@elyra/canvas 12.35.0 → 12.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{canvas-controller-c9f3bef9.js → canvas-controller-7beb80ec.js} +2 -2
- package/dist/{canvas-controller-f7820ab0.js.map → canvas-controller-7beb80ec.js.map} +1 -1
- package/dist/{canvas-controller-f7820ab0.js → canvas-controller-b70d0f98.js} +2 -2
- package/dist/{canvas-controller-c9f3bef9.js.map → canvas-controller-b70d0f98.js.map} +1 -1
- package/dist/{common-canvas-487520d3.js → common-canvas-86fb7d21.js} +2 -2
- package/dist/{common-canvas-487520d3.js.map → common-canvas-86fb7d21.js.map} +1 -1
- package/dist/{common-canvas-e1591f51.js → common-canvas-a6bfce5e.js} +2 -2
- package/dist/{common-canvas-e1591f51.js.map → common-canvas-a6bfce5e.js.map} +1 -1
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-a34905c3.js +2 -0
- package/dist/common-properties-a34905c3.js.map +1 -0
- package/dist/common-properties-d5775a12.js +2 -0
- package/dist/common-properties-d5775a12.js.map +1 -0
- package/dist/lib/canvas-controller.es.js +1 -1
- package/dist/lib/canvas-controller.js +1 -1
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/package.json +2 -2
- package/src/common-canvas/canvas-controller.js +8 -6
- package/src/common-canvas/cc-contents.jsx +2 -2
- package/src/common-canvas/svg-canvas-renderer.js +31 -18
- package/src/common-properties/common-properties.jsx +2 -0
- package/src/common-properties/components/editor-form/editor-form.jsx +5 -1
- package/src/common-properties/properties-main/properties-main.jsx +2 -0
- package/src/notification-panel/notification-panel.scss +10 -6
- package/src/palette/palette.scss +4 -4
- package/stats.html +1 -1
- package/dist/common-properties-580436d7.js +0 -2
- package/dist/common-properties-580436d7.js.map +0 -1
- package/dist/common-properties-98a9a99f.js +0 -2
- package/dist/common-properties-98a9a99f.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./createClass-09bc08f7.js"),t=require("./isArrayLikeObject-0cd02b77.js"),n=require("./getPrototypeOf-5f227292.js"),i=require("./datarecord-metadata-v3-schema-531c7b07.js"),o=require("./canvas-constants-85883d4c.js"),r=require("./lib/command-stack.js"),a=require("./canvas-logger-34ca361a.js"),s=require("uuid"),d=require("redux"),c=require("jsonschema"),l=require("@elyra/pipeline-schemas"),u={"menu.highlightBranch":"Highlight branch","menu.highlightUpstream":"Highlight upstream","menu.highlightDownstream":"Highlight downstream","menu.unhighlight":"Unhighlight","menu.highlight":"Highlight","edit.cutSelection":"Cut","edit.copySelection":"Copy","edit.pasteSelection":"Paste","canvas.label":"Canvas","canvas.addComment":"New comment","canvas.selectAll":"Select all","canvas.undo":"Undo","canvas.redo":"Redo","canvas.undoCommand":"Undo: {undo_command}","canvas.redoCommand":"Redo: {redo_command}","canvas.deleteObject":"Delete","canvas.flowIsEmpty":"Your flow is empty.","canvas.addNodeToStart":"Get started by adding a node.","canvas.stateTagLocked":"Locked","canvas.stateTagReadOnly":"Read-only","canvas.stateTagTipLocked":"This flow is locked and cannot be edited.","canvas.stateTagTipReadOnly":"This flow cannot be edited.","comment.colorBackground":"Color background","comment.editComment":"Edit comment","node.createSupernode":"Create supernode","node.createSupernodeExternal":"Create external supernode","node.expandSupernode":"Expand supernode","node.displaySupernodeFullPage":"Display full page","node.collapseSupernodeInPlace":"Collapse supernode","node.deconstructSupernode":"Deconstruct supernode","node.convertSupernodeExternalToLocal":"Convert external to local","node.convertSupernodeLocalToExternal":"Convert local to external","node.renameNode":"Rename","canvas.validateFlow":"Validate Flow","node.editNode":"Open","node.editMenu":"Edit","node.disconnectNode":"Disconnect","node.saveToPalette":"Save to palette","link.deleteLink":"Delete","texttoolbar.headerAction":"Header","texttoolbar.boldAction":"Bold","texttoolbar.italicsAction":"Italics","texttoolbar.strikethroughAction":"Strikethrough","texttoolbar.codeAction":"Code","texttoolbar.linkAction":"Link","texttoolbar.quoteAction":"Quote","texttoolbar.bulletedListAction":"Bulleted List","texttoolbar.numberedListAction":"Numbered List","texttoolbar.titleAction":"Title","texttoolbar.subheaderAction":"Subheader","texttoolbar.bodyAction":"Body"};function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var h=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"getObjectPositions",value:function(e){var t={};return e.forEach((function(e){t[e.id]={x_pos:e.x_pos,y_pos:e.y_pos}})),t}},{key:"getLinkPositions",value:function(e){var t={};return e.forEach((function(e){e.srcPos&&(i.set_1(t[e.id],"srcPos.x_pos",e.srcPos.x_pos),i.set_1(t[e.id],"srcPos.y_pos",e.srcPos.y_pos)),e.trgPos&&(t[e.id]||(t[e.id]={}),i.set_1(t[e.id],"trgPos.x_pos",e.trgPos.x_pos),i.set_1(t[e.id],"trgPos.y_pos",e.trgPos.y_pos))})),t}},{key:"moveSurroundingObjects",value:function(e,t,n,i,o,r){var a=this,s={},d=i-e.width,c=o-e.height,l=e.x_pos+e.width/2,u=e.y_pos+e.height/2;return t.forEach((function(t){if(t.id!==e.id){var i=a.getMoveDeltas(t.x_pos+t.width/2,t.y_pos+t.height/2,n,l,u,d,c);0===i.xDelta&&0===i.yDelta||(s[t.id]={id:t.id,x_pos:t.x_pos+i.xDelta,y_pos:t.y_pos+i.yDelta,width:t.width,height:t.height},r&&(t.x_pos+=i.xDelta,t.y_pos+=i.yDelta))}})),s}},{key:"moveSurroundingDetachedLinks",value:function(e,t,n,o,r,a){var s=this,d={},c=o-e.width,l=r-e.height,u=e.x_pos+e.width/2,p=e.y_pos+e.height/2;return t.forEach((function(e){if(e.srcPos){var t=s.getMoveDeltas(e.srcPos.x_pos,e.srcPos.y_pos,n,u,p,c,l);0===t.xDelta&&0===t.yDelta||(d[e.id]||(d[e.id]={id:e.id}),i.set_1(d[e.id],"srcPos.x_pos",e.srcPos.x_pos+t.xDelta),i.set_1(d[e.id],"srcPos.y_pos",e.srcPos.y_pos+t.yDelta),a&&(e.srcPos.x_pos+=t.xDelta,e.srcPos.y_pos+=t.yDelta))}if(e.trgPos){var o=s.getMoveDeltas(e.trgPos.x_pos,e.trgPos.y_pos,n,u,p,c,l);0===o.xDelta&&0===o.yDelta||(d[e.id]||(d[e.id]={id:e.id}),i.set_1(d[e.id],"trgPos.x_pos",e.trgPos.x_pos+o.xDelta),i.set_1(d[e.id],"trgPos.y_pos",e.trgPos.y_pos+o.yDelta)),a&&(e.trgPos.x_pos+=o.xDelta,e.trgPos.y_pos+=o.yDelta)}})),d}},{key:"getMoveDeltas",value:function(e,t,n,i,o,r,a){var s=0,d=0;return n.indexOf("n")>-1&&t<o-20?d=-a:n.indexOf("s")>-1&&t>o+20&&(d=a),n.indexOf("w")>-1&&e<i-20?s=-r:n.indexOf("e")>-1&&e>i+20&&(s=r),{xDelta:s,yDelta:d}}},{key:"getSupernodeExpandedWidth",value:function(e,t){return e.expanded_width?e.expanded_width:Math.max(t.supernodeDefaultWidth,e.width)}},{key:"getSupernodeExpandedHeight",value:function(e,t){return e.expanded_height?e.expanded_height:Math.max(t.supernodeDefaultHeight,e.height)}},{key:"getNodePaddingToTargetNodes",value:function(e,t,n,i){var o=0;if("Elbow"===i){var r=this.getCountOfLinksToTargetNodes(e,t,n)*e.layout.minInitialLineIncrement;o=e.layout.minInitialLine+e.layout.minFinalLine+r}else o=2*e.layout.minInitialLine;return o}},{key:"getCountOfLinksToTargetNodes",value:function(e,t,n){var i=this,o=0;return e.outputs&&e.outputs.length>0&&e.outputs.forEach((function(r){i.isNodeOutputLinkedToTargetNodes(e,r,t,n)&&o++})),o}},{key:"isNodeOutputLinkedToTargetNodes",value:function(e,t,n,i){var o=this,r=!1;return i.forEach((function(i){i.srcNodeId===e.id&&i.srcNodePortId===t.id&&o.isTargetNode(i.trgNodeId,n)&&(r=!0)})),r}},{key:"isTargetNode",value:function(e,t){return t.findIndex((function(t){return t.id===e}))>-1}},{key:"getCombinedDecorations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.map((function(e){var n=t.find((function(t){return t.id===e.id}));return n?Object.assign({},e,n):e}));return t&&t.forEach((function(t){-1===e.findIndex((function(e){return e.id===t.id}))&&n.push(t)})),n}},{key:"isCmndCtrlPressed",value:function(e){return this.isMacintosh()?e.metaKey:e.ctrlKey}},{key:"isMacintosh",value:function(){return navigator.platform.indexOf("Mac")>-1}},{key:"stopPropagationAndPreventDefault",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"snapToGrid",value:function(e,t){var n=e/t,i=Math.trunc(n);return n-i>.5&&i++,i*t}},{key:"getOuterCoord",value:function(e,t,n,i,o,r,a,s,d){var c,l,u=t-o,p=e-o,f=e+n+o,h=t+i+o,g=a-u,y=r-p,m=h-a,_=r-s,v=a-d;if(0===_)c=r,l=d<a?u:h;else if(s>r){var b=v/_;b<g/(r-f)?(c=r-g/b,l=u):b>(a-h)/(r-f)?(c=r+m/b,l=h):(c=f,l=a+(f-r)*b)}else{var P=v/_;P>g/y?(c=r-g/P,l=u):P<(a-h)/y?(c=r+m/P,l=h):(c=p,l=a-y*P)}return{x:c,y:l,originX:r,originY:a}}},{key:"getDir",value:function(e,t,n,i,r,a,s,d){var c=t+i,l=a-t,u=r-e,p=r-s,f=a-d,h="";if(0===p)h=d<a?o.NORTH:o.SOUTH;else if(s>r){var g=e+n,y=(a-c)/(r-g),m=f/p;h=m<l/(r-g)?o.NORTH:m>y?o.SOUTH:o.EAST}else{var _=(a-c)/u,v=f/p;h=v>l/u?o.NORTH:v<_?o.SOUTH:o.WEST}return h}},{key:"lineIntersectRectangle",value:function(e,t,n,i,o,r,a,s){var d=this.lineInside(e,t,n,i,o,r,a,s),c=this.linesIntersect(e,t,n,i,o,r,a,r),l=this.linesIntersect(e,t,n,i,o,r,o,s),u=this.linesIntersect(e,t,n,i,a,r,a,s),p=this.linesIntersect(e,t,n,i,o,s,a,s);return d||c||l||u||p}},{key:"lineInside",value:function(e,t,n,i,o,r,a,s){return e>=o&&e<=a&&t>=r&&t<=s&&n>=o&&n<=a&&i>=r&&i<=s}},{key:"linesIntersect",value:function(e,t,n,i,o,r,a,s){var d=((a-o)*(t-r)-(s-r)*(e-o))/((s-r)*(n-e)-(a-o)*(i-t)),c=((n-e)*(t-r)-(i-t)*(e-o))/((s-r)*(n-e)-(a-o)*(i-t));return d>=0&&d<=1&&c>=0&&c<=1?{x:e+d*(n-e),y:t+d*(i-t)}:null}},{key:"isConnectionAllowed",value:function(e,t,n,i,r,a){return a===o.ASSOCIATION_LINK?this.isAssocConnectionAllowed(n,i,r):this.isDataConnectionAllowed(e,t,n,i,r)}},{key:"isConnectionAllowedWithDetachedLinks",value:function(e,t,n,i,o){return(!n||!i||n.id!==i.id)&&!(n&&i&&this.linkAlreadyExists(e,t,n,i,o))}},{key:"isSrcConnectionAllowedWithDetachedLinks",value:function(e,t,n){return!(t&&!this.doesNodeHaveOutputPorts(t))&&(!t||!this.isSrcCardinalityAtMax(e,t,n))}},{key:"isTrgConnectionAllowedWithDetachedLinks",value:function(e,t,n){return!(t&&!this.doesNodeHaveInputPorts(t))&&(!t||!this.isTrgCardinalityAtMax(e,t,n))}},{key:"doesNodeHaveInputPorts",value:function(e){return e.inputs&&e.inputs.length>0}},{key:"doesNodeHaveOutputPorts",value:function(e){return e.outputs&&e.outputs.length>0}},{key:"isDataLinkReplacementAllowed",value:function(e,t,n,i,o){return!!this.isDataConnectionAllowedNoCardinality(e,t,n,i,o)&&(1===this.getMaxCardinality(t,i.inputs)&&!!this.isTrgCardinalityAtMax(t,i,o))}},{key:"isDataConnectionAllowed",value:function(e,t,n,i,o){return!!this.isDataConnectionAllowedNoCardinality(e,t,n,i,o)&&!this.isCardinalityAtMax(e,t,n,i,o)}},{key:"isDataConnectionAllowedNoCardinality",value:function(e,t,n,i,o){return!(!n||!i)&&(n.id!==i.id&&(!!this.doesNodeHaveInputPorts(i)&&!this.linkAlreadyExists(e,t,n,i,o)))}},{key:"isAssocConnectionAllowed",value:function(e,t,n){return!(!e||!t)&&e.id!==t.id}},{key:"isSrcNodeAvailable",value:function(e,t,n,i){return!(!t||t.id!==e.id)||!!this.doesNodeHaveOutputPorts(e)&&!this.areAllSrcNodePortsCardinalityAtMax(e,i)}},{key:"isTrgNodeAvailable",value:function(e,t,n,i){return!(!t||t.id!==e.id)||!!this.doesNodeHaveInputPorts(e)&&!this.areAllTrgNodePortsCardinalityAtMax(e,i)}},{key:"linkAlreadyExists",value:function(e,t,n,i,o){var r=!1;return o.forEach((function(o){o.srcNodeId!==n.id||o.srcNodePortId&&o.srcNodePortId!==e||o.trgNodeId!==i.id||o.trgNodePortId&&o.trgNodePortId!==t||(r=!0)})),r}},{key:"areAllSrcNodePortsCardinalityAtMax",value:function(e,t){var n=this;return!(!e||!e.outputs)&&-1===e.outputs.findIndex((function(i){return!n.isSrcCardinalityAtMax(i.id,e,t)}))}},{key:"areAllTrgNodePortsCardinalityAtMax",value:function(e,t){var n=this;return!(!e||!e.inputs)&&-1===e.inputs.findIndex((function(i){return!n.isTrgCardinalityAtMax(i.id,e,t)}))}},{key:"hasInputAndOutputPorts",value:function(e){return this.isNode(e)&&e.inputs&&e.inputs.length>0&&e.outputs&&e.outputs.length>0}},{key:"isNodeDefaultPortsCardinalityAtMax",value:function(e,t){return this.isCardinalityAtMax(null,null,e,e,t)}},{key:"isCardinalityAtMax",value:function(e,t,n,i,o){return this.isSrcCardinalityAtMax(e,n,o)||this.isTrgCardinalityAtMax(t,i,o)}},{key:"isSrcCardinalityAtMax",value:function(e,t,n){var i=this,r=e||this.getDefaultOutputPortId(t),a=0;n.forEach((function(e){e.type===o.NODE_LINK&&e.srcNodeId===t.id&&r&&(e.srcNodePortId===r||!e.srcNodePortId&&i.isFirstPort(t.outputs,r))&&a++}));var s=this.getMaxCardinality(r,t.outputs);return null!==s&&-1!==s&&a>=s}},{key:"isTrgCardinalityAtMax",value:function(e,t,n){var i=this,r=e||this.getDefaultInputPortId(t),a=0;n.forEach((function(e){e.type===o.NODE_LINK&&e.trgNodeId===t.id&&r&&(e.trgNodePortId===r||!e.trgNodePortId&&i.isFirstPort(t.inputs,r))&&a++}));var s=this.getMaxCardinality(r,t.inputs);return null!==s&&-1!==s&&a>=s}},{key:"isFirstPort",value:function(e,t){return 0===e.findIndex((function(e){return e.id===t}))}},{key:"getPort",value:function(e,t){if(t&&t.length>0){var n=t.findIndex((function(t){return t.id===e}));if(n>-1)return t[n]}return null}},{key:"getMaxCardinality",value:function(e,t){var n=this.getPort(e,t);return n&&n.cardinality?Number(n.cardinality.max):null}},{key:"isCommentLinkConnectionAllowed",value:function(e,t,n){return!this.commentLinkAlreadyExists(e,t,n)}},{key:"commentLinkAlreadyExists",value:function(e,t,n){var i=!1;return n.forEach((function(n){n.srcNodeId===e&&n.trgNodeId===t&&(i=!0)})),i}},{key:"getDetachedLinksToUpdate",value:function(e,t,n){var i=this,o=[],r=[];return t.forEach((function(t){if(t.nodeOverSrcPos&&t.srcPos&&e.outputs&&e.outputs.length>0){var a=!1;e.outputs.forEach((function(s){if(!1===a&&i.isSrcConnectionAllowedWithDetachedLinks(s.id,e,i.getReplacedLinks(n,o))){var d=Object.assign({},t,{srcNodeId:e.id,srcNodePortId:s.id});delete d.srcPos,o.push(d),r.push(t),a=!0}}))}else if(t.nodeOverTrgPos&&t.trgPos&&e.inputs&&e.inputs.length>0){var s=!1;e.inputs.forEach((function(a){if(!1===s&&i.isTrgConnectionAllowedWithDetachedLinks(a.id,e,i.getReplacedLinks(n,o))){var d=Object.assign({},t,{trgNodeId:e.id,trgNodePortId:a.id});delete d.trgPos,o.push(d),r.push(t),s=!0}}))}})),{newLinks:o,oldLinks:r}}},{key:"getReplacedLinks",value:function(e,t){return e.map((function(e){var n=t.findIndex((function(t){return t.id===e.id}));return n>-1?t[n]:e}))}},{key:"selectInRegion",value:function(e,t,n,i,r){var a,s=[],d=p(t.nodes);try{for(d.s();!(a=d.n()).done;){var c=a.value;!this.isSuperBindingNode(c)&&e.x1<c.x_pos+c.width&&e.x2>c.x_pos&&e.y1<c.y_pos+c.height&&e.y2>c.y_pos&&s.push(c.id)}}catch(e){d.e(e)}finally{d.f()}var l,u=p(t.comments);try{for(u.s();!(l=u.n()).done;){var f=l.value;e.x1<f.x_pos+f.width&&e.x2>f.x_pos&&e.y1<f.y_pos+f.height&&e.y2>f.y_pos&&s.push(f.id)}}catch(e){u.e(e)}finally{u.f()}if(n){var h,g=p(t.links);try{for(g.s();!(h=g.n()).done;){var y=h.value;y.type===o.NODE_LINK&&i===o.LINK_TYPE_STRAIGHT||y.type===o.COMMENT_LINK||y.type===o.ASSOCIATION_LINK&&r===o.ASSOC_STRAIGHT?this.lineIntersectRectangle(y.x1,y.y1,y.x2,y.y2,e.x1,e.y1,e.x2,e.y2)&&s.push(y.id):(this.isPosInArea({x_pos:y.x1,y_pos:y.y1},e,0)||this.isPosInArea({x_pos:y.x2,y_pos:y.y2},e,0))&&s.push(y.id)}}catch(e){g.e(e)}finally{g.f()}}return s}},{key:"isPosInArea",value:function(e,t,n){return e.x_pos>t.x1-n&&e.x_pos<t.x2+n&&e.y_pos>t.y1-n&&e.y_pos<t.y2+n}},{key:"isNode",value:function(e){return e.type}},{key:"isSupernode",value:function(e){return e.type===o.SUPER_NODE}},{key:"isExpanded",value:function(e){return!0===e.is_expanded}},{key:"isExpandedSupernode",value:function(e){return this.isSupernode(e)&&this.isExpanded(e)}},{key:"isCollapsedSupernode",value:function(e){return this.isSupernode(e)&&!this.isExpanded(e)}},{key:"isSuperBindingNode",value:function(e){return e.isSupernodeInputBinding||e.isSupernodeOutputBinding}},{key:"getCanvasDimensions",value:function(e,t,n,i,o,r){var a=this,s=1/0,d=1/0,c=-1/0,l=-1/0;return e&&e.forEach((function(e){if(!a.isSuperBindingNode(e)){var t=0===o?0:e.layout.nodeHighlightGap;s=Math.min(s,e.x_pos-t),d=Math.min(d,e.y_pos-t),c=Math.max(c,e.x_pos+e.width+t),l=Math.max(l,e.y_pos+e.height+t)}})),t&&t.forEach((function(e){s=Math.min(s,e.x_pos-i),d=Math.min(d,e.y_pos-i),c=Math.max(c,e.x_pos+e.width+i),l=Math.max(l,e.y_pos+e.height+i)})),n&&n.forEach((function(e){r?(s=Math.min(s,e.x1),d=Math.min(d,e.y1),c=Math.max(c,e.x1),l=Math.max(l,e.y1),s=Math.min(s,e.x2),d=Math.min(d,e.y2),c=Math.max(c,e.x2),l=Math.max(l,e.y2)):(e.srcPos&&(s=Math.min(s,e.srcPos.x_pos),d=Math.min(d,e.srcPos.y_pos),c=Math.max(c,e.srcPos.x_pos),l=Math.max(l,e.srcPos.y_pos)),e.trgPos&&(s=Math.min(s,e.trgPos.x_pos),d=Math.min(d,e.trgPos.y_pos),c=Math.max(c,e.trgPos.x_pos),l=Math.max(l,e.trgPos.y_pos)))})),s===1/0||d===1/0||c===-1/0||l===-1/0?{left:0,top:0,right:0,bottom:0,width:0,height:0}:{left:s,top:d,right:c,bottom:l,width:c-s,height:l-d}}},{key:"getDataLinksConnectedTo",value:function(e,t,n){var i=this.getDefaultInputPortId(t);return n.filter((function(n){if(n.type===o.NODE_LINK){var r=n.trgNodePortId||i;return n.trgNodeId===t.id&&r===e}return!1}))}},{key:"getDefaultInputPortId",value:function(e){return e.inputs&&e.inputs.length>0?e.inputs[0].id:null}},{key:"getDefaultOutputPortId",value:function(e){return e.outputs&&e.outputs.length>0?e.outputs[0].id:null}},{key:"getObjectStyle",value:function(e,t,n){if(!e.style&&!e.style_temp)return null;var i=null;return"hover"===n?i=this.getStyleValue(e,t,"default")+";"+this.getStyleValue(e,t,"hover"):"default"===n&&(i=this.getStyleValue(e,t,"default")),i}},{key:"getStyleValue",value:function(e,n,i){var o=t.get_1(e,"style_temp.".concat(n,".").concat(i),null);return null!==o?o:t.get_1(e,"style.".concat(n,".").concat(i),null)}},{key:"filterSupernodes",value:function(e){return e.filter((function(e){return e.type===o.SUPER_NODE}))}},{key:"getSrcPos",value:function(e,t){var n,i;if(e.trgNodeId){var o=t.getNode(e.trgNodeId);n=o.x_pos+o.width/2,i=o.y_pos+o.height/2}else n=e.trgPos.x_pos,i=e.trgPos.y_pos;var r,a,s=t.getNode(e.srcNodeId);s.layout&&"image_center"===s.layout.drawNodeLinkLineFromTo?(r=s.x_pos+s.layout.imagePosX+s.layout.imageWidth/2,a=s.y_pos+s.layout.imagePosY+s.layout.imageHeight/2):(r=s.x_pos+s.width/2,a=s.y_pos+s.height/2);var d=this.getOuterCoord(s.x_pos,s.y_pos,s.width,s.height,0,r,a,n,i);return{x_pos:d.x,y_pos:d.y}}},{key:"getTrgPos",value:function(e,t){var n,i;if(e.srcNodeId){var o=t.getNode(e.srcNodeId);n=o.x_pos+o.width/2,i=o.y_pos+o.height/2}else n=e.srcPos.x_pos,i=e.srcPos.y_pos;var r,a,s=t.getNode(e.trgNodeId);s.layout&&"image_center"===s.layout.drawNodeLinkLineFromTo?(r=s.x_pos+s.layout.imagePosX+s.layout.imageWidth/2,a=s.y_pos+s.layout.imagePosY+s.layout.imageHeight/2):(r=s.x_pos+s.width/2,a=s.y_pos+s.height/2);var d=this.getOuterCoord(s.x_pos,s.y_pos,s.width,s.height,0,r,a,n,i);return{x_pos:d.x,y_pos:d.y}}},{key:"concatUniqueBasedOnId",value:function(e,t){var n=t;return e.forEach((function(e){t.some((function(t){return t.id===e.id}))||n.push(e)})),n}},{key:"getBkgColorClass",value:function(e){return"bkg-col-white-0"===e||"bkg-col-yellow-20"===e||"bkg-col-gray-20"===e||"bkg-col-green-20"===e||"bkg-col-teal-20"===e||"bkg-col-cyan-20"===e||"bkg-col-red-50"===e||"bkg-col-orange-40"===e||"bkg-col-gray-50"===e||"bkg-col-green-50"===e||"bkg-col-teal-50"===e||"bkg-col-cyan-50"===e?e:null}},{key:"getParentElementWithClass",value:function(e,t){for(var n=e,i=null;n;)this.isClassNameIncluded(n,"d3-new-connection-guide")||this.isClassNameIncluded(n,"svg-area")?n=null:this.isClassNameIncluded(n,t)?(i=n,n=null):n=n.parentNode;return i}},{key:"isClassNameIncluded",value:function(e,t){return e.classList&&e.classList.contains(t)}}]),n}(),g=t.identity_1;var y=function(e){return"function"==typeof e?e:g},m=t._baseIsMatch,_=t._getMatchData;var v=function(e,t,n){return n="function"==typeof n?n:void 0,m(e,t,_(t),n)},b=t._baseIsMatch,P=t._getMatchData;var k=function(e,t){return e===t||b(e,t,P(t))},I={nodeLayout:{defaultNodeWidth:160,defaultNodeHeight:40,className:"",nodeShapeDisplay:!0,nodeShape:"port-arcs",bodyPath:null,selectionPath:null,nodeExternalObject:!1,imageDisplay:!0,imageWidth:26,imageHeight:26,imagePosition:"topLeft",imagePosX:6,imagePosY:7,labelDisplay:!0,labelWidth:112,labelHeight:19,labelPosition:"topLeft",labelPosX:36,labelPosY:12,labelEditable:!1,labelAlign:"left",labelSingleLine:!0,labelOutline:!1,labelMaxCharacters:null,labelAllowReturnKey:!1,decorations:[],decoratorTopY:2,decoratorMiddleY:-8,decoratorBottomY:-18,decoratorLeftX:2,decoratorCenterX:-8,decoratorRightX:-30,decoratorWidth:16,decoratorHeight:16,decoratorPadding:2,decoratorLabelWidth:80,decoratorLabelHeight:30,dropShadow:!0,nodeHighlightGap:1,nodeSizingArea:10,errorPosition:"topLeft",errorXPos:24,errorYPos:5,errorWidth:10.5,errorHeight:10.5,nodeCornerResizeArea:10,drawNodeLinkLineFromTo:"node_center",drawCommentLinkLineTo:"node_center",minInitialLine:30,minInitialLineIncrement:8,minFinalLine:30,inputPortDisplay:!0,inputPortObject:"circle",inputPortImage:"",inputPortWidth:12,inputPortHeight:12,inputPortLeftPosX:0,inputPortLeftPosY:20,inputPortTopPosX:80,inputPortTopPosY:0,inputPortBottomPosX:80,inputPortBottomPosY:0,inputPortGuideObject:"circle",inputPortGuideImage:"",outputPortDisplay:!0,outputPortObject:"circle",outputPortImage:"",outputPortWidth:12,outputPortHeight:12,outputPortRightPosition:"topRight",outputPortRightPosX:0,outputPortRightPosY:20,outputPortTopPosX:80,outputPortTopPosY:0,outputPortBottomPosX:80,outputPortBottomPosY:0,outputPortGuideObject:"circle",outputPortGuideImage:"",autoSizeNode:!0,portRadius:3,portArcOffset:3,portArcRadius:6,portArcSpacing:3,contextToolbarPosition:"topRight",ellipsisDisplay:!0,ellipsisPosition:"topLeft",ellipsisWidth:10,ellipsisHeight:22,ellipsisPosX:145,ellipsisPosY:9,ellipsisHoverAreaPadding:2},canvasLayout:{supernodeLabelPosX:30,supernodeLabelPosY:4,supernodeLabelWidth:50,supernodeLabelHeight:20,supernodeImageWidth:18,supernodeImageHeight:18,supernodeImagePosX:5,supernodeImagePosY:4,supernodeEllipsisPosX:-34,supernodeEllipsisPosY:2,supernodeEllipsisWidth:10,supernodeEllipsisHeight:20,supernodeExpansionIconPosX:-21,supernodeExpansionIconPosY:4,supernodeExpansionIconHeight:18,supernodeExpansionIconWidth:18,supernodeExpansionIconHoverAreaPadding:2,supernodeErrorPosX:-50,supernodeErrorPosY:5,supernodeErrorWidth:14,supernodeErrorHeight:14,supernodeDefaultWidth:300,supernodeDefaultHeight:200,supernodeMinWidth:100,supernodeMinHeight:80,supernodeTopAreaHeight:25,supernodeSVGAreaPadding:3,supernodeBindingPortRadius:6,linkDirection:"LeftRight",displayLinkOnOverlap:!0,linkGap:7,linkDecoratorHeight:20,linkDecoratorWidth:20,linkDecoratorPadding:2,linkDecoratorLabelWidth:80,linkDecoratorLabelHeight:30,elbowSize:10,wrapAroundSpacing:20,wrapAroundNodePadding:10,linkType:"Curve",commentLinkArrowHead:!1,dataLinkArrowHead:!1,linkStartHandleObject:"circle",linkStartHandleImage:"",linkStartHandleWidth:12,linkStartHandleHeight:12,linkStartHandleRadius:5,linkEndHandleObject:"circle",linkEndHandleImage:"",linkEndHandleWidth:12,linkEndHandleHeight:12,linkEndHandleRadius:5,commentCornerResizeArea:10,commentHighlightGap:1,commentSizingArea:10,addCommentOffsetX:30,addCommentOffsetY:50,commentPortRadius:5,commentToolbarPosX:-2,commentToolbarPosY:-36,alwaysDisplayBackToParentFlow:!1,zoomToFitPadding:10,snapToGridType:"None",snapToGridX:"20%",snapToGridY:"33.33%",nodeProximity:20,ghostAreaPadding:10,initialPanX:null,initialPanY:null,autoLayoutInitialMarginX:50,autoLayoutInitialMarginY:50,autoLayoutVerticalSpacing:80,autoLayoutHorizontalSpacing:80}},N={nodeLayout:{defaultNodeWidth:70,defaultNodeHeight:75,className:"",nodeShapeDisplay:!0,nodeShape:"rectangle",bodyPath:null,selectionPath:null,nodeExternalObject:!1,imageDisplay:!0,imageWidth:48,imageHeight:48,imagePosition:"topLeft",imagePosX:11,imagePosY:6,labelDisplay:!0,labelWidth:72,labelHeight:19,labelPosition:"topLeft",labelPosX:35,labelPosY:55,labelEditable:!1,labelAlign:"center",labelSingleLine:!0,labelOutline:!1,labelMaxCharacters:null,labelAllowReturnKey:!1,decorations:[],decoratorTopY:5,decoratorMiddleY:-8,decoratorBottomY:-34,decoratorLeftX:10,decoratorCenterX:-8,decoratorRightX:-24,decoratorWidth:16,decoratorHeight:16,decoratorPadding:2,decoratorLabelWidth:80,decoratorLabelHeight:30,dropShadow:!1,nodeHighlightGap:4,nodeSizingArea:10,errorPosition:"topLeft",errorXPos:45,errorYPos:5,errorWidth:14,errorHeight:14,nodeCornerResizeArea:10,drawNodeLinkLineFromTo:"node_center",drawCommentLinkLineTo:"node_center",minInitialLine:30,minInitialLineIncrement:8,minFinalLine:30,inputPortDisplay:!0,inputPortObject:"circle",inputPortImage:"",inputPortWidth:12,inputPortHeight:12,inputPortLeftPosX:0,inputPortLeftPosY:29,inputPortTopPosX:35,inputPortTopPosY:0,inputPortBottomPosX:35,inputPortBottomPosY:0,inputPortGuideObject:"circle",inputPortGuideImage:"",outputPortDisplay:!0,outputPortObject:"circle",outputPortImage:"",outputPortWidth:12,outputPortHeight:12,outputPortRightPosition:"topRight",outputPortRightPosX:0,outputPortRightPosY:29,outputPortTopPosX:35,outputPortTopPosY:0,outputPortBottomPosX:35,outputPortBottomPosY:0,outputPortGuideObject:"circle",outputPortGuideImage:"",autoSizeNode:!0,portRadius:6,portArcOffset:0,portArcRadius:10,portArcSpacing:0,contextToolbarPosition:"topCenter",ellipsisDisplay:!0,ellipsisPosition:"topLeft",ellipsisWidth:11,ellipsisHeight:21,ellipsisPosX:57,ellipsisPosY:4,ellipsisHoverAreaPadding:2},canvasLayout:{supernodeLabelPosX:30,supernodeLabelPosY:4,supernodeLabelWidth:50,supernodeLabelHeight:20,supernodeImageWidth:18,supernodeImageHeight:18,supernodeImagePosX:5,supernodeImagePosY:4,supernodeEllipsisPosX:-34,supernodeEllipsisPosY:2,supernodeEllipsisWidth:10,supernodeEllipsisHeight:20,supernodeExpansionIconPosX:-21,supernodeExpansionIconPosY:4,supernodeExpansionIconHeight:18,supernodeExpansionIconWidth:18,supernodeExpansionIconHoverAreaPadding:2,supernodeErrorPosX:-50,supernodeErrorPosY:5,supernodeErrorWidth:14,supernodeErrorHeight:14,supernodeDefaultWidth:200,supernodeDefaultHeight:200,supernodeMinWidth:100,supernodeMinHeight:80,supernodeTopAreaHeight:25,supernodeSVGAreaPadding:3,supernodeBindingPortRadius:10,linkDirection:"LeftRight",displayLinkOnOverlap:!0,linkGap:7,linkDecoratorHeight:20,linkDecoratorWidth:20,linkDecoratorPadding:2,linkDecoratorLabelWidth:80,linkDecoratorLabelHeight:30,elbowSize:10,wrapAroundSpacing:20,wrapAroundNodePadding:10,linkType:"Curve",commentLinkArrowHead:!1,dataLinkArrowHead:!1,linkStartHandleObject:"circle",linkStartHandleImage:"",linkStartHandleWidth:12,linkStartHandleHeight:12,linkStartHandleRadius:6,linkEndHandleObject:"circle",linkEndHandleImage:"",linkEndHandleWidth:12,linkEndHandleHeight:12,linkEndHandleRadius:6,commentCornerResizeArea:10,commentHighlightGap:4,commentSizingArea:10,addCommentOffsetX:30,addCommentOffsetY:50,commentPortRadius:5,commentToolbarPosX:-2,commentToolbarPosY:-36,alwaysDisplayBackToParentFlow:!1,zoomToFitPadding:10,snapToGridType:"None",snapToGridX:"25%",snapToGridY:"20%",nodeProximity:20,ghostAreaPadding:10,initialPanX:null,initialPanY:null,autoLayoutInitialMarginX:50,autoLayoutInitialMarginY:50,autoLayoutVerticalSpacing:80,autoLayoutHorizontalSpacing:80}},E=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"getLayout",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getDefaultLayout(e);return e&&(n=this.overrideNodeLayout(n,t),n=this.overrideCanvasLayout(n,e,t),n=this.overrideLinkType(n,e),n=this.overrideSnapToGrid(n,e),n=this.overrideAutoLayout(n,e)),n}},{key:"getDefaultLayout",value:function(e){var t;return t=e&&"Vertical"===e.enableNodeFormatType?N:I,Object.assign({},t)}},{key:"overrideNodeLayout",value:function(e,t){return e.nodeLayout=Object.assign({},e.nodeLayout,t.nodeLayout||{}),e}},{key:"overrideCanvasLayout",value:function(e,t,n){return e.canvasLayout=Object.assign({},e.canvasLayout,{linkDirection:t.enableLinkDirection},n.canvasLayout||{}),e}},{key:"overrideLinkType",value:function(e,t){return e.canvasLayout.linkType=t.enableLinkType||e.canvasLayout.linkType||"Curve",e}},{key:"overrideSnapToGrid",value:function(e,t){return t.enableSnapToGridType&&(e.canvasLayout.snapToGridType=t.enableSnapToGridType),e.canvasLayout.snapToGridX=t.enableSnapToGridX||e.canvasLayout.snapToGridX||"25%",e.canvasLayout.snapToGridY=t.enableSnapToGridY||e.canvasLayout.snapToGridY||"20%",e.canvasLayout.snapToGridXPx=this.getSnapToGridSize(e.canvasLayout.snapToGridX,e.nodeLayout.defaultNodeWidth),e.canvasLayout.snapToGridYPx=this.getSnapToGridSize(e.canvasLayout.snapToGridY,e.nodeLayout.defaultNodeHeight),e}},{key:"overrideAutoLayout",value:function(e,t){return e.canvasLayout.autoLayoutVerticalSpacing=this.getAutoLayoutSpacing(t.enableAutoLayoutVerticalSpacing,e.canvasLayout.autoLayoutVerticalSpacing),e.canvasLayout.autoLayoutHorizontalSpacing=this.getAutoLayoutSpacing(t.enableAutoLayoutHorizontalSpacing,e.canvasLayout.autoLayoutHorizontalSpacing),e}},{key:"getAutoLayoutSpacing",value:function(e,t){var n=80;return null!=e?n=e:null!=t&&(n=t),n}},{key:"getSnapToGridSize",value:function(e,t){return e.endsWith("%")?Number.parseInt(e,10)/100*t:Number.parseInt(e,10)}}]),t}(),S=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"mergeCanvasConfigs",value:function(e,t){var n=Object.assign({},e,t||{});if(t){var i=E.getLayout(n,{nodeLayout:t.enableNodeLayout,canvasLayout:t.enableCanvasLayout}),o=Object.assign({},e.tipConfig,t.tipConfig);n=Object.assign({},n,{enableNodeLayout:i.nodeLayout,enableCanvasLayout:i.canvasLayout,tipConfig:o})}return n}},{key:"getDefaultCanvasConfig",value:function(){var e={enableInteractionType:"Mouse",enableNodeFormatType:"Horizontal",enableLinkType:"Curve",enableLinkDirection:"LeftRight",enableLinkSelection:o.LINK_SELECTION_NONE,enableLinkReplaceOnNewConnection:!1,enableAssocLinkCreation:!1,enableAssocLinkType:o.ASSOC_STRAIGHT,enableDragWithoutSelect:!1,enableInternalObjectModel:!0,enablePaletteLayout:"Flyout",enableToolbarLayout:"Top",enableImageDisplay:"SVGInline",enableResizableNodes:!1,enableInsertNodeDroppedOnLink:!1,enableHighlightNodeOnNewLinkDrag:!1,enableHighlightUnavailableNodes:!1,enableMoveNodesOnSupernodeResize:!0,enableRaiseNodesToTopOnHover:!0,enableExternalPipelineFlows:!0,enableEditingActions:!0,enableDisplayFullLabelOnHover:!1,enableDropZoneOnExternalDrag:!1,enableRightFlyoutUnderToolbar:!1,enablePanIntoViewOnOpen:!1,enableZoomIntoSubFlows:!1,enableBrowserEditMenu:!0,enableMarkdownInComments:!1,enableAutoLinkOnlyFromSelNodes:!1,enableContextToolbar:!1,enableSaveZoom:"None",enableSnapToGridType:"None",enableSnapToGridX:null,enableSnapToGridY:null,enableAutoLayoutVerticalSpacing:null,enableAutoLayoutHorizontalSpacing:null,enableSingleOutputPortDisplay:!1,enableNarrowPalette:!0,schemaValidation:!1,enableBoundingRectangles:!1,enableCanvasUnderlay:"None",enableParentClass:"",enablePositionNodeOnRightFlyoutOpen:!1,emptyCanvasContent:null,dropZoneCanvasContent:null,enableNodeLayout:{},enableCanvasLayout:{},enableUseCardFromOriginalPorts:!1,tipConfig:{palette:{categories:!0,nodesTemplates:!0},nodes:!0,ports:!0,decorations:!0,links:!0,stateTag:!0}},t=E.getLayout(e);return e.enableNodeLayout=t.nodeLayout,e.enableCanvasLayout=t.canvasLayout,e}},{key:"compareCanvasConfigsOmitFields",value:function(e,t){var n=this.omitFields(e),i=this.omitFields(t);return this.compareCanvasConfigs(n,i)}},{key:"compareCanvasConfigs",value:function(e,t){var n=this,i=!1;return Object.keys(e).length===Object.keys(t).length&&(i=v(e,t,(function(e,t,i){switch(i){case"enablePositionNodeOnRightFlyoutOpen":return n.enableNodeRightFlyoutOpenExactlyMatches(e,t);case"enableCanvasLayout":return n.enableCanvasLayoutExactlyMatches(e,t);case"enableNodeLayout":return n.enableNodeLayoutExactlyMatches(e,t);case"tipConfig":return n.enableTipConfigExactlyMatches(e,t);default:return e===t}}))),i}},{key:"omitFields",value:function(e){return i.omit_1(e,["enableEditingActions","enableDropZoneOnExternalDrag","enableStateTag"])}},{key:"enableNodeRightFlyoutOpenExactlyMatches",value:function(t,n){return"boolean"==typeof t&&"boolean"==typeof n?t===n:"object"===e._typeof(t)&&"object"===e._typeof(n)&&t.x===n.x&&t.y===n.y}},{key:"enableCanvasLayoutExactlyMatches",value:function(e,t){return!e&&!t||!(!this.compareFieldCount(e,t)||!k(e,t))}},{key:"enableNodeLayoutExactlyMatches",value:function(e,t){return!e&&!t||!!(this.compareFieldCount(e,t)&&k(e,t)&&this.decorationsArraysExactlyMatches(e.decorations,t.decorations))}},{key:"decorationsArraysExactlyMatches",value:function(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=!0;return e.forEach((function(e,i){var o=t[i];o&&k(e,o)&&k(o,e)||(n=!1)})),n}},{key:"enableTipConfigExactlyMatches",value:function(e,t){return!e&&!t||!(!e||!t)&&(this.compareFieldCount(e,t)&&k(e,t))}},{key:"compareFieldCount",value:function(e,t){return Object.keys(e).length===Object.keys(t).length}}]),t}();function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var C=function(t){n._inherits(o,t);var i=O(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,a)).data=t,s.objectModel=n,s.labelUtil=r,s.layoutDirection=a,s.apiPipeline=s.objectModel.getAPIPipeline(),s.existingNodes=s.apiPipeline.getNodes().map((function(e){return Object.assign({},e)})),s}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.autoLayout(this.layoutDirection)}},{key:"undo",value:function(){this.apiPipeline.replaceNodes(this.existingNodes)}},{key:"redo",value:function(){this.apiPipeline.autoLayout(this.layoutDirection)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.arrangeLayout")}}]),o}(i.Action);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var T=function(t){n._inherits(o,t);var i=j(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.node=t.node,a.linksToUpdateInfo=h.getDetachedLinksToUpdate(a.node,a.data.detachedLinks,a.apiPipeline.getNodeDataLinks()),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.linksToUpdateInfo=this.linksToUpdateInfo,this.data}},{key:"do",value:function(){this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:this.data.offsetX,offsetY:this.data.offsetY}),this.apiPipeline.updateLinks(this.linksToUpdateInfo.newLinks)}},{key:"undo",value:function(){this.apiPipeline.updateLinks(this.linksToUpdateInfo.oldLinks),this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:-this.data.offsetX,offsetY:-this.data.offsetY})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.attachNodeToLinks",{node_label:this.node.label})}}]),o}(i.Action);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var L=function(t){n._inherits(r,t);var i=w(r);function r(t,n,a){var s;e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.pipelineFlowLoaded=s.objectModel.ensurePipelineIsLoaded(s.data),s.oldSupernode=s.apiPipeline.getNode(s.data.targetObject.id),s.oldPipelines=s.objectModel.getDescPipelinesToDelete([s.oldSupernode],s.data.pipelineId),s.oldPipelines=s.oldPipelines.filter((function(e){return e.parentUrl===s.data.externalUrl})),s.oldExtPipelineFlows=s.objectModel.getExternalPipelineFlowsForPipelines(s.oldPipelines),s.newSupernode=Object.assign({},s.oldSupernode,{subflow_ref:Object.assign({},s.oldSupernode.subflow_ref)}),s.newSupernode.image=s.newSupernode.image===o.USE_DEFAULT_EXT_ICON?o.USE_DEFAULT_ICON:s.newSupernode.image,delete s.newSupernode.subflow_ref.url;var d=s.objectModel.getDescendantPipelinesForSupernode(s.newSupernode).filter((function(e){return e.parentUrl===s.data.externalUrl}));return s.newPipelines=s.objectModel.cloneSupernodeContents(s.newSupernode,d),s.newPipelines=s.newPipelines.map((function(e){return delete e.parentUrl,e})),s}return e._createClass(r,[{key:"do",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.newSupernode,pipelinesToAdd:this.newPipelines,pipelinesToRemove:this.oldPipelines,extPipelineFlowsToAdd:[],extPipelineFlowsToDelete:this.oldExtPipelineFlows})}},{key:"undo",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.oldSupernode,pipelinesToAdd:this.oldPipelines,pipelinesToRemove:this.newPipelines,extPipelineFlowsToAdd:this.oldExtPipelineFlows,extPipelineFlowsToDelete:[]})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.convertSuperNodeExternalToLocal",{node_label:this.oldSupernode.label})}}]),r}(i.Action);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var x=function(t){n._inherits(r,t);var i=A(r);function r(t,n,a){var s;e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.oldSupernode=s.apiPipeline.getNode(s.data.targetObject.id),s.newSupernode=Object.assign({},s.oldSupernode,{subflow_ref:Object.assign({},s.oldSupernode.subflow_ref)}),s.newSupernode.image=s.newSupernode.image===o.USE_DEFAULT_ICON?o.USE_DEFAULT_EXT_ICON:s.newSupernode.image,s.newSupernode.subflow_ref.url=s.data.externalUrl;var d=s.objectModel.getDescendantPipelinesForSupernode(s.oldSupernode);return s.oldPipelines=d.filter((function(e){return!e.parentUrl})),s.newPipelines=s.objectModel.cloneSupernodeContents(s.newSupernode,s.oldPipelines),s.newPipelines=s.newPipelines.map((function(e){return e.parentUrl=s.data.externalUrl,e})),s.newPipelineFlow=s.objectModel.createExternalPipelineFlowTemplate(s.data.pipelineFlowId,s.newSupernode.subflow_ref.pipeline_id_ref),s.newPipelineFlow.pipelines=[],s.newPipelineFlow.url=s.data.externalUrl,s}return e._createClass(r,[{key:"do",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.newSupernode,pipelinesToAdd:this.newPipelines,pipelinesToRemove:this.oldPipelines,extPipelineFlowsToAdd:[this.newPipelineFlow],extPipelineFlowsToDelete:[]})}},{key:"undo",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.oldSupernode,pipelinesToAdd:this.oldPipelines,pipelinesToRemove:this.newPipelines,extPipelineFlowsToAdd:[],extPipelineFlowsToDelete:[this.newPipelineFlow]})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.convertSuperNodeLocalToExternal",{node_label:this.oldSupernode.label})}}]),r}(i.Action);function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var M=function(t){n._inherits(o,t);var i=D(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.labelUtil=r,s.objectModel=n,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.srcNode=s.apiPipeline.getAutoSourceNode(a),s.newNode=s.apiPipeline.createAutoNode(t,s.srcNode),s.newLink=null,s.apiPipeline.isLinkNeededWithAutoNode(s.newNode,s.srcNode)&&(s.newLink=s.apiPipeline.createLink(s.newNode,s.srcNode)),s}return e._createClass(o,[{key:"getData",value:function(){return this.data.sourceNode=this.srcNode,this.data.newNode=this.newNode,this.data.newLink=this.newLink,this.data.subPipeline=this.subPipelines,this.data}},{key:"do",value:function(){this.apiPipeline.addNode(this.newNode),this.newLink&&this.apiPipeline.addLink(this.newLink),this.objectModel.setSelections([this.newNode.id],this.data.pipelineId)}},{key:"undo",value:function(){this.apiPipeline.deleteNodes([this.newNode])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNode",{node_label:this.newNode.label})}}]),o}(i.Action);function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var U=function(t){n._inherits(o,t);var i=R(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),a&&(s.data.mousePos=a),s.comment=s.apiPipeline.createComment(t),s}return e._createClass(o,[{key:"getData",value:function(){return this.data.commentId=this.comment.id,this.data}},{key:"do",value:function(){this.apiPipeline.addComment(this.comment)}},{key:"undo",value:function(){this.apiPipeline.deleteComment(this.comment.id)}},{key:"redo",value:function(){this.apiPipeline.addComment(this.comment)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createComment")}}]),o}(i.Action);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var B=function(t){n._inherits(o,t);var i=F(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.linkCommentList=a.apiPipeline.createCommentLinks(t),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.linkIds=this.linkCommentList.map((function(e){return e.id})),this.data.linkType="comment",this.data}},{key:"do",value:function(){this.apiPipeline.addLinks(this.linkCommentList)}},{key:"undo",value:function(){var e=this;this.linkCommentList.forEach((function(t){e.apiPipeline.deleteLink(t)}))}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createCommentLink")}}]),o}(i.Action);function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var G=function(t){n._inherits(o,t);var i=H(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.newNode=a.apiPipeline.createNode(t),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newNode=this.newNode,this.data.subPipelines=this.subPipelines,this.data}},{key:"do",value:function(){this.apiPipeline.addNode(this.newNode)}},{key:"undo",value:function(){this.apiPipeline.deleteNodes([this.newNode])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNode",{node_label:this.newNode.label})}}]),o}(i.Action);function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var V=function(t){n._inherits(o,t);var i=q(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.actionLabel=a.createActionLabel(),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.linkIds=this.linkNodeList.map((function(e){return e.id})),this.data.linkType="data",this.data}},{key:"do",value:function(){this.data.replaceLink&&this.apiPipeline.deleteLink(this.data.replaceLink),this.linkNodeList=this.apiPipeline.createNodeLinks(this.data),this.apiPipeline.addLinks(this.linkNodeList)}},{key:"undo",value:function(){var e=this;this.linkNodeList.forEach((function(t){e.apiPipeline.deleteLink(t)})),this.data.replaceLink&&this.apiPipeline.addLinks([this.data.replaceLink])}},{key:"redo",value:function(){this.data.replaceLink&&this.apiPipeline.deleteLink(this.data.replaceLink),this.apiPipeline.addLinks(this.linkNodeList)}},{key:"getLabel",value:function(){return this.actionLabel}},{key:"createActionLabel",value:function(){var e=this.getTargetNodeLabel();return this.data.replaceLink?this.labelUtil.getActionLabel(this,"action.replaceNodeLink",{node_label:e}):this.labelUtil.getActionLabel(this,"action.createNodeLink",{node_label:e})}},{key:"getTargetNodeLabel",value:function(){return(this.data.targetNodes&&this.data.targetNodes.length>0?this.apiPipeline.getNode(this.data.targetNodes[0].id):{}).label}}]),o}(i.Action);function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var $=function(t){n._inherits(o,t);var i=z(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.detachedLink=a.apiPipeline.createNodeLinkDetached(t),a}return e._createClass(o,[{key:"getData",value:function(){return this.data}},{key:"do",value:function(){this.apiPipeline.addLinks([this.detachedLink])}},{key:"undo",value:function(){this.apiPipeline.deleteLink(this.detachedLink)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNodeLinkDetached")}}]),o}(i.Action);function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var K=function(t){n._inherits(o,t);var i=W(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.newNode=a.apiPipeline.createNode(t),a.firstLinkSrcInfo={id:t.link.srcNodeId,portId:t.link.srcNodePortId},a.firstLinkTrgInfo={id:a.newNode.id},a.secondLinkSrcInfo={id:a.newNode.id},a.secondLinkTrgInfo={id:t.link.trgNodeId,portId:t.link.trgNodePortId},a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newNode=this.newNode,this.data.newFirstLink=this.firstLink,this.data.newSecondLink=this.secondLink,this.data}},{key:"do",value:function(){this.apiPipeline.deleteLink({id:this.data.link.id}),this.apiPipeline.addNode(this.newNode),this.firstLink=this.apiPipeline.createNodeLink(this.firstLinkSrcInfo,this.firstLinkTrgInfo,{type:"nodeLink"}),this.secondLink=this.apiPipeline.createNodeLink(this.secondLinkSrcInfo,this.secondLinkTrgInfo,{type:"nodeLink"}),this.apiPipeline.addLinks([this.firstLink,this.secondLink])}},{key:"undo",value:function(){this.apiPipeline.deleteLink({id:this.firstLink.id}),this.apiPipeline.deleteLink({id:this.secondLink.id}),this.apiPipeline.deleteNodes([this.newNode]),this.apiPipeline.addLinks([this.data.link])}},{key:"redo",value:function(){this.apiPipeline.deleteLink({id:this.data.link.id}),this.apiPipeline.addNode(this.newNode),this.apiPipeline.addLinks([this.firstLink,this.secondLink])}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNodeOnLink",{node_label:this.newNode.label})}}]),o}(i.Action);function Y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var X=function(t){n._inherits(o,t);var i=Y(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.newNode=a.apiPipeline.createNode(t),a.linksToUpdateInfo=h.getDetachedLinksToUpdate(a.newNode,a.data.detachedLinks,a.apiPipeline.getNodeDataLinks()),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newNode=this.newNode,this.data.linksToUpdateInfo=this.linksToUpdateInfo,this.data}},{key:"do",value:function(){this.apiPipeline.addNode(this.newNode),this.apiPipeline.updateLinks(this.linksToUpdateInfo.newLinks)}},{key:"undo",value:function(){this.apiPipeline.updateLinks(this.linksToUpdateInfo.oldLinks),this.apiPipeline.deleteNodes([this.newNode])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNodeAttachLinks",{node_label:this.newNode.label})}}]),o}(i.Action);function J(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ee=80,te=function(t){n._inherits(a,t);var r=Q(a);function a(t,n,i,o){var s;e._classCallCheck(this,a),(s=r.call(this,t)).labelUtil=i,s.data=t,s.useCardFromOriginalPorts=o,s.objectModel=n,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.subflowNodes=s.objectModel.getSelectedNodes(),s.subflowComments=s.objectModel.getSelectedComments(),s.subflowRect=s.apiPipeline.getBoundingRectForNodes(s.subflowNodes),s.linksToDelete=[];var d=s.getUniqueSubflowLinks(s.data.selectedObjectIds);return s.subflowNodeLinks=s.getSubflowNodeLinks(d),s.subflowCommentLinks=s.getSubflowCommentLinks(d),s.subflowCommentLinks=s.filterCommentLinks(s.subflowCommentLinks,s.subflowComments),s.subflowLinks=s.subflowNodeLinks.concat(s.subflowCommentLinks),s.subflowInputLinks=s.createOrderedSubflowInputLinks(s.subflowNodeLinks),s.subflowOutputLinks=s.createOrderedSubflowOutputLinks(s.subflowNodeLinks),s.subPipeline=s.objectModel.createPipeline(s.subflowNodes,s.subflowComments,s.subflowLinks),s.subAPIPipeline=s.objectModel.getAPIPipeline(s.subPipeline.id),s.bindingInputData=s.getBindingInputData(s.subflowInputLinks,s.subflowRect),s.bindingOutputData=s.getBindingOutputData(s.subflowOutputLinks,s.subflowRect),s.supernode=s.createSupernode(s.bindingInputData,s.bindingOutputData),s.supernodeLinkDefs=s.createSupernodeLinkDefs(s.bindingInputData,s.bindingOutputData,s.supernode),s.bindingNodeLinkDefs=s.createBindingNodeLinkDefs(s.bindingInputData,s.bindingOutputData),s.data.externalUrl&&s.handleExternalSubflow(),s}return e._createClass(a,[{key:"getUniqueSubflowLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.apiPipeline.getLinksContainingId(e).forEach((function(e){n.find((function(t){return t.id===e.id}))||n.push(e)}))})),n}},{key:"getSubflowNodeLinks",value:function(e){return e.filter((function(e){return e.type===o.NODE_LINK||e.type===o.ASSOCIATION_LINK}))}},{key:"getSubflowCommentLinks",value:function(e){return e.filter((function(e){return e.type===o.COMMENT_LINK}))}},{key:"filterCommentLinks",value:function(e,t){var n=this,i=[];return e.forEach((function(e){var t=n.apiPipeline.getComment(e.srcNodeId);n.apiPipeline.isObjectIdInObjects(t.id,n.subflowComments)?i.push(e):n.apiPipeline.isCommentLinkedToNonSelectedNodes(t.id)?n.linksToDelete.push(e):(i.push(e),n.subflowComments.push(t))})),i=this.removeCommentLinksToUnselectedNodes(i,t)}},{key:"removeCommentLinksToUnselectedNodes",value:function(e,t){var n,i=this,o=e,r=[],a=J(t);try{for(a.s();!(n=a.n()).done;){var s=n.value;this.apiPipeline.isCommentLinkedToNonSelectedNodes(s.id)&&r.push(s)}}catch(e){a.e(e)}finally{a.f()}return r.forEach((function(e){i.apiPipeline.getLinksContainingId(e.id).forEach((function(e){i.apiPipeline.isObjectIdInObjects(e.trgNodeId,i.subflowNodes)||i.apiPipeline.isObjectIdInObjects(e.id,i.linksToDelete)||(o=o.filter((function(t){return t.id!==e.id})),i.linksToDelete.push(e))}))})),o}},{key:"createOrderedSubflowInputLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.apiPipeline.isObjectIdInObjects(e.srcNodeId,t.subflowNodes)||n.find((function(t){return t.id===e.trgNodeId}))||(e.type===o.ASSOCIATION_LINK?t.removeLinkFromSubflow(e,!0):(n.push(e),t.removeLinkFromSubflow(e,!1)))})),n=this.reorderSubflowLinks(n,"input")}},{key:"createOrderedSubflowOutputLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.apiPipeline.isObjectIdInObjects(e.trgNodeId,t.subflowNodes)||n.find((function(t){return t.id===e.srcNodeId}))||(e.type===o.ASSOCIATION_LINK?t.removeLinkFromSubflow(e,!0):(n.push(e),t.removeLinkFromSubflow(e,!1)))})),n=this.reorderSubflowLinks(n,"output")}},{key:"handleExternalSubflow",value:function(){var e=h.filterSupernodes(this.subflowNodes),t=this.objectModel.getDescendantPipelinesForSupernodes(e);this.descPipelines=t.filter((function(e){return!e.parentUrl})),this.newPipelineFlow=this.objectModel.createExternalPipelineFlowTemplate(this.data.externalPipelineFlowId,this.supernode.subflow_ref.pipeline_id_ref)}},{key:"createSupernode",value:function(e,t){var n=e.map((function(e){return e.supernodePort})),i=t.map((function(e){return e.supernodePort})),r={label:this.labelUtil.getLabel("supernode.template.label"),description:this.labelUtil.getLabel("supernode.template.description"),image:this.data.externalUrl?o.USE_DEFAULT_EXT_ICON:o.USE_DEFAULT_ICON,inputs:n,outputs:i,type:o.SUPER_NODE,subflow_ref:{pipeline_id_ref:this.subPipeline.id}};this.data.externalUrl&&(r.subflow_ref.url=this.data.externalUrl);var a=this.getTopLeftNode(this.subflowNodes),s={nodeTemplate:r,offsetX:a.x_pos,offsetY:a.y_pos};return this.apiPipeline.createNode(s)}},{key:"reorderSubflowLinks",value:function(e,t){var n=this;if(e.length>1){var o=i._toConsumableArray(e),r="input"===t?"srcNodeId":"trgNodeId",a="input"===t?"srcPos":"trgPos";return o.sort((function(e,t){var i=n.apiPipeline.getNode(e[r]),o=n.apiPipeline.getNode(t[r]),s=e[a]?e[a].y_pos:i.y_pos,d=t[a]?t[a].y_pos:o.y_pos;return s<d?-1:s>d?1:0})),o}return e}},{key:"getTopLeftNode",value:function(e){var t=this,n=e[0],i=this.getDistanceFromPosition(this.subflowRect.x,this.subflowRect.y,e[0]);return e.forEach((function(e){var o=t.getDistanceFromPosition(t.subflowRect.x,t.subflowRect.y,e);o<i&&(i=o,n=e)})),n}},{key:"getDistanceFromPosition",value:function(e,t,n){var i=n.x_pos-e,o=n.y_pos-t;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}},{key:"getBindingInputData",value:function(e,t){var n=this,i=[],o=t.y-ee;return e.forEach((function(e){var r=n.apiPipeline.getNode(e.trgNodeId),a=Object.assign({},n.findPort(e.trgNodePortId,r.inputs));a.id=n.generateUniquePortId(a,e.trgNodeId,i),a.label=n.labelUtil.getLabel("supernode.new.port.label"),n.useCardFromOriginalPorts||(a.cardinality={min:0,max:1});var s=Object.assign({},a),d={x:t.x-160,y:o+=ee};s.id=s.id?"output_"+s.id:s.id;var c=n.createBindingNode(e,{outputs:[s],isSupernodeInputBinding:!0},d);i.push({link:e,supernodePort:a,bindingNode:c})})),i}},{key:"getBindingOutputData",value:function(e,t){var n=this,i=[],o=t.y-ee;return e.forEach((function(e){var r=n.apiPipeline.getNode(e.srcNodeId),a=Object.assign({},n.findPort(e.srcNodePortId,r.outputs));a.id=n.generateUniquePortId(a,e.srcNodeId,i),a.label=n.labelUtil.getLabel("supernode.new.port.label"),n.useCardFromOriginalPorts||(a.cardinality={min:0,max:1});var s=Object.assign({},a),d={x:t.x+t.width+ee,y:o+=ee};s.id=s.id?"input_"+s.id:s.id;var c=n.createBindingNode(e,{inputs:[s],isSupernodeOutputBinding:!0},d);i.push({link:e,supernodePort:a,bindingNode:c})})),i}},{key:"findPort",value:function(e,t){if(null!=e){var n=h.getPort(e,t);if(n)return n}return t[0]}},{key:"generateUniquePortId",value:function(e,t,n){var i=e.id?t+"_"+e.id:e.id,o=this.occurancesStartingWith(i,n);return o>0&&(i+="_"+o),i}},{key:"occurancesStartingWith",value:function(e,t){return t.filter((function(t){return t.supernodePort.id.startsWith(e)})).length}},{key:"createBindingNode",value:function(e,t,n){var i={description:this.labelUtil.getLabel("supernode.binding.node.description"),label:this.labelUtil.getLabel("supernode.binding.node.label"),type:"binding"},o={editType:"createNode",nodeTemplate:Object.assign(i,t),offsetX:n.x,offsetY:n.y};return this.subAPIPipeline.createNode(o)}},{key:"removeLinkFromSubflow",value:function(e,t){this.subflowLinks=this.subflowLinks.filter((function(t){return t.id!==e.id})),t&&this.linksToDelete.push(e)}},{key:"createSupernodeLinkDefs",value:function(e,t,n){var i=[];return e.forEach((function(e){var t={srcInfo:{},trgInfo:{}};e.link.srcPos?t.srcInfo.srcPos=e.link.srcPos:(t.srcInfo.id=e.link.srcNodeId,t.srcInfo.portId=e.link.srcNodePortId),t.trgInfo.id=n.id,t.trgInfo.portId=e.supernodePort.id,i.push(t)})),t.forEach((function(e){var t={srcInfo:{},trgInfo:{}};t.srcInfo.id=n.id,t.srcInfo.portId=e.supernodePort.id,e.link.trgPos?t.trgInfo.trgPos=e.link.trgPos:(t.trgInfo.id=e.link.trgNodeId,t.trgInfo.portId=e.link.trgNodePortId),i.push(t)})),i}},{key:"createBindingNodeLinkDefs",value:function(e,t){var n=[];return e.forEach((function(e){n.push({srcInfo:{id:e.bindingNode.id,portId:e.bindingNode.outputs[0].id},trgInfo:{id:e.link.trgNodeId,portId:e.link.trgNodePortId}})})),t.forEach((function(e){n.push({srcInfo:{id:e.link.srcNodeId,portId:e.link.srcNodePortId},trgInfo:{id:e.bindingNode.id,portId:e.bindingNode.inputs[0].id}})})),n}},{key:"getData",value:function(){return this.data.newNode=this.supernode,this.data.newLinks=this.newLinks,this.data.subPipelineId=this.subPipeline.id,this.data}},{key:"do",value:function(){var e=this;if(this.apiPipeline.deleteNodes(this.subflowNodes,!1),this.apiPipeline.deleteComments(this.subflowComments),this.apiPipeline.deleteLinks(this.linksToDelete),this.apiPipeline.addSupernode(this.supernode,[this.subPipeline]),this.bindingInputData.forEach((function(t){e.apiPipeline.setInputPortSubflowNodeRef(e.supernode.id,t.supernodePort.id,t.bindingNode.id)})),this.bindingOutputData.forEach((function(t){e.apiPipeline.setOutputPortSubflowNodeRef(e.supernode.id,t.supernodePort.id,t.bindingNode.id)})),this.newLinks=[],this.supernodeLinkDefs.forEach((function(t){e.newLinks.push(e.apiPipeline.createNodeLink(t.srcInfo,t.trgInfo,{type:o.NODE_LINK}))})),this.apiPipeline.addLinks(this.newLinks),this.bindingInputData.forEach((function(t){e.subAPIPipeline.addNode(t.bindingNode)})),this.bindingOutputData.forEach((function(t){e.subAPIPipeline.addNode(t.bindingNode)})),this.subflowNewLinks=[],this.bindingNodeLinkDefs.forEach((function(t){e.subflowNewLinks.push(e.subAPIPipeline.createNodeLink(t.srcInfo,t.trgInfo,{type:o.NODE_LINK}))})),this.subAPIPipeline.addLinks(this.subflowNewLinks),this.data.externalUrl){this.objectModel.addExternalPipelineFlow(this.newPipelineFlow,this.data.externalUrl,null,!1);var t=[this.subPipeline].concat(this.descPipelines);this.objectModel.setParentUrl(t,this.data.externalUrl)}}},{key:"undo",value:function(){var e=this;this.data.externalUrl&&(this.objectModel.setParentUrl(this.descPipelines),this.objectModel.removeExternalPipelineFlow(this.data.externalUrl)),this.apiPipeline.deleteSupernodes([this.supernode],[this.subPipeline],[]),this.subflowNodes.forEach((function(t){e.apiPipeline.addNode(t)})),this.subflowComments.forEach((function(t){e.apiPipeline.addComment(t)})),this.apiPipeline.addLinks(this.subflowLinks),this.apiPipeline.addLinks(this.subflowInputLinks),this.apiPipeline.addLinks(this.subflowOutputLinks),this.apiPipeline.addLinks(this.linksToDelete)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createSuperNode",{node_label:this.supernode.label})}}]),a}(i.Action);function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ie=function(t){n._inherits(o,t);var i=ne(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.oldObjectPositions=[],s.newObjectPositions=[],s.oldLinkPositions=[],s.newLinkPositions=[],s.enableMoveNodesOnSupernodeResize=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.enableMoveNodesOnSupernodeResize&&(s.supernode=s.apiPipeline.getNode(s.data.id),s.oldObjectPositions=h.getObjectPositions(s.apiPipeline.getObjects()),s.oldLinkPositions=h.getLinkPositions(s.apiPipeline.getLinks()),s.newObjectPositions=h.moveSurroundingObjects(s.supernode,s.apiPipeline.getObjects(),"se",s.supernode.layout.defaultNodeWidth,s.supernode.layout.defaultNodeHeight,!1),s.newLinkPositions=h.moveSurroundingDetachedLinks(s.supernode,s.apiPipeline.getLinks(),"se",s.supernode.layout.defaultNodeWidth,s.supernode.layout.defaultNodeHeight,!1)),s}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.collapseSuperNodeInPlace(this.data.id,this.newObjectPositions,this.newLinkPositions)}},{key:"undo",value:function(){this.apiPipeline.expandSuperNodeInPlace(this.data.id,this.oldObjectPositions,this.oldLinkPositions)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.collapseSuperNodeInPlace")}}]),o}(i.Action);function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var re=function(t){n._inherits(o,t);var i=oe(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.oldIds=a.data.selectedObjects.map((function(e){return e.id})),a.oldColors=a.getOldColors(),a.actionLabel=a.createActionLabel(),a.newBackgroundColor=a.data.editParam.color,a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.setObjectsColorClassName(this.oldIds,this.newBackgroundColor)}},{key:"undo",value:function(){this.apiPipeline.setObjectsColorClassName(this.oldIds,this.oldColors)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.actionLabel}},{key:"createActionLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.colorComments",{comments_count:this.data.selectedObjectIds.length})}},{key:"getOldColors",value:function(){var e=this,t=[];return this.data.selectedObjects.forEach((function(n){t.push(e.getObjectColorClass(n))})),t}},{key:"getObjectColorClass",value:function(e){if(e.class_name){var t=e.class_name.split(" ");if(t)return t.find((function(e){return h.getBkgColorClass(e)}))}return""}}]),o}(i.Action);function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var se=function(t){n._inherits(r,t);var i=ae(r);function r(t,n,o,a){var s;e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=o,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.enableMoveNodesOnSupernodeResize=a,s.supernode=s.data.targetObject,s.oldObjectPositions=[],s.newObjectPositions=[],s.oldLinkPositions=[],s.newLinkPositions=[],s.objectModel.ensurePipelineIsLoaded(s.data),s.targetApiPipeline=s.objectModel.getAPIPipeline(s.supernode.subflow_ref.pipeline_id_ref),s.targetPipeline=s.targetApiPipeline.getPipeline(),s.extPipelineFlowToDelete=s.targetPipeline.parentUrl?s.objectModel.getExternalPipelineFlow(s.targetPipeline.parentUrl):[];var d=s.getLinksToRemove(),c=s.getBindingNodes(),l=s.getNonBindingNodes(c),u=s.getCommentsToAdd(),p=s.getLinksToAdd(c,d),f={left:0,top:0};return s.enableMoveNodesOnSupernodeResize&&(s.oldObjectPositions=h.getObjectPositions(s.apiPipeline.getObjects()),s.oldLinkPositions=h.getLinkPositions(s.apiPipeline.getLinks()),f=h.getCanvasDimensions(l,u,p,0,0),s.newObjectPositions=h.moveSurroundingObjects(s.data.targetObject,s.apiPipeline.getObjects(),"se",f.width,f.height,!1),s.newLinkPositions=h.moveSurroundingDetachedLinks(s.data.targetObject,s.apiPipeline.getLinks(),"se",f.width,f.height,!1)),l.forEach((function(e){s.newObjectPositions[e.id]={x_pos:s.supernode.x_pos+e.x_pos-f.left,y_pos:s.supernode.y_pos+e.y_pos-f.top}})),u.forEach((function(e){s.newObjectPositions[e.id]={x_pos:s.supernode.x_pos+e.x_pos-f.left,y_pos:s.supernode.y_pos+e.y_pos-f.top}})),s.info={pipelineId:s.data.pipelineId,supernodeToDelete:s.supernode,nodesToAdd:l,linksToAdd:p,linksToRemove:d,commentsToAdd:u,oldObjectPositions:s.oldObjectPositions,newObjectPositions:s.newObjectPositions,oldLinkPositions:s.oldLinkPositions,newLinkPositions:s.newLinkPositions,pipelineToDelete:s.targetPipeline,extPipelineFlowToDelete:s.extPipelineFlowToDelete},s}return e._createClass(r,[{key:"getNonBindingNodes",value:function(e){return this.targetApiPipeline.getNodes().filter((function(t){return!e.some((function(e){return e.id===t.id}))}))}},{key:"getBindingNodes",value:function(){var e=this,t=[];return this.data.targetObject.inputs&&this.data.targetObject.inputs.forEach((function(n){var i=e.targetApiPipeline.getNode(n.subflow_node_ref);i&&t.push(i)})),this.data.targetObject.outputs&&this.data.targetObject.outputs.forEach((function(n){var i=e.targetApiPipeline.getNode(n.subflow_node_ref);i&&t.push(i)})),t}},{key:"getLinksToFromBindingNodes",value:function(e){return this.targetApiPipeline.getLinksContainingIds(e.map((function(e){return e.id})))}},{key:"getLinksNotToFromBindingNodes",value:function(e){var t=this.getLinksToFromBindingNodes(e);return this.targetApiPipeline.getLinks().filter((function(e){return!t.some((function(t){return t.id===e.id}))}))}},{key:"getCommentsToAdd",value:function(){return this.targetApiPipeline.getComments()}},{key:"getLinksToRemove",value:function(){return this.apiPipeline.getLinksContainingId(this.supernode.id)}},{key:"getLinksToAdd",value:function(e,t){var n=this.getLinksNotToFromBindingNodes(e),i=this.getNewLinks(t);return n.concat(i)}},{key:"getNewLinks",value:function(e){var t=this,n=[],i=e.filter((function(e){return e.type===o.NODE_LINK}));return this.supernode.inputs&&this.supernode.inputs.forEach((function(e){n=n.concat(t.getNewLinksForInput(e,i))})),this.supernode.outputs&&this.supernode.outputs.forEach((function(e){n=n.concat(t.getNewLinksForOutput(e,i))})),n}},{key:"getNewLinksForInput",value:function(e,t){var n=this,i=[],o=this.getSupernodeInputLinks(this.supernode,e.id,t),r=this.getInputBindingNode(e);if(r){var a=this.getInputBindingLinks(r);o.forEach((function(e){a.forEach((function(t){var o={};e.srcPos?o.srcPos=e.srcPos:(o.srcNodeId=e.srcNodeId,o.srcNodePortId=e.srcNodePortId),t.trgPos?o.trgPos=t.trgPos:(o.trgNodeId=t.trgNodeId,o.trgNodePortId=t.trgNodePortId);var r=n.apiPipeline.createLinkFromInfo(o);i.push(r)}))}))}return i}},{key:"getNewLinksForOutput",value:function(e,t){var n=this,i=[],o=this.getSupernodeOutputLinks(this.supernode,e.id,t),r=this.getOutputBindingNode(e);if(r){var a=this.getOutputBindingLinks(r);o.forEach((function(e){a.forEach((function(t){var o={};t.srcPos?o.srcPos=t.srcPos:(o.srcNodeId=t.srcNodeId,o.srcNodePortId=t.srcNodePortId),e.trgPos?o.trgPos=e.trgPos:(o.trgNodeId=e.trgNodeId,o.trgNodePortId=e.trgNodePortId);var r=n.apiPipeline.createLinkFromInfo(o);i.push(r)}))}))}return i}},{key:"getSupernodeInputLinks",value:function(e,t,n){return n.filter((function(n){var i=n.trgNodePortId||h.getDefaultInputPortId(e);return n.trgNodeId===e.id&&i===t}))}},{key:"getInputBindingNode",value:function(e){return this.targetApiPipeline.getNodes().find((function(t){return t.id===e.subflow_node_ref}))}},{key:"getInputBindingLinks",value:function(e){return this.targetApiPipeline.getLinksContainingSourceId(e.id).filter((function(e){return e.type===o.NODE_LINK}))}},{key:"getSupernodeOutputLinks",value:function(e,t,n){return n.filter((function(n){var i=n.srcNodePortId||h.getDefaultOutputPortId(e);return n.srcNodeId===e.id&&i===t}))}},{key:"getOutputBindingNode",value:function(e){return this.targetApiPipeline.getNodes().find((function(t){return t.id===e.subflow_node_ref}))}},{key:"getOutputBindingLinks",value:function(e){return this.targetApiPipeline.getLinksContainingTargetId(e.id).filter((function(e){return e.type===o.NODE_LINK}))}},{key:"do",value:function(){this.apiPipeline.deconstructSupernode(this.info)}},{key:"undo",value:function(){this.apiPipeline.reconstructSupernode(this.info)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.deconstructSuperNode",{node_label:this.supernode.label})}}]),r}(i.Action);function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ce=function(t){n._inherits(o,t);var i=de(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.linkInfo=[],a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a}return e._createClass(o,[{key:"do",value:function(){this.linkInfo=this.apiPipeline.getLink(this.data.id),this.apiPipeline.deleteLink(this.data)}},{key:"undo",value:function(){this.apiPipeline.addLinks([this.linkInfo])}},{key:"redo",value:function(){this.apiPipeline.deleteLink(this.data)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.deleteLink")}}]),o}(i.Action);function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ue=function(t){n._inherits(o,t);var i=le(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.areDetachableLinksSupported=a,s.objectsInfo=[],s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.nodesToDelete=s.objectModel.getSelectedNodes(),s.commentsToDelete=s.objectModel.getSelectedComments(),s.linksToDelete=s.objectModel.getSelectedLinks(),s.linksToUpdateInfo={},s.supernodesToDelete=[],s.nodeAndCommentsToDelete=s.nodesToDelete.concat(s.commentsToDelete),a?(s.linksToDelete=s.getConnectedLinksToDelete(s.linksToDelete,"nodeLink"),s.linksToUpdateInfo=s.getLinksToUpdateInfo()):s.linksToDelete=s.getConnectedLinksToDelete(s.linksToDelete),s.supernodesToDelete=h.filterSupernodes(s.nodesToDelete),s.pipelinesToDelete=s.objectModel.getDescPipelinesToDelete(s.supernodesToDelete,s.data.pipelineId),s.extPipelineFlowsToDelete=s.objectModel.getExternalPipelineFlowsForPipelines(s.pipelinesToDelete),s.nodesToDelete=s.nodesToDelete.filter((function(e){return!s.isSupernodeToBeDeleted(e)})),s.actionLabel=s.createActionLabel(),s}return e._createClass(o,[{key:"getConnectedLinksToDelete",value:function(e,t){var n=this;return this.nodeAndCommentsToDelete.forEach((function(i){n.apiPipeline.getLinksContainingId(i.id).forEach((function(i){n.isLinkToBeDeleted(i,e)||i.type===t||e.push(i)}))})),e}},{key:"getLinksToUpdateInfo",value:function(){var e=this,t=[],n=[];return this.apiPipeline.getLinks().forEach((function(i){if(!e.isLinkToBeDeleted(i,e.linksToDelete)){var o=e.isSourceToBeDeleted(i),r=e.isTargetToBeDeleted(i);if(o||r){var a=Object.assign({},i);o&&(delete a.srcNodeId,delete a.srcNodePortId,a.srcPos=h.getSrcPos(i,e.apiPipeline)),r&&(delete a.trgNodeId,delete a.trgNodePortId,a.trgPos=h.getTrgPos(i,e.apiPipeline)),t.push(a),n.push(i)}}})),{newLinks:t,oldLinks:n}}},{key:"isLinkToBeDeleted",value:function(e,t){return-1!==t.findIndex((function(t){return t.id===e.id}))}},{key:"isSupernodeToBeDeleted",value:function(e){return-1!==this.supernodesToDelete.findIndex((function(t){return e.id===t.id}))}},{key:"isSourceToBeDeleted",value:function(e){return-1!==this.nodeAndCommentsToDelete.findIndex((function(t){return t.id===e.srcNodeId}))}},{key:"isTargetToBeDeleted",value:function(e){return-1!==this.nodesToDelete.findIndex((function(t){return t.id===e.trgNodeId}))}},{key:"do",value:function(){this.apiPipeline.deleteAndUpdateObjects({linksToUpdate:this.linksToUpdateInfo.newLinks,linksToDelete:this.linksToDelete,supernodesToDelete:this.supernodesToDelete,pipelinesToDelete:this.pipelinesToDelete,extPipelineFlowsToDelete:this.extPipelineFlowsToDelete,nodesToDelete:this.nodesToDelete,commentsToDelete:this.commentsToDelete})}},{key:"undo",value:function(){this.apiPipeline.addAndUpdateObjects({linksToUpdate:this.linksToUpdateInfo.oldLinks,linksToAdd:this.linksToDelete,supernodesToAdd:this.supernodesToDelete,pipelinesToAdd:this.pipelinesToDelete,extPipelineFlowsToAdd:this.extPipelineFlowsToDelete,nodesToAdd:this.nodesToDelete,commentsToAdd:this.commentsToDelete})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.actionLabel}},{key:"createActionLabel",value:function(){var e="action.delete"+[{label:"Nodes",val:this.nodesToDelete.length+this.supernodesToDelete.length},{label:"Comments",val:this.commentsToDelete.length},{label:"Links",val:this.linksToDelete.length}].filter((function(e){return e.val})).map((function(e){return e.label})).join("");return this.labelUtil.getActionLabel(this,e,{nodes_count:this.nodesToDelete.length+this.supernodesToDelete.length,comments_count:this.commentsToDelete.length,links_count:this.linksToDelete.length})}}]),o}(i.Action);function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var fe=function(t){n._inherits(o,t);var i=pe(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.links=[],a}return e._createClass(o,[{key:"do",value:function(){this.links=this.apiPipeline.disconnectObjects(this.data.selectedObjectIds)}},{key:"undo",value:function(){this.apiPipeline.addLinks(this.links)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.disconnectObjects")}}]),o}(i.Action);function he(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ge=function(t){n._inherits(o,t);var i=he(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldBreadcrumbs=a.objectModel.getBreadcrumbs(),a}return e._createClass(o,[{key:"do",value:function(){this.objectModel.setPreviousBreadcrumb()}},{key:"undo",value:function(){this.objectModel.setBreadcrumbs(this.oldBreadcrumbs)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.displayPreviousPipeline")}}]),o}(i.Action);function ye(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var me=function(t){n._inherits(o,t);var i=ye(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldBreadcrumbs=a.objectModel.getBreadcrumbs(),a}return e._createClass(o,[{key:"do",value:function(){this.data.addBreadcrumbs?(this.objectModel.ensurePipelineIsLoaded(this.data),this.objectModel.addBreadcrumbs(this.data)):0===this.data.breadcrumbIndex?this.objectModel.setIndexedBreadcrumb(this.data):this.data.breadcrumbIndex&&(this.objectModel.ensurePipelineIsLoaded(this.data),this.objectModel.setIndexedBreadcrumb(this.data))}},{key:"undo",value:function(){this.objectModel.setBreadcrumbs(this.oldBreadcrumbs)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.displaySubPipeline")}}]),o}(i.Action);function _e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ve=function(t){n._inherits(o,t);var i=_e(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.previousComment=a.apiPipeline.getComment(a.data.id),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.editComment(this.data)}},{key:"undo",value:function(){this.apiPipeline.editComment(this.previousComment)}},{key:"redo",value:function(){this.apiPipeline.editComment(this.data)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.editComment")}}]),o}(i.Action);function be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Pe=function(t){n._inherits(r,t);var i=be(r);function r(t,n,a){var s;return e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=a,s.apiPipeline=s.objectModel.getAPIPipeline(s.data.pipelineId),s.data.objType===o.DEC_LINK?s.previousDecorations=s.apiPipeline.getLinkDecorations(s.data.objId)||[]:s.data.objType===o.DEC_NODE&&(s.previousDecorations=s.apiPipeline.getNodeDecorations(s.data.objId)||[]),s.newDecorations=s.previousDecorations.map((function(e){return e.id===s.data.decId?Object.assign({},e,{label:s.data.label}):e})),s}return e._createClass(r,[{key:"do",value:function(){this.data.objType===o.DEC_LINK?this.apiPipeline.setLinkDecorations(this.data.objId,this.newDecorations):this.data.objType===o.DEC_NODE&&this.apiPipeline.setNodeDecorations(this.data.objId,this.newDecorations)}},{key:"undo",value:function(){this.data.objType===o.DEC_LINK?this.apiPipeline.setLinkDecorations(this.data.objId,this.previousDecorations):this.data.objType===o.DEC_NODE&&this.apiPipeline.setNodeDecorations(this.data.objId,this.previousDecorations)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.data.objType===o.DEC_LINK?this.labelUtil.getActionLabel(this,"action.editLinkDecorationLabel"):this.labelUtil.getActionLabel(this,"action.editNodeDecorationLabel")}}]),r}(i.Action);function ke(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Ie=function(t){n._inherits(o,t);var i=ke(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.previousLabel=a.apiPipeline.getNode(t.nodeId).label,a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.setNodeLabel(this.data.nodeId,this.data.label)}},{key:"undo",value:function(){this.apiPipeline.setNodeLabel(this.data.nodeId,this.previousLabel)}},{key:"redo",value:function(){this.apiPipeline.setNodeLabel(this.data.nodeId,this.data.label)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.setNodeLabel")}}]),o}(i.Action);function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Ee=function(t){n._inherits(o,t);var i=Ne(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.oldObjectPositions=[],s.newObjectPositions=[],s.oldLinkPositions=[],s.newLinkPositions=[],s.enableMoveNodesOnSupernodeResize=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.supernode=s.apiPipeline.getNode(s.data.id),s.enableMoveNodesOnSupernodeResize&&(s.oldObjectPositions=h.getObjectPositions(s.apiPipeline.getObjects()),s.oldLinkPositions=h.getLinkPositions(s.apiPipeline.getLinks()),s.newObjectPositions=h.moveSurroundingObjects(s.supernode,s.apiPipeline.getObjects(),"se",h.getSupernodeExpandedWidth(s.supernode,s.objectModel.getCanvasLayout()),h.getSupernodeExpandedHeight(s.supernode,s.objectModel.getCanvasLayout()),!1),s.newLinkPositions=h.moveSurroundingDetachedLinks(s.supernode,s.apiPipeline.getLinks(),"se",h.getSupernodeExpandedWidth(s.supernode,s.objectModel.getCanvasLayout()),h.getSupernodeExpandedHeight(s.supernode,s.objectModel.getCanvasLayout()),!1)),s}return e._createClass(o,[{key:"do",value:function(){this.objectModel.ensurePipelineIsLoaded(this.data),this.apiPipeline.expandSuperNodeInPlace(this.data.id,this.newObjectPositions,this.newLinkPositions)}},{key:"undo",value:function(){this.apiPipeline.collapseSuperNodeInPlace(this.data.id,this.oldObjectPositions,this.oldLinkPositions)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.expandSuperNodeInPlace",{node_label:this.supernode.label})}}]),o}(i.Action);function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Oe=function(t){n._inherits(o,t);var i=Se(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.node=t.node,a.firstLinkSrcInfo={id:t.link.srcNodeId,portId:t.link.srcNodePortId},a.firstLinkTrgInfo={id:a.node.id},a.secondLinkSrcInfo={id:a.node.id},a.secondLinkTrgInfo={id:t.link.trgNodeId,portId:t.link.trgNodePortId},a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newFirstLink=this.firstLink,this.data.newSecondLink=this.secondLink,this.data}},{key:"do",value:function(){this.apiPipeline.deleteLink({id:this.data.link.id}),this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:this.data.offsetX,offsetY:this.data.offsetY}),this.firstLink=this.apiPipeline.createNodeLink(this.firstLinkSrcInfo,this.firstLinkTrgInfo,{type:"nodeLink"}),this.secondLink=this.apiPipeline.createNodeLink(this.secondLinkSrcInfo,this.secondLinkTrgInfo,{type:"nodeLink"}),this.apiPipeline.addLinks([this.firstLink,this.secondLink])}},{key:"undo",value:function(){this.apiPipeline.deleteLink({id:this.firstLink.id}),this.apiPipeline.deleteLink({id:this.secondLink.id}),this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:-this.data.offsetX,offsetY:-this.data.offsetY}),this.apiPipeline.addLinks([this.data.link])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.insertNodeIntoLink",{node_label:this.node.label})}}]),o}(i.Action);function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var je=function(t){n._inherits(o,t);var i=Ce(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.moveObjects(this.data)}},{key:"undo",value:function(){this.data.offsetX=-this.data.offsetX,this.data.offsetY=-this.data.offsetY,this.apiPipeline.moveObjects(this.data)}},{key:"redo",value:function(){this.data.offsetX=-this.data.offsetX,this.data.offsetY=-this.data.offsetY,this.apiPipeline.moveObjects(this.data)}},{key:"getLabel",value:function(){return 1===this.data.nodes.length?this.labelUtil.getActionLabel(this,"action.moveObject"):this.labelUtil.getActionLabel(this,"action.moveObjects")}}]),o}(i.Action);function Te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var we=function(t){n._inherits(o,t);var i=Te(o);function o(t,n,r,a,s,d){var c;e._classCallCheck(this,o),(c=i.call(this,t)).data=t,c.objectModel=n,c.labelUtil=r,c.viewportDimensions=a,c.areDetachableLinksInUse=s,c.isSnapToGridInUse=d,c.apiPipeline=c.objectModel.getAPIPipeline(t.pipelineId),c.adjustObjectsPositions(),c.clones=c.objectModel.cloneObjectsToPaste(t.objects.nodes,t.objects.comments,t.objects.links);var l=c.objectModel.extractAddDataPipelines(c.clones.clonedNodes),u=l.nodes,p=l.pipelines;return c.clones.clonedNodes=u,c.pipelines=p,c.selectionIds=c.getSelectionIds(c.clones),c}return e._createClass(o,[{key:"adjustObjectsPositions",value:function(){var e=this.data.objects,t=h.getCanvasDimensions(e.nodes,e.comments,e.links,0,0);if(t)if(this.data.mousePos&&this.data.mousePos.x&&this.data.mousePos.y){var n=this.data.mousePos.x-t.left,i=this.data.mousePos.y-t.top;this.moveObjectsPositions(e,n,i)}else{var o=this.viewportDimensions;if(o.x<t.left&&o.y<t.top&&o.x+o.width>t.left&&o.y+o.height>t.top)this.ensureNoOverlap(e);else{var r=o.x+o.width/2-t.width/2-t.left,a=o.y+o.height/2-t.height/2-t.top;this.moveObjectsPositions(e,r,a),this.ensureNoOverlap(e)}}}},{key:"ensureNoOverlap",value:function(e){var t=10,n=10;if(this.isSnapToGridInUse){var i=this.objectModel.getCanvasLayout();t=i.snapToGridXPx,n=i.snapToGridYPx}for(;this.apiPipeline.exactlyOverlaps(e.nodes,e.comments,e.links);)this.moveObjectsPositions(e,t,n)}},{key:"moveObjectsPositions",value:function(e,t,n){e.nodes&&e.nodes.forEach((function(e){e.x_pos+=t,e.y_pos+=n})),e.comments&&e.comments.forEach((function(e){e.x_pos+=t,e.y_pos+=n,e.selectedObjectIds=[]})),e.links&&e.links.forEach((function(e){e.srcPos&&(e.srcPos.x_pos+=t,e.srcPos.y_pos+=n),e.trgPos&&(e.trgPos.x_pos+=t,e.trgPos.y_pos+=n)}))}},{key:"getSelectionIds",value:function(e){var t=[];return e.clonedNodes.forEach((function(e){t.push(e.id)})),e.clonedComments.forEach((function(e){t.push(e.id)})),this.areDetachableLinksInUse&&e.clonedLinks.forEach((function(e){return t.push(e.id)})),t}},{key:"getData",value:function(){return this.data.clonedNodes=this.clones.clonedNodes,this.data.clonedComments=this.clones.clonedComments,this.data.clonedLinks=this.clones.clonedLinks,this.data}},{key:"do",value:function(){this.apiPipeline.addPastedObjects({nodesToAdd:this.clones.clonedNodes,commentsToAdd:this.clones.clonedComments,linksToAdd:this.clones.clonedLinks,pipelinesToAdd:this.pipelines,selections:this.selectionIds})}},{key:"undo",value:function(){var e=h.filterSupernodes(this.clones.clonedNodes),t=this.objectModel.getDescPipelinesToDelete(e,this.data.pipelineId),n=this.objectModel.getExternalPipelineFlowsForPipelines(t);this.apiPipeline.deletePastedObjects({nodesToDelete:this.clones.clonedNodes,commentsToDelete:this.clones.clonedComments,linksToDelete:this.clones.clonedLinks,pipelinesToDelete:t,extPipelineFlowsToDelete:n})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.pasteObjects")}}]),o}(i.Action);function Le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Ae=function(t){n._inherits(r,t);var i=Le(r);function r(t,n,o){var a;return e._classCallCheck(this,r),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=o,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.data.addedNodeTypes=a.apiPipeline.createNodesForPalette(a.data.selectedObjectIds),a}return e._createClass(r,[{key:"do",value:function(){this.objectModel.addNodeTypesToPalette(this.data.addedNodeTypes,o.SAVED_NODES_CATEGORY_ID,this.labelUtil.getLabel("palette.saved.nodes.label"),this.labelUtil.getLabel("palette.saved.nodes.description"),o.SAVED_NODES_FOLDER_ICON)}},{key:"undo",value:function(){var e=this.data.addedNodeTypes.map((function(e){return e.id}));this.objectModel.removeNodesFromPalette(e,o.SAVED_NODES_CATEGORY_ID)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.saveToPalette")}}]),r}(i.Action),xe=t._baseFor,De=y,Me=o.keysIn_1;var Re=function(e,t){return null==e?e:xe(e,De(t),Me)};function Ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Fe=function(t){n._inherits(o,t);var i=Ue(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldPipelineObjStyles=[],Re(a.data.pipelineObjectIds,(function(e,t){var n=a.objectModel.getAPIPipeline(t);a.oldPipelineObjStyles=[],e.forEach((function(e){a.oldPipelineObjStyles.push({pipelineId:t,objId:e,style:n.getObjectStyle(e,a.data.temporary)})}))})),a}return e._createClass(o,[{key:"do",value:function(){this.objectModel.setObjectsStyle(this.data.pipelineObjectIds,this.data.style,this.data.temporary)}},{key:"undo",value:function(){this.objectModel.setObjectsMultiStyle(this.oldPipelineObjStyles,this.data.temporary)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.setObjectsStyle")}}]),o}(i.Action);function Be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var He=function(t){n._inherits(o,t);var i=Be(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldPipelineLinkStyles=[],Re(a.data.pipelineLinkIds,(function(e,t){var n=a.objectModel.getAPIPipeline(t);a.oldPipelineLinkStyles=[],e.forEach((function(e){a.oldPipelineLinkStyles.push({pipelineId:t,objId:e,style:n.getLinkStyle(e,a.data.temporary)})}))})),a}return e._createClass(o,[{key:"do",value:function(){this.objectModel.setLinksStyle(this.data.pipelineLinkIds,this.data.style,this.data.temporary)}},{key:"undo",value:function(){this.objectModel.setLinksMultiStyle(this.oldPipelineLinkStyles,this.data.temporary)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.setLinksStyle")}}]),o}(i.Action);function Ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var qe=function(t){n._inherits(o,t);var i=Ge(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.oldLink=a.apiPipeline.getLink(t.newLink.id),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.updateLink(this.data.newLink)}},{key:"undo",value:function(){this.apiPipeline.updateLink(this.oldLink)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.updateLink")}}]),o}(i.Action);function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){o._defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $e=function(){function t(){e._classCallCheck(this,t),this.intl=null,this.actionLabelHandler=null,this.defaultMessages=ze(ze({},u),o.defaultMessages2)}return e._createClass(t,[{key:"setIntl",value:function(e){this.intl=e}},{key:"setActionLabelHandler",value:function(e){this.actionLabelHandler=e}},{key:"getActionLabel",value:function(e,t,n){if(this.actionLabelHandler){var i=this.actionLabelHandler(e,n);if(i)return i}return this.getLabel(t,n)}},{key:"getLabel",value:function(e,t){return void 0!==this.intl&&null!==this.intl?this.intl.formatMessage({id:e,defaultMessage:this.defaultMessages[e]},t):this.defaultMessages[e]}}]),t}(),We=t._baseDifference,Ke=t._baseFlatten,Ye=t._baseRest,Xe=t.isArrayLikeObject_1,Je=t.last_1,Ze=Ye((function(e,t){var n=Je(t);return Xe(n)&&(n=void 0),Xe(e)?We(e,Ke(t,1,Xe,!0),void 0,n):[]})),Qe=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"convertCanvasToCanvasInfo",value:function(e){var t={id:e.diagram.id,nodes:this.getNodes(e.diagram.nodes),comments:this.getComments(e.diagram.comments),links:this.getLinks(e.diagram.links,e.diagram.nodes,e.diagram.comments),runtime_ref:""};return e.zoom&&"number"==typeof e.zoom&&100!==e.zoom&&(t.zoom={k:e.zoom/100,x:0,y:0}),{doc_type:"pipeline",version:"3.0",json_schema:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",id:e.id,primary_pipeline:e.diagram.id,pipelines:[t]}}},{key:"getNodes",value:function(e){var t=this;return e.map((function(e){var n=t.getType(e),i={id:e.id,image:e.image,x_pos:void 0!==e.x_pos?e.x_pos:e.xPos,y_pos:void 0!==e.y_pos?e.y_pos:e.yPos,class_name:e.className,label:e.objectData.label,type:n,style:e.style};return e.objectData&&e.objectData.description&&(i.description=e.objectData.description),e.inputPorts&&(i.inputs=t.getInputPorts(e.inputPorts,1)),e.outputPorts&&(i.outputs=t.getOutputPorts(e.outputPorts,-1)),e.decorations&&(i.decorations=t.getDecorations(e.decorations)),n===o.SUPER_NODE&&(i.subflow_ref={pipeline_id_ref:e.subDiagramId,url:"app_defined"},i.open_with_tool="canvas",i.is_expanded=!1,i.expanded_width=200,i.expanded_height=200),n===o.MODEL_NODE&&(i.model_ref=""),n!==o.EXECUTION_NODE&&n!==o.BINDING&&n!==o.MODEL_NODE||(e.userData&&e.userData.typeId?i.op=e.userData.typeId:i.op=""),i}))}},{key:"getType",value:function(e){return e.userData&&!0===e.userData.containsModel?o.MODEL_NODE:e.inputPorts&&e.inputPorts.length>0&&e.outputPorts&&e.outputPorts.length>0?e.subDiagramId?o.SUPER_NODE:o.EXECUTION_NODE:o.BINDING}},{key:"getInputPorts",value:function(e,t){var n=this;return e.map((function(e){return{id:e.name,label:e.label,cardinality:{min:n.getMinCard(e.cardinality),max:n.getMaxCard(e.cardinality,t)}}}))}},{key:"getOutputPorts",value:function(e,t){var n=this;return e.map((function(e){return{id:e.name,label:e.label,cardinality:{min:n.getMinCard(e.cardinality),max:n.getMaxCard(e.cardinality,t)}}}))}},{key:"getMinCard",value:function(e){return e?Number(e.split(":")[0]):0}},{key:"getMaxCard",value:function(e,t){return e?Number(e.split(":")[1]):t}},{key:"getDecorations",value:function(e){return e.map((function(e){return{position:e.position,class_name:e.className,hotspot:e.hotspot,id:e.id,image:e.image,outline:e.outline,x_pos:e.x_pos,y_pos:e.y_pos,width:e.width,height:e.height}}))}},{key:"getComments",value:function(e){return e.map((function(e){return{id:e.id,class_name:e.className,content:e.content,x_pos:void 0!==e.x_pos?e.x_pos:e.xPos,y_pos:void 0!==e.y_pos?e.y_pos:e.yPos,height:e.height,width:e.width,style:e.style}}))}},{key:"getLinks",value:function(e,t,n){var i=this,o=[];return e.forEach((function(e){if(i.isValidLink(e,t,n)){var r={id:e.id,class_name:e.className,srcNodeId:e.source,trgNodeId:e.target,type:i.getLinkType(e),style:e.style};e.sourcePort&&(r.srcNodePortId=e.sourcePort),e.targetPort&&(r.trgNodePortId=e.targetPort),o.push(r)}})),o}},{key:"isValidLink",value:function(e,t,n){var i=!1;return("nodeLink"===this.getLinkType(e)||"associationLink"===this.getLinkType(e))&&t.findIndex((function(t){return t.id===e.source}))>-1&&t.findIndex((function(t){return t.id===e.target}))>-1&&(i=!0),"commentLink"===this.getLinkType(e)&&n.findIndex((function(t){return t.id===e.source}))>-1&&t.findIndex((function(t){return t.id===e.target}))>-1&&(i=!0),i}},{key:"getLinkType",value:function(e){if(t.has_1(e,"userData.linkType"))switch(e.userData.linkType){case"comment":return"commentLink";case"object":return"associationLink";default:return"nodeLink"}return"nodeLink"}},{key:"convertPaletteToPipelineFlowPalette",value:function(e){return{version:"1.0",categories:this.getCategories(e.categories)}}},{key:"getCategories",value:function(e){var t=this;return e.map((function(e){return{category:e.category,label:e.label,description:e.description,image:e.image,is_open:e.is_open,nodetypes:t.convertNodeTypes(e.nodetypes)}}))}},{key:"convertNodeTypes",value:function(e){var t=this;return e.map((function(e){var n={type:t.getType(e),label:e.label,description:e.description,operator_id_ref:e.typeId,image:e.image};return e.inputPorts&&(n.input_ports=t.convertPalettePorts(e.inputPorts,1)),e.outputPorts&&(n.output_ports=t.convertPalettePorts(e.outputPorts,-1)),n}))}},{key:"convertPalettePorts",value:function(e,t){var n=this;return e.map((function(e){return{id:e.name,label:e.label,cardinality:n.convertPaletteCardinality(e.cardinality,t)}}))}},{key:"convertPaletteCardinality",value:function(e,t){return{min:this.getMinCard(e),max:this.getMaxCard(e,t)}}},{key:"isVersion0Palette",value:function(e){for(var t=!1,n=0;n<e.categories.length;n++)if(this.isVersion0Category(e.categories[n])){t=!0;break}return t}},{key:"isVersion0Category",value:function(e){var t=!1;if(e.nodetypes)for(var n=0;n<e.nodetypes.length;n++)if(e.nodetypes[n].typeId){t=!0;break}return t}}]),n}(),et=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"getCanvasBasedOnCanvasInfo",value:function(e,t){return Object.assign({},e,{diagram:this.getDiagram(e,t.pipelines[0])})}},{key:"getDiagram",value:function(e,t){return{id:t.id,nodes:this.getCanvasNodes(t.nodes,e),comments:this.getCanvasComments(t.comments),links:this.getCanvasLinks(t.links)}}},{key:"getCanvasNodes",value:function(e,t){var n=this;return e.map((function(e){var i={id:e.id};e.inputs&&(i.inputPorts=n.getCanvasPorts(e.inputs)),e.outputs&&(i.outputPorts=n.getCanvasPorts(e.outputs)),i.image=e.image,i.x_pos=e.x_pos,i.y_pos=e.y_pos,i.className=e.class_name,i.objectData={label:e.label,description:e.description||""},i.userData={typeId:e.op},e.decorations&&(i.decorations=n.getCanvasDecorations(e.decorations));var o=n.getOldNode(e.id,t);return o&&o.userData&&(i.userData=o.userData),i}))}},{key:"getCanvasPorts",value:function(e){return e.map((function(e){var t={name:e.id,label:e.label};return e.cardinality&&(t.cardinality=e.cardinality.min+":"+e.cardinality.max),t}))}},{key:"getCanvasDecorations",value:function(e){return e.map((function(e){var t={};return e.position&&(t.position=e.position),e.class_name&&(t.className=e.class_name),e.image&&(t.image=e.image),e.hotspot&&(t.hotspot=e.hotspot),e.id&&(t.id=e.id),t}))}},{key:"getOldNode",value:function(e,t){if(t&&t.diagram&&t.diagram.nodes){var n=t.diagram.nodes.findIndex((function(t){return t.id===e}));if(n>-1)return t.diagram.nodes[n]}return null}},{key:"getCanvasComments",value:function(e){return e.map((function(e){return{id:e.id,className:e.class_name,content:e.content,height:e.height,width:e.width,x_pos:e.x_pos,y_pos:e.y_pos}}))}},{key:"getCanvasLinks",value:function(e){return e.map((function(e){var t={id:e.id,className:e.class_name,source:e.srcNodeId};e.srcNodePortId&&(t.sourcePort=e.srcNodePortId),t.target=e.trgNodeId,e.trgNodePortId&&(t.targetPort=e.trgNodePortId);var n="";switch(e.type){case"commentLink":n="comment";break;case"associationLink":n="object";break;default:n="data"}return t.userData={linkType:n},t}))}}]),t}(),tt=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"convertPipelineFlowToCanvasInfo",value:function(e,t){var n=this.convertPipelinesToCanvasInfoPipelines(e.pipelines,t);return Object.assign({},e,{pipelines:n})}},{key:"convertPipelinesToCanvasInfoPipelines",value:function(e,t){var n=this,i=[];return e&&(i=e.map((function(e){return n.convertPipelineToCanvasInfoPipeline(e,t)}))),i}},{key:"convertPipelineToCanvasInfoPipeline",value:function(e,n){var i=t.has_1(e,"nodes")?e.nodes:[],o=t.has_1(e,"app_data.ui_data.comments")?e.app_data.ui_data.comments:[],r=t.has_1(e,"app_data.ui_data.detached_links")?e.app_data.ui_data.detached_links:[],a={id:e.id,name:e.name,nodes:this.convertNodes(i,n),comments:this.convertComments(o),links:this.convertLinks(i,o,r),runtime_ref:e.runtime_ref,app_data:e.app_data,parameters:e.parameters};return t.has_1(e,"app_data.ui_data.zoom")&&("number"==typeof e.app_data.ui_data.zoom?a.zoom={x:0,y:0,k:e.app_data.ui_data.zoom/100}:a.zoom=e.app_data.ui_data.zoom),t.has_1(a,"app_data.ui_data.comments")&&delete a.app_data.ui_data.comments,t.has_1(a,"app_data.ui_data.detached_links")&&delete a.app_data.ui_data.detached_links,a}},{key:"convertNodes",value:function(e,t){var n=this;return e.map((function(e){return n.convertNode(e,t)}))}},{key:"convertNode",value:function(e,n){var i={id:e.id,type:e.type,outputs:this.convertOutputs(e),inputs:this.convertInputs(e),label:this.convertLabel(e),x_pos:t.has_1(e,"app_data.ui_data.x_pos")?e.app_data.ui_data.x_pos:10,y_pos:t.has_1(e,"app_data.ui_data.y_pos")?e.app_data.ui_data.y_pos:10,decorations:t.has_1(e,"app_data.ui_data.decorations")?this.convertDecorations(e.app_data.ui_data.decorations):[],parameters:t.has_1(e,"parameters")?e.parameters:[],messages:t.has_1(e,"app_data.ui_data.messages")?e.app_data.ui_data.messages:[],ui_parameters:t.has_1(e,"app_data.ui_data.ui_parameters")?e.app_data.ui_data.ui_parameters:[],app_data:t.has_1(e,"app_data")?this.removeUiDataFromAppData(e.app_data):[]};return e.type!==o.EXECUTION_NODE&&e.type!==o.BINDING&&e.type!==o.MODEL_NODE||(i.op=e.op),e.type===o.SUPER_NODE&&(t.has_1(e,"open_with_tool")&&(i.open_with_tool=e.open_with_tool),i.subflow_ref=t.has_1(e,"subflow_ref")?this.convertSubFlowRef(e.subflow_ref):{},i.is_expanded=!!t.has_1(e,"app_data.ui_data.is_expanded")&&e.app_data.ui_data.is_expanded,i.expanded_width=t.has_1(e,"app_data.ui_data.expanded_width")?e.app_data.ui_data.expanded_width:n.supernodeDefaultWidth,i.expanded_height=t.has_1(e,"app_data.ui_data.expanded_height")?e.app_data.ui_data.expanded_height:n.supernodeDefaultHeight),e.type===o.MODEL_NODE&&(i.model_ref=t.has_1(e,"model_ref")?e.model_ref:""),t.has_1(e,"app_data.ui_data.is_resized")&&(i.isResized=e.app_data.ui_data.is_resized,i.resizeHeight=e.app_data.ui_data.resize_height,i.resizeWidth=e.app_data.ui_data.resize_width),t.has_1(e,"app_data.ui_data.description")&&(i.description=e.app_data.ui_data.description),t.has_1(e,"app_data.ui_data.image")&&(i.image=e.app_data.ui_data.image),t.has_1(e,"app_data.ui_data.class_name")&&(i.class_name=e.app_data.ui_data.class_name),t.has_1(e,"app_data.ui_data.style")&&(i.style=e.app_data.ui_data.style),t.has_1(e,"app_data.ui_data.sub_pipelines")&&(i.sub_pipelines=e.app_data.ui_data.sub_pipelines),t.has_1(e,"isSupernodeInputBinding")&&(i.isSupernodeInputBinding=!0),t.has_1(e,"isSupernodeOutputBinding")&&(i.isSupernodeOutputBinding=!0),t.has_1(e,"connection")&&(i.connection=e.connection),t.has_1(e,"data_asset")&&(i.data_asset=e.data_asset),i}},{key:"convertSubFlowRef",value:function(e){var t={pipeline_id_ref:e.pipeline_id_ref};return e.url&&(t.url=e.url),t}},{key:"convertLabel",value:function(e){var n=t.has_1(e,"app_data.ui_data.label")?e.app_data.ui_data.label:"";return t.isObject_1(n)&&n.default?n.default:n}},{key:"convertOutputs",value:function(e){var t=this;return e.outputs?e.outputs.map((function(e){return t.convertPortObject(e)})):e.outputs}},{key:"convertInputs",value:function(e){var t=this;return e.inputs?e.inputs.map((function(e){return t.convertPortObject(e)})):e.inputs}},{key:"convertPortObject",value:function(e){var n={id:e.id,label:this.convertLabel(e)};return t.has_1(e,"subflow_node_ref")&&(n.subflow_node_ref=e.subflow_node_ref),t.has_1(e,"schema_ref")&&(n.schema_ref=e.schema_ref),t.has_1(e,"app_data.ui_data.cardinality")&&(n.cardinality={min:e.app_data.ui_data.cardinality.min,max:e.app_data.ui_data.cardinality.max}),t.has_1(e,"app_data.ui_data.class_name")&&(n.class_name=e.app_data.ui_data.class_name),t.has_1(e,"parameters")&&(n.parameters=e.parameters),e.app_data&&(n.app_data=this.removeUiDataFromAppData(e.app_data)),n}},{key:"convertDecorations",value:function(e){var t=this,n=[];return e&&e.forEach((function(e){var i=Object.assign({},e,{id:e.id||t.getUUID()});n.push(i)})),n}},{key:"convertComments",value:function(e){return e.map((function(e){var n={id:e.id,content:e.content,height:e.height,width:e.width,x_pos:e.x_pos,y_pos:e.y_pos};return t.has_1(e,"class_name")&&(n.class_name=e.class_name),t.has_1(e,"style")&&(n.style=e.style),n}))}},{key:"convertLinks",value:function(e,n,i){var o=this,r=[];return e.forEach((function(n){n.inputs&&n.inputs.forEach((function(t){t.links&&t.links.forEach((function(i){if(o.isNode(e,i.node_id_ref)){var a=o.createDataLink(i,i.node_id_ref,i.port_id_ref,n.id,t.id);r.push(a)}}))})),t.has_1(n,"app_data.ui_data.associations")&&!t.isEmpty_1(n.app_data.ui_data.associations)&&n.app_data.ui_data.associations.forEach((function(i){if(o.isNode(e,i.node_ref)){var a={id:i.id?i.id:o.getUUID(),srcNodeId:n.id,trgNodeId:i.node_ref,type:"associationLink",decorations:i.decorations};t.has_1(i,"class_name")&&(a.class_name=i.class_name),r.push(a)}}))})),n.forEach((function(n){n.associated_id_refs&&n.associated_id_refs.forEach((function(i){if(o.isNode(e,i.node_ref)){var a={id:i.id?i.id:o.getUUID(),srcNodeId:n.id,trgNodeId:i.node_ref,type:"commentLink"};t.has_1(i,"class_name")&&(a.class_name=i.class_name),i.style&&(a.style=i.style),r.push(a)}}))})),i.forEach((function(e){var t=o.createDataLink(e,e.src_node_id,e.src_node_port_id,e.trg_node_id,e.trg_node_port_id);e.src_pos&&(t.srcPos=e.src_pos),e.trg_pos&&(t.trgPos=e.trg_pos),r.push(t)})),r}},{key:"isNode",value:function(e,t){return-1!==e.findIndex((function(e){return e.id===t}))}},{key:"getUUID",value:function(){return s.v4()}},{key:"createDataLink",value:function(e,n,i,o,r){var a={id:t.has_1(e,"id")?e.id:this.getUUID(),srcNodeId:n,trgNodeId:o,trgNodePortId:r,type:"nodeLink"};return t.has_1(e,"app_data.ui_data.class_name")&&(a.class_name=e.app_data.ui_data.class_name),t.has_1(e,"app_data.ui_data.style")&&(a.style=e.app_data.ui_data.style),t.has_1(e,"app_data.ui_data.decorations")&&(a.decorations=e.app_data.ui_data.decorations),e.app_data&&(a.app_data=this.removeUiDataFromAppData(e.app_data)),i&&(a.srcNodePortId=i),e.link_name&&(a.linkName=e.link_name),e.type_attr&&(a.typeAttr=e.type_attr),e.description&&(a.description=e.description),a}},{key:"removeUiDataFromAppData",value:function(e){var t;return e&&delete(t=o.cloneDeep_1(e)).ui_data,t}}]),n}(),nt=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"createPipelineFlow",value:function(e){var t=o.cloneDeep_1(e);return delete t.subdueStyle,delete t.hideComments,Object.assign({},t,{pipelines:this.createPipelinesFromCanvasInfo(t)})}},{key:"createPipelinesFromCanvasInfo",value:function(e){var t=this;return e?this.filterOutExternalPipelines(e.pipelines).map((function(e){return t.createPipeline(e)})):{}}},{key:"filterOutExternalPipelines",value:function(e){return e.filter((function(e){return!e.parentUrl}))}},{key:"createPipeline",value:function(e){var t={id:e.id};return e.name&&(t.name=e.name),t.nodes=this.createNodes(e),t.app_data=this.createPipelineAppData(e),t.runtime_ref=e.runtime_ref,e.parameters&&(t.parameters=e.parameters),t}},{key:"createNodes",value:function(e){var t=this;return e.nodes.map((function(n){return t.createSchemaNode(n,e.links)}))}},{key:"createSchemaNode",value:function(e,n){var i={id:e.id,type:e.type};e.type!==o.EXECUTION_NODE&&e.type!==o.BINDING&&e.type!==o.MODEL_NODE||(e.op||""===e.op)&&(i.op=e.op),e.type===o.SUPER_NODE&&(e.open_with_tool&&(i.open_with_tool=e.open_with_tool),i.subflow_ref=e.subflow_ref),e.type===o.MODEL_NODE&&(i.model_ref=e.model_ref),i.app_data=Object.assign({},e.app_data,{ui_data:this.createNodeUiData(e)}),e.inputs&&(i.inputs=this.createInputs(e,n)),e.outputs&&(i.outputs=this.createOutputs(e)),e.parameters&&!t.isEmpty_1(e.parameters)&&(i.parameters=e.parameters),e.connection&&(i.connection=e.connection),e.data_asset&&(i.data_asset=e.data_asset);var r=this.createAssociationLinks(e,n);return t.isEmpty_1(r)||(i.app_data.ui_data.associations=r),i}},{key:"createNodeUiData",value:function(e){var n={label:e.label,image:e.image,x_pos:e.x_pos,y_pos:e.y_pos};if(e.class_name&&(n.class_name=e.class_name),e.style&&(n.style=e.style),e.description&&(n.description=e.description),e.type===o.SUPER_NODE?(n.is_expanded=e.is_expanded,n.expanded_width=e.expanded_width,n.expanded_height=e.expanded_height):e.isResized&&(n.is_resized=e.isResized,n.resize_width=e.width,n.resize_height=e.height),e.messages&&!t.isEmpty_1(e.messages)&&(n.messages=e.messages),e.ui_parameters&&!t.isEmpty_1(e.ui_parameters)&&(n.ui_parameters=e.ui_parameters),e.decorations){var i=this.createDecorations(e.decorations);i.length>0&&(n.decorations=i)}return n}},{key:"createDecorations",value:function(e){var t=[];return e&&e.forEach((function(e){if(!e.temporary&&!e.jsx){var n=Object.assign({},e);t.push(n)}})),t}},{key:"createInputs",value:function(e,t){var n=this,i=[];return e.inputs.forEach((function(r,a){var s={id:r.id};e.type===o.SUPER_NODE&&r.subflow_node_ref&&(s.subflow_node_ref=r.subflow_node_ref),r.schema_ref&&(s.schema_ref=r.schema_ref),s.app_data=Object.assign({},r.app_data,{ui_data:n.createPortUiData(r)});var d=n.createLinks(t,e.id,r.id,a);d.length>0&&(s.links=d),r.parameters&&(s.parameters=r.parameters),i.push(s)})),i}},{key:"createOutputs",value:function(e){var t=this,n=[];return e.outputs.forEach((function(i){var r={id:i.id};e.type===o.SUPER_NODE&&i.subflow_node_ref&&(r.subflow_node_ref=i.subflow_node_ref),i.schema_ref&&(r.schema_ref=i.schema_ref),r.app_data=Object.assign({},i.app_data,{ui_data:t.createPortUiData(i)}),i.parameters&&(r.parameters=i.parameters),n.push(r)})),n}},{key:"createPortUiData",value:function(e){var t={};return e.cardinality&&(t.cardinality=e.cardinality),e.class_name&&(t.class_name=e.class_name),t.label=e.label,t}},{key:"createLinks",value:function(e,t,n,i){var o=this,r=[];e&&this.getFilteredCanvasLinks(e,t,n,i).forEach((function(e){if(void 0!==e.srcNodeId){var t={id:e.id,node_id_ref:e.srcNodeId};e.srcNodePortId&&(t.port_id_ref=e.srcNodePortId),t=o.addNodeLinkCommonAttrs(t,e),r.push(t)}}));return r}},{key:"getFilteredCanvasLinks",value:function(e,t,n,i){return e.filter((function(e){if("nodeLink"===e.type&&e.trgNodeId===t)if(e.trgNodePortId){if(e.trgNodePortId===n)return!0}else if(0===i)return!0;return!1}))}},{key:"createPipelineAppData",value:function(e){return e.app_data?Object.assign({},e.app_data,{ui_data:this.createPipelineUiData(e)}):{ui_data:this.createPipelineUiData(e)}}},{key:"createPipelineUiData",value:function(e){var t=null;t=e.app_data&&e.app_data.ui_data?Object.assign({},e.app_data.ui_data,{comments:this.createComments(e.comments,e.links)}):{comments:this.createComments(e.comments,e.links)};var n=this.createDetachedLinks(e.links);return n.length>0&&(t.detached_links=n),e.zoom&&(t.zoom=e.zoom),t}},{key:"createComments",value:function(e,t){var n=this;return e.map((function(e){var i={id:e.id,x_pos:e.x_pos,y_pos:e.y_pos,width:e.width,height:e.height};return e.class_name&&(i.class_name=e.class_name),i.content=e.content,i.associated_id_refs=n.createCommentLinks(t,e.id),e.style&&(i.style=e.style),i}))}},{key:"createCommentLinks",value:function(e,t){var n=[];return e.forEach((function(e){if("commentLink"===e.type&&e.srcNodeId===t){var i={id:e.id,node_ref:e.trgNodeId};e.class_name&&(i.class_name=e.class_name),e.style&&(i.style=e.style),n.push(i)}})),n}},{key:"createAssociationLinks",value:function(e,t){var n=this,i=[];return t.forEach((function(t){if("associationLink"===t.type&&t.srcNodeId===e.id){var o={id:t.id,node_ref:t.trgNodeId};if(t.class_name&&(o.class_name=t.class_name),t.style&&(o.style=t.style),t.decorations){var r=n.createDecorations(t.decorations);r.length>0&&(o.decorations=r)}i.push(o)}})),i}},{key:"createDetachedLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){if(!e.srcNodeId||!e.trgNodeId){var i={id:e.id};e.srcNodeId?(i.src_node_id=e.srcNodeId,e.srcNodePortId&&(i.src_node_port_id=e.srcNodePortId)):e.srcPos&&(i.src_pos=e.srcPos),e.trgNodeId?(i.trg_node_id=e.trgNodeId,e.trgNodePortId&&(i.trg_node_port_id=e.trgNodePortId)):e.trgPos&&(i.trg_pos=e.trgPos),i=t.addNodeLinkCommonAttrs(i,e),n.push(i)}})),n}},{key:"addNodeLinkCommonAttrs",value:function(e,t){if(t.app_data&&i.set_1(e,"app_data",t.app_data),t.class_name&&i.set_1(e,"app_data.ui_data.class_name",t.class_name),t.style&&i.set_1(e,"app_data.ui_data.style",t.style),t.decorations){var n=this.createDecorations(t.decorations);n.length>0&&i.set_1(e,"app_data.ui_data.decorations",n)}return t.linkName&&(e.link_name=t.linkName),t.typeAttr&&(e.type_attr=t.typeAttr),t.description&&(e.description=t.description),e}}]),n}(),it=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"set",value:function(e,n){try{window.electronUtil&&window.electronUtil.wsdStorage&&window.electronUtil.wsdStorage.setItem?window.electronUtil.wsdStorage.setItem(e,n):window.localStorage&&(window.localStorage[e]=n)}catch(e){t.logger.warn("Local storage is not accessible: "+e)}}},{key:"get",value:function(e){try{if(window.electronUtil&&window.electronUtil.wsdStorage&&window.electronUtil.wsdStorage.getItem)return window.electronUtil.wsdStorage.getItem(e);if(window.localStorage)return window.localStorage[e]}catch(e){t.logger.warn("Local storage is not accessible: "+e)}return null}},{key:"delete",value:function(e){try{window.electronUtil&&window.electronUtil.wsdStorage&&window.electronUtil.wsdStorage.removeItem?window.electronUtil.wsdStorage.removeItem(e):window.localStorage&&delete window.localStorage[e]}catch(e){t.logger.warn("Local storage is not accessible: "+e)}}}]),t}();it.logger=new a.Logger(["LocalStorage"]);var ot={exports:{}};ot.exports=function(){function e(n,i,o){function r(s,d){if(!i[s]){if(!n[s]){var c="function"==typeof t.commonjsRequire&&t.commonjsRequire;if(!d&&c)return c(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=i[s]={exports:{}};n[s][0].call(u.exports,(function(e){return r(n[s][1][e]||e)}),u,u.exports,e,n,i,o)}return i[s].exports}for(var a="function"==typeof t.commonjsRequire&&t.commonjsRequire,s=0;s<o.length;s++)r(o[s]);return r}return e}()({1:[function(e,t,n){t.exports={graphlib:e("./lib/graphlib"),layout:e("./lib/layout"),debug:e("./lib/debug"),util:{time:e("./lib/util").time,notime:e("./lib/util").notime},version:e("./lib/version")}},{"./lib/debug":6,"./lib/graphlib":7,"./lib/layout":9,"./lib/util":29,"./lib/version":30}],2:[function(e,t,n){var i=e("./lodash"),o=e("./greedy-fas");function r(e){var t="greedy"===e.graph().acyclicer?o(e,n(e)):a(e);function n(e){return function(t){return e.edge(t).weight}}i.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,i.uniqueId("rev"))}))}function a(e){var t=[],n={},o={};function r(a){i.has(o,a)||(o[a]=!0,n[a]=!0,i.forEach(e.outEdges(a),(function(e){i.has(n,e.w)?t.push(e):r(e.w)})),delete n[a])}return i.forEach(e.nodes(),r),t}function s(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}}))}t.exports={run:r,undo:s}},{"./greedy-fas":8,"./lodash":10}],3:[function(e,t,n){var i=e("./lodash"),o=e("./util");function r(e){function t(n){var o=e.children(n),r=e.node(n);if(o.length&&i.forEach(o,t),i.has(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(var s=r.minRank,d=r.maxRank+1;s<d;++s)a(e,"borderLeft","_bl",n,r,s),a(e,"borderRight","_br",n,r,s)}}i.forEach(e.children(),t)}function a(e,t,n,i,r,a){var s={width:0,height:0,rank:a,borderType:t},d=r[t][a-1],c=o.addDummyNode(e,"border",s,n);r[t][a]=c,e.setParent(c,i),d&&e.setEdge(d,c,{weight:1})}t.exports=r},{"./lodash":10,"./util":29}],4:[function(e,t,n){var i=e("./lodash");function o(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||a(e)}function r(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||d(e),"lr"!==t&&"rl"!==t||(l(e),a(e))}function a(e){i.forEach(e.nodes(),(function(t){s(e.node(t))})),i.forEach(e.edges(),(function(t){s(e.edge(t))}))}function s(e){var t=e.width;e.width=e.height,e.height=t}function d(e){i.forEach(e.nodes(),(function(t){c(e.node(t))})),i.forEach(e.edges(),(function(t){var n=e.edge(t);i.forEach(n.points,c),i.has(n,"y")&&c(n)}))}function c(e){e.y=-e.y}function l(e){i.forEach(e.nodes(),(function(t){u(e.node(t))})),i.forEach(e.edges(),(function(t){var n=e.edge(t);i.forEach(n.points,u),i.has(n,"x")&&u(n)}))}function u(e){var t=e.x;e.x=e.y,e.y=t}t.exports={adjust:o,undo:r}},{"./lodash":10}],5:[function(e,t,n){function i(){var e={};e._next=e._prev=e,this._sentinel=e}function o(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=i,i.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return o(t),t},i.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&o(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},i.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},{}],6:[function(e,t,n){var i=e("./lodash"),o=e("./util"),r=e("./graphlib").Graph;function a(e){var t=o.buildLayerMatrix(e),n=new r({compound:!0,multigraph:!0}).setGraph({});return i.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),i.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),i.forEach(t,(function(e,t){var o="layer"+t;n.setNode(o,{rank:"same"}),i.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}t.exports={debugOrdering:a}},{"./graphlib":7,"./lodash":10,"./util":29}],7:[function(e,t,n){var i;if("function"==typeof e)try{i=e("graphlib")}catch(e){}i||(i=window.graphlib),t.exports=i},{graphlib:31}],8:[function(e,t,n){var i=e("./lodash"),o=e("./graphlib").Graph,r=e("./data/list");t.exports=s;var a=i.constant(1);function s(e,t){if(e.nodeCount()<=1)return[];var n=l(e,t||a),o=d(n.graph,n.buckets,n.zeroIdx);return i.flatten(i.map(o,(function(t){return e.outEdges(t.v,t.w)})),!0)}function d(e,t,n){for(var i,o=[],r=t[t.length-1],a=t[0];e.nodeCount();){for(;i=a.dequeue();)c(e,t,n,i);for(;i=r.dequeue();)c(e,t,n,i);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(i=t[s].dequeue()){o=o.concat(c(e,t,n,i,!0));break}}return o}function c(e,t,n,o,r){var a=r?[]:void 0;return i.forEach(e.inEdges(o.v),(function(i){var o=e.edge(i),s=e.node(i.v);r&&a.push({v:i.v,w:i.w}),s.out-=o,u(t,n,s)})),i.forEach(e.outEdges(o.v),(function(i){var o=e.edge(i),r=i.w,a=e.node(r);a.in-=o,u(t,n,a)})),e.removeNode(o.v),a}function l(e,t){var n=new o,a=0,s=0;i.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),i.forEach(e.edges(),(function(e){var i=n.edge(e.v,e.w)||0,o=t(e),r=i+o;n.setEdge(e.v,e.w,r),s=Math.max(s,n.node(e.v).out+=o),a=Math.max(a,n.node(e.w).in+=o)}));var d=i.range(s+a+3).map((function(){return new r})),c=a+1;return i.forEach(n.nodes(),(function(e){u(d,c,n.node(e))})),{graph:n,buckets:d,zeroIdx:c}}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(e,t,n){var i=e("./lodash"),o=e("./acyclic"),r=e("./normalize"),a=e("./rank"),s=e("./util").normalizeRanks,d=e("./parent-dummy-chains"),c=e("./util").removeEmptyRanks,l=e("./nesting-graph"),u=e("./add-border-segments"),p=e("./coordinate-system"),f=e("./order"),h=e("./position"),g=e("./util"),y=e("./graphlib").Graph;function m(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return C(e)}));n(" runLayout",(function(){_(t,n)})),n(" updateInputGraph",(function(){v(e,t)}))}))}function _(e,t){t(" makeSpaceForEdgeLabels",(function(){j(e)})),t(" removeSelfEdges",(function(){U(e)})),t(" acyclic",(function(){o.run(e)})),t(" nestingGraph.run",(function(){l.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){T(e)})),t(" removeEmptyRanks",(function(){c(e)})),t(" nestingGraph.cleanup",(function(){l.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){w(e)})),t(" removeEdgeLabelProxies",(function(){L(e)})),t(" normalize.run",(function(){r.run(e)})),t(" parentDummyChains",(function(){d(e)})),t(" addBorderSegments",(function(){u(e)})),t(" order",(function(){f(e)})),t(" insertSelfEdges",(function(){F(e)})),t(" adjustCoordinateSystem",(function(){p.adjust(e)})),t(" position",(function(){h(e)})),t(" positionSelfEdges",(function(){B(e)})),t(" removeBorderNodes",(function(){R(e)})),t(" normalize.undo",(function(){r.undo(e)})),t(" fixupEdgeLabelCoords",(function(){D(e)})),t(" undoCoordinateSystem",(function(){p.undo(e)})),t(" translateGraph",(function(){A(e)})),t(" assignNodeIntersects",(function(){x(e)})),t(" reversePoints",(function(){M(e)})),t(" acyclic.undo",(function(){o.undo(e)}))}function v(e,t){i.forEach(e.nodes(),(function(n){var i=e.node(n),o=t.node(n);i&&(i.x=o.x,i.y=o.y,t.children(n).length&&(i.width=o.width,i.height=o.height))})),i.forEach(e.edges(),(function(n){var o=e.edge(n),r=t.edge(n);o.points=r.points,i.has(r,"x")&&(o.x=r.x,o.y=r.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}t.exports=m;var b=["nodesep","edgesep","ranksep","marginx","marginy"],P={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},k=["acyclicer","ranker","rankdir","align"],I=["width","height"],N={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function C(e){var t=new y({multigraph:!0,compound:!0}),n=G(e.graph());return t.setGraph(i.merge({},P,H(n,b),i.pick(n,k))),i.forEach(e.nodes(),(function(n){var o=G(e.node(n));t.setNode(n,i.defaults(H(o,I),N)),t.setParent(n,e.parent(n))})),i.forEach(e.edges(),(function(n){var o=G(e.edge(n));t.setEdge(n,i.merge({},S,H(o,E),i.pick(o,O)))})),t}function j(e){var t=e.graph();t.ranksep/=2,i.forEach(e.edges(),(function(n){var i=e.edge(n);i.minlen*=2,"c"!==i.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}function T(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var i=e.node(t.v),o={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};g.addDummyNode(e,"edge-proxy",o,"_ep")}}))}function w(e){var t=0;i.forEach(e.nodes(),(function(n){var o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=i.max(t,o.maxRank))})),e.graph().maxRank=t}function L(e){i.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}function A(e){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,r=0,a=e.graph(),s=a.marginx||0,d=a.marginy||0;function c(e){var i=e.x,a=e.y,s=e.width,d=e.height;t=Math.min(t,i-s/2),n=Math.max(n,i+s/2),o=Math.min(o,a-d/2),r=Math.max(r,a+d/2)}i.forEach(e.nodes(),(function(t){c(e.node(t))})),i.forEach(e.edges(),(function(t){var n=e.edge(t);i.has(n,"x")&&c(n)})),t-=s,o-=d,i.forEach(e.nodes(),(function(n){var i=e.node(n);i.x-=t,i.y-=o})),i.forEach(e.edges(),(function(n){var r=e.edge(n);i.forEach(r.points,(function(e){e.x-=t,e.y-=o})),i.has(r,"x")&&(r.x-=t),i.has(r,"y")&&(r.y-=o)})),a.width=n-t+s,a.height=r-o+d}function x(e){i.forEach(e.edges(),(function(t){var n,i,o=e.edge(t),r=e.node(t.v),a=e.node(t.w);o.points?(n=o.points[0],i=o.points[o.points.length-1]):(o.points=[],n=a,i=r),o.points.unshift(g.intersectRect(r,n)),o.points.push(g.intersectRect(a,i))}))}function D(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);if(i.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}function M(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}function R(e){i.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),o=e.node(n.borderTop),r=e.node(n.borderBottom),a=e.node(i.last(n.borderLeft)),s=e.node(i.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(r.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}})),i.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}function U(e){i.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}function F(e){var t=g.buildLayerMatrix(e);i.forEach(t,(function(t){var n=0;i.forEach(t,(function(t,o){var r=e.node(t);r.order=o+n,i.forEach(r.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:r.rank,order:o+ ++n,e:t.e,label:t.label},"_se")})),delete r.selfEdges}))}))}function B(e){i.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var i=e.node(n.e.v),o=i.x+i.width/2,r=i.y,a=n.x-o,s=i.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*a/3,y:r-s},{x:o+5*a/6,y:r-s},{x:o+a,y:r},{x:o+5*a/6,y:r+s},{x:o+2*a/3,y:r+s}],n.label.x=n.x,n.label.y=n.y}}))}function H(e,t){return i.mapValues(i.pick(e,t),Number)}function G(e){var t={};return i.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(e,t,n){var i;if("function"==typeof e)try{i={cloneDeep:e("lodash/cloneDeep"),constant:e("lodash/constant"),defaults:e("lodash/defaults"),each:e("lodash/each"),filter:e("lodash/filter"),find:e("lodash/find"),flatten:e("lodash/flatten"),forEach:e("lodash/forEach"),forIn:e("lodash/forIn"),has:e("lodash/has"),isUndefined:e("lodash/isUndefined"),last:e("lodash/last"),map:e("lodash/map"),mapValues:e("lodash/mapValues"),max:e("lodash/max"),merge:e("lodash/merge"),min:e("lodash/min"),minBy:e("lodash/minBy"),now:e("lodash/now"),pick:e("lodash/pick"),range:e("lodash/range"),reduce:e("lodash/reduce"),sortBy:e("lodash/sortBy"),uniqueId:e("lodash/uniqueId"),values:e("lodash/values"),zipObject:e("lodash/zipObject")}}catch(e){}i||(i=window._),t.exports=i},{"lodash/cloneDeep":227,"lodash/constant":228,"lodash/defaults":229,"lodash/each":230,"lodash/filter":232,"lodash/find":233,"lodash/flatten":235,"lodash/forEach":236,"lodash/forIn":237,"lodash/has":239,"lodash/isUndefined":258,"lodash/last":261,"lodash/map":262,"lodash/mapValues":263,"lodash/max":264,"lodash/merge":266,"lodash/min":267,"lodash/minBy":268,"lodash/now":270,"lodash/pick":271,"lodash/range":273,"lodash/reduce":274,"lodash/sortBy":276,"lodash/uniqueId":286,"lodash/values":287,"lodash/zipObject":288}],11:[function(e,t,n){var i=e("./lodash"),o=e("./util");function r(e){var t=o.addDummyNode(e,"root",{},"_root"),n=s(e),r=i.max(i.values(n))-1,c=2*r+1;e.graph().nestingRoot=t,i.forEach(e.edges(),(function(t){e.edge(t).minlen*=c}));var l=d(e)+1;i.forEach(e.children(),(function(i){a(e,t,c,l,r,n,i)})),e.graph().nodeRankFactor=c}function a(e,t,n,r,s,d,c){var l=e.children(c);if(l.length){var u=o.addBorderNode(e,"_bt"),p=o.addBorderNode(e,"_bb"),f=e.node(c);e.setParent(u,c),f.borderTop=u,e.setParent(p,c),f.borderBottom=p,i.forEach(l,(function(i){a(e,t,n,r,s,d,i);var o=e.node(i),l=o.borderTop?o.borderTop:i,f=o.borderBottom?o.borderBottom:i,h=o.borderTop?r:2*r,g=l!==f?1:s-d[c]+1;e.setEdge(u,l,{weight:h,minlen:g,nestingEdge:!0}),e.setEdge(f,p,{weight:h,minlen:g,nestingEdge:!0})})),e.parent(c)||e.setEdge(t,u,{weight:0,minlen:s+d[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}function s(e){var t={};function n(o,r){var a=e.children(o);a&&a.length&&i.forEach(a,(function(e){n(e,r+1)})),t[o]=r}return i.forEach(e.children(),(function(e){n(e,1)})),t}function d(e){return i.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}function c(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,i.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}t.exports={run:r,cleanup:c}},{"./lodash":10,"./util":29}],12:[function(e,t,n){var i=e("./lodash"),o=e("./util");function r(e){e.graph().dummyChains=[],i.forEach(e.edges(),(function(t){a(e,t)}))}function a(e,t){var n=t.v,i=e.node(n).rank,r=t.w,a=e.node(r).rank,s=t.name,d=e.edge(t),c=d.labelRank;if(a!==i+1){var l,u,p;for(e.removeEdge(t),p=0,++i;i<a;++p,++i)d.points=[],u={width:0,height:0,edgeLabel:d,edgeObj:t,rank:i},l=o.addDummyNode(e,"edge",u,"_d"),i===c&&(u.width=d.width,u.height=d.height,u.dummy="edge-label",u.labelpos=d.labelpos),e.setEdge(n,l,{weight:d.weight},s),0===p&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,r,{weight:d.weight},s)}}function s(e){i.forEach(e.graph().dummyChains,(function(t){var n,i=e.node(t),o=i.edgeLabel;for(e.setEdge(i.edgeObj,o);i.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(o.x=i.x,o.y=i.y,o.width=i.width,o.height=i.height),t=n,i=e.node(t)}))}t.exports={run:r,undo:s}},{"./lodash":10,"./util":29}],13:[function(e,t,n){var i=e("../lodash");function o(e,t,n){var o,r={};i.forEach(n,(function(n){for(var i,a,s=e.parent(n);s;){if((i=e.parent(s))?(a=r[i],r[i]=s):(a=o,o=s),a&&a!==s)return void t.setEdge(a,s);s=i}}))}t.exports=o},{"../lodash":10}],14:[function(e,t,n){var i=e("../lodash");function o(e,t){return i.map(t,(function(t){var n=e.inEdges(t);if(n.length){var o=i.reduce(n,(function(t,n){var i=e.edge(n),o=e.node(n.v);return{sum:t.sum+i.weight*o.order,weight:t.weight+i.weight}}),{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}}))}t.exports=o},{"../lodash":10}],15:[function(e,t,n){var i=e("../lodash"),o=e("../graphlib").Graph;function r(e,t,n){var r=a(e),s=new o({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(t){return e.node(t)}));return i.forEach(e.nodes(),(function(o){var a=e.node(o),d=e.parent(o);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(s.setNode(o),s.setParent(o,d||r),i.forEach(e[n](o),(function(t){var n=t.v===o?t.w:t.v,r=s.edge(n,o),a=i.isUndefined(r)?0:r.weight;s.setEdge(n,o,{weight:e.edge(t).weight+a})})),i.has(a,"minRank")&&s.setNode(o,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))})),s}function a(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}t.exports=r},{"../graphlib":7,"../lodash":10}],16:[function(e,t,n){var i=e("../lodash");function o(e,t){for(var n=0,i=1;i<t.length;++i)n+=r(e,t[i-1],t[i]);return n}function r(e,t,n){for(var o=i.zipObject(n,i.map(n,(function(e,t){return t}))),r=i.flatten(i.map(t,(function(t){return i.sortBy(i.map(e.outEdges(t),(function(t){return{pos:o[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var d=i.map(new Array(s),(function(){return 0})),c=0;return i.forEach(r.forEach((function(e){var t=e.pos+a;d[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=d[t+1]),d[t=t-1>>1]+=e.weight;c+=e.weight*n}))),c}t.exports=o},{"../lodash":10}],17:[function(e,t,n){var i=e("../lodash"),o=e("./init-order"),r=e("./cross-count"),a=e("./sort-subgraph"),s=e("./build-layer-graph"),d=e("./add-subgraph-constraints"),c=e("../graphlib").Graph,l=e("../util");function u(e){var t=l.maxRank(e),n=p(e,i.range(1,t+1),"inEdges"),a=p(e,i.range(t-1,-1,-1),"outEdges"),s=o(e);h(e,s);for(var d,c=Number.POSITIVE_INFINITY,u=0,g=0;g<4;++u,++g){f(u%2?n:a,u%4>=2),s=l.buildLayerMatrix(e);var y=r(e,s);y<c&&(g=0,d=i.cloneDeep(s),c=y)}h(e,d)}function p(e,t,n){return i.map(t,(function(t){return s(e,t,n)}))}function f(e,t){var n=new c;i.forEach(e,(function(e){var o=e.graph().root,r=a(e,o,n,t);i.forEach(r.vs,(function(t,n){e.node(t).order=n})),d(e,n,r.vs)}))}function h(e,t){i.forEach(t,(function(t){i.forEach(t,(function(t,n){e.node(t).order=n}))}))}t.exports=u},{"../graphlib":7,"../lodash":10,"../util":29,"./add-subgraph-constraints":13,"./build-layer-graph":15,"./cross-count":16,"./init-order":18,"./sort-subgraph":20}],18:[function(e,t,n){var i=e("../lodash");function o(e){var t={},n=i.filter(e.nodes(),(function(t){return!e.children(t).length})),o=i.max(i.map(n,(function(t){return e.node(t).rank}))),r=i.map(i.range(o+1),(function(){return[]}));function a(n){if(!i.has(t,n)){t[n]=!0;var o=e.node(n);r[o.rank].push(n),i.forEach(e.successors(n),a)}}var s=i.sortBy(n,(function(t){return e.node(t).rank}));return i.forEach(s,a),r}t.exports=o},{"../lodash":10}],19:[function(e,t,n){var i=e("../lodash");function o(e,t){var n={};return i.forEach(e,(function(e,t){var o=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};i.isUndefined(e.barycenter)||(o.barycenter=e.barycenter,o.weight=e.weight)})),i.forEach(t.edges(),(function(e){var t=n[e.v],o=n[e.w];i.isUndefined(t)||i.isUndefined(o)||(o.indegree++,t.out.push(n[e.w]))})),r(i.filter(n,(function(e){return!e.indegree})))}function r(e){var t=[];function n(e){return function(t){t.merged||(i.isUndefined(t.barycenter)||i.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&a(e,t)}}function o(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var r=e.pop();t.push(r),i.forEach(r.in.reverse(),n(r)),i.forEach(r.out,o(r))}return i.map(i.filter(t,(function(e){return!e.merged})),(function(e){return i.pick(e,["vs","i","barycenter","weight"])}))}function a(e,t){var n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}t.exports=o},{"../lodash":10}],20:[function(e,t,n){var i=e("../lodash"),o=e("./barycenter"),r=e("./resolve-conflicts"),a=e("./sort");function s(e,t,n,l){var u=e.children(t),p=e.node(t),f=p?p.borderLeft:void 0,h=p?p.borderRight:void 0,g={};f&&(u=i.filter(u,(function(e){return e!==f&&e!==h})));var y=o(e,u);i.forEach(y,(function(t){if(e.children(t.v).length){var o=s(e,t.v,n,l);g[t.v]=o,i.has(o,"barycenter")&&c(t,o)}}));var m=r(y,n);d(m,g);var _=a(m,l);if(f&&(_.vs=i.flatten([f,_.vs,h],!0),e.predecessors(f).length)){var v=e.node(e.predecessors(f)[0]),b=e.node(e.predecessors(h)[0]);i.has(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+v.order+b.order)/(_.weight+2),_.weight+=2}return _}function d(e,t){i.forEach(e,(function(e){e.vs=i.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}function c(e,t){i.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}t.exports=s},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(e,t,n){var i=e("../lodash"),o=e("../util");function r(e,t){var n=o.partition(e,(function(e){return i.has(e,"barycenter")})),r=n.lhs,d=i.sortBy(n.rhs,(function(e){return-e.i})),c=[],l=0,u=0,p=0;r.sort(s(!!t)),p=a(c,d,p),i.forEach(r,(function(e){p+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,u+=e.weight,p=a(c,d,p)}));var f={vs:i.flatten(c,!0)};return u&&(f.barycenter=l/u,f.weight=u),f}function a(e,t,n){for(var o;t.length&&(o=i.last(t)).i<=n;)t.pop(),e.push(o.vs),n++;return n}function s(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}t.exports=r},{"../lodash":10,"../util":29}],22:[function(e,t,n){var i=e("./lodash");function o(e){var t=a(e);i.forEach(e.graph().dummyChains,(function(n){for(var i=e.node(n),o=i.edgeObj,a=r(e,t,o.v,o.w),s=a.path,d=a.lca,c=0,l=s[c],u=!0;n!==o.w;){if(i=e.node(n),u){for(;(l=s[c])!==d&&e.node(l).maxRank<i.rank;)c++;l===d&&(u=!1)}if(!u){for(;c<s.length-1&&e.node(l=s[c+1]).minRank<=i.rank;)c++;l=s[c]}e.setParent(n,l),n=e.successors(n)[0]}}))}function r(e,t,n,i){var o,r,a=[],s=[],d=Math.min(t[n].low,t[i].low),c=Math.max(t[n].lim,t[i].lim);o=n;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>d||c>t[o].lim));for(r=o,o=i;(o=e.parent(o))!==r;)s.push(o);return{path:a.concat(s.reverse()),lca:r}}function a(e){var t={},n=0;function o(r){var a=n;i.forEach(e.children(r),o),t[r]={low:a,lim:n++}}return i.forEach(e.children(),o),t}t.exports=o},{"./lodash":10}],23:[function(e,t,n){var i=e("../lodash"),o=e("../graphlib").Graph,r=e("../util");function a(e,t){var n={};function o(t,o){var r=0,a=0,s=t.length,l=i.last(o);return i.forEach(o,(function(t,u){var p=d(e,t),f=p?e.node(p).order:s;(p||t===l)&&(i.forEach(o.slice(a,u+1),(function(t){i.forEach(e.predecessors(t),(function(i){var o=e.node(i),a=o.order;!(a<r||f<a)||o.dummy&&e.node(t).dummy||c(n,i,t)}))})),a=u+1,r=f)})),o}return i.reduce(t,o),n}function s(e,t){var n={};function o(t,o,r,a,s){var d;i.forEach(i.range(o,r),(function(o){d=t[o],e.node(d).dummy&&i.forEach(e.predecessors(d),(function(t){var i=e.node(t);i.dummy&&(i.order<a||i.order>s)&&c(n,t,d)}))}))}function r(t,n){var r,a=-1,s=0;return i.forEach(n,(function(i,d){if("border"===e.node(i).dummy){var c=e.predecessors(i);c.length&&(r=e.node(c[0]).order,o(n,s,d,a,r),s=d,a=r)}o(n,s,n.length,r,t.length)})),n}return i.reduce(t,r),n}function d(e,t){if(e.node(t).dummy)return i.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}function c(e,t,n){if(t>n){var i=t;t=n,n=i}var o=e[t];o||(e[t]=o={}),o[n]=!0}function l(e,t,n){if(t>n){var o=t;t=n,n=o}return i.has(e[t],n)}function u(e,t,n,o){var r={},a={},s={};return i.forEach(t,(function(e){i.forEach(e,(function(e,t){r[e]=e,a[e]=e,s[e]=t}))})),i.forEach(t,(function(e){var t=-1;i.forEach(e,(function(e){var d=o(e);if(d.length){d=i.sortBy(d,(function(e){return s[e]}));for(var c=(d.length-1)/2,u=Math.floor(c),p=Math.ceil(c);u<=p;++u){var f=d[u];a[e]===e&&t<s[f]&&!l(n,e,f)&&(a[f]=e,a[e]=r[e]=r[f],t=s[f])}}}))})),{root:r,align:a}}function p(e,t,n,o,r){var a={},s=f(e,t,n,r),d=r?"borderLeft":"borderRight";function c(e,t){for(var n=s.nodes(),i=n.pop(),o={};i;)o[i]?e(i):(o[i]=!0,n.push(i),n=n.concat(t(i))),i=n.pop()}function l(e){a[e]=s.inEdges(e).reduce((function(e,t){return Math.max(e,a[t.v]+s.edge(t))}),0)}function u(t){var n=s.outEdges(t).reduce((function(e,t){return Math.min(e,a[t.w]-s.edge(t))}),Number.POSITIVE_INFINITY),i=e.node(t);n!==Number.POSITIVE_INFINITY&&i.borderType!==d&&(a[t]=Math.max(a[t],n))}return c(l,s.predecessors.bind(s)),c(u,s.successors.bind(s)),i.forEach(o,(function(e){a[e]=a[n[e]]})),a}function f(e,t,n,r){var a=new o,s=e.graph(),d=_(s.nodesep,s.edgesep,r);return i.forEach(t,(function(t){var o;i.forEach(t,(function(t){var i=n[t];if(a.setNode(i),o){var r=n[o],s=a.edge(r,i);a.setEdge(r,i,Math.max(d(e,t,o),s||0))}o=t}))})),a}function h(e,t){return i.minBy(i.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return i.forIn(t,(function(t,i){var r=v(e,i)/2;n=Math.max(t+r,n),o=Math.min(t-r,o)})),n-o}))}function g(e,t){var n=i.values(t),o=i.min(n),r=i.max(n);i.forEach(["u","d"],(function(n){i.forEach(["l","r"],(function(a){var s,d=n+a,c=e[d];if(c!==t){var l=i.values(c);(s="l"===a?o-i.min(l):r-i.max(l))&&(e[d]=i.mapValues(c,(function(e){return e+s})))}}))}))}function y(e,t){return i.mapValues(e.ul,(function(n,o){if(t)return e[t.toLowerCase()][o];var r=i.sortBy(i.map(e,o));return(r[1]+r[2])/2}))}function m(e){var t,n=r.buildLayerMatrix(e),o=i.merge(a(e,n),s(e,n)),d={};i.forEach(["u","d"],(function(r){t="u"===r?n:i.values(n).reverse(),i.forEach(["l","r"],(function(n){"r"===n&&(t=i.map(t,(function(e){return i.values(e).reverse()})));var a=("u"===r?e.predecessors:e.successors).bind(e),s=u(e,t,o,a),c=p(e,t,s.root,s.align,"r"===n);"r"===n&&(c=i.mapValues(c,(function(e){return-e}))),d[r+n]=c}))}));var c=h(e,d);return g(d,c),y(d,e.graph().align)}function _(e,t,n){return function(o,r,a){var s,d=o.node(r),c=o.node(a),l=0;if(l+=d.width/2,i.has(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":s=-d.width/2;break;case"r":s=d.width/2}if(s&&(l+=n?s:-s),s=0,l+=(d.dummy?t:e)/2,l+=(c.dummy?t:e)/2,l+=c.width/2,i.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(l+=n?s:-s),s=0,l}}function v(e,t){return e.node(t).width}t.exports={positionX:m,findType1Conflicts:a,findType2Conflicts:s,addConflict:c,hasConflict:l,verticalAlignment:u,horizontalCompaction:p,alignCoordinates:g,findSmallestWidthAlignment:h,balance:y}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(e,t,n){var i=e("../lodash"),o=e("../util"),r=e("./bk").positionX;function a(e){s(e=o.asNonCompoundGraph(e)),i.forEach(r(e),(function(t,n){e.node(n).x=t}))}function s(e){var t=o.buildLayerMatrix(e),n=e.graph().ranksep,r=0;i.forEach(t,(function(t){var o=i.max(i.map(t,(function(t){return e.node(t).height})));i.forEach(t,(function(t){e.node(t).y=r+o/2})),r+=o+n}))}t.exports=a},{"../lodash":10,"../util":29,"./bk":23}],25:[function(e,t,n){var i=e("../lodash"),o=e("../graphlib").Graph,r=e("./util").slack;function a(e){var t,n,i=new o({directed:!1}),a=e.nodes()[0],l=e.nodeCount();for(i.setNode(a,{});s(i,e)<l;)t=d(i,e),n=i.hasNode(t.v)?r(e,t):-r(e,t),c(i,e,n);return i}function s(e,t){function n(o){i.forEach(t.nodeEdges(o),(function(i){var a=i.v,s=o===a?i.w:a;e.hasNode(s)||r(t,i)||(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))}))}return i.forEach(e.nodes(),n),e.nodeCount()}function d(e,t){return i.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return r(t,n)}))}function c(e,t,n){i.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}t.exports=a},{"../graphlib":7,"../lodash":10,"./util":28}],26:[function(e,t,n){var i=e("./util").longestPath,o=e("./feasible-tree"),r=e("./network-simplex");function a(e){switch(e.graph().ranker){case"network-simplex":default:c(e);break;case"tight-tree":d(e);break;case"longest-path":s(e)}}t.exports=a;var s=i;function d(e){i(e),o(e)}function c(e){r(e)}},{"./feasible-tree":25,"./network-simplex":27,"./util":28}],27:[function(e,t,n){var i=e("../lodash"),o=e("./feasible-tree"),r=e("./util").slack,a=e("./util").longestPath,s=e("../graphlib").alg.preorder,d=e("../graphlib").alg.postorder,c=e("../util").simplify;function l(e){e=c(e),a(e);var t,n=o(e);for(h(n),u(n,e);t=y(n);)_(n,e,t,m(n,e,t))}function u(e,t){var n=d(e,e.nodes());n=n.slice(0,n.length-1),i.forEach(n,(function(n){p(e,t,n)}))}function p(e,t,n){var i=e.node(n).parent;e.edge(n,i).cutvalue=f(e,t,n)}function f(e,t,n){var o=e.node(n).parent,r=!0,a=t.edge(n,o),s=0;return a||(r=!1,a=t.edge(o,n)),s=a.weight,i.forEach(t.nodeEdges(n),(function(i){var a=i.v===n,d=a?i.w:i.v;if(d!==o){var c=a===r,l=t.edge(i).weight;if(s+=c?l:-l,b(e,n,d)){var u=e.edge(n,d).cutvalue;s+=c?-u:u}}})),s}function h(e,t){arguments.length<2&&(t=e.nodes()[0]),g(e,{},1,t)}function g(e,t,n,o,r){var a=n,s=e.node(o);return t[o]=!0,i.forEach(e.neighbors(o),(function(r){i.has(t,r)||(n=g(e,t,n,r,o))})),s.low=a,s.lim=n++,r?s.parent=r:delete s.parent,n}function y(e){return i.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function m(e,t,n){var o=n.v,a=n.w;t.hasEdge(o,a)||(o=n.w,a=n.v);var s=e.node(o),d=e.node(a),c=s,l=!1;s.lim>d.lim&&(c=d,l=!0);var u=i.filter(t.edges(),(function(t){return l===P(e,e.node(t.v),c)&&l!==P(e,e.node(t.w),c)}));return i.minBy(u,(function(e){return r(t,e)}))}function _(e,t,n,i){var o=n.v,r=n.w;e.removeEdge(o,r),e.setEdge(i.v,i.w,{}),h(e),u(e,t),v(e,t)}function v(e,t){var n=i.find(e.nodes(),(function(e){return!t.node(e).parent})),o=s(e,n);o=o.slice(1),i.forEach(o,(function(n){var i=e.node(n).parent,o=t.edge(n,i),r=!1;o||(o=t.edge(i,n),r=!0),t.node(n).rank=t.node(i).rank+(r?o.minlen:-o.minlen)}))}function b(e,t,n){return e.hasEdge(t,n)}function P(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=l,l.initLowLimValues=h,l.initCutValues=u,l.calcCutValue=f,l.leaveEdge=y,l.enterEdge=m,l.exchangeEdges=_},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(e,t,n){var i=e("../lodash");function o(e){var t={};function n(o){var r=e.node(o);if(i.has(t,o))return r.rank;t[o]=!0;var a=i.min(i.map(e.outEdges(o),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),r.rank=a}i.forEach(e.sources(),n)}function r(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}t.exports={longestPath:o,slack:r}},{"../lodash":10}],29:[function(e,t,n){var i=e("./lodash"),o=e("./graphlib").Graph;function r(e,t,n,o){var r;do{r=i.uniqueId(o)}while(e.hasNode(r));return n.dummy=t,e.setNode(r,n),r}function a(e){var t=(new o).setGraph(e.graph());return i.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),i.forEach(e.edges(),(function(n){var i=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+o.weight,minlen:Math.max(i.minlen,o.minlen)})})),t}function s(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return i.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),i.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t}function d(e){var t=i.map(e.nodes(),(function(t){var n={};return i.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return i.zipObject(e.nodes(),t)}function c(e){var t=i.map(e.nodes(),(function(t){var n={};return i.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return i.zipObject(e.nodes(),t)}function l(e,t){var n,i,o=e.x,r=e.y,a=t.x-o,s=t.y-r,d=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*d>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,i=c):(a<0&&(d=-d),n=d,i=d*s/a),{x:o+n,y:r+i}}function u(e){var t=i.map(i.range(g(e)+1),(function(){return[]}));return i.forEach(e.nodes(),(function(n){var o=e.node(n),r=o.rank;i.isUndefined(r)||(t[r][o.order]=n)})),t}function p(e){var t=i.min(i.map(e.nodes(),(function(t){return e.node(t).rank})));i.forEach(e.nodes(),(function(n){var o=e.node(n);i.has(o,"rank")&&(o.rank-=t)}))}function f(e){var t=i.min(i.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];i.forEach(e.nodes(),(function(i){var o=e.node(i).rank-t;n[o]||(n[o]=[]),n[o].push(i)}));var o=0,r=e.graph().nodeRankFactor;i.forEach(n,(function(t,n){i.isUndefined(t)&&n%r!=0?--o:o&&i.forEach(t,(function(t){e.node(t).rank+=o}))}))}function h(e,t,n,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=i),r(e,"border",o,t)}function g(e){return i.max(i.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!i.isUndefined(n))return n})))}function y(e,t){var n={lhs:[],rhs:[]};return i.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n}function m(e,t){var n=i.now();try{return t()}finally{console.log(e+" time: "+(i.now()-n)+"ms")}}function _(e,t){return t()}t.exports={addDummyNode:r,simplify:a,asNonCompoundGraph:s,successorWeights:d,predecessorWeights:c,intersectRect:l,buildLayerMatrix:u,normalizeRanks:p,removeEmptyRanks:f,addBorderNode:h,maxRank:g,partition:y,time:m,notime:_}},{"./graphlib":7,"./lodash":10}],30:[function(e,t,n){t.exports="0.8.5"},{}],31:[function(e,t,n){var i=e("./lib");t.exports={Graph:i.Graph,json:e("./lib/json"),alg:e("./lib/alg"),version:i.version}},{"./lib":47,"./lib/alg":38,"./lib/json":48}],32:[function(e,t,n){var i=e("../lodash");function o(e){var t,n={},o=[];function r(o){i.has(n,o)||(n[o]=!0,t.push(o),i.each(e.successors(o),r),i.each(e.predecessors(o),r))}return i.each(e.nodes(),(function(e){t=[],r(e),t.length&&o.push(t)})),o}t.exports=o},{"../lodash":49}],33:[function(e,t,n){var i=e("../lodash");function o(e,t,n){i.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return i.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);r(e,t,"post"===n,s,o,a)})),a}function r(e,t,n,o,a,s){i.has(o,t)||(o[t]=!0,n||s.push(t),i.each(a(t),(function(t){r(e,t,n,o,a,s)})),n&&s.push(t))}t.exports=o},{"../lodash":49}],34:[function(e,t,n){var i=e("./dijkstra"),o=e("../lodash");function r(e,t,n){return o.transform(e.nodes(),(function(o,r){o[r]=i(e,r,t,n)}),{})}t.exports=r},{"../lodash":49,"./dijkstra":35}],35:[function(e,t,n){var i=e("../lodash"),o=e("../data/priority-queue");t.exports=a;var r=i.constant(1);function a(e,t,n,i){return s(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function s(e,t,n,i){var r,a,s={},d=new o,c=function(e){var t=e.v!==r?e.v:e.w,i=s[t],o=n(e),c=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<i.distance&&(i.distance=c,i.predecessor=r,d.decrease(t,c))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},d.add(e,n)}));d.size()>0&&(r=d.removeMin(),(a=s[r]).distance!==Number.POSITIVE_INFINITY);)i(r).forEach(c);return s}},{"../data/priority-queue":45,"../lodash":49}],36:[function(e,t,n){var i=e("../lodash"),o=e("./tarjan");function r(e){return i.filter(o(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}t.exports=r},{"../lodash":49,"./tarjan":43}],37:[function(e,t,n){var i=e("../lodash");t.exports=r;var o=i.constant(1);function r(e,t,n){return a(e,t||o,n||function(t){return e.outEdges(t)})}function a(e,t,n){var i={},o=e.nodes();return o.forEach((function(e){i[e]={},i[e][e]={distance:0},o.forEach((function(t){e!==t&&(i[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var o=n.v===e?n.w:n.v,r=t(n);i[e][o]={distance:r,predecessor:e}}))})),o.forEach((function(e){var t=i[e];o.forEach((function(n){var r=i[n];o.forEach((function(n){var i=r[e],o=t[n],a=r[n],s=i.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)}))}))})),i}},{"../lodash":49}],38:[function(e,t,n){t.exports={components:e("./components"),dijkstra:e("./dijkstra"),dijkstraAll:e("./dijkstra-all"),findCycles:e("./find-cycles"),floydWarshall:e("./floyd-warshall"),isAcyclic:e("./is-acyclic"),postorder:e("./postorder"),preorder:e("./preorder"),prim:e("./prim"),tarjan:e("./tarjan"),topsort:e("./topsort")}},{"./components":32,"./dijkstra":35,"./dijkstra-all":34,"./find-cycles":36,"./floyd-warshall":37,"./is-acyclic":39,"./postorder":40,"./preorder":41,"./prim":42,"./tarjan":43,"./topsort":44}],39:[function(e,t,n){var i=e("./topsort");function o(e){try{i(e)}catch(e){if(e instanceof i.CycleException)return!1;throw e}return!0}t.exports=o},{"./topsort":44}],40:[function(e,t,n){var i=e("./dfs");function o(e,t){return i(e,t,"post")}t.exports=o},{"./dfs":33}],41:[function(e,t,n){var i=e("./dfs");function o(e,t){return i(e,t,"pre")}t.exports=o},{"./dfs":33}],42:[function(e,t,n){var i=e("../lodash"),o=e("../graph"),r=e("../data/priority-queue");function a(e,t){var n,a=new o,s={},d=new r;function c(e){var i=e.v===n?e.w:e.v,o=d.priority(i);if(void 0!==o){var r=t(e);r<o&&(s[i]=n,d.decrease(i,r))}}if(0===e.nodeCount())return a;i.each(e.nodes(),(function(e){d.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),d.decrease(e.nodes()[0],0);for(var l=!1;d.size()>0;){if(n=d.removeMin(),i.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(n).forEach(c)}return a}t.exports=a},{"../data/priority-queue":45,"../graph":46,"../lodash":49}],43:[function(e,t,n){var i=e("../lodash");function o(e){var t=0,n=[],o={},r=[];function a(s){var d=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){i.has(o,e)?o[e].onStack&&(d.lowlink=Math.min(d.lowlink,o[e].index)):(a(e),d.lowlink=Math.min(d.lowlink,o[e].lowlink))})),d.lowlink===d.index){var c,l=[];do{c=n.pop(),o[c].onStack=!1,l.push(c)}while(s!==c);r.push(l)}}return e.nodes().forEach((function(e){i.has(o,e)||a(e)})),r}t.exports=o},{"../lodash":49}],44:[function(e,t,n){var i=e("../lodash");function o(e){var t={},n={},o=[];function a(s){if(i.has(n,s))throw new r;i.has(t,s)||(n[s]=!0,t[s]=!0,i.each(e.predecessors(s),a),delete n[s],o.push(s))}if(i.each(e.sinks(),a),i.size(t)!==e.nodeCount())throw new r;return o}function r(){}t.exports=o,o.CycleException=r,r.prototype=new Error},{"../lodash":49}],45:[function(e,t,n){var i=e("../lodash");function o(){this._arr=[],this._keyIndices={}}t.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},o.prototype.has=function(e){return i.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!i.has(n,e)){var o=this._arr,r=o.length;return n[e]=r,o.push({key:e,priority:t}),this._decrease(r),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,i=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,i<t.length&&(o=t[i].priority<t[o].priority?i:o),o!==e&&(this._swap(e,o),this._heapify(o)))},o.prototype._decrease=function(e){for(var t,n=this._arr,i=n[e].priority;0!==e&&!(n[t=e>>1].priority<i);)this._swap(e,t),e=t},o.prototype._swap=function(e,t){var n=this._arr,i=this._keyIndices,o=n[e],r=n[t];n[e]=r,n[t]=o,i[r.key]=e,i[o.key]=t}},{"../lodash":49}],46:[function(e,t,n){var i=e("./lodash");t.exports=s;var o="\0",r="\0",a="";function s(e){this._isDirected=!i.has(e,"directed")||e.directed,this._isMultigraph=!!i.has(e,"multigraph")&&e.multigraph,this._isCompound=!!i.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=i.constant(void 0),this._defaultEdgeLabelFn=i.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function d(e,t){e[t]?e[t]++:e[t]=1}function c(e,t){--e[t]||delete e[t]}function l(e,t,n,r){var s=""+t,d=""+n;if(!e&&s>d){var c=s;s=d,d=c}return s+a+d+a+(i.isUndefined(r)?o:r)}function u(e,t,n,i){var o=""+t,r=""+n;if(!e&&o>r){var a=o;o=r,r=a}var s={v:o,w:r};return i&&(s.name=i),s}function p(e,t){return l(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return i.isFunction(e)||(e=i.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return i.keys(this._nodes)},s.prototype.sources=function(){var e=this;return i.filter(this.nodes(),(function(t){return i.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return i.filter(this.nodes(),(function(t){return i.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,o=this;return i.each(e,(function(e){n.length>1?o.setNode(e,t):o.setNode(e)})),this},s.prototype.setNode=function(e,t){return i.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=r,this._children[e]={},this._children[r][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return i.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(i.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],i.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),i.each(i.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],i.each(i.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(t))t=r;else{for(var n=t+="";!i.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==r)return t}},s.prototype.children=function(e){if(i.isUndefined(e)&&(e=r),this._isCompound){var t=this._children[e];if(t)return i.keys(t)}else{if(e===r)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return i.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return i.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return i.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;i.each(this._nodes,(function(n,i){e(i)&&t.setNode(i,n)})),i.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var o={};function r(e){var i=n.parent(e);return void 0===i||t.hasNode(i)?(o[e]=i,i):i in o?o[i]:r(i)}return this._isCompound&&i.each(t.nodes(),(function(e){t.setParent(e,r(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return i.isFunction(e)||(e=i.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return i.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,o=arguments;return i.reduce(e,(function(e,i){return o.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i})),this},s.prototype.setEdge=function(){var e,t,n,o,r=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(o=arguments[1],r=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,i.isUndefined(n)||(n=""+n);var s=l(this._isDirected,e,t,n);if(i.has(this._edgeLabels,s))return r&&(this._edgeLabels[s]=o),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=r?o:this._defaultEdgeLabelFn(e,t,n);var c=u(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[s]=c,d(this._preds[t],e),d(this._sucs[e],t),this._in[t][s]=c,this._out[e][s]=c,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var i=1===arguments.length?p(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[i]},s.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?p(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return i.has(this._edgeLabels,o)},s.prototype.removeEdge=function(e,t,n){var i=1===arguments.length?p(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),o=this._edgeObjs[i];return o&&(e=o.v,t=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=i.values(n);return t?i.filter(o,(function(e){return e.v===t})):o}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=i.values(n);return t?i.filter(o,(function(e){return e.w===t})):o}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},{"./lodash":49}],47:[function(e,t,n){t.exports={Graph:e("./graph"),version:e("./version")}},{"./graph":46,"./version":50}],48:[function(e,t,n){var i=e("./lodash"),o=e("./graph");function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:a(e),edges:s(e)};return i.isUndefined(e.graph())||(t.value=i.clone(e.graph())),t}function a(e){return i.map(e.nodes(),(function(t){var n=e.node(t),o=e.parent(t),r={v:t};return i.isUndefined(n)||(r.value=n),i.isUndefined(o)||(r.parent=o),r}))}function s(e){return i.map(e.edges(),(function(t){var n=e.edge(t),o={v:t.v,w:t.w};return i.isUndefined(t.name)||(o.name=t.name),i.isUndefined(n)||(o.value=n),o}))}function d(e){var t=new o(e.options).setGraph(e.value);return i.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),i.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}t.exports={write:r,read:d}},{"./graph":46,"./lodash":49}],49:[function(e,t,n){var i;if("function"==typeof e)try{i={clone:e("lodash/clone"),constant:e("lodash/constant"),each:e("lodash/each"),filter:e("lodash/filter"),has:e("lodash/has"),isArray:e("lodash/isArray"),isEmpty:e("lodash/isEmpty"),isFunction:e("lodash/isFunction"),isUndefined:e("lodash/isUndefined"),keys:e("lodash/keys"),map:e("lodash/map"),reduce:e("lodash/reduce"),size:e("lodash/size"),transform:e("lodash/transform"),union:e("lodash/union"),values:e("lodash/values")}}catch(e){}i||(i=window._),t.exports=i},{"lodash/clone":226,"lodash/constant":228,"lodash/each":230,"lodash/filter":232,"lodash/has":239,"lodash/isArray":243,"lodash/isEmpty":247,"lodash/isFunction":248,"lodash/isUndefined":258,"lodash/keys":259,"lodash/map":262,"lodash/reduce":274,"lodash/size":275,"lodash/transform":284,"lodash/union":285,"lodash/values":287}],50:[function(e,t,n){t.exports="2.1.8"},{}],51:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"DataView");t.exports=i},{"./_getNative":163,"./_root":208}],52:[function(e,t,n){var i=e("./_hashClear"),o=e("./_hashDelete"),r=e("./_hashGet"),a=e("./_hashHas"),s=e("./_hashSet");function d(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=r,d.prototype.has=a,d.prototype.set=s,t.exports=d},{"./_hashClear":172,"./_hashDelete":173,"./_hashGet":174,"./_hashHas":175,"./_hashSet":176}],53:[function(e,t,n){var i=e("./_listCacheClear"),o=e("./_listCacheDelete"),r=e("./_listCacheGet"),a=e("./_listCacheHas"),s=e("./_listCacheSet");function d(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=r,d.prototype.has=a,d.prototype.set=s,t.exports=d},{"./_listCacheClear":188,"./_listCacheDelete":189,"./_listCacheGet":190,"./_listCacheHas":191,"./_listCacheSet":192}],54:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"Map");t.exports=i},{"./_getNative":163,"./_root":208}],55:[function(e,t,n){var i=e("./_mapCacheClear"),o=e("./_mapCacheDelete"),r=e("./_mapCacheGet"),a=e("./_mapCacheHas"),s=e("./_mapCacheSet");function d(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=r,d.prototype.has=a,d.prototype.set=s,t.exports=d},{"./_mapCacheClear":193,"./_mapCacheDelete":194,"./_mapCacheGet":195,"./_mapCacheHas":196,"./_mapCacheSet":197}],56:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"Promise");t.exports=i},{"./_getNative":163,"./_root":208}],57:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"Set");t.exports=i},{"./_getNative":163,"./_root":208}],58:[function(e,t,n){var i=e("./_MapCache"),o=e("./_setCacheAdd"),r=e("./_setCacheHas");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=r,t.exports=a},{"./_MapCache":55,"./_setCacheAdd":210,"./_setCacheHas":211}],59:[function(e,t,n){var i=e("./_ListCache"),o=e("./_stackClear"),r=e("./_stackDelete"),a=e("./_stackGet"),s=e("./_stackHas"),d=e("./_stackSet");function c(e){var t=this.__data__=new i(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=s,c.prototype.set=d,t.exports=c},{"./_ListCache":53,"./_stackClear":215,"./_stackDelete":216,"./_stackGet":217,"./_stackHas":218,"./_stackSet":219}],60:[function(e,t,n){var i=e("./_root").Symbol;t.exports=i},{"./_root":208}],61:[function(e,t,n){var i=e("./_root").Uint8Array;t.exports=i},{"./_root":208}],62:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"WeakMap");t.exports=i},{"./_getNative":163,"./_root":208}],63:[function(e,t,n){function i(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=i},{}],64:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}t.exports=i},{}],65:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length,o=0,r=[];++n<i;){var a=e[n];t(a,n,e)&&(r[o++]=a)}return r}t.exports=i},{}],66:[function(e,t,n){var i=e("./_baseIndexOf");function o(e,t){return!(null==e||!e.length)&&i(e,t,0)>-1}t.exports=o},{"./_baseIndexOf":95}],67:[function(e,t,n){function i(e,t,n){for(var i=-1,o=null==e?0:e.length;++i<o;)if(n(t,e[i]))return!0;return!1}t.exports=i},{}],68:[function(e,t,n){var i=e("./_baseTimes"),o=e("./isArguments"),r=e("./isArray"),a=e("./isBuffer"),s=e("./_isIndex"),d=e("./isTypedArray"),c=Object.prototype.hasOwnProperty;function l(e,t){var n=r(e),l=!n&&o(e),u=!n&&!l&&a(e),p=!n&&!l&&!u&&d(e),f=n||l||u||p,h=f?i(e.length,String):[],g=h.length;for(var y in e)!t&&!c.call(e,y)||f&&("length"==y||u&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,g))||h.push(y);return h}t.exports=l},{"./_baseTimes":125,"./_isIndex":181,"./isArguments":242,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],69:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o}t.exports=i},{}],70:[function(e,t,n){function i(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}t.exports=i},{}],71:[function(e,t,n){function i(e,t,n,i){var o=-1,r=null==e?0:e.length;for(i&&r&&(n=e[++o]);++o<r;)n=t(n,e[o],o,e);return n}t.exports=i},{}],72:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}t.exports=i},{}],73:[function(e,t,n){var i=e("./_baseProperty")("length");t.exports=i},{"./_baseProperty":117}],74:[function(e,t,n){var i=e("./_baseAssignValue"),o=e("./eq");function r(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&i(e,t,n)}t.exports=r},{"./_baseAssignValue":79,"./eq":231}],75:[function(e,t,n){var i=e("./_baseAssignValue"),o=e("./eq"),r=Object.prototype.hasOwnProperty;function a(e,t,n){var a=e[t];r.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||i(e,t,n)}t.exports=a},{"./_baseAssignValue":79,"./eq":231}],76:[function(e,t,n){var i=e("./eq");function o(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}t.exports=o},{"./eq":231}],77:[function(e,t,n){var i=e("./_copyObject"),o=e("./keys");function r(e,t){return e&&i(t,o(t),e)}t.exports=r},{"./_copyObject":143,"./keys":259}],78:[function(e,t,n){var i=e("./_copyObject"),o=e("./keysIn");function r(e,t){return e&&i(t,o(t),e)}t.exports=r},{"./_copyObject":143,"./keysIn":260}],79:[function(e,t,n){var i=e("./_defineProperty");function o(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}t.exports=o},{"./_defineProperty":153}],80:[function(e,t,n){var i=e("./_Stack"),o=e("./_arrayEach"),r=e("./_assignValue"),a=e("./_baseAssign"),s=e("./_baseAssignIn"),d=e("./_cloneBuffer"),c=e("./_copyArray"),l=e("./_copySymbols"),u=e("./_copySymbolsIn"),p=e("./_getAllKeys"),f=e("./_getAllKeysIn"),h=e("./_getTag"),g=e("./_initCloneArray"),y=e("./_initCloneByTag"),m=e("./_initCloneObject"),_=e("./isArray"),v=e("./isBuffer"),b=e("./isMap"),P=e("./isObject"),k=e("./isSet"),I=e("./keys"),N=1,E=2,S=4,O="[object Arguments]",C="[object Array]",j="[object Boolean]",T="[object Date]",w="[object Error]",L="[object Function]",A="[object GeneratorFunction]",x="[object Map]",D="[object Number]",M="[object Object]",R="[object RegExp]",U="[object Set]",F="[object String]",B="[object Symbol]",H="[object WeakMap]",G="[object ArrayBuffer]",q="[object DataView]",V="[object Float32Array]",z="[object Float64Array]",$="[object Int8Array]",W="[object Int16Array]",K="[object Int32Array]",Y="[object Uint8Array]",X="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",Q={};function ee(e,t,n,C,j,T){var w,x=t&N,D=t&E,R=t&S;if(n&&(w=j?n(e,C,j,T):n(e)),void 0!==w)return w;if(!P(e))return e;var U=_(e);if(U){if(w=g(e),!x)return c(e,w)}else{var F=h(e),B=F==L||F==A;if(v(e))return d(e,x);if(F==M||F==O||B&&!j){if(w=D||B?{}:m(e),!x)return D?u(e,s(w,e)):l(e,a(w,e))}else{if(!Q[F])return j?e:{};w=y(e,F,x)}}T||(T=new i);var H=T.get(e);if(H)return H;T.set(e,w),k(e)?e.forEach((function(i){w.add(ee(i,t,n,i,e,T))})):b(e)&&e.forEach((function(i,o){w.set(o,ee(i,t,n,o,e,T))}));var G=R?D?f:p:D?keysIn:I,q=U?void 0:G(e);return o(q||e,(function(i,o){q&&(i=e[o=i]),r(w,o,ee(i,t,n,o,e,T))})),w}Q[O]=Q[C]=Q[G]=Q[q]=Q[j]=Q[T]=Q[V]=Q[z]=Q[$]=Q[W]=Q[K]=Q[x]=Q[D]=Q[M]=Q[R]=Q[U]=Q[F]=Q[B]=Q[Y]=Q[X]=Q[J]=Q[Z]=!0,Q[w]=Q[L]=Q[H]=!1,t.exports=ee},{"./_Stack":59,"./_arrayEach":64,"./_assignValue":75,"./_baseAssign":77,"./_baseAssignIn":78,"./_cloneBuffer":135,"./_copyArray":142,"./_copySymbols":144,"./_copySymbolsIn":145,"./_getAllKeys":159,"./_getAllKeysIn":160,"./_getTag":168,"./_initCloneArray":177,"./_initCloneByTag":178,"./_initCloneObject":179,"./isArray":243,"./isBuffer":246,"./isMap":250,"./isObject":251,"./isSet":254,"./keys":259}],81:[function(e,t,n){var i=e("./isObject"),o=Object.create,r=function(){function e(){}return function(t){if(!i(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();t.exports=r},{"./isObject":251}],82:[function(e,t,n){var i=e("./_baseForOwn"),o=e("./_createBaseEach")(i);t.exports=o},{"./_baseForOwn":88,"./_createBaseEach":148}],83:[function(e,t,n){var i=e("./isSymbol");function o(e,t,n){for(var o=-1,r=e.length;++o<r;){var a=e[o],s=t(a);if(null!=s&&(void 0===d?s==s&&!i(s):n(s,d)))var d=s,c=a}return c}t.exports=o},{"./isSymbol":256}],84:[function(e,t,n){var i=e("./_baseEach");function o(e,t){var n=[];return i(e,(function(e,i,o){t(e,i,o)&&n.push(e)})),n}t.exports=o},{"./_baseEach":82}],85:[function(e,t,n){function i(e,t,n,i){for(var o=e.length,r=n+(i?1:-1);i?r--:++r<o;)if(t(e[r],r,e))return r;return-1}t.exports=i},{}],86:[function(e,t,n){var i=e("./_arrayPush"),o=e("./_isFlattenable");function r(e,t,n,a,s){var d=-1,c=e.length;for(n||(n=o),s||(s=[]);++d<c;){var l=e[d];t>0&&n(l)?t>1?r(l,t-1,n,a,s):i(s,l):a||(s[s.length]=l)}return s}t.exports=r},{"./_arrayPush":70,"./_isFlattenable":180}],87:[function(e,t,n){var i=e("./_createBaseFor")();t.exports=i},{"./_createBaseFor":149}],88:[function(e,t,n){var i=e("./_baseFor"),o=e("./keys");function r(e,t){return e&&i(e,t,o)}t.exports=r},{"./_baseFor":87,"./keys":259}],89:[function(e,t,n){var i=e("./_castPath"),o=e("./_toKey");function r(e,t){for(var n=0,r=(t=i(t,e)).length;null!=e&&n<r;)e=e[o(t[n++])];return n&&n==r?e:void 0}t.exports=r},{"./_castPath":133,"./_toKey":223}],90:[function(e,t,n){var i=e("./_arrayPush"),o=e("./isArray");function r(e,t,n){var r=t(e);return o(e)?r:i(r,n(e))}t.exports=r},{"./_arrayPush":70,"./isArray":243}],91:[function(e,t,n){var i=e("./_Symbol"),o=e("./_getRawTag"),r=e("./_objectToString"),a="[object Null]",s="[object Undefined]",d=i?i.toStringTag:void 0;function c(e){return null==e?void 0===e?s:a:d&&d in Object(e)?o(e):r(e)}t.exports=c},{"./_Symbol":60,"./_getRawTag":165,"./_objectToString":205}],92:[function(e,t,n){function i(e,t){return e>t}t.exports=i},{}],93:[function(e,t,n){var i=Object.prototype.hasOwnProperty;function o(e,t){return null!=e&&i.call(e,t)}t.exports=o},{}],94:[function(e,t,n){function i(e,t){return null!=e&&t in Object(e)}t.exports=i},{}],95:[function(e,t,n){var i=e("./_baseFindIndex"),o=e("./_baseIsNaN"),r=e("./_strictIndexOf");function a(e,t,n){return t==t?r(e,t,n):i(e,o,n)}t.exports=a},{"./_baseFindIndex":85,"./_baseIsNaN":101,"./_strictIndexOf":220}],96:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isObjectLike"),r="[object Arguments]";function a(e){return o(e)&&i(e)==r}t.exports=a},{"./_baseGetTag":91,"./isObjectLike":252}],97:[function(e,t,n){var i=e("./_baseIsEqualDeep"),o=e("./isObjectLike");function r(e,t,n,a,s){return e===t||(null==e||null==t||!o(e)&&!o(t)?e!=e&&t!=t:i(e,t,n,a,r,s))}t.exports=r},{"./_baseIsEqualDeep":98,"./isObjectLike":252}],98:[function(e,t,n){var i=e("./_Stack"),o=e("./_equalArrays"),r=e("./_equalByTag"),a=e("./_equalObjects"),s=e("./_getTag"),d=e("./isArray"),c=e("./isBuffer"),l=e("./isTypedArray"),u=1,p="[object Arguments]",f="[object Array]",h="[object Object]",g=Object.prototype.hasOwnProperty;function y(e,t,n,y,m,_){var v=d(e),b=d(t),P=v?f:s(e),k=b?f:s(t),I=(P=P==p?h:P)==h,N=(k=k==p?h:k)==h,E=P==k;if(E&&c(e)){if(!c(t))return!1;v=!0,I=!1}if(E&&!I)return _||(_=new i),v||l(e)?o(e,t,n,y,m,_):r(e,t,P,n,y,m,_);if(!(n&u)){var S=I&&g.call(e,"__wrapped__"),O=N&&g.call(t,"__wrapped__");if(S||O){var C=S?e.value():e,j=O?t.value():t;return _||(_=new i),m(C,j,n,y,_)}}return!!E&&(_||(_=new i),a(e,t,n,y,m,_))}t.exports=y},{"./_Stack":59,"./_equalArrays":154,"./_equalByTag":155,"./_equalObjects":156,"./_getTag":168,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],99:[function(e,t,n){var i=e("./_getTag"),o=e("./isObjectLike"),r="[object Map]";function a(e){return o(e)&&i(e)==r}t.exports=a},{"./_getTag":168,"./isObjectLike":252}],100:[function(e,t,n){var i=e("./_Stack"),o=e("./_baseIsEqual"),r=1,a=2;function s(e,t,n,s){var d=n.length,c=d,l=!s;if(null==e)return!c;for(e=Object(e);d--;){var u=n[d];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++d<c;){var p=(u=n[d])[0],f=e[p],h=u[1];if(l&&u[2]){if(void 0===f&&!(p in e))return!1}else{var g=new i;if(s)var y=s(f,h,p,e,t,g);if(!(void 0===y?o(h,f,r|a,s,g):y))return!1}}return!0}t.exports=s},{"./_Stack":59,"./_baseIsEqual":97}],101:[function(e,t,n){function i(e){return e!=e}t.exports=i},{}],102:[function(e,t,n){var i=e("./isFunction"),o=e("./_isMasked"),r=e("./isObject"),a=e("./_toSource"),s=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,p=l.hasOwnProperty,f=RegExp("^"+u.call(p).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(e){return!(!r(e)||o(e))&&(i(e)?f:d).test(a(e))}t.exports=h},{"./_isMasked":185,"./_toSource":224,"./isFunction":248,"./isObject":251}],103:[function(e,t,n){var i=e("./_getTag"),o=e("./isObjectLike"),r="[object Set]";function a(e){return o(e)&&i(e)==r}t.exports=a},{"./_getTag":168,"./isObjectLike":252}],104:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isLength"),r=e("./isObjectLike"),a="[object Arguments]",s="[object Array]",d="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",p="[object Map]",f="[object Number]",h="[object Object]",g="[object RegExp]",y="[object Set]",m="[object String]",_="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",P="[object Float64Array]",k="[object Int8Array]",I="[object Int16Array]",N="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",O="[object Uint16Array]",C="[object Uint32Array]",j={};function T(e){return r(e)&&o(e.length)&&!!j[i(e)]}j["[object Float32Array]"]=j[P]=j[k]=j[I]=j[N]=j[E]=j[S]=j[O]=j[C]=!0,j[a]=j[s]=j[v]=j[d]=j[b]=j[c]=j[l]=j[u]=j[p]=j[f]=j[h]=j[g]=j[y]=j[m]=j[_]=!1,t.exports=T},{"./_baseGetTag":91,"./isLength":249,"./isObjectLike":252}],105:[function(e,t,n){var i=e("./_baseMatches"),o=e("./_baseMatchesProperty"),r=e("./identity"),a=e("./isArray"),s=e("./property");function d(e){return"function"==typeof e?e:null==e?r:"object"==typeof e?a(e)?o(e[0],e[1]):i(e):s(e)}t.exports=d},{"./_baseMatches":110,"./_baseMatchesProperty":111,"./identity":241,"./isArray":243,"./property":272}],106:[function(e,t,n){var i=e("./_isPrototype"),o=e("./_nativeKeys"),r=Object.prototype.hasOwnProperty;function a(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))r.call(e,n)&&"constructor"!=n&&t.push(n);return t}t.exports=a},{"./_isPrototype":186,"./_nativeKeys":202}],107:[function(e,t,n){var i=e("./isObject"),o=e("./_isPrototype"),r=e("./_nativeKeysIn"),a=Object.prototype.hasOwnProperty;function s(e){if(!i(e))return r(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}t.exports=s},{"./_isPrototype":186,"./_nativeKeysIn":203,"./isObject":251}],108:[function(e,t,n){function i(e,t){return e<t}t.exports=i},{}],109:[function(e,t,n){var i=e("./_baseEach"),o=e("./isArrayLike");function r(e,t){var n=-1,r=o(e)?Array(e.length):[];return i(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}t.exports=r},{"./_baseEach":82,"./isArrayLike":244}],110:[function(e,t,n){var i=e("./_baseIsMatch"),o=e("./_getMatchData"),r=e("./_matchesStrictComparable");function a(e){var t=o(e);return 1==t.length&&t[0][2]?r(t[0][0],t[0][1]):function(n){return n===e||i(n,e,t)}}t.exports=a},{"./_baseIsMatch":100,"./_getMatchData":162,"./_matchesStrictComparable":199}],111:[function(e,t,n){var i=e("./_baseIsEqual"),o=e("./get"),r=e("./hasIn"),a=e("./_isKey"),s=e("./_isStrictComparable"),d=e("./_matchesStrictComparable"),c=e("./_toKey"),l=1,u=2;function p(e,t){return a(e)&&s(t)?d(c(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?r(n,e):i(t,a,l|u)}}t.exports=p},{"./_baseIsEqual":97,"./_isKey":183,"./_isStrictComparable":187,"./_matchesStrictComparable":199,"./_toKey":223,"./get":238,"./hasIn":240}],112:[function(e,t,n){var i=e("./_Stack"),o=e("./_assignMergeValue"),r=e("./_baseFor"),a=e("./_baseMergeDeep"),s=e("./isObject"),d=e("./keysIn"),c=e("./_safeGet");function l(e,t,n,u,p){e!==t&&r(t,(function(r,d){if(p||(p=new i),s(r))a(e,t,d,n,l,u,p);else{var f=u?u(c(e,d),r,d+"",e,t,p):void 0;void 0===f&&(f=r),o(e,d,f)}}),d)}t.exports=l},{"./_Stack":59,"./_assignMergeValue":74,"./_baseFor":87,"./_baseMergeDeep":113,"./_safeGet":209,"./isObject":251,"./keysIn":260}],113:[function(e,t,n){var i=e("./_assignMergeValue"),o=e("./_cloneBuffer"),r=e("./_cloneTypedArray"),a=e("./_copyArray"),s=e("./_initCloneObject"),d=e("./isArguments"),c=e("./isArray"),l=e("./isArrayLikeObject"),u=e("./isBuffer"),p=e("./isFunction"),f=e("./isObject"),h=e("./isPlainObject"),g=e("./isTypedArray"),y=e("./_safeGet"),m=e("./toPlainObject");function _(e,t,n,_,v,b,P){var k=y(e,n),I=y(t,n),N=P.get(I);if(N)i(e,n,N);else{var E=b?b(k,I,n+"",e,t,P):void 0,S=void 0===E;if(S){var O=c(I),C=!O&&u(I),j=!O&&!C&&g(I);E=I,O||C||j?c(k)?E=k:l(k)?E=a(k):C?(S=!1,E=o(I,!0)):j?(S=!1,E=r(I,!0)):E=[]:h(I)||d(I)?(E=k,d(k)?E=m(k):f(k)&&!p(k)||(E=s(I))):S=!1}S&&(P.set(I,E),v(E,I,_,b,P),P.delete(I)),i(e,n,E)}}t.exports=_},{"./_assignMergeValue":74,"./_cloneBuffer":135,"./_cloneTypedArray":139,"./_copyArray":142,"./_initCloneObject":179,"./_safeGet":209,"./isArguments":242,"./isArray":243,"./isArrayLikeObject":245,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isPlainObject":253,"./isTypedArray":257,"./toPlainObject":282}],114:[function(e,t,n){var i=e("./_arrayMap"),o=e("./_baseIteratee"),r=e("./_baseMap"),a=e("./_baseSortBy"),s=e("./_baseUnary"),d=e("./_compareMultiple"),c=e("./identity");function l(e,t,n){var l=-1;t=i(t.length?t:[c],s(o));var u=r(e,(function(e,n,o){return{criteria:i(t,(function(t){return t(e)})),index:++l,value:e}}));return a(u,(function(e,t){return d(e,t,n)}))}t.exports=l},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./_baseSortBy":124,"./_baseUnary":127,"./_compareMultiple":141,"./identity":241}],115:[function(e,t,n){var i=e("./_basePickBy"),o=e("./hasIn");function r(e,t){return i(e,t,(function(t,n){return o(e,n)}))}t.exports=r},{"./_basePickBy":116,"./hasIn":240}],116:[function(e,t,n){var i=e("./_baseGet"),o=e("./_baseSet"),r=e("./_castPath");function a(e,t,n){for(var a=-1,s=t.length,d={};++a<s;){var c=t[a],l=i(e,c);n(l,c)&&o(d,r(c,e),l)}return d}t.exports=a},{"./_baseGet":89,"./_baseSet":122,"./_castPath":133}],117:[function(e,t,n){function i(e){return function(t){return null==t?void 0:t[e]}}t.exports=i},{}],118:[function(e,t,n){var i=e("./_baseGet");function o(e){return function(t){return i(t,e)}}t.exports=o},{"./_baseGet":89}],119:[function(e,t,n){var i=Math.ceil,o=Math.max;function r(e,t,n,r){for(var a=-1,s=o(i((t-e)/(n||1)),0),d=Array(s);s--;)d[r?s:++a]=e,e+=n;return d}t.exports=r},{}],120:[function(e,t,n){function i(e,t,n,i,o){return o(e,(function(e,o,r){n=i?(i=!1,e):t(n,e,o,r)})),n}t.exports=i},{}],121:[function(e,t,n){var i=e("./identity"),o=e("./_overRest"),r=e("./_setToString");function a(e,t){return r(o(e,t,i),e+"")}t.exports=a},{"./_overRest":207,"./_setToString":213,"./identity":241}],122:[function(e,t,n){var i=e("./_assignValue"),o=e("./_castPath"),r=e("./_isIndex"),a=e("./isObject"),s=e("./_toKey");function d(e,t,n,d){if(!a(e))return e;for(var c=-1,l=(t=o(t,e)).length,u=l-1,p=e;null!=p&&++c<l;){var f=s(t[c]),h=n;if(c!=u){var g=p[f];void 0===(h=d?d(g,f,p):void 0)&&(h=a(g)?g:r(t[c+1])?[]:{})}i(p,f,h),p=p[f]}return e}t.exports=d},{"./_assignValue":75,"./_castPath":133,"./_isIndex":181,"./_toKey":223,"./isObject":251}],123:[function(e,t,n){var i=e("./constant"),o=e("./_defineProperty"),r=e("./identity"),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:r;t.exports=a},{"./_defineProperty":153,"./constant":228,"./identity":241}],124:[function(e,t,n){function i(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=i},{}],125:[function(e,t,n){function i(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}t.exports=i},{}],126:[function(e,t,n){var i=e("./_Symbol"),o=e("./_arrayMap"),r=e("./isArray"),a=e("./isSymbol"),s=1/0,d=i?i.prototype:void 0,c=d?d.toString:void 0;function l(e){if("string"==typeof e)return e;if(r(e))return o(e,l)+"";if(a(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}t.exports=l},{"./_Symbol":60,"./_arrayMap":69,"./isArray":243,"./isSymbol":256}],127:[function(e,t,n){function i(e){return function(t){return e(t)}}t.exports=i},{}],128:[function(e,t,n){var i=e("./_SetCache"),o=e("./_arrayIncludes"),r=e("./_arrayIncludesWith"),a=e("./_cacheHas"),s=e("./_createSet"),d=e("./_setToArray"),c=200;function l(e,t,n){var l=-1,u=o,p=e.length,f=!0,h=[],g=h;if(n)f=!1,u=r;else if(p>=c){var y=t?null:s(e);if(y)return d(y);f=!1,u=a,g=new i}else g=t?[]:h;e:for(;++l<p;){var m=e[l],_=t?t(m):m;if(m=n||0!==m?m:0,f&&_==_){for(var v=g.length;v--;)if(g[v]===_)continue e;t&&g.push(_),h.push(m)}else u(g,_,n)||(g!==h&&g.push(_),h.push(m))}return h}t.exports=l},{"./_SetCache":58,"./_arrayIncludes":66,"./_arrayIncludesWith":67,"./_cacheHas":131,"./_createSet":152,"./_setToArray":212}],129:[function(e,t,n){var i=e("./_arrayMap");function o(e,t){return i(t,(function(t){return e[t]}))}t.exports=o},{"./_arrayMap":69}],130:[function(e,t,n){function i(e,t,n){for(var i=-1,o=e.length,r=t.length,a={};++i<o;){var s=i<r?t[i]:void 0;n(a,e[i],s)}return a}t.exports=i},{}],131:[function(e,t,n){function i(e,t){return e.has(t)}t.exports=i},{}],132:[function(e,t,n){var i=e("./identity");function o(e){return"function"==typeof e?e:i}t.exports=o},{"./identity":241}],133:[function(e,t,n){var i=e("./isArray"),o=e("./_isKey"),r=e("./_stringToPath"),a=e("./toString");function s(e,t){return i(e)?e:o(e,t)?[e]:r(a(e))}t.exports=s},{"./_isKey":183,"./_stringToPath":222,"./isArray":243,"./toString":283}],134:[function(e,t,n){var i=e("./_Uint8Array");function o(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}t.exports=o},{"./_Uint8Array":61}],135:[function(e,t,n){var i=e("./_root"),o="object"==typeof n&&n&&!n.nodeType&&n,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=r&&r.exports===o?i.Buffer:void 0,s=a?a.allocUnsafe:void 0;function d(e,t){if(t)return e.slice();var n=e.length,i=s?s(n):new e.constructor(n);return e.copy(i),i}t.exports=d},{"./_root":208}],136:[function(e,t,n){var i=e("./_cloneArrayBuffer");function o(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}t.exports=o},{"./_cloneArrayBuffer":134}],137:[function(e,t,n){var i=/\w*$/;function o(e){var t=new e.constructor(e.source,i.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=o},{}],138:[function(e,t,n){var i=e("./_Symbol"),o=i?i.prototype:void 0,r=o?o.valueOf:void 0;function a(e){return r?Object(r.call(e)):{}}t.exports=a},{"./_Symbol":60}],139:[function(e,t,n){var i=e("./_cloneArrayBuffer");function o(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}t.exports=o},{"./_cloneArrayBuffer":134}],140:[function(e,t,n){var i=e("./isSymbol");function o(e,t){if(e!==t){var n=void 0!==e,o=null===e,r=e==e,a=i(e),s=void 0!==t,d=null===t,c=t==t,l=i(t);if(!d&&!l&&!a&&e>t||a&&s&&c&&!d&&!l||o&&s&&c||!n&&c||!r)return 1;if(!o&&!a&&!l&&e<t||l&&n&&r&&!o&&!a||d&&n&&r||!s&&r||!c)return-1}return 0}t.exports=o},{"./isSymbol":256}],141:[function(e,t,n){var i=e("./_compareAscending");function o(e,t,n){for(var o=-1,r=e.criteria,a=t.criteria,s=r.length,d=n.length;++o<s;){var c=i(r[o],a[o]);if(c)return o>=d?c:c*("desc"==n[o]?-1:1)}return e.index-t.index}t.exports=o},{"./_compareAscending":140}],142:[function(e,t,n){function i(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}t.exports=i},{}],143:[function(e,t,n){var i=e("./_assignValue"),o=e("./_baseAssignValue");function r(e,t,n,r){var a=!n;n||(n={});for(var s=-1,d=t.length;++s<d;){var c=t[s],l=r?r(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?o(n,c,l):i(n,c,l)}return n}t.exports=r},{"./_assignValue":75,"./_baseAssignValue":79}],144:[function(e,t,n){var i=e("./_copyObject"),o=e("./_getSymbols");function r(e,t){return i(e,o(e),t)}t.exports=r},{"./_copyObject":143,"./_getSymbols":166}],145:[function(e,t,n){var i=e("./_copyObject"),o=e("./_getSymbolsIn");function r(e,t){return i(e,o(e),t)}t.exports=r},{"./_copyObject":143,"./_getSymbolsIn":167}],146:[function(e,t,n){var i=e("./_root")["__core-js_shared__"];t.exports=i},{"./_root":208}],147:[function(e,t,n){var i=e("./_baseRest"),o=e("./_isIterateeCall");function r(e){return i((function(t,n){var i=-1,r=n.length,a=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(r--,a):void 0,s&&o(n[0],n[1],s)&&(a=r<3?void 0:a,r=1),t=Object(t);++i<r;){var d=n[i];d&&e(t,d,i,a)}return t}))}t.exports=r},{"./_baseRest":121,"./_isIterateeCall":182}],148:[function(e,t,n){var i=e("./isArrayLike");function o(e,t){return function(n,o){if(null==n)return n;if(!i(n))return e(n,o);for(var r=n.length,a=t?r:-1,s=Object(n);(t?a--:++a<r)&&!1!==o(s[a],a,s););return n}}t.exports=o},{"./isArrayLike":244}],149:[function(e,t,n){function i(e){return function(t,n,i){for(var o=-1,r=Object(t),a=i(t),s=a.length;s--;){var d=a[e?s:++o];if(!1===n(r[d],d,r))break}return t}}t.exports=i},{}],150:[function(e,t,n){var i=e("./_baseIteratee"),o=e("./isArrayLike"),r=e("./keys");function a(e){return function(t,n,a){var s=Object(t);if(!o(t)){var d=i(n,3);t=r(t),n=function(e){return d(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[d?t[c]:c]:void 0}}t.exports=a},{"./_baseIteratee":105,"./isArrayLike":244,"./keys":259}],151:[function(e,t,n){var i=e("./_baseRange"),o=e("./_isIterateeCall"),r=e("./toFinite");function a(e){return function(t,n,a){return a&&"number"!=typeof a&&o(t,n,a)&&(n=a=void 0),t=r(t),void 0===n?(n=t,t=0):n=r(n),a=void 0===a?t<n?1:-1:r(a),i(t,n,a,e)}}t.exports=a},{"./_baseRange":119,"./_isIterateeCall":182,"./toFinite":279}],152:[function(e,t,n){var i=e("./_Set"),o=e("./noop"),r=e("./_setToArray"),a=1/0,s=i&&1/r(new i([,-0]))[1]==a?function(e){return new i(e)}:o;t.exports=s},{"./_Set":57,"./_setToArray":212,"./noop":269}],153:[function(e,t,n){var i=e("./_getNative"),o=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.exports=o},{"./_getNative":163}],154:[function(e,t,n){var i=e("./_SetCache"),o=e("./_arraySome"),r=e("./_cacheHas"),a=1,s=2;function d(e,t,n,d,c,l){var u=n&a,p=e.length,f=t.length;if(p!=f&&!(u&&f>p))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var g=-1,y=!0,m=n&s?new i:void 0;for(l.set(e,t),l.set(t,e);++g<p;){var _=e[g],v=t[g];if(d)var b=u?d(v,_,g,t,e,l):d(_,v,g,e,t,l);if(void 0!==b){if(b)continue;y=!1;break}if(m){if(!o(t,(function(e,t){if(!r(m,t)&&(_===e||c(_,e,n,d,l)))return m.push(t)}))){y=!1;break}}else if(_!==v&&!c(_,v,n,d,l)){y=!1;break}}return l.delete(e),l.delete(t),y}t.exports=d},{"./_SetCache":58,"./_arraySome":72,"./_cacheHas":131}],155:[function(e,t,n){var i=e("./_Symbol"),o=e("./_Uint8Array"),r=e("./eq"),a=e("./_equalArrays"),s=e("./_mapToArray"),d=e("./_setToArray"),c=1,l=2,u="[object Boolean]",p="[object Date]",f="[object Error]",h="[object Map]",g="[object Number]",y="[object RegExp]",m="[object Set]",_="[object String]",v="[object Symbol]",b="[object ArrayBuffer]",P="[object DataView]",k=i?i.prototype:void 0,I=k?k.valueOf:void 0;function N(e,t,n,i,k,N,E){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!N(new o(e),new o(t)));case u:case p:case g:return r(+e,+t);case f:return e.name==t.name&&e.message==t.message;case y:case _:return e==t+"";case h:var S=s;case m:var O=i&c;if(S||(S=d),e.size!=t.size&&!O)return!1;var C=E.get(e);if(C)return C==t;i|=l,E.set(e,t);var j=a(S(e),S(t),i,k,N,E);return E.delete(e),j;case v:if(I)return I.call(e)==I.call(t)}return!1}t.exports=N},{"./_Symbol":60,"./_Uint8Array":61,"./_equalArrays":154,"./_mapToArray":198,"./_setToArray":212,"./eq":231}],156:[function(e,t,n){var i=e("./_getAllKeys"),o=1,r=Object.prototype.hasOwnProperty;function a(e,t,n,a,s,d){var c=n&o,l=i(e),u=l.length;if(u!=i(t).length&&!c)return!1;for(var p=u;p--;){var f=l[p];if(!(c?f in t:r.call(t,f)))return!1}var h=d.get(e);if(h&&d.get(t))return h==t;var g=!0;d.set(e,t),d.set(t,e);for(var y=c;++p<u;){var m=e[f=l[p]],_=t[f];if(a)var v=c?a(_,m,f,t,e,d):a(m,_,f,e,t,d);if(!(void 0===v?m===_||s(m,_,n,a,d):v)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=e.constructor,P=t.constructor;b==P||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof P&&P instanceof P||(g=!1)}return d.delete(e),d.delete(t),g}t.exports=a},{"./_getAllKeys":159}],157:[function(e,t,n){var i=e("./flatten"),o=e("./_overRest"),r=e("./_setToString");function a(e){return r(o(e,void 0,i),e+"")}t.exports=a},{"./_overRest":207,"./_setToString":213,"./flatten":235}],158:[function(e,n,i){(function(e){var t="object"==typeof e&&e&&e.Object===Object&&e;n.exports=t}).call(this,void 0!==t.commonjsGlobal?t.commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],159:[function(e,t,n){var i=e("./_baseGetAllKeys"),o=e("./_getSymbols"),r=e("./keys");function a(e){return i(e,r,o)}t.exports=a},{"./_baseGetAllKeys":90,"./_getSymbols":166,"./keys":259}],160:[function(e,t,n){var i=e("./_baseGetAllKeys"),o=e("./_getSymbolsIn"),r=e("./keysIn");function a(e){return i(e,r,o)}t.exports=a},{"./_baseGetAllKeys":90,"./_getSymbolsIn":167,"./keysIn":260}],161:[function(e,t,n){var i=e("./_isKeyable");function o(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}t.exports=o},{"./_isKeyable":184}],162:[function(e,t,n){var i=e("./_isStrictComparable"),o=e("./keys");function r(e){for(var t=o(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,i(a)]}return t}t.exports=r},{"./_isStrictComparable":187,"./keys":259}],163:[function(e,t,n){var i=e("./_baseIsNative"),o=e("./_getValue");function r(e,t){var n=o(e,t);return i(n)?n:void 0}t.exports=r},{"./_baseIsNative":102,"./_getValue":169}],164:[function(e,t,n){var i=e("./_overArg")(Object.getPrototypeOf,Object);t.exports=i},{"./_overArg":206}],165:[function(e,t,n){var i=e("./_Symbol"),o=Object.prototype,r=o.hasOwnProperty,a=o.toString,s=i?i.toStringTag:void 0;function d(e){var t=r.call(e,s),n=e[s];try{e[s]=void 0;var i=!0}catch(e){}var o=a.call(e);return i&&(t?e[s]=n:delete e[s]),o}t.exports=d},{"./_Symbol":60}],166:[function(e,t,n){var i=e("./_arrayFilter"),o=e("./stubArray"),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),i(a(e),(function(t){return r.call(e,t)})))}:o;t.exports=s},{"./_arrayFilter":65,"./stubArray":277}],167:[function(e,t,n){var i=e("./_arrayPush"),o=e("./_getPrototype"),r=e("./_getSymbols"),a=e("./stubArray"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)i(t,r(e)),e=o(e);return t}:a;t.exports=s},{"./_arrayPush":70,"./_getPrototype":164,"./_getSymbols":166,"./stubArray":277}],168:[function(e,t,n){var i=e("./_DataView"),o=e("./_Map"),r=e("./_Promise"),a=e("./_Set"),s=e("./_WeakMap"),d=e("./_baseGetTag"),c=e("./_toSource"),l="[object Map]",u="[object Object]",p="[object Promise]",f="[object Set]",h="[object WeakMap]",g="[object DataView]",y=c(i),m=c(o),_=c(r),v=c(a),b=c(s),P=d;(i&&P(new i(new ArrayBuffer(1)))!=g||o&&P(new o)!=l||r&&P(r.resolve())!=p||a&&P(new a)!=f||s&&P(new s)!=h)&&(P=function(e){var t=d(e),n=t==u?e.constructor:void 0,i=n?c(n):"";if(i)switch(i){case y:return g;case m:return l;case _:return p;case v:return f;case b:return h}return t}),t.exports=P},{"./_DataView":51,"./_Map":54,"./_Promise":56,"./_Set":57,"./_WeakMap":62,"./_baseGetTag":91,"./_toSource":224}],169:[function(e,t,n){function i(e,t){return null==e?void 0:e[t]}t.exports=i},{}],170:[function(e,t,n){var i=e("./_castPath"),o=e("./isArguments"),r=e("./isArray"),a=e("./_isIndex"),s=e("./isLength"),d=e("./_toKey");function c(e,t,n){for(var c=-1,l=(t=i(t,e)).length,u=!1;++c<l;){var p=d(t[c]);if(!(u=null!=e&&n(e,p)))break;e=e[p]}return u||++c!=l?u:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(r(e)||o(e))}t.exports=c},{"./_castPath":133,"./_isIndex":181,"./_toKey":223,"./isArguments":242,"./isArray":243,"./isLength":249}],171:[function(e,t,n){var i=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function o(e){return i.test(e)}t.exports=o},{}],172:[function(e,t,n){var i=e("./_nativeCreate");function o(){this.__data__=i?i(null):{},this.size=0}t.exports=o},{"./_nativeCreate":201}],173:[function(e,t,n){function i(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=i},{}],174:[function(e,t,n){var i=e("./_nativeCreate"),o="__lodash_hash_undefined__",r=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(i){var n=t[e];return n===o?void 0:n}return r.call(t,e)?t[e]:void 0}t.exports=a},{"./_nativeCreate":201}],175:[function(e,t,n){var i=e("./_nativeCreate"),o=Object.prototype.hasOwnProperty;function r(e){var t=this.__data__;return i?void 0!==t[e]:o.call(t,e)}t.exports=r},{"./_nativeCreate":201}],176:[function(e,t,n){var i=e("./_nativeCreate"),o="__lodash_hash_undefined__";function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?o:t,this}t.exports=r},{"./_nativeCreate":201}],177:[function(e,t,n){var i=Object.prototype.hasOwnProperty;function o(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(n.index=e.index,n.input=e.input),n}t.exports=o},{}],178:[function(e,t,n){var i=e("./_cloneArrayBuffer"),o=e("./_cloneDataView"),r=e("./_cloneRegExp"),a=e("./_cloneSymbol"),s=e("./_cloneTypedArray"),d="[object Boolean]",c="[object Date]",l="[object Map]",u="[object Number]",p="[object RegExp]",f="[object Set]",h="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",m="[object DataView]",_="[object Float32Array]",v="[object Float64Array]",b="[object Int8Array]",P="[object Int16Array]",k="[object Int32Array]",I="[object Uint8Array]",N="[object Uint8ClampedArray]",E="[object Uint16Array]",S="[object Uint32Array]";function O(e,t,n){var O=e.constructor;switch(t){case y:return i(e);case d:case c:return new O(+e);case m:return o(e,n);case _:case v:case b:case P:case k:case I:case N:case E:case S:return s(e,n);case l:return new O;case u:case h:return new O(e);case p:return r(e);case f:return new O;case g:return a(e)}}t.exports=O},{"./_cloneArrayBuffer":134,"./_cloneDataView":136,"./_cloneRegExp":137,"./_cloneSymbol":138,"./_cloneTypedArray":139}],179:[function(e,t,n){var i=e("./_baseCreate"),o=e("./_getPrototype"),r=e("./_isPrototype");function a(e){return"function"!=typeof e.constructor||r(e)?{}:i(o(e))}t.exports=a},{"./_baseCreate":81,"./_getPrototype":164,"./_isPrototype":186}],180:[function(e,t,n){var i=e("./_Symbol"),o=e("./isArguments"),r=e("./isArray"),a=i?i.isConcatSpreadable:void 0;function s(e){return r(e)||o(e)||!!(a&&e&&e[a])}t.exports=s},{"./_Symbol":60,"./isArguments":242,"./isArray":243}],181:[function(e,t,n){var i=9007199254740991,o=/^(?:0|[1-9]\d*)$/;function r(e,t){var n=typeof e;return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r},{}],182:[function(e,t,n){var i=e("./eq"),o=e("./isArrayLike"),r=e("./_isIndex"),a=e("./isObject");function s(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&r(t,n.length):"string"==s&&t in n)&&i(n[t],e)}t.exports=s},{"./_isIndex":181,"./eq":231,"./isArrayLike":244,"./isObject":251}],183:[function(e,t,n){var i=e("./isArray"),o=e("./isSymbol"),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function s(e,t){if(i(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!r.test(e)||null!=t&&e in Object(t)}t.exports=s},{"./isArray":243,"./isSymbol":256}],184:[function(e,t,n){function i(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}t.exports=i},{}],185:[function(e,t,n){var i,o=e("./_coreJsData"),r=(i=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";function a(e){return!!r&&r in e}t.exports=a},{"./_coreJsData":146}],186:[function(e,t,n){var i=Object.prototype;function o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}t.exports=o},{}],187:[function(e,t,n){var i=e("./isObject");function o(e){return e==e&&!i(e)}t.exports=o},{"./isObject":251}],188:[function(e,t,n){function i(){this.__data__=[],this.size=0}t.exports=i},{}],189:[function(e,t,n){var i=e("./_assocIndexOf"),o=Array.prototype.splice;function r(e){var t=this.__data__,n=i(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}t.exports=r},{"./_assocIndexOf":76}],190:[function(e,t,n){var i=e("./_assocIndexOf");function o(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}t.exports=o},{"./_assocIndexOf":76}],191:[function(e,t,n){var i=e("./_assocIndexOf");function o(e){return i(this.__data__,e)>-1}t.exports=o},{"./_assocIndexOf":76}],192:[function(e,t,n){var i=e("./_assocIndexOf");function o(e,t){var n=this.__data__,o=i(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}t.exports=o},{"./_assocIndexOf":76}],193:[function(e,t,n){var i=e("./_Hash"),o=e("./_ListCache"),r=e("./_Map");function a(){this.size=0,this.__data__={hash:new i,map:new(r||o),string:new i}}t.exports=a},{"./_Hash":52,"./_ListCache":53,"./_Map":54}],194:[function(e,t,n){var i=e("./_getMapData");function o(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}t.exports=o},{"./_getMapData":161}],195:[function(e,t,n){var i=e("./_getMapData");function o(e){return i(this,e).get(e)}t.exports=o},{"./_getMapData":161}],196:[function(e,t,n){var i=e("./_getMapData");function o(e){return i(this,e).has(e)}t.exports=o},{"./_getMapData":161}],197:[function(e,t,n){var i=e("./_getMapData");function o(e,t){var n=i(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}t.exports=o},{"./_getMapData":161}],198:[function(e,t,n){function i(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}t.exports=i},{}],199:[function(e,t,n){function i(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}t.exports=i},{}],200:[function(e,t,n){var i=e("./memoize"),o=500;function r(e){var t=i(e,(function(e){return n.size===o&&n.clear(),e})),n=t.cache;return t}t.exports=r},{"./memoize":265}],201:[function(e,t,n){var i=e("./_getNative")(Object,"create");t.exports=i},{"./_getNative":163}],202:[function(e,t,n){var i=e("./_overArg")(Object.keys,Object);t.exports=i},{"./_overArg":206}],203:[function(e,t,n){function i(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.exports=i},{}],204:[function(e,t,n){var i=e("./_freeGlobal"),o="object"==typeof n&&n&&!n.nodeType&&n,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=r&&r.exports===o&&i.process,s=function(){try{var e=r&&r.require&&r.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=s},{"./_freeGlobal":158}],205:[function(e,t,n){var i=Object.prototype.toString;function o(e){return i.call(e)}t.exports=o},{}],206:[function(e,t,n){function i(e,t){return function(n){return e(t(n))}}t.exports=i},{}],207:[function(e,t,n){var i=e("./_apply"),o=Math.max;function r(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=o(r.length-t,0),d=Array(s);++a<s;)d[a]=r[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=r[a];return c[t]=n(d),i(e,this,c)}}t.exports=r},{"./_apply":63}],208:[function(e,t,n){var i=e("./_freeGlobal"),o="object"==typeof self&&self&&self.Object===Object&&self,r=i||o||Function("return this")();t.exports=r},{"./_freeGlobal":158}],209:[function(e,t,n){function i(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}t.exports=i},{}],210:[function(e,t,n){var i="__lodash_hash_undefined__";function o(e){return this.__data__.set(e,i),this}t.exports=o},{}],211:[function(e,t,n){function i(e){return this.__data__.has(e)}t.exports=i},{}],212:[function(e,t,n){function i(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}t.exports=i},{}],213:[function(e,t,n){var i=e("./_baseSetToString"),o=e("./_shortOut")(i);t.exports=o},{"./_baseSetToString":123,"./_shortOut":214}],214:[function(e,t,n){var i=800,o=16,r=Date.now;function a(e){var t=0,n=0;return function(){var a=r(),s=o-(a-n);if(n=a,s>0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a},{}],215:[function(e,t,n){var i=e("./_ListCache");function o(){this.__data__=new i,this.size=0}t.exports=o},{"./_ListCache":53}],216:[function(e,t,n){function i(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=i},{}],217:[function(e,t,n){function i(e){return this.__data__.get(e)}t.exports=i},{}],218:[function(e,t,n){function i(e){return this.__data__.has(e)}t.exports=i},{}],219:[function(e,t,n){var i=e("./_ListCache"),o=e("./_Map"),r=e("./_MapCache"),a=200;function s(e,t){var n=this.__data__;if(n instanceof i){var s=n.__data__;if(!o||s.length<a-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new r(s)}return n.set(e,t),this.size=n.size,this}t.exports=s},{"./_ListCache":53,"./_Map":54,"./_MapCache":55}],220:[function(e,t,n){function i(e,t,n){for(var i=n-1,o=e.length;++i<o;)if(e[i]===t)return i;return-1}t.exports=i},{}],221:[function(e,t,n){var i=e("./_asciiSize"),o=e("./_hasUnicode"),r=e("./_unicodeSize");function a(e){return o(e)?r(e):i(e)}t.exports=a},{"./_asciiSize":73,"./_hasUnicode":171,"./_unicodeSize":225}],222:[function(e,t,n){var i=e("./_memoizeCapped"),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=i((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,i,o){t.push(i?o.replace(r,"$1"):n||e)})),t}));t.exports=a},{"./_memoizeCapped":200}],223:[function(e,t,n){var i=e("./isSymbol"),o=1/0;function r(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}t.exports=r},{"./isSymbol":256}],224:[function(e,t,n){var i=Function.prototype.toString;function o(e){if(null!=e){try{return i.call(e)}catch(e){}try{return e+""}catch(e){}}return""}t.exports=o},{}],225:[function(e,t,n){var i="\\ud800-\\udfff",o="["+i+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",a="\\ud83c[\\udffb-\\udfff]",s="[^"+i+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+a+")?",u="[\\ufe0e\\ufe0f]?",p=u+l+"(?:\\u200d(?:"+[s,d,c].join("|")+")"+u+l+")*",f="(?:"+[s+r+"?",r,d,c,o].join("|")+")",h=RegExp(a+"(?="+a+")|"+f+p,"g");function g(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}t.exports=g},{}],226:[function(e,t,n){var i=e("./_baseClone"),o=4;function r(e){return i(e,o)}t.exports=r},{"./_baseClone":80}],227:[function(e,t,n){var i=e("./_baseClone"),o=1,r=4;function a(e){return i(e,o|r)}t.exports=a},{"./_baseClone":80}],228:[function(e,t,n){function i(e){return function(){return e}}t.exports=i},{}],229:[function(e,t,n){var i=e("./_baseRest"),o=e("./eq"),r=e("./_isIterateeCall"),a=e("./keysIn"),s=Object.prototype,d=s.hasOwnProperty,c=i((function(e,t){e=Object(e);var n=-1,i=t.length,c=i>2?t[2]:void 0;for(c&&r(t[0],t[1],c)&&(i=1);++n<i;)for(var l=t[n],u=a(l),p=-1,f=u.length;++p<f;){var h=u[p],g=e[h];(void 0===g||o(g,s[h])&&!d.call(e,h))&&(e[h]=l[h])}return e}));t.exports=c},{"./_baseRest":121,"./_isIterateeCall":182,"./eq":231,"./keysIn":260}],230:[function(e,t,n){t.exports=e("./forEach")},{"./forEach":236}],231:[function(e,t,n){function i(e,t){return e===t||e!=e&&t!=t}t.exports=i},{}],232:[function(e,t,n){var i=e("./_arrayFilter"),o=e("./_baseFilter"),r=e("./_baseIteratee"),a=e("./isArray");function s(e,t){return(a(e)?i:o)(e,r(t,3))}t.exports=s},{"./_arrayFilter":65,"./_baseFilter":84,"./_baseIteratee":105,"./isArray":243}],233:[function(e,t,n){var i=e("./_createFind")(e("./findIndex"));t.exports=i},{"./_createFind":150,"./findIndex":234}],234:[function(e,t,n){var i=e("./_baseFindIndex"),o=e("./_baseIteratee"),r=e("./toInteger"),a=Math.max;function s(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var d=null==n?0:r(n);return d<0&&(d=a(s+d,0)),i(e,o(t,3),d)}t.exports=s},{"./_baseFindIndex":85,"./_baseIteratee":105,"./toInteger":280}],235:[function(e,t,n){var i=e("./_baseFlatten");function o(e){return null!=e&&e.length?i(e,1):[]}t.exports=o},{"./_baseFlatten":86}],236:[function(e,t,n){var i=e("./_arrayEach"),o=e("./_baseEach"),r=e("./_castFunction"),a=e("./isArray");function s(e,t){return(a(e)?i:o)(e,r(t))}t.exports=s},{"./_arrayEach":64,"./_baseEach":82,"./_castFunction":132,"./isArray":243}],237:[function(e,t,n){var i=e("./_baseFor"),o=e("./_castFunction"),r=e("./keysIn");function a(e,t){return null==e?e:i(e,o(t),r)}t.exports=a},{"./_baseFor":87,"./_castFunction":132,"./keysIn":260}],238:[function(e,t,n){var i=e("./_baseGet");function o(e,t,n){var o=null==e?void 0:i(e,t);return void 0===o?n:o}t.exports=o},{"./_baseGet":89}],239:[function(e,t,n){var i=e("./_baseHas"),o=e("./_hasPath");function r(e,t){return null!=e&&o(e,t,i)}t.exports=r},{"./_baseHas":93,"./_hasPath":170}],240:[function(e,t,n){var i=e("./_baseHasIn"),o=e("./_hasPath");function r(e,t){return null!=e&&o(e,t,i)}t.exports=r},{"./_baseHasIn":94,"./_hasPath":170}],241:[function(e,t,n){function i(e){return e}t.exports=i},{}],242:[function(e,t,n){var i=e("./_baseIsArguments"),o=e("./isObjectLike"),r=Object.prototype,a=r.hasOwnProperty,s=r.propertyIsEnumerable,d=i(function(){return arguments}())?i:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};t.exports=d},{"./_baseIsArguments":96,"./isObjectLike":252}],243:[function(e,t,n){var i=Array.isArray;t.exports=i},{}],244:[function(e,t,n){var i=e("./isFunction"),o=e("./isLength");function r(e){return null!=e&&o(e.length)&&!i(e)}t.exports=r},{"./isFunction":248,"./isLength":249}],245:[function(e,t,n){var i=e("./isArrayLike"),o=e("./isObjectLike");function r(e){return o(e)&&i(e)}t.exports=r},{"./isArrayLike":244,"./isObjectLike":252}],246:[function(e,t,n){var i=e("./_root"),o=e("./stubFalse"),r="object"==typeof n&&n&&!n.nodeType&&n,a=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===r?i.Buffer:void 0,d=(s?s.isBuffer:void 0)||o;t.exports=d},{"./_root":208,"./stubFalse":278}],247:[function(e,t,n){var i=e("./_baseKeys"),o=e("./_getTag"),r=e("./isArguments"),a=e("./isArray"),s=e("./isArrayLike"),d=e("./isBuffer"),c=e("./_isPrototype"),l=e("./isTypedArray"),u="[object Map]",p="[object Set]",f=Object.prototype.hasOwnProperty;function h(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||l(e)||r(e)))return!e.length;var t=o(e);if(t==u||t==p)return!e.size;if(c(e))return!i(e).length;for(var n in e)if(f.call(e,n))return!1;return!0}t.exports=h},{"./_baseKeys":106,"./_getTag":168,"./_isPrototype":186,"./isArguments":242,"./isArray":243,"./isArrayLike":244,"./isBuffer":246,"./isTypedArray":257}],248:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isObject"),r="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",d="[object Proxy]";function c(e){if(!o(e))return!1;var t=i(e);return t==a||t==s||t==r||t==d}t.exports=c},{"./_baseGetTag":91,"./isObject":251}],249:[function(e,t,n){var i=9007199254740991;function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}t.exports=o},{}],250:[function(e,t,n){var i=e("./_baseIsMap"),o=e("./_baseUnary"),r=e("./_nodeUtil"),a=r&&r.isMap,s=a?o(a):i;t.exports=s},{"./_baseIsMap":99,"./_baseUnary":127,"./_nodeUtil":204}],251:[function(e,t,n){function i(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=i},{}],252:[function(e,t,n){function i(e){return null!=e&&"object"==typeof e}t.exports=i},{}],253:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./_getPrototype"),r=e("./isObjectLike"),a="[object Object]",s=Function.prototype,d=Object.prototype,c=s.toString,l=d.hasOwnProperty,u=c.call(Object);function p(e){if(!r(e)||i(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==u}t.exports=p},{"./_baseGetTag":91,"./_getPrototype":164,"./isObjectLike":252}],254:[function(e,t,n){var i=e("./_baseIsSet"),o=e("./_baseUnary"),r=e("./_nodeUtil"),a=r&&r.isSet,s=a?o(a):i;t.exports=s},{"./_baseIsSet":103,"./_baseUnary":127,"./_nodeUtil":204}],255:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isArray"),r=e("./isObjectLike"),a="[object String]";function s(e){return"string"==typeof e||!o(e)&&r(e)&&i(e)==a}t.exports=s},{"./_baseGetTag":91,"./isArray":243,"./isObjectLike":252}],256:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isObjectLike"),r="[object Symbol]";function a(e){return"symbol"==typeof e||o(e)&&i(e)==r}t.exports=a},{"./_baseGetTag":91,"./isObjectLike":252}],257:[function(e,t,n){var i=e("./_baseIsTypedArray"),o=e("./_baseUnary"),r=e("./_nodeUtil"),a=r&&r.isTypedArray,s=a?o(a):i;t.exports=s},{"./_baseIsTypedArray":104,"./_baseUnary":127,"./_nodeUtil":204}],258:[function(e,t,n){function i(e){return void 0===e}t.exports=i},{}],259:[function(e,t,n){var i=e("./_arrayLikeKeys"),o=e("./_baseKeys"),r=e("./isArrayLike");function a(e){return r(e)?i(e):o(e)}t.exports=a},{"./_arrayLikeKeys":68,"./_baseKeys":106,"./isArrayLike":244}],260:[function(e,t,n){var i=e("./_arrayLikeKeys"),o=e("./_baseKeysIn"),r=e("./isArrayLike");function a(e){return r(e)?i(e,!0):o(e)}t.exports=a},{"./_arrayLikeKeys":68,"./_baseKeysIn":107,"./isArrayLike":244}],261:[function(e,t,n){function i(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}t.exports=i},{}],262:[function(e,t,n){var i=e("./_arrayMap"),o=e("./_baseIteratee"),r=e("./_baseMap"),a=e("./isArray");function s(e,t){return(a(e)?i:r)(e,o(t,3))}t.exports=s},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./isArray":243}],263:[function(e,t,n){var i=e("./_baseAssignValue"),o=e("./_baseForOwn"),r=e("./_baseIteratee");function a(e,t){var n={};return t=r(t,3),o(e,(function(e,o,r){i(n,o,t(e,o,r))})),n}t.exports=a},{"./_baseAssignValue":79,"./_baseForOwn":88,"./_baseIteratee":105}],264:[function(e,t,n){var i=e("./_baseExtremum"),o=e("./_baseGt"),r=e("./identity");function a(e){return e&&e.length?i(e,r,o):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseGt":92,"./identity":241}],265:[function(e,t,n){var i=e("./_MapCache"),o="Expected a function";function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var a=e.apply(this,i);return n.cache=r.set(o,a)||r,a};return n.cache=new(r.Cache||i),n}r.Cache=i,t.exports=r},{"./_MapCache":55}],266:[function(e,t,n){var i=e("./_baseMerge"),o=e("./_createAssigner")((function(e,t,n){i(e,t,n)}));t.exports=o},{"./_baseMerge":112,"./_createAssigner":147}],267:[function(e,t,n){var i=e("./_baseExtremum"),o=e("./_baseLt"),r=e("./identity");function a(e){return e&&e.length?i(e,r,o):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseLt":108,"./identity":241}],268:[function(e,t,n){var i=e("./_baseExtremum"),o=e("./_baseIteratee"),r=e("./_baseLt");function a(e,t){return e&&e.length?i(e,o(t,2),r):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseIteratee":105,"./_baseLt":108}],269:[function(e,t,n){function i(){}t.exports=i},{}],270:[function(e,t,n){var i=e("./_root"),o=function(){return i.Date.now()};t.exports=o},{"./_root":208}],271:[function(e,t,n){var i=e("./_basePick"),o=e("./_flatRest")((function(e,t){return null==e?{}:i(e,t)}));t.exports=o},{"./_basePick":115,"./_flatRest":157}],272:[function(e,t,n){var i=e("./_baseProperty"),o=e("./_basePropertyDeep"),r=e("./_isKey"),a=e("./_toKey");function s(e){return r(e)?i(a(e)):o(e)}t.exports=s},{"./_baseProperty":117,"./_basePropertyDeep":118,"./_isKey":183,"./_toKey":223}],273:[function(e,t,n){var i=e("./_createRange")();t.exports=i},{"./_createRange":151}],274:[function(e,t,n){var i=e("./_arrayReduce"),o=e("./_baseEach"),r=e("./_baseIteratee"),a=e("./_baseReduce"),s=e("./isArray");function d(e,t,n){var d=s(e)?i:a,c=arguments.length<3;return d(e,r(t,4),n,c,o)}t.exports=d},{"./_arrayReduce":71,"./_baseEach":82,"./_baseIteratee":105,"./_baseReduce":120,"./isArray":243}],275:[function(e,t,n){var i=e("./_baseKeys"),o=e("./_getTag"),r=e("./isArrayLike"),a=e("./isString"),s=e("./_stringSize"),d="[object Map]",c="[object Set]";function l(e){if(null==e)return 0;if(r(e))return a(e)?s(e):e.length;var t=o(e);return t==d||t==c?e.size:i(e).length}t.exports=l},{"./_baseKeys":106,"./_getTag":168,"./_stringSize":221,"./isArrayLike":244,"./isString":255}],276:[function(e,t,n){var i=e("./_baseFlatten"),o=e("./_baseOrderBy"),r=e("./_baseRest"),a=e("./_isIterateeCall"),s=r((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,i(t,1),[])}));t.exports=s},{"./_baseFlatten":86,"./_baseOrderBy":114,"./_baseRest":121,"./_isIterateeCall":182}],277:[function(e,t,n){function i(){return[]}t.exports=i},{}],278:[function(e,t,n){function i(){return!1}t.exports=i},{}],279:[function(e,t,n){var i=e("./toNumber"),o=1/0,r=17976931348623157e292;function a(e){return e?(e=i(e))===o||e===-o?(e<0?-1:1)*r:e==e?e:0:0===e?e:0}t.exports=a},{"./toNumber":281}],280:[function(e,t,n){var i=e("./toFinite");function o(e){var t=i(e),n=t%1;return t==t?n?t-n:t:0}t.exports=o},{"./toFinite":279}],281:[function(e,t,n){var i=e("./isObject"),o=e("./isSymbol"),r=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if("number"==typeof e)return e;if(o(e))return r;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=d.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?r:+e}t.exports=u},{"./isObject":251,"./isSymbol":256}],282:[function(e,t,n){var i=e("./_copyObject"),o=e("./keysIn");function r(e){return i(e,o(e))}t.exports=r},{"./_copyObject":143,"./keysIn":260}],283:[function(e,t,n){var i=e("./_baseToString");function o(e){return null==e?"":i(e)}t.exports=o},{"./_baseToString":126}],284:[function(e,t,n){var i=e("./_arrayEach"),o=e("./_baseCreate"),r=e("./_baseForOwn"),a=e("./_baseIteratee"),s=e("./_getPrototype"),d=e("./isArray"),c=e("./isBuffer"),l=e("./isFunction"),u=e("./isObject"),p=e("./isTypedArray");function f(e,t,n){var f=d(e),h=f||c(e)||p(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=h?f?new g:[]:u(e)&&l(g)?o(s(e)):{}}return(h?i:r)(e,(function(e,i,o){return t(n,e,i,o)})),n}t.exports=f},{"./_arrayEach":64,"./_baseCreate":81,"./_baseForOwn":88,"./_baseIteratee":105,"./_getPrototype":164,"./isArray":243,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isTypedArray":257}],285:[function(e,t,n){var i=e("./_baseFlatten"),o=e("./_baseRest"),r=e("./_baseUniq"),a=e("./isArrayLikeObject"),s=o((function(e){return r(i(e,1,a,!0))}));t.exports=s},{"./_baseFlatten":86,"./_baseRest":121,"./_baseUniq":128,"./isArrayLikeObject":245}],286:[function(e,t,n){var i=e("./toString"),o=0;function r(e){var t=++o;return i(e)+t}t.exports=r},{"./toString":283}],287:[function(e,t,n){var i=e("./_baseValues"),o=e("./keys");function r(e){return null==e?[]:i(e,o(e))}t.exports=r},{"./_baseValues":129,"./keys":259}],288:[function(e,t,n){var i=e("./_assignValue"),o=e("./_baseZipObject");function r(e,t){return o(e||[],t||[],i)}t.exports=r},{"./_assignValue":75,"./_baseZipObject":130}]},{},[1])(1);var rt=ot.exports;function at(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return st(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var dt=function(){function n(t,i){e._classCallCheck(this,n),this.pipelineId=t,this.objectModel=i,this.store=i.store}return e._createClass(n,[{key:"getPipeline",value:function(){return this.objectModel.getCanvasInfoPipeline(this.pipelineId)}},{key:"isPipelineExternal",value:function(){return this.objectModel.getCanvasInfoPipeline(this.pipelineId).parentUrl}},{key:"getObjects",value:function(){var e=this.objectModel.getCanvasInfoPipeline(this.pipelineId);return e?e.nodes.concat(e.comments):[]}},{key:"moveObjects",value:function(e){this.store.dispatch({type:"MOVE_OBJECTS",data:e,pipelineId:this.pipelineId})}},{key:"deleteObject",value:function(e){this.deleteObjects([e])}},{key:"deleteObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){var n=t.filterNodesAndComments(e),i=n.nodes,o=n.comments;t.deleteNodesInternal(i),t.deleteCommentsInternal(o)}),e)}},{key:"addAndUpdateObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"ADD_AND_UPDATE_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"deleteAndUpdateObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"DELETE_AND_UPDATE_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"addPastedObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"ADD_PASTED_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"deletePastedObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"DELETE_PASTED_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"filterNodesAndComments",value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){var o=t.getComment(e);o?i.push(o):n.push(t.getNode(e))})),{nodes:n,comments:i}}},{key:"getObjectStyle",value:function(e,t){var n=this.getObject(e);return t?n&&n.style_temp?n.style_temp:null:n&&n.style?n.style:null}},{key:"setObjectsClassName",value:function(e,t){this.store.dispatch({type:"SET_OBJECTS_CLASS_NAME",data:{objIds:e,newClassName:t},pipelineId:this.pipelineId})}},{key:"setObjectsColorClassName",value:function(e,t){this.store.dispatch({type:"SET_OBJECTS_COLOR_CLASS_NAME",data:{objIds:e,newColorClass:t},pipelineId:this.pipelineId})}},{key:"disconnectObjects",value:function(e){var t=this,n=[];return e.forEach((function(e){t.getLinksContainingId(e).forEach((function(e){n=t.pushUniqueLinks(e,n)}))})),this.store.dispatch({type:"DELETE_LINKS",data:{linksToDelete:n},pipelineId:this.pipelineId}),n}},{key:"isEmpty",value:function(){return this.store.isEmpty(this.pipelineId)}},{key:"getObject",value:function(e){var t=this.getNode(e);if(t)return t;var n=this.getComment(e);return n||null}},{key:"exactlyOverlaps",value:function(e,t,n){var i=this,o=!1;e&&e.length>0&&(e.findIndex((function(e){return i.exactlyOverlapsNodes(e)}))>-1&&(o=!0));!1===o&&t&&t.length>0&&(t.findIndex((function(e){return i.exactlyOverlapsComments(e)}))>-1&&(o=!0));!1===o&&n&&n.length>0&&(n.findIndex((function(e){return i.exactlyOverlapsLinks(e)}))>-1&&(o=!0));return o}},{key:"exactlyOverlapsNodes",value:function(e){var t=!1;return this.getNodes().forEach((function(n){n.x_pos===e.x_pos&&n.y_pos===e.y_pos&&(t=!0)})),t}},{key:"overlapsNodes",value:function(e,t){var n=!1;return(t||this.getNodes()).forEach((function(t){var i=t.x_pos+t.width,o=t.y_pos+t.height;e.id!==t.id&&(e.x_pos===t.x_pos&&e.y_pos===t.y_pos||e.x_pos>=t.x_pos&&e.x_pos<=i&&e.y_pos>=t.y_pos&&e.y_pos<=o||e.x_pos+e.width>t.x_pos&&e.x_pos+e.width<i&&e.y_pos>t.y_pos&&e.y_pos<o||e.x_pos>t.x_pos&&e.x_pos<i&&e.y_pos+e.height>t.y_pos&&e.y_pos+e.height<o||e.x_pos+e.width>t.x_pos&&e.x_pos+e.width<i&&e.y_pos+e.height>t.y_pos&&e.y_pos+e.height<o)&&(n=!0)})),n}},{key:"exactlyOverlapsComments",value:function(e){var t=!1;return this.getComments().forEach((function(n){n.x_pos===e.x_pos&&n.y_pos===e.y_pos&&(t=!0)})),t}},{key:"exactlyOverlapsLinks",value:function(e){var t=!1;return this.getLinks().forEach((function(n){n.srcPos&&e.srcPos&&n.srcPos.x_pos===e.srcPos.x_pos&&n.srcPos.y_pos===e.srcPos.y_pos&&(t=!0),n.trgPos&&e.trgPos&&n.trgPos.x_pos===e.trgPos.x_pos&&n.trgPos.y_pos===e.trgPos.y_pos&&(t=!0)})),t}},{key:"isObjectIdInObjects",value:function(e,t){return!!t&&t.findIndex((function(t){return t.id===e}))>-1}},{key:"createNode",value:function(e){var n=e.nodeTemplate;t.has_1(e.nodeTemplate,"app_data.ui_data")&&(n=this.objectModel.convertNodeTemplate(n));var i={};return null!==n&&(i=Object.assign({},n,{id:this.objectModel.getUniqueId(o.CREATE_NODE,{nodeType:n,pipelineId:this.pipelineId}),x_pos:e.offsetX,y_pos:e.offsetY}),i=this.objectModel.setNodeAttributes(i)),i}},{key:"getAutoSourceNode",value:function(e){var t=null,n=this.objectModel.getSelectedNodes();if(1===n.length&&this.isViableAutoSourceNode(n[0]))t=n[0];else if(!e){var i=this.getNodes();if(i.length>0){var o=i[i.length-1];if(o.outputs)t=o;else if(i.length>1){var r=i[i.length-2];r.outputs&&(t=r)}}}return t}},{key:"isViableAutoSourceNode",value:function(e){return e.outputs&&e.outputs.length>0&&!h.isSrcCardinalityAtMax(e.outputs[0].id,e,this.getLinks())}},{key:"createAutoNode",value:function(e,t){var n=this.objectModel.getCanvasLayout().autoLayoutInitialMarginX,i=this.objectModel.getCanvasLayout().autoLayoutInitialMarginY,o=this.objectModel.getCanvasLayout().autoLayoutHorizontalSpacing,r=this.objectModel.getCanvasLayout().autoLayoutVerticalSpacing,a=0,s=0;null===t?(a=n,s=i):(a=t.x_pos+t.width+o,s=t.y_pos),e.offsetX=a,e.offsetY=s;var d=this.createNode(e);this.getNodes().length>0&&this.isEntryBindingNode(d)&&(d.x_pos=n,d.y_pos+=d.height+r);for(var c=!0;c;)(c=this.isNodeOverlappingOthers(d))&&(d.y_pos+=d.height+r);return d}},{key:"createNodesForPalette",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=t.getNode(e);if(r){if((r=o.cloneDeep_1(r)).id=t.objectModel.getUUID(),r.x_pos=0,r.y_pos=0,(r=nt.createSchemaNode(r,[])).type===o.SUPER_NODE){var a=t.objectModel.getSchemaPipelinesForSupernode(r);i.set_1(r,"app_data.ui_data.sub_pipelines",a)}n.push(r)}})),n}},{key:"replaceNodes",value:function(e){this.store.dispatch({type:"REPLACE_NODES",data:e,pipelineId:this.pipelineId})}},{key:"isLinkNeededWithAutoNode",value:function(e,t){var n=!1;return e&&t&&e.inputs&&t.outputs&&1===e.inputs.length&&1===t.outputs.length&&!h.isCardinalityAtMax(t.outputs[0].id,e.inputs[0].id,t,e,this.getLinks())&&(n=!0),n}},{key:"isEntryBindingNode",value:function(e){return!(e.type!==o.BINDING||e.inputs&&0!==e.inputs.length)}},{key:"isExitBindingNode",value:function(e){return!!(e.type===o.BINDING&&e.inputs&&e.inputs.length>0)}},{key:"isNodeOverlappingOthers",value:function(e){var t=this;return-1!==this.getNodes().findIndex((function(n){return t.isSourceOverlappingTarget(n,e)}))}},{key:"isSourceOverlappingTarget",value:function(e,t){var n=e.layout.nodeHighlightGap,i=t.layout.nodeHighlightGap;return e.x_pos+e.width+n>=t.x_pos-i&&t.x_pos+t.width+i>=e.x_pos-n&&e.y_pos+e.height+n>=t.y_pos-i&&t.y_pos+t.height+i>=e.y_pos-n}},{key:"addNode",value:function(e){e&&(e.type===o.SUPER_NODE?this.addSupernode(e,t.get_1(e,"sub_pipelines")):this.store.dispatch({type:"ADD_NODE",data:{newNode:e},pipelineId:this.pipelineId}))}},{key:"addSupernodes",value:function(e,t,n){this.store.dispatch({type:"ADD_SUPERNODES",data:{supernodesToAdd:e,pipelinesToAdd:t,extPipelineFlowsToAdd:n,pipelineId:this.pipelineId}})}},{key:"addSupernode",value:function(e,t){var n=this,o=this.objectModel.getCanvasInfo(),r=this.objectModel.getCanvasInfo().pipelines.concat(t||[]);r=r.map((function(t){if(t.id===n.pipelineId){var o=[].concat(i._toConsumableArray(t.nodes),[n.cloneSupernodeRemovePipelineData(e)]);return Object.assign({},t,{nodes:o})}return t}));var a=Object.assign({},o,{pipelines:r});this.objectModel.setCanvasInfo(a)}},{key:"cloneSupernodeRemovePipelineData",value:function(e){var t=Object.assign({},e);return t.app_data&&(t.app_data=Object.assign({},t.app_data),t.app_data.ui_data&&delete t.app_data.ui_data.sub_pipelines),t}},{key:"deleteNode",value:function(e){var t=this.getNode(e);t&&this.deleteNodes([t])}},{key:"deleteNodes",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&e.length>0&&this.objectModel.executeWithSelectionChange((function(e){t.deleteNodesInternal(e.nodes,e.removePipelines)}),{nodes:e,removePipelines:n})}},{key:"deleteNodesInternal",value:function(e,t){var n=this;e.filter((function(e){return e.type!==o.SUPER_NODE})).forEach((function(e){n.store.dispatch({type:"DELETE_OBJECT",data:{id:e.id},pipelineId:n.pipelineId})}));var i=e.filter((function(e){return e.type===o.SUPER_NODE}));t?this.deleteSupernodesAndDescPipelines(i):this.deleteSupernodes(i,[],[])}},{key:"deleteSupernodesAndDescPipelines",value:function(e){var t=this.objectModel.getDescPipelinesToDelete(e,this.pipelineId),n=this.objectModel.getExternalPipelineFlowsForPipelines(t);this.deleteSupernodes(e,t,n)}},{key:"deleteSupernodes",value:function(e,t,n){this.store.dispatch({type:"DELETE_SUPERNODES",data:{supernodesToDelete:e,pipelinesToDelete:t,extPipelineFlowsToDelete:n,pipelineId:this.pipelineId}})}},{key:"deconstructSupernode",value:function(e){this.store.dispatch({type:"DECONSTRUCT_SUPERNODE",data:e})}},{key:"reconstructSupernode",value:function(e){this.store.dispatch({type:"RECONSTRUCT_SUPERNODE",data:e})}},{key:"getNodes",value:function(){return this.store.getNodes(this.pipelineId)}},{key:"getNodeIds",value:function(){return this.getNodes().map((function(e){return e.id}))}},{key:"getNode",value:function(e){return this.store.getNode(e,this.pipelineId)}},{key:"getSupernodes",value:function(){return h.filterSupernodes(this.getNodes())}},{key:"isDataNode",value:function(e){return this.getNode(e)}},{key:"sizeAndPositionObjects",value:function(e,t){this.store.dispatch({type:"SIZE_AND_POSITION_OBJECTS",data:{objectsInfo:e,linksInfo:t},pipelineId:this.pipelineId})}},{key:"filterDataNodes",value:function(e){var t=this;return e.filter((function(e){return t.isDataNode(e)}))}},{key:"expandSuperNodeInPlace",value:function(e,t,n){var i=Object.assign({},this.getNode(e),{is_expanded:!0});i=this.objectModel.setNodeAttributes(i),this.store.dispatch({type:"SET_SUPERNODE_EXPAND_STATE",data:{node:i,objectPositions:t,linkPositions:n},pipelineId:this.pipelineId})}},{key:"collapseSuperNodeInPlace",value:function(e,t,n){var i=Object.assign({},this.getNode(e),{is_expanded:!1});i=this.objectModel.setNodeAttributes(i),this.store.dispatch({type:"SET_SUPERNODE_EXPAND_STATE",data:{node:i,objectPositions:t,linkPositions:n},pipelineId:this.pipelineId})}},{key:"isSuperNodeExpandedInPlace",value:function(e){return!0===this.getNode(e).is_expanded}},{key:"isSupernode",value:function(e){return this.getNode(e).type===o.SUPER_NODE}},{key:"getNodeParameters",value:function(e){var t=this.getNode(e);return t?t.parameters:null}},{key:"getNodeUiParameters",value:function(e){var t=this.getNode(e);return t?t.ui_parameters:null}},{key:"setNodeLabel",value:function(e,t){this.store.dispatch({type:"SET_NODE_LABEL",data:{nodeId:e,label:t},pipelineId:this.pipelineId})}},{key:"setNodeDecorations",value:function(e,t){this.store.dispatch({type:"SET_NODE_DECORATIONS",data:{nodeId:e,decorations:this.ensureDecorationsHaveIds(t)},pipelineId:this.pipelineId})}},{key:"setInputPortLabel",value:function(e,t,n){this.store.dispatch({type:"SET_INPUT_PORT_LABEL",data:{nodeId:e,portId:t,label:n},pipelineId:this.pipelineId})}},{key:"setOutputPortLabel",value:function(e,t,n){this.store.dispatch({type:"SET_OUTPUT_PORT_LABEL",data:{nodeId:e,portId:t,label:n},pipelineId:this.pipelineId})}},{key:"setInputPortSubflowNodeRef",value:function(e,t,n){this.store.dispatch({type:"SET_INPUT_PORT_SUBFLOW_NODE_REF",data:{nodeId:e,portId:t,subflowNodeRef:n},pipelineId:this.pipelineId})}},{key:"setOutputPortSubflowNodeRef",value:function(e,t,n){this.store.dispatch({type:"SET_OUTPUT_PORT_SUBFLOW_NODE_REF",data:{nodeId:e,portId:t,subflowNodeRef:n},pipelineId:this.pipelineId})}},{key:"setNodeProperties",value:function(e,t){var n=o.cloneDeep_1(this.getNode(e));n=Object.assign(n,t),n=this.objectModel.setNodeAttributes(n),this.store.dispatch({type:"REPLACE_NODE",data:{node:n},pipelineId:this.pipelineId})}},{key:"setNodeMessage",value:function(e,t){this.store.dispatch({type:"SET_NODE_MESSAGE",data:{nodeId:e,message:t},pipelineId:this.pipelineId})}},{key:"setNodeMessages",value:function(e,t){this.store.dispatch({type:"SET_NODE_MESSAGES",data:{nodeId:e,messages:t},pipelineId:this.pipelineId})}},{key:"setNodeUiParameters",value:function(e,t){this.store.dispatch({type:"SET_NODE_UI_PARAMETERS",data:{nodeId:e,ui_parameters:t},pipelineId:this.pipelineId})}},{key:"setNodeParameters",value:function(e,t){this.store.dispatch({type:"SET_NODE_PARAMETERS",data:{nodeId:e,parameters:t},pipelineId:this.pipelineId})}},{key:"setNodeInputPorts",value:function(e,t){this.setNodeProperties(e,{inputs:t})}},{key:"setNodeOutputPorts",value:function(e,t){this.setNodeProperties(e,{outputs:t})}},{key:"addCustomAttrToNodes",value:function(e,t,n){this.store.dispatch({type:"ADD_NODE_ATTR",data:{objIds:e,attrName:t,attrValue:n},pipelineId:this.pipelineId})}},{key:"removeCustomAttrFromNodes",value:function(e,t,n){this.store.dispatch({type:"REMOVE_NODE_ATTR",data:{objIds:e,attrName:t},pipelineId:this.pipelineId})}},{key:"getNodeDecorations",value:function(e){var t=this.getNode(e);return t?t.decorations:null}},{key:"getNodeMessages",value:function(e){var t=this.getNode(e);return t?t.messages:null}},{key:"getNodeMessage",value:function(e,t){var n=this.getNodeMessages(e);if(n){var i,o=at(n);try{for(o.s();!(i=o.n()).done;){var r=i.value;if(r.id_ref===t)return r}}catch(e){o.e(e)}finally{o.f()}}return null}},{key:"getNodeInputPorts",value:function(e){var t=this.getNode(e);return t?t.inputs:null}},{key:"getNodeOutputPorts",value:function(e){var t=this.getNode(e);return t?t.outputs:null}},{key:"getNodeClassName",value:function(e){var t=this.getNode(e);return t?t.class_name:null}},{key:"getNodeStyle",value:function(e,t){var n=this.getNode(e);return t?n?n.style_temp:null:n?n.style:null}},{key:"hasErrorMessage",value:function(e){var t=this.getNode(e);return this.objectModel.hasErrorMessage(t)}},{key:"hasWarningMessage",value:function(e){var t=this.getNode(e);return this.objectModel.hasWarningMessage(t)}},{key:"isFlowValid",value:function(e){var t,n=!0,i=at(this.getNodes());try{for(i.s();!(t=i.n()).done;){var o=t.value;n&&(n=this.isNodeValid(o,e))}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"isNodeValid",value:function(e,t){var n=!0;if(t&&Array.isArray(t)&&t.length>0){var i,o=at(e.messages);try{for(o.s();!(i=o.n()).done;){var r=i.value;-1!==t.indexOf(r.type)&&(n=!1)}}catch(e){o.e(e)}finally{o.f()}}else e.messages&&e.messages.length>0&&(n=!1);return n}},{key:"getFlowMessages",value:function(){var e=this.getNodes(),t={};return e.forEach((function(e){e.messages&&e.messages.length>0&&(t[e.id]=e.messages)})),t}},{key:"autoLayout",value:function(e){var t=this.objectModel.getCanvasInfoPipeline(this.pipelineId),n={};n=e===o.VERTICAL?this.dagreAutolayout(o.DAGRE_VERTICAL,t):this.dagreAutolayout(o.DAGRE_HORIZONTAL,t),this.sizeAndPositionObjects(n)}},{key:"dagreAutolayout",value:function(e,t){var n=this,i=this.objectModel.getCanvasLayout(),r=t.links.filter((function(e){return e.type===o.NODE_LINK||e.type===o.ASSOCIATION_LINK})).map((function(e){return{v:e.srcNodeId,w:e.trgNodeId,value:{points:[]}}})),a=t.nodes.map((function(r){var a=r.width;return e===o.DAGRE_HORIZONTAL&&(a=r.width+Math.max(n.getPaddingForNode(r,i,t),i.autoLayoutHorizontalSpacing)),{v:r.id,value:{width:a,height:r.height}}})),s={};["TB","BT","LR","RL"].indexOf(e)>=0&&(s={rankDir:e});var d={nodes:a,edges:r,value:s},c=i.autoLayoutInitialMarginX,l=i.autoLayoutInitialMarginY,u=i.autoLayoutVerticalSpacing,p=i.autoLayoutHorizontalSpacing;e===o.DAGRE_HORIZONTAL&&(p=0);var f=rt.graphlib.json.read(d);f.graph().marginx=c,f.graph().marginy=l,"TB"===e?(f.graph().nodesep=p,f.graph().ranksep=u):(f.graph().nodesep=u,f.graph().ranksep=p),rt.layout(f);var h=rt.graphlib.json.write(f);return this.convertGraphToMovedNodes(h,t.nodes)}},{key:"convertGraphToMovedNodes",value:function(e,t){for(var n=[],i={},o=0,r=e.nodes.length;o<r;o++)i[e.nodes[o].v]=e.nodes[o];return t.forEach((function(e){n[e.id]={id:e.id,x_pos:i[e.id].value.x-i[e.id].value.width/2,y_pos:i[e.id].value.y-i[e.id].value.height/2,width:e.width,height:e.height}})),n}},{key:"getPaddingForNode",value:function(e,t,n){return h.getNodePaddingToTargetNodes(e,n.nodes,n.links,t.linkType)}},{key:"getBoundingRectForNodes",value:function(e){var t=e[0].x_pos,n=e[0].y_pos,i=e[0].width+t,o=e[0].height+n;return e.forEach((function(e){t=Math.min(t,e.x_pos),n=Math.min(n,e.y_pos),i=Math.max(i,e.x_pos+e.width),o=Math.max(o,e.y_pos+e.height)})),{x:t,y:n,width:i-t,height:o-n}}},{key:"ensureDecorationsHaveIds",value:function(e){var t=this;return e?e.map((function(e){return Object.assign({},e,{id:e.id||t.objectModel.getUUID()})})):e}},{key:"createComment",value:function(e){var t=this,n={id:this.objectModel.getUniqueId(o.CREATE_COMMENT),content:"",height:42,width:175,x_pos:e.mousePos.x,y_pos:e.mousePos.y,linkIds:[],selectedObjectIds:[]};return n=this.objectModel.setCommentAttributes(n),e.selectedObjectIds.forEach((function(e){t.isDataNode(e)&&(n.selectedObjectIds.push(e),n.linkIds.push(t.objectModel.getUniqueId(o.CREATE_COMMENT_LINK,{comment:n,targetNode:t.getNode(e)})))})),n}},{key:"addComment",value:function(e){this.store.dispatch({type:"ADD_COMMENT",data:e,pipelineId:this.pipelineId}),this.store.dispatch({type:"SHOW_COMMENTS"})}},{key:"getAdjustedCommentPosition",value:function(e){for(var t=this.objectModel.getCanvasConfig().enableSnapToGridType,n={x_pos:e.x,y_pos:e.y};this.exactlyOverlaps(null,[n],null);)t===o.SNAP_TO_GRID_DURING||t===o.SNAP_TO_GRID_AFTER?(n.x_pos+=this.objectModel.getCanvasLayout().snapToGridXPx,n.y_pos+=this.objectModel.getCanvasLayout().snapToGridYPx):(n.x_pos+=10,n.y_pos+=10);return n}},{key:"deleteComment",value:function(e){var t=this.getComment(e);t&&this.deleteComments([t])}},{key:"deleteComments",value:function(e){var t=this;e&&e.length>0&&this.objectModel.executeWithSelectionChange((function(e){t.deleteCommentsInternal(e)}),e)}},{key:"deleteCommentsInternal",value:function(e){var t=this;e.forEach((function(e){t.store.dispatch({type:"DELETE_OBJECT",data:{id:e.id},pipelineId:t.pipelineId})}))}},{key:"getComments",value:function(){return this.store.getComments(this.pipelineId)}},{key:"getComment",value:function(e){return this.store.getComment(e,this.pipelineId)}},{key:"editComment",value:function(e){this.store.dispatch({type:"EDIT_COMMENT",data:e,pipelineId:this.pipelineId})}},{key:"addCustomAttrToComments",value:function(e,t,n){this.store.dispatch({type:"ADD_COMMENT_ATTR",data:{objIds:e,attrName:t,attrValue:n},pipelineId:this.pipelineId})}},{key:"removeCustomAttrFromComments",value:function(e,t){this.store.dispatch({type:"REMOVE_COMMENT_ATTR",data:{objIds:e,attrName:t},pipelineId:this.pipelineId})}},{key:"getCommentClassName",value:function(e){var t=this.getComment(e);return t?t.class_name:null}},{key:"getCommentStyle",value:function(e,t){var n=this.getComment(e);return t?n?n.style_temp:null:n?n.style:null}},{key:"createLink",value:function(e,t){var n={id:this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNode:t,targetNode:e}),srcNodeId:t.id,trgNodeId:e.id,type:o.NODE_LINK};return t.outputs&&t.outputs.length>0&&(n=Object.assign(n,{srcNodePortId:t.outputs[0].id})),e.inputs&&e.inputs.length>0&&(n=Object.assign(n,{trgNodePortId:e.inputs[0].id})),n}},{key:"createLinkFromInfo",value:function(e){var t=this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNodeId:e.srcNodeId,targetNodeId:e.trgNodeId});return Object.assign({id:t,type:o.NODE_LINK},e)}},{key:"deleteLink",value:function(e){this.store.dispatch({type:"DELETE_LINK",data:e,pipelineId:this.pipelineId})}},{key:"deleteLinks",value:function(e){this.store.dispatch({type:"DELETE_LINKS",data:{linksToDelete:e},pipelineId:this.pipelineId})}},{key:"updateLinks",value:function(e){this.store.dispatch({type:"UPDATE_LINKS",data:{linksToUpdate:e},pipelineId:this.pipelineId})}},{key:"updateLink",value:function(e){this.updateLinks([e])}},{key:"createNodeLinks",value:function(e){var t=this,n=[];return e.nodes.forEach((function(i){e.targetNodes.forEach((function(o){var r=t.createNodeLink(i,o,e);r&&n.push(r)}))})),n}},{key:"createNodeLink",value:function(e,t,n){var i=this.getNode(e.id),r=this.getNode(t.id),a=this.getLinks();if(e.srcPos&&t.trgPos||e.srcPos&&h.isTrgConnectionAllowedWithDetachedLinks(t.portId,r,a)||t.trgPos&&h.isSrcConnectionAllowedWithDetachedLinks(e.portId,i,a)||h.isConnectionAllowed(e.portId,t.portId,i,r,a,n.type)){var s={};return s.id=n.id?n.id:this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNode:i,targetNode:r}),s.type=n.type,e.srcPos?s.srcPos=e.srcPos:(s.srcNodeId=e.id,s.srcNodePortId=e.portId),t.trgPos?s.trgPos=t.trgPos:(s.trgNodeId=t.id,s.trgNodePortId=t.portId),n.class_name&&(s.class_name=n.class_name),n.linkName&&(s.linkName=n.linkName),s}return null}},{key:"createNodeLinkDetached",value:function(e){var t={};return t.id=e.id?e.id:this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNode:this.getNode(e.srcNodeId)}),t.type=e.type,t.srcNodeId=e.srcNodeId,t.srcNodePortId=e.srcNodePortId,t.trgPos={x_pos:e.trgPos.x,y_pos:e.trgPos.y},e.class_name&&(t.class_name=e.class_name),e.linkName&&(t.linkName=e.linkName),e.typeAttr&&(t.typeAttr=e.typeAttr),e.description&&(t.description=e.description),t}},{key:"createCommentLinks",value:function(e){var t=this,n=[];return e.nodes.forEach((function(i){e.targetNodes.forEach((function(r){if(h.isCommentLinkConnectionAllowed(i,r,t.getLinks())){var a={};a.id=t.objectModel.getUniqueId(o.CREATE_COMMENT_LINK,{comment:t.getComment(i),targetNode:t.getNode(r)}),a.type=e.type,a.srcNodeId=i,a.trgNodeId=r,n.push(a)}}))})),n}},{key:"addLinks",value:function(e){var t=this;e.forEach((function(e){t.addLink(e)}))}},{key:"addLink",value:function(e){this.store.dispatch({type:"ADD_LINK",data:e,pipelineId:this.pipelineId})}},{key:"setLinks",value:function(e){this.store.dispatch({type:"SET_LINKS",data:e,pipelineId:this.pipelineId})}},{key:"getLinks",value:function(){return this.store.getLinks(this.pipelineId)}},{key:"getLinkIds",value:function(){return this.getLinks().map((function(e){return e.id}))}},{key:"getLinksBetween",value:function(e,t){var n=this;return this.getLinks().filter((function(i){return!(!n.isObjectIdInObjects(i.trgNodeId,e)||!n.isObjectIdInObjects(i.srcNodeId,e)&&!n.isObjectIdInObjects(i.srcNodeId,t))}))}},{key:"getLinksContainingId",value:function(e){return this.getLinks().filter((function(t){return t.srcNodeId===e||t.trgNodeId===e})).map((function(e){return Object.assign({},e)}))}},{key:"getLinksContainingIds",value:function(e){var t=this,n=[];return e.forEach((function(e){var i=t.getLinksContainingId(e);i.length>0&&(n=h.concatUniqueBasedOnId(i,n))})),n}},{key:"getNodeDataLinksContainingIds",value:function(e){return this.getLinksContainingIds(e).filter((function(e){return e.type===o.NODE_LINK}))}},{key:"getLinksContainingSourceId",value:function(e){return this.getLinks().filter((function(t){return t.srcNodeId===e}))}},{key:"getLinksContainingTargetId",value:function(e){return this.getLinks().filter((function(t){return t.trgNodeId===e}))}},{key:"getAttachedLinksContainingSourceId",value:function(e){return this.getLinks().filter((function(t){return t.srcNodeId===e&&t.trgNodeId}))}},{key:"getAttachedLinksContainingTargetId",value:function(e){return this.getLinks().filter((function(t){return t.trgNodeId===e&&t.srcNodeId}))}},{key:"getNodeLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.getLinksContainingId(e.id).forEach((function(e){e.type!==o.NODE_LINK&&e.type!==o.ASSOCIATION_LINK||n.push(e)}))})),n}},{key:"getNodeDataLinks",value:function(){return this.getLinks().filter((function(e){return e.type===o.NODE_LINK}))}},{key:"getNodeDataLinkFromInfo",value:function(e,t,n,i){var r=this,a=this.getDefaultSrcPortId(e,t),s=this.getDefaultTrgPortId(n,i);return a&&s?this.getLinks().find((function(t){if(t.type===o.NODE_LINK){var i=r.getDefaultSrcPortId(t.srcNodeId,t.srcNodePortId),d=r.getDefaultTrgPortId(t.trgNodeId,t.trgNodePortId);return t.srcNodeId===e&&i===a&&t.trgNodeId===n&&d===s}return!1})):null}},{key:"getCommentLinkFromInfo",value:function(e,t){return this.getLinks().find((function(n){return n.type===o.COMMENT_LINK&&(n.srcNodeId===e&&n.trgNodeId===t||n.srcNodeId===t&&n.trgNodeId===e)}))}},{key:"setCommentProperties",value:function(e,t){this.store.dispatch({type:"SET_COMMENT_PROPERTIES",data:{commentId:e,commentProperties:t},pipelineId:this.pipelineId})}},{key:"getNodeAssocLinkFromInfo",value:function(e,t){return this.getLinks().find((function(n){return n.type===o.ASSOCIATION_LINK&&(n.srcNodeId===e&&n.trgNodeId===t||n.srcNodeId===t&&n.trgNodeId===e)}))}},{key:"getDefaultSrcPortId",value:function(e,t){if(!t){var n=this.getNode(e);if(n&&n.outputs&&n.outputs.length>0)return n.outputs[0].id}return t}},{key:"getDefaultTrgPortId",value:function(e,t){if(!t){var n=this.getNode(e);if(n&&n.inputs&&n.inputs.length>0)return n.inputs[0].id}return t}},{key:"getLink",value:function(e){return this.store.getLink(e,this.pipelineId)}},{key:"setLinkProperties",value:function(e,t){this.store.dispatch({type:"SET_LINK_PROPERTIES",data:{linkId:e,linkProperties:t},pipelineId:this.pipelineId})}},{key:"setNodeDataLinkSrcInfo",value:function(e,t,n){this.store.dispatch({type:"SET_LINK_SRC_INFO",data:{linkId:e,srcNodeId:t,srcNodePortId:n},pipelineId:this.pipelineId})}},{key:"setNodeDataLinkTrgInfo",value:function(e,t,n){this.store.dispatch({type:"SET_LINK_TRG_INFO",data:{linkId:e,trgNodeId:t,trgNodePortId:n},pipelineId:this.pipelineId})}},{key:"getLinkClassName",value:function(e){var t=this.getLink(e);return t&&t.class_name?t.class_name:null}},{key:"getLinkStyle",value:function(e,t){var n=this.getLink(e);return t?n&&n.style_temp?n.style_temp:null:n&&n.style?n.style:null}},{key:"setLinksClassName",value:function(e,t){this.store.dispatch({type:"SET_LINKS_CLASS_NAME",data:{linkIds:e,newClassName:t},pipelineId:this.pipelineId})}},{key:"setLinkDecorations",value:function(e,t){this.store.dispatch({type:"SET_LINK_DECORATIONS",data:{linkId:e,decorations:this.ensureDecorationsHaveIds(t)},pipelineId:this.pipelineId})}},{key:"getLinkDecorations",value:function(e){var t=this.getLink(e);return t?t.decorations:null}},{key:"isCommentLinkedToNonSelectedNodes",value:function(e){var t,n=this.getLinksContainingId(e),i=this.objectModel.getSelectedObjectIds(),o=!1,r=at(n);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(o=!i.includes(a.trgNodeId))return o}}catch(e){r.e(e)}finally{r.f()}return o}},{key:"pushUniqueLinks",value:function(e,t){return-1===t.findIndex((function(t){return t.id===e.id}))&&t.push(e),t}}]),n}(),ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_TOOLTIP_DEF"===t.type&&t.data.tooltipDef?t.data.tooltipDef:e},lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NODE_TYPES_TO_PALETTE":return t.data.nodeTypes?[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.nodeTypes)):e;case"REMOVE_NODE_TYPES_FROM_PALETTE":return e.filter((function(e){return-1===t.data.selObjectIds.findIndex((function(t){return t===e.id}))}));default:return e}},ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NODE_TYPES_TO_PALETTE":var n=e.find((function(e){return e.id===t.data.categoryId}));return n?e.map((function(e){return t.data.categoryId===e.id?Object.assign({},e,{node_types:lt(e.node_types,t)}):e})):(n={id:t.data.categoryId,label:t.data.categoryLabel?t.data.categoryLabel:t.data.categoryId},t.data.categoryDescription&&(n.description=t.data.categoryDescription),t.data.categoryImage&&(n.image=t.data.categoryImage),n.node_types=[],[].concat(i._toConsumableArray(e),[Object.assign({},n,{node_types:lt(n.node_types,t)})]));case"REMOVE_NODE_TYPES_FROM_PALETTE":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{node_types:lt(e.node_types,t)}):e}));case"SET_CATEGORY_LOADING_TEXT":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{loading_text:t.data.loadingText}):e}));case"SET_CATEGORY_EMPTY_TEXT":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{empty_text:t.data.emptyText}):e}));case"SET_IS_OPEN_CATEGORY":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{is_open:t.data.isOpen}):e}));case"SET_IS_OPEN_ALL_CATEGORIES":return e.map((function(e){return Object.assign({},e,{is_open:t.data.isOpen})}));default:return e}},pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_PALETTE_DATA":return{content:{}};case"SET_PALETTE_DATA":var n=Object.assign({},t.data.content);return Object.assign({},e,{content:n});case"ADD_NODE_TYPES_TO_PALETTE":case"REMOVE_NODE_TYPES_FROM_PALETTE":case"SET_IS_OPEN_CATEGORY":case"SET_IS_OPEN_ALL_CATEGORIES":case"SET_CATEGORY_LOADING_TEXT":case"SET_CATEGORY_EMPTY_TEXT":var i=Object.assign({},e.content,{categories:ut(e.content.categories,t)});return Object.assign({},e,{content:i,version:"3.0"});case"SET_PALETTE_OPEN_STATE":return Object.assign({},e,{isOpen:t.data.isOpen});default:return e}},ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_INPUT_PORT_LABEL":case"SET_OUTPUT_PORT_LABEL":return e.map((function(e,n){if(t.data.portId===e.id){var i=Object.assign({},e);return i.label=t.data.label,i}return e}));case"SET_INPUT_PORT_SUBFLOW_NODE_REF":case"SET_OUTPUT_PORT_SUBFLOW_NODE_REF":return e.map((function(e,n){if(t.data.portId===e.id){var i=Object.assign({},e);return i.subflow_node_ref=t.data.subflowNodeRef,i}return e}));default:return e}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NODE":return[].concat(i._toConsumableArray(e),[Object.assign({},t.data.newNode)]);case"ADD_NODES":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.nodesToAdd));case"REPLACE_NODES":return t.data;case"REPLACE_NODE":return e.map((function(e,n){return t.data.node.id===e.id?t.data.node:e}));case"MOVE_OBJECTS":return t.data.nodes?e.map((function(e,n){if(t.data.nodes.indexOf(e.id)>-1){var i=e.x_pos+t.data.offsetX,o=e.y_pos+t.data.offsetY;return Object.assign({},e,{x_pos:i,y_pos:o})}return e})):e;case"SIZE_AND_POSITION_OBJECTS":return e.map((function(e,n){var i=t.data.objectsInfo[e.id];if(void 0!==i){var r=Object.assign({},e,{height:i.height,width:i.width,x_pos:i.x_pos,y_pos:i.y_pos});return r.type===o.SUPER_NODE&&r.is_expanded?(r.expanded_width=i.width,r.expanded_height=i.height):i.isResized?(r.isResized=i.isResized,r.resizeWidth=i.resizeWidth,r.resizeHeight=i.resizeHeight):(delete r.isResized,delete r.resizeWidth,delete r.resizeHeight),r}return e}));case"SET_NODE_POSITIONS":return e.map((function(e,n){if(t.data.nodePositions&&void 0!==t.data.nodePositions[e.id]){var i=t.data.nodePositions[e.id];return Object.assign({},e,{x_pos:i.x_pos,y_pos:i.y_pos})}return e}));case"ADD_SUPERNODES":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.supernodesToAdd));case"DELETE_SUPERNODES":return e.filter((function(e){return!t.data.supernodesToDelete.some((function(t){return t.id===e.id}))}));case"DELETE_OBJECT":return e.filter((function(e){return e.id!==t.data.id}));case"DELETE_NODES":return e.filter((function(e){return!t.data.nodesToDelete.some((function(t){return t.id===e.id}))}));case"SET_NODE_PARAMETERS":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.parameters=t.data.parameters,i}return e}));case"SET_NODE_UI_PARAMETERS":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.ui_parameters=t.data.ui_parameters,i}return e}));case"SET_NODE_MESSAGE":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);if(i.messages){var o=i.messages.findIndex((function(e){return e.id_ref===t.data.message.id_ref}));o>-1?i.messages[o]=t.data.message:i.messages.push(t.data.message)}else i.messages=[t.data.message];return i}return e}));case"SET_NODE_MESSAGES":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.messages=t.data.messages,i}return e}));case"ADD_NODE_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs=i.customAttrs||[],i.customAttrs.push(t.data.attrName),i}return e}));case"REMOVE_NODE_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs&&(i.customAttrs=i.customAttrs.filter((function(e){return e!==t.data.attrName}))),i}return e}));case"SET_NODE_LABEL":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.label=t.data.label,i}return e}));case"SET_NODE_DECORATIONS":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.decorations=t.data.decorations,i}return e}));case"SET_NODES_MULTI_DECORATIONS":return e.map((function(e){var n=t.data.pipelineNodeDecorations.find((function(n){return n.pipelineId===t.data.pipelineId&&n.nodeId===e.id}));return n?Object.assign({},e,{decorations:n.decorations}):e}));case"SET_OBJECTS_CLASS_NAME":return e.map((function(e){var n=t.data.objIds.indexOf(e.id);if(n>-1){var i=Object.assign({},e);return i.class_name=Array.isArray(t.data.newClassName)?t.data.newClassName[n]||null:t.data.newClassName,i}return e}));case"SET_OBJECTS_STYLE":return e.map((function(e){if(t.data.objIds.indexOf(e.id)>-1){var n=Object.assign({},e);return t.data.temporary?n.style_temp=t.data.newStyle:n.style=t.data.newStyle,n}return e}));case"SET_OBJECTS_MULTI_STYLE":return e.map((function(e){var n=t.data.pipelineObjStyles.find((function(n){return n.pipelineId===t.data.pipelineId&&n.objId===e.id}));if(n){var i=Object.assign({},e),o=n&&n.style?n.style:null;return t.data.temporary?i.style_temp=o:i.style=o,i}return e}));case"REMOVE_ALL_STYLES":return e.map((function(e){if(t.data.temporary&&e.style_temp){var n=Object.assign({},e);return delete n.style_temp,n}if(!t.data.temporary&&e.style){var i=Object.assign({},e);return delete i.style,i}return e}));case"SET_INPUT_PORT_LABEL":case"SET_INPUT_PORT_SUBFLOW_NODE_REF":return e.map((function(e,n){return t.data.nodeId===e.id?Object.assign({},e,{inputs:ft(e.inputs,t)}):e}));case"SET_OUTPUT_PORT_LABEL":case"SET_OUTPUT_PORT_SUBFLOW_NODE_REF":return e.map((function(e,n){return t.data.nodeId===e.id?Object.assign({},e,{outputs:ft(e.outputs,t)}):e}));case"SET_SUPERNODE_EXPAND_STATE":return e.map((function(e){return t.data.node.id===e.id?t.data.node:e}));case"REPLACE_SN_AND_PIPELINES":return e.map((function(e,n){return e.id===t.data.topSupernode.id?Object.assign({},t.data.topSupernode):e}));default:return e}},gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"MOVE_OBJECTS":return t.data.nodes?e.map((function(e,n){if(t.data.nodes.indexOf(e.id)>-1){var i=e.x_pos+t.data.offsetX,o=e.y_pos+t.data.offsetY;return Object.assign({},e,{x_pos:i,y_pos:o})}return e})):e;case"SET_COMMENT_POSITIONS":return e.map((function(e,n){if(t.data.commentPositions&&void 0!==t.data.commentPositions[e.id]){var i=t.data.commentPositions[e.id];return Object.assign({},e,{x_pos:i.x_pos,y_pos:i.y_pos})}return e}));case"DELETE_OBJECT":return e.filter((function(e){return e.id!==t.data.id}));case"DELETE_COMMENTS":return e.filter((function(e){return!t.data.commentsToDelete.some((function(t){return t.id===e.id}))}));case"ADD_COMMENT":var n=yt(t.data);return[].concat(i._toConsumableArray(e),[n]);case"ADD_COMMENTS":var o=t.data.commentsToAdd.map((function(e){return yt(e)}));return[].concat(i._toConsumableArray(e),i._toConsumableArray(o));case"EDIT_COMMENT":return e.map((function(e,n){return t.data.id===e.id?Object.assign({},e,{content:t.data.content,height:t.data.height,width:t.data.width,x_pos:t.data.x_pos?t.data.x_pos:e.x_pos,y_pos:t.data.y_pos?t.data.y_pos:e.y_pos}):e}));case"SET_COMMENT_PROPERTIES":return e.map((function(e){return e.id===t.data.commentId?Object.assign({},e,t.data.commentProperties):e}));case"SIZE_AND_POSITION_OBJECTS":return e.map((function(e,n){var i=t.data.objectsInfo[e.id];return void 0!==i?Object.assign({},e,{height:i.height,width:i.width,x_pos:i.x_pos,y_pos:i.y_pos}):e}));case"ADD_COMMENT_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs=i.customAttrs||[],i.customAttrs.push(t.data.attrName),i}return e}));case"REMOVE_COMMENT_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs&&(i.customAttrs=i.customAttrs.filter((function(e){return e!==t.data.attrName}))),i}return e}));case"SET_OBJECTS_COLOR_CLASS_NAME":return e.map((function(e){var n=t.data.objIds.indexOf(e.id);if(n>-1){var i=Array.isArray(t.data.newColorClass)?t.data.newColorClass[n]||null:t.data.newColorClass,o=function(e,t){var n="";e?(n=function(e){var t=e.split(" ").filter((function(e){return!h.getBkgColorClass(e)})).join(" ");return t}(e),n=function(e,t){return e?e+" "+t:t}(n,t)):n=t;return n}(e.class_name,i);return Object.assign({},e,{class_name:o})}return e}));case"SET_OBJECTS_CLASS_NAME":return e.map((function(e){var n=t.data.objIds.indexOf(e.id);if(n>-1){var i=Object.assign({},e);return i.class_name=Array.isArray(t.data.newClassName)?t.data.newClassName[n]||null:t.data.newClassName,i}return e}));case"SET_OBJECTS_STYLE":return e.map((function(e){if(t.data.objIds.indexOf(e.id)>-1){var n=Object.assign({},e);return t.data.temporary?n.style_temp=t.data.newStyle:n.style=t.data.newStyle,n}return e}));case"SET_OBJECTS_MULTI_STYLE":return e.map((function(e){var n=t.data.pipelineObjStyles.find((function(n){return n.pipelineId===t.data.pipelineId&&n.objId===e.id}));if(n){var i=Object.assign({},e),o=n&&n.style?n.style:null;return t.data.temporary?i.style_temp=o:i.style=o,i}return e}));case"REMOVE_ALL_STYLES":return e.map((function(e){if(t.data.temporary&&e.style_temp){var n=Object.assign({},e);return delete n.style_temp,n}if(!t.data.temporary&&e.style){var i=Object.assign({},e);return delete i.style,i}return e}));default:return e}};function yt(e){var t={id:e.id,content:e.content,height:e.height,width:e.width,x_pos:e.x_pos,y_pos:e.y_pos};return void 0!==e.class_name&&(t.class_name=e.class_name),t}var mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DELETE_SUPERNODES":return e.filter((function(e){return!t.data.supernodesToDelete.some((function(t){return e.srcNodeId===t.id||e.trgNodeId===t.id}))}));case"DELETE_OBJECT":return e.filter((function(e){return e.srcNodeId!==t.data.id&&e.trgNodeId!==t.data.id}));case"REMOVE_LINKS":return e.filter((function(e){return!t.data.linksToDelete.some((function(t){return t.id===e.id}))}));case"ADD_LINK":var n={id:t.data.id};return _t(n,"type",t.data.type),_t(n,"class_name",t.data.class_name),_t(n,"srcPos",t.data.srcPos),_t(n,"srcNodeId",t.data.srcNodeId),_t(n,"srcNodePortId",t.data.srcNodePortId),_t(n,"trgPos",t.data.trgPos),_t(n,"trgNodeId",t.data.trgNodeId),_t(n,"trgNodePortId",t.data.trgNodePortId),_t(n,"decorations",t.data.decorations),_t(n,"style",t.data.style),_t(n,"style_temp",t.data.style_temp),_t(n,"linkName",t.data.linkName),_t(n,"typeAttr",t.data.typeAttr),_t(n,"description",t.data.description),_t(n,"app_data",t.data.app_data),[].concat(i._toConsumableArray(e),[n]);case"ADD_LINKS":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.linksToAdd));case"SET_LINKS":return i._toConsumableArray(t.data);case"MOVE_OBJECTS":return e.map((function(e){if(t.data.links&&t.data.links.findIndex((function(t){return t.id===e.id}))>-1){var n=Object.assign({},e);n.srcPos&&(n.srcPos.x_pos+=t.data.offsetX,n.srcPos.y_pos+=t.data.offsetY),n.trgPos&&(n.trgPos.x_pos+=t.data.offsetX,n.trgPos.y_pos+=t.data.offsetY)}return e}));case"SET_LINK_POSITIONS":return e.map((function(e,n){if(t.data.linkPositions&&void 0!==t.data.linkPositions[e.id]){var i=Object.assign({},e);return t.data.linkPositions[e.id].srcPos&&(i=Object.assign(i,{srcPos:t.data.linkPositions[e.id].srcPos})),t.data.linkPositions[e.id].trgPos&&(i=Object.assign(i,{trgPos:t.data.linkPositions[e.id].trgPos})),i}return e}));case"SIZE_AND_POSITION_OBJECTS":return e.map((function(e,n){if(t.data.linksInfo&&void 0!==t.data.linksInfo[e.id]){var i=Object.assign({},e);return t.data.linksInfo[e.id].srcPos&&(i=Object.assign(i,{srcPos:t.data.linksInfo[e.id].srcPos})),t.data.linksInfo[e.id].trgPos&&(i=Object.assign(i,{trgPos:t.data.linksInfo[e.id].trgPos})),i}return e}));case"SET_LINK_PROPERTIES":return e.map((function(e){return e.id===t.data.linkId?Object.assign({},e,t.data.linkProperties):e}));case"SET_LINK_SRC_INFO":return e.map((function(e){if(e.id===t.data.linkId){var n=Object.assign({},e);return delete n.srcNodeId,delete n.srcNodePortId,delete n.srcPos,n.srcNodeId=t.data.srcNodeId,t.data.srcNodePortId&&(n.srcNodePortId=t.data.srcNodePortId),n}return e}));case"SET_LINK_TRG_INFO":return e.map((function(e){if(e.id===t.data.linkId){var n=Object.assign({},e);return delete n.trgNodeId,delete n.trgNodePortId,delete n.trgPos,n.trgNodeId=t.data.trgNodeId,t.data.trgNodePortId&&(n.trgNodePortId=t.data.trgNodePortId),n}return e}));case"DELETE_LINK":return e.filter((function(e){return e.id!==t.data.id}));case"DELETE_LINKS":return e.filter((function(e){return-1===t.data.linksToDelete.findIndex((function(t){return e.id===t.id}))}));case"UPDATE_LINKS":return t.data.linksToUpdate?e.map((function(e){var n=t.data.linksToUpdate.find((function(t){return t.id===e.id}));if(n){var i=Object.assign({},e,n);return n.srcPos?(delete i.srcNodeId,delete i.srcNodePortId):n.srcNodeId&&delete i.srcPos,n.trgPos?(delete i.trgNodeId,delete i.trgNodePortId):n.trgNodeId&&delete i.trgPos,i}return e})):e;case"SET_LINKS_CLASS_NAME":return e.map((function(e){var n=t.data.linkIds.indexOf(e.id);if(n>-1){var i=Object.assign({},e);return i.class_name=Array.isArray(t.data.newClassName)?t.data.newClassName[n]:t.data.newClassName,i}return e}));case"SET_LINKS_STYLE":return e.map((function(e){if(t.data.objIds.indexOf(e.id)>-1){var n=Object.assign({},e);return t.data.temporary?n.style_temp=t.data.newStyle:n.style=t.data.newStyle,n}return e}));case"SET_LINKS_MULTI_STYLE":return e.map((function(e){var n=t.data.pipelineObjStyles.find((function(n){return n.pipelineId===t.data.pipelineId&&n.objId===e.id}));if(n){var i=Object.assign({},e),o=n&&n.style?n.style:null;return t.data.temporary?i.style_temp=o:i.style=o,i}return e}));case"SET_LINK_DECORATIONS":return e.map((function(e,n){if(t.data.linkId===e.id){var i=Object.assign({},e);return i.decorations=t.data.decorations,i}return e}));case"SET_LINKS_MULTI_DECORATIONS":return e.map((function(e){var n=t.data.pipelineLinkDecorations.find((function(n){return n.pipelineId===t.data.pipelineId&&n.linkId===e.id}));return n?Object.assign({},e,{decorations:n.decorations}):e}));case"REMOVE_ALL_STYLES":return e.map((function(e){if(t.data.temporary&&e.style_temp){var n=Object.assign({},e);return delete n.style_temp,n}if(!t.data.temporary&&e.style){var i=Object.assign({},e);return delete i.style,i}return e}));case"ADD_COMMENT":var r=[];return t.data.selectedObjectIds&&t.data.selectedObjectIds.forEach((function(e,n){r.push({id:t.data.linkIds[n],srcNodeId:t.data.id,trgNodeId:t.data.selectedObjectIds[n],type:o.COMMENT_LINK})})),[].concat(i._toConsumableArray(e),r);default:return e}};function _t(e,t,n){void 0!==n&&(e[t]=n)}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){o._defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CANVAS_INFO":return t.canvasInfo?Object.assign({},t.canvasInfo):e;case"SET_CANVAS_CONFIG_INFO":case"REPLACE_PIPELINES":return Object.assign({},e,{pipelines:t.data.pipelines});case"ADD_EXTERNAL_PIPELINE_FLOW":var n=t.newPipelines.map((function(e){return Object.assign({},e)})),r=e.pipelines.concat(n);return Object.assign({},e,{pipelines:r});case"REMOVE_EXTERNAL_PIPELINE_FLOW":var a=e.pipelines.filter((function(e){return!e.parentUrl||e.parentUrl!==t.externalUrl}));return Object.assign({},e,{pipelines:a});case"REPLACE_SN_AND_PIPELINES":var s=e.pipelines.filter((function(e){return!t.data.pipelinesToRemove.some((function(t){return t.id===e.id}))}));return s=(s=s.map((function(e){return e.id===t.data.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t)}):e}))).concat(t.data.pipelinesToAdd),Object.assign({},e,{pipelines:s});case"SET_PIPELINE_PARENT_URL":var d=e.pipelines.map((function(e){if(t.data.pipelines.some((function(t){return t.id===e.id}))){var n=Object.assign({},e);return t.data.url?n.parentUrl=t.data.url:delete n.parentUrl,n}return e}));return Object.assign({},e,{pipelines:d});case"DELETE_PIPELINE":var c=e.pipelines.filter((function(e){return e.id!==t.data.id}));return Object.assign({},e,{pipelines:c});case"SET_ZOOM":if(t.data.enableSaveZoom===o.SAVE_ZOOM_PIPELINE_FLOW){var l=e.pipelines.map((function(e){return e.id===t.pipelineId?Object.assign({},e,{zoom:{k:t.data.zoom.k,x:t.data.zoom.x,y:t.data.zoom.y}}):e}));return Object.assign({},e,{pipelines:l})}return e;case"ADD_SUPERNODES":var u=[].concat(i._toConsumableArray(e.pipelines),i._toConsumableArray(t.data.pipelinesToAdd));return u=u.map((function(e){return e.id===t.data.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t)}):e})),Object.assign({},e,{pipelines:u});case"DELETE_SUPERNODES":var p=e.pipelines.filter((function(e){return!t.data.pipelinesToDelete.some((function(t){return t.id===e.id}))}));return p=p.map((function(e){return e.id===t.data.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t),links:mt(e.links,t)}):e})),Object.assign({},e,{pipelines:p});case"SET_SUBDUE_STYLE":return Object.assign({},e,{subdueStyle:t.data.subdueStyle});case"HIDE_COMMENTS":return bt(bt({},e),{},{hideComments:!0});case"SHOW_COMMENTS":return bt(bt({},e),{},{hideComments:!1});case"ADD_NODE":case"REPLACE_NODES":case"REPLACE_NODE":case"SIZE_AND_POSITION_OBJECTS":case"SET_NODE_PARAMETERS":case"SET_NODE_UI_PARAMETERS":case"SET_NODE_MESSAGE":case"SET_NODE_MESSAGES":case"SET_NODE_DECORATIONS":case"SET_LINK_DECORATIONS":case"ADD_NODE_ATTR":case"REMOVE_NODE_ATTR":case"SET_NODE_LABEL":case"SET_OBJECTS_CLASS_NAME":case"SET_OBJECTS_COLOR_CLASS_NAME":case"SET_INPUT_PORT_LABEL":case"SET_OUTPUT_PORT_LABEL":case"SET_INPUT_PORT_SUBFLOW_NODE_REF":case"SET_OUTPUT_PORT_SUBFLOW_NODE_REF":case"MOVE_OBJECTS":case"DELETE_OBJECT":case"ADD_LINK":case"SET_LINKS":case"SET_LINK_PROPERTIES":case"SET_LINK_SRC_INFO":case"SET_LINK_TRG_INFO":case"SET_LINKS_CLASS_NAME":case"DELETE_LINK":case"DELETE_LINKS":case"UPDATE_LINKS":case"ADD_COMMENT":case"EDIT_COMMENT":case"SET_COMMENT_PROPERTIES":case"ADD_COMMENT_ATTR":case"REMOVE_COMMENT_ATTR":var f=e.pipelines.map((function(e){return e.id===t.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)}):e}));return Object.assign({},e,{pipelines:f});case"DELETE_AND_UPDATE_OBJECTS":var h=e.pipelines.map((function(e){if(e.id===t.pipelineId){var n=mt(e.links,{type:"UPDATE_LINKS",data:{linksToUpdate:t.data.linksToUpdate||[]}});n=mt(n,{type:"DELETE_LINKS",data:{linksToDelete:t.data.linksToDelete||[]}});var i=ht(e.nodes,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:t.data.supernodesToDelete||[]}});n=mt(n,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:t.data.supernodesToDelete||[]}}),i=ht(i,{type:"DELETE_NODES",data:{nodesToDelete:t.data.nodesToDelete||[]}});var o=gt(e.comments,{type:"DELETE_COMMENTS",data:{commentsToDelete:t.data.commentsToDelete||[]}});return Object.assign({},e,{nodes:i,comments:o,links:n})}return e}));return h=h.filter((function(e){return!t.data.pipelinesToDelete.some((function(t){return t.id===e.id}))})),Object.assign({},e,{pipelines:h});case"ADD_PASTED_OBJECTS":case"ADD_AND_UPDATE_OBJECTS":var g=e.pipelines.map((function(e){if(e.id===t.pipelineId){var n=ht(e.nodes,{type:"ADD_SUPERNODES",data:{supernodesToAdd:t.data.supernodesToAdd||[]}});n=ht(n,{type:"ADD_NODES",data:{nodesToAdd:t.data.nodesToAdd||[]}});var i=gt(e.comments,{type:"ADD_COMMENTS",data:{commentsToAdd:t.data.commentsToAdd||[]}}),o=mt(e.links,{type:"ADD_LINKS",data:{linksToAdd:t.data.linksToAdd||[]}});return o=mt(o,{type:"UPDATE_LINKS",data:{linksToUpdate:t.data.linksToUpdate||[]}}),Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return g=[].concat(i._toConsumableArray(g),i._toConsumableArray(t.data.pipelinesToAdd)),Object.assign({},e,{pipelines:g});case"DELETE_PASTED_OBJECTS":var y=e.pipelines.filter((function(e){return!function(e,t){return t.some((function(t){return t.id===e.id}))}(e,t.data.pipelinesToDelete)})).map((function(e){if(e.id===t.pipelineId){var n=ht(e.nodes,{type:"DELETE_NODES",data:t.data}),i=gt(e.comments,{type:"DELETE_COMMENTS",data:t.data}),o=mt(e.links,{type:"REMOVE_LINKS",data:t.data});return Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return Object.assign({},e,{pipelines:y});case"SET_SUPERNODE_EXPAND_STATE":var m=e.pipelines.map((function(e){if(e.id===t.pipelineId){var n=ht(e.nodes,{type:"SET_SUPERNODE_EXPAND_STATE",data:t.data});n=ht(n,{type:"SET_NODE_POSITIONS",data:{nodePositions:t.data.objectPositions}});var i=gt(e.comments,{type:"SET_COMMENT_POSITIONS",data:{commentPositions:t.data.objectPositions}}),o=mt(e.links,{type:"SET_LINK_POSITIONS",data:t.data});return Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return Object.assign({},e,{pipelines:m});case"DECONSTRUCT_SUPERNODE":var _=e.pipelines.filter((function(e){return e.id!==t.data.pipelineToDelete.id})).map((function(e){if(e.id===t.data.pipelineId){var n=ht(e.nodes,{type:"ADD_NODES",data:t.data}),i=gt(e.comments,{type:"ADD_COMMENTS",data:t.data}),o=mt(e.links,{type:"ADD_LINKS",data:t.data});return n=ht(n,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:[t.data.supernodeToDelete]}}),o=mt(o,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:[t.data.supernodeToDelete]}}),n=ht(n,{type:"SET_NODE_POSITIONS",data:{nodePositions:t.data.newObjectPositions}}),i=gt(i,{type:"SET_COMMENT_POSITIONS",data:{commentPositions:t.data.newObjectPositions}}),o=mt(o,{type:"SET_LINK_POSITIONS",data:{linkPositions:t.data.newLinkPositions}}),Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return Object.assign({},e,{pipelines:_});case"RECONSTRUCT_SUPERNODE":var v=[].concat(i._toConsumableArray(e.pipelines),[t.data.pipelineToDelete]);return v=v.map((function(e){if(e.id===t.data.pipelineId){var n=ht(e.nodes,{type:"DELETE_NODES",data:{nodesToDelete:t.data.nodesToAdd}}),i=gt(e.comments,{type:"DELETE_COMMENTS",data:{commentsToDelete:t.data.commentsToAdd}}),o=mt(e.links,{type:"REMOVE_LINKS",data:{linksToDelete:t.data.linksToAdd}});return n=ht(n,{type:"ADD_SUPERNODES",data:{supernodesToAdd:[t.data.supernodeToDelete]}}),o=mt(o,{type:"ADD_LINKS",data:{linksToAdd:t.data.linksToRemove}}),n=ht(n,{type:"SET_NODE_POSITIONS",data:{nodePositions:t.data.oldObjectPositions}}),i=gt(i,{type:"SET_COMMENT_POSITIONS",data:{commentPositions:t.data.oldObjectPositions}}),o=mt(o,{type:"SET_LINK_POSITIONS",data:{linkPositions:t.data.oldLinkPositions}}),Object.assign({},e,{nodes:n,comments:i,links:o})}return e})),Object.assign({},e,{pipelines:v});case"SET_OBJECTS_STYLE":case"SET_LINKS_STYLE":var b=Object.keys(t.data.pipelineObjIds),P=e.pipelines.map((function(e){return b.indexOf(e.id)>-1?(t.data.objIds=t.data.pipelineObjIds[e.id],t.data.pipelineId=e.id,Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)})):e}));return Object.assign({},e,{pipelines:P});case"SET_OBJECTS_MULTI_STYLE":case"SET_LINKS_MULTI_STYLE":var k=e.pipelines.map((function(e){return t.data.pipelineObjStyles.findIndex((function(t){return t.pipelineId===e.id}))>-1?(t.data.pipelineId=e.id,Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)})):e}));return Object.assign({},e,{pipelines:k});case"SET_NODES_MULTI_DECORATIONS":var I=e.pipelines.map((function(e){return t.data.pipelineNodeDecorations.findIndex((function(t){return t.pipelineId===e.id}))>-1?(t.data.pipelineId=e.id,Object.assign({},e,{nodes:ht(e.nodes,t),comments:e.comments,links:e.links})):e}));return Object.assign({},e,{pipelines:I});case"SET_LINKS_MULTI_DECORATIONS":var N=e.pipelines.map((function(e){return t.data.pipelineLinkDecorations.findIndex((function(t){return t.pipelineId===e.id}))>-1?(t.data.pipelineId=e.id,Object.assign({},e,{nodes:e.nodes,comments:e.comments,links:mt(e.links,t)})):e}));return Object.assign({},e,{pipelines:N});case"REMOVE_ALL_STYLES":var E=e.pipelines.map((function(e){return Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)})}));return Object.assign({},e,{pipelines:E});default:return e}};var kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_CONTEXT_MENU":var n=t.data.menuDef.map((function(e){return Object.assign({},e)}));return n.length>0?Object.assign({},e,{isOpen:!0,menuDef:n,source:t.data.source}):e;case"CLOSE_CONTEXT_MENU":return Object.assign({},e,{isOpen:!1});default:return e}},It=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_RIGHT_FLYOUT_CONFIG"===t.type&&t.data.config?{content:t.data.config.content,isOpen:t.data.config.isOpen}:e},Nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BOTTOM_PANEL_CONFIG"===t.type&&t.data.config?Object.assign({},e,t.data.config):e},Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_TOP_PANEL_CONFIG"===t.type&&t.data.config?Object.assign({},e,t.data.config):e},St=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CANVAS_INFO":return t.canvasInfoIdChanged||!Ot(e,t.canvasInfo)?[{pipelineId:t.canvasInfo.primary_pipeline,pipelineFlowId:t.canvasInfo.id}]:e;case"SET_BREADCRUMBS":return t.data.breadcrumbs.map((function(e){return Object.assign({},e)}));case"ADD_BREADCRUMB":return[].concat(i._toConsumableArray(e),[{pipelineId:t.data.pipelineId,supernodeId:t.data.supernodeId,supernodeParentPipelineId:t.data.supernodeParentPipelineId,externalUrl:t.data.externalUrl,label:t.data.label}]);case"ADD_BREADCRUMBS":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.addBreadcrumbs));case"SET_TO_INDEXED_BREADCRUMB":return t.data.breadcrumbIndex>=0&&t.data.breadcrumbIndex<e.length?e.slice(0,t.data.breadcrumbIndex+1):e;case"SET_TO_PREVIOUS_BREADCRUMB":return e.length>1?e.slice(0,e.length-1):e;case"RESET_BREADCRUMB":return[{pipelineId:t.data.pipelineId}];default:return e}},Ot=function(e,t){if(t&&t.pipelines&&Array.isArray(e)&&e.length>0&&e[e.length-1].pipelineId){var n=e[e.length-1].pipelineId;return t.pipelines.findIndex((function(e){return e.id===n}))>-1}return!1},Ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"SET_CANVAS_CONFIG_INFO"===t.type?t.data.canvasConfig:e},jt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ZOOM":return Object.assign({},e);case"SET_TOOLBAR_CONFIG":return Object.assign({},e,{config:t.data.toolbarConfig});default:return e}},Tt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_TEXT_TOOLBAR_DEF"===t.type&&t.data.textToolbarDef?Object.assign({},e,t.data.textToolbarDef):e},wt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_NOTIFICATION_MESSAGES":return[];case"SET_NOTIFICATION_MESSAGES":return t.data.messages.forEach((function(e){return function(e){null!==e.type&&""!==e.type&&void 0!==e.type||(e.type="unspecified");return e}(e)})),t.data.messages;case"DELETE_NOTIFICATION_MESSAGES":var n=Array.isArray(t.data.ids)?t.data.ids:[t.data.ids];return e.filter((function(e){return!n.includes(e.id)}));default:return e}};var Lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CANVAS_INFO":return t.canvasInfoIdChanged?{}:e;case"CLEAR_SELECTIONS":case"SET_BREADCRUMBS":case"ADD_BREADCRUMB":case"ADD_BREADCRUMBS":case"SET_TO_INDEXED_BREADCRUMB":case"SET_TO_PREVIOUS_BREADCRUMB":case"RESET_BREADCRUMB":return{};case"ADD_PASTED_OBJECTS":case"SET_SELECTIONS":return{pipelineId:t.pipelineId,selections:i._toConsumableArray(t.data.selections)};case"DELETE_OBJECT":if(e.selections){var n=e.selections.filter((function(e){return t.data.id!==e}));return{pipelineId:e.pipelineId,selections:n}}return e;case"DELETE_AND_UPDATE_OBJECTS":if(e.selections){var o=[].concat(i._toConsumableArray(t.data.linksToDelete),i._toConsumableArray(t.data.supernodesToDelete),i._toConsumableArray(t.data.nodesToDelete),i._toConsumableArray(t.data.commentsToDelete)),r=e.selections.filter((function(e){return!o.some((function(t){return t.id===e}))}));return{pipelineId:e.pipelineId,selections:r}}return e;default:return e}},At=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NOTIFICATION_PANEL_CONFIG":return Object.assign({},e,{config:t.data.notificationPanelConfig});case"SET_NOTIFICATION_PANEL_OPEN_STATE":return Object.assign({},e,{isOpen:t.data.isOpen});default:return e}},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_EXTERNAL_PIPELINE_FLOW":var n=Object.assign({},t.newPipelineFlow);return[].concat(i._toConsumableArray(e),[n]);case"REMOVE_EXTERNAL_PIPELINE_FLOW":return e.filter((function(e){return e.url!==t.externalUrl}));case"REPLACE_SN_AND_PIPELINES":var o=e.filter((function(e){return!t.data.extPipelineFlowsToDelete.some((function(t){return t.url===e.url}))}));return[].concat(i._toConsumableArray(o),i._toConsumableArray(t.data.extPipelineFlowsToAdd));case"ADD_OBJECTS_AND_UPDATE":case"ADD_SUPERNODES":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.extPipelineFlowsToAdd));case"DELETE_PASTED_OBJECTS":case"DELETE_OBJECTS_AND_UPDATE":case"DELETE_SUPERNODES":return e.filter((function(e){return!t.data.extPipelineFlowsToDelete.some((function(t){return e.url===t.url}))}));case"DECONSTRUCT_SUPERNODE":return e.filter((function(e){return e.id!==t.data.extPipelineFlowToDelete.id}));case"RECONSTRUCT_SUPERNODE":return[].concat(i._toConsumableArray(e),[t.data.extPipelineFlowToDelete]);case"SET_CANVAS_INFO":return t.canvasInfoIdChanged?[]:e;default:return e}},Dt=function(){function n(t){e._classCallCheck(this,n);var i=d.combineReducers({selectioninfo:Lt,canvasconfig:Ct,canvasinfo:Pt,breadcrumbs:St,palette:pt,notifications:wt,notificationpanel:At,externalpipelineflows:xt,tooltip:ct,canvastoolbar:jt,texttoolbar:Tt,contextmenu:kt,rightflyout:It,bottompanel:Nt,toppanel:Et}),o={selectioninfo:{},canvasinfo:t,canvasconfig:S.getDefaultCanvasConfig(),breadcrumbs:[{pipelineId:t.primary_pipeline,pipelineFlowId:t.id}],palette:{content:{}},notifications:[],notificationpanel:{isOpen:!1,config:{}},externalpipelineflows:[],tooltip:{},canvastoolbar:{},texttoolbar:{isOpen:!1},contextmenu:{isOpen:!1,menuDef:[],source:{}},rightflyout:{},bottompanel:{panelHeight:393},toppanel:{}},r=!1;"undefined"!=typeof window&&(r=window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__()),this.store=d.createStore(i,o,r),this.dispatch=this.dispatch.bind(this)}return e._createClass(n,[{key:"dispatch",value:function(e){this.store.dispatch(e)}},{key:"subscribe",value:function(e){return this.store.subscribe(e)}},{key:"getStore",value:function(){return this.store}},{key:"getPalette",value:function(){return o.cloneDeep_1(this.store.getState().palette)}},{key:"getPaletteData",value:function(){return o.cloneDeep_1(this.store.getState().palette.content)}},{key:"getPaletteCategory",value:function(e){return o.cloneDeep_1(this.store.getState().palette.content.categories.find((function(t){return t.id===e})))}},{key:"getCanvasInfo",value:function(){return o.cloneDeep_1(this.store.getState().canvasinfo)}},{key:"getPipelineFlowId",value:function(){return this.store.getState().canvasinfo.id}},{key:"getPrimaryPipelineId",value:function(){return this.store.getState().canvasinfo.primary_pipeline}},{key:"getZoom",value:function(e){var t=this.getNonClonedPipeline(e);return t?o.cloneDeep_1(t.zoom):null}},{key:"isEmpty",value:function(e){var t=this.getNonClonedPipeline(e);return!!(t.nodes&&0===t.nodes.length&&t.comments&&0===t.comments.length&&t.links&&0===t.links.length)}},{key:"getNonClonedPipeline",value:function(e){return this.store.getState().canvasinfo.pipelines.find((function(t){return t.id===e}))}},{key:"getNonClonedSelectedObjs",value:function(e){var t=this.getSelectedPipelineId();if(t){var n=this.getNonClonedPipeline(t);if(n&&n[e]){var i=this.getSelectedObjectIds();return n[e].filter((function(e){return i.includes(e.id)}))}}return[]}},{key:"getNodes",value:function(e){var t=this.getNonClonedPipeline(e);return t&&t.nodes?o.cloneDeep_1(t.nodes):[]}},{key:"getNode",value:function(e,t){var n=this.getNonClonedPipeline(t),i=null;if(n&&n.nodes){var r=n.nodes.find((function(t){return t.id===e}));r&&(i=o.cloneDeep_1(r))}return i}},{key:"getComments",value:function(e){var t=this.getNonClonedPipeline(e);return t&&t.comments?o.cloneDeep_1(t.comments):[]}},{key:"getComment",value:function(e,t){var n=this.getNonClonedPipeline(t),i=null;if(n&&n.comments){var r=n.comments.find((function(t){return t.id===e}));r&&(i=o.cloneDeep_1(r))}return i}},{key:"getLinks",value:function(e){var t=this.getNonClonedPipeline(e);return t&&t.links?o.cloneDeep_1(t.links):[]}},{key:"getLink",value:function(e,t){var n=this.getNonClonedPipeline(t),i=null;if(n&&n.links){var r=n.links.find((function(t){return t.id===e}));r&&(i=o.cloneDeep_1(r))}return i}},{key:"getBreadcrumbs",value:function(){return o.cloneDeep_1(this.store.getState().breadcrumbs)}},{key:"getCanvasConfig",value:function(){return Object.assign({},this.store.getState().canvasconfig)}},{key:"getNodeLayout",value:function(){return this.cloneData(this.store.getState().canvasconfig.enableNodeLayout)}},{key:"getCanvasLayout",value:function(){return this.cloneData(this.store.getState().canvasconfig.enableCanvasLayout)}},{key:"isTooltipOpen",value:function(){return!t.isEmpty_1(this.store.getState().tooltip)}},{key:"getTooltip",value:function(){return this.cloneData(this.store.getState().tooltip)}},{key:"isRightFlyoutOpen",value:function(){return this.store.getState().rightflyout.isOpen}},{key:"isBottomPanelOpen",value:function(){return this.store.getState().bottompanel.isOpen}},{key:"isTopPanelOpen",value:function(){return this.store.getState().toppanel.isOpen}},{key:"getNotificationPanel",value:function(){return this.cloneData(this.store.getState().notificationpanel)}},{key:"getNotifications",value:function(){return this.store.getState().notifications.map((function(e,t){return Object.assign({},e)}))}},{key:"isNotificationPanelOpen",value:function(){return this.getNotificationPanel().isOpen}},{key:"getContextMenuSource",value:function(){return this.cloneData(this.store.getState().contextmenu.source)}},{key:"isContextMenuDisplayed",value:function(){return this.store.getState().contextmenu.isOpen}},{key:"getSelectionInfo",value:function(){return this.cloneData(this.store.getState().selectioninfo)}},{key:"getSelectedPipelineId",value:function(){return this.getSelectionInfo().pipelineId}},{key:"getSelectedObjectIds",value:function(){var e=this.store.getState().selectioninfo.selections||[];return this.cloneData(e)}},{key:"getSelectedNodes",value:function(){return o.cloneDeep_1(this.getNonClonedSelectedObjs("nodes"))}},{key:"getSelectedComments",value:function(){return o.cloneDeep_1(this.getNonClonedSelectedObjs("comments"))}},{key:"getSelectedLinks",value:function(){return o.cloneDeep_1(this.getNonClonedSelectedObjs("links"))}},{key:"areAllSelectedObjectsLinks",value:function(){return this.getNonClonedSelectedObjs("links").length===this.getSelectedObjectIds().length}},{key:"getExternalPipelineFlows",value:function(){return this.cloneData(this.store.getState().externalpipelineflows)}},{key:"getExternalPipelineFlow",value:function(e){var t=this.store.getState().externalpipelineflows.find((function(t){return t.url===e}));return t?this.cloneData(t):null}},{key:"cloneData",value:function(e){return o.cloneDeep_1(e)}}]),n}(),Mt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow Schema",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json",properties:{doc_type:{description:"Document type",type:"string"},version:{description:"Pipeline-flow schema version",enum:["1.0"]},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json"]},open_with_tool:{description:"Preferred authoring application",type:"string"},id:{description:"Document identifier, GUID recommended",type:"string"},primary_pipeline:{description:"Reference to the primary (main) pipeline flow within the document",type:"string"},pipelines:{description:"Array of pipelines",type:"array",minItems:1,items:{$ref:"#/definitions/pipeline_def"},uniqueItems:!0},schemas:{description:"Array of data record schemas used in the document",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json#/definitions/record_schema"},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["doc_type","version","primary_pipeline","pipelines"],additionalProperties:!1,definitions:{pipeline_def:{description:"Definition of a single pipeline flow",type:"object",properties:{id:{description:"Unique identifier",type:"string"},runtime:{description:"Runtime associated with the operations in the current pipeline",type:"string"},nodes:{description:"Array of pipeline nodes",type:"array",minItems:0,items:{oneOf:[{$ref:"#/definitions/node_def"},{$ref:"#/definitions/supernode_def"},{$ref:"#/definitions/binding_entry_node_def"},{$ref:"#/definitions/binding_exit_node_def"},{$ref:"#/definitions/model_node_def"}]},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","runtime","nodes"],additionalProperties:!1},node_def:{description:"Definition of a single pipeline node",type:"object",properties:{id:{description:"Unique identifier for node within the current pipeline",type:"string"},type:{description:"Node type - always 'execution_node' for non-model pipeline elements",enum:["execution_node"]},op:{description:"Operator type identifier",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","op"],additionalProperties:!1},supernode_def:{description:"Definition of a supernode which serves as the entry point for a sub-pipeline",type:"object",properties:{id:{description:"Unique identifier for the supernode within the current pipeline",type:"string"},type:{description:"Node type - always 'super_node' for supernode elements",enum:["super_node"]},subflow_ref:{description:"Refers to the sub-flow associated with this supernode",type:"object",properties:{url:{description:"Reference to an external sub-flow. When not present the sub-flow is assumed to be in the current document. A value of 'app_defined' indicates a sub-flow identifier is present, but the controlling application will serve up the sub-pipeline in the form of a new pipeline-flow document (no sub-flow is present in the document).",type:"string"},pipeline_id_ref:{description:"Sub-flow identifier reference",type:"string"}},required:["pipeline_id_ref"]},inputs:{$ref:"#/definitions/bound_ports_def"},outputs:{$ref:"#/definitions/bound_ports_def"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","subflow_ref","inputs"],additionalProperties:!1},binding_entry_node_def:{description:"Defines an entry point (source) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},output:{$ref:"#/definitions/port_binding_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_data_asset_def"}},required:["id","type"],additionalProperties:!1},binding_exit_node_def:{description:"Defines an exit point (sink) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},input:{$ref:"#/definitions/port_binding_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_data_asset_def"}},required:["id","type"],additionalProperties:!1},model_node_def:{description:"Definition of a single predictive model node",type:"object",properties:{id:{description:"Unique identifier for the model within the current pipeline",type:"string"},type:{description:"Node type - always 'model_node' for model pipeline elements",enum:["model_node"]},model_ref:{description:"Reference to the binary model",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","inputs"],additionalProperties:!1},port_def:{description:"Port definition (input/output) on a node",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema reference associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:0,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},port_binding_def:{description:"Definition (input/output) of a binding port on a node (bound or unbound). If no binding is present the port is bound at runtime via a configuration object or wrapper document.",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},link:{$ref:"#/definitions/link_def"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/port_def"},uniqueItems:!0},bound_ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/bound_port_def"},uniqueItems:!0},bound_port_def:{description:"Port definition (input/output) on a node with optional pipeline port binding for supernodes",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:1,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},subflow_node_ref:{description:"Optional node id binding within the current document.",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},link_def:{description:"Node link definition",type:"object",properties:{pipeline_id_ref:{description:"id of the pipeline this link connects to",type:"string"},node_id_ref:{description:"id of a node this link connects to",type:"string"},port_id_ref:{description:"optional port id of a node this link connects to",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["node_id_ref"],additionalProperties:!1},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{anyOf:[{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/pipeline_overview_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/pipeline_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/port_info_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/node_info_def"}]}},additionalProperties:!0}}},Rt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow UI Schema. Defines UI-only constructs for pipeline flow documents.",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#",properties:{},additionalProperties:!0,definitions:{pipeline_overview_def:{description:"Top level UI information",type:"object",properties:{name:{description:"User-defined name",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"}},additionalProperties:!0},pipeline_def:{description:"Pipeline level UI information",type:"object",properties:{zoom:{description:"Zoom factor",type:"integer"},comments:{description:"Array of Comments, optionally associated with nodes",type:"array",minItems:0,items:{$ref:"#/definitions/comment_def"},uniqueItems:!0}},additionalProperties:!0},port_info_def:{description:"Additional UI info for ports",type:"object",properties:{cardinality:{description:"Property to capture how many data assets are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of data assets. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1},class_name:{description:"CSS class name",type:"string"},label:{description:"Port name",type:"string"}},additionalProperties:!0},node_info_def:{description:"object with app-specific UI-information",type:"object",properties:{label:{description:"User-defined label",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},image:{description:"Image name (do not embed images inline!)",type:"string"},x_pos:{description:"x-position",type:"integer"},y_pos:{description:"y-position",type:"integer"},attributes:{description:"additional attributes",type:"string"},associations:{description:"Array of non-data node linkage",type:"array",minItems:0,items:{$ref:"#/definitions/association_def"}},messages:{descriptions:"An array of messages for the node",type:"array",minItems:0,items:{$ref:"#/definitions/message_def"},uniqueItems:!0},decorations:{description:"Array of decorations used to decorate nodes",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},association_def:{description:"Non-data link",type:"object",properties:{id:{description:"Association identifier",type:"string"},node_ref:{description:"Target node id",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["id","node_ref"],additionalProperties:!1},decoration_def:{description:"Decoration used to decorate a node",type:"object",properties:{id:{description:"An identifier used as a token when a hotspot is used",type:"string"},hotspot:{description:"Indicates whether teh decorator is a hotspot or not. ie does it send an event to consuming app. when clicked",type:"boolean"},class_name:{description:"CSS class name for decoration styling",type:"string"},positions:{description:"Shows where the decoration is displayed with respect to the node",enum:["topLeft","topRight","bottomLeft","bottomRight"]},image:{description:"Image displayed at the decoration position",type:"string"}}},message_def:{description:"Node message definition",type:"object",properties:{id_ref:{description:"Name of the parameter that has the message",type:"string"},validation_id:{description:"Validation identifier from the fail_message validation section.",type:"string"},type:{description:"Type of message",enum:["info","error","warning"]},text:{description:"Message string",type:"string"}}},comment_def:{type:"object",properties:{id:{description:"Comment identifier. Must be unique.",type:"string"},x_pos:{description:"Horizontal comment position",type:"integer",minimum:0},y_pos:{description:"Vertical comment position",type:"integer",minimum:0},width:{description:"Comment width",type:"integer",minimum:10},height:{description:"Comment height",type:"integer",minimum:10},class_name:{description:"CSS class(es) to apply to the comment",type:"string"},attributes:{description:"Optional attributes to be added to this element. For example: \"attributes\": \"attr1='value1'; attr2='value2'\"",type:"string"},content:{description:"Comment content",type:"string"},associated_id_refs:{description:"Optional array of associated node id references",type:"array",minItems:0,items:{$ref:"#/definitions/comment_link_def"},uniqueItems:!0}},required:["id","x_pos","y_pos","width","height"],additionalProperties:!0},comment_link_def:{description:"Comment link definition",type:"object",properties:{node_ref:{description:"Node reference",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["node_ref"],additionalProperties:!0}}},Ut={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#",title:"Watson Data Platform Pipeline Connection Schema",description:"Connection schema for pipelines in the Watson Data Platform",definitions:{common_pipeline_connection_def:{description:"Details of the connection to use for a pipeline binding node.",properties:{app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a connection by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the connection. If neither this attribute nor project_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the connection. If neither this attribute nor catalog_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"The properties for the connection. The specific properties allowed depend on the type of connection referenced.",additionalProperties:{type:"object"},type:"object"}},required:["ref"],type:"object"},common_pipeline_data_asset_def:{description:"Details of the data asset contained in a catalog or project to use for a pipeline binding node.",properties:{app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a data asset by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the data asset. If neither this attribute nor project_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the data asset. If neither this attribute nor catalog_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"Properties controlling how the data asset is used.",type:"object",additionalProperties:{type:"object"},properties:{attachment_ref:{description:"The ID of the data asset attachment to use. If not specified and used as a source, the first suitable attachment found will be used. If not specified and used as a target, a new attachment will be created.",type:"string"},name:{description:"Specifies the name of the data asset to read, create or update if ref is unset.",type:"string",default:!1},no_write_schema:{description:"When used as a target, whether to update the data asset with the schema when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1},no_write_status:{description:"When used as a target, whether to update the data asset with the status when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1}}}},type:"object"}}},Ft={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json#",title:"Watson Data Platform Datarecord Metadata Schema",description:"Metadata schema for datarecords in the Watson Data Platform",definitions:{record_schema:{description:"Description of a datarecord including column types and metadata",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"Name of datarecord",type:"string"},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json"],type:"string"},type:{description:"Always 'struct' for datarecord schema",type:"string"},fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0}},required:["fields"]},field:{description:"Definition of a datarecord field",type:"object",properties:{name:{description:"Field name. Must be unique within the datarecord",type:"string"},type:{description:"Field type. Can be a primitive type (string, integer, double, date, time, timestamp, binary, boolean, or other)",type:"string"},nullable:{description:"Whether or not one can place null values into the field",type:"boolean",default:!1},metadata:{$ref:"#/definitions/metadata"}},required:["name","type"]},metadata:{description:"Additional field metadata",type:"object",properties:{description:{description:"Field description",type:"string"},measure:{description:"Field measurement level",enum:["range","discrete","flag","set","ordered-set","typeless","collection","geospatial","default"]},modeling_role:{description:"Field role for modeling",enum:["input","target","both","none","partition","split","frequency","record-id"]},max_length:{description:"Maximum length for fields. Length is unlimited when not present",type:"number"},decimal_precision:{description:"Precision for decimal types",type:"number"},decimal_scale:{description:"Scale for decimal types",type:"number"},values:{description:"Array of unique categorical values for the column",type:"array",minItems:0,items:{description:"A value discovered in the data",type:"string"},uniqueItems:!0},range:{description:"Minimum and maximum discovered values for scalar data",type:"object",properties:{min:{description:"Lowest value discovered in the data",type:"number"},max:{description:"Highest value discovered in the data",type:"number"}},required:["min","max"]}},required:[]}}},Bt={$schema:"http://json-schema.org/draft-04/schema#",type:"object",description:"Abstract Canvas diagram schema",id:"http://api.dataplatform.ibm.com/schemas/common-canvas/palette/palette-v1-schema.json",properties:{categories:{description:"Array of palette categories",type:"array",minItems:0,items:{type:"object",properties:{category:{description:"The palette category that the items belong within",type:"string"},label:{description:"Category label",type:"string"},image:{description:"Encoded image or image reference for the category",type:"string"},nodetypes:{description:"Array of nodes within the current category",type:"array",items:{type:"object",properties:{label:{description:"Node label",type:"string"},description:{description:"Node description",type:"string"},type:{description:"Node classification type",enum:["binding","execution_node","super_node","model_node"]},operator_id_ref:{description:"Unique node type identifier",type:"string"},image:{description:"Encoded image or image reference for the node",type:"string"},subDiagramId:{description:"Optional sub diagram identifier.",type:"string"},input_ports:{description:"Array of node input ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}},output_ports:{description:"Array of node output ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}}},required:["label","image"]}}},required:["category","label"]}}},definitions:{port:{description:"Defines a node port for links",type:"object",properties:{id:{description:"Port identifier",type:"string"},label:{description:"Port long label",type:"string"},cardinality:{description:"Property to capture how many connections are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of connections. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1}},required:["id"]}}},Ht={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow Schema",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json",properties:{doc_type:{description:"Document type",type:"string"},version:{description:"Pipeline-flow schema version",enum:["2.0"]},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json"]},open_with_tool:{description:"Preferred authoring application",type:"string"},id:{description:"Document identifier, GUID recommended",type:"string"},parameters:{description:"Parameters for the flow document",type:"object",properties:{},additionalProperties:!0},primary_pipeline:{description:"Reference to the primary (main) pipeline flow within the document",type:"string"},pipelines:{description:"Array of pipelines",type:"array",minItems:1,items:{$ref:"#/definitions/pipeline_def"},uniqueItems:!0},schemas:{description:"Array of data record schemas used in the document",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v2-schema.json#/definitions/record_schema"},uniqueItems:!0},runtimes:{description:"Array of runtime objects referred to in the document",type:"array",minItems:0,items:{$ref:"#/definitions/runtime_def"},uniqueItems:!0},external_parameters:{description:"Array of parameterized property references",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/parameters/parameters-v2-schema.json#/definitions/param_property_ref"},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["doc_type","version","primary_pipeline","pipelines"],additionalProperties:!1,definitions:{pipeline_def:{description:"Definition of a single pipeline flow",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"User-readable name",type:"string"},runtime_ref:{description:"Reference to the id of the runtime associated with the operations in the current pipeline",type:"string"},nodes:{description:"Array of pipeline nodes",type:"array",minItems:0,items:{oneOf:[{$ref:"#/definitions/node_def"},{$ref:"#/definitions/supernode_def"},{$ref:"#/definitions/binding_entry_node_def"},{$ref:"#/definitions/binding_exit_node_def"},{$ref:"#/definitions/model_node_def"}]},uniqueItems:!0},parameters:{description:"Parameters for the pipeline",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","runtime_ref","nodes"],additionalProperties:!1},node_def:{description:"Definition of a single pipeline node",type:"object",properties:{id:{description:"Unique identifier for node within the current pipeline",type:"string"},type:{description:"Node type - always 'execution_node' for non-model pipeline elements",enum:["execution_node"]},op:{description:"Operator type identifier",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Optional reference to the id of the runtime associated with the current node",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","op"],additionalProperties:!1},supernode_def:{description:"Definition of a supernode which serves as the entry point for a sub-pipeline",type:"object",properties:{id:{description:"Unique identifier for the supernode within the current pipeline",type:"string"},type:{description:"Node type - always 'super_node' for supernode elements",enum:["super_node"]},open_with_tool:{description:"Name of the tool which can be used to view or edit the sub-flow for this supernode. The default is 'canvas'",type:"string"},subflow_ref:{description:"Refers to the sub-flow associated with this supernode",type:"object",properties:{url:{description:"Reference to an external sub-flow. When not present the sub-flow is assumed to be in the current document. A value of 'app_defined' indicates a sub-flow identifier is present, but the controlling application will serve up the sub-pipeline in the form of a new pipeline-flow document (no sub-flow is present in the document).",type:"string"},pipeline_id_ref:{description:"Sub-flow identifier reference",type:"string"}},required:["pipeline_id_ref"]},inputs:{$ref:"#/definitions/bound_ports_def"},outputs:{$ref:"#/definitions/bound_ports_def"},parameters:{description:"Input parameters for the supernode",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","subflow_ref","inputs"],additionalProperties:!1},binding_entry_node_def:{description:"Defines an entry point (source) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},outputs:{$ref:"#/definitions/ports_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the entry binding node",type:"object",properties:{},additionalProperties:!0}},required:["id","type"],additionalProperties:!1},binding_exit_node_def:{description:"Defines an exit point (sink) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},inputs:{$ref:"#/definitions/ports_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the binding exit node",type:"object",properties:{},additionalProperties:!0}},required:["id","type"],additionalProperties:!1},model_node_def:{description:"Definition of a single predictive model node",type:"object",properties:{id:{description:"Unique identifier for the model within the current pipeline",type:"string"},type:{description:"Node type - always 'model_node' for model pipeline elements",enum:["model_node"]},model_ref:{description:"Reference to the binary model",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Reference to the runtime associated with the current node",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","inputs"],additionalProperties:!1},port_def:{description:"Port definition (input/output) on a node",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema reference associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:0,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},parameters:{description:"Parameters for the port",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/port_def"},uniqueItems:!0},bound_ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/bound_port_def"},uniqueItems:!0},bound_port_def:{description:"Port definition (input/output) on a node with optional pipeline port binding for supernodes",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:1,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},subflow_node_ref:{description:"Optional node id binding within the current document.",type:"string"},parameters:{description:"Parameters for the binding port",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},link_def:{description:"Node link definition",type:"object",properties:{node_id_ref:{description:"id of a node this link connects to",type:"string"},port_id_ref:{description:"optional port id of a node this link connects to",type:"string"},link_name:{description:"optional link name (used in parameter sets when there are multiple input sources)",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["node_id_ref"],additionalProperties:!1},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{anyOf:[{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/pipeline_overview_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/pipeline_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/port_info_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/node_info_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/runtime_info_def"}]}},additionalProperties:!0},runtime_def:{description:"Runtime associated with the operations in the current pipeline",type:"object",properties:{id:{description:"Unique internal runtime identifier",type:"string"},name:{description:"The runtime name",type:"string"},version:{description:"The runtime version. When not present the latest version is assumed",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","name"]}}},Gt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow UI Schema. Defines UI-only constructs for pipeline flow documents.",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#",properties:{},additionalProperties:!0,definitions:{pipeline_overview_def:{description:"Top level UI information",type:"object",properties:{name:{description:"User-defined name",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"}},additionalProperties:!0},pipeline_def:{description:"Pipeline level UI information",type:"object",properties:{zoom:{description:"Zoom factor",type:"integer"},comments:{description:"Array of Comments, optionally associated with nodes",type:"array",minItems:0,items:{$ref:"#/definitions/comment_def"},uniqueItems:!0}},additionalProperties:!0},port_info_def:{description:"Additional UI info for ports",type:"object",properties:{cardinality:{description:"Property to capture how many data assets are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of data assets. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1},class_name:{description:"CSS class name",type:"string"},label:{description:"Port name",type:"string"}},additionalProperties:!0},node_info_def:{description:"object with app-specific UI-information",type:"object",properties:{label:{description:"User-defined label",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},image:{description:"Image name (do not embed images inline!)",type:"string"},x_pos:{description:"x-position",type:"integer"},y_pos:{description:"y-position",type:"integer"},is_expanded:{description:"Indicates whether a supernode is shown in expanded state or as a regular node.",type:"boolean"},expanded_height:{description:"Height of expanded supernode. If not provided an appropriate height is calculated.",type:"string"},expanded_width:{description:"Width of expanded supernode. If not provided an appropriate width is calculated.",type:"string"},attributes:{description:"additional attributes",type:"string"},associations:{description:"Array of non-data node linkage",type:"array",minItems:0,items:{$ref:"#/definitions/association_def"}},messages:{descriptions:"An array of messages for the node",type:"array",minItems:0,items:{$ref:"#/definitions/message_def"},uniqueItems:!0},ui_parameters:{description:"UI only parameter values for the node",type:"object",properties:{},additionalProperties:!0},decorations:{description:"Array of decorations used to decorate nodes",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},runtime_info_def:{description:"Runtime information",type:"object",properties:{},required:[],additionalProperties:!0},association_def:{description:"Non-data link",type:"object",properties:{id:{description:"Association identifier",type:"string"},node_ref:{description:"Target node id",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["id","node_ref"],additionalProperties:!1},decoration_def:{description:"Decoration used to decorate a node",type:"object",properties:{id:{description:"An identifier used to identify the decoration",type:"string"},hotspot:{description:"Indicates whether the decorator is a hotspot or not. ie does it send an event to consuming app. when clicked",type:"boolean"},class_name:{description:"CSS class name for decoration styling",type:"string"},position:{description:"Shows where the decoration is displayed with respect to the node",enum:["topLeft","topRight","bottomLeft","bottomRight"]},x_pos:{description:"X position of the decorator relative to the node's top left corner. If provided, this is used in preference to the position field.",type:"integer"},y_pos:{description:"Y position of the decorator relative to the node's top left corner. If provided, this is used in preference to the position field.",type:"integer"},image:{description:"Image displayed at the decoration position. Provide either this or a label.",type:"string"},label:{description:"Label displayed at the decoration position. Provide either this or an image.",type:"string"}}},message_def:{description:"Node message definition",type:"object",properties:{id_ref:{description:"Name of the parameter that has the message",type:"string"},validation_id:{description:"Validation identifier from the fail_message validation section.",type:"string"},type:{description:"Type of message",enum:["info","error","warning"]},text:{description:"Message string",type:"string"}},required:["id_ref","type","text"]},comment_def:{type:"object",properties:{id:{description:"Comment identifier. Must be unique.",type:"string"},x_pos:{description:"Horizontal comment position",type:"integer",minimum:0},y_pos:{description:"Vertical comment position",type:"integer",minimum:0},width:{description:"Comment width",type:"integer",minimum:10},height:{description:"Comment height",type:"integer",minimum:10},class_name:{description:"CSS class(es) to apply to the comment",type:"string"},attributes:{description:"Optional attributes to be added to this element. For example: \"attributes\": \"attr1='value1'; attr2='value2'\"",type:"string"},content:{description:"Comment content",type:"string"},associated_id_refs:{description:"Optional array of associated node id references",type:"array",minItems:0,items:{$ref:"#/definitions/comment_link_def"},uniqueItems:!0}},required:["id","x_pos","y_pos","width","height"],additionalProperties:!0},comment_link_def:{description:"Comment link definition",type:"object",properties:{node_ref:{description:"Node reference",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["node_ref"],additionalProperties:!0}}},qt={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json",title:"Watson Data Platform Pipeline Connection Schema",description:"Connection schema for pipelines in the Watson Data Platform",definitions:{common_pipeline_connection_def:{description:"Details of the connection to use for a pipeline binding node.",properties:{name:{description:"A name tag for disambiguating connections",type:"string"},app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a connection by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the connection. If neither this attribute nor project_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the connection. If neither this attribute nor catalog_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"The properties for the connection. The specific properties allowed depend on the type of connection referenced.",additionalProperties:{type:"object"},type:"object"}},required:["ref"],type:"object"},common_pipeline_data_asset_def:{description:"Details of the data asset contained in a catalog or project to use for a pipeline binding node.",properties:{app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a data asset by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the data asset. If neither this attribute nor project_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the data asset. If neither this attribute nor catalog_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"Properties controlling how the data asset is used.",type:"object",additionalProperties:{type:"object"},properties:{attachment_ref:{description:"The ID of the data asset attachment to use. If not specified and used as a source, the first suitable attachment found will be used. If not specified and used as a target, a new attachment will be created.",type:"string"},name:{description:"Specifies the name of the data asset to read, create or update if ref is unset.",type:"string",default:!1},no_write_schema:{description:"When used as a target, whether to update the data asset with the schema when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1},no_write_status:{description:"When used as a target, whether to update the data asset with the status when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1}}}},type:"object"}}},Vt={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v2-schema.json",title:"Watson Data Platform Datarecord Metadata Schema",description:"Metadata schema for datarecords in the Watson Data Platform",definitions:{record_schema:{description:"Description of a datarecord including column types and metadata",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"Name of datarecord",type:"string"},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v2-schema.json"],type:"string"},type:{description:"Always 'struct' for datarecord schema",type:"string"},fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0},struct_types:{description:"The list of custom struct types to be used as field types",type:"object",patternProperties:{".":{type:"object",properties:{fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0}}}}}},required:["id","fields"]},field:{description:"Definition of a datarecord field",type:"object",properties:{name:{description:"Field name. Must be unique within the datarecord",type:"string"},type:{description:"Field type. Can be a primitive type (string, integer, double, date, time, timestamp, binary, boolean, array[type], map[type, type]. The type can also be a reference to a struct_type declaration.)",type:"string"},nullable:{description:"Whether or not one can place null values into the field",type:"boolean",default:!1},metadata:{$ref:"#/definitions/metadata"}},required:["name","type"]},metadata:{description:"Additional field metadata",type:"object",properties:{description:{description:"Field description",type:"string"},measure:{description:"Field measurement level",enum:["range","discrete","flag","set","ordered-set","typeless","collection","geospatial","default"]},modeling_role:{description:"Field role for modeling",enum:["input","target","both","none","partition","split","frequency","record-id"]},max_length:{description:"Maximum length for fields. Length is unlimited when not present",type:"number"},decimal_precision:{description:"Precision for decimal types",type:"number"},decimal_scale:{description:"Scale for decimal types",type:"number"},values:{description:"Array of unique categorical values for the column",type:"array",minItems:0,items:{description:"A value discovered in the data",type:"string"},uniqueItems:!0},range:{description:"Minimum and maximum discovered values for scalar data",type:"object",properties:{min:{description:"Lowest value discovered in the data",type:"number"},max:{description:"Highest value discovered in the data",type:"number"}},required:["min","max"]},runtime_type:{description:"Type of runtime",type:"string"}},required:[]}}},zt={$schema:"http://json-schema.org/draft-04/schema#",type:"object",description:"Common Canvas palette schema",id:"http://api.dataplatform.ibm.com/schemas/common-canvas/palette/palette-v2-schema.json",version:{description:"Palette schema version",enum:["2.0"]},properties:{categories:{description:"Array of palette categories",type:"array",minItems:0,items:{type:"object",properties:{category:{description:"The palette category that the items belong within",type:"string"},label:{description:"Category label",type:"string"},image:{description:"Encoded image or image reference for the category",type:"string"},nodetypes:{description:"Array of nodes within the current category",type:"array",items:{type:"object",properties:{label:{description:"Node label",type:"string"},description:{description:"Node description",type:"string"},type:{description:"Node classification type",enum:["binding","execution_node","super_node","model_node"]},operator_id_ref:{description:"Unique node type identifier",type:"string"},image:{description:"Encoded image or image reference for the node",type:"string"},subDiagramId:{description:"Optional sub diagram identifier.",type:"string"},input_ports:{description:"Array of node input ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}},output_ports:{description:"Array of node output ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}}},required:["label","image"]}}},required:["category","label"]}}},definitions:{port:{description:"Defines a node port for links",type:"object",properties:{id:{description:"Port identifier",type:"string"},label:{description:"Port long label",type:"string"},cardinality:{description:"Property to capture how many connections are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of connections. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1}},required:["id"]}}},$t={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow Schema",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",properties:{doc_type:{description:"Document type",type:"string"},version:{description:"Pipeline-flow schema version",enum:["3.0"]},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["http://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json","https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json"]},open_with_tool:{description:"Preferred authoring application",type:"string"},id:{description:"Document identifier, GUID recommended",type:"string"},parameters:{description:"Parameters for the flow document",type:"object",properties:{},additionalProperties:!0},primary_pipeline:{description:"Reference to the primary (main) pipeline flow within the document",type:"string"},pipelines:{description:"Array of pipelines",type:"array",minItems:1,items:{$ref:"#/definitions/pipeline_def"},uniqueItems:!0},schemas:{description:"Array of data record schemas used in the document",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v3-schema.json#/definitions/record_schema"},uniqueItems:!0},runtimes:{description:"Array of runtime objects referred to in the document",type:"array",minItems:0,items:{$ref:"#/definitions/runtime_def"},uniqueItems:!0},external_paramsets:{description:"Array of parameter set references",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/parameters/parametersets-v3-schema.json#/definitions/paramset_ref"},uniqueItems:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/pipeline_overview_def"}},additionalProperties:!0}},required:["doc_type","version","primary_pipeline","pipelines"],additionalProperties:!1,definitions:{pipeline_def:{description:"Definition of a single pipeline flow",type:"object",properties:{id:{description:"Unique identifier",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/pipeline_def instead.",type:"string",deprecated:!0},name:{description:"User-readable name",type:"string"},runtime_ref:{description:"Reference to the id of the runtime associated with the operations in the current pipeline",type:"string"},nodes:{description:"Array of pipeline nodes",type:"array",minItems:0,items:{$ref:"#/definitions/node_type_def"},uniqueItems:!0},parameters:{description:"Parameters for the pipeline",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/pipeline_def"}},additionalProperties:!0}},required:["id","runtime_ref","nodes"],additionalProperties:!1},node_type_def:{oneOf:[{$ref:"#/definitions/execution_node_def"},{$ref:"#/definitions/supernode_def"},{$ref:"#/definitions/binding_entry_node_def"},{$ref:"#/definitions/binding_exit_node_def"},{$ref:"#/definitions/model_node_def"}]},execution_node_def:{description:"Definition of a single execution pipeline node",type:"object",properties:{id:{description:"Unique identifier for node within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'execution_node' for non-model pipeline elements",enum:["execution_node"]},op:{description:"Operator type identifier",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Optional reference to the id of the runtime associated with the current node",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0}},required:["id","type","op"],additionalProperties:!1},supernode_def:{description:"Definition of a supernode which serves as the entry point for a sub-pipeline",type:"object",properties:{id:{description:"Unique identifier for the supernode within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'super_node' for supernode elements",enum:["super_node"]},open_with_tool:{description:"Name of the tool which can be used to view or edit the sub-flow for this supernode. The default is 'canvas'",type:"string"},subflow_ref:{description:"Refers to the sub-flow associated with this supernode",type:"object",properties:{url:{description:"Reference to an external sub-flow. When not present the sub-flow is assumed to be in the current document. A value of 'app_defined' indicates a sub-flow identifier is present, but the controlling application will serve up the sub-pipeline in the form of a new pipeline-flow document (no sub-flow is present in the document).",type:"string"},pipeline_id_ref:{description:"Sub-flow identifier reference",type:"string"}},required:["pipeline_id_ref"]},inputs:{$ref:"#/definitions/bound_ports_def"},outputs:{$ref:"#/definitions/bound_ports_def"},parameters:{description:"Input parameters for the supernode",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0}},required:["id","type","subflow_ref"],additionalProperties:!1},binding_entry_node_def:{description:"Defines an entry point (source) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},outputs:{$ref:"#/definitions/ports_def"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the binding entry node",type:"object",properties:{},additionalProperties:!0}},required:["id","type","outputs"],additionalProperties:!1},binding_exit_node_def:{description:"Defines an exit point (sink) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},inputs:{$ref:"#/definitions/ports_def"},outputs:{description:"An optional set of output ports, typically used for directing error information out of the binding node.",$ref:"#/definitions/ports_def"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the binding exit node",type:"object",properties:{},additionalProperties:!0}},required:["id","type","inputs"],additionalProperties:!1},model_node_def:{description:"Definition of a single predictive model node",type:"object",properties:{id:{description:"Unique identifier for the model within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'model_node' for model pipeline elements",enum:["model_node"]},model_ref:{description:"Reference to the binary model",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},op:{description:"Node type identifier of modeling node that created this model.",type:"string"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Reference to the runtime associated with the current node",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0}},required:["id","type","inputs"],additionalProperties:!1},port_def:{description:"Port definition (input/output) on a node",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema reference associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:0,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},parameters:{description:"Parameters for the port",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/port_info_def"}},additionalProperties:!0}},required:["id"],additionalProperties:!1},ports_def:{type:"array",minItems:0,items:{$ref:"#/definitions/port_def"},uniqueItems:!0},bound_ports_def:{type:"array",minItems:0,items:{$ref:"#/definitions/bound_port_def"},uniqueItems:!0},bound_port_def:{description:"Port definition (input/output) on a node with optional pipeline port binding for supernodes",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:1,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},subflow_node_ref:{description:"Optional node id binding within the current document.",type:"string"},parameters:{description:"Parameters for the binding port",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/port_info_def"}},additionalProperties:!0}},required:["id"],additionalProperties:!1},link_def:{description:"Node link definition",type:"object",properties:{id:{description:"Unique id of this link within the pipelineFlow. If omitted a new link id will be generated.",type:"string"},node_id_ref:{description:"id of a node this link connects to",type:"string"},port_id_ref:{description:"optional port id of a node this link connects to",type:"string"},link_name:{description:"optional link name (used in parameter sets when there are multiple input sources)",type:"string"},type_attr:{description:"Link type attribute",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_link_info_def instead.",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_link_info_def"}},additionalProperties:!0}},required:["node_id_ref"],additionalProperties:!1},runtime_def:{description:"Runtime associated with the operations in the current pipeline",type:"object",properties:{id:{description:"Unique internal runtime identifier",type:"string"},name:{description:"The runtime name",type:"string"},version:{description:"The runtime version. When not present the latest version is assumed",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/runtime_info_def"}},additionalProperties:!0}},required:["id","name"]}}},Wt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow UI Schema. Defines UI-only constructs for pipeline flow documents.",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json",properties:{},additionalProperties:!0,definitions:{pipeline_overview_def:{description:"Top level UI information",type:"object",properties:{name:{description:"User-defined name",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"}},additionalProperties:!0},pipeline_def:{description:"Pipeline level UI information",type:"object",properties:{description:{description:"User-defined description",type:"string"},zoom:{oneOf:[{description:"Deprecated - use zoom object instead. Scale factor as a percentage. 100% is standard scale amount. Smaller values zoom out. Larger values zoom in.",type:"integer",deprecated:!0},{description:"A zoom object containing translation and scale amounts.",type:"object",properties:{x:{description:"Horizontal translation amount. Positive value moves right, negative to the left.",type:"number"},y:{description:"Vertical translation amount. Positive value moves down, negative moves up.",type:"number"},k:{description:"Scale amount. 1.0 is the standard scale amount. Smaller values zoom out. Larger values zoom in.",type:"number"}},required:["x","y","k"],additionalProperties:!1}]},comments:{description:"Array of Comments, optionally associated with nodes",type:"array",minItems:0,items:{$ref:"#/definitions/comment_def"},uniqueItems:!0}},additionalProperties:!0},port_info_def:{description:"Additional UI info for ports",type:"object",properties:{cardinality:{description:"Property to capture how many data assets are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of data assets. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1},class_name:{description:"CSS class name",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the port.",type:["string","object"]},label:{description:"Port name",type:"string"}},additionalProperties:!0},node_info_def:{description:"object with app-specific UI-information",type:"object",properties:{label:{description:"User-defined label",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the node.",type:["string","object"]},image:{description:"Image name (do not embed images inline!)",type:"string"},x_pos:{description:"x-position",type:"number"},y_pos:{description:"y-position",type:"number"},is_expanded:{description:"Indicates whether a supernode is shown in expanded state or as a regular node.",type:"boolean"},expanded_height:{description:"Height of expanded supernode. If not provided an appropriate height is calculated.",type:"number"},expanded_width:{description:"Width of expanded supernode. If not provided an appropriate width is calculated.",type:"number"},is_resized:{description:"Indicates whether a node has been resized or not. If true, resize_width and resize_height are used for node display. If false, the default width and height are used.",type:"boolean"},resize_height:{description:"Height of resized node. The node will be displayed with this height, when is_resized is true, in preference to its default height.",type:"number"},resize_width:{description:"Width of resized node. The node will be displayed with this width, when is_resized is true, in preference to its default width.",type:"number"},sub_pipelines:{description:"An array of pipelines referenced when this node is a supernode. This field is only used when the supernode is in a palette or on the clipboard. It will be an empty array when the supernode references an external pipeline.",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json#/definitions/pipeline_def"},uniqueItems:!0},attributes:{description:"additional attributes",type:"string"},associations:{description:"Array of non-data node linkage",type:"array",minItems:0,items:{$ref:"#/definitions/association_def"}},messages:{description:"An array of messages for the node",type:"array",minItems:0,items:{$ref:"#/definitions/message_def"},uniqueItems:!0},ui_parameters:{description:"UI only parameter values for the node",type:"object",properties:{},additionalProperties:!0},decorations:{description:"Array of decorations used to decorate nodes",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},node_link_info_def:{description:"object with app-specific UI-information",type:"object",properties:{description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the node to node link.",type:["string","object"]},decorations:{description:"Array of decorations used to decorate node links",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},runtime_info_def:{description:"Runtime information",type:"object",properties:{},additionalProperties:!0},association_def:{description:"Non-data link",type:"object",properties:{id:{description:"Association identifier",type:"string"},node_ref:{description:"Target node id",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the association link.",type:["string","object"]},decorations:{description:"Array of decorations used to decorate association links",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},required:["id","node_ref"],additionalProperties:!1},decoration_def:{description:"Decoration used to decorate a node",type:"object",properties:{id:{description:"An identifier used to identify the decoration",type:"string"},hotspot:{description:"Indicates whether the decorator is a hotspot or not. ie does it send an event to consuming app. when clicked",type:"boolean"},class_name:{description:"CSS class name for decoration styling",type:"string"},position:{description:"Indicates an anchor point on the node or link from which the decoration will be displayed. If x_pos and y_pos are not provided the decoration is displayed with a default offset from this position.",enum:["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight","source","middle","target"]},x_pos:{description:"X position of the decorator relative to the node's position field. If position is not provided it is relative to the 'topLeft' position",type:"integer"},y_pos:{description:"Y position of the decorator relative to the node's position field. If position is not provided it is relative to the 'topLeft' position",type:"integer"},image:{description:"Image displayed at the decoration position. Provide either this or a label.",type:"string"},label:{description:"Label displayed at the decoration position. Provide either this or an image.",type:"string"}}},message_def:{description:"Node message definition",type:"object",properties:{id_ref:{description:"Name of the parameter that has the message",type:"string"},validation_id:{description:"Validation identifier from the fail_message validation section.",type:"string"},type:{description:"Type of message",enum:["info","error","warning"]},text:{description:"Message string",type:"string"}},required:["id_ref","type","text"]},comment_def:{type:"object",properties:{id:{description:"Comment identifier. Must be unique.",type:"string"},x_pos:{description:"Horizontal comment position",type:"number"},y_pos:{description:"Vertical comment position",type:"number"},width:{description:"Comment width",type:"number",minimum:10},height:{description:"Comment height",type:"number",minimum:10},class_name:{description:"CSS class(es) to apply to the comment",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the comment.",type:["string","object"]},attributes:{description:"Optional attributes to be added to this element. For example: \"attributes\": \"attr1='value1'; attr2='value2'\"",type:"string"},content:{description:"Comment content",type:"string"},associated_id_refs:{description:"Optional array of associated node id references",type:"array",minItems:0,items:{$ref:"#/definitions/comment_link_def"},uniqueItems:!0}},required:["id","x_pos","y_pos","width","height"],additionalProperties:!0},comment_link_def:{description:"Comment link definition",type:"object",properties:{node_ref:{description:"Node reference",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the comment link.",type:["string","object"]}},required:["node_ref"],additionalProperties:!0}}},Kt={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json",title:"Watson Data Platform Pipeline Connection Schema",description:"Connection schema for pipelines in the Watson Data Platform",definitions:{common_pipeline_connection_def:{description:"Details of the connection to use for a pipeline binding node.",properties:{name:{description:"A name tag for disambiguating connections",type:"string"},app_data:{$ref:"#/definitions/app_data_def"},ref:{description:"A reference to a connection by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the connection. If neither this attribute nor project_ref are specified, the connection will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the connection. If neither this attribute nor catalog_ref are specified, the connection will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},space_ref:{description:"If ref is set, this refers to the ID of the space which contains the connection. If neither this attribute nor space_ref are specified, the connection will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},properties:{description:"The properties for the connection. The specific properties allowed depend on the type of connection referenced.",type:"object"}},required:["ref"],type:"object"},common_pipeline_data_asset_def:{description:"Details of the data asset contained in a catalog or project to use for a pipeline binding node.",properties:{app_data:{$ref:"#/definitions/app_data_def"},ref:{description:"A reference to a data asset by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the data asset. If neither this attribute nor project_ref are specified, the data asset will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the data asset. If neither this attribute nor catalog_ref are specified, the data asset will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},space_ref:{description:"If ref is set, this refers to the ID of the space which contains the data asset. If neither this attribute nor space_ref are specified, the data asset will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},properties:{description:"Properties controlling how the data asset is used.",type:"object",additionalProperties:{type:"object"},properties:{attachment_ref:{description:"The ID of the data asset attachment to use. If not specified and used as a source, the first suitable attachment found will be used. If not specified and used as a target, a new attachment will be created.",type:"string"},name:{description:"Specifies the name of the data asset to read, create or update if ref is unset.",type:"string",default:!1},no_write_schema:{description:"When used as a target, whether to update the data asset with the schema when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1},no_write_status:{description:"When used as a target, whether to update the data asset with the status when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1}}}},type:"object"},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{},additionalProperties:!0}}},Yt={$schema:"https://json-schema.org/draft-04/schema#",type:"object",description:"Common Canvas palette schema",id:"https://api.dataplatform.ibm.com/schemas/common-canvas/palette/palette-v3-schema.json",properties:{version:{description:"Palette schema version",enum:["3.0"]},categories:{description:"Array of palette categories",type:"array",minItems:0,items:{$ref:"#/definitions/category_def"},uniqueItems:!0}},additionalProperties:!1,definitions:{category_def:{description:"Palette Category",type:"object",properties:{id:{description:"ID of the category",type:"string"},label:{description:"Category label",type:"string"},description:{description:"Category description",type:"string"},is_open:{description:"Boolean to indicate if the category is open (true) or not (false).",type:"boolean"},empty_text:{description:"When set to a non-empty string and node_types is empty, is used to indicate that no nodes exist",type:"string"},loading_text:{description:"When set to a non-empty string, causes a loading indicator to appear with this text as a label",type:"string"},image:{description:"Encoded image or image reference for the category",type:"string"},node_types:{description:"Array of pipeline node types",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json#/definitions/node_type_def"},uniqueItems:!0}},required:["id","label"],additionalProperties:!1}}},Xt=new a.Logger("SchemaValidator");function Jt(e,t){switch(t){case 1:var n=function(){var e=new c.Validator,t="http://api.dataplatform.ibm.com/schemas/common-pipeline/";return e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/pipeline_overview_def"),e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/pipeline_def"),e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/port_info_def"),e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/node_info_def"),e.addSchema(Ut,t+"pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_connection_def"),e.addSchema(Ut,t+"pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_data_asset_def"),e.addSchema(Ft,t+"datarecord-metadata/datarecord-metadata-v1-schema.json#/definitions/record_schema"),e}();Qt(e,Mt,"pipelineFlow",n);break;case 2:var i=function(){var e=new c.Validator,t="http://api.dataplatform.ibm.com/schemas/common-pipeline/";return e.addSchema(Ht,t+"pipeline-flow/pipeline-flow-v2-schema.json"),e.addSchema(Gt,t+"pipeline-flow/pipeline-flow-ui-v2-schema.json"),e.addSchema(qt,t+"pipeline-connection/pipeline-connection-v2-schema.json"),e.addSchema(Vt,t+"datarecord-metadata/datarecord-metadata-v2-schema.json"),e}();Qt(e,Ht,"pipelineFlow",i);break;default:var o=en();Qt(e,$t,"pipelineFlow",o)}}function Zt(e,t){switch(t){case 1:Qt(e,Bt,"palette",new c.Validator);break;case 2:Qt(e,zt,"palette",new c.Validator);break;default:var n=en();Qt(e,Yt,"palette",n)}}function Qt(e,t,n,i){Xt.logStartTimer("Schema validation");var o=i.validate(e,t,{nestedErrors:!0});if(Xt.logEndTimer("Schema validation"),Xt.log("Schema "+n+" - validation result:"),Xt.log(o),o&&o.errors&&o.errors.length>0)throw Xt.error(o),o}function en(){var e=new c.Validator,t="http://api.dataplatform.ibm.com/schemas/common-pipeline/";return e.addSchema($t,t+"pipeline-flow/pipeline-flow-v3-schema.json"),e.addSchema(Wt,t+"pipeline-flow/pipeline-flow-ui-v3-schema.json"),e.addSchema(Kt,t+"pipeline-connection/pipeline-connection-v3-schema.json"),e.addSchema(i.dataRecordMetadataV3Schema,t+"datarecord-metadata/datarecord-metadata-v3-schema.json"),e}function tn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var on=[function(e){return e},function(e){var t=Object.assign({},{version:"2.0"},e);return t},function(e){e.version="3.0";var t,n=tn(e.categories);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.id=i.category,delete i.category,i.node_types=[];for(var o=0;o<i.nodetypes.length;o++){var r=i.nodetypes[o],a={id:""};a.type=r.type,"execution_node"===r.type||"binding"===r.type?a.op=r.operator_id_ref:"super_node"===r.type&&(r.open_with_tool&&(a.open_with_tool=r.open_with_tool),a.subflow_ref={pipeline_id_ref:r.subDiagramId}),r.input_ports&&r.input_ports.length>0&&(a.inputs=an(r.input_ports)),r.output_ports&&r.output_ports.length>0&&(a.outputs=an(r.output_ports)),a.parameters={},a.app_data={},a.app_data.ui_data={},a.app_data.ui_data.label=r.label,a.app_data.ui_data.description=r.description,a.app_data.ui_data.image=r.image,a.app_data.ui_data.x_pos=0,a.app_data.ui_data.y_pos=0,i.node_types.push(a)}delete i.nodetypes}}catch(e){n.e(e)}finally{n.f()}return e}];function rn(e){var t;if(!e)throw new Error("Invalid palette document");if(e.version){if("string"!=typeof e.version||0===e.version.length)throw new Error("Invalid palette document: The 'version' attribute is missing or invalid");if(!(t=parseInt(e.version,10)))throw new Error("Invalid palette document: The 'version' attribute cannot be parsed")}else t=1;return t}function an(e){var t,n=[],i=tn(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,r={};r.id=o.id,r.app_data={},r.app_data.ui_data={},o.cardinality&&(r.app_data.ui_data.cardinality=o.cardinality),r.app_data.ui_data.label=o.label,n.push(r)}}catch(e){i.e(e)}finally{i.f()}return n}function sn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return dn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var cn=function(){function n(){e._classCallCheck(this,n),this.logger=new a.Logger("Object Model");var t=this.getEmptyCanvasInfo();this.store=new Dt(t),this.oldCanvas=null,this.idGeneratorHandler=null,this.selectionChangeHandler=null,this.layoutHandler=null}return e._createClass(n,[{key:"dispatch",value:function(e){this.store.dispatch(e)}},{key:"subscribe",value:function(e){return this.store.subscribe(e)}},{key:"setSchemaValidation",value:function(e){this.setCanvasConfig({schemaValidation:e})}},{key:"setSelectionChangeHandler",value:function(e){this.selectionChangeHandler=e}},{key:"setLayoutHandler",value:function(e){if(e!==this.layoutHandler){this.layoutHandler=e;var t=this.prepareNodes(this.getCanvasInfo().pipelines,this.getNodeLayout(),this.getCanvasLayout());this.store.dispatch({type:"REPLACE_PIPELINES",data:{pipelines:t}})}}},{key:"getStore",value:function(){return this.store.getStore()}},{key:"getUUID",value:function(){return s.v4()}},{key:"setIdGeneratorHandler",value:function(e){this.idGeneratorHandler=e}},{key:"getUniqueId",value:function(e,t){var n;return this.idGeneratorHandler&&(n=this.idGeneratorHandler(e,t)),n||this.getUUID()}},{key:"clearPaletteData",value:function(){this.store.dispatch({type:"CLEAR_PALETTE_DATA"})}},{key:"setPaletteData",value:function(e){var t=Qe.convertPaletteToPipelineFlowPalette(e);this.setPipelineFlowPalette(t)}},{key:"setPipelineFlowPalette",value:function(e){if(e&&!t.isEmpty_1(e)){var n=e;Qe.isVersion0Palette(n)&&(n=Qe.convertPaletteToPipelineFlowPalette(n));var i=this.validateAndUpgradePalette(n);this.store.dispatch({type:"SET_PALETTE_DATA",data:{content:i}})}else this.clearPaletteData()}},{key:"getPaletteData",value:function(){return this.store.getPaletteData()}},{key:"togglePalette",value:function(){this.isPaletteOpen()?this.closePalette():this.openPalette()}},{key:"openPalette",value:function(){this.store.dispatch({type:"SET_PALETTE_OPEN_STATE",data:{isOpen:!0}})}},{key:"openPaletteIfNecessary",value:function(e){e&&void 0===this.store.getPalette().isOpen&&void 0!==e.paletteInitialState&&(e.paletteInitialState?this.openPalette():this.closePalette())}},{key:"closePalette",value:function(){this.store.dispatch({type:"SET_PALETTE_OPEN_STATE",data:{isOpen:!1}})}},{key:"isPaletteOpen",value:function(){var e=this.store.getPalette().isOpen;return void 0!==e&&e}},{key:"setCategoryLoadingText",value:function(e,t){this.store.dispatch({type:"SET_CATEGORY_LOADING_TEXT",data:{categoryId:e,loadingText:t}})}},{key:"setCategoryEmptyText",value:function(e,t){this.store.dispatch({type:"SET_CATEGORY_EMPTY_TEXT",data:{categoryId:e,emptyText:t}})}},{key:"addNodeTypeToPalette",value:function(e,t,n,i,o){this.addNodeTypesToPalette([e],t,n,i,o)}},{key:"addNodeTypesToPalette",value:function(e,t,n,i,o){var r={nodeTypes:e,categoryId:t,categoryLabel:n,categoryDescription:i,categoryImage:o};this.store.dispatch({type:"ADD_NODE_TYPES_TO_PALETTE",data:r}),this.store.getCanvasConfig().schemaValidation&&Zt(this.getPaletteData(),3)}},{key:"removeNodesFromPalette",value:function(e,t){this.store.dispatch({type:"REMOVE_NODE_TYPES_FROM_PALETTE",data:{selObjectIds:e,categoryId:t}})}},{key:"convertNodeTemplate",value:function(e){var t=null;return e?((t=tt.convertNode(e,this.getCanvasLayout())).type===o.SUPER_NODE&&(t=this.convertPipelineData(t)),t):null}},{key:"convertPipelineData",value:function(e){var n,o=t.get_1(e,"sub_pipelines");if(o)n=e.subflow_ref.url?[]:tt.convertPipelinesToCanvasInfoPipelines(o,this.getCanvasLayout()),n=this.cloneSupernodeContents(e,n),n=this.prepareNodes(n,this.getNodeLayout(),this.getCanvasLayout(),e);else{var r=this.createEmptyPipeline();n=[r],i.set_1(e,"subflow_ref.pipeline_id_ref",r.id)}return e.sub_pipelines=n,e}},{key:"extractAddDataPipelines",value:function(e){var n=[],o=[];return e.forEach((function(e){if(h.isSupernode(e)){var r=t.get_1(e,"sub_pipelines");r&&(n.push.apply(n,i._toConsumableArray(r)),e.sub_pipelines&&delete e.sub_pipelines)}o.push(e)})),{nodes:o,pipelines:n}}},{key:"getPaletteNode",value:function(e){var n=null;return e&&!t.isEmpty_1(this.getPaletteData())&&this.getPaletteData().categories.forEach((function(t){t.node_types.forEach((function(t){t.op===e&&(n=t)}))})),n}},{key:"getPaletteNodeById",value:function(e){var n=null;return t.isEmpty_1(this.getPaletteData())||this.getPaletteData().categories.forEach((function(t){t.node_types.forEach((function(t){t.id===e&&(n=t)}))})),n}},{key:"getCategoryForNode",value:function(e){var t=null;return this.getPaletteData().categories.forEach((function(n){n.node_types.forEach((function(i){i.op===e&&(t=n)}))})),t}},{key:"validateAndUpgradePalette",value:function(e){var t=o.cloneDeep_1(e),n=rn(t);return this.store.getCanvasConfig().schemaValidation&&Zt(t,n),3!==n&&(t=function(e){for(var t=Math.max(rn(e),1),n=o.cloneDeep_1(e),i=t;i<3;i++)n=on[i](n);return n}(t),this.store.getCanvasConfig().schemaValidation&&Zt(t,3)),t}},{key:"setIsOpenCategory",value:function(e,t){this.store.dispatch({type:"SET_IS_OPEN_CATEGORY",data:{categoryId:e,isOpen:t}})}},{key:"setIsOpenAllCategories",value:function(e){this.store.dispatch({type:"SET_IS_OPEN_ALL_CATEGORIES",data:{isOpen:e}})}},{key:"isPaletteCategoryOpen",value:function(e){var t=this.store.getPaletteCategory(e);return t?t.is_open:null}},{key:"getAPIPipeline",value:function(e){return new dt(e||this.getCurrentBreadcrumb().pipelineId,this)}},{key:"getSelectionAPIPipeline",value:function(){var e=this.getSelectedPipelineId();return e?this.getAPIPipeline(e):null}},{key:"clearPipelineFlow",value:function(){this.setCanvasInfo(this.getEmptyCanvasInfo())}},{key:"setCanvas",value:function(e){this.oldCanvas=e;var t=Qe.convertCanvasToCanvasInfo(e);this.setCanvasInfo(t)}},{key:"getCanvas",value:function(){return this.oldCanvas?et.getCanvasBasedOnCanvasInfo(this.oldCanvas,this.getCanvasInfo()):{}}},{key:"getEmptyCanvasInfo",value:function(){var e=this.getUUID(),t=this.getUUID();return{doc_type:"pipeline",version:"3.0",json_schema:"http://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",id:e,primary_pipeline:t,pipelines:[{id:t,runtime_ref:"",nodes:[],comments:[],links:[]}],schemas:[]}}},{key:"setPipelineFlow",value:function(e){if(e.objectData)this.setCanvas(e);else{var t=this.preparePipelineFlow(e);this.executeWithSelectionChange(this.store.dispatch,{type:"SET_CANVAS_INFO",canvasInfo:t,canvasInfoIdChanged:this.hasCanvasInfoIdChanged(t)})}}},{key:"ensurePipelineIsLoaded",value:function(e){var t=this.getSupernodePipelineUrl(e.targetObject),n=this.getSupernodePipelineId(e.targetObject);if(!this.isPipelineLoaded(n,t)){if(!e.externalPipelineFlow){var i="The external pipeline flow at '"+e.externalUrl+"' was not provided. Make sure you have implemented beforeEditActionHandler to support external pipeline flows.";throw this.logger.error(i),i}if(!this.flowContainsPipeline(e.externalPipelineFlow,n)){var o="The external pipeline flow '"+e.externalPipelineFlow.id+"' does not contain a pipeline with ID: "+n;throw this.logger.error(o),o}return this.addExternalPipelineFlow(e.externalPipelineFlow,t,e.targetObject,!0),!0}return!1}},{key:"getVisibleExpandedExternalSupernodes",value:function(){var e=this.getCurrentPipeline();return this.getVisibleExpandedExternalSupernodesForPipeline(e,this.getPipelines())}},{key:"getVisibleExpandedExternalSupernodesForPipeline",value:function(e,t){var n=this,i=[];return e.nodes.forEach((function(e){if(e.type===o.SUPER_NODE&&e.is_expanded){var r=t.find((function(t){return t.id===n.getSupernodePipelineId(e)}));if(e.subflow_ref.url&&!r&&i.push(e),r){var a=n.getVisibleExpandedExternalSupernodesForPipeline(r,t);i=i.concat(a)}}})),i}},{key:"flowContainsPipeline",value:function(e,t){return!!e.pipelines&&e.pipelines.some((function(e){return e.id===t}))}},{key:"addExternalPipelineFlow",value:function(e,t,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.preparePipelineFlow(e,n);o.pipelines.forEach((function(e){return e.parentUrl=t}));var r=Object.assign({},o);r.pipelines=[],r.url=t,this.store.dispatch({type:"ADD_EXTERNAL_PIPELINE_FLOW",newPipelineFlow:r,newPipelines:i?o.pipelines:[]})}},{key:"removeExternalPipelineFlow",value:function(e){this.store.dispatch({type:"REMOVE_EXTERNAL_PIPELINE_FLOW",externalUrl:e})}},{key:"createExternalPipelineFlowTemplate",value:function(e,t){return{doc_type:"pipeline",version:"3.0",json_schema:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",id:e,primary_pipeline:t,pipelines:[{id:"",runtime_ref:"",nodes:[]}],schemas:[],runtimes:[]}}},{key:"getExternalPipelineFlows",value:function(){return this.store.getExternalPipelineFlows()}},{key:"getExternalPipelineFlowsForPipelines",value:function(e){var t=this.getUniqueUrls(e);return this.getExternalPipelineFlowsForUrls(t)}},{key:"getUniqueUrls",value:function(e){var t=[];return e.forEach((function(e){e.parentUrl&&!t.includes(e.parentUrl)&&t.push(e.parentUrl)})),t}},{key:"getExternalPipelineFlowsForUrls",value:function(e){var t=this,n=[];return e.forEach((function(e){var i=t.getExternalPipelineFlow(e);i.url=e,n.push(i)})),n}},{key:"getExternalPipelineFlow",value:function(e){var t=this.store.getExternalPipelineFlow(e);if(t){delete t.url;var n=this.getCanvasInfo();t.pipelines=n.pipelines.filter((function(t){return t.parentUrl===e})),t.pipelines.forEach((function(e){return delete e.parentUrl})),t=nt.createPipelineFlow(t),this.store.getCanvasConfig().schemaValidation&&Jt(t)}return t}},{key:"setParentUrl",value:function(e,t){this.store.dispatch({type:"SET_PIPELINE_PARENT_URL",data:{pipelines:e,url:t}})}},{key:"replaceSupernodeAndPipelines",value:function(e){this.store.dispatch({type:"REPLACE_SN_AND_PIPELINES",data:e})}},{key:"preparePipelineFlow",value:function(e,t){var n=this.validateAndUpgrade(e),i=tt.convertPipelineFlowToCanvasInfo(n,this.getCanvasLayout());return i.pipelines=this.prepareNodes(i.pipelines,this.getNodeLayout(),this.getCanvasLayout(),t),i}},{key:"prepareNodes",value:function(e,t,n,i){var o=this;return this.setSupernodesBindingStatus(e,i).map((function(e){return o.setPipelineObjectAttributes(e,t,n)}))}},{key:"setSupernodesBindingStatus",value:function(e,t){var n=this;return e.forEach((function(e){e.nodes&&e.nodes.forEach((function(e){delete e.isSupernodeInputBinding,delete e.isSupernodeOutputBinding}))})),t&&this.setSupernodesBindingStatusForNode(t,e),e.forEach((function(t){t.nodes&&h.filterSupernodes(t.nodes).forEach((function(t){n.setSupernodesBindingStatusForNode(t,e)}))})),e}},{key:"setSupernodesBindingStatusForNode",value:function(e,t){var n=this,i=this.getSupernodePipelineId(e);i&&(e.inputs&&e.inputs.forEach((function(e){if(e.subflow_node_ref){var o=n.findNode(e.subflow_node_ref,i,t);o&&(o.isSupernodeInputBinding=!0)}})),e.outputs&&e.outputs.forEach((function(e){if(e.subflow_node_ref){var o=n.findNode(e.subflow_node_ref,i,t);o&&(o.isSupernodeOutputBinding=!0)}})))}},{key:"setPipelineObjectAttributes",value:function(e,t,n){var i=this,o=Object.assign({},e);return o.nodes?o.nodes=o.nodes.map((function(e){return i.setNodeAttributesWithLayout(e,t,n)})):o.nodes=[],o.comments?o.comments=o.comments.map((function(e){return i.setCommentAttributesWithLayout(e,n)})):o.comments=[],o}},{key:"setNodeAttributes",value:function(e){return this.setNodeAttributesWithLayout(e,this.getNodeLayout(),this.getCanvasLayout())}},{key:"setCommentAttributes",value:function(e){return this.setCommentAttributesWithLayout(e,this.getCanvasLayout())}},{key:"setNodeAttributesWithLayout",value:function(e,t,n){var i=Object.assign({},e);return i=this.setNodeLayoutAttributes(i,t),i="TopBottom"===n.linkDirection||"BottomTop"===n.linkDirection?this.setNodeDimensionAttributesVertical(i,n):this.setNodeDimensionAttributesLeftRight(i,n),n.snapToGridType!==o.SNAP_TO_GRID_DURING&&n.snapToGridType!==o.SNAP_TO_GRID_AFTER||(i.x_pos=h.snapToGrid(i.x_pos,n.snapToGridXPx),i.y_pos=h.snapToGrid(i.y_pos,n.snapToGridYPx)),i}},{key:"setCommentAttributesWithLayout",value:function(e,t){var n=Object.assign({},e);return t.snapToGridType!==o.SNAP_TO_GRID_DURING&&t.snapToGridType!==o.SNAP_TO_GRID_AFTER||(n.x_pos=h.snapToGrid(n.x_pos,t.snapToGridXPx),n.y_pos=h.snapToGrid(n.y_pos,t.snapToGridYPx)),n}},{key:"setNodeLayoutAttributes",value:function(e,n){if(e.layout=n,this.layoutHandler){var i=this.layoutHandler(e);if(i&&!t.isEmpty_1(i)){var o=h.getCombinedDecorations(e.layout.decorations,i.decorations);e.layout=Object.assign({},e.layout,i,{decorations:o})}}return e}},{key:"setNodeDimensionAttributesLeftRight",value:function(e,t){return e.inputPortsHeight=e.inputs?e.inputs.length*(2*e.layout.portArcRadius)+(e.inputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.outputPortsHeight=e.outputs?e.outputs.length*(2*e.layout.portArcRadius)+(e.outputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.layout.autoSizeNode?e.height=Math.max(e.inputPortsHeight,e.outputPortsHeight,e.layout.defaultNodeHeight):e.height=e.layout.defaultNodeHeight,e.width=e.layout.defaultNodeWidth,e.type===o.SUPER_NODE&&e.is_expanded?(e.height+=t.supernodeTopAreaHeight+t.supernodeSVGAreaPadding,e.expanded_height&&(e.expanded_height=Math.max(e.expanded_height,e.height)),e.width=h.getSupernodeExpandedWidth(e,t),e.height=h.getSupernodeExpandedHeight(e,t)):e.isResized&&(e.height=e.resizeHeight?e.resizeHeight:e.height,e.width=e.resizeWidth?e.resizeWidth:e.width),e}},{key:"setNodeDimensionAttributesVertical",value:function(e,t){return e.inputPortsWidth=e.inputs?e.inputs.length*(2*e.layout.portArcRadius)+(e.inputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.outputPortsWidth=e.outputs?e.outputs.length*(2*e.layout.portArcRadius)+(e.outputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.height=e.layout.defaultNodeHeight,e.layout.autoSizeNode?e.width=Math.max(e.inputPortsWidth,e.outputPortsWidth,e.layout.defaultNodeWidth):e.width=e.layout.defaultNodeWidth,e.type===o.SUPER_NODE&&e.is_expanded?(e.width+=2*t.supernodeSVGAreaPadding,e.expanded_width&&(e.expanded_width=Math.max(e.expanded_width,e.width)),e.width=h.getSupernodeExpandedWidth(e,t),e.height=h.getSupernodeExpandedHeight(e,t)):e.isResized&&(e.height=e.resizeHeight?e.resizeHeight:e.height,e.width=e.resizeWidth?e.resizeWidth:e.width),e}},{key:"validateAndUpgrade",value:function(e){var t=o.cloneDeep_1(e),n=l.extractVersion(t);return this.store.getCanvasConfig().schemaValidation&&Jt(t,n),n!==l.LATEST_VERSION&&(t=l.upgradePipelineFlow(t),this.store.getCanvasConfig().schemaValidation&&Jt(t,l.LATEST_VERSION)),t}},{key:"getCanvasInfoPipeline",value:function(e){var t=this.getCanvasInfo();if(!t)return null;var n=e;n||(n=this.getPrimaryPipelineId());var i=t.pipelines.find((function(e){return e.id===n}));return void 0===i?null:i}},{key:"getDescendantPipelineIds",value:function(e){var t=this,n=[];return this.getAPIPipeline(e).getSupernodes().forEach((function(e){var i=t.getSupernodePipelineId(e);i&&(n.push(i),n=n.concat(t.getDescendantPipelineIds(i)))})),n}},{key:"getDescendantPipelinesForSupernodes",value:function(e){var t=this,n=[];return e.forEach((function(e){n=n.concat(t.getDescendantPipelinesForSupernode(e))})),n}},{key:"getDescendantPipelinesForSupernode",value:function(e){var t=this,n=[],i=this.getSupernodePipelineId(e);if(i){var o=this.getCanvasInfoPipeline(i);o&&(n.push(o),this.getAPIPipeline(i).getSupernodes().forEach((function(e){n=n.concat(t.getDescendantPipelinesForSupernode(e))})))}return n}},{key:"getSchemaPipelinesForSupernode",value:function(e){return this.getDescendantPipelinesForSupernode(e).filter((function(e){return!e.parentUrl})).map((function(e){return nt.createPipeline(e)}))}},{key:"getDescPipelinesToDelete",value:function(e,t){var n=this,i=this.getDescendantSupernodeInfos(e,t),o=this.getOtherSupernodeInfos(e,t),r=[];return i.forEach((function(e){if(n.shouldBeDeleted(e,o)){var t=n.getCanvasInfoPipeline(e.pipelineId);r.push(t)}})),r}},{key:"shouldBeDeleted",value:function(e,t){var n=!0;return t.forEach((function(t){t.pipelineId===e.pipelineId&&(n=!1)})),n}},{key:"getOtherSupernodeInfos",value:function(e,t){var n=this.getPrimaryPipelineId(),i=this.getCanvasInfoPipeline(n),o=h.filterSupernodes(i.nodes);return this.getDescendantSupernodeInfos(o,n,{supernodesToIgnore:e,parentPipelineId:t})}},{key:"getDescendantSupernodeInfos",value:function(e,t,n){var i=this,o=[];return e.forEach((function(e){i.getDescendantSupernodeInfosForSupernode(e,t,n).forEach((function(e){i.isSupernodeInfoInArray(e,o)||o.push(e)}))})),o}},{key:"getDescendantSupernodeInfosForSupernode",value:function(e,t,n){var i=this,o=[];if(this.continueNavigation(e,t,n)){var r=this.getSupernodePipelineId(e),a=this.getCanvasInfoPipeline(r);if(a)o.push({pipelineId:r,supernode:e,parentPipelineId:t}),h.filterSupernodes(a.nodes).forEach((function(e){o=o.concat(i.getDescendantSupernodeInfosForSupernode(e,r,n))}))}return o}},{key:"continueNavigation",value:function(e,t,n){return!n||n.parentPipelineId!==t||!n.supernodesToIgnore.some((function(t){return t.id===e.id}))}},{key:"isSupernodeInfoInArray",value:function(e,t){var n=this,i=!1;return t.forEach((function(t){n.isSupernodeInfoEqual(t,e)&&(i=!0)})),i}},{key:"isSupernodeInfoEqual",value:function(e,t){return e.supernode.id===t.supernode.id&&e.parentPipelineId===t.parentPipelineId}},{key:"getAncestorPipelineIds",value:function(e){var t=this.getPrimaryPipelineId();return t===e?[{pipelineId:t}]:[{pipelineId:t}].concat(this.getAncestorsBetween(t,e))}},{key:"getAncestorsBetween",value:function(e,t){var n=this,i=[];return this.getAPIPipeline(e).getSupernodes().forEach((function(o){var r=n.getSupernodePipelineId(o);r&&((n.isAncestorOfPipeline(r,t)||r===t)&&i.push({pipelineId:r,label:o.label,supernodeId:o.id,parentPipelineId:e}),i=i.concat(n.getAncestorsBetween(r,t)))})),i}},{key:"isAncestorOfPipeline",value:function(e,t){return this.getDescendantPipelineIds(e).includes(t)}},{key:"getSupernodePipelineId",value:function(e){return e.type===o.SUPER_NODE&&t.has_1(e,"subflow_ref.pipeline_id_ref")?e.subflow_ref.pipeline_id_ref:null}},{key:"getSupernodePipelineUrl",value:function(e){return e.type===o.SUPER_NODE&&t.has_1(e,"subflow_ref.url")?e.subflow_ref.url:null}},{key:"getSupernodeObjReferencing",value:function(e){var n,i=this;e===this.getPrimaryPipelineId()?n=this.getAPIPipeline(e).getSupernodes().find((function(t){return i.getSupernodePipelineId(t)===e})).id:n=this.getAncestorPipelineIds(e).find((function(n){return n.pipelineId===e&&t.has_1(n,"supernodeId")}));return n}},{key:"setCanvasInfo",value:function(e){var t=Object.assign({},e);t.pipelines=this.prepareNodes(t.pipelines,this.getNodeLayout(),this.getCanvasLayout()),this.store.dispatch({type:"SET_CANVAS_INFO",canvasInfo:t,canvasInfoIdChanged:this.hasCanvasInfoIdChanged(t)})}},{key:"getPipelineFlow",value:function(){var e=nt.createPipelineFlow(this.getCanvasInfo());return this.store.getCanvasConfig().schemaValidation&&Jt(e),e}},{key:"getPipelines",value:function(){return this.getCanvasInfo().pipelines}},{key:"getPipelineFlowId",value:function(){return this.store.getPipelineFlowId()}},{key:"getPrimaryPipelineId",value:function(){return this.store.getPrimaryPipelineId()}},{key:"getPrimaryPipeline",value:function(){return this.getCanvasInfoPipeline(this.getPrimaryPipelineId())}},{key:"getCurrentPipeline",value:function(){return this.getCanvasInfoPipeline(this.getCurrentPipelineId())}},{key:"getCurrentPipelineId",value:function(){return this.getCurrentBreadcrumb().pipelineId}},{key:"isPrimaryPipelineEmpty",value:function(){return this.getAPIPipeline(this.getPrimaryPipelineId()).isEmpty()}},{key:"deletePipeline",value:function(e){this.store.dispatch({type:"DELETE_PIPELINE",data:{id:e}})}},{key:"isPipelineLoaded",value:function(e,t){var n=this,i=this.getCanvasInfo();return!!i&&i.pipelines.some((function(i){return n.isPipeline(i,e,t)}))}},{key:"isPipeline",value:function(e,t,n){return e.id===t&&(!e.parentUrl&&!n||e.parentUrl===n)}},{key:"cloneSupernodeContents",value:function(e,t){var n=this,i=[],r=this.getSupernodePipelineId(e);if(r){var a=t.find((function(e){return e.id===r}));if(a){var s=this.clonePipelineWithNewId(a);e.subflow_ref.pipeline_id_ref=s.id,i.push(s),s.nodes.forEach((function(e){if(e.type===o.SUPER_NODE){var r=n.cloneSupernodeContents(e,t);i=i.concat(r)}}))}}return i}},{key:"clonePipelineWithNewId",value:function(e){var t=o.cloneDeep_1(e);return Object.assign({},t,{id:this.getUniqueId(o.CLONE_PIPELINE,{pipeline:t})})}},{key:"createCanvasInfoPipeline",value:function(e){var t=this.getUniqueId(o.CREATE_PIPELINE,{pipeline:e});return Object.assign({},e,{id:t})}},{key:"getCanvasInfo",value:function(){return this.store.getCanvasInfo()}},{key:"hasCanvasInfoIdChanged",value:function(e){return e.id!==this.getCanvasInfo().id}},{key:"setSubdueStyle",value:function(e){this.store.dispatch({type:"SET_SUBDUE_STYLE",data:{subdueStyle:e}})}},{key:"removeAllStyles",value:function(e){this.store.dispatch({type:"REMOVE_ALL_STYLES",data:{temporary:e}})}},{key:"hideComments",value:function(){this.store.dispatch({type:"HIDE_COMMENTS"})}},{key:"showComments",value:function(){this.store.dispatch({type:"SHOW_COMMENTS"})}},{key:"isHidingComments",value:function(){return this.store.getCanvasInfo().hideComments}},{key:"findNode",value:function(e,t,n){var i=n.find((function(e){return e.id===t}));return i&&i.nodes?i.nodes.find((function(t){return t.id===e})):null}},{key:"createBreadcrumb",value:function(e,t){return{pipelineId:e.subflow_ref.pipeline_id_ref,supernodeId:e.id,supernodeParentPipelineId:t,externalUrl:e.subflow_ref.url,label:e.label}}},{key:"addBreadcrumb",value:function(e){e&&e.pipelineId!==this.getPrimaryPipelineId()?this.store.dispatch({type:"ADD_BREADCRUMB",data:e}):this.resetBreadcrumb()}},{key:"addBreadcrumbs",value:function(e){this.store.dispatch({type:"ADD_BREADCRUMBS",data:e})}},{key:"setIndexedBreadcrumb",value:function(e){this.store.dispatch({type:"SET_TO_INDEXED_BREADCRUMB",data:e})}},{key:"setBreadcrumbs",value:function(e){this.store.dispatch({type:"SET_BREADCRUMBS",data:{breadcrumbs:e}})}},{key:"setPreviousBreadcrumb",value:function(){this.store.dispatch({type:"SET_TO_PREVIOUS_BREADCRUMB"})}},{key:"resetBreadcrumb",value:function(){this.store.dispatch({type:"RESET_BREADCRUMB",data:{pipelineId:this.getPrimaryPipelineId()}})}},{key:"getBreadcrumbs",value:function(){return this.store.getBreadcrumbs()}},{key:"getCurrentBreadcrumb",value:function(){var e=this.getBreadcrumbs();return e[e.length-1]}},{key:"getPreviousBreadcrumb",value:function(){var e=this.getBreadcrumbs();return e.length<2?null:e[e.length-2]}},{key:"isInSubFlowBreadcrumb",value:function(e){return this.getBreadcrumbs().findIndex((function(t){return t.pipelineId===e}))>0}},{key:"setCanvasConfig",value:function(e){var t=this.getCanvasConfig(),n=S.mergeCanvasConfigs(t,e);if(!S.compareCanvasConfigs(t,n)){var i=this.prepareNodes(this.getCanvasInfo().pipelines,n.enableNodeLayout,n.enableCanvasLayout);this.store.dispatch({type:"SET_CANVAS_CONFIG_INFO",data:{canvasConfig:n,pipelines:i}})}}},{key:"setToolbarConfig",value:function(e){this.store.dispatch({type:"SET_TOOLBAR_CONFIG",data:{toolbarConfig:e}})}},{key:"setNotificationPanelConfig",value:function(e){this.store.dispatch({type:"SET_NOTIFICATION_PANEL_CONFIG",data:{notificationPanelConfig:e}})}},{key:"getCanvasConfig",value:function(){return this.store.getCanvasConfig()}},{key:"getNodeLayout",value:function(){return this.store.getNodeLayout()}},{key:"getCanvasLayout",value:function(){return this.store.getCanvasLayout()}},{key:"clearNotificationMessages",value:function(){this.store.dispatch({type:"CLEAR_NOTIFICATION_MESSAGES"})}},{key:"setNotificationMessages",value:function(e){this.store.dispatch({type:"SET_NOTIFICATION_MESSAGES",data:{messages:e}})}},{key:"getNotificationMessages",value:function(e){var t=this.store.getNotifications();return e?t.filter((function(t){return t.type===e})):t}},{key:"deleteNotificationMessages",value:function(e){this.store.dispatch({type:"DELETE_NOTIFICATION_MESSAGES",data:{ids:e}})}},{key:"toggleNotificationPanel",value:function(){this.isNotificationPanelOpen()?this.closeNotificationPanel():this.openNotificationPanel()}},{key:"openNotificationPanel",value:function(){this.store.dispatch({type:"SET_NOTIFICATION_PANEL_OPEN_STATE",data:{isOpen:!0}})}},{key:"closeNotificationPanel",value:function(){this.store.dispatch({type:"SET_NOTIFICATION_PANEL_OPEN_STATE",data:{isOpen:!1}})}},{key:"isNotificationPanelOpen",value:function(){return this.store.isNotificationPanelOpen()}},{key:"openContextMenu",value:function(e,t){this.store.dispatch({type:"OPEN_CONTEXT_MENU",data:{menuDef:e,source:t}})}},{key:"closeContextMenu",value:function(){this.store.dispatch({type:"CLOSE_CONTEXT_MENU"})}},{key:"isContextMenuDisplayed",value:function(){return this.store.isContextMenuDisplayed()}},{key:"getContextMenuSource",value:function(){return this.store.getContextMenuSource()}},{key:"setRightFlyoutConfig",value:function(e){this.store.dispatch({type:"SET_RIGHT_FLYOUT_CONFIG",data:{config:e}})}},{key:"isRightFlyoutOpen",value:function(){return this.store.isRightFlyoutOpen()}},{key:"setBottomPanelConfig",value:function(e){this.store.dispatch({type:"SET_BOTTOM_PANEL_CONFIG",data:{config:e}})}},{key:"isBottomPanelOpen",value:function(){return this.store.isBottomPanelOpen()}},{key:"setBottomPanelHeight",value:function(e){this.store.dispatch({type:"SET_BOTTOM_PANEL_CONFIG",data:{config:{panelHeight:e}}})}},{key:"setTopPanelConfig",value:function(e){this.store.dispatch({type:"SET_TOP_PANEL_CONFIG",data:{config:e}})}},{key:"isTopPanelOpen",value:function(){return this.store.isTopPanelOpen()}},{key:"cloneObjectsToPaste",value:function(e,t,n){var i=this,r=[],a=[],s=[];return e&&e.forEach((function(e){var t=i.cloneNode(e);t.type===o.SUPER_NODE&&(t=i.convertPipelineData(t)),r.push({originalId:e.id,node:t})})),t&&t.forEach((function(e){a.push({originalId:e.id,comment:i.cloneComment(e)})})),n&&n.forEach((function(e){if("nodeLink"===e.type||"associationLink"===e.type){var t=i.findClonedNode(e.srcNodeId,r),n=i.findClonedNode(e.trgNodeId,r),o=i.cloneNodeLink(e,t,n);s.push(o)}else{var d=i.findClonedComment(e.srcNodeId,a),c=i.findClonedNode(e.trgNodeId,r);if(d&&c){var l=i.cloneCommentLink(e,d.id,c.id);s.push(l)}}})),{clonedNodes:r.map((function(e){return e.node})),clonedComments:a.map((function(e){return e.comment})),clonedLinks:s}}},{key:"findClonedNode",value:function(e,t){var n=t.find((function(t){return t.originalId===e}));return n?n.node:null}},{key:"findClonedComment",value:function(e,t){var n=t.find((function(t){return t.originalId===e}));return n?n.comment:null}},{key:"cloneNode",value:function(e){var t=Object.assign({},e,{id:this.getUniqueId(o.CLONE_NODE,{node:e})});return t=this.setNodeAttributes(t)}},{key:"cloneComment",value:function(e){var t=this.setCommentAttributes(e);return Object.assign({},t,{id:this.getUniqueId(o.CLONE_COMMENT,{comment:t})})}},{key:"cloneNodeLink",value:function(e,t,n){var i=this.getUniqueId(o.CLONE_NODE_LINK,{link:e,sourceNodeId:t?t.id:null,targetNodeId:n?n.id:null}),r=Object.assign({},e,{id:i});return t?(r.srcNodeId=t.id,r.srcNodePortId=e.srcNodePortId):r.srcPos=e.srcPos,n?(r.trgNodeId=n.id,r.trgNodePortId=e.trgNodePortId):r.trgPos=e.trgPos,r}},{key:"cloneCommentLink",value:function(e,t,n){return{id:this.getUniqueId(o.CLONE_COMMENT_LINK,{link:e,commentId:t,targetNodeId:n}),type:e.type,class_name:e.class_name,srcNodeId:t,trgNodeId:n}}},{key:"getSelectedObjectIds",value:function(){return this.store.getSelectedObjectIds()}},{key:"getSelectedNodesIds",value:function(){return this.getSelectedNodes().map((function(e){return e.id}))}},{key:"getSelectedNodes",value:function(){return this.store.getSelectedNodes()}},{key:"getSelectedComments",value:function(){return this.store.getSelectedComments()}},{key:"getSelectedLinks",value:function(){return this.store.getSelectedLinks()}},{key:"getSelectedObjects",value:function(){return this.getSelectedNodes().concat(this.getSelectedComments()).concat(this.getSelectedLinks())}},{key:"getSelectionInfo",value:function(){return this.store.getSelectionInfo()}},{key:"getSelectedPipeline",value:function(){return this.getAPIPipeline(this.getSelectedPipelineId())}},{key:"getSelectedPipelineId",value:function(){return this.store.getSelectedPipelineId()}},{key:"clearSelections",value:function(){this.executeWithSelectionChange(this.store.dispatch,{type:"CLEAR_SELECTIONS"})}},{key:"selectObject",value:function(e,t,n,i){this.isSelected(e,i)?n&&this.toggleSelection(e,n,i):t?this.selectSubGraph(e,i):this.toggleSelection(e,n,i)}},{key:"isSelected",value:function(e,t){return t===this.getSelectedPipelineId()&&this.getSelectedObjectIds().indexOf(e)>=0}},{key:"toggleSelection",value:function(e,t,n){var i=[e];if(n===this.getSelectedPipelineId()&&t)if(this.isSelected(e,n)){var o=(i=this.getSelectedObjectIds().slice()).indexOf(e);i.splice(o,1)}else i=this.getSelectedObjectIds().concat(e);this.setSelections(i,n)}},{key:"setSelections",value:function(e,t){var n=this.getAPIPipeline(t).pipelineId;this.executeWithSelectionChange(this.store.dispatch,{type:"SET_SELECTIONS",data:{selections:e},pipelineId:n})}},{key:"deleteSelectedObjects",value:function(){this.getSelectedPipeline().deleteObjects(this.getSelectedObjectIds())}},{key:"selectAll",value:function(e,t){var n,i=[],o=this.getAPIPipeline(t),r=sn(o.getNodes());try{for(r.s();!(n=r.n()).done;){var a=n.value;h.isSuperBindingNode(a)||i.push(a.id)}}catch(e){r.e(e)}finally{r.f()}var s,d=sn(o.getComments());try{for(d.s();!(s=d.n()).done;){var c=s.value;i.push(c.id)}}catch(e){d.e(e)}finally{d.f()}if(e){var l,u=sn(o.getLinks());try{for(u.s();!(l=u.n()).done;){var p=l.value;i.push(p.id)}}catch(e){u.e(e)}finally{u.f()}}this.setSelections(i,o.pipelineId)}},{key:"findNodesInSubGraph",value:function(e,t,n,i){var o=this.getAPIPipeline(i),r=!1;if(n.push(e),e===t)r=!0;else{var a,s=sn(o.getLinks());try{for(s.s();!(a=s.n()).done;){var d=a.value;if(d.srcNodeId===e){var c=this.findNodesInSubGraph(d.trgNodeId,t,n,i);!0!==c&&n.pop(),r=r||c}}}catch(e){s.e(e)}finally{s.f()}}return r}},{key:"selectSubGraph",value:function(e,t){var n=[],i=[e];if(t===this.getSelectedPipelineId()){var o,r=!1,a=sn(this.getSelectedObjectIds());try{for(a.s();!(o=a.n()).done;){var s=o.value;r=r||this.findNodesInSubGraph(s,e,n,t)}}catch(e){a.e(e)}finally{a.f()}r||n.push(e),i=this.getSelectedObjectIds().slice();var d,c=sn(n);try{for(c.s();!(d=c.n()).done;){var l=d.value;this.isSelected(l,t)||i.push(l)}}catch(e){c.e(e)}finally{c.f()}}this.setSelections(i,t)}},{key:"areSelectedNodesContiguous",value:function(){var e,t=this.getSelectedNodesIds(),n=[t[0]],i=this.getSelectedPipeline(),o=sn(t);try{for(o.s();!(e=o.n()).done;){var r=e.value;this.addConnectedNodeIdToGroup(r,n,t,i)}}catch(e){o.e(e)}finally{o.f()}return n.length===t.length}},{key:"areAllSelectedObjectsLinks",value:function(){return this.store.areAllSelectedObjectsLinks()}},{key:"addConnectedNodeIdToGroup",value:function(e,t,n,i){if(t.includes(e)){var r,a=i.getLinksContainingId(e).filter((function(e){return e.type===o.NODE_LINK||e.type===o.ASSOCIATION_LINK})),s=sn(a);try{for(s.s();!(r=s.n()).done;){var d=r.value;n.includes(d.trgNodeId)&&n.includes(d.srcNodeId)&&(t.includes(d.trgNodeId)||(t.push(d.trgNodeId),this.addConnectedNodeIdToGroup(d.trgNodeId,t,n,i)),t.includes(d.srcNodeId)||(t.push(d.srcNodeId),this.addConnectedNodeIdToGroup(d.srcNodeId,t,n,i)))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"createEmptyPipeline",value:function(){var e={runtime_ref:this.getCanvasInfoPipeline(this.getPrimaryPipelineId()).runtime_ref,nodes:[],comments:[],links:[]};return this.createCanvasInfoPipeline(e)}},{key:"createPipeline",value:function(e,t,n){var i={runtime_ref:this.getCanvasInfoPipeline(this.getPrimaryPipelineId()).runtime_ref,nodes:e,comments:t,links:n};return this.createCanvasInfoPipeline(i)}},{key:"executeWithSelectionChange",value:function(e,n){var i={nodes:[],comments:[],pipelineId:""};if(this.selectionChangeHandler&&(i={links:this.getSelectedLinks(),nodes:this.getSelectedNodes(),comments:this.getSelectedComments(),pipelineId:this.getSelectedPipelineId()}),e(n),this.selectionChangeHandler){var o=this.getSelectedLinks(),r=this.getSelectedNodes(),a=this.getSelectedComments(),s={selection:this.getSelectedObjectIds(),selectedLinks:o,selectedNodes:r,selectedComments:a,addedLinks:Ze(o,i.links,(function(e,t){return e.id===t.id})),addedNodes:Ze(r,i.nodes,(function(e,t){return e.id===t.id})),addedComments:Ze(a,i.comments,(function(e,t){return e.id===t.id})),deselectedLinks:Ze(i.links,o,(function(e,t){return e.id===t.id})),deselectedNodes:Ze(i.nodes,r,(function(e,t){return e.id===t.id})),deselectedComments:Ze(i.comments,a,(function(e,t){return e.id===t.id})),previousPipelineId:i.pipelineId,selectedPipelineId:this.getSelectedPipelineId()};t.isEmpty_1(s.addedLinks)&&t.isEmpty_1(s.addedNodes)&&t.isEmpty_1(s.addedComments)&&t.isEmpty_1(s.deselectedLinks)&&t.isEmpty_1(s.deselectedNodes)&&t.isEmpty_1(s.deselectedComments)||this.selectionChangeHandler(s)}}},{key:"hasErrorMessage",value:function(e){var t=this.getNodeMessages(e);return!!t&&t.some((function(e){return e.type===o.ERROR}))}},{key:"hasWarningMessage",value:function(e){var t=this.getNodeMessages(e);return!!t&&t.some((function(e){return e.type===o.WARNING}))}},{key:"getNodeMessages",value:function(e){return e?e.messages:null}},{key:"getNotificationMessagesMaxType",value:function(){var e=this.getNotificationMessages(),t=this.getNotificationMessages(o.ERROR),n=this.getNotificationMessages(o.WARNING),i=this.getNotificationMessages(o.SUCCESS),r=this.getNotificationMessages(o.INFO),a=null;return e.length>0&&(t.length>0?a=o.ERROR:n.length>0?a=o.WARNING:i.length>0?a=o.SUCCESS:r.length>0&&(a=o.INFO)),a}},{key:"isLink",value:function(e){return e.type===o.NODE_LINK||e.type===o.COMMENT_LINK||e.type===o.ASSOCIATION_LINK}},{key:"setZoom",value:function(e,t){var n=this.getCanvasConfig().enableSaveZoom;this.store.dispatch({type:"SET_ZOOM",data:{zoom:e,enableSaveZoom:n},pipelineId:t}),n===o.SAVE_ZOOM_LOCAL_STORAGE&&this.setSavedZoomLocal(e,t)}},{key:"getSavedZoom",value:function(e){var t=this.getCanvasConfig().enableSaveZoom;return t===o.SAVE_ZOOM_PIPELINE_FLOW?this.store.getZoom(e):t===o.SAVE_ZOOM_LOCAL_STORAGE?this.getSavedZoomLocal(e):null}},{key:"clearSavedZoomValues",value:function(){it.delete("canvasSavedZoomValues")}},{key:"setSavedZoomLocal",value:function(e,t){var n=it.get("canvasSavedZoomValues"),o=n?JSON.parse(n):{};i.set_1(o,[this.getPipelineFlowId(),t],e),it.set("canvasSavedZoomValues",JSON.stringify(o))}},{key:"getSavedZoomLocal",value:function(e){var n=it.get("canvasSavedZoomValues");if(n){var i=JSON.parse(n);return t.get_1(i,[this.getPipelineFlowId(),e])}return null}},{key:"setNodesMultiDecorations",value:function(e){this.store.dispatch({type:"SET_NODES_MULTI_DECORATIONS",data:{pipelineNodeDecorations:e}})}},{key:"setLinksMultiDecorations",value:function(e){this.store.dispatch({type:"SET_LINKS_MULTI_DECORATIONS",data:{pipelineLinkDecorations:e}})}},{key:"setObjectsStyle",value:function(e,t,n){this.store.dispatch({type:"SET_OBJECTS_STYLE",data:{pipelineObjIds:e,newStyle:t,temporary:n}})}},{key:"setObjectsMultiStyle",value:function(e,t){this.store.dispatch({type:"SET_OBJECTS_MULTI_STYLE",data:{pipelineObjStyles:e,temporary:t}})}},{key:"setLinksStyle",value:function(e,t,n){this.store.dispatch({type:"SET_LINKS_STYLE",data:{pipelineObjIds:e,newStyle:t,temporary:n}})}},{key:"setLinksMultiStyle",value:function(e,t){this.store.dispatch({type:"SET_LINKS_MULTI_STYLE",data:{pipelineObjStyles:e,temporary:t}})}},{key:"getObjectStyle",value:function(e,t){var n=this.getObject(e);return t?n&&n.style_temp?n.style_temp:null:n&&n.style?n.style:null}},{key:"getHighlightObjectIds",value:function(e,t,n){var i=this,r={},a={};return r[e]=[],a[e]=[],t.forEach((function(t){switch(r[e].push(t),n){case o.HIGHLIGHT_BRANCH:i.getUpstreamObjIdsFrom(t,e,r,a),i.getDownstreamObjIdsFrom(t,e,r,a);break;case o.HIGHLIGHT_UPSTREAM:i.getUpstreamObjIdsFrom(t,e,r,a);break;case o.HIGHLIGHT_DOWNSTREAM:i.getDownstreamObjIdsFrom(t,e,r,a)}i.getAPIPipeline(e).isSupernode(t)&&i.getSupernodeNodeIds(t,e,r,a)})),{nodes:r,links:a}}},{key:"getSupernodeNodeIds",value:function(e,t,n,r){var a=this,s=this.getAPIPipeline(t).getNode(e);if(s.type===o.SUPER_NODE){var d=this.getSupernodePipelineId(s);n[d]=n[d]||[],r[d]=r[d]||[];var c=this.getAPIPipeline(d).getNodeIds(),l=this.getAPIPipeline(d).getLinkIds();n[d]=i.union_1(n[d],c),r[d]=i.union_1(r[d],l),c.forEach((function(e){a.getSupernodeNodeIds(e,d,n,r)}))}}},{key:"getUpstreamObjIdsFrom",value:function(e,t,n,r){var a=this;n[t]=n[t]||[],r[t]=r[t]||[];var s=this.getAPIPipeline(t),d=s.getNode(e),c=s.getAttachedLinksContainingTargetId(e).filter((function(e){return e.type===o.NODE_LINK}));if(c.length>0)c.forEach((function(e){if(!r[t].includes(e.id)){var o=s.getNode(e.srcNodeId);r[t]=i.union_1(r[t],[e.id]),n[t]=i.union_1(n[t],[e.srcNodeId]);var d=a.getSupernodeOutputPortForLink(o,e);if(d){var c=a.getSupernodePipelineId(o),l=a.getAPIPipeline(c).getNode(d.subflow_node_ref);l&&(r[c]=r[c]||[],n[c]=n[c]||[],n[c]=i.union_1(n[c],[l.id]),a.getUpstreamObjIdsFrom(l.id,c,n,r))}else a.getUpstreamObjIdsFrom(e.srcNodeId,t,n,r)}}));else if(s.isEntryBindingNode(d)&&h.isSuperBindingNode(d)){var l=this.getSupernodeObjReferencing(t),u=l.parentPipelineId,p=this.getAPIPipeline(u),f=p.getNode(l.supernodeId);f.inputs.forEach((function(t){t.subflow_node_ref===e&&p.getAttachedLinksContainingTargetId(f.id).forEach((function(e){if(e.trgNodePortId===t.id)if(n[u]=n[u]||[],r[u]=r[u]||[],n[u]=i.union_1(n[u],[e.srcNodeId]),r[u]=i.union_1(r[u],[e.id]),p.isSupernode(e.srcNodeId)){var o=p.getNode(e.srcNodeId),s=a.getSupernodeOutputPortForLink(o,e);if(s){var d=s.subflow_node_ref;a.getUpstreamObjIdsFrom(d,a.getSupernodePipelineId(o),n,r)}}else a.getUpstreamObjIdsFrom(e.srcNodeId,u,n,r)}))}))}}},{key:"getDownstreamObjIdsFrom",value:function(e,t,n,r){var a=this;n[t]=n[t]||[],r[t]=r[t]||[];var s=this.getAPIPipeline(t),d=s.getNode(e),c=s.getAttachedLinksContainingSourceId(e).filter((function(e){return e.type===o.NODE_LINK}));if(c.length>0)c.forEach((function(e){if(!r[t].includes(e.id)){var o=s.getNode(e.trgNodeId);r[t]=i.union_1(r[t],[e.id]),n[t]=i.union_1(n[t],[e.trgNodeId]);var d=a.getSupernodeInputPortForLink(o,e);if(d){var c=a.getSupernodePipelineId(o),l=a.getAPIPipeline(c).getNode(d.subflow_node_ref);l&&(r[c]=r[c]||[],n[c]=n[c]||[],n[c]=i.union_1(n[c],[l.id]),a.getDownstreamObjIdsFrom(l.id,c,n,r))}else a.getDownstreamObjIdsFrom(e.trgNodeId,t,n,r)}}));else if(s.isExitBindingNode(d)&&h.isSuperBindingNode(d)){var l=this.getSupernodeObjReferencing(t),u=l.parentPipelineId,p=this.getAPIPipeline(u),f=p.getNode(l.supernodeId);f.outputs.forEach((function(t){t.subflow_node_ref===e&&p.getAttachedLinksContainingSourceId(f.id).forEach((function(e){if(e.srcNodePortId===t.id)if(n[u]=n[u]||[],r[u]=r[u]||[],n[u]=i.union_1(n[u],[e.trgNodeId]),r[u]=i.union_1(r[u],[e.id]),p.isSupernode(e.trgNodeId)){var o=p.getNode(e.trgNodeId),s=a.getSupernodeInputPortForLink(o,e);if(s){var d=s.subflow_node_ref;a.getDownstreamObjIdsFrom(d,a.getSupernodePipelineId(o),n,r)}}else a.getDownstreamObjIdsFrom(e.trgNodeId,u,n,r)}))}))}}},{key:"getSupernodeInputPortForLink",value:function(e,t){var n=null;return this.getSupernodePipelineId(e)&&t.trgNodePortId&&e.inputs.forEach((function(e){e.id!==t.trgNodePortId||(n=e)})),n}},{key:"getSupernodeOutputPortForLink",value:function(e,t){var n=null;return this.getSupernodePipelineId(e)&&t.srcNodePortId&&e.outputs.forEach((function(e){e.id!==t.srcNodePortId||(n=e)})),n}},{key:"copyToClipboard",value:function(e){var t=this,n={},i=this.getSelectionAPIPipeline();if(!i)return!1;var r=this.getSelectedNodes(),a=this.getSelectedComments(),s=i.getLinksBetween(r,a);if(e){var d=i.getNodeDataLinksContainingIds(r.map((function(e){return e.id})));s=h.concatUniqueBasedOnId(d,s),s=h.concatUniqueBasedOnId(this.getSelectedLinks(),s)}if(0===r.length&&0===a.length&&0===s.length)return!1;if(r&&r.length>0){n.nodes=r;var c=[];h.filterSupernodes(r).forEach((function(e){c=c.concat(t.getSchemaPipelinesForSupernode(e)),e.sub_pipelines=c}))}a&&a.length>0&&(n.comments=a),s&&s.length>0&&(n.links=s.map((function(e){var t=Object.assign({},e);return e.type===o.NODE_LINK&&e.srcNodeId&&-1===r.findIndex((function(t){return t.id===e.srcNodeId}))&&(delete t.srcNodeId,delete t.srcNodePortId,t.srcPos=h.getSrcPos(e,i)),e.type===o.NODE_LINK&&e.trgNodeId&&-1===r.findIndex((function(t){return t.id===e.trgNodeId}))&&(delete t.trgNodeId,delete t.trgNodePortId,t.trgPos=h.getTrgPos(e,i)),t})));var l=JSON.stringify(n);return it.set("canvasClipboard",l),!0}},{key:"isClipboardEmpty",value:function(){var e=it.get("canvasClipboard");return!e||""===e}},{key:"getObjectsToPaste",value:function(){var e=it.get("canvasClipboard");if(!e)return{};var t=JSON.parse(e);return t.nodes||t.comments||t.links?t:null}},{key:"setTooltipDef",value:function(e){this.store.dispatch({type:"SET_TOOLTIP_DEF",data:{tooltipDef:e}})}},{key:"isTooltipOpen",value:function(){return this.store.isTooltipOpen()}},{key:"setTextToolbarDef",value:function(e){this.store.dispatch({type:"SET_TEXT_TOOLBAR_DEF",data:{textToolbarDef:e}})}}]),n}();function ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var un=function(t){n._inherits(o,t);var i=ln(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.previousObjectsInfo=a.getPreviousObjectsInfo(t),a.previousDetLinksInfo=a.getPreviousDetachedLinksInfo(t),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.sizeAndPositionObjects(this.data.objectsInfo,this.data.linksInfo)}},{key:"undo",value:function(){this.apiPipeline.sizeAndPositionObjects(this.previousObjectsInfo,this.previousDetLinksInfo)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.sizeAndPositionObjects")}},{key:"getPreviousObjectsInfo",value:function(e){var t=this,n=[];return Object.keys(e.objectsInfo).forEach((function(e){var i=t.apiPipeline.getObject(e);i&&(n[e]={id:i.id,x_pos:i.x_pos,y_pos:i.y_pos,width:i.width,height:i.height},i.isResized&&(n[e].isResized=i.isResized,n[e].resizeWidth=i.resizeWidth,n[e].resizeHeight=i.resizeHeight))})),n}},{key:"getPreviousDetachedLinksInfo",value:function(e){var t=this,n=[];return Object.keys(e.detachedLinksInfo).forEach((function(e){var i=t.apiPipeline.getLink(e);i&&(i.srcPos||i.trgPos)&&(n[e]={},i.srcPos&&(n[e].srcPos={x_pos:i.srcPos.x_pos,y_pos:i.srcPos.y_pos}),i.trgPos&&(n[e].trgPos={x_pos:i.trgPos.x_pos,y_pos:i.trgPos.y_pos}))})),n}}]),o}(i.Action),pn=null;var fn=function e(t){var n=[];return t.forEach((function(t){if(t.submenu){var i=e(t.menu);i&&i.length>0&&(t.menu=i,n.push(t))}else gn(t.action)||n.push(t)})),n},hn=function(e){var t=[],n=!0;return e.forEach((function(e){e.divider?n||(t.push(e),n=!0):(t.push(e),n=!1)})),t},gn=function(e){return"createComment"===e||"colorBackground"===e||"disconnectNode"===e||"setNodeLabelEditingMode"===e||"setCommentEditingMode"===e||"cut"===e||"copy"===e||"paste"===e||"undo"===e||"redo"===e||"deleteSelectedObjects"===e||"createSuperNode"===e||"createSuperNodeExternal"===e||"deconstructSuperNode"===e||"collapseSuperNodeInPlace"===e||"expandSuperNodeInPlace"===e||"convertSuperNodeExternalToLocal"===e||"convertSuperNodeLocalToExternal"===e||"deleteLink"===e||"saveToPalette"===e},yn=function(e){var n=[],i=pn.isContextMenuForNonSelectedObj(e);if("canvas"===e.type&&(n=n.concat([{action:"createComment",label:bn("canvas.addComment"),toolbarItem:!0},{action:"selectAll",label:bn("canvas.selectAll")},{divider:!0}])),"node"===e.type&&t.get_1(e,"targetObject.layout.labelEditable",!1)&&(n=n.concat({action:"setNodeLabelEditingMode",label:bn("node.renameNode"),toolbarItem:!0})),"comment"===e.type&&(n=n.concat({action:"setCommentEditingMode",label:bn("comment.editComment"),toolbarItem:!0})),"comment"===e.type&&t.get_1(pn,"contextMenuConfig.defaultMenuEntries.colorBackground",!0)&&(n=n.concat({action:"colorBackground",label:bn("comment.colorBackground")},{divider:!0})),"node"===e.type||"comment"===e.type){var r=i?[e.targetObject.id]:e.selectedObjectIds;pn.objectModel.getAPIPipeline(e.pipelineId).getLinksContainingIds(r).length>0&&(n=n.concat({action:"disconnectNode",label:bn("node.disconnectNode")},{divider:!0}))}if("node"===e.type||"comment"===e.type||"link"===e.type&&pn.areDetachableLinksInUse()||"canvas"===e.type){var a=mn(e,"canvas"===e.type);n=n.concat({action:"clipboard",submenu:!0,menu:a,label:bn("node.editMenu")},{divider:!0})}return"canvas"===e.type&&(n=n.concat({action:"undo",label:bn("canvas.undo"),enable:pn.canUndo()},{action:"redo",label:bn("canvas.redo"),enable:pn.canRedo()},{divider:!0})),("node"===e.type||"comment"===e.type||pn.getCanvasConfig().enableLinkSelection!==o.LINK_SELECTION_NONE&&"link"===e.type)&&(n=n.concat({action:"deleteSelectedObjects",label:bn("canvas.deleteObject"),toolbarItem:!0},{divider:!0})),"node"!==e.type&&"comment"!==e.type||t.get_1(pn,"contextMenuConfig.defaultMenuEntries.createSupernode",!1)&&(pn.areSelectedNodesContiguous()||t.get_1(pn,"contextMenuConfig.enableCreateSupernodeNonContiguous",!1)||i&&"node"===e.type)&&(n=n.concat({action:"createSuperNode",label:bn("node.createSupernode")}),pn.getCanvasConfig().enableExternalPipelineFlows&&(n=n.concat({action:"createSuperNodeExternal",label:bn("node.createSupernodeExternal")})),n=n.concat({divider:!0})),"node"!==e.type||e.targetObject.type!==o.SUPER_NODE||1!==e.selectedObjectIds.length&&!i||"canvas"!==e.targetObject.open_with_tool&&void 0!==e.targetObject.open_with_tool||(n=n.concat({action:"deconstructSuperNode",label:bn("node.deconstructSupernode")},{divider:!0}),n=pn.isSuperNodeExpandedInPlace(e.targetObject.id,e.pipelineId)?n.concat({action:"collapseSuperNodeInPlace",label:bn("node.collapseSupernodeInPlace")}):n.concat({action:"expandSuperNodeInPlace",label:bn("node.expandSupernode")}),t.get_1(pn,"contextMenuConfig.defaultMenuEntries.displaySupernodeFullPage")&&(n=n.concat({action:"displaySubPipeline",label:bn("node.displaySupernodeFullPage"),toolbarItem:!0})),n=n.concat({divider:!0}),pn.getCanvasConfig().enableExternalPipelineFlows&&(e.targetObject.subflow_ref.url?pn.isPipelineExternal(e.pipelineId)||(n=n.concat({action:"convertSuperNodeExternalToLocal",label:bn("node.convertSupernodeExternalToLocal")},{divider:!0})):n=n.concat({action:"convertSuperNodeLocalToExternal",label:bn("node.convertSupernodeLocalToExternal")},{divider:!0}))),"link"===e.type&&pn.getCanvasConfig().enableLinkSelection===o.LINK_SELECTION_NONE&&(n=n.concat({action:"deleteLink",label:bn("canvas.deleteObject"),toolbarItem:!0})),"node"===e.type&&(n=n.concat({action:"highlight",submenu:!0,menu:_n(e),label:bn("menu.highlight")})),"canvas"===e.type&&(n=n.concat({action:"unhighlight",label:bn("menu.unhighlight"),enable:pn.isHighlighted()})),"node"===e.type&&t.get_1(pn,"contextMenuConfig.defaultMenuEntries.saveToPalette",!1)&&(n=n.concat({divider:!0},{action:"saveToPalette",label:bn("node.saveToPalette")})),n},mn=function(e,t){var n=[{action:"cut",label:bn("edit.cutSelection"),enable:"canvas"!==e.type||e.selectedObjectIds.length>0},{action:"copy",label:bn("edit.copySelection"),enable:"canvas"!==e.type||e.selectedObjectIds.length>0}];return t&&n.push({action:"paste",label:bn("edit.pasteSelection"),enable:!pn.isClipboardEmpty()}),n},_n=function(e){var t=[{action:"highlightBranch",label:bn("menu.highlightBranch")},{action:"highlightUpstream",label:bn("menu.highlightUpstream")},{action:"highlightDownstream",label:bn("menu.highlightDownstream")}];return t.push({divider:!0}),t=t.concat(vn(e))},vn=function(e){return[{action:"unhighlight",label:bn("menu.unhighlight"),enable:pn.isHighlighted()}]},bn=function(e){return pn.labelUtil.getLabel(e)},Pn=0,kn=function(){function n(){e._classCallCheck(this,n),this.logger=new a.Logger("CanvasController"),this.contextMenuConfig={enableCreateSupernodeNonContiguous:!1,defaultMenuEntries:{saveToPalette:!1,createSupernode:!0,displaySupernodeFullPage:!0,colorBackground:!0}},this.keyboardConfig={actions:{delete:!0,undo:!0,redo:!0,selectAll:!0,copyToClipboard:!0,cutToClipboard:!0,pasteFromClipboard:!0}},this.handlers={contextMenuHandler:null,beforeEditActionHandler:null,editActionHandler:null,clickActionHandler:null,decorationActionHandler:null,tipHandler:null,layoutHandler:null,idGeneratorHandler:null,selectionChangeHandler:null,actionLabelHandler:null},this.objectModel=new cn,this.commandStack=new r,this.labelUtil=new $e,this.contextMenuActionHandler=this.contextMenuActionHandler.bind(this),this.closeContextMenu=this.closeContextMenu.bind(this),this.isContextMenuForNonSelectedObj=this.isContextMenuForNonSelectedObj.bind(this),this.instanceId=Pn++,this.highlight=!1}return e._createClass(n,[{key:"setCanvasConfig",value:function(e){this.logger.log("Setting Canvas Config");var t=this.correctTypo(e);this.objectModel.openPaletteIfNecessary(e),this.objectModel.setCanvasConfig(t)}},{key:"correctTypo",value:function(e){return t.isEmpty_1(e)||"boolean"!=typeof e.enableHightlightNodeOnNewLinkDrag||(e.enableHighlightNodeOnNewLinkDrag=e.enableHightlightNodeOnNewLinkDrag,delete e.enableHightlightNodeOnNewLinkDrag),e}},{key:"getCanvasConfig",value:function(){return this.objectModel.getCanvasConfig()}},{key:"setIntl",value:function(e){this.labelUtil.setIntl(e)}},{key:"setToolbarConfig",value:function(e){this.logger.log("Setting Toolbar Config"),this.objectModel.setToolbarConfig(e)}},{key:"setNotificationPanelConfig",value:function(e){this.logger.log("Setting Notif Panel Config"),this.objectModel.setNotificationPanelConfig(e)}},{key:"setRightFlyoutConfig",value:function(e){this.logger.log("Setting Right Flyout Config"),this.objectModel.setRightFlyoutConfig(e)}},{key:"setBottomPanelConfig",value:function(e){this.logger.log("Setting Bottom Panel Config"),this.objectModel.setBottomPanelConfig(e)}},{key:"setTopPanelConfig",value:function(e){this.logger.log("Setting Top Panel Config"),this.objectModel.setTopPanelConfig(e)}},{key:"setContextMenuConfig",value:function(e){if(this.logger.log("Setting Context Menu Config"),e){var t=Object.assign(this.contextMenuConfig.defaultMenuEntries,e.defaultMenuEntries);this.contextMenuConfig=Object.assign(this.contextMenuConfig,e,{defaultMenuEntries:t})}}},{key:"setKeyboardConfig",value:function(e){this.logger.log("Setting Keyboard Config"),e&&e.actions&&(this.keyboardConfig.actions=Object.assign({},this.keyboardConfig.actions,e.actions))}},{key:"getKeyboardConfig",value:function(){return this.keyboardConfig}},{key:"setHandlers",value:function(e){this.logger.log("Setting Handlers"),this.handlers=Object.assign(this.handlers,e),this.objectModel.setIdGeneratorHandler(e.idGeneratorHandler),this.objectModel.setSelectionChangeHandler(e.selectionChangeHandler),this.objectModel.setLayoutHandler(e.layoutHandler),this.labelUtil.setActionLabelHandler(e.actionLabelHandler)}},{key:"setCanvasContents",value:function(e){this.canvasContents=e}},{key:"getSVGCanvasD3",value:function(){return this.canvasContents?this.canvasContents.getSVGCanvasD3():null}},{key:"setInstanceId",value:function(e){this.instanceId=e}},{key:"getInstanceId",value:function(){return this.instanceId}},{key:"getObjectModel",value:function(){return this.objectModel}},{key:"isInternalObjectModelEnabled",value:function(){return this.getCanvasConfig().enableInternalObjectModel}},{key:"getStore",value:function(){return this.getObjectModel().getStore()}},{key:"setPipelineFlow",value:function(e){this.objectModel.setPipelineFlow(e),this.ensureVisibleExpandedPipelinesAreLoaded()}},{key:"clearPipelineFlow",value:function(){this.objectModel.clearPipelineFlow()}},{key:"getPipelineFlow",value:function(){return this.objectModel.getPipelineFlow()}},{key:"getPipelineFlowId",value:function(){return this.objectModel.getPipelineFlowId()}},{key:"getPrimaryPipelineId",value:function(){return this.objectModel.getPrimaryPipelineId()}},{key:"getExternalPipelineFlow",value:function(e){return this.objectModel.getExternalPipelineFlow(e)}},{key:"getCanvasInfo",value:function(){return this.objectModel.getCanvasInfo()}},{key:"getAncestorPipelineIds",value:function(e){return this.objectModel.getAncestorPipelineIds(e)}},{key:"removeAllStyles",value:function(e){this.objectModel.removeAllStyles(e)}},{key:"setSubdueStyle",value:function(e){this.objectModel.setSubdueStyle(e)}},{key:"getPipeline",value:function(e){return this.objectModel.getCanvasInfoPipeline(e)}},{key:"getCurrentPipelineId",value:function(){return this.objectModel.getCurrentBreadcrumb().pipelineId}},{key:"isPipelineExternal",value:function(e){return this.objectModel.getAPIPipeline(e).isPipelineExternal()}},{key:"getFlowMessages",value:function(e){return this.objectModel.getAPIPipeline(e).getFlowMessages()}},{key:"isFlowValid",value:function(e,t){return this.objectModel.getAPIPipeline(t).isFlowValid(e)}},{key:"autoLayout",value:function(e,t){this.objectModel.getAPIPipeline(t).autoLayout(e)}},{key:"setCanvas",value:function(e){this.objectModel.setCanvas(e)}},{key:"setPaletteData",value:function(e){this.objectModel.setPaletteData(e)}},{key:"getCanvas",value:function(){return this.objectModel.getCanvas()}},{key:"setPipelineFlowPalette",value:function(e){this.objectModel.setPipelineFlowPalette(e)}},{key:"clearPaletteData",value:function(){this.objectModel.clearPaletteData()}},{key:"setCategoryLoadingText",value:function(e,t){this.objectModel.setCategoryLoadingText(e,t)}},{key:"setCategoryEmptyText",value:function(e,t){this.objectModel.setCategoryEmptyText(e,t)}},{key:"addNodeTypeToPalette",value:function(e,t,n,i,o){this.objectModel.addNodeTypeToPalette(e,t,n,i,o)}},{key:"addNodeTypesToPalette",value:function(e,t,n,i,o){this.objectModel.addNodeTypesToPalette(e,t,n,i,o)}},{key:"removeNodesFromPalette",value:function(e,t){this.objectModel.addNodeTypesToPalette(e,t)}},{key:"getPaletteData",value:function(){return this.objectModel.getPaletteData()}},{key:"getPaletteNode",value:function(e){return this.objectModel.getPaletteNode(e)}},{key:"getPaletteNodeById",value:function(e){return this.objectModel.getPaletteNodeById(e)}},{key:"getCategoryForNode",value:function(e){return this.objectModel.getCategoryForNode(e)}},{key:"convertNodeTemplate",value:function(e){return this.objectModel.convertNodeTemplate(e)}},{key:"openPaletteCategory",value:function(e){this.objectModel.setIsOpenCategory(e,!0)}},{key:"closePaletteCategory",value:function(e){this.objectModel.setIsOpenCategory(e,!1)}},{key:"openAllPaletteCategories",value:function(){this.objectModel.setIsOpenAllCategories(!0)}},{key:"closeAllPaletteCategories",value:function(){this.objectModel.setIsOpenAllCategories(!1)}},{key:"isPaletteCategoryOpen",value:function(e){return this.objectModel.isPaletteCategoryOpen(e)}},{key:"setSelections",value:function(e,t){this.objectModel.setSelections(e,t)}},{key:"clearSelections",value:function(){this.objectModel.clearSelections()}},{key:"selectAll",value:function(e){var t=this.getCanvasConfig().enableLinkSelection!==o.LINK_SELECTION_NONE;this.objectModel.selectAll(t,e)}},{key:"isPrimaryPipelineEmpty",value:function(){return this.objectModel.isPrimaryPipelineEmpty()}},{key:"getSelectedObjectIds",value:function(){return this.objectModel.getSelectedObjectIds()}},{key:"getSelectedNodes",value:function(){return this.objectModel.getSelectedNodes()}},{key:"getSelectedComments",value:function(){return this.objectModel.getSelectedComments()}},{key:"getSelectedLinks",value:function(){return this.objectModel.getSelectedLinks()}},{key:"getSelectedObjects",value:function(){return this.objectModel.getSelectedObjects()}},{key:"getSelectedPipelineId",value:function(){return this.objectModel.getSelectedPipelineId()}},{key:"deleteSelectedObjects",value:function(){this.objectModel.deleteSelectedObjects()}},{key:"areSelectedNodesContiguous",value:function(){return this.objectModel.areSelectedNodesContiguous()}},{key:"areAllSelectedObjectsLinks",value:function(){return this.objectModel.areAllSelectedObjectsLinks()}},{key:"areDetachableLinksInUse",value:function(){return this.getCanvasConfig().enableLinkSelection===o.LINK_SELECTION_DETACHABLE}},{key:"isSnapToGridInUse",value:function(){return this.getCanvasConfig().enableSnapToGridType!==o.SNAP_TO_GRID_NONE}},{key:"selectObject",value:function(e,t,n,i){this.objectModel.selectObject(e,t,n,i)}},{key:"setNotificationMessages",value:function(e){this.objectModel.setNotificationMessages(e)}},{key:"clearNotificationMessages",value:function(){this.objectModel.clearNotificationMessages()}},{key:"deleteNotificationMessages",value:function(e){this.objectModel.deleteNotificationMessages(e)}},{key:"getNotificationMessages",value:function(e){return this.objectModel.getNotificationMessages(e)}},{key:"getNotificationMessagesMaxType",value:function(){return this.objectModel.getNotificationMessagesMaxType()}},{key:"moveObjects",value:function(e,t){this.objectModel.getAPIPipeline(t).moveObjects(e)}},{key:"deleteObjects",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteObjects(e)}},{key:"disconnectObjects",value:function(e,t){this.objectModel.getAPIPipeline(t).disconnectObjects(e)}},{key:"deleteObject",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteObject(e)}},{key:"setObjectsStyle",value:function(e,t,n){this.objectModel.setObjectsStyle(e,t,n)}},{key:"setObjectsMultiStyle",value:function(e,t){this.objectModel.setObjectsMultiStyle(e,t)}},{key:"getNodes",value:function(e){return this.objectModel.getAPIPipeline(e).getNodes()}},{key:"createNode",value:function(e,t){return this.objectModel.getAPIPipeline(t).createNode(e)}},{key:"addNode",value:function(e,t){this.objectModel.getAPIPipeline(t).addNode(e)}},{key:"createNodeCommand",value:function(e,t){var n=t||this.getCurrentPipelineId(),i=this.convertNodeTemplate(e.nodeTemplate);this.createNodeFromTemplateAt(i,{x:e.offsetX,y:e.offsetY},n)}},{key:"deleteNode",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteNode(e)}},{key:"setNodeProperties",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeProperties(e,t)}},{key:"setNodeParameters",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeParameters(e,t)}},{key:"setNodeUiParameters",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeUiParameters(e,t)}},{key:"setNodeMessages",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeMessages(e,t)}},{key:"setNodeMessage",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeMessage(e,t)}},{key:"setNodeLabel",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeLabel(e,t)}},{key:"setNodesClassName",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setObjectsClassName(e,t)}},{key:"setNodeDecorations",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeDecorations(e,t)}},{key:"setNodeInputPorts",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeInputPorts(e,t)}},{key:"setNodeOutputPorts",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeOutputPorts(e,t)}},{key:"setNodesMultiDecorations",value:function(e){this.objectModel.setNodesMultiDecorations(e)}},{key:"setInputPortLabel",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setInputPortLabel(e,t,n)}},{key:"setOutputPortLabel",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setOutputPortLabel(e,t,n)}},{key:"getNode",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNode(e)}},{key:"getNodeUiParameters",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeUiParameters(e)}},{key:"getSupernodes",value:function(e){return this.objectModel.getAPIPipeline(e).getSupernodes()}},{key:"getSupernodeObjReferencing",value:function(e){return this.objectModel.getSupernodeObjReferencing(e)}},{key:"getNodeMessages",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeMessages(e)}},{key:"getNodeMessage",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getNodeMessage(e,t)}},{key:"getNodeInputPorts",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeInputPorts(e)}},{key:"getNodeOutputPorts",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeOutputPorts(e)}},{key:"getNodeDecorations",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeDecorations(e)}},{key:"getNodeClassName",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeClassName(e)}},{key:"getNodeStyle",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getNodeStyle(e,t)}},{key:"getBranchNodes",value:function(e,t){var n=t||this.objectModel.getCurrentPipelineId();return this.objectModel.getHighlightObjectIds(n,e,o.HIGHLIGHT_BRANCH)}},{key:"getUpstreamNodes",value:function(e,t){var n=t||this.objectModel.getCurrentPipelineId();return this.objectModel.getHighlightObjectIds(n,e,o.HIGHLIGHT_UPSTREAM)}},{key:"getDownstreamNodes",value:function(e,t){var n=t||this.objectModel.getCurrentPipelineId();return this.objectModel.getHighlightObjectIds(n,e,o.HIGHLIGHT_DOWNSTREAM)}},{key:"addCustomAttrToNodes",value:function(e,t,n){this.objectModel.getAPIPipeline(n).addCustomAttrToNodes(e,t)}},{key:"removeCustomAttrFromNodes",value:function(e,t,n){this.objectModel.getAPIPipeline(n).removeCustomAttrFromNodes(e,t)}},{key:"isSuperNodeExpandedInPlace",value:function(e,t){return this.objectModel.getAPIPipeline(t).isSuperNodeExpandedInPlace(e)}},{key:"setNodeLabelEditingMode",value:function(e,t){this.canvasContents&&this.getSVGCanvasD3().setNodeLabelEditingMode(e,t)}},{key:"setNodeDecorationLabelEditingMode",value:function(e,t,n){this.canvasContents&&this.getSVGCanvasD3().setNodeDecorationLabelEditingMode(e,t,n)}},{key:"getComments",value:function(e){return this.objectModel.getAPIPipeline(e).getComments()}},{key:"getComment",value:function(e,t){return this.objectModel.getAPIPipeline(t).getComment(e)}},{key:"getNewCommentPosition",value:function(e){var t=this.objectModel.getAPIPipeline(e),n=this.getSVGCanvasD3().getDefaultCommentOffset(),i=t.getAdjustedCommentPosition(n);return{x:i.x_pos,y:i.y_pos}}},{key:"createComment",value:function(e,t){this.objectModel.getAPIPipeline(t).createComment(e)}},{key:"addComment",value:function(e,t){this.objectModel.getAPIPipeline(t).addComment(e)}},{key:"editComment",value:function(e,t){this.objectModel.getAPIPipeline(t).editComment(e)}},{key:"setCommentProperties",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setCommentProperties(e,t)}},{key:"setCommentsClassName",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setObjectsClassName(e,t)}},{key:"deleteComment",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteComment(e)}},{key:"addCustomAttrToComments",value:function(e,t,n){this.objectModel.getAPIPipeline(n).addCustomAttrToComments(e,t)}},{key:"removeCustomAttrFromComments",value:function(e,t,n){this.objectModel.getAPIPipeline(n).removeCustomAttrFromComments(e,t)}},{key:"getCommentClassName",value:function(e,t){return this.objectModel.getAPIPipeline(t).getCommentClassName(e)}},{key:"getCommentStyle",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getCommentStyle(e,t)}},{key:"hideComments",value:function(){this.objectModel.hideComments()}},{key:"showComments",value:function(){this.objectModel.showComments()}},{key:"isHidingComments",value:function(){return this.objectModel.isHidingComments()}},{key:"setCommentEditingMode",value:function(e,t){this.canvasContents&&this.getSVGCanvasD3().setCommentEditingMode(e,t)}},{key:"getLink",value:function(e,t){return this.objectModel.getAPIPipeline(t).getLink(e)}},{key:"getLinks",value:function(e){return this.objectModel.getAPIPipeline(e).getLinks()}},{key:"setLinkProperties",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setLinkProperties(e,t)}},{key:"setNodeDataLinkSrcInfo",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setNodeDataLinkSrcInfo(e,t,n)}},{key:"setNodeDataLinkTrgInfo",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setNodeDataLinkTrgInfo(e,t,n)}},{key:"getNodeDataLinkFromInfo",value:function(e,t,n,i,o){return this.objectModel.getAPIPipeline(o).getNodeDataLinkFromInfo(e,t,n,i)}},{key:"getCommentLinkFromInfo",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getCommentLinkFromInfo(e,t)}},{key:"getNodeAssocLinkFromInfo",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getNodeAssocLinkFromInfo(e,t)}},{key:"addLinks",value:function(e,t){this.objectModel.getAPIPipeline(t).addLinks(e)}},{key:"setLinks",value:function(e,t){this.objectModel.getAPIPipeline(t).setLinks(e)}},{key:"deleteLink",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteLink(e)}},{key:"createNodeLinks",value:function(e,t){return this.objectModel.getAPIPipeline(t).createNodeLinks(e)}},{key:"createCommentLinks",value:function(e,t){return this.objectModel.getAPIPipeline(t).createCommentLinks(e)}},{key:"setLinksClassName",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setLinksClassName(e,t)}},{key:"setLinksStyle",value:function(e,t,n){this.objectModel.setLinksStyle(e,t,n)}},{key:"setLinksMultiStyle",value:function(e,t){this.objectModel.setLinksMultiStyle(e,t)}},{key:"getLinkClassName",value:function(e,t){return this.objectModel.getAPIPipeline(t).getLinkClassName(e)}},{key:"getLinkStyle",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getLinkStyle(e,t)}},{key:"setLinkDecorations",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setLinkDecorations(e,t)}},{key:"setLinksMultiDecorations",value:function(e){this.objectModel.setLinksMultiDecorations(e)}},{key:"getLinkDecorations",value:function(e,t){return this.objectModel.getAPIPipeline(t).getLinkDecorations(e)}},{key:"setLinkDecorationLabelEditingMode",value:function(e,t,n){this.canvasContents&&this.getSVGCanvasD3().setLinkDecorationLabelEditingMode(e,t,n)}},{key:"getCommandStack",value:function(){return this.commandStack}},{key:"undo",value:function(){this.canUndo()&&this.getCommandStack().undo()}},{key:"redo",value:function(){this.canRedo()&&this.getCommandStack().redo()}},{key:"canUndo",value:function(){return this.getCommandStack().canUndo()}},{key:"canRedo",value:function(){return this.getCommandStack().canRedo()}},{key:"getUndoLabel",value:function(){if(this.canUndo()){var e=this.getCommandStack().getUndoCommand();if(e&&e.getLabel)return e.getLabel()}return""}},{key:"getRedoLabel",value:function(){if(this.canRedo()){var e=this.getCommandStack().getRedoCommand();if(e&&e.getLabel)return e.getLabel()}return""}},{key:"getBreadcrumbs",value:function(){return this.objectModel.getBreadcrumbs()}},{key:"getCurrentBreadcrumb",value:function(){return this.objectModel.getCurrentBreadcrumb()}},{key:"createBreadcrumb",value:function(e,t){return this.objectModel.createBreadcrumb(e,t)}},{key:"setHighlightStyle",value:function(e,t){this.removeAllStyles(!0);var n={body:{default:"fill: ".concat(o.HIGHLIGHT_FILL," ;stroke: ").concat(o.HIGHLIGHT_STROKE,";"),hover:"fill: ".concat(o.HIGHLIGHT_HOVER_FILL,";")}},i={line:{default:"stroke: ".concat(o.HIGHLIGHT_STROKE,";"),hover:"stroke-width: ".concat(o.HIGHLIGHT_STROKE_WIDTH)}};this.setObjectsStyle(e.nodes,n,!0,!1),this.setLinksStyle(e.links,i,!0,!1),this.highlight=!0}},{key:"highlightBranch",value:function(e,t){var n=this.objectModel.getHighlightObjectIds(t,e,o.HIGHLIGHT_BRANCH);return this.setHighlightStyle(n,t),n}},{key:"highlightUpstream",value:function(e,t){var n=this.objectModel.getHighlightObjectIds(t,e,o.HIGHLIGHT_UPSTREAM);return this.setHighlightStyle(n,t),n}},{key:"highlightDownstream",value:function(e,t){var n=this.objectModel.getHighlightObjectIds(t,e,o.HIGHLIGHT_DOWNSTREAM);return this.setHighlightStyle(n,t),n}},{key:"isHighlighted",value:function(){return this.highlight}},{key:"getLoggingState",value:function(){return a.Logger.getLoggingState()}},{key:"setLoggingState",value:function(e){a.Logger.setLoggingState(e)}},{key:"log",value:function(e){new a.Logger("Host App").log(e)}},{key:"addAfterUpdateCallback",value:function(e){this.canvasContents&&this.canvasContents.addAfterUpdateCallback(e)}},{key:"removeAfterUpdateCallback",value:function(e){this.canvasContents&&this.canvasContents.removeAfterUpdateCallback(e)}},{key:"togglePalette",value:function(){this.getObjectModel().togglePalette()}},{key:"openPalette",value:function(){this.getObjectModel().openPalette()}},{key:"closePalette",value:function(){this.getObjectModel().closePalette()}},{key:"isPaletteOpen",value:function(){return this.getObjectModel().isPaletteOpen()}},{key:"openContextMenu",value:function(e,t){this.objectModel.openContextMenu(e,t)}},{key:"isBottomPanelOpen",value:function(){return this.getObjectModel().isBottomPanelOpen()}},{key:"setBottomPanelHeight",value:function(e){this.objectModel.setBottomPanelHeight(e)}},{key:"isTopPanelOpen",value:function(){return this.getObjectModel().isTopPanelOpen()}},{key:"closeContextMenu",value:function(){this.objectModel.closeContextMenu()}},{key:"isContextMenuDisplayed",value:function(){return this.objectModel.isContextMenuDisplayed()}},{key:"getContextMenuSource",value:function(){return this.objectModel.getContextMenuSource()}},{key:"closeContextToolbar",value:function(){this.mouseInContextToolbar||this.mouseInObject||this.objectModel.closeContextMenu()}},{key:"setMouseInContextToolbar",value:function(e){this.mouseInContextToolbar=e}},{key:"setMouseInObject",value:function(e){this.mouseInObject=e}},{key:"openNotificationPanel",value:function(){this.objectModel.openNotificationPanel()}},{key:"closeNotificationPanel",value:function(){this.objectModel.closeNotificationPanel()}},{key:"toggleNotificationPanel",value:function(){this.objectModel.toggleNotificationPanel()}},{key:"isRightFlyoutOpen",value:function(){return this.objectModel.isRightFlyoutOpen()}},{key:"displaySubPipeline",value:function(e){var t=this.objectModel.getBreadcrumbs(),n=t.findIndex((function(t){return t.pipelineId===e}));if(n>-1){var i={editType:"displaySubPipeline",editSource:"canvas",targetObject:this.getSupernodeFromBreadcrumb(t[n]),breadcrumbIndex:n};this.editActionHandler(i)}}},{key:"displaySubPipelineForSupernode",value:function(e,t){var n=this.getNode(e,t);if(n&&n.type===o.SUPER_NODE){var i=this.objectModel.getCurrentBreadcrumb(),r=this.objectModel.createBreadcrumb(n,i.pipelineId);this.displaySubPipelineForBreadcrumbs([r])}}},{key:"displaySubPipelineForBreadcrumbs",value:function(e){var t=e[e.length-1],n={editType:"displaySubPipeline",editSource:"canvas",targetObject:this.getSupernodeFromBreadcrumb(t),addBreadcrumbs:e};this.editActionHandler(n)}},{key:"getSupernodeFromBreadcrumb",value:function(e){return e.supernodeParentPipelineId?this.objectModel.getAPIPipeline(e.supernodeParentPipelineId).getNode(e.supernodeId):null}},{key:"displayPreviousPipeline",value:function(){var e={editType:"displayPreviousPipeline",pipelineInfo:this.objectModel.getPreviousBreadcrumb(),editSource:"canvas"};this.editActionHandler(e)}},{key:"zoomIn",value:function(){this.canvasContents&&this.getSVGCanvasD3().zoomIn()}},{key:"zoomOut",value:function(){this.canvasContents&&this.getSVGCanvasD3().zoomOut()}},{key:"zoomToFit",value:function(){this.canvasContents&&this.getSVGCanvasD3().zoomToFit()}},{key:"zoomTo",value:function(e){this.canvasContents&&this.getSVGCanvasD3().zoomTo(e)}},{key:"translateBy",value:function(e,t,n){this.canvasContents&&this.getSVGCanvasD3().translateBy(e,t,n)}},{key:"getZoom",value:function(){return this.canvasContents?this.getSVGCanvasD3().getZoom():null}},{key:"getZoomToReveal",value:function(e,t,n){return this.canvasContents?this.getSVGCanvasD3().getZoomToReveal(e,t,n):null}},{key:"clearSavedZoomValues",value:function(){this.objectModel.clearSavedZoomValues()}},{key:"getGhostNode",value:function(e){if(this.canvasContents){var t=this.convertNodeTemplate(e);return t=this.objectModel.setNodeAttributes(t),this.getSVGCanvasD3().getGhostNode(t)}return null}},{key:"nodeTemplateDragStart",value:function(e){n.dragNodeTemplate=e,this.canvasContents&&this.getSVGCanvasD3().nodeTemplateDragStart(n.dragNodeTemplate)}},{key:"nodeTemplateDragEnd",value:function(){this.canvasContents&&n.dragNodeTemplate&&this.getSVGCanvasD3().nodeTemplateDragEnd(n.dragNodeTemplate),n.dragNodeTemplate=null}},{key:"getDragNodeTemplate",value:function(){return n.dragNodeTemplate}},{key:"cutToClipboard",value:function(){this.editActionHandler({editType:"cut",editSource:"api"})}},{key:"copyToClipboard",value:function(){this.editActionHandler({editType:"copy",editSource:"api"})}},{key:"pasteFromClipboard",value:function(e){this.editActionHandler({editType:"paste",editSource:"api",pipelineId:e})}},{key:"isClipboardEmpty",value:function(){return this.objectModel.isClipboardEmpty()}},{key:"canPaste",value:function(){return!this.isClipboardEmpty()}},{key:"canCutCopy",value:function(){return this.getSelectedObjectIds().length>0&&!(this.areAllSelectedObjectsLinks()&&!this.areDetachableLinksInUse())}},{key:"canDelete",value:function(){return this.getSelectedObjectIds().length>0}},{key:"canZoomIn",value:function(){return!this.isPrimaryPipelineEmpty()&&(!this.getSVGCanvasD3()||!this.getSVGCanvasD3().isZoomedToMax())}},{key:"canZoomOut",value:function(){return!this.isPrimaryPipelineEmpty()&&(!this.getSVGCanvasD3()||!this.getSVGCanvasD3().isZoomedToMin())}},{key:"canZoomToFit",value:function(){return!this.isPrimaryPipelineEmpty()}},{key:"getSavedZoom",value:function(e){return this.objectModel.getSavedZoom(e)}},{key:"openTip",value:function(e){if(!this.isTipOpen()&&this.isTipEnabled(e.type)){if(this.handlers.tipHandler){var t={};switch(e.type){case o.TIP_TYPE_PALETTE_ITEM:t.nodeTemplate=e.nodeTemplate;break;case o.TIP_TYPE_PALETTE_CATEGORY:t.category=e.category;break;case o.TIP_TYPE_NODE:t.pipelineId=e.pipelineId,t.node=e.node;break;case o.TIP_TYPE_PORT:t.pipelineId=e.pipelineId,t.node=e.node,t.port=e.port;break;case o.TIP_TYPE_DEC:t.pipelineId=e.pipelineId,t.decoration=e.decoration;break;case o.TIP_TYPE_LINK:t.pipelineId=e.pipelineId,t.link=e.link;break;case o.TIP_TYPE_STATE_TAG:t.stateTagText=e.stateTagText,t.stateTagType=e.stateTagType}e.customContent=this.handlers.tipHandler(e.type,t)}var n=this;this.pendingTooltip&&clearTimeout(this.pendingTooltip),this.pendingTooltip=setTimeout((function(){n.objectModel.setTooltipDef(e)}),e.delay?e.delay:200)}}},{key:"closeTip",value:function(){this.pendingTooltip&&clearTimeout(this.pendingTooltip),this.isTipOpen()&&this.objectModel.setTooltipDef({})}},{key:"isTipOpen",value:function(){return this.objectModel.isTooltipOpen()}},{key:"isTipEnabled",value:function(e){var n=this.getCanvasConfig();switch(e){case o.TIP_TYPE_PALETTE_CATEGORY:return!0===n.tipConfig.palette||t.get_1(n,"tipConfig.palette.categories",!1);case o.TIP_TYPE_PALETTE_ITEM:return!0===n.tipConfig.palette||t.get_1(n,"tipConfig.palette.nodeTemplates",!1);case o.TIP_TYPE_NODE:return n.tipConfig.nodes;case o.TIP_TYPE_PORT:return n.tipConfig.ports;case o.TIP_TYPE_DEC:return n.tipConfig.decorations;case o.TIP_TYPE_LINK:return n.tipConfig.links;case o.TIP_TYPE_STATE_TAG:return n.tipConfig.stateTag;default:return!1}}},{key:"openTextToolbar",value:function(e,t,n,i){this.objectModel.setTextToolbarDef({isOpen:!0,pos_x:e,pos_y:t,actionHandler:n,blurHandler:i})}},{key:"closeTextToolbar",value:function(){this.objectModel.setTextToolbarDef({isOpen:!1})}},{key:"moveTextToolbar",value:function(e,t){this.objectModel.setTextToolbarDef({pos_x:e,pos_y:t})}},{key:"createDroppedExternalObject",value:function(e,t,n){e&&("createFromObject"===e.operation?this.createNodeFromObjectAt(e.sourceId,e.sourceObjectTypeId,e.label,t.x,t.y,n):this.createNodeFromDataAt(t.x,t.y,e,n))}},{key:"createAutoNode",value:function(e){var t=this.objectModel.getSelectionAPIPipeline(),n={editType:"createAutoNode",editSource:"canvas",nodeTemplate:e,pipelineId:(t||this.objectModel.getAPIPipeline()).pipelineId};this.editActionHandler(n)}},{key:"createNodeFromTemplateAt",value:function(e,t,n){var i={editType:"createNode",editSource:"canvas",nodeTemplate:e,offsetX:t.x,offsetY:t.y,pipelineId:n};this.editActionHandler(i)}},{key:"createNodeFromTemplateOnLinkAt",value:function(e,t,n,i){if(this.canNewNodeBeDroppedOnLink(e)){var o={editType:"createNodeOnLink",editSource:"canvas",nodeTemplate:e,offsetX:n.x,offsetY:n.y,link:t,pipelineId:i};this.editActionHandler(o)}}},{key:"createNodeFromTemplateAttachLinks",value:function(e,t,n,i){if(t&&this.canNewNodeBeAttachedToLinks(e)){var o={editType:"createNodeAttachLinks",editSource:"canvas",nodeTemplate:e,offsetX:n.x,offsetY:n.y,detachedLinks:t,pipelineId:i};this.editActionHandler(o)}}},{key:"createNodeFromObjectAt",value:function(e,t,n,i,o,r){var a={editType:"createNode",editSource:"canvas",label:n,offsetX:i,offsetY:o,sourceObjectId:e,sourceObjectTypeId:t,pipelineId:r};this.editActionHandler(a)}},{key:"createNodeFromDataAt",value:function(e,t,n,i){var o=n.data;o.offsetX=e,o.offsetY=t,o.pipelineId=i,o.editSource="canvas",this.editActionHandler(o)}},{key:"canNewNodeBeDroppedOnLink",value:function(e){return!!(e.inputs&&e.inputs.length>0&&e.outputs&&e.outputs.length>0)}},{key:"canNewNodeBeAttachedToLinks",value:function(e){return!!(e.inputs&&e.inputs.length>0||e.outputs&&e.outputs.length>0)}},{key:"isContextMenuForNonSelectedObj",value:function(e){return!(!this.getCanvasConfig().enableContextToolbar||!e.targetObject)&&!e.selectedObjectIds.includes(e.targetObject.id)}},{key:"contextMenuHandler",value:function(e){var t=function(e,t){pn=t;var n,i=yn(e);if("function"==typeof pn.handlers.contextMenuHandler){var o=pn.handlers.contextMenuHandler(e,i);o&&o.length>0&&(n=o)}else n=i;return n&&n.length>0&&!1===pn.getCanvasConfig().enableEditingActions&&(n=fn(n)),n&&n.length>0&&(n=hn(n)),n}(e,this);t&&t.length>0&&this.openContextMenu(t,e)}},{key:"contextMenuActionHandler",value:function(e,t){var n=this.getContextMenuSource();this.logger.log("contextMenuActionHandler - action: "+e),this.logger.log(n),this.closeContextMenu(),this.getCanvasConfig().enableContextToolbar&&this.isContextMenuForNonSelectedObj(n)&&this.setSelections([n.targetObject.id]),this.canvasContents.focusOnCanvas();var i=Object.assign({},n,{editType:e,editParam:t,editSource:"contextmenu"});this.editActionHandler(i)}},{key:"toolbarActionHandler",value:function(e){this.logger.log("toolbarActionHandler - action: "+e),this.editActionHandler({editType:e,editSource:"toolbar",pipelineId:this.objectModel.getSelectedPipelineId()})}},{key:"keyboardActionHandler",value:function(e,t){this.logger.log("keyboardActionHandler - action: "+e),this.editActionHandler({editType:e,editSource:"keyboard",pipelineId:this.objectModel.getSelectedPipelineId(),mousePos:t})}},{key:"clickActionHandler",value:function(e){this.logger.log("clickActionHandler - "+e.clickType+" on "+e.objectType),this.handlers.clickActionHandler&&this.handlers.clickActionHandler(e)}},{key:"decorationActionHandler",value:function(e,t,n){this.logger.log("decorationActionHandler - node: "+e.id+" id: "+t),this.handlers.decorationActionHandler&&this.handlers.decorationActionHandler(e,t,n)}},{key:"editActionHandler",value:function(e){this.logger.log("editActionHandler - "+e.editType),this.logger.log(e);var t=e;if(t.selectedObjectIds=this.getSelectedObjectIds(),t.selectedObjects=this.getSelectedObjects(),"createSuperNodeExternal"===t.editType||"convertSuperNodeLocalToExternal"===t.editType?(t.externalUrl="",t.externalPipelineFlowId=""):"loadPipelineFlow"!==t.editType&&"expandSuperNodeInPlace"!==t.editType&&"displaySubPipeline"!==t.editType&&"deconstructSuperNode"!==t.editType&&"convertSuperNodeExternalToLocal"!==t.editType||(t=this.preProcessForExternalPipelines(t)),this.handlers.beforeEditActionHandler){var n=null;if("undo"===t.editType?n=this.getCommandStack().getUndoCommand():"redo"===t.editType&&(n=this.getCommandStack().getRedoCommand()),!(t=this.handlers.beforeEditActionHandler(t,n)))return;if(!this.wasExtPipelineFlowLoadSuccessful(t))return}this.editAction(t)}},{key:"editAction",value:function(e){var t=e;if("deleteSelectedObjects"!==t.editType||0!==t.selectedObjectIds.length){switch(t.editType){case"selectAll":this.selectAll(t.pipelineId);break;case"zoomIn":this.zoomIn();break;case"zoomOut":this.zoomOut();break;case"zoomToFit":this.zoomToFit();break;case"commentsHide":this.hideComments();break;case"commentsShow":this.showComments();break;case"setCommentEditingMode":this.setCommentEditingMode(t.id,t.pipelineId);break;case"setNodeLabelEditingMode":this.setNodeLabelEditingMode(t.id,t.pipelineId);break;case"setZoom":this.objectModel.setZoom(t.zoom,t.pipelineId);break;case"togglePalette":this.togglePalette();break;case"paletteOpen":this.openPalette();break;case"paletteClose":this.closePalette();break;case"toggleNotificationPanel":this.toggleNotificationPanel();break;case"loadPipelineFlow":this.objectModel.ensurePipelineIsLoaded(t)}var n=null;if(this.getCanvasConfig().enableInternalObjectModel)switch(t.editType){case"createNode":n=new G(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createNodeOnLink":n=new K(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createNodeAttachLinks":n=new X(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createAutoNode":var i=this.getCanvasConfig().enableAutoLinkOnlyFromSelNodes;n=new M(t,this.objectModel,this.labelUtil,i),this.commandStack.do(n),this.panToReveal(t),t=n.getData();break;case"createComment":n=new U(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"createAutoComment":var r=this.getNewCommentPosition(t.pipelineId);n=new U(t,this.objectModel,this.labelUtil,r),this.commandStack.do(n),t=n.getData();break;case"insertNodeIntoLink":n=new Oe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"attachNodeToLinks":n=new T(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"moveObjects":n=new je(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"resizeObjects":n=new un(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"setObjectsStyle":n=new Fe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"setLinksStyle":n=new He(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"updateLink":n=new qe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"setNodeLabel":n=new Ie(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"editComment":n=new ve(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"editDecorationLabel":n=new Pe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"linkNodes":n=new V(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"linkNodesAndReplace":n=new V(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"linkComment":n=new B(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createDetachedLink":n=new $(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"colorSelectedObjects":n=new re(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"deleteSelectedObjects":n=new ue(t,this.objectModel,this.labelUtil,this.areDetachableLinksInUse()),this.commandStack.do(n);break;case"displaySubPipeline":n=new me(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"displayPreviousPipeline":n=new ge(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"arrangeHorizontally":n=new C(t,this.objectModel,this.labelUtil,o.HORIZONTAL),this.commandStack.do(n);break;case"arrangeVertically":n=new C(t,this.objectModel,this.labelUtil,o.VERTICAL),this.commandStack.do(n);break;case"createSuperNode":case"createSuperNodeExternal":n=new te(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableUseCardFromOriginalPorts),this.commandStack.do(n);break;case"deconstructSuperNode":n=new se(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableMoveNodesOnSupernodeResize),this.commandStack.do(n);break;case"expandSuperNodeInPlace":n=new Ee(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableMoveNodesOnSupernodeResize),this.commandStack.do(n);break;case"collapseSuperNodeInPlace":n=new ie(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableMoveNodesOnSupernodeResize),this.commandStack.do(n);break;case"convertSuperNodeExternalToLocal":n=new L(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"convertSuperNodeLocalToExternal":n=new x(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"deleteLink":n=new ce(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"disconnectNode":n=new fe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"saveToPalette":n=new Ae(t,this.objectModel,this.labelUtil,this.labelUtil),this.commandStack.do(n);break;case"cut":this.objectModel.copyToClipboard(this.areDetachableLinksInUse()),n=new ue(t,this.objectModel,this.labelUtil,this.areDetachableLinksInUse()),this.commandStack.do(n);break;case"copy":this.objectModel.copyToClipboard(this.areDetachableLinksInUse());break;case"paste":var a=this.objectModel.getObjectsToPaste();if(a){t.objects=a;var s=this.getSVGCanvasD3().getTransformedViewportDimensions();n=new we(t,this.objectModel,this.labelUtil,s,this.areDetachableLinksInUse(),this.isSnapToGridInUse()),this.commandStack.do(n),t=n.getData()}break;case"undo":n=this.getCommandStack().getUndoCommand(),this.commandStack.undo();break;case"redo":n=this.getCommandStack().getRedoCommand(),this.commandStack.redo();break;case"highlightBranch":t.highlightedObjectIds=this.highlightBranch(this.objectModel.getSelectedNodesIds(),t.pipelineId);break;case"highlightDownstream":t.highlightedObjectIds=this.highlightDownstream(this.objectModel.getSelectedNodesIds(),t.pipelineId);break;case"highlightUpstream":t.highlightedObjectIds=this.highlightUpstream(this.objectModel.getSelectedNodesIds(),t.pipelineId);break;case"unhighlight":this.removeAllStyles(!0),this.highlight=!1;break;case"openNotificationPanel":this.openNotificationPanel();break;case"closeNotificationPanel":this.closeNotificationPanel()}this.handlers.editActionHandler&&this.handlers.editActionHandler(t,n),this.ensureVisibleExpandedPipelinesAreLoaded()}}},{key:"preProcessForExternalPipelines",value:function(e){if(e.externalPipelineFlowLoad=!1,e.targetObject){var n=t.get_1(e,"targetObject.subflow_ref.url");n&&(e.externalUrl=n,e.externalPipelineFlow=this.objectModel.getExternalPipelineFlow(n),e.externalPipelineFlow||(e.externalPipelineFlowLoad=!0))}return e}},{key:"ensureVisibleExpandedPipelinesAreLoaded",value:function(){var e=this.objectModel.getVisibleExpandedExternalSupernodes();e&&e.length>0&&this.editActionHandler({editType:"loadPipelineFlow",targetObject:e[0]})}},{key:"wasExtPipelineFlowLoadSuccessful",value:function(e){if(e.externalPipelineFlowLoad&&!e.externalPipelineFlow){var t="The host app did not provide a pipeline flow when requested for action "+e.editType+" in beforeEditActionHandler, for URL: "+e.externalUrl;return this.logger.error(t),!1}return!0}},{key:"panToReveal",value:function(e){var t=this;this.addAfterUpdateCallback((function n(){var i=t.getZoomToReveal([e.newNode.id]);i&&t.zoomTo(i),t.removeAfterUpdateCallback(n)}))}}]),n}();kn.dragNodeTemplate=null,exports.CanvasController=kn,exports.CanvasUtils=h,exports.CanvasUtils$1=S,exports._castFunction=y,exports.defaultMessages1=u;
|
|
2
|
-
//# sourceMappingURL=canvas-controller-
|
|
1
|
+
"use strict";var e=require("./createClass-09bc08f7.js"),t=require("./isArrayLikeObject-0cd02b77.js"),n=require("./getPrototypeOf-5f227292.js"),i=require("./datarecord-metadata-v3-schema-531c7b07.js"),o=require("./canvas-constants-85883d4c.js"),r=require("./lib/command-stack.js"),a=require("./canvas-logger-34ca361a.js"),s=require("uuid"),d=require("redux"),c=require("jsonschema"),l=require("@elyra/pipeline-schemas"),u={"menu.highlightBranch":"Highlight branch","menu.highlightUpstream":"Highlight upstream","menu.highlightDownstream":"Highlight downstream","menu.unhighlight":"Unhighlight","menu.highlight":"Highlight","edit.cutSelection":"Cut","edit.copySelection":"Copy","edit.pasteSelection":"Paste","canvas.label":"Canvas","canvas.addComment":"New comment","canvas.selectAll":"Select all","canvas.undo":"Undo","canvas.redo":"Redo","canvas.undoCommand":"Undo: {undo_command}","canvas.redoCommand":"Redo: {redo_command}","canvas.deleteObject":"Delete","canvas.flowIsEmpty":"Your flow is empty.","canvas.addNodeToStart":"Get started by adding a node.","canvas.stateTagLocked":"Locked","canvas.stateTagReadOnly":"Read-only","canvas.stateTagTipLocked":"This flow is locked and cannot be edited.","canvas.stateTagTipReadOnly":"This flow cannot be edited.","comment.colorBackground":"Color background","comment.editComment":"Edit comment","node.createSupernode":"Create supernode","node.createSupernodeExternal":"Create external supernode","node.expandSupernode":"Expand supernode","node.displaySupernodeFullPage":"Display full page","node.collapseSupernodeInPlace":"Collapse supernode","node.deconstructSupernode":"Deconstruct supernode","node.convertSupernodeExternalToLocal":"Convert external to local","node.convertSupernodeLocalToExternal":"Convert local to external","node.renameNode":"Rename","canvas.validateFlow":"Validate Flow","node.editNode":"Open","node.editMenu":"Edit","node.disconnectNode":"Disconnect","node.saveToPalette":"Save to palette","link.deleteLink":"Delete","texttoolbar.headerAction":"Header","texttoolbar.boldAction":"Bold","texttoolbar.italicsAction":"Italics","texttoolbar.strikethroughAction":"Strikethrough","texttoolbar.codeAction":"Code","texttoolbar.linkAction":"Link","texttoolbar.quoteAction":"Quote","texttoolbar.bulletedListAction":"Bulleted List","texttoolbar.numberedListAction":"Numbered List","texttoolbar.titleAction":"Title","texttoolbar.subheaderAction":"Subheader","texttoolbar.bodyAction":"Body"};function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var h=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"getObjectPositions",value:function(e){var t={};return e.forEach((function(e){t[e.id]={x_pos:e.x_pos,y_pos:e.y_pos}})),t}},{key:"getLinkPositions",value:function(e){var t={};return e.forEach((function(e){e.srcPos&&(i.set_1(t[e.id],"srcPos.x_pos",e.srcPos.x_pos),i.set_1(t[e.id],"srcPos.y_pos",e.srcPos.y_pos)),e.trgPos&&(t[e.id]||(t[e.id]={}),i.set_1(t[e.id],"trgPos.x_pos",e.trgPos.x_pos),i.set_1(t[e.id],"trgPos.y_pos",e.trgPos.y_pos))})),t}},{key:"moveSurroundingObjects",value:function(e,t,n,i,o,r){var a=this,s={},d=i-e.width,c=o-e.height,l=e.x_pos+e.width/2,u=e.y_pos+e.height/2;return t.forEach((function(t){if(t.id!==e.id){var i=a.getMoveDeltas(t.x_pos+t.width/2,t.y_pos+t.height/2,n,l,u,d,c);0===i.xDelta&&0===i.yDelta||(s[t.id]={id:t.id,x_pos:t.x_pos+i.xDelta,y_pos:t.y_pos+i.yDelta,width:t.width,height:t.height},r&&(t.x_pos+=i.xDelta,t.y_pos+=i.yDelta))}})),s}},{key:"moveSurroundingDetachedLinks",value:function(e,t,n,o,r,a){var s=this,d={},c=o-e.width,l=r-e.height,u=e.x_pos+e.width/2,p=e.y_pos+e.height/2;return t.forEach((function(e){if(e.srcPos){var t=s.getMoveDeltas(e.srcPos.x_pos,e.srcPos.y_pos,n,u,p,c,l);0===t.xDelta&&0===t.yDelta||(d[e.id]||(d[e.id]={id:e.id}),i.set_1(d[e.id],"srcPos.x_pos",e.srcPos.x_pos+t.xDelta),i.set_1(d[e.id],"srcPos.y_pos",e.srcPos.y_pos+t.yDelta),a&&(e.srcPos.x_pos+=t.xDelta,e.srcPos.y_pos+=t.yDelta))}if(e.trgPos){var o=s.getMoveDeltas(e.trgPos.x_pos,e.trgPos.y_pos,n,u,p,c,l);0===o.xDelta&&0===o.yDelta||(d[e.id]||(d[e.id]={id:e.id}),i.set_1(d[e.id],"trgPos.x_pos",e.trgPos.x_pos+o.xDelta),i.set_1(d[e.id],"trgPos.y_pos",e.trgPos.y_pos+o.yDelta)),a&&(e.trgPos.x_pos+=o.xDelta,e.trgPos.y_pos+=o.yDelta)}})),d}},{key:"getMoveDeltas",value:function(e,t,n,i,o,r,a){var s=0,d=0;return n.indexOf("n")>-1&&t<o-20?d=-a:n.indexOf("s")>-1&&t>o+20&&(d=a),n.indexOf("w")>-1&&e<i-20?s=-r:n.indexOf("e")>-1&&e>i+20&&(s=r),{xDelta:s,yDelta:d}}},{key:"getSupernodeExpandedWidth",value:function(e,t){return e.expanded_width?e.expanded_width:Math.max(t.supernodeDefaultWidth,e.width)}},{key:"getSupernodeExpandedHeight",value:function(e,t){return e.expanded_height?e.expanded_height:Math.max(t.supernodeDefaultHeight,e.height)}},{key:"getNodePaddingToTargetNodes",value:function(e,t,n,i){var o=0;if("Elbow"===i){var r=this.getCountOfLinksToTargetNodes(e,t,n)*e.layout.minInitialLineIncrement;o=e.layout.minInitialLine+e.layout.minFinalLine+r}else o=2*e.layout.minInitialLine;return o}},{key:"getCountOfLinksToTargetNodes",value:function(e,t,n){var i=this,o=0;return e.outputs&&e.outputs.length>0&&e.outputs.forEach((function(r){i.isNodeOutputLinkedToTargetNodes(e,r,t,n)&&o++})),o}},{key:"isNodeOutputLinkedToTargetNodes",value:function(e,t,n,i){var o=this,r=!1;return i.forEach((function(i){i.srcNodeId===e.id&&i.srcNodePortId===t.id&&o.isTargetNode(i.trgNodeId,n)&&(r=!0)})),r}},{key:"isTargetNode",value:function(e,t){return t.findIndex((function(t){return t.id===e}))>-1}},{key:"getCombinedDecorations",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.map((function(e){var n=t.find((function(t){return t.id===e.id}));return n?Object.assign({},e,n):e}));return t&&t.forEach((function(t){-1===e.findIndex((function(e){return e.id===t.id}))&&n.push(t)})),n}},{key:"isCmndCtrlPressed",value:function(e){return this.isMacintosh()?e.metaKey:e.ctrlKey}},{key:"isMacintosh",value:function(){return navigator.platform.indexOf("Mac")>-1}},{key:"stopPropagationAndPreventDefault",value:function(e){e.stopPropagation(),e.preventDefault()}},{key:"snapToGrid",value:function(e,t){var n=e/t,i=Math.trunc(n);return n-i>.5&&i++,i*t}},{key:"getOuterCoord",value:function(e,t,n,i,o,r,a,s,d){var c,l,u=t-o,p=e-o,f=e+n+o,h=t+i+o,g=a-u,y=r-p,m=h-a,_=r-s,v=a-d;if(0===_)c=r,l=d<a?u:h;else if(s>r){var b=v/_;b<g/(r-f)?(c=r-g/b,l=u):b>(a-h)/(r-f)?(c=r+m/b,l=h):(c=f,l=a+(f-r)*b)}else{var P=v/_;P>g/y?(c=r-g/P,l=u):P<(a-h)/y?(c=r+m/P,l=h):(c=p,l=a-y*P)}return{x:c,y:l,originX:r,originY:a}}},{key:"getDir",value:function(e,t,n,i,r,a,s,d){var c=t+i,l=a-t,u=r-e,p=r-s,f=a-d,h="";if(0===p)h=d<a?o.NORTH:o.SOUTH;else if(s>r){var g=e+n,y=(a-c)/(r-g),m=f/p;h=m<l/(r-g)?o.NORTH:m>y?o.SOUTH:o.EAST}else{var _=(a-c)/u,v=f/p;h=v>l/u?o.NORTH:v<_?o.SOUTH:o.WEST}return h}},{key:"lineIntersectRectangle",value:function(e,t,n,i,o,r,a,s){var d=this.lineInside(e,t,n,i,o,r,a,s),c=this.linesIntersect(e,t,n,i,o,r,a,r),l=this.linesIntersect(e,t,n,i,o,r,o,s),u=this.linesIntersect(e,t,n,i,a,r,a,s),p=this.linesIntersect(e,t,n,i,o,s,a,s);return d||c||l||u||p}},{key:"lineInside",value:function(e,t,n,i,o,r,a,s){return e>=o&&e<=a&&t>=r&&t<=s&&n>=o&&n<=a&&i>=r&&i<=s}},{key:"linesIntersect",value:function(e,t,n,i,o,r,a,s){var d=((a-o)*(t-r)-(s-r)*(e-o))/((s-r)*(n-e)-(a-o)*(i-t)),c=((n-e)*(t-r)-(i-t)*(e-o))/((s-r)*(n-e)-(a-o)*(i-t));return d>=0&&d<=1&&c>=0&&c<=1?{x:e+d*(n-e),y:t+d*(i-t)}:null}},{key:"isConnectionAllowed",value:function(e,t,n,i,r,a){return a===o.ASSOCIATION_LINK?this.isAssocConnectionAllowed(n,i,r):this.isDataConnectionAllowed(e,t,n,i,r)}},{key:"isConnectionAllowedWithDetachedLinks",value:function(e,t,n,i,o){return(!n||!i||n.id!==i.id)&&!(n&&i&&this.linkAlreadyExists(e,t,n,i,o))}},{key:"isSrcConnectionAllowedWithDetachedLinks",value:function(e,t,n){return!(t&&!this.doesNodeHaveOutputPorts(t))&&(!t||!this.isSrcCardinalityAtMax(e,t,n))}},{key:"isTrgConnectionAllowedWithDetachedLinks",value:function(e,t,n){return!(t&&!this.doesNodeHaveInputPorts(t))&&(!t||!this.isTrgCardinalityAtMax(e,t,n))}},{key:"doesNodeHaveInputPorts",value:function(e){return e.inputs&&e.inputs.length>0}},{key:"doesNodeHaveOutputPorts",value:function(e){return e.outputs&&e.outputs.length>0}},{key:"isDataLinkReplacementAllowed",value:function(e,t,n,i,o){return!!this.isDataConnectionAllowedNoCardinality(e,t,n,i,o)&&(1===this.getMaxCardinality(t,i.inputs)&&!!this.isTrgCardinalityAtMax(t,i,o))}},{key:"isDataConnectionAllowed",value:function(e,t,n,i,o){return!!this.isDataConnectionAllowedNoCardinality(e,t,n,i,o)&&!this.isCardinalityAtMax(e,t,n,i,o)}},{key:"isDataConnectionAllowedNoCardinality",value:function(e,t,n,i,o){return!(!n||!i)&&(n.id!==i.id&&(!!this.doesNodeHaveInputPorts(i)&&!this.linkAlreadyExists(e,t,n,i,o)))}},{key:"isAssocConnectionAllowed",value:function(e,t,n){return!(!e||!t)&&e.id!==t.id}},{key:"isSrcNodeAvailable",value:function(e,t,n,i){return!(!t||t.id!==e.id)||!!this.doesNodeHaveOutputPorts(e)&&!this.areAllSrcNodePortsCardinalityAtMax(e,i)}},{key:"isTrgNodeAvailable",value:function(e,t,n,i){return!(!t||t.id!==e.id)||!!this.doesNodeHaveInputPorts(e)&&!this.areAllTrgNodePortsCardinalityAtMax(e,i)}},{key:"linkAlreadyExists",value:function(e,t,n,i,o){var r=!1;return o.forEach((function(o){o.srcNodeId!==n.id||o.srcNodePortId&&o.srcNodePortId!==e||o.trgNodeId!==i.id||o.trgNodePortId&&o.trgNodePortId!==t||(r=!0)})),r}},{key:"areAllSrcNodePortsCardinalityAtMax",value:function(e,t){var n=this;return!(!e||!e.outputs)&&-1===e.outputs.findIndex((function(i){return!n.isSrcCardinalityAtMax(i.id,e,t)}))}},{key:"areAllTrgNodePortsCardinalityAtMax",value:function(e,t){var n=this;return!(!e||!e.inputs)&&-1===e.inputs.findIndex((function(i){return!n.isTrgCardinalityAtMax(i.id,e,t)}))}},{key:"hasInputAndOutputPorts",value:function(e){return this.isNode(e)&&e.inputs&&e.inputs.length>0&&e.outputs&&e.outputs.length>0}},{key:"isNodeDefaultPortsCardinalityAtMax",value:function(e,t){return this.isCardinalityAtMax(null,null,e,e,t)}},{key:"isCardinalityAtMax",value:function(e,t,n,i,o){return this.isSrcCardinalityAtMax(e,n,o)||this.isTrgCardinalityAtMax(t,i,o)}},{key:"isSrcCardinalityAtMax",value:function(e,t,n){var i=this,r=e||this.getDefaultOutputPortId(t),a=0;n.forEach((function(e){e.type===o.NODE_LINK&&e.srcNodeId===t.id&&r&&(e.srcNodePortId===r||!e.srcNodePortId&&i.isFirstPort(t.outputs,r))&&a++}));var s=this.getMaxCardinality(r,t.outputs);return null!==s&&-1!==s&&a>=s}},{key:"isTrgCardinalityAtMax",value:function(e,t,n){var i=this,r=e||this.getDefaultInputPortId(t),a=0;n.forEach((function(e){e.type===o.NODE_LINK&&e.trgNodeId===t.id&&r&&(e.trgNodePortId===r||!e.trgNodePortId&&i.isFirstPort(t.inputs,r))&&a++}));var s=this.getMaxCardinality(r,t.inputs);return null!==s&&-1!==s&&a>=s}},{key:"isFirstPort",value:function(e,t){return 0===e.findIndex((function(e){return e.id===t}))}},{key:"getPort",value:function(e,t){if(t&&t.length>0){var n=t.findIndex((function(t){return t.id===e}));if(n>-1)return t[n]}return null}},{key:"getMaxCardinality",value:function(e,t){var n=this.getPort(e,t);return n&&n.cardinality?Number(n.cardinality.max):null}},{key:"isCommentLinkConnectionAllowed",value:function(e,t,n){return!this.commentLinkAlreadyExists(e,t,n)}},{key:"commentLinkAlreadyExists",value:function(e,t,n){var i=!1;return n.forEach((function(n){n.srcNodeId===e&&n.trgNodeId===t&&(i=!0)})),i}},{key:"getDetachedLinksToUpdate",value:function(e,t,n){var i=this,o=[],r=[];return t.forEach((function(t){if(t.nodeOverSrcPos&&t.srcPos&&e.outputs&&e.outputs.length>0){var a=!1;e.outputs.forEach((function(s){if(!1===a&&i.isSrcConnectionAllowedWithDetachedLinks(s.id,e,i.getReplacedLinks(n,o))){var d=Object.assign({},t,{srcNodeId:e.id,srcNodePortId:s.id});delete d.srcPos,o.push(d),r.push(t),a=!0}}))}else if(t.nodeOverTrgPos&&t.trgPos&&e.inputs&&e.inputs.length>0){var s=!1;e.inputs.forEach((function(a){if(!1===s&&i.isTrgConnectionAllowedWithDetachedLinks(a.id,e,i.getReplacedLinks(n,o))){var d=Object.assign({},t,{trgNodeId:e.id,trgNodePortId:a.id});delete d.trgPos,o.push(d),r.push(t),s=!0}}))}})),{newLinks:o,oldLinks:r}}},{key:"getReplacedLinks",value:function(e,t){return e.map((function(e){var n=t.findIndex((function(t){return t.id===e.id}));return n>-1?t[n]:e}))}},{key:"selectInRegion",value:function(e,t,n,i,r){var a,s=[],d=p(t.nodes);try{for(d.s();!(a=d.n()).done;){var c=a.value;!this.isSuperBindingNode(c)&&e.x1<c.x_pos+c.width&&e.x2>c.x_pos&&e.y1<c.y_pos+c.height&&e.y2>c.y_pos&&s.push(c.id)}}catch(e){d.e(e)}finally{d.f()}var l,u=p(t.comments);try{for(u.s();!(l=u.n()).done;){var f=l.value;e.x1<f.x_pos+f.width&&e.x2>f.x_pos&&e.y1<f.y_pos+f.height&&e.y2>f.y_pos&&s.push(f.id)}}catch(e){u.e(e)}finally{u.f()}if(n){var h,g=p(t.links);try{for(g.s();!(h=g.n()).done;){var y=h.value;y.type===o.NODE_LINK&&i===o.LINK_TYPE_STRAIGHT||y.type===o.COMMENT_LINK||y.type===o.ASSOCIATION_LINK&&r===o.ASSOC_STRAIGHT?this.lineIntersectRectangle(y.x1,y.y1,y.x2,y.y2,e.x1,e.y1,e.x2,e.y2)&&s.push(y.id):(this.isPosInArea({x_pos:y.x1,y_pos:y.y1},e,0)||this.isPosInArea({x_pos:y.x2,y_pos:y.y2},e,0))&&s.push(y.id)}}catch(e){g.e(e)}finally{g.f()}}return s}},{key:"isPosInArea",value:function(e,t,n){return e.x_pos>t.x1-n&&e.x_pos<t.x2+n&&e.y_pos>t.y1-n&&e.y_pos<t.y2+n}},{key:"isNode",value:function(e){return e.type}},{key:"isSupernode",value:function(e){return e.type===o.SUPER_NODE}},{key:"isExpanded",value:function(e){return!0===e.is_expanded}},{key:"isExpandedSupernode",value:function(e){return this.isSupernode(e)&&this.isExpanded(e)}},{key:"isCollapsedSupernode",value:function(e){return this.isSupernode(e)&&!this.isExpanded(e)}},{key:"isSuperBindingNode",value:function(e){return e.isSupernodeInputBinding||e.isSupernodeOutputBinding}},{key:"getCanvasDimensions",value:function(e,t,n,i,o,r){var a=this,s=1/0,d=1/0,c=-1/0,l=-1/0;return e&&e.forEach((function(e){if(!a.isSuperBindingNode(e)){var t=0===o?0:e.layout.nodeHighlightGap;s=Math.min(s,e.x_pos-t),d=Math.min(d,e.y_pos-t),c=Math.max(c,e.x_pos+e.width+t),l=Math.max(l,e.y_pos+e.height+t)}})),t&&t.forEach((function(e){s=Math.min(s,e.x_pos-i),d=Math.min(d,e.y_pos-i),c=Math.max(c,e.x_pos+e.width+i),l=Math.max(l,e.y_pos+e.height+i)})),n&&n.forEach((function(e){r?(s=Math.min(s,e.x1),d=Math.min(d,e.y1),c=Math.max(c,e.x1),l=Math.max(l,e.y1),s=Math.min(s,e.x2),d=Math.min(d,e.y2),c=Math.max(c,e.x2),l=Math.max(l,e.y2)):(e.srcPos&&(s=Math.min(s,e.srcPos.x_pos),d=Math.min(d,e.srcPos.y_pos),c=Math.max(c,e.srcPos.x_pos),l=Math.max(l,e.srcPos.y_pos)),e.trgPos&&(s=Math.min(s,e.trgPos.x_pos),d=Math.min(d,e.trgPos.y_pos),c=Math.max(c,e.trgPos.x_pos),l=Math.max(l,e.trgPos.y_pos)))})),s===1/0||d===1/0||c===-1/0||l===-1/0?{left:0,top:0,right:0,bottom:0,width:0,height:0}:{left:s,top:d,right:c,bottom:l,width:c-s,height:l-d}}},{key:"getDataLinksConnectedTo",value:function(e,t,n){var i=this.getDefaultInputPortId(t);return n.filter((function(n){if(n.type===o.NODE_LINK){var r=n.trgNodePortId||i;return n.trgNodeId===t.id&&r===e}return!1}))}},{key:"getDefaultInputPortId",value:function(e){return e.inputs&&e.inputs.length>0?e.inputs[0].id:null}},{key:"getDefaultOutputPortId",value:function(e){return e.outputs&&e.outputs.length>0?e.outputs[0].id:null}},{key:"getObjectStyle",value:function(e,t,n){if(!e.style&&!e.style_temp)return null;var i=null;return"hover"===n?i=this.getStyleValue(e,t,"default")+";"+this.getStyleValue(e,t,"hover"):"default"===n&&(i=this.getStyleValue(e,t,"default")),i}},{key:"getStyleValue",value:function(e,n,i){var o=t.get_1(e,"style_temp.".concat(n,".").concat(i),null);return null!==o?o:t.get_1(e,"style.".concat(n,".").concat(i),null)}},{key:"filterSupernodes",value:function(e){return e.filter((function(e){return e.type===o.SUPER_NODE}))}},{key:"getSrcPos",value:function(e,t){var n,i;if(e.trgNodeId){var o=t.getNode(e.trgNodeId);n=o.x_pos+o.width/2,i=o.y_pos+o.height/2}else n=e.trgPos.x_pos,i=e.trgPos.y_pos;var r,a,s=t.getNode(e.srcNodeId);s.layout&&"image_center"===s.layout.drawNodeLinkLineFromTo?(r=s.x_pos+s.layout.imagePosX+s.layout.imageWidth/2,a=s.y_pos+s.layout.imagePosY+s.layout.imageHeight/2):(r=s.x_pos+s.width/2,a=s.y_pos+s.height/2);var d=this.getOuterCoord(s.x_pos,s.y_pos,s.width,s.height,0,r,a,n,i);return{x_pos:d.x,y_pos:d.y}}},{key:"getTrgPos",value:function(e,t){var n,i;if(e.srcNodeId){var o=t.getNode(e.srcNodeId);n=o.x_pos+o.width/2,i=o.y_pos+o.height/2}else n=e.srcPos.x_pos,i=e.srcPos.y_pos;var r,a,s=t.getNode(e.trgNodeId);s.layout&&"image_center"===s.layout.drawNodeLinkLineFromTo?(r=s.x_pos+s.layout.imagePosX+s.layout.imageWidth/2,a=s.y_pos+s.layout.imagePosY+s.layout.imageHeight/2):(r=s.x_pos+s.width/2,a=s.y_pos+s.height/2);var d=this.getOuterCoord(s.x_pos,s.y_pos,s.width,s.height,0,r,a,n,i);return{x_pos:d.x,y_pos:d.y}}},{key:"concatUniqueBasedOnId",value:function(e,t){var n=t;return e.forEach((function(e){t.some((function(t){return t.id===e.id}))||n.push(e)})),n}},{key:"getBkgColorClass",value:function(e){return"bkg-col-white-0"===e||"bkg-col-yellow-20"===e||"bkg-col-gray-20"===e||"bkg-col-green-20"===e||"bkg-col-teal-20"===e||"bkg-col-cyan-20"===e||"bkg-col-red-50"===e||"bkg-col-orange-40"===e||"bkg-col-gray-50"===e||"bkg-col-green-50"===e||"bkg-col-teal-50"===e||"bkg-col-cyan-50"===e?e:null}},{key:"getParentElementWithClass",value:function(e,t){for(var n=e,i=null;n;)this.isClassNameIncluded(n,"d3-new-connection-guide")||this.isClassNameIncluded(n,"svg-area")?n=null:this.isClassNameIncluded(n,t)?(i=n,n=null):n=n.parentNode;return i}},{key:"isClassNameIncluded",value:function(e,t){return e.classList&&e.classList.contains(t)}}]),n}(),g=t.identity_1;var y=function(e){return"function"==typeof e?e:g},m=t._baseIsMatch,_=t._getMatchData;var v=function(e,t,n){return n="function"==typeof n?n:void 0,m(e,t,_(t),n)},b=t._baseIsMatch,P=t._getMatchData;var k=function(e,t){return e===t||b(e,t,P(t))},I={nodeLayout:{defaultNodeWidth:160,defaultNodeHeight:40,className:"",nodeShapeDisplay:!0,nodeShape:"port-arcs",bodyPath:null,selectionPath:null,nodeExternalObject:!1,imageDisplay:!0,imageWidth:26,imageHeight:26,imagePosition:"topLeft",imagePosX:6,imagePosY:7,labelDisplay:!0,labelWidth:112,labelHeight:19,labelPosition:"topLeft",labelPosX:36,labelPosY:12,labelEditable:!1,labelAlign:"left",labelSingleLine:!0,labelOutline:!1,labelMaxCharacters:null,labelAllowReturnKey:!1,decorations:[],decoratorTopY:2,decoratorMiddleY:-8,decoratorBottomY:-18,decoratorLeftX:2,decoratorCenterX:-8,decoratorRightX:-30,decoratorWidth:16,decoratorHeight:16,decoratorPadding:2,decoratorLabelWidth:80,decoratorLabelHeight:30,dropShadow:!0,nodeHighlightGap:1,nodeSizingArea:10,errorPosition:"topLeft",errorXPos:24,errorYPos:5,errorWidth:10.5,errorHeight:10.5,nodeCornerResizeArea:10,drawNodeLinkLineFromTo:"node_center",drawCommentLinkLineTo:"node_center",minInitialLine:30,minInitialLineIncrement:8,minFinalLine:30,inputPortDisplay:!0,inputPortObject:"circle",inputPortImage:"",inputPortWidth:12,inputPortHeight:12,inputPortLeftPosX:0,inputPortLeftPosY:20,inputPortTopPosX:80,inputPortTopPosY:0,inputPortBottomPosX:80,inputPortBottomPosY:0,inputPortGuideObject:"circle",inputPortGuideImage:"",outputPortDisplay:!0,outputPortObject:"circle",outputPortImage:"",outputPortWidth:12,outputPortHeight:12,outputPortRightPosition:"topRight",outputPortRightPosX:0,outputPortRightPosY:20,outputPortTopPosX:80,outputPortTopPosY:0,outputPortBottomPosX:80,outputPortBottomPosY:0,outputPortGuideObject:"circle",outputPortGuideImage:"",autoSizeNode:!0,portRadius:3,portArcOffset:3,portArcRadius:6,portArcSpacing:3,contextToolbarPosition:"topRight",ellipsisDisplay:!0,ellipsisPosition:"topLeft",ellipsisWidth:10,ellipsisHeight:22,ellipsisPosX:145,ellipsisPosY:9,ellipsisHoverAreaPadding:2},canvasLayout:{supernodeLabelPosX:30,supernodeLabelPosY:4,supernodeLabelWidth:50,supernodeLabelHeight:20,supernodeImageWidth:18,supernodeImageHeight:18,supernodeImagePosX:5,supernodeImagePosY:4,supernodeEllipsisPosX:-34,supernodeEllipsisPosY:2,supernodeEllipsisWidth:10,supernodeEllipsisHeight:20,supernodeExpansionIconPosX:-21,supernodeExpansionIconPosY:4,supernodeExpansionIconHeight:18,supernodeExpansionIconWidth:18,supernodeExpansionIconHoverAreaPadding:2,supernodeErrorPosX:-50,supernodeErrorPosY:5,supernodeErrorWidth:14,supernodeErrorHeight:14,supernodeDefaultWidth:300,supernodeDefaultHeight:200,supernodeMinWidth:100,supernodeMinHeight:80,supernodeTopAreaHeight:25,supernodeSVGAreaPadding:3,supernodeBindingPortRadius:6,linkDirection:"LeftRight",displayLinkOnOverlap:!0,linkGap:7,linkDecoratorHeight:20,linkDecoratorWidth:20,linkDecoratorPadding:2,linkDecoratorLabelWidth:80,linkDecoratorLabelHeight:30,elbowSize:10,wrapAroundSpacing:20,wrapAroundNodePadding:10,linkType:"Curve",commentLinkArrowHead:!1,dataLinkArrowHead:!1,linkStartHandleObject:"circle",linkStartHandleImage:"",linkStartHandleWidth:12,linkStartHandleHeight:12,linkStartHandleRadius:5,linkEndHandleObject:"circle",linkEndHandleImage:"",linkEndHandleWidth:12,linkEndHandleHeight:12,linkEndHandleRadius:5,commentCornerResizeArea:10,commentHighlightGap:1,commentSizingArea:10,addCommentOffsetX:30,addCommentOffsetY:50,commentPortRadius:5,commentToolbarPosX:-2,commentToolbarPosY:-36,alwaysDisplayBackToParentFlow:!1,zoomToFitPadding:10,snapToGridType:"None",snapToGridX:"20%",snapToGridY:"33.33%",nodeProximity:20,ghostAreaPadding:10,initialPanX:null,initialPanY:null,autoLayoutInitialMarginX:50,autoLayoutInitialMarginY:50,autoLayoutVerticalSpacing:80,autoLayoutHorizontalSpacing:80}},N={nodeLayout:{defaultNodeWidth:70,defaultNodeHeight:75,className:"",nodeShapeDisplay:!0,nodeShape:"rectangle",bodyPath:null,selectionPath:null,nodeExternalObject:!1,imageDisplay:!0,imageWidth:48,imageHeight:48,imagePosition:"topLeft",imagePosX:11,imagePosY:6,labelDisplay:!0,labelWidth:72,labelHeight:19,labelPosition:"topLeft",labelPosX:35,labelPosY:55,labelEditable:!1,labelAlign:"center",labelSingleLine:!0,labelOutline:!1,labelMaxCharacters:null,labelAllowReturnKey:!1,decorations:[],decoratorTopY:5,decoratorMiddleY:-8,decoratorBottomY:-34,decoratorLeftX:10,decoratorCenterX:-8,decoratorRightX:-24,decoratorWidth:16,decoratorHeight:16,decoratorPadding:2,decoratorLabelWidth:80,decoratorLabelHeight:30,dropShadow:!1,nodeHighlightGap:4,nodeSizingArea:10,errorPosition:"topLeft",errorXPos:45,errorYPos:5,errorWidth:14,errorHeight:14,nodeCornerResizeArea:10,drawNodeLinkLineFromTo:"node_center",drawCommentLinkLineTo:"node_center",minInitialLine:30,minInitialLineIncrement:8,minFinalLine:30,inputPortDisplay:!0,inputPortObject:"circle",inputPortImage:"",inputPortWidth:12,inputPortHeight:12,inputPortLeftPosX:0,inputPortLeftPosY:29,inputPortTopPosX:35,inputPortTopPosY:0,inputPortBottomPosX:35,inputPortBottomPosY:0,inputPortGuideObject:"circle",inputPortGuideImage:"",outputPortDisplay:!0,outputPortObject:"circle",outputPortImage:"",outputPortWidth:12,outputPortHeight:12,outputPortRightPosition:"topRight",outputPortRightPosX:0,outputPortRightPosY:29,outputPortTopPosX:35,outputPortTopPosY:0,outputPortBottomPosX:35,outputPortBottomPosY:0,outputPortGuideObject:"circle",outputPortGuideImage:"",autoSizeNode:!0,portRadius:6,portArcOffset:0,portArcRadius:10,portArcSpacing:0,contextToolbarPosition:"topCenter",ellipsisDisplay:!0,ellipsisPosition:"topLeft",ellipsisWidth:11,ellipsisHeight:21,ellipsisPosX:57,ellipsisPosY:4,ellipsisHoverAreaPadding:2},canvasLayout:{supernodeLabelPosX:30,supernodeLabelPosY:4,supernodeLabelWidth:50,supernodeLabelHeight:20,supernodeImageWidth:18,supernodeImageHeight:18,supernodeImagePosX:5,supernodeImagePosY:4,supernodeEllipsisPosX:-34,supernodeEllipsisPosY:2,supernodeEllipsisWidth:10,supernodeEllipsisHeight:20,supernodeExpansionIconPosX:-21,supernodeExpansionIconPosY:4,supernodeExpansionIconHeight:18,supernodeExpansionIconWidth:18,supernodeExpansionIconHoverAreaPadding:2,supernodeErrorPosX:-50,supernodeErrorPosY:5,supernodeErrorWidth:14,supernodeErrorHeight:14,supernodeDefaultWidth:200,supernodeDefaultHeight:200,supernodeMinWidth:100,supernodeMinHeight:80,supernodeTopAreaHeight:25,supernodeSVGAreaPadding:3,supernodeBindingPortRadius:10,linkDirection:"LeftRight",displayLinkOnOverlap:!0,linkGap:7,linkDecoratorHeight:20,linkDecoratorWidth:20,linkDecoratorPadding:2,linkDecoratorLabelWidth:80,linkDecoratorLabelHeight:30,elbowSize:10,wrapAroundSpacing:20,wrapAroundNodePadding:10,linkType:"Curve",commentLinkArrowHead:!1,dataLinkArrowHead:!1,linkStartHandleObject:"circle",linkStartHandleImage:"",linkStartHandleWidth:12,linkStartHandleHeight:12,linkStartHandleRadius:6,linkEndHandleObject:"circle",linkEndHandleImage:"",linkEndHandleWidth:12,linkEndHandleHeight:12,linkEndHandleRadius:6,commentCornerResizeArea:10,commentHighlightGap:4,commentSizingArea:10,addCommentOffsetX:30,addCommentOffsetY:50,commentPortRadius:5,commentToolbarPosX:-2,commentToolbarPosY:-36,alwaysDisplayBackToParentFlow:!1,zoomToFitPadding:10,snapToGridType:"None",snapToGridX:"25%",snapToGridY:"20%",nodeProximity:20,ghostAreaPadding:10,initialPanX:null,initialPanY:null,autoLayoutInitialMarginX:50,autoLayoutInitialMarginY:50,autoLayoutVerticalSpacing:80,autoLayoutHorizontalSpacing:80}},E=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"getLayout",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getDefaultLayout(e);return e&&(n=this.overrideNodeLayout(n,t),n=this.overrideCanvasLayout(n,e,t),n=this.overrideLinkType(n,e),n=this.overrideSnapToGrid(n,e),n=this.overrideAutoLayout(n,e)),n}},{key:"getDefaultLayout",value:function(e){var t;return t=e&&"Vertical"===e.enableNodeFormatType?N:I,Object.assign({},t)}},{key:"overrideNodeLayout",value:function(e,t){return e.nodeLayout=Object.assign({},e.nodeLayout,t.nodeLayout||{}),e}},{key:"overrideCanvasLayout",value:function(e,t,n){return e.canvasLayout=Object.assign({},e.canvasLayout,{linkDirection:t.enableLinkDirection},n.canvasLayout||{}),e}},{key:"overrideLinkType",value:function(e,t){return e.canvasLayout.linkType=t.enableLinkType||e.canvasLayout.linkType||"Curve",e}},{key:"overrideSnapToGrid",value:function(e,t){return t.enableSnapToGridType&&(e.canvasLayout.snapToGridType=t.enableSnapToGridType),e.canvasLayout.snapToGridX=t.enableSnapToGridX||e.canvasLayout.snapToGridX||"25%",e.canvasLayout.snapToGridY=t.enableSnapToGridY||e.canvasLayout.snapToGridY||"20%",e.canvasLayout.snapToGridXPx=this.getSnapToGridSize(e.canvasLayout.snapToGridX,e.nodeLayout.defaultNodeWidth),e.canvasLayout.snapToGridYPx=this.getSnapToGridSize(e.canvasLayout.snapToGridY,e.nodeLayout.defaultNodeHeight),e}},{key:"overrideAutoLayout",value:function(e,t){return e.canvasLayout.autoLayoutVerticalSpacing=this.getAutoLayoutSpacing(t.enableAutoLayoutVerticalSpacing,e.canvasLayout.autoLayoutVerticalSpacing),e.canvasLayout.autoLayoutHorizontalSpacing=this.getAutoLayoutSpacing(t.enableAutoLayoutHorizontalSpacing,e.canvasLayout.autoLayoutHorizontalSpacing),e}},{key:"getAutoLayoutSpacing",value:function(e,t){var n=80;return null!=e?n=e:null!=t&&(n=t),n}},{key:"getSnapToGridSize",value:function(e,t){return e.endsWith("%")?Number.parseInt(e,10)/100*t:Number.parseInt(e,10)}}]),t}(),S=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"mergeCanvasConfigs",value:function(e,t){var n=Object.assign({},e,t||{});if(t){var i=E.getLayout(n,{nodeLayout:t.enableNodeLayout,canvasLayout:t.enableCanvasLayout}),o=Object.assign({},e.tipConfig,t.tipConfig);n=Object.assign({},n,{enableNodeLayout:i.nodeLayout,enableCanvasLayout:i.canvasLayout,tipConfig:o})}return n}},{key:"getDefaultCanvasConfig",value:function(){var e={enableInteractionType:"Mouse",enableNodeFormatType:"Horizontal",enableLinkType:"Curve",enableLinkDirection:"LeftRight",enableLinkSelection:o.LINK_SELECTION_NONE,enableLinkReplaceOnNewConnection:!1,enableAssocLinkCreation:!1,enableAssocLinkType:o.ASSOC_STRAIGHT,enableDragWithoutSelect:!1,enableInternalObjectModel:!0,enablePaletteLayout:"Flyout",enableToolbarLayout:"Top",enableImageDisplay:"SVGInline",enableResizableNodes:!1,enableInsertNodeDroppedOnLink:!1,enableHighlightNodeOnNewLinkDrag:!1,enableHighlightUnavailableNodes:!1,enableMoveNodesOnSupernodeResize:!0,enableRaiseNodesToTopOnHover:!0,enableExternalPipelineFlows:!0,enableEditingActions:!0,enableDisplayFullLabelOnHover:!1,enableDropZoneOnExternalDrag:!1,enableRightFlyoutUnderToolbar:!1,enablePanIntoViewOnOpen:!1,enableZoomIntoSubFlows:!1,enableBrowserEditMenu:!0,enableMarkdownInComments:!1,enableAutoLinkOnlyFromSelNodes:!1,enableContextToolbar:!1,enableSaveZoom:"None",enableSnapToGridType:"None",enableSnapToGridX:null,enableSnapToGridY:null,enableAutoLayoutVerticalSpacing:null,enableAutoLayoutHorizontalSpacing:null,enableSingleOutputPortDisplay:!1,enableNarrowPalette:!0,schemaValidation:!1,enableBoundingRectangles:!1,enableCanvasUnderlay:"None",enableParentClass:"",enablePositionNodeOnRightFlyoutOpen:!1,emptyCanvasContent:null,dropZoneCanvasContent:null,enableNodeLayout:{},enableCanvasLayout:{},enableUseCardFromOriginalPorts:!1,tipConfig:{palette:{categories:!0,nodesTemplates:!0},nodes:!0,ports:!0,decorations:!0,links:!0,stateTag:!0}},t=E.getLayout(e);return e.enableNodeLayout=t.nodeLayout,e.enableCanvasLayout=t.canvasLayout,e}},{key:"compareCanvasConfigsOmitFields",value:function(e,t){var n=this.omitFields(e),i=this.omitFields(t);return this.compareCanvasConfigs(n,i)}},{key:"compareCanvasConfigs",value:function(e,t){var n=this,i=!1;return Object.keys(e).length===Object.keys(t).length&&(i=v(e,t,(function(e,t,i){switch(i){case"enablePositionNodeOnRightFlyoutOpen":return n.enableNodeRightFlyoutOpenExactlyMatches(e,t);case"enableCanvasLayout":return n.enableCanvasLayoutExactlyMatches(e,t);case"enableNodeLayout":return n.enableNodeLayoutExactlyMatches(e,t);case"tipConfig":return n.enableTipConfigExactlyMatches(e,t);default:return e===t}}))),i}},{key:"omitFields",value:function(e){return i.omit_1(e,["enableEditingActions","enableDropZoneOnExternalDrag","enableStateTag"])}},{key:"enableNodeRightFlyoutOpenExactlyMatches",value:function(t,n){return"boolean"==typeof t&&"boolean"==typeof n?t===n:"object"===e._typeof(t)&&"object"===e._typeof(n)&&t.x===n.x&&t.y===n.y}},{key:"enableCanvasLayoutExactlyMatches",value:function(e,t){return!e&&!t||!(!this.compareFieldCount(e,t)||!k(e,t))}},{key:"enableNodeLayoutExactlyMatches",value:function(e,t){return!e&&!t||!!(this.compareFieldCount(e,t)&&k(e,t)&&this.decorationsArraysExactlyMatches(e.decorations,t.decorations))}},{key:"decorationsArraysExactlyMatches",value:function(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=!0;return e.forEach((function(e,i){var o=t[i];o&&k(e,o)&&k(o,e)||(n=!1)})),n}},{key:"enableTipConfigExactlyMatches",value:function(e,t){return!e&&!t||!(!e||!t)&&(this.compareFieldCount(e,t)&&k(e,t))}},{key:"compareFieldCount",value:function(e,t){return Object.keys(e).length===Object.keys(t).length}}]),t}();function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var C=function(t){n._inherits(o,t);var i=O(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,a)).data=t,s.objectModel=n,s.labelUtil=r,s.layoutDirection=a,s.apiPipeline=s.objectModel.getAPIPipeline(),s.existingNodes=s.apiPipeline.getNodes().map((function(e){return Object.assign({},e)})),s}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.autoLayout(this.layoutDirection)}},{key:"undo",value:function(){this.apiPipeline.replaceNodes(this.existingNodes)}},{key:"redo",value:function(){this.apiPipeline.autoLayout(this.layoutDirection)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.arrangeLayout")}}]),o}(i.Action);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var T=function(t){n._inherits(o,t);var i=j(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.node=t.node,a.linksToUpdateInfo=h.getDetachedLinksToUpdate(a.node,a.data.detachedLinks,a.apiPipeline.getNodeDataLinks()),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.linksToUpdateInfo=this.linksToUpdateInfo,this.data}},{key:"do",value:function(){this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:this.data.offsetX,offsetY:this.data.offsetY}),this.apiPipeline.updateLinks(this.linksToUpdateInfo.newLinks)}},{key:"undo",value:function(){this.apiPipeline.updateLinks(this.linksToUpdateInfo.oldLinks),this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:-this.data.offsetX,offsetY:-this.data.offsetY})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.attachNodeToLinks",{node_label:this.node.label})}}]),o}(i.Action);function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var L=function(t){n._inherits(r,t);var i=w(r);function r(t,n,a){var s;e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.pipelineFlowLoaded=s.objectModel.ensurePipelineIsLoaded(s.data),s.oldSupernode=s.apiPipeline.getNode(s.data.targetObject.id),s.oldPipelines=s.objectModel.getDescPipelinesToDelete([s.oldSupernode],s.data.pipelineId),s.oldPipelines=s.oldPipelines.filter((function(e){return e.parentUrl===s.data.externalUrl})),s.oldExtPipelineFlows=s.objectModel.getExternalPipelineFlowsForPipelines(s.oldPipelines),s.newSupernode=Object.assign({},s.oldSupernode,{subflow_ref:Object.assign({},s.oldSupernode.subflow_ref)}),s.newSupernode.image=s.newSupernode.image===o.USE_DEFAULT_EXT_ICON?o.USE_DEFAULT_ICON:s.newSupernode.image,delete s.newSupernode.subflow_ref.url;var d=s.objectModel.getDescendantPipelinesForSupernode(s.newSupernode).filter((function(e){return e.parentUrl===s.data.externalUrl}));return s.newPipelines=s.objectModel.cloneSupernodeContents(s.newSupernode,d),s.newPipelines=s.newPipelines.map((function(e){return delete e.parentUrl,e})),s}return e._createClass(r,[{key:"do",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.newSupernode,pipelinesToAdd:this.newPipelines,pipelinesToRemove:this.oldPipelines,extPipelineFlowsToAdd:[],extPipelineFlowsToDelete:this.oldExtPipelineFlows})}},{key:"undo",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.oldSupernode,pipelinesToAdd:this.oldPipelines,pipelinesToRemove:this.newPipelines,extPipelineFlowsToAdd:this.oldExtPipelineFlows,extPipelineFlowsToDelete:[]})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.convertSuperNodeExternalToLocal",{node_label:this.oldSupernode.label})}}]),r}(i.Action);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var x=function(t){n._inherits(r,t);var i=A(r);function r(t,n,a){var s;e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.oldSupernode=s.apiPipeline.getNode(s.data.targetObject.id),s.newSupernode=Object.assign({},s.oldSupernode,{subflow_ref:Object.assign({},s.oldSupernode.subflow_ref)}),s.newSupernode.image=s.newSupernode.image===o.USE_DEFAULT_ICON?o.USE_DEFAULT_EXT_ICON:s.newSupernode.image,s.newSupernode.subflow_ref.url=s.data.externalUrl;var d=s.objectModel.getDescendantPipelinesForSupernode(s.oldSupernode);return s.oldPipelines=d.filter((function(e){return!e.parentUrl})),s.newPipelines=s.objectModel.cloneSupernodeContents(s.newSupernode,s.oldPipelines),s.newPipelines=s.newPipelines.map((function(e){return e.parentUrl=s.data.externalUrl,e})),s.newPipelineFlow=s.objectModel.createExternalPipelineFlowTemplate(s.data.pipelineFlowId,s.newSupernode.subflow_ref.pipeline_id_ref),s.newPipelineFlow.pipelines=[],s.newPipelineFlow.url=s.data.externalUrl,s}return e._createClass(r,[{key:"do",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.newSupernode,pipelinesToAdd:this.newPipelines,pipelinesToRemove:this.oldPipelines,extPipelineFlowsToAdd:[this.newPipelineFlow],extPipelineFlowsToDelete:[]})}},{key:"undo",value:function(){this.objectModel.replaceSupernodeAndPipelines({pipelineId:this.data.pipelineId,topSupernode:this.oldSupernode,pipelinesToAdd:this.oldPipelines,pipelinesToRemove:this.newPipelines,extPipelineFlowsToAdd:[],extPipelineFlowsToDelete:[this.newPipelineFlow]})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.convertSuperNodeLocalToExternal",{node_label:this.oldSupernode.label})}}]),r}(i.Action);function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var M=function(t){n._inherits(o,t);var i=D(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.labelUtil=r,s.objectModel=n,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.srcNode=s.apiPipeline.getAutoSourceNode(a),s.newNode=s.apiPipeline.createAutoNode(t,s.srcNode),s.newLink=null,s.apiPipeline.isLinkNeededWithAutoNode(s.newNode,s.srcNode)&&(s.newLink=s.apiPipeline.createLink(s.newNode,s.srcNode)),s}return e._createClass(o,[{key:"getData",value:function(){return this.data.sourceNode=this.srcNode,this.data.newNode=this.newNode,this.data.newLink=this.newLink,this.data.subPipeline=this.subPipelines,this.data}},{key:"do",value:function(){this.apiPipeline.addNode(this.newNode),this.newLink&&this.apiPipeline.addLink(this.newLink),this.objectModel.setSelections([this.newNode.id],this.data.pipelineId)}},{key:"undo",value:function(){this.apiPipeline.deleteNodes([this.newNode])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNode",{node_label:this.newNode.label})}}]),o}(i.Action);function R(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var U=function(t){n._inherits(o,t);var i=R(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),a&&(s.data.mousePos=a),s.comment=s.apiPipeline.createComment(t),s}return e._createClass(o,[{key:"getData",value:function(){return this.data.commentId=this.comment.id,this.data}},{key:"do",value:function(){this.apiPipeline.addComment(this.comment)}},{key:"undo",value:function(){this.apiPipeline.deleteComment(this.comment.id)}},{key:"redo",value:function(){this.apiPipeline.addComment(this.comment)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createComment")}}]),o}(i.Action);function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var B=function(t){n._inherits(o,t);var i=F(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.linkCommentList=a.apiPipeline.createCommentLinks(t),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.linkIds=this.linkCommentList.map((function(e){return e.id})),this.data.linkType="comment",this.data}},{key:"do",value:function(){this.apiPipeline.addLinks(this.linkCommentList)}},{key:"undo",value:function(){var e=this;this.linkCommentList.forEach((function(t){e.apiPipeline.deleteLink(t)}))}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createCommentLink")}}]),o}(i.Action);function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var G=function(t){n._inherits(o,t);var i=H(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.newNode=a.apiPipeline.createNode(t),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newNode=this.newNode,this.data.subPipelines=this.subPipelines,this.data}},{key:"do",value:function(){this.apiPipeline.addNode(this.newNode)}},{key:"undo",value:function(){this.apiPipeline.deleteNodes([this.newNode])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNode",{node_label:this.newNode.label})}}]),o}(i.Action);function q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var V=function(t){n._inherits(o,t);var i=q(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.actionLabel=a.createActionLabel(),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.linkIds=this.linkNodeList.map((function(e){return e.id})),this.data.linkType="data",this.data}},{key:"do",value:function(){this.data.replaceLink&&this.apiPipeline.deleteLink(this.data.replaceLink),this.linkNodeList=this.apiPipeline.createNodeLinks(this.data),this.apiPipeline.addLinks(this.linkNodeList)}},{key:"undo",value:function(){var e=this;this.linkNodeList.forEach((function(t){e.apiPipeline.deleteLink(t)})),this.data.replaceLink&&this.apiPipeline.addLinks([this.data.replaceLink])}},{key:"redo",value:function(){this.data.replaceLink&&this.apiPipeline.deleteLink(this.data.replaceLink),this.apiPipeline.addLinks(this.linkNodeList)}},{key:"getLabel",value:function(){return this.actionLabel}},{key:"createActionLabel",value:function(){var e=this.getTargetNodeLabel();return this.data.replaceLink?this.labelUtil.getActionLabel(this,"action.replaceNodeLink",{node_label:e}):this.labelUtil.getActionLabel(this,"action.createNodeLink",{node_label:e})}},{key:"getTargetNodeLabel",value:function(){return(this.data.targetNodes&&this.data.targetNodes.length>0?this.apiPipeline.getNode(this.data.targetNodes[0].id):{}).label}}]),o}(i.Action);function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var $=function(t){n._inherits(o,t);var i=z(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.detachedLink=a.apiPipeline.createNodeLinkDetached(t),a}return e._createClass(o,[{key:"getData",value:function(){return this.data}},{key:"do",value:function(){this.apiPipeline.addLinks([this.detachedLink])}},{key:"undo",value:function(){this.apiPipeline.deleteLink(this.detachedLink)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNodeLinkDetached")}}]),o}(i.Action);function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var K=function(t){n._inherits(o,t);var i=W(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.newNode=a.apiPipeline.createNode(t),a.firstLinkSrcInfo={id:t.link.srcNodeId,portId:t.link.srcNodePortId},a.firstLinkTrgInfo={id:a.newNode.id},a.secondLinkSrcInfo={id:a.newNode.id},a.secondLinkTrgInfo={id:t.link.trgNodeId,portId:t.link.trgNodePortId},a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newNode=this.newNode,this.data.newFirstLink=this.firstLink,this.data.newSecondLink=this.secondLink,this.data}},{key:"do",value:function(){this.apiPipeline.deleteLink({id:this.data.link.id}),this.apiPipeline.addNode(this.newNode),this.firstLink=this.apiPipeline.createNodeLink(this.firstLinkSrcInfo,this.firstLinkTrgInfo,{type:"nodeLink"}),this.secondLink=this.apiPipeline.createNodeLink(this.secondLinkSrcInfo,this.secondLinkTrgInfo,{type:"nodeLink"}),this.apiPipeline.addLinks([this.firstLink,this.secondLink])}},{key:"undo",value:function(){this.apiPipeline.deleteLink({id:this.firstLink.id}),this.apiPipeline.deleteLink({id:this.secondLink.id}),this.apiPipeline.deleteNodes([this.newNode]),this.apiPipeline.addLinks([this.data.link])}},{key:"redo",value:function(){this.apiPipeline.deleteLink({id:this.data.link.id}),this.apiPipeline.addNode(this.newNode),this.apiPipeline.addLinks([this.firstLink,this.secondLink])}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNodeOnLink",{node_label:this.newNode.label})}}]),o}(i.Action);function Y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var X=function(t){n._inherits(o,t);var i=Y(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.newNode=a.apiPipeline.createNode(t),a.linksToUpdateInfo=h.getDetachedLinksToUpdate(a.newNode,a.data.detachedLinks,a.apiPipeline.getNodeDataLinks()),a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newNode=this.newNode,this.data.linksToUpdateInfo=this.linksToUpdateInfo,this.data}},{key:"do",value:function(){this.apiPipeline.addNode(this.newNode),this.apiPipeline.updateLinks(this.linksToUpdateInfo.newLinks)}},{key:"undo",value:function(){this.apiPipeline.updateLinks(this.linksToUpdateInfo.oldLinks),this.apiPipeline.deleteNodes([this.newNode])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createNodeAttachLinks",{node_label:this.newNode.label})}}]),o}(i.Action);function J(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Z(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Q(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ee=80,te=function(t){n._inherits(a,t);var r=Q(a);function a(t,n,i,o){var s;e._classCallCheck(this,a),(s=r.call(this,t)).labelUtil=i,s.data=t,s.useCardFromOriginalPorts=o,s.objectModel=n,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.subflowNodes=s.objectModel.getSelectedNodes(),s.subflowComments=s.objectModel.getSelectedComments(),s.subflowRect=s.apiPipeline.getBoundingRectForNodes(s.subflowNodes),s.linksToDelete=[];var d=s.getUniqueSubflowLinks(s.data.selectedObjectIds);return s.subflowNodeLinks=s.getSubflowNodeLinks(d),s.subflowCommentLinks=s.getSubflowCommentLinks(d),s.subflowCommentLinks=s.filterCommentLinks(s.subflowCommentLinks,s.subflowComments),s.subflowLinks=s.subflowNodeLinks.concat(s.subflowCommentLinks),s.subflowInputLinks=s.createOrderedSubflowInputLinks(s.subflowNodeLinks),s.subflowOutputLinks=s.createOrderedSubflowOutputLinks(s.subflowNodeLinks),s.subPipeline=s.objectModel.createPipeline(s.subflowNodes,s.subflowComments,s.subflowLinks),s.subAPIPipeline=s.objectModel.getAPIPipeline(s.subPipeline.id),s.bindingInputData=s.getBindingInputData(s.subflowInputLinks,s.subflowRect),s.bindingOutputData=s.getBindingOutputData(s.subflowOutputLinks,s.subflowRect),s.supernode=s.createSupernode(s.bindingInputData,s.bindingOutputData),s.supernodeLinkDefs=s.createSupernodeLinkDefs(s.bindingInputData,s.bindingOutputData,s.supernode),s.bindingNodeLinkDefs=s.createBindingNodeLinkDefs(s.bindingInputData,s.bindingOutputData),s.data.externalUrl&&s.handleExternalSubflow(),s}return e._createClass(a,[{key:"getUniqueSubflowLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.apiPipeline.getLinksContainingId(e).forEach((function(e){n.find((function(t){return t.id===e.id}))||n.push(e)}))})),n}},{key:"getSubflowNodeLinks",value:function(e){return e.filter((function(e){return e.type===o.NODE_LINK||e.type===o.ASSOCIATION_LINK}))}},{key:"getSubflowCommentLinks",value:function(e){return e.filter((function(e){return e.type===o.COMMENT_LINK}))}},{key:"filterCommentLinks",value:function(e,t){var n=this,i=[];return e.forEach((function(e){var t=n.apiPipeline.getComment(e.srcNodeId);n.apiPipeline.isObjectIdInObjects(t.id,n.subflowComments)?i.push(e):n.apiPipeline.isCommentLinkedToNonSelectedNodes(t.id)?n.linksToDelete.push(e):(i.push(e),n.subflowComments.push(t))})),i=this.removeCommentLinksToUnselectedNodes(i,t)}},{key:"removeCommentLinksToUnselectedNodes",value:function(e,t){var n,i=this,o=e,r=[],a=J(t);try{for(a.s();!(n=a.n()).done;){var s=n.value;this.apiPipeline.isCommentLinkedToNonSelectedNodes(s.id)&&r.push(s)}}catch(e){a.e(e)}finally{a.f()}return r.forEach((function(e){i.apiPipeline.getLinksContainingId(e.id).forEach((function(e){i.apiPipeline.isObjectIdInObjects(e.trgNodeId,i.subflowNodes)||i.apiPipeline.isObjectIdInObjects(e.id,i.linksToDelete)||(o=o.filter((function(t){return t.id!==e.id})),i.linksToDelete.push(e))}))})),o}},{key:"createOrderedSubflowInputLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.apiPipeline.isObjectIdInObjects(e.srcNodeId,t.subflowNodes)||n.find((function(t){return t.id===e.trgNodeId}))||(e.type===o.ASSOCIATION_LINK?t.removeLinkFromSubflow(e,!0):(n.push(e),t.removeLinkFromSubflow(e,!1)))})),n=this.reorderSubflowLinks(n,"input")}},{key:"createOrderedSubflowOutputLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.apiPipeline.isObjectIdInObjects(e.trgNodeId,t.subflowNodes)||n.find((function(t){return t.id===e.srcNodeId}))||(e.type===o.ASSOCIATION_LINK?t.removeLinkFromSubflow(e,!0):(n.push(e),t.removeLinkFromSubflow(e,!1)))})),n=this.reorderSubflowLinks(n,"output")}},{key:"handleExternalSubflow",value:function(){var e=h.filterSupernodes(this.subflowNodes),t=this.objectModel.getDescendantPipelinesForSupernodes(e);this.descPipelines=t.filter((function(e){return!e.parentUrl})),this.newPipelineFlow=this.objectModel.createExternalPipelineFlowTemplate(this.data.externalPipelineFlowId,this.supernode.subflow_ref.pipeline_id_ref)}},{key:"createSupernode",value:function(e,t){var n=e.map((function(e){return e.supernodePort})),i=t.map((function(e){return e.supernodePort})),r={label:this.labelUtil.getLabel("supernode.template.label"),description:this.labelUtil.getLabel("supernode.template.description"),image:this.data.externalUrl?o.USE_DEFAULT_EXT_ICON:o.USE_DEFAULT_ICON,inputs:n,outputs:i,type:o.SUPER_NODE,subflow_ref:{pipeline_id_ref:this.subPipeline.id}};this.data.externalUrl&&(r.subflow_ref.url=this.data.externalUrl);var a=this.getTopLeftNode(this.subflowNodes),s={nodeTemplate:r,offsetX:a.x_pos,offsetY:a.y_pos};return this.apiPipeline.createNode(s)}},{key:"reorderSubflowLinks",value:function(e,t){var n=this;if(e.length>1){var o=i._toConsumableArray(e),r="input"===t?"srcNodeId":"trgNodeId",a="input"===t?"srcPos":"trgPos";return o.sort((function(e,t){var i=n.apiPipeline.getNode(e[r]),o=n.apiPipeline.getNode(t[r]),s=e[a]?e[a].y_pos:i.y_pos,d=t[a]?t[a].y_pos:o.y_pos;return s<d?-1:s>d?1:0})),o}return e}},{key:"getTopLeftNode",value:function(e){var t=this,n=e[0],i=this.getDistanceFromPosition(this.subflowRect.x,this.subflowRect.y,e[0]);return e.forEach((function(e){var o=t.getDistanceFromPosition(t.subflowRect.x,t.subflowRect.y,e);o<i&&(i=o,n=e)})),n}},{key:"getDistanceFromPosition",value:function(e,t,n){var i=n.x_pos-e,o=n.y_pos-t;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}},{key:"getBindingInputData",value:function(e,t){var n=this,i=[],o=t.y-ee;return e.forEach((function(e){var r=n.apiPipeline.getNode(e.trgNodeId),a=Object.assign({},n.findPort(e.trgNodePortId,r.inputs));a.id=n.generateUniquePortId(a,e.trgNodeId,i),a.label=n.labelUtil.getLabel("supernode.new.port.label"),n.useCardFromOriginalPorts||(a.cardinality={min:0,max:1});var s=Object.assign({},a),d={x:t.x-160,y:o+=ee};s.id=s.id?"output_"+s.id:s.id;var c=n.createBindingNode(e,{outputs:[s],isSupernodeInputBinding:!0},d);i.push({link:e,supernodePort:a,bindingNode:c})})),i}},{key:"getBindingOutputData",value:function(e,t){var n=this,i=[],o=t.y-ee;return e.forEach((function(e){var r=n.apiPipeline.getNode(e.srcNodeId),a=Object.assign({},n.findPort(e.srcNodePortId,r.outputs));a.id=n.generateUniquePortId(a,e.srcNodeId,i),a.label=n.labelUtil.getLabel("supernode.new.port.label"),n.useCardFromOriginalPorts||(a.cardinality={min:0,max:1});var s=Object.assign({},a),d={x:t.x+t.width+ee,y:o+=ee};s.id=s.id?"input_"+s.id:s.id;var c=n.createBindingNode(e,{inputs:[s],isSupernodeOutputBinding:!0},d);i.push({link:e,supernodePort:a,bindingNode:c})})),i}},{key:"findPort",value:function(e,t){if(null!=e){var n=h.getPort(e,t);if(n)return n}return t[0]}},{key:"generateUniquePortId",value:function(e,t,n){var i=e.id?t+"_"+e.id:e.id,o=this.occurancesStartingWith(i,n);return o>0&&(i+="_"+o),i}},{key:"occurancesStartingWith",value:function(e,t){return t.filter((function(t){return t.supernodePort.id.startsWith(e)})).length}},{key:"createBindingNode",value:function(e,t,n){var i={description:this.labelUtil.getLabel("supernode.binding.node.description"),label:this.labelUtil.getLabel("supernode.binding.node.label"),type:"binding"},o={editType:"createNode",nodeTemplate:Object.assign(i,t),offsetX:n.x,offsetY:n.y};return this.subAPIPipeline.createNode(o)}},{key:"removeLinkFromSubflow",value:function(e,t){this.subflowLinks=this.subflowLinks.filter((function(t){return t.id!==e.id})),t&&this.linksToDelete.push(e)}},{key:"createSupernodeLinkDefs",value:function(e,t,n){var i=[];return e.forEach((function(e){var t={srcInfo:{},trgInfo:{}};e.link.srcPos?t.srcInfo.srcPos=e.link.srcPos:(t.srcInfo.id=e.link.srcNodeId,t.srcInfo.portId=e.link.srcNodePortId),t.trgInfo.id=n.id,t.trgInfo.portId=e.supernodePort.id,i.push(t)})),t.forEach((function(e){var t={srcInfo:{},trgInfo:{}};t.srcInfo.id=n.id,t.srcInfo.portId=e.supernodePort.id,e.link.trgPos?t.trgInfo.trgPos=e.link.trgPos:(t.trgInfo.id=e.link.trgNodeId,t.trgInfo.portId=e.link.trgNodePortId),i.push(t)})),i}},{key:"createBindingNodeLinkDefs",value:function(e,t){var n=[];return e.forEach((function(e){n.push({srcInfo:{id:e.bindingNode.id,portId:e.bindingNode.outputs[0].id},trgInfo:{id:e.link.trgNodeId,portId:e.link.trgNodePortId}})})),t.forEach((function(e){n.push({srcInfo:{id:e.link.srcNodeId,portId:e.link.srcNodePortId},trgInfo:{id:e.bindingNode.id,portId:e.bindingNode.inputs[0].id}})})),n}},{key:"getData",value:function(){return this.data.newNode=this.supernode,this.data.newLinks=this.newLinks,this.data.subPipelineId=this.subPipeline.id,this.data}},{key:"do",value:function(){var e=this;if(this.apiPipeline.deleteNodes(this.subflowNodes,!1),this.apiPipeline.deleteComments(this.subflowComments),this.apiPipeline.deleteLinks(this.linksToDelete),this.apiPipeline.addSupernode(this.supernode,[this.subPipeline]),this.bindingInputData.forEach((function(t){e.apiPipeline.setInputPortSubflowNodeRef(e.supernode.id,t.supernodePort.id,t.bindingNode.id)})),this.bindingOutputData.forEach((function(t){e.apiPipeline.setOutputPortSubflowNodeRef(e.supernode.id,t.supernodePort.id,t.bindingNode.id)})),this.newLinks=[],this.supernodeLinkDefs.forEach((function(t){e.newLinks.push(e.apiPipeline.createNodeLink(t.srcInfo,t.trgInfo,{type:o.NODE_LINK}))})),this.apiPipeline.addLinks(this.newLinks),this.bindingInputData.forEach((function(t){e.subAPIPipeline.addNode(t.bindingNode)})),this.bindingOutputData.forEach((function(t){e.subAPIPipeline.addNode(t.bindingNode)})),this.subflowNewLinks=[],this.bindingNodeLinkDefs.forEach((function(t){e.subflowNewLinks.push(e.subAPIPipeline.createNodeLink(t.srcInfo,t.trgInfo,{type:o.NODE_LINK}))})),this.subAPIPipeline.addLinks(this.subflowNewLinks),this.data.externalUrl){this.objectModel.addExternalPipelineFlow(this.newPipelineFlow,this.data.externalUrl,null,!1);var t=[this.subPipeline].concat(this.descPipelines);this.objectModel.setParentUrl(t,this.data.externalUrl)}}},{key:"undo",value:function(){var e=this;this.data.externalUrl&&(this.objectModel.setParentUrl(this.descPipelines),this.objectModel.removeExternalPipelineFlow(this.data.externalUrl)),this.apiPipeline.deleteSupernodes([this.supernode],[this.subPipeline],[]),this.subflowNodes.forEach((function(t){e.apiPipeline.addNode(t)})),this.subflowComments.forEach((function(t){e.apiPipeline.addComment(t)})),this.apiPipeline.addLinks(this.subflowLinks),this.apiPipeline.addLinks(this.subflowInputLinks),this.apiPipeline.addLinks(this.subflowOutputLinks),this.apiPipeline.addLinks(this.linksToDelete)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.createSuperNode",{node_label:this.supernode.label})}}]),a}(i.Action);function ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ie=function(t){n._inherits(o,t);var i=ne(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.oldObjectPositions=[],s.newObjectPositions=[],s.oldLinkPositions=[],s.newLinkPositions=[],s.enableMoveNodesOnSupernodeResize=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.enableMoveNodesOnSupernodeResize&&(s.supernode=s.apiPipeline.getNode(s.data.id),s.oldObjectPositions=h.getObjectPositions(s.apiPipeline.getObjects()),s.oldLinkPositions=h.getLinkPositions(s.apiPipeline.getLinks()),s.newObjectPositions=h.moveSurroundingObjects(s.supernode,s.apiPipeline.getObjects(),"se",s.supernode.layout.defaultNodeWidth,s.supernode.layout.defaultNodeHeight,!1),s.newLinkPositions=h.moveSurroundingDetachedLinks(s.supernode,s.apiPipeline.getLinks(),"se",s.supernode.layout.defaultNodeWidth,s.supernode.layout.defaultNodeHeight,!1)),s}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.collapseSuperNodeInPlace(this.data.id,this.newObjectPositions,this.newLinkPositions)}},{key:"undo",value:function(){this.apiPipeline.expandSuperNodeInPlace(this.data.id,this.oldObjectPositions,this.oldLinkPositions)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.collapseSuperNodeInPlace")}}]),o}(i.Action);function oe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var re=function(t){n._inherits(o,t);var i=oe(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.oldIds=a.data.selectedObjects.map((function(e){return e.id})),a.oldColors=a.getOldColors(),a.actionLabel=a.createActionLabel(),a.newBackgroundColor=a.data.editParam.color,a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.setObjectsColorClassName(this.oldIds,this.newBackgroundColor)}},{key:"undo",value:function(){this.apiPipeline.setObjectsColorClassName(this.oldIds,this.oldColors)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.actionLabel}},{key:"createActionLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.colorComments",{comments_count:this.data.selectedObjectIds.length})}},{key:"getOldColors",value:function(){var e=this,t=[];return this.data.selectedObjects.forEach((function(n){t.push(e.getObjectColorClass(n))})),t}},{key:"getObjectColorClass",value:function(e){if(e.class_name){var t=e.class_name.split(" ");if(t)return t.find((function(e){return h.getBkgColorClass(e)}))}return""}}]),o}(i.Action);function ae(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var se=function(t){n._inherits(r,t);var i=ae(r);function r(t,n,o,a){var s;e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=o,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.enableMoveNodesOnSupernodeResize=a,s.supernode=s.data.targetObject,s.oldObjectPositions=[],s.newObjectPositions=[],s.oldLinkPositions=[],s.newLinkPositions=[],s.objectModel.ensurePipelineIsLoaded(s.data),s.targetApiPipeline=s.objectModel.getAPIPipeline(s.supernode.subflow_ref.pipeline_id_ref),s.targetPipeline=s.targetApiPipeline.getPipeline(),s.extPipelineFlowToDelete=s.targetPipeline.parentUrl?s.objectModel.getExternalPipelineFlow(s.targetPipeline.parentUrl):[];var d=s.getLinksToRemove(),c=s.getBindingNodes(),l=s.getNonBindingNodes(c),u=s.getCommentsToAdd(),p=s.getLinksToAdd(c,d),f={left:0,top:0};return s.enableMoveNodesOnSupernodeResize&&(s.oldObjectPositions=h.getObjectPositions(s.apiPipeline.getObjects()),s.oldLinkPositions=h.getLinkPositions(s.apiPipeline.getLinks()),f=h.getCanvasDimensions(l,u,p,0,0),s.newObjectPositions=h.moveSurroundingObjects(s.data.targetObject,s.apiPipeline.getObjects(),"se",f.width,f.height,!1),s.newLinkPositions=h.moveSurroundingDetachedLinks(s.data.targetObject,s.apiPipeline.getLinks(),"se",f.width,f.height,!1)),l.forEach((function(e){s.newObjectPositions[e.id]={x_pos:s.supernode.x_pos+e.x_pos-f.left,y_pos:s.supernode.y_pos+e.y_pos-f.top}})),u.forEach((function(e){s.newObjectPositions[e.id]={x_pos:s.supernode.x_pos+e.x_pos-f.left,y_pos:s.supernode.y_pos+e.y_pos-f.top}})),s.info={pipelineId:s.data.pipelineId,supernodeToDelete:s.supernode,nodesToAdd:l,linksToAdd:p,linksToRemove:d,commentsToAdd:u,oldObjectPositions:s.oldObjectPositions,newObjectPositions:s.newObjectPositions,oldLinkPositions:s.oldLinkPositions,newLinkPositions:s.newLinkPositions,pipelineToDelete:s.targetPipeline,extPipelineFlowToDelete:s.extPipelineFlowToDelete},s}return e._createClass(r,[{key:"getNonBindingNodes",value:function(e){return this.targetApiPipeline.getNodes().filter((function(t){return!e.some((function(e){return e.id===t.id}))}))}},{key:"getBindingNodes",value:function(){var e=this,t=[];return this.data.targetObject.inputs&&this.data.targetObject.inputs.forEach((function(n){var i=e.targetApiPipeline.getNode(n.subflow_node_ref);i&&t.push(i)})),this.data.targetObject.outputs&&this.data.targetObject.outputs.forEach((function(n){var i=e.targetApiPipeline.getNode(n.subflow_node_ref);i&&t.push(i)})),t}},{key:"getLinksToFromBindingNodes",value:function(e){return this.targetApiPipeline.getLinksContainingIds(e.map((function(e){return e.id})))}},{key:"getLinksNotToFromBindingNodes",value:function(e){var t=this.getLinksToFromBindingNodes(e);return this.targetApiPipeline.getLinks().filter((function(e){return!t.some((function(t){return t.id===e.id}))}))}},{key:"getCommentsToAdd",value:function(){return this.targetApiPipeline.getComments()}},{key:"getLinksToRemove",value:function(){return this.apiPipeline.getLinksContainingId(this.supernode.id)}},{key:"getLinksToAdd",value:function(e,t){var n=this.getLinksNotToFromBindingNodes(e),i=this.getNewLinks(t);return n.concat(i)}},{key:"getNewLinks",value:function(e){var t=this,n=[],i=e.filter((function(e){return e.type===o.NODE_LINK}));return this.supernode.inputs&&this.supernode.inputs.forEach((function(e){n=n.concat(t.getNewLinksForInput(e,i))})),this.supernode.outputs&&this.supernode.outputs.forEach((function(e){n=n.concat(t.getNewLinksForOutput(e,i))})),n}},{key:"getNewLinksForInput",value:function(e,t){var n=this,i=[],o=this.getSupernodeInputLinks(this.supernode,e.id,t),r=this.getInputBindingNode(e);if(r){var a=this.getInputBindingLinks(r);o.forEach((function(e){a.forEach((function(t){var o={};e.srcPos?o.srcPos=e.srcPos:(o.srcNodeId=e.srcNodeId,o.srcNodePortId=e.srcNodePortId),t.trgPos?o.trgPos=t.trgPos:(o.trgNodeId=t.trgNodeId,o.trgNodePortId=t.trgNodePortId);var r=n.apiPipeline.createLinkFromInfo(o);i.push(r)}))}))}return i}},{key:"getNewLinksForOutput",value:function(e,t){var n=this,i=[],o=this.getSupernodeOutputLinks(this.supernode,e.id,t),r=this.getOutputBindingNode(e);if(r){var a=this.getOutputBindingLinks(r);o.forEach((function(e){a.forEach((function(t){var o={};t.srcPos?o.srcPos=t.srcPos:(o.srcNodeId=t.srcNodeId,o.srcNodePortId=t.srcNodePortId),e.trgPos?o.trgPos=e.trgPos:(o.trgNodeId=e.trgNodeId,o.trgNodePortId=e.trgNodePortId);var r=n.apiPipeline.createLinkFromInfo(o);i.push(r)}))}))}return i}},{key:"getSupernodeInputLinks",value:function(e,t,n){return n.filter((function(n){var i=n.trgNodePortId||h.getDefaultInputPortId(e);return n.trgNodeId===e.id&&i===t}))}},{key:"getInputBindingNode",value:function(e){return this.targetApiPipeline.getNodes().find((function(t){return t.id===e.subflow_node_ref}))}},{key:"getInputBindingLinks",value:function(e){return this.targetApiPipeline.getLinksContainingSourceId(e.id).filter((function(e){return e.type===o.NODE_LINK}))}},{key:"getSupernodeOutputLinks",value:function(e,t,n){return n.filter((function(n){var i=n.srcNodePortId||h.getDefaultOutputPortId(e);return n.srcNodeId===e.id&&i===t}))}},{key:"getOutputBindingNode",value:function(e){return this.targetApiPipeline.getNodes().find((function(t){return t.id===e.subflow_node_ref}))}},{key:"getOutputBindingLinks",value:function(e){return this.targetApiPipeline.getLinksContainingTargetId(e.id).filter((function(e){return e.type===o.NODE_LINK}))}},{key:"do",value:function(){this.apiPipeline.deconstructSupernode(this.info)}},{key:"undo",value:function(){this.apiPipeline.reconstructSupernode(this.info)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.deconstructSuperNode",{node_label:this.supernode.label})}}]),r}(i.Action);function de(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ce=function(t){n._inherits(o,t);var i=de(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.linkInfo=[],a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a}return e._createClass(o,[{key:"do",value:function(){this.linkInfo=this.apiPipeline.getLink(this.data.id),this.apiPipeline.deleteLink(this.data)}},{key:"undo",value:function(){this.apiPipeline.addLinks([this.linkInfo])}},{key:"redo",value:function(){this.apiPipeline.deleteLink(this.data)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.deleteLink")}}]),o}(i.Action);function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ue=function(t){n._inherits(o,t);var i=le(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.areDetachableLinksSupported=a,s.objectsInfo=[],s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.nodesToDelete=s.objectModel.getSelectedNodes(),s.commentsToDelete=s.objectModel.getSelectedComments(),s.linksToDelete=s.objectModel.getSelectedLinks(),s.linksToUpdateInfo={},s.supernodesToDelete=[],s.nodeAndCommentsToDelete=s.nodesToDelete.concat(s.commentsToDelete),a?(s.linksToDelete=s.getConnectedLinksToDelete(s.linksToDelete,"nodeLink"),s.linksToUpdateInfo=s.getLinksToUpdateInfo()):s.linksToDelete=s.getConnectedLinksToDelete(s.linksToDelete),s.supernodesToDelete=h.filterSupernodes(s.nodesToDelete),s.pipelinesToDelete=s.objectModel.getDescPipelinesToDelete(s.supernodesToDelete,s.data.pipelineId),s.extPipelineFlowsToDelete=s.objectModel.getExternalPipelineFlowsForPipelines(s.pipelinesToDelete),s.nodesToDelete=s.nodesToDelete.filter((function(e){return!s.isSupernodeToBeDeleted(e)})),s.actionLabel=s.createActionLabel(),s}return e._createClass(o,[{key:"getConnectedLinksToDelete",value:function(e,t){var n=this;return this.nodeAndCommentsToDelete.forEach((function(i){n.apiPipeline.getLinksContainingId(i.id).forEach((function(i){n.isLinkToBeDeleted(i,e)||i.type===t||e.push(i)}))})),e}},{key:"getLinksToUpdateInfo",value:function(){var e=this,t=[],n=[];return this.apiPipeline.getLinks().forEach((function(i){if(!e.isLinkToBeDeleted(i,e.linksToDelete)){var o=e.isSourceToBeDeleted(i),r=e.isTargetToBeDeleted(i);if(o||r){var a=Object.assign({},i);o&&(delete a.srcNodeId,delete a.srcNodePortId,a.srcPos=h.getSrcPos(i,e.apiPipeline)),r&&(delete a.trgNodeId,delete a.trgNodePortId,a.trgPos=h.getTrgPos(i,e.apiPipeline)),t.push(a),n.push(i)}}})),{newLinks:t,oldLinks:n}}},{key:"isLinkToBeDeleted",value:function(e,t){return-1!==t.findIndex((function(t){return t.id===e.id}))}},{key:"isSupernodeToBeDeleted",value:function(e){return-1!==this.supernodesToDelete.findIndex((function(t){return e.id===t.id}))}},{key:"isSourceToBeDeleted",value:function(e){return-1!==this.nodeAndCommentsToDelete.findIndex((function(t){return t.id===e.srcNodeId}))}},{key:"isTargetToBeDeleted",value:function(e){return-1!==this.nodesToDelete.findIndex((function(t){return t.id===e.trgNodeId}))}},{key:"do",value:function(){this.apiPipeline.deleteAndUpdateObjects({linksToUpdate:this.linksToUpdateInfo.newLinks,linksToDelete:this.linksToDelete,supernodesToDelete:this.supernodesToDelete,pipelinesToDelete:this.pipelinesToDelete,extPipelineFlowsToDelete:this.extPipelineFlowsToDelete,nodesToDelete:this.nodesToDelete,commentsToDelete:this.commentsToDelete})}},{key:"undo",value:function(){this.apiPipeline.addAndUpdateObjects({linksToUpdate:this.linksToUpdateInfo.oldLinks,linksToAdd:this.linksToDelete,supernodesToAdd:this.supernodesToDelete,pipelinesToAdd:this.pipelinesToDelete,extPipelineFlowsToAdd:this.extPipelineFlowsToDelete,nodesToAdd:this.nodesToDelete,commentsToAdd:this.commentsToDelete})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.actionLabel}},{key:"createActionLabel",value:function(){var e="action.delete"+[{label:"Nodes",val:this.nodesToDelete.length+this.supernodesToDelete.length},{label:"Comments",val:this.commentsToDelete.length},{label:"Links",val:this.linksToDelete.length}].filter((function(e){return e.val})).map((function(e){return e.label})).join("");return this.labelUtil.getActionLabel(this,e,{nodes_count:this.nodesToDelete.length+this.supernodesToDelete.length,comments_count:this.commentsToDelete.length,links_count:this.linksToDelete.length})}}]),o}(i.Action);function pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var fe=function(t){n._inherits(o,t);var i=pe(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.links=[],a}return e._createClass(o,[{key:"do",value:function(){this.links=this.apiPipeline.disconnectObjects(this.data.selectedObjectIds)}},{key:"undo",value:function(){this.apiPipeline.addLinks(this.links)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.disconnectObjects")}}]),o}(i.Action);function he(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ge=function(t){n._inherits(o,t);var i=he(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldBreadcrumbs=a.objectModel.getBreadcrumbs(),a}return e._createClass(o,[{key:"do",value:function(){this.objectModel.setPreviousBreadcrumb()}},{key:"undo",value:function(){this.objectModel.setBreadcrumbs(this.oldBreadcrumbs)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.displayPreviousPipeline")}}]),o}(i.Action);function ye(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var me=function(t){n._inherits(o,t);var i=ye(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldBreadcrumbs=a.objectModel.getBreadcrumbs(),a}return e._createClass(o,[{key:"do",value:function(){this.data.addBreadcrumbs?(this.objectModel.ensurePipelineIsLoaded(this.data),this.objectModel.addBreadcrumbs(this.data)):0===this.data.breadcrumbIndex?this.objectModel.setIndexedBreadcrumb(this.data):this.data.breadcrumbIndex&&(this.objectModel.ensurePipelineIsLoaded(this.data),this.objectModel.setIndexedBreadcrumb(this.data))}},{key:"undo",value:function(){this.objectModel.setBreadcrumbs(this.oldBreadcrumbs)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.displaySubPipeline")}}]),o}(i.Action);function _e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var ve=function(t){n._inherits(o,t);var i=_e(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.previousComment=a.apiPipeline.getComment(a.data.id),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.editComment(this.data)}},{key:"undo",value:function(){this.apiPipeline.editComment(this.previousComment)}},{key:"redo",value:function(){this.apiPipeline.editComment(this.data)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.editComment")}}]),o}(i.Action);function be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Pe=function(t){n._inherits(r,t);var i=be(r);function r(t,n,a){var s;return e._classCallCheck(this,r),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=a,s.apiPipeline=s.objectModel.getAPIPipeline(s.data.pipelineId),s.data.objType===o.DEC_LINK?s.previousDecorations=s.apiPipeline.getLinkDecorations(s.data.objId)||[]:s.data.objType===o.DEC_NODE&&(s.previousDecorations=s.apiPipeline.getNodeDecorations(s.data.objId)||[]),s.newDecorations=s.previousDecorations.map((function(e){return e.id===s.data.decId?Object.assign({},e,{label:s.data.label}):e})),s}return e._createClass(r,[{key:"do",value:function(){this.data.objType===o.DEC_LINK?this.apiPipeline.setLinkDecorations(this.data.objId,this.newDecorations):this.data.objType===o.DEC_NODE&&this.apiPipeline.setNodeDecorations(this.data.objId,this.newDecorations)}},{key:"undo",value:function(){this.data.objType===o.DEC_LINK?this.apiPipeline.setLinkDecorations(this.data.objId,this.previousDecorations):this.data.objType===o.DEC_NODE&&this.apiPipeline.setNodeDecorations(this.data.objId,this.previousDecorations)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.data.objType===o.DEC_LINK?this.labelUtil.getActionLabel(this,"action.editLinkDecorationLabel"):this.labelUtil.getActionLabel(this,"action.editNodeDecorationLabel")}}]),r}(i.Action);function ke(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Ie=function(t){n._inherits(o,t);var i=ke(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.previousLabel=a.apiPipeline.getNode(t.nodeId).label,a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.setNodeLabel(this.data.nodeId,this.data.label)}},{key:"undo",value:function(){this.apiPipeline.setNodeLabel(this.data.nodeId,this.previousLabel)}},{key:"redo",value:function(){this.apiPipeline.setNodeLabel(this.data.nodeId,this.data.label)}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.setNodeLabel")}}]),o}(i.Action);function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Ee=function(t){n._inherits(o,t);var i=Ne(o);function o(t,n,r,a){var s;return e._classCallCheck(this,o),(s=i.call(this,t)).data=t,s.objectModel=n,s.labelUtil=r,s.oldObjectPositions=[],s.newObjectPositions=[],s.oldLinkPositions=[],s.newLinkPositions=[],s.enableMoveNodesOnSupernodeResize=a,s.apiPipeline=s.objectModel.getAPIPipeline(t.pipelineId),s.supernode=s.apiPipeline.getNode(s.data.id),s.enableMoveNodesOnSupernodeResize&&(s.oldObjectPositions=h.getObjectPositions(s.apiPipeline.getObjects()),s.oldLinkPositions=h.getLinkPositions(s.apiPipeline.getLinks()),s.newObjectPositions=h.moveSurroundingObjects(s.supernode,s.apiPipeline.getObjects(),"se",h.getSupernodeExpandedWidth(s.supernode,s.objectModel.getCanvasLayout()),h.getSupernodeExpandedHeight(s.supernode,s.objectModel.getCanvasLayout()),!1),s.newLinkPositions=h.moveSurroundingDetachedLinks(s.supernode,s.apiPipeline.getLinks(),"se",h.getSupernodeExpandedWidth(s.supernode,s.objectModel.getCanvasLayout()),h.getSupernodeExpandedHeight(s.supernode,s.objectModel.getCanvasLayout()),!1)),s}return e._createClass(o,[{key:"do",value:function(){this.objectModel.ensurePipelineIsLoaded(this.data),this.apiPipeline.expandSuperNodeInPlace(this.data.id,this.newObjectPositions,this.newLinkPositions)}},{key:"undo",value:function(){this.apiPipeline.collapseSuperNodeInPlace(this.data.id,this.oldObjectPositions,this.oldLinkPositions)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.expandSuperNodeInPlace",{node_label:this.supernode.label})}}]),o}(i.Action);function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Oe=function(t){n._inherits(o,t);var i=Se(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.node=t.node,a.firstLinkSrcInfo={id:t.link.srcNodeId,portId:t.link.srcNodePortId},a.firstLinkTrgInfo={id:a.node.id},a.secondLinkSrcInfo={id:a.node.id},a.secondLinkTrgInfo={id:t.link.trgNodeId,portId:t.link.trgNodePortId},a}return e._createClass(o,[{key:"getData",value:function(){return this.data.newFirstLink=this.firstLink,this.data.newSecondLink=this.secondLink,this.data}},{key:"do",value:function(){this.apiPipeline.deleteLink({id:this.data.link.id}),this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:this.data.offsetX,offsetY:this.data.offsetY}),this.firstLink=this.apiPipeline.createNodeLink(this.firstLinkSrcInfo,this.firstLinkTrgInfo,{type:"nodeLink"}),this.secondLink=this.apiPipeline.createNodeLink(this.secondLinkSrcInfo,this.secondLinkTrgInfo,{type:"nodeLink"}),this.apiPipeline.addLinks([this.firstLink,this.secondLink])}},{key:"undo",value:function(){this.apiPipeline.deleteLink({id:this.firstLink.id}),this.apiPipeline.deleteLink({id:this.secondLink.id}),this.apiPipeline.moveObjects({nodes:[this.node.id],offsetX:-this.data.offsetX,offsetY:-this.data.offsetY}),this.apiPipeline.addLinks([this.data.link])}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.insertNodeIntoLink",{node_label:this.node.label})}}]),o}(i.Action);function Ce(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var je=function(t){n._inherits(o,t);var i=Ce(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.moveObjects(this.data)}},{key:"undo",value:function(){this.data.offsetX=-this.data.offsetX,this.data.offsetY=-this.data.offsetY,this.apiPipeline.moveObjects(this.data)}},{key:"redo",value:function(){this.data.offsetX=-this.data.offsetX,this.data.offsetY=-this.data.offsetY,this.apiPipeline.moveObjects(this.data)}},{key:"getLabel",value:function(){return 1===this.data.nodes.length?this.labelUtil.getActionLabel(this,"action.moveObject"):this.labelUtil.getActionLabel(this,"action.moveObjects")}}]),o}(i.Action);function Te(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var we=function(t){n._inherits(o,t);var i=Te(o);function o(t,n,r,a,s,d){var c;e._classCallCheck(this,o),(c=i.call(this,t)).data=t,c.objectModel=n,c.labelUtil=r,c.viewportDimensions=a,c.areDetachableLinksInUse=s,c.isSnapToGridInUse=d,c.apiPipeline=c.objectModel.getAPIPipeline(t.pipelineId),c.adjustObjectsPositions(),c.clones=c.objectModel.cloneObjectsToPaste(t.objects.nodes,t.objects.comments,t.objects.links);var l=c.objectModel.extractAddDataPipelines(c.clones.clonedNodes),u=l.nodes,p=l.pipelines;return c.clones.clonedNodes=u,c.pipelines=p,c.selectionIds=c.getSelectionIds(c.clones),c}return e._createClass(o,[{key:"adjustObjectsPositions",value:function(){var e=this.data.objects,t=h.getCanvasDimensions(e.nodes,e.comments,e.links,0,0);if(t)if(this.data.mousePos&&this.data.mousePos.x&&this.data.mousePos.y){var n=this.data.mousePos.x-t.left,i=this.data.mousePos.y-t.top;this.moveObjectsPositions(e,n,i)}else{var o=this.viewportDimensions;if(o.x<t.left&&o.y<t.top&&o.x+o.width>t.left&&o.y+o.height>t.top)this.ensureNoOverlap(e);else{var r=o.x+o.width/2-t.width/2-t.left,a=o.y+o.height/2-t.height/2-t.top;this.moveObjectsPositions(e,r,a),this.ensureNoOverlap(e)}}}},{key:"ensureNoOverlap",value:function(e){var t=10,n=10;if(this.isSnapToGridInUse){var i=this.objectModel.getCanvasLayout();t=i.snapToGridXPx,n=i.snapToGridYPx}for(;this.apiPipeline.exactlyOverlaps(e.nodes,e.comments,e.links);)this.moveObjectsPositions(e,t,n)}},{key:"moveObjectsPositions",value:function(e,t,n){e.nodes&&e.nodes.forEach((function(e){e.x_pos+=t,e.y_pos+=n})),e.comments&&e.comments.forEach((function(e){e.x_pos+=t,e.y_pos+=n,e.selectedObjectIds=[]})),e.links&&e.links.forEach((function(e){e.srcPos&&(e.srcPos.x_pos+=t,e.srcPos.y_pos+=n),e.trgPos&&(e.trgPos.x_pos+=t,e.trgPos.y_pos+=n)}))}},{key:"getSelectionIds",value:function(e){var t=[];return e.clonedNodes.forEach((function(e){t.push(e.id)})),e.clonedComments.forEach((function(e){t.push(e.id)})),this.areDetachableLinksInUse&&e.clonedLinks.forEach((function(e){return t.push(e.id)})),t}},{key:"getData",value:function(){return this.data.clonedNodes=this.clones.clonedNodes,this.data.clonedComments=this.clones.clonedComments,this.data.clonedLinks=this.clones.clonedLinks,this.data}},{key:"do",value:function(){this.apiPipeline.addPastedObjects({nodesToAdd:this.clones.clonedNodes,commentsToAdd:this.clones.clonedComments,linksToAdd:this.clones.clonedLinks,pipelinesToAdd:this.pipelines,selections:this.selectionIds})}},{key:"undo",value:function(){var e=h.filterSupernodes(this.clones.clonedNodes),t=this.objectModel.getDescPipelinesToDelete(e,this.data.pipelineId),n=this.objectModel.getExternalPipelineFlowsForPipelines(t);this.apiPipeline.deletePastedObjects({nodesToDelete:this.clones.clonedNodes,commentsToDelete:this.clones.clonedComments,linksToDelete:this.clones.clonedLinks,pipelinesToDelete:t,extPipelineFlowsToDelete:n})}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.pasteObjects")}}]),o}(i.Action);function Le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Ae=function(t){n._inherits(r,t);var i=Le(r);function r(t,n,o){var a;return e._classCallCheck(this,r),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=o,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.data.addedNodeTypes=a.apiPipeline.createNodesForPalette(a.data.selectedObjectIds),a}return e._createClass(r,[{key:"do",value:function(){this.objectModel.addNodeTypesToPalette(this.data.addedNodeTypes,o.SAVED_NODES_CATEGORY_ID,this.labelUtil.getLabel("palette.saved.nodes.label"),this.labelUtil.getLabel("palette.saved.nodes.description"),o.SAVED_NODES_FOLDER_ICON)}},{key:"undo",value:function(){var e=this.data.addedNodeTypes.map((function(e){return e.id}));this.objectModel.removeNodesFromPalette(e,o.SAVED_NODES_CATEGORY_ID)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.saveToPalette")}}]),r}(i.Action),xe=t._baseFor,De=y,Me=o.keysIn_1;var Re=function(e,t){return null==e?e:xe(e,De(t),Me)};function Ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var Fe=function(t){n._inherits(o,t);var i=Ue(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldPipelineObjStyles=[],Re(a.data.pipelineObjectIds,(function(e,t){var n=a.objectModel.getAPIPipeline(t);a.oldPipelineObjStyles=[],e.forEach((function(e){a.oldPipelineObjStyles.push({pipelineId:t,objId:e,style:n.getObjectStyle(e,a.data.temporary)})}))})),a}return e._createClass(o,[{key:"do",value:function(){this.objectModel.setObjectsStyle(this.data.pipelineObjectIds,this.data.style,this.data.temporary)}},{key:"undo",value:function(){this.objectModel.setObjectsMultiStyle(this.oldPipelineObjStyles,this.data.temporary)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.setObjectsStyle")}}]),o}(i.Action);function Be(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var He=function(t){n._inherits(o,t);var i=Be(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.oldPipelineLinkStyles=[],Re(a.data.pipelineLinkIds,(function(e,t){var n=a.objectModel.getAPIPipeline(t);a.oldPipelineLinkStyles=[],e.forEach((function(e){a.oldPipelineLinkStyles.push({pipelineId:t,objId:e,style:n.getLinkStyle(e,a.data.temporary)})}))})),a}return e._createClass(o,[{key:"do",value:function(){this.objectModel.setLinksStyle(this.data.pipelineLinkIds,this.data.style,this.data.temporary)}},{key:"undo",value:function(){this.objectModel.setLinksMultiStyle(this.oldPipelineLinkStyles,this.data.temporary)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.setLinksStyle")}}]),o}(i.Action);function Ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var qe=function(t){n._inherits(o,t);var i=Ge(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.oldLink=a.apiPipeline.getLink(t.newLink.id),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.updateLink(this.data.newLink)}},{key:"undo",value:function(){this.apiPipeline.updateLink(this.oldLink)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.updateLink")}}]),o}(i.Action);function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){o._defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var $e=function(){function t(){e._classCallCheck(this,t),this.intl=null,this.actionLabelHandler=null,this.defaultMessages=ze(ze({},u),o.defaultMessages2)}return e._createClass(t,[{key:"setIntl",value:function(e){this.intl=e}},{key:"setActionLabelHandler",value:function(e){this.actionLabelHandler=e}},{key:"getActionLabel",value:function(e,t,n){if(this.actionLabelHandler){var i=this.actionLabelHandler(e,n);if(i)return i}return this.getLabel(t,n)}},{key:"getLabel",value:function(e,t){return void 0!==this.intl&&null!==this.intl?this.intl.formatMessage({id:e,defaultMessage:this.defaultMessages[e]},t):this.defaultMessages[e]}}]),t}(),We=t._baseDifference,Ke=t._baseFlatten,Ye=t._baseRest,Xe=t.isArrayLikeObject_1,Je=t.last_1,Ze=Ye((function(e,t){var n=Je(t);return Xe(n)&&(n=void 0),Xe(e)?We(e,Ke(t,1,Xe,!0),void 0,n):[]})),Qe=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"convertCanvasToCanvasInfo",value:function(e){var t={id:e.diagram.id,nodes:this.getNodes(e.diagram.nodes),comments:this.getComments(e.diagram.comments),links:this.getLinks(e.diagram.links,e.diagram.nodes,e.diagram.comments),runtime_ref:""};return e.zoom&&"number"==typeof e.zoom&&100!==e.zoom&&(t.zoom={k:e.zoom/100,x:0,y:0}),{doc_type:"pipeline",version:"3.0",json_schema:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",id:e.id,primary_pipeline:e.diagram.id,pipelines:[t]}}},{key:"getNodes",value:function(e){var t=this;return e.map((function(e){var n=t.getType(e),i={id:e.id,image:e.image,x_pos:void 0!==e.x_pos?e.x_pos:e.xPos,y_pos:void 0!==e.y_pos?e.y_pos:e.yPos,class_name:e.className,label:e.objectData.label,type:n,style:e.style};return e.objectData&&e.objectData.description&&(i.description=e.objectData.description),e.inputPorts&&(i.inputs=t.getInputPorts(e.inputPorts,1)),e.outputPorts&&(i.outputs=t.getOutputPorts(e.outputPorts,-1)),e.decorations&&(i.decorations=t.getDecorations(e.decorations)),n===o.SUPER_NODE&&(i.subflow_ref={pipeline_id_ref:e.subDiagramId,url:"app_defined"},i.open_with_tool="canvas",i.is_expanded=!1,i.expanded_width=200,i.expanded_height=200),n===o.MODEL_NODE&&(i.model_ref=""),n!==o.EXECUTION_NODE&&n!==o.BINDING&&n!==o.MODEL_NODE||(e.userData&&e.userData.typeId?i.op=e.userData.typeId:i.op=""),i}))}},{key:"getType",value:function(e){return e.userData&&!0===e.userData.containsModel?o.MODEL_NODE:e.inputPorts&&e.inputPorts.length>0&&e.outputPorts&&e.outputPorts.length>0?e.subDiagramId?o.SUPER_NODE:o.EXECUTION_NODE:o.BINDING}},{key:"getInputPorts",value:function(e,t){var n=this;return e.map((function(e){return{id:e.name,label:e.label,cardinality:{min:n.getMinCard(e.cardinality),max:n.getMaxCard(e.cardinality,t)}}}))}},{key:"getOutputPorts",value:function(e,t){var n=this;return e.map((function(e){return{id:e.name,label:e.label,cardinality:{min:n.getMinCard(e.cardinality),max:n.getMaxCard(e.cardinality,t)}}}))}},{key:"getMinCard",value:function(e){return e?Number(e.split(":")[0]):0}},{key:"getMaxCard",value:function(e,t){return e?Number(e.split(":")[1]):t}},{key:"getDecorations",value:function(e){return e.map((function(e){return{position:e.position,class_name:e.className,hotspot:e.hotspot,id:e.id,image:e.image,outline:e.outline,x_pos:e.x_pos,y_pos:e.y_pos,width:e.width,height:e.height}}))}},{key:"getComments",value:function(e){return e.map((function(e){return{id:e.id,class_name:e.className,content:e.content,x_pos:void 0!==e.x_pos?e.x_pos:e.xPos,y_pos:void 0!==e.y_pos?e.y_pos:e.yPos,height:e.height,width:e.width,style:e.style}}))}},{key:"getLinks",value:function(e,t,n){var i=this,o=[];return e.forEach((function(e){if(i.isValidLink(e,t,n)){var r={id:e.id,class_name:e.className,srcNodeId:e.source,trgNodeId:e.target,type:i.getLinkType(e),style:e.style};e.sourcePort&&(r.srcNodePortId=e.sourcePort),e.targetPort&&(r.trgNodePortId=e.targetPort),o.push(r)}})),o}},{key:"isValidLink",value:function(e,t,n){var i=!1;return("nodeLink"===this.getLinkType(e)||"associationLink"===this.getLinkType(e))&&t.findIndex((function(t){return t.id===e.source}))>-1&&t.findIndex((function(t){return t.id===e.target}))>-1&&(i=!0),"commentLink"===this.getLinkType(e)&&n.findIndex((function(t){return t.id===e.source}))>-1&&t.findIndex((function(t){return t.id===e.target}))>-1&&(i=!0),i}},{key:"getLinkType",value:function(e){if(t.has_1(e,"userData.linkType"))switch(e.userData.linkType){case"comment":return"commentLink";case"object":return"associationLink";default:return"nodeLink"}return"nodeLink"}},{key:"convertPaletteToPipelineFlowPalette",value:function(e){return{version:"1.0",categories:this.getCategories(e.categories)}}},{key:"getCategories",value:function(e){var t=this;return e.map((function(e){return{category:e.category,label:e.label,description:e.description,image:e.image,is_open:e.is_open,nodetypes:t.convertNodeTypes(e.nodetypes)}}))}},{key:"convertNodeTypes",value:function(e){var t=this;return e.map((function(e){var n={type:t.getType(e),label:e.label,description:e.description,operator_id_ref:e.typeId,image:e.image};return e.inputPorts&&(n.input_ports=t.convertPalettePorts(e.inputPorts,1)),e.outputPorts&&(n.output_ports=t.convertPalettePorts(e.outputPorts,-1)),n}))}},{key:"convertPalettePorts",value:function(e,t){var n=this;return e.map((function(e){return{id:e.name,label:e.label,cardinality:n.convertPaletteCardinality(e.cardinality,t)}}))}},{key:"convertPaletteCardinality",value:function(e,t){return{min:this.getMinCard(e),max:this.getMaxCard(e,t)}}},{key:"isVersion0Palette",value:function(e){for(var t=!1,n=0;n<e.categories.length;n++)if(this.isVersion0Category(e.categories[n])){t=!0;break}return t}},{key:"isVersion0Category",value:function(e){var t=!1;if(e.nodetypes)for(var n=0;n<e.nodetypes.length;n++)if(e.nodetypes[n].typeId){t=!0;break}return t}}]),n}(),et=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"getCanvasBasedOnCanvasInfo",value:function(e,t){return Object.assign({},e,{diagram:this.getDiagram(e,t.pipelines[0])})}},{key:"getDiagram",value:function(e,t){return{id:t.id,nodes:this.getCanvasNodes(t.nodes,e),comments:this.getCanvasComments(t.comments),links:this.getCanvasLinks(t.links)}}},{key:"getCanvasNodes",value:function(e,t){var n=this;return e.map((function(e){var i={id:e.id};e.inputs&&(i.inputPorts=n.getCanvasPorts(e.inputs)),e.outputs&&(i.outputPorts=n.getCanvasPorts(e.outputs)),i.image=e.image,i.x_pos=e.x_pos,i.y_pos=e.y_pos,i.className=e.class_name,i.objectData={label:e.label,description:e.description||""},i.userData={typeId:e.op},e.decorations&&(i.decorations=n.getCanvasDecorations(e.decorations));var o=n.getOldNode(e.id,t);return o&&o.userData&&(i.userData=o.userData),i}))}},{key:"getCanvasPorts",value:function(e){return e.map((function(e){var t={name:e.id,label:e.label};return e.cardinality&&(t.cardinality=e.cardinality.min+":"+e.cardinality.max),t}))}},{key:"getCanvasDecorations",value:function(e){return e.map((function(e){var t={};return e.position&&(t.position=e.position),e.class_name&&(t.className=e.class_name),e.image&&(t.image=e.image),e.hotspot&&(t.hotspot=e.hotspot),e.id&&(t.id=e.id),t}))}},{key:"getOldNode",value:function(e,t){if(t&&t.diagram&&t.diagram.nodes){var n=t.diagram.nodes.findIndex((function(t){return t.id===e}));if(n>-1)return t.diagram.nodes[n]}return null}},{key:"getCanvasComments",value:function(e){return e.map((function(e){return{id:e.id,className:e.class_name,content:e.content,height:e.height,width:e.width,x_pos:e.x_pos,y_pos:e.y_pos}}))}},{key:"getCanvasLinks",value:function(e){return e.map((function(e){var t={id:e.id,className:e.class_name,source:e.srcNodeId};e.srcNodePortId&&(t.sourcePort=e.srcNodePortId),t.target=e.trgNodeId,e.trgNodePortId&&(t.targetPort=e.trgNodePortId);var n="";switch(e.type){case"commentLink":n="comment";break;case"associationLink":n="object";break;default:n="data"}return t.userData={linkType:n},t}))}}]),t}(),tt=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"convertPipelineFlowToCanvasInfo",value:function(e,t){var n=this.convertPipelinesToCanvasInfoPipelines(e.pipelines,t);return Object.assign({},e,{pipelines:n})}},{key:"convertPipelinesToCanvasInfoPipelines",value:function(e,t){var n=this,i=[];return e&&(i=e.map((function(e){return n.convertPipelineToCanvasInfoPipeline(e,t)}))),i}},{key:"convertPipelineToCanvasInfoPipeline",value:function(e,n){var i=t.has_1(e,"nodes")?e.nodes:[],o=t.has_1(e,"app_data.ui_data.comments")?e.app_data.ui_data.comments:[],r=t.has_1(e,"app_data.ui_data.detached_links")?e.app_data.ui_data.detached_links:[],a={id:e.id,name:e.name,nodes:this.convertNodes(i,n),comments:this.convertComments(o),links:this.convertLinks(i,o,r),runtime_ref:e.runtime_ref,app_data:e.app_data,parameters:e.parameters};return t.has_1(e,"app_data.ui_data.zoom")&&("number"==typeof e.app_data.ui_data.zoom?a.zoom={x:0,y:0,k:e.app_data.ui_data.zoom/100}:a.zoom=e.app_data.ui_data.zoom),t.has_1(a,"app_data.ui_data.comments")&&delete a.app_data.ui_data.comments,t.has_1(a,"app_data.ui_data.detached_links")&&delete a.app_data.ui_data.detached_links,a}},{key:"convertNodes",value:function(e,t){var n=this;return e.map((function(e){return n.convertNode(e,t)}))}},{key:"convertNode",value:function(e,n){var i={id:e.id,type:e.type,outputs:this.convertOutputs(e),inputs:this.convertInputs(e),label:this.convertLabel(e),x_pos:t.has_1(e,"app_data.ui_data.x_pos")?e.app_data.ui_data.x_pos:10,y_pos:t.has_1(e,"app_data.ui_data.y_pos")?e.app_data.ui_data.y_pos:10,decorations:t.has_1(e,"app_data.ui_data.decorations")?this.convertDecorations(e.app_data.ui_data.decorations):[],parameters:t.has_1(e,"parameters")?e.parameters:[],messages:t.has_1(e,"app_data.ui_data.messages")?e.app_data.ui_data.messages:[],ui_parameters:t.has_1(e,"app_data.ui_data.ui_parameters")?e.app_data.ui_data.ui_parameters:[],app_data:t.has_1(e,"app_data")?this.removeUiDataFromAppData(e.app_data):[]};return e.type!==o.EXECUTION_NODE&&e.type!==o.BINDING&&e.type!==o.MODEL_NODE||(i.op=e.op),e.type===o.SUPER_NODE&&(t.has_1(e,"open_with_tool")&&(i.open_with_tool=e.open_with_tool),i.subflow_ref=t.has_1(e,"subflow_ref")?this.convertSubFlowRef(e.subflow_ref):{},i.is_expanded=!!t.has_1(e,"app_data.ui_data.is_expanded")&&e.app_data.ui_data.is_expanded,i.expanded_width=t.has_1(e,"app_data.ui_data.expanded_width")?e.app_data.ui_data.expanded_width:n.supernodeDefaultWidth,i.expanded_height=t.has_1(e,"app_data.ui_data.expanded_height")?e.app_data.ui_data.expanded_height:n.supernodeDefaultHeight),e.type===o.MODEL_NODE&&(i.model_ref=t.has_1(e,"model_ref")?e.model_ref:""),t.has_1(e,"app_data.ui_data.is_resized")&&(i.isResized=e.app_data.ui_data.is_resized,i.resizeHeight=e.app_data.ui_data.resize_height,i.resizeWidth=e.app_data.ui_data.resize_width),t.has_1(e,"app_data.ui_data.description")&&(i.description=e.app_data.ui_data.description),t.has_1(e,"app_data.ui_data.image")&&(i.image=e.app_data.ui_data.image),t.has_1(e,"app_data.ui_data.class_name")&&(i.class_name=e.app_data.ui_data.class_name),t.has_1(e,"app_data.ui_data.style")&&(i.style=e.app_data.ui_data.style),t.has_1(e,"app_data.ui_data.sub_pipelines")&&(i.sub_pipelines=e.app_data.ui_data.sub_pipelines),t.has_1(e,"isSupernodeInputBinding")&&(i.isSupernodeInputBinding=!0),t.has_1(e,"isSupernodeOutputBinding")&&(i.isSupernodeOutputBinding=!0),t.has_1(e,"connection")&&(i.connection=e.connection),t.has_1(e,"data_asset")&&(i.data_asset=e.data_asset),i}},{key:"convertSubFlowRef",value:function(e){var t={pipeline_id_ref:e.pipeline_id_ref};return e.url&&(t.url=e.url),t}},{key:"convertLabel",value:function(e){var n=t.has_1(e,"app_data.ui_data.label")?e.app_data.ui_data.label:"";return t.isObject_1(n)&&n.default?n.default:n}},{key:"convertOutputs",value:function(e){var t=this;return e.outputs?e.outputs.map((function(e){return t.convertPortObject(e)})):e.outputs}},{key:"convertInputs",value:function(e){var t=this;return e.inputs?e.inputs.map((function(e){return t.convertPortObject(e)})):e.inputs}},{key:"convertPortObject",value:function(e){var n={id:e.id,label:this.convertLabel(e)};return t.has_1(e,"subflow_node_ref")&&(n.subflow_node_ref=e.subflow_node_ref),t.has_1(e,"schema_ref")&&(n.schema_ref=e.schema_ref),t.has_1(e,"app_data.ui_data.cardinality")&&(n.cardinality={min:e.app_data.ui_data.cardinality.min,max:e.app_data.ui_data.cardinality.max}),t.has_1(e,"app_data.ui_data.class_name")&&(n.class_name=e.app_data.ui_data.class_name),t.has_1(e,"parameters")&&(n.parameters=e.parameters),e.app_data&&(n.app_data=this.removeUiDataFromAppData(e.app_data)),n}},{key:"convertDecorations",value:function(e){var t=this,n=[];return e&&e.forEach((function(e){var i=Object.assign({},e,{id:e.id||t.getUUID()});n.push(i)})),n}},{key:"convertComments",value:function(e){return e.map((function(e){var n={id:e.id,content:e.content,height:e.height,width:e.width,x_pos:e.x_pos,y_pos:e.y_pos};return t.has_1(e,"class_name")&&(n.class_name=e.class_name),t.has_1(e,"style")&&(n.style=e.style),n}))}},{key:"convertLinks",value:function(e,n,i){var o=this,r=[];return e.forEach((function(n){n.inputs&&n.inputs.forEach((function(t){t.links&&t.links.forEach((function(i){if(o.isNode(e,i.node_id_ref)){var a=o.createDataLink(i,i.node_id_ref,i.port_id_ref,n.id,t.id);r.push(a)}}))})),t.has_1(n,"app_data.ui_data.associations")&&!t.isEmpty_1(n.app_data.ui_data.associations)&&n.app_data.ui_data.associations.forEach((function(i){if(o.isNode(e,i.node_ref)){var a={id:i.id?i.id:o.getUUID(),srcNodeId:n.id,trgNodeId:i.node_ref,type:"associationLink",decorations:i.decorations};t.has_1(i,"class_name")&&(a.class_name=i.class_name),r.push(a)}}))})),n.forEach((function(n){n.associated_id_refs&&n.associated_id_refs.forEach((function(i){if(o.isNode(e,i.node_ref)){var a={id:i.id?i.id:o.getUUID(),srcNodeId:n.id,trgNodeId:i.node_ref,type:"commentLink"};t.has_1(i,"class_name")&&(a.class_name=i.class_name),i.style&&(a.style=i.style),r.push(a)}}))})),i.forEach((function(e){var t=o.createDataLink(e,e.src_node_id,e.src_node_port_id,e.trg_node_id,e.trg_node_port_id);e.src_pos&&(t.srcPos=e.src_pos),e.trg_pos&&(t.trgPos=e.trg_pos),r.push(t)})),r}},{key:"isNode",value:function(e,t){return-1!==e.findIndex((function(e){return e.id===t}))}},{key:"getUUID",value:function(){return s.v4()}},{key:"createDataLink",value:function(e,n,i,o,r){var a={id:t.has_1(e,"id")?e.id:this.getUUID(),srcNodeId:n,trgNodeId:o,trgNodePortId:r,type:"nodeLink"};return t.has_1(e,"app_data.ui_data.class_name")&&(a.class_name=e.app_data.ui_data.class_name),t.has_1(e,"app_data.ui_data.style")&&(a.style=e.app_data.ui_data.style),t.has_1(e,"app_data.ui_data.decorations")&&(a.decorations=e.app_data.ui_data.decorations),e.app_data&&(a.app_data=this.removeUiDataFromAppData(e.app_data)),i&&(a.srcNodePortId=i),e.link_name&&(a.linkName=e.link_name),e.type_attr&&(a.typeAttr=e.type_attr),e.description&&(a.description=e.description),a}},{key:"removeUiDataFromAppData",value:function(e){var t;return e&&delete(t=o.cloneDeep_1(e)).ui_data,t}}]),n}(),nt=function(){function n(){e._classCallCheck(this,n)}return e._createClass(n,null,[{key:"createPipelineFlow",value:function(e){var t=o.cloneDeep_1(e);return delete t.subdueStyle,delete t.hideComments,Object.assign({},t,{pipelines:this.createPipelinesFromCanvasInfo(t)})}},{key:"createPipelinesFromCanvasInfo",value:function(e){var t=this;return e?this.filterOutExternalPipelines(e.pipelines).map((function(e){return t.createPipeline(e)})):{}}},{key:"filterOutExternalPipelines",value:function(e){return e.filter((function(e){return!e.parentUrl}))}},{key:"createPipeline",value:function(e){var t={id:e.id};return e.name&&(t.name=e.name),t.nodes=this.createNodes(e),t.app_data=this.createPipelineAppData(e),t.runtime_ref=e.runtime_ref,e.parameters&&(t.parameters=e.parameters),t}},{key:"createNodes",value:function(e){var t=this;return e.nodes.map((function(n){return t.createSchemaNode(n,e.links)}))}},{key:"createSchemaNode",value:function(e,n){var i={id:e.id,type:e.type};e.type!==o.EXECUTION_NODE&&e.type!==o.BINDING&&e.type!==o.MODEL_NODE||(e.op||""===e.op)&&(i.op=e.op),e.type===o.SUPER_NODE&&(e.open_with_tool&&(i.open_with_tool=e.open_with_tool),i.subflow_ref=e.subflow_ref),e.type===o.MODEL_NODE&&(i.model_ref=e.model_ref),i.app_data=Object.assign({},e.app_data,{ui_data:this.createNodeUiData(e)}),e.inputs&&(i.inputs=this.createInputs(e,n)),e.outputs&&(i.outputs=this.createOutputs(e)),e.parameters&&!t.isEmpty_1(e.parameters)&&(i.parameters=e.parameters),e.connection&&(i.connection=e.connection),e.data_asset&&(i.data_asset=e.data_asset);var r=this.createAssociationLinks(e,n);return t.isEmpty_1(r)||(i.app_data.ui_data.associations=r),i}},{key:"createNodeUiData",value:function(e){var n={label:e.label,image:e.image,x_pos:e.x_pos,y_pos:e.y_pos};if(e.class_name&&(n.class_name=e.class_name),e.style&&(n.style=e.style),e.description&&(n.description=e.description),e.type===o.SUPER_NODE?(n.is_expanded=e.is_expanded,n.expanded_width=e.expanded_width,n.expanded_height=e.expanded_height):e.isResized&&(n.is_resized=e.isResized,n.resize_width=e.width,n.resize_height=e.height),e.messages&&!t.isEmpty_1(e.messages)&&(n.messages=e.messages),e.ui_parameters&&!t.isEmpty_1(e.ui_parameters)&&(n.ui_parameters=e.ui_parameters),e.decorations){var i=this.createDecorations(e.decorations);i.length>0&&(n.decorations=i)}return n}},{key:"createDecorations",value:function(e){var t=[];return e&&e.forEach((function(e){if(!e.temporary&&!e.jsx){var n=Object.assign({},e);t.push(n)}})),t}},{key:"createInputs",value:function(e,t){var n=this,i=[];return e.inputs.forEach((function(r,a){var s={id:r.id};e.type===o.SUPER_NODE&&r.subflow_node_ref&&(s.subflow_node_ref=r.subflow_node_ref),r.schema_ref&&(s.schema_ref=r.schema_ref),s.app_data=Object.assign({},r.app_data,{ui_data:n.createPortUiData(r)});var d=n.createLinks(t,e.id,r.id,a);d.length>0&&(s.links=d),r.parameters&&(s.parameters=r.parameters),i.push(s)})),i}},{key:"createOutputs",value:function(e){var t=this,n=[];return e.outputs.forEach((function(i){var r={id:i.id};e.type===o.SUPER_NODE&&i.subflow_node_ref&&(r.subflow_node_ref=i.subflow_node_ref),i.schema_ref&&(r.schema_ref=i.schema_ref),r.app_data=Object.assign({},i.app_data,{ui_data:t.createPortUiData(i)}),i.parameters&&(r.parameters=i.parameters),n.push(r)})),n}},{key:"createPortUiData",value:function(e){var t={};return e.cardinality&&(t.cardinality=e.cardinality),e.class_name&&(t.class_name=e.class_name),t.label=e.label,t}},{key:"createLinks",value:function(e,t,n,i){var o=this,r=[];e&&this.getFilteredCanvasLinks(e,t,n,i).forEach((function(e){if(void 0!==e.srcNodeId){var t={id:e.id,node_id_ref:e.srcNodeId};e.srcNodePortId&&(t.port_id_ref=e.srcNodePortId),t=o.addNodeLinkCommonAttrs(t,e),r.push(t)}}));return r}},{key:"getFilteredCanvasLinks",value:function(e,t,n,i){return e.filter((function(e){if("nodeLink"===e.type&&e.trgNodeId===t)if(e.trgNodePortId){if(e.trgNodePortId===n)return!0}else if(0===i)return!0;return!1}))}},{key:"createPipelineAppData",value:function(e){return e.app_data?Object.assign({},e.app_data,{ui_data:this.createPipelineUiData(e)}):{ui_data:this.createPipelineUiData(e)}}},{key:"createPipelineUiData",value:function(e){var t=null;t=e.app_data&&e.app_data.ui_data?Object.assign({},e.app_data.ui_data,{comments:this.createComments(e.comments,e.links)}):{comments:this.createComments(e.comments,e.links)};var n=this.createDetachedLinks(e.links);return n.length>0&&(t.detached_links=n),e.zoom&&(t.zoom=e.zoom),t}},{key:"createComments",value:function(e,t){var n=this;return e.map((function(e){var i={id:e.id,x_pos:e.x_pos,y_pos:e.y_pos,width:e.width,height:e.height};return e.class_name&&(i.class_name=e.class_name),i.content=e.content,i.associated_id_refs=n.createCommentLinks(t,e.id),e.style&&(i.style=e.style),i}))}},{key:"createCommentLinks",value:function(e,t){var n=[];return e.forEach((function(e){if("commentLink"===e.type&&e.srcNodeId===t){var i={id:e.id,node_ref:e.trgNodeId};e.class_name&&(i.class_name=e.class_name),e.style&&(i.style=e.style),n.push(i)}})),n}},{key:"createAssociationLinks",value:function(e,t){var n=this,i=[];return t.forEach((function(t){if("associationLink"===t.type&&t.srcNodeId===e.id){var o={id:t.id,node_ref:t.trgNodeId};if(t.class_name&&(o.class_name=t.class_name),t.style&&(o.style=t.style),t.decorations){var r=n.createDecorations(t.decorations);r.length>0&&(o.decorations=r)}i.push(o)}})),i}},{key:"createDetachedLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){if(!e.srcNodeId||!e.trgNodeId){var i={id:e.id};e.srcNodeId?(i.src_node_id=e.srcNodeId,e.srcNodePortId&&(i.src_node_port_id=e.srcNodePortId)):e.srcPos&&(i.src_pos=e.srcPos),e.trgNodeId?(i.trg_node_id=e.trgNodeId,e.trgNodePortId&&(i.trg_node_port_id=e.trgNodePortId)):e.trgPos&&(i.trg_pos=e.trgPos),i=t.addNodeLinkCommonAttrs(i,e),n.push(i)}})),n}},{key:"addNodeLinkCommonAttrs",value:function(e,t){if(t.app_data&&i.set_1(e,"app_data",t.app_data),t.class_name&&i.set_1(e,"app_data.ui_data.class_name",t.class_name),t.style&&i.set_1(e,"app_data.ui_data.style",t.style),t.decorations){var n=this.createDecorations(t.decorations);n.length>0&&i.set_1(e,"app_data.ui_data.decorations",n)}return t.linkName&&(e.link_name=t.linkName),t.typeAttr&&(e.type_attr=t.typeAttr),t.description&&(e.description=t.description),e}}]),n}(),it=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"set",value:function(e,n){try{window.electronUtil&&window.electronUtil.wsdStorage&&window.electronUtil.wsdStorage.setItem?window.electronUtil.wsdStorage.setItem(e,n):window.localStorage&&(window.localStorage[e]=n)}catch(e){t.logger.warn("Local storage is not accessible: "+e)}}},{key:"get",value:function(e){try{if(window.electronUtil&&window.electronUtil.wsdStorage&&window.electronUtil.wsdStorage.getItem)return window.electronUtil.wsdStorage.getItem(e);if(window.localStorage)return window.localStorage[e]}catch(e){t.logger.warn("Local storage is not accessible: "+e)}return null}},{key:"delete",value:function(e){try{window.electronUtil&&window.electronUtil.wsdStorage&&window.electronUtil.wsdStorage.removeItem?window.electronUtil.wsdStorage.removeItem(e):window.localStorage&&delete window.localStorage[e]}catch(e){t.logger.warn("Local storage is not accessible: "+e)}}}]),t}();it.logger=new a.Logger(["LocalStorage"]);var ot={exports:{}};ot.exports=function(){function e(n,i,o){function r(s,d){if(!i[s]){if(!n[s]){var c="function"==typeof t.commonjsRequire&&t.commonjsRequire;if(!d&&c)return c(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=i[s]={exports:{}};n[s][0].call(u.exports,(function(e){return r(n[s][1][e]||e)}),u,u.exports,e,n,i,o)}return i[s].exports}for(var a="function"==typeof t.commonjsRequire&&t.commonjsRequire,s=0;s<o.length;s++)r(o[s]);return r}return e}()({1:[function(e,t,n){t.exports={graphlib:e("./lib/graphlib"),layout:e("./lib/layout"),debug:e("./lib/debug"),util:{time:e("./lib/util").time,notime:e("./lib/util").notime},version:e("./lib/version")}},{"./lib/debug":6,"./lib/graphlib":7,"./lib/layout":9,"./lib/util":29,"./lib/version":30}],2:[function(e,t,n){var i=e("./lodash"),o=e("./greedy-fas");function r(e){var t="greedy"===e.graph().acyclicer?o(e,n(e)):a(e);function n(e){return function(t){return e.edge(t).weight}}i.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,i.uniqueId("rev"))}))}function a(e){var t=[],n={},o={};function r(a){i.has(o,a)||(o[a]=!0,n[a]=!0,i.forEach(e.outEdges(a),(function(e){i.has(n,e.w)?t.push(e):r(e.w)})),delete n[a])}return i.forEach(e.nodes(),r),t}function s(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var i=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,i)}}))}t.exports={run:r,undo:s}},{"./greedy-fas":8,"./lodash":10}],3:[function(e,t,n){var i=e("./lodash"),o=e("./util");function r(e){function t(n){var o=e.children(n),r=e.node(n);if(o.length&&i.forEach(o,t),i.has(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(var s=r.minRank,d=r.maxRank+1;s<d;++s)a(e,"borderLeft","_bl",n,r,s),a(e,"borderRight","_br",n,r,s)}}i.forEach(e.children(),t)}function a(e,t,n,i,r,a){var s={width:0,height:0,rank:a,borderType:t},d=r[t][a-1],c=o.addDummyNode(e,"border",s,n);r[t][a]=c,e.setParent(c,i),d&&e.setEdge(d,c,{weight:1})}t.exports=r},{"./lodash":10,"./util":29}],4:[function(e,t,n){var i=e("./lodash");function o(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||a(e)}function r(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||d(e),"lr"!==t&&"rl"!==t||(l(e),a(e))}function a(e){i.forEach(e.nodes(),(function(t){s(e.node(t))})),i.forEach(e.edges(),(function(t){s(e.edge(t))}))}function s(e){var t=e.width;e.width=e.height,e.height=t}function d(e){i.forEach(e.nodes(),(function(t){c(e.node(t))})),i.forEach(e.edges(),(function(t){var n=e.edge(t);i.forEach(n.points,c),i.has(n,"y")&&c(n)}))}function c(e){e.y=-e.y}function l(e){i.forEach(e.nodes(),(function(t){u(e.node(t))})),i.forEach(e.edges(),(function(t){var n=e.edge(t);i.forEach(n.points,u),i.has(n,"x")&&u(n)}))}function u(e){var t=e.x;e.x=e.y,e.y=t}t.exports={adjust:o,undo:r}},{"./lodash":10}],5:[function(e,t,n){function i(){var e={};e._next=e._prev=e,this._sentinel=e}function o(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=i,i.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return o(t),t},i.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&o(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},i.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},{}],6:[function(e,t,n){var i=e("./lodash"),o=e("./util"),r=e("./graphlib").Graph;function a(e){var t=o.buildLayerMatrix(e),n=new r({compound:!0,multigraph:!0}).setGraph({});return i.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),i.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),i.forEach(t,(function(e,t){var o="layer"+t;n.setNode(o,{rank:"same"}),i.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}t.exports={debugOrdering:a}},{"./graphlib":7,"./lodash":10,"./util":29}],7:[function(e,t,n){var i;if("function"==typeof e)try{i=e("graphlib")}catch(e){}i||(i=window.graphlib),t.exports=i},{graphlib:31}],8:[function(e,t,n){var i=e("./lodash"),o=e("./graphlib").Graph,r=e("./data/list");t.exports=s;var a=i.constant(1);function s(e,t){if(e.nodeCount()<=1)return[];var n=l(e,t||a),o=d(n.graph,n.buckets,n.zeroIdx);return i.flatten(i.map(o,(function(t){return e.outEdges(t.v,t.w)})),!0)}function d(e,t,n){for(var i,o=[],r=t[t.length-1],a=t[0];e.nodeCount();){for(;i=a.dequeue();)c(e,t,n,i);for(;i=r.dequeue();)c(e,t,n,i);if(e.nodeCount())for(var s=t.length-2;s>0;--s)if(i=t[s].dequeue()){o=o.concat(c(e,t,n,i,!0));break}}return o}function c(e,t,n,o,r){var a=r?[]:void 0;return i.forEach(e.inEdges(o.v),(function(i){var o=e.edge(i),s=e.node(i.v);r&&a.push({v:i.v,w:i.w}),s.out-=o,u(t,n,s)})),i.forEach(e.outEdges(o.v),(function(i){var o=e.edge(i),r=i.w,a=e.node(r);a.in-=o,u(t,n,a)})),e.removeNode(o.v),a}function l(e,t){var n=new o,a=0,s=0;i.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),i.forEach(e.edges(),(function(e){var i=n.edge(e.v,e.w)||0,o=t(e),r=i+o;n.setEdge(e.v,e.w,r),s=Math.max(s,n.node(e.v).out+=o),a=Math.max(a,n.node(e.w).in+=o)}));var d=i.range(s+a+3).map((function(){return new r})),c=a+1;return i.forEach(n.nodes(),(function(e){u(d,c,n.node(e))})),{graph:n,buckets:d,zeroIdx:c}}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},{"./data/list":5,"./graphlib":7,"./lodash":10}],9:[function(e,t,n){var i=e("./lodash"),o=e("./acyclic"),r=e("./normalize"),a=e("./rank"),s=e("./util").normalizeRanks,d=e("./parent-dummy-chains"),c=e("./util").removeEmptyRanks,l=e("./nesting-graph"),u=e("./add-border-segments"),p=e("./coordinate-system"),f=e("./order"),h=e("./position"),g=e("./util"),y=e("./graphlib").Graph;function m(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return C(e)}));n(" runLayout",(function(){_(t,n)})),n(" updateInputGraph",(function(){v(e,t)}))}))}function _(e,t){t(" makeSpaceForEdgeLabels",(function(){j(e)})),t(" removeSelfEdges",(function(){U(e)})),t(" acyclic",(function(){o.run(e)})),t(" nestingGraph.run",(function(){l.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){T(e)})),t(" removeEmptyRanks",(function(){c(e)})),t(" nestingGraph.cleanup",(function(){l.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){w(e)})),t(" removeEdgeLabelProxies",(function(){L(e)})),t(" normalize.run",(function(){r.run(e)})),t(" parentDummyChains",(function(){d(e)})),t(" addBorderSegments",(function(){u(e)})),t(" order",(function(){f(e)})),t(" insertSelfEdges",(function(){F(e)})),t(" adjustCoordinateSystem",(function(){p.adjust(e)})),t(" position",(function(){h(e)})),t(" positionSelfEdges",(function(){B(e)})),t(" removeBorderNodes",(function(){R(e)})),t(" normalize.undo",(function(){r.undo(e)})),t(" fixupEdgeLabelCoords",(function(){D(e)})),t(" undoCoordinateSystem",(function(){p.undo(e)})),t(" translateGraph",(function(){A(e)})),t(" assignNodeIntersects",(function(){x(e)})),t(" reversePoints",(function(){M(e)})),t(" acyclic.undo",(function(){o.undo(e)}))}function v(e,t){i.forEach(e.nodes(),(function(n){var i=e.node(n),o=t.node(n);i&&(i.x=o.x,i.y=o.y,t.children(n).length&&(i.width=o.width,i.height=o.height))})),i.forEach(e.edges(),(function(n){var o=e.edge(n),r=t.edge(n);o.points=r.points,i.has(r,"x")&&(o.x=r.x,o.y=r.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}t.exports=m;var b=["nodesep","edgesep","ranksep","marginx","marginy"],P={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},k=["acyclicer","ranker","rankdir","align"],I=["width","height"],N={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],S={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function C(e){var t=new y({multigraph:!0,compound:!0}),n=G(e.graph());return t.setGraph(i.merge({},P,H(n,b),i.pick(n,k))),i.forEach(e.nodes(),(function(n){var o=G(e.node(n));t.setNode(n,i.defaults(H(o,I),N)),t.setParent(n,e.parent(n))})),i.forEach(e.edges(),(function(n){var o=G(e.edge(n));t.setEdge(n,i.merge({},S,H(o,E),i.pick(o,O)))})),t}function j(e){var t=e.graph();t.ranksep/=2,i.forEach(e.edges(),(function(n){var i=e.edge(n);i.minlen*=2,"c"!==i.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?i.width+=i.labeloffset:i.height+=i.labeloffset)}))}function T(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var i=e.node(t.v),o={rank:(e.node(t.w).rank-i.rank)/2+i.rank,e:t};g.addDummyNode(e,"edge-proxy",o,"_ep")}}))}function w(e){var t=0;i.forEach(e.nodes(),(function(n){var o=e.node(n);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,t=i.max(t,o.maxRank))})),e.graph().maxRank=t}function L(e){i.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}function A(e){var t=Number.POSITIVE_INFINITY,n=0,o=Number.POSITIVE_INFINITY,r=0,a=e.graph(),s=a.marginx||0,d=a.marginy||0;function c(e){var i=e.x,a=e.y,s=e.width,d=e.height;t=Math.min(t,i-s/2),n=Math.max(n,i+s/2),o=Math.min(o,a-d/2),r=Math.max(r,a+d/2)}i.forEach(e.nodes(),(function(t){c(e.node(t))})),i.forEach(e.edges(),(function(t){var n=e.edge(t);i.has(n,"x")&&c(n)})),t-=s,o-=d,i.forEach(e.nodes(),(function(n){var i=e.node(n);i.x-=t,i.y-=o})),i.forEach(e.edges(),(function(n){var r=e.edge(n);i.forEach(r.points,(function(e){e.x-=t,e.y-=o})),i.has(r,"x")&&(r.x-=t),i.has(r,"y")&&(r.y-=o)})),a.width=n-t+s,a.height=r-o+d}function x(e){i.forEach(e.edges(),(function(t){var n,i,o=e.edge(t),r=e.node(t.v),a=e.node(t.w);o.points?(n=o.points[0],i=o.points[o.points.length-1]):(o.points=[],n=a,i=r),o.points.unshift(g.intersectRect(r,n)),o.points.push(g.intersectRect(a,i))}))}function D(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);if(i.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}function M(e){i.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}function R(e){i.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),o=e.node(n.borderTop),r=e.node(n.borderBottom),a=e.node(i.last(n.borderLeft)),s=e.node(i.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(r.y-o.y),n.x=a.x+n.width/2,n.y=o.y+n.height/2}})),i.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}function U(e){i.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}function F(e){var t=g.buildLayerMatrix(e);i.forEach(t,(function(t){var n=0;i.forEach(t,(function(t,o){var r=e.node(t);r.order=o+n,i.forEach(r.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:r.rank,order:o+ ++n,e:t.e,label:t.label},"_se")})),delete r.selfEdges}))}))}function B(e){i.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var i=e.node(n.e.v),o=i.x+i.width/2,r=i.y,a=n.x-o,s=i.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:o+2*a/3,y:r-s},{x:o+5*a/6,y:r-s},{x:o+a,y:r},{x:o+5*a/6,y:r+s},{x:o+2*a/3,y:r+s}],n.label.x=n.x,n.label.y=n.y}}))}function H(e,t){return i.mapValues(i.pick(e,t),Number)}function G(e){var t={};return i.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},{"./acyclic":2,"./add-border-segments":3,"./coordinate-system":4,"./graphlib":7,"./lodash":10,"./nesting-graph":11,"./normalize":12,"./order":17,"./parent-dummy-chains":22,"./position":24,"./rank":26,"./util":29}],10:[function(e,t,n){var i;if("function"==typeof e)try{i={cloneDeep:e("lodash/cloneDeep"),constant:e("lodash/constant"),defaults:e("lodash/defaults"),each:e("lodash/each"),filter:e("lodash/filter"),find:e("lodash/find"),flatten:e("lodash/flatten"),forEach:e("lodash/forEach"),forIn:e("lodash/forIn"),has:e("lodash/has"),isUndefined:e("lodash/isUndefined"),last:e("lodash/last"),map:e("lodash/map"),mapValues:e("lodash/mapValues"),max:e("lodash/max"),merge:e("lodash/merge"),min:e("lodash/min"),minBy:e("lodash/minBy"),now:e("lodash/now"),pick:e("lodash/pick"),range:e("lodash/range"),reduce:e("lodash/reduce"),sortBy:e("lodash/sortBy"),uniqueId:e("lodash/uniqueId"),values:e("lodash/values"),zipObject:e("lodash/zipObject")}}catch(e){}i||(i=window._),t.exports=i},{"lodash/cloneDeep":227,"lodash/constant":228,"lodash/defaults":229,"lodash/each":230,"lodash/filter":232,"lodash/find":233,"lodash/flatten":235,"lodash/forEach":236,"lodash/forIn":237,"lodash/has":239,"lodash/isUndefined":258,"lodash/last":261,"lodash/map":262,"lodash/mapValues":263,"lodash/max":264,"lodash/merge":266,"lodash/min":267,"lodash/minBy":268,"lodash/now":270,"lodash/pick":271,"lodash/range":273,"lodash/reduce":274,"lodash/sortBy":276,"lodash/uniqueId":286,"lodash/values":287,"lodash/zipObject":288}],11:[function(e,t,n){var i=e("./lodash"),o=e("./util");function r(e){var t=o.addDummyNode(e,"root",{},"_root"),n=s(e),r=i.max(i.values(n))-1,c=2*r+1;e.graph().nestingRoot=t,i.forEach(e.edges(),(function(t){e.edge(t).minlen*=c}));var l=d(e)+1;i.forEach(e.children(),(function(i){a(e,t,c,l,r,n,i)})),e.graph().nodeRankFactor=c}function a(e,t,n,r,s,d,c){var l=e.children(c);if(l.length){var u=o.addBorderNode(e,"_bt"),p=o.addBorderNode(e,"_bb"),f=e.node(c);e.setParent(u,c),f.borderTop=u,e.setParent(p,c),f.borderBottom=p,i.forEach(l,(function(i){a(e,t,n,r,s,d,i);var o=e.node(i),l=o.borderTop?o.borderTop:i,f=o.borderBottom?o.borderBottom:i,h=o.borderTop?r:2*r,g=l!==f?1:s-d[c]+1;e.setEdge(u,l,{weight:h,minlen:g,nestingEdge:!0}),e.setEdge(f,p,{weight:h,minlen:g,nestingEdge:!0})})),e.parent(c)||e.setEdge(t,u,{weight:0,minlen:s+d[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}function s(e){var t={};function n(o,r){var a=e.children(o);a&&a.length&&i.forEach(a,(function(e){n(e,r+1)})),t[o]=r}return i.forEach(e.children(),(function(e){n(e,1)})),t}function d(e){return i.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}function c(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,i.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}t.exports={run:r,cleanup:c}},{"./lodash":10,"./util":29}],12:[function(e,t,n){var i=e("./lodash"),o=e("./util");function r(e){e.graph().dummyChains=[],i.forEach(e.edges(),(function(t){a(e,t)}))}function a(e,t){var n=t.v,i=e.node(n).rank,r=t.w,a=e.node(r).rank,s=t.name,d=e.edge(t),c=d.labelRank;if(a!==i+1){var l,u,p;for(e.removeEdge(t),p=0,++i;i<a;++p,++i)d.points=[],u={width:0,height:0,edgeLabel:d,edgeObj:t,rank:i},l=o.addDummyNode(e,"edge",u,"_d"),i===c&&(u.width=d.width,u.height=d.height,u.dummy="edge-label",u.labelpos=d.labelpos),e.setEdge(n,l,{weight:d.weight},s),0===p&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,r,{weight:d.weight},s)}}function s(e){i.forEach(e.graph().dummyChains,(function(t){var n,i=e.node(t),o=i.edgeLabel;for(e.setEdge(i.edgeObj,o);i.dummy;)n=e.successors(t)[0],e.removeNode(t),o.points.push({x:i.x,y:i.y}),"edge-label"===i.dummy&&(o.x=i.x,o.y=i.y,o.width=i.width,o.height=i.height),t=n,i=e.node(t)}))}t.exports={run:r,undo:s}},{"./lodash":10,"./util":29}],13:[function(e,t,n){var i=e("../lodash");function o(e,t,n){var o,r={};i.forEach(n,(function(n){for(var i,a,s=e.parent(n);s;){if((i=e.parent(s))?(a=r[i],r[i]=s):(a=o,o=s),a&&a!==s)return void t.setEdge(a,s);s=i}}))}t.exports=o},{"../lodash":10}],14:[function(e,t,n){var i=e("../lodash");function o(e,t){return i.map(t,(function(t){var n=e.inEdges(t);if(n.length){var o=i.reduce(n,(function(t,n){var i=e.edge(n),o=e.node(n.v);return{sum:t.sum+i.weight*o.order,weight:t.weight+i.weight}}),{sum:0,weight:0});return{v:t,barycenter:o.sum/o.weight,weight:o.weight}}return{v:t}}))}t.exports=o},{"../lodash":10}],15:[function(e,t,n){var i=e("../lodash"),o=e("../graphlib").Graph;function r(e,t,n){var r=a(e),s=new o({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(t){return e.node(t)}));return i.forEach(e.nodes(),(function(o){var a=e.node(o),d=e.parent(o);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(s.setNode(o),s.setParent(o,d||r),i.forEach(e[n](o),(function(t){var n=t.v===o?t.w:t.v,r=s.edge(n,o),a=i.isUndefined(r)?0:r.weight;s.setEdge(n,o,{weight:e.edge(t).weight+a})})),i.has(a,"minRank")&&s.setNode(o,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}))})),s}function a(e){for(var t;e.hasNode(t=i.uniqueId("_root")););return t}t.exports=r},{"../graphlib":7,"../lodash":10}],16:[function(e,t,n){var i=e("../lodash");function o(e,t){for(var n=0,i=1;i<t.length;++i)n+=r(e,t[i-1],t[i]);return n}function r(e,t,n){for(var o=i.zipObject(n,i.map(n,(function(e,t){return t}))),r=i.flatten(i.map(t,(function(t){return i.sortBy(i.map(e.outEdges(t),(function(t){return{pos:o[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var d=i.map(new Array(s),(function(){return 0})),c=0;return i.forEach(r.forEach((function(e){var t=e.pos+a;d[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=d[t+1]),d[t=t-1>>1]+=e.weight;c+=e.weight*n}))),c}t.exports=o},{"../lodash":10}],17:[function(e,t,n){var i=e("../lodash"),o=e("./init-order"),r=e("./cross-count"),a=e("./sort-subgraph"),s=e("./build-layer-graph"),d=e("./add-subgraph-constraints"),c=e("../graphlib").Graph,l=e("../util");function u(e){var t=l.maxRank(e),n=p(e,i.range(1,t+1),"inEdges"),a=p(e,i.range(t-1,-1,-1),"outEdges"),s=o(e);h(e,s);for(var d,c=Number.POSITIVE_INFINITY,u=0,g=0;g<4;++u,++g){f(u%2?n:a,u%4>=2),s=l.buildLayerMatrix(e);var y=r(e,s);y<c&&(g=0,d=i.cloneDeep(s),c=y)}h(e,d)}function p(e,t,n){return i.map(t,(function(t){return s(e,t,n)}))}function f(e,t){var n=new c;i.forEach(e,(function(e){var o=e.graph().root,r=a(e,o,n,t);i.forEach(r.vs,(function(t,n){e.node(t).order=n})),d(e,n,r.vs)}))}function h(e,t){i.forEach(t,(function(t){i.forEach(t,(function(t,n){e.node(t).order=n}))}))}t.exports=u},{"../graphlib":7,"../lodash":10,"../util":29,"./add-subgraph-constraints":13,"./build-layer-graph":15,"./cross-count":16,"./init-order":18,"./sort-subgraph":20}],18:[function(e,t,n){var i=e("../lodash");function o(e){var t={},n=i.filter(e.nodes(),(function(t){return!e.children(t).length})),o=i.max(i.map(n,(function(t){return e.node(t).rank}))),r=i.map(i.range(o+1),(function(){return[]}));function a(n){if(!i.has(t,n)){t[n]=!0;var o=e.node(n);r[o.rank].push(n),i.forEach(e.successors(n),a)}}var s=i.sortBy(n,(function(t){return e.node(t).rank}));return i.forEach(s,a),r}t.exports=o},{"../lodash":10}],19:[function(e,t,n){var i=e("../lodash");function o(e,t){var n={};return i.forEach(e,(function(e,t){var o=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};i.isUndefined(e.barycenter)||(o.barycenter=e.barycenter,o.weight=e.weight)})),i.forEach(t.edges(),(function(e){var t=n[e.v],o=n[e.w];i.isUndefined(t)||i.isUndefined(o)||(o.indegree++,t.out.push(n[e.w]))})),r(i.filter(n,(function(e){return!e.indegree})))}function r(e){var t=[];function n(e){return function(t){t.merged||(i.isUndefined(t.barycenter)||i.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&a(e,t)}}function o(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var r=e.pop();t.push(r),i.forEach(r.in.reverse(),n(r)),i.forEach(r.out,o(r))}return i.map(i.filter(t,(function(e){return!e.merged})),(function(e){return i.pick(e,["vs","i","barycenter","weight"])}))}function a(e,t){var n=0,i=0;e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/i,e.weight=i,e.i=Math.min(t.i,e.i),t.merged=!0}t.exports=o},{"../lodash":10}],20:[function(e,t,n){var i=e("../lodash"),o=e("./barycenter"),r=e("./resolve-conflicts"),a=e("./sort");function s(e,t,n,l){var u=e.children(t),p=e.node(t),f=p?p.borderLeft:void 0,h=p?p.borderRight:void 0,g={};f&&(u=i.filter(u,(function(e){return e!==f&&e!==h})));var y=o(e,u);i.forEach(y,(function(t){if(e.children(t.v).length){var o=s(e,t.v,n,l);g[t.v]=o,i.has(o,"barycenter")&&c(t,o)}}));var m=r(y,n);d(m,g);var _=a(m,l);if(f&&(_.vs=i.flatten([f,_.vs,h],!0),e.predecessors(f).length)){var v=e.node(e.predecessors(f)[0]),b=e.node(e.predecessors(h)[0]);i.has(_,"barycenter")||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+v.order+b.order)/(_.weight+2),_.weight+=2}return _}function d(e,t){i.forEach(e,(function(e){e.vs=i.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}function c(e,t){i.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}t.exports=s},{"../lodash":10,"./barycenter":14,"./resolve-conflicts":19,"./sort":21}],21:[function(e,t,n){var i=e("../lodash"),o=e("../util");function r(e,t){var n=o.partition(e,(function(e){return i.has(e,"barycenter")})),r=n.lhs,d=i.sortBy(n.rhs,(function(e){return-e.i})),c=[],l=0,u=0,p=0;r.sort(s(!!t)),p=a(c,d,p),i.forEach(r,(function(e){p+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,u+=e.weight,p=a(c,d,p)}));var f={vs:i.flatten(c,!0)};return u&&(f.barycenter=l/u,f.weight=u),f}function a(e,t,n){for(var o;t.length&&(o=i.last(t)).i<=n;)t.pop(),e.push(o.vs),n++;return n}function s(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}t.exports=r},{"../lodash":10,"../util":29}],22:[function(e,t,n){var i=e("./lodash");function o(e){var t=a(e);i.forEach(e.graph().dummyChains,(function(n){for(var i=e.node(n),o=i.edgeObj,a=r(e,t,o.v,o.w),s=a.path,d=a.lca,c=0,l=s[c],u=!0;n!==o.w;){if(i=e.node(n),u){for(;(l=s[c])!==d&&e.node(l).maxRank<i.rank;)c++;l===d&&(u=!1)}if(!u){for(;c<s.length-1&&e.node(l=s[c+1]).minRank<=i.rank;)c++;l=s[c]}e.setParent(n,l),n=e.successors(n)[0]}}))}function r(e,t,n,i){var o,r,a=[],s=[],d=Math.min(t[n].low,t[i].low),c=Math.max(t[n].lim,t[i].lim);o=n;do{o=e.parent(o),a.push(o)}while(o&&(t[o].low>d||c>t[o].lim));for(r=o,o=i;(o=e.parent(o))!==r;)s.push(o);return{path:a.concat(s.reverse()),lca:r}}function a(e){var t={},n=0;function o(r){var a=n;i.forEach(e.children(r),o),t[r]={low:a,lim:n++}}return i.forEach(e.children(),o),t}t.exports=o},{"./lodash":10}],23:[function(e,t,n){var i=e("../lodash"),o=e("../graphlib").Graph,r=e("../util");function a(e,t){var n={};function o(t,o){var r=0,a=0,s=t.length,l=i.last(o);return i.forEach(o,(function(t,u){var p=d(e,t),f=p?e.node(p).order:s;(p||t===l)&&(i.forEach(o.slice(a,u+1),(function(t){i.forEach(e.predecessors(t),(function(i){var o=e.node(i),a=o.order;!(a<r||f<a)||o.dummy&&e.node(t).dummy||c(n,i,t)}))})),a=u+1,r=f)})),o}return i.reduce(t,o),n}function s(e,t){var n={};function o(t,o,r,a,s){var d;i.forEach(i.range(o,r),(function(o){d=t[o],e.node(d).dummy&&i.forEach(e.predecessors(d),(function(t){var i=e.node(t);i.dummy&&(i.order<a||i.order>s)&&c(n,t,d)}))}))}function r(t,n){var r,a=-1,s=0;return i.forEach(n,(function(i,d){if("border"===e.node(i).dummy){var c=e.predecessors(i);c.length&&(r=e.node(c[0]).order,o(n,s,d,a,r),s=d,a=r)}o(n,s,n.length,r,t.length)})),n}return i.reduce(t,r),n}function d(e,t){if(e.node(t).dummy)return i.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}function c(e,t,n){if(t>n){var i=t;t=n,n=i}var o=e[t];o||(e[t]=o={}),o[n]=!0}function l(e,t,n){if(t>n){var o=t;t=n,n=o}return i.has(e[t],n)}function u(e,t,n,o){var r={},a={},s={};return i.forEach(t,(function(e){i.forEach(e,(function(e,t){r[e]=e,a[e]=e,s[e]=t}))})),i.forEach(t,(function(e){var t=-1;i.forEach(e,(function(e){var d=o(e);if(d.length){d=i.sortBy(d,(function(e){return s[e]}));for(var c=(d.length-1)/2,u=Math.floor(c),p=Math.ceil(c);u<=p;++u){var f=d[u];a[e]===e&&t<s[f]&&!l(n,e,f)&&(a[f]=e,a[e]=r[e]=r[f],t=s[f])}}}))})),{root:r,align:a}}function p(e,t,n,o,r){var a={},s=f(e,t,n,r),d=r?"borderLeft":"borderRight";function c(e,t){for(var n=s.nodes(),i=n.pop(),o={};i;)o[i]?e(i):(o[i]=!0,n.push(i),n=n.concat(t(i))),i=n.pop()}function l(e){a[e]=s.inEdges(e).reduce((function(e,t){return Math.max(e,a[t.v]+s.edge(t))}),0)}function u(t){var n=s.outEdges(t).reduce((function(e,t){return Math.min(e,a[t.w]-s.edge(t))}),Number.POSITIVE_INFINITY),i=e.node(t);n!==Number.POSITIVE_INFINITY&&i.borderType!==d&&(a[t]=Math.max(a[t],n))}return c(l,s.predecessors.bind(s)),c(u,s.successors.bind(s)),i.forEach(o,(function(e){a[e]=a[n[e]]})),a}function f(e,t,n,r){var a=new o,s=e.graph(),d=_(s.nodesep,s.edgesep,r);return i.forEach(t,(function(t){var o;i.forEach(t,(function(t){var i=n[t];if(a.setNode(i),o){var r=n[o],s=a.edge(r,i);a.setEdge(r,i,Math.max(d(e,t,o),s||0))}o=t}))})),a}function h(e,t){return i.minBy(i.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;return i.forIn(t,(function(t,i){var r=v(e,i)/2;n=Math.max(t+r,n),o=Math.min(t-r,o)})),n-o}))}function g(e,t){var n=i.values(t),o=i.min(n),r=i.max(n);i.forEach(["u","d"],(function(n){i.forEach(["l","r"],(function(a){var s,d=n+a,c=e[d];if(c!==t){var l=i.values(c);(s="l"===a?o-i.min(l):r-i.max(l))&&(e[d]=i.mapValues(c,(function(e){return e+s})))}}))}))}function y(e,t){return i.mapValues(e.ul,(function(n,o){if(t)return e[t.toLowerCase()][o];var r=i.sortBy(i.map(e,o));return(r[1]+r[2])/2}))}function m(e){var t,n=r.buildLayerMatrix(e),o=i.merge(a(e,n),s(e,n)),d={};i.forEach(["u","d"],(function(r){t="u"===r?n:i.values(n).reverse(),i.forEach(["l","r"],(function(n){"r"===n&&(t=i.map(t,(function(e){return i.values(e).reverse()})));var a=("u"===r?e.predecessors:e.successors).bind(e),s=u(e,t,o,a),c=p(e,t,s.root,s.align,"r"===n);"r"===n&&(c=i.mapValues(c,(function(e){return-e}))),d[r+n]=c}))}));var c=h(e,d);return g(d,c),y(d,e.graph().align)}function _(e,t,n){return function(o,r,a){var s,d=o.node(r),c=o.node(a),l=0;if(l+=d.width/2,i.has(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":s=-d.width/2;break;case"r":s=d.width/2}if(s&&(l+=n?s:-s),s=0,l+=(d.dummy?t:e)/2,l+=(c.dummy?t:e)/2,l+=c.width/2,i.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(l+=n?s:-s),s=0,l}}function v(e,t){return e.node(t).width}t.exports={positionX:m,findType1Conflicts:a,findType2Conflicts:s,addConflict:c,hasConflict:l,verticalAlignment:u,horizontalCompaction:p,alignCoordinates:g,findSmallestWidthAlignment:h,balance:y}},{"../graphlib":7,"../lodash":10,"../util":29}],24:[function(e,t,n){var i=e("../lodash"),o=e("../util"),r=e("./bk").positionX;function a(e){s(e=o.asNonCompoundGraph(e)),i.forEach(r(e),(function(t,n){e.node(n).x=t}))}function s(e){var t=o.buildLayerMatrix(e),n=e.graph().ranksep,r=0;i.forEach(t,(function(t){var o=i.max(i.map(t,(function(t){return e.node(t).height})));i.forEach(t,(function(t){e.node(t).y=r+o/2})),r+=o+n}))}t.exports=a},{"../lodash":10,"../util":29,"./bk":23}],25:[function(e,t,n){var i=e("../lodash"),o=e("../graphlib").Graph,r=e("./util").slack;function a(e){var t,n,i=new o({directed:!1}),a=e.nodes()[0],l=e.nodeCount();for(i.setNode(a,{});s(i,e)<l;)t=d(i,e),n=i.hasNode(t.v)?r(e,t):-r(e,t),c(i,e,n);return i}function s(e,t){function n(o){i.forEach(t.nodeEdges(o),(function(i){var a=i.v,s=o===a?i.w:a;e.hasNode(s)||r(t,i)||(e.setNode(s,{}),e.setEdge(o,s,{}),n(s))}))}return i.forEach(e.nodes(),n),e.nodeCount()}function d(e,t){return i.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return r(t,n)}))}function c(e,t,n){i.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}t.exports=a},{"../graphlib":7,"../lodash":10,"./util":28}],26:[function(e,t,n){var i=e("./util").longestPath,o=e("./feasible-tree"),r=e("./network-simplex");function a(e){switch(e.graph().ranker){case"network-simplex":default:c(e);break;case"tight-tree":d(e);break;case"longest-path":s(e)}}t.exports=a;var s=i;function d(e){i(e),o(e)}function c(e){r(e)}},{"./feasible-tree":25,"./network-simplex":27,"./util":28}],27:[function(e,t,n){var i=e("../lodash"),o=e("./feasible-tree"),r=e("./util").slack,a=e("./util").longestPath,s=e("../graphlib").alg.preorder,d=e("../graphlib").alg.postorder,c=e("../util").simplify;function l(e){e=c(e),a(e);var t,n=o(e);for(h(n),u(n,e);t=y(n);)_(n,e,t,m(n,e,t))}function u(e,t){var n=d(e,e.nodes());n=n.slice(0,n.length-1),i.forEach(n,(function(n){p(e,t,n)}))}function p(e,t,n){var i=e.node(n).parent;e.edge(n,i).cutvalue=f(e,t,n)}function f(e,t,n){var o=e.node(n).parent,r=!0,a=t.edge(n,o),s=0;return a||(r=!1,a=t.edge(o,n)),s=a.weight,i.forEach(t.nodeEdges(n),(function(i){var a=i.v===n,d=a?i.w:i.v;if(d!==o){var c=a===r,l=t.edge(i).weight;if(s+=c?l:-l,b(e,n,d)){var u=e.edge(n,d).cutvalue;s+=c?-u:u}}})),s}function h(e,t){arguments.length<2&&(t=e.nodes()[0]),g(e,{},1,t)}function g(e,t,n,o,r){var a=n,s=e.node(o);return t[o]=!0,i.forEach(e.neighbors(o),(function(r){i.has(t,r)||(n=g(e,t,n,r,o))})),s.low=a,s.lim=n++,r?s.parent=r:delete s.parent,n}function y(e){return i.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function m(e,t,n){var o=n.v,a=n.w;t.hasEdge(o,a)||(o=n.w,a=n.v);var s=e.node(o),d=e.node(a),c=s,l=!1;s.lim>d.lim&&(c=d,l=!0);var u=i.filter(t.edges(),(function(t){return l===P(e,e.node(t.v),c)&&l!==P(e,e.node(t.w),c)}));return i.minBy(u,(function(e){return r(t,e)}))}function _(e,t,n,i){var o=n.v,r=n.w;e.removeEdge(o,r),e.setEdge(i.v,i.w,{}),h(e),u(e,t),v(e,t)}function v(e,t){var n=i.find(e.nodes(),(function(e){return!t.node(e).parent})),o=s(e,n);o=o.slice(1),i.forEach(o,(function(n){var i=e.node(n).parent,o=t.edge(n,i),r=!1;o||(o=t.edge(i,n),r=!0),t.node(n).rank=t.node(i).rank+(r?o.minlen:-o.minlen)}))}function b(e,t,n){return e.hasEdge(t,n)}function P(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}t.exports=l,l.initLowLimValues=h,l.initCutValues=u,l.calcCutValue=f,l.leaveEdge=y,l.enterEdge=m,l.exchangeEdges=_},{"../graphlib":7,"../lodash":10,"../util":29,"./feasible-tree":25,"./util":28}],28:[function(e,t,n){var i=e("../lodash");function o(e){var t={};function n(o){var r=e.node(o);if(i.has(t,o))return r.rank;t[o]=!0;var a=i.min(i.map(e.outEdges(o),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),r.rank=a}i.forEach(e.sources(),n)}function r(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}t.exports={longestPath:o,slack:r}},{"../lodash":10}],29:[function(e,t,n){var i=e("./lodash"),o=e("./graphlib").Graph;function r(e,t,n,o){var r;do{r=i.uniqueId(o)}while(e.hasNode(r));return n.dummy=t,e.setNode(r,n),r}function a(e){var t=(new o).setGraph(e.graph());return i.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),i.forEach(e.edges(),(function(n){var i=t.edge(n.v,n.w)||{weight:0,minlen:1},o=e.edge(n);t.setEdge(n.v,n.w,{weight:i.weight+o.weight,minlen:Math.max(i.minlen,o.minlen)})})),t}function s(e){var t=new o({multigraph:e.isMultigraph()}).setGraph(e.graph());return i.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),i.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t}function d(e){var t=i.map(e.nodes(),(function(t){var n={};return i.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return i.zipObject(e.nodes(),t)}function c(e){var t=i.map(e.nodes(),(function(t){var n={};return i.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return i.zipObject(e.nodes(),t)}function l(e,t){var n,i,o=e.x,r=e.y,a=t.x-o,s=t.y-r,d=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*d>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,i=c):(a<0&&(d=-d),n=d,i=d*s/a),{x:o+n,y:r+i}}function u(e){var t=i.map(i.range(g(e)+1),(function(){return[]}));return i.forEach(e.nodes(),(function(n){var o=e.node(n),r=o.rank;i.isUndefined(r)||(t[r][o.order]=n)})),t}function p(e){var t=i.min(i.map(e.nodes(),(function(t){return e.node(t).rank})));i.forEach(e.nodes(),(function(n){var o=e.node(n);i.has(o,"rank")&&(o.rank-=t)}))}function f(e){var t=i.min(i.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];i.forEach(e.nodes(),(function(i){var o=e.node(i).rank-t;n[o]||(n[o]=[]),n[o].push(i)}));var o=0,r=e.graph().nodeRankFactor;i.forEach(n,(function(t,n){i.isUndefined(t)&&n%r!=0?--o:o&&i.forEach(t,(function(t){e.node(t).rank+=o}))}))}function h(e,t,n,i){var o={width:0,height:0};return arguments.length>=4&&(o.rank=n,o.order=i),r(e,"border",o,t)}function g(e){return i.max(i.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!i.isUndefined(n))return n})))}function y(e,t){var n={lhs:[],rhs:[]};return i.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n}function m(e,t){var n=i.now();try{return t()}finally{console.log(e+" time: "+(i.now()-n)+"ms")}}function _(e,t){return t()}t.exports={addDummyNode:r,simplify:a,asNonCompoundGraph:s,successorWeights:d,predecessorWeights:c,intersectRect:l,buildLayerMatrix:u,normalizeRanks:p,removeEmptyRanks:f,addBorderNode:h,maxRank:g,partition:y,time:m,notime:_}},{"./graphlib":7,"./lodash":10}],30:[function(e,t,n){t.exports="0.8.5"},{}],31:[function(e,t,n){var i=e("./lib");t.exports={Graph:i.Graph,json:e("./lib/json"),alg:e("./lib/alg"),version:i.version}},{"./lib":47,"./lib/alg":38,"./lib/json":48}],32:[function(e,t,n){var i=e("../lodash");function o(e){var t,n={},o=[];function r(o){i.has(n,o)||(n[o]=!0,t.push(o),i.each(e.successors(o),r),i.each(e.predecessors(o),r))}return i.each(e.nodes(),(function(e){t=[],r(e),t.length&&o.push(t)})),o}t.exports=o},{"../lodash":49}],33:[function(e,t,n){var i=e("../lodash");function o(e,t,n){i.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return i.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);r(e,t,"post"===n,s,o,a)})),a}function r(e,t,n,o,a,s){i.has(o,t)||(o[t]=!0,n||s.push(t),i.each(a(t),(function(t){r(e,t,n,o,a,s)})),n&&s.push(t))}t.exports=o},{"../lodash":49}],34:[function(e,t,n){var i=e("./dijkstra"),o=e("../lodash");function r(e,t,n){return o.transform(e.nodes(),(function(o,r){o[r]=i(e,r,t,n)}),{})}t.exports=r},{"../lodash":49,"./dijkstra":35}],35:[function(e,t,n){var i=e("../lodash"),o=e("../data/priority-queue");t.exports=a;var r=i.constant(1);function a(e,t,n,i){return s(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function s(e,t,n,i){var r,a,s={},d=new o,c=function(e){var t=e.v!==r?e.v:e.w,i=s[t],o=n(e),c=a.distance+o;if(o<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);c<i.distance&&(i.distance=c,i.predecessor=r,d.decrease(t,c))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},d.add(e,n)}));d.size()>0&&(r=d.removeMin(),(a=s[r]).distance!==Number.POSITIVE_INFINITY);)i(r).forEach(c);return s}},{"../data/priority-queue":45,"../lodash":49}],36:[function(e,t,n){var i=e("../lodash"),o=e("./tarjan");function r(e){return i.filter(o(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}t.exports=r},{"../lodash":49,"./tarjan":43}],37:[function(e,t,n){var i=e("../lodash");t.exports=r;var o=i.constant(1);function r(e,t,n){return a(e,t||o,n||function(t){return e.outEdges(t)})}function a(e,t,n){var i={},o=e.nodes();return o.forEach((function(e){i[e]={},i[e][e]={distance:0},o.forEach((function(t){e!==t&&(i[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var o=n.v===e?n.w:n.v,r=t(n);i[e][o]={distance:r,predecessor:e}}))})),o.forEach((function(e){var t=i[e];o.forEach((function(n){var r=i[n];o.forEach((function(n){var i=r[e],o=t[n],a=r[n],s=i.distance+o.distance;s<a.distance&&(a.distance=s,a.predecessor=o.predecessor)}))}))})),i}},{"../lodash":49}],38:[function(e,t,n){t.exports={components:e("./components"),dijkstra:e("./dijkstra"),dijkstraAll:e("./dijkstra-all"),findCycles:e("./find-cycles"),floydWarshall:e("./floyd-warshall"),isAcyclic:e("./is-acyclic"),postorder:e("./postorder"),preorder:e("./preorder"),prim:e("./prim"),tarjan:e("./tarjan"),topsort:e("./topsort")}},{"./components":32,"./dijkstra":35,"./dijkstra-all":34,"./find-cycles":36,"./floyd-warshall":37,"./is-acyclic":39,"./postorder":40,"./preorder":41,"./prim":42,"./tarjan":43,"./topsort":44}],39:[function(e,t,n){var i=e("./topsort");function o(e){try{i(e)}catch(e){if(e instanceof i.CycleException)return!1;throw e}return!0}t.exports=o},{"./topsort":44}],40:[function(e,t,n){var i=e("./dfs");function o(e,t){return i(e,t,"post")}t.exports=o},{"./dfs":33}],41:[function(e,t,n){var i=e("./dfs");function o(e,t){return i(e,t,"pre")}t.exports=o},{"./dfs":33}],42:[function(e,t,n){var i=e("../lodash"),o=e("../graph"),r=e("../data/priority-queue");function a(e,t){var n,a=new o,s={},d=new r;function c(e){var i=e.v===n?e.w:e.v,o=d.priority(i);if(void 0!==o){var r=t(e);r<o&&(s[i]=n,d.decrease(i,r))}}if(0===e.nodeCount())return a;i.each(e.nodes(),(function(e){d.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),d.decrease(e.nodes()[0],0);for(var l=!1;d.size()>0;){if(n=d.removeMin(),i.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(n).forEach(c)}return a}t.exports=a},{"../data/priority-queue":45,"../graph":46,"../lodash":49}],43:[function(e,t,n){var i=e("../lodash");function o(e){var t=0,n=[],o={},r=[];function a(s){var d=o[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){i.has(o,e)?o[e].onStack&&(d.lowlink=Math.min(d.lowlink,o[e].index)):(a(e),d.lowlink=Math.min(d.lowlink,o[e].lowlink))})),d.lowlink===d.index){var c,l=[];do{c=n.pop(),o[c].onStack=!1,l.push(c)}while(s!==c);r.push(l)}}return e.nodes().forEach((function(e){i.has(o,e)||a(e)})),r}t.exports=o},{"../lodash":49}],44:[function(e,t,n){var i=e("../lodash");function o(e){var t={},n={},o=[];function a(s){if(i.has(n,s))throw new r;i.has(t,s)||(n[s]=!0,t[s]=!0,i.each(e.predecessors(s),a),delete n[s],o.push(s))}if(i.each(e.sinks(),a),i.size(t)!==e.nodeCount())throw new r;return o}function r(){}t.exports=o,o.CycleException=r,r.prototype=new Error},{"../lodash":49}],45:[function(e,t,n){var i=e("../lodash");function o(){this._arr=[],this._keyIndices={}}t.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},o.prototype.has=function(e){return i.has(this._keyIndices,e)},o.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},o.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!i.has(n,e)){var o=this._arr,r=o.length;return n[e]=r,o.push({key:e,priority:t}),this._decrease(r),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},o.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},o.prototype._heapify=function(e){var t=this._arr,n=2*e,i=n+1,o=e;n<t.length&&(o=t[n].priority<t[o].priority?n:o,i<t.length&&(o=t[i].priority<t[o].priority?i:o),o!==e&&(this._swap(e,o),this._heapify(o)))},o.prototype._decrease=function(e){for(var t,n=this._arr,i=n[e].priority;0!==e&&!(n[t=e>>1].priority<i);)this._swap(e,t),e=t},o.prototype._swap=function(e,t){var n=this._arr,i=this._keyIndices,o=n[e],r=n[t];n[e]=r,n[t]=o,i[r.key]=e,i[o.key]=t}},{"../lodash":49}],46:[function(e,t,n){var i=e("./lodash");t.exports=s;var o="\0",r="\0",a="";function s(e){this._isDirected=!i.has(e,"directed")||e.directed,this._isMultigraph=!!i.has(e,"multigraph")&&e.multigraph,this._isCompound=!!i.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=i.constant(void 0),this._defaultEdgeLabelFn=i.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function d(e,t){e[t]?e[t]++:e[t]=1}function c(e,t){--e[t]||delete e[t]}function l(e,t,n,r){var s=""+t,d=""+n;if(!e&&s>d){var c=s;s=d,d=c}return s+a+d+a+(i.isUndefined(r)?o:r)}function u(e,t,n,i){var o=""+t,r=""+n;if(!e&&o>r){var a=o;o=r,r=a}var s={v:o,w:r};return i&&(s.name=i),s}function p(e,t){return l(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return i.isFunction(e)||(e=i.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return i.keys(this._nodes)},s.prototype.sources=function(){var e=this;return i.filter(this.nodes(),(function(t){return i.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return i.filter(this.nodes(),(function(t){return i.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,o=this;return i.each(e,(function(e){n.length>1?o.setNode(e,t):o.setNode(e)})),this},s.prototype.setNode=function(e,t){return i.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=r,this._children[e]={},this._children[r][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return i.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(i.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],i.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),i.each(i.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],i.each(i.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(i.isUndefined(t))t=r;else{for(var n=t+="";!i.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==r)return t}},s.prototype.children=function(e){if(i.isUndefined(e)&&(e=r),this._isCompound){var t=this._children[e];if(t)return i.keys(t)}else{if(e===r)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return i.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return i.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return i.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;i.each(this._nodes,(function(n,i){e(i)&&t.setNode(i,n)})),i.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var o={};function r(e){var i=n.parent(e);return void 0===i||t.hasNode(i)?(o[e]=i,i):i in o?o[i]:r(i)}return this._isCompound&&i.each(t.nodes(),(function(e){t.setParent(e,r(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return i.isFunction(e)||(e=i.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return i.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,o=arguments;return i.reduce(e,(function(e,i){return o.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i})),this},s.prototype.setEdge=function(){var e,t,n,o,r=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(o=arguments[1],r=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],r=!0)),e=""+e,t=""+t,i.isUndefined(n)||(n=""+n);var s=l(this._isDirected,e,t,n);if(i.has(this._edgeLabels,s))return r&&(this._edgeLabels[s]=o),this;if(!i.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=r?o:this._defaultEdgeLabelFn(e,t,n);var c=u(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[s]=c,d(this._preds[t],e),d(this._sucs[e],t),this._in[t][s]=c,this._out[e][s]=c,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var i=1===arguments.length?p(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[i]},s.prototype.hasEdge=function(e,t,n){var o=1===arguments.length?p(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return i.has(this._edgeLabels,o)},s.prototype.removeEdge=function(e,t,n){var i=1===arguments.length?p(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),o=this._edgeObjs[i];return o&&(e=o.v,t=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var o=i.values(n);return t?i.filter(o,(function(e){return e.v===t})):o}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var o=i.values(n);return t?i.filter(o,(function(e){return e.w===t})):o}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},{"./lodash":49}],47:[function(e,t,n){t.exports={Graph:e("./graph"),version:e("./version")}},{"./graph":46,"./version":50}],48:[function(e,t,n){var i=e("./lodash"),o=e("./graph");function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:a(e),edges:s(e)};return i.isUndefined(e.graph())||(t.value=i.clone(e.graph())),t}function a(e){return i.map(e.nodes(),(function(t){var n=e.node(t),o=e.parent(t),r={v:t};return i.isUndefined(n)||(r.value=n),i.isUndefined(o)||(r.parent=o),r}))}function s(e){return i.map(e.edges(),(function(t){var n=e.edge(t),o={v:t.v,w:t.w};return i.isUndefined(t.name)||(o.name=t.name),i.isUndefined(n)||(o.value=n),o}))}function d(e){var t=new o(e.options).setGraph(e.value);return i.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),i.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}t.exports={write:r,read:d}},{"./graph":46,"./lodash":49}],49:[function(e,t,n){var i;if("function"==typeof e)try{i={clone:e("lodash/clone"),constant:e("lodash/constant"),each:e("lodash/each"),filter:e("lodash/filter"),has:e("lodash/has"),isArray:e("lodash/isArray"),isEmpty:e("lodash/isEmpty"),isFunction:e("lodash/isFunction"),isUndefined:e("lodash/isUndefined"),keys:e("lodash/keys"),map:e("lodash/map"),reduce:e("lodash/reduce"),size:e("lodash/size"),transform:e("lodash/transform"),union:e("lodash/union"),values:e("lodash/values")}}catch(e){}i||(i=window._),t.exports=i},{"lodash/clone":226,"lodash/constant":228,"lodash/each":230,"lodash/filter":232,"lodash/has":239,"lodash/isArray":243,"lodash/isEmpty":247,"lodash/isFunction":248,"lodash/isUndefined":258,"lodash/keys":259,"lodash/map":262,"lodash/reduce":274,"lodash/size":275,"lodash/transform":284,"lodash/union":285,"lodash/values":287}],50:[function(e,t,n){t.exports="2.1.8"},{}],51:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"DataView");t.exports=i},{"./_getNative":163,"./_root":208}],52:[function(e,t,n){var i=e("./_hashClear"),o=e("./_hashDelete"),r=e("./_hashGet"),a=e("./_hashHas"),s=e("./_hashSet");function d(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=r,d.prototype.has=a,d.prototype.set=s,t.exports=d},{"./_hashClear":172,"./_hashDelete":173,"./_hashGet":174,"./_hashHas":175,"./_hashSet":176}],53:[function(e,t,n){var i=e("./_listCacheClear"),o=e("./_listCacheDelete"),r=e("./_listCacheGet"),a=e("./_listCacheHas"),s=e("./_listCacheSet");function d(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=r,d.prototype.has=a,d.prototype.set=s,t.exports=d},{"./_listCacheClear":188,"./_listCacheDelete":189,"./_listCacheGet":190,"./_listCacheHas":191,"./_listCacheSet":192}],54:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"Map");t.exports=i},{"./_getNative":163,"./_root":208}],55:[function(e,t,n){var i=e("./_mapCacheClear"),o=e("./_mapCacheDelete"),r=e("./_mapCacheGet"),a=e("./_mapCacheHas"),s=e("./_mapCacheSet");function d(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}d.prototype.clear=i,d.prototype.delete=o,d.prototype.get=r,d.prototype.has=a,d.prototype.set=s,t.exports=d},{"./_mapCacheClear":193,"./_mapCacheDelete":194,"./_mapCacheGet":195,"./_mapCacheHas":196,"./_mapCacheSet":197}],56:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"Promise");t.exports=i},{"./_getNative":163,"./_root":208}],57:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"Set");t.exports=i},{"./_getNative":163,"./_root":208}],58:[function(e,t,n){var i=e("./_MapCache"),o=e("./_setCacheAdd"),r=e("./_setCacheHas");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new i;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=o,a.prototype.has=r,t.exports=a},{"./_MapCache":55,"./_setCacheAdd":210,"./_setCacheHas":211}],59:[function(e,t,n){var i=e("./_ListCache"),o=e("./_stackClear"),r=e("./_stackDelete"),a=e("./_stackGet"),s=e("./_stackHas"),d=e("./_stackSet");function c(e){var t=this.__data__=new i(e);this.size=t.size}c.prototype.clear=o,c.prototype.delete=r,c.prototype.get=a,c.prototype.has=s,c.prototype.set=d,t.exports=c},{"./_ListCache":53,"./_stackClear":215,"./_stackDelete":216,"./_stackGet":217,"./_stackHas":218,"./_stackSet":219}],60:[function(e,t,n){var i=e("./_root").Symbol;t.exports=i},{"./_root":208}],61:[function(e,t,n){var i=e("./_root").Uint8Array;t.exports=i},{"./_root":208}],62:[function(e,t,n){var i=e("./_getNative")(e("./_root"),"WeakMap");t.exports=i},{"./_getNative":163,"./_root":208}],63:[function(e,t,n){function i(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=i},{}],64:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}t.exports=i},{}],65:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length,o=0,r=[];++n<i;){var a=e[n];t(a,n,e)&&(r[o++]=a)}return r}t.exports=i},{}],66:[function(e,t,n){var i=e("./_baseIndexOf");function o(e,t){return!(null==e||!e.length)&&i(e,t,0)>-1}t.exports=o},{"./_baseIndexOf":95}],67:[function(e,t,n){function i(e,t,n){for(var i=-1,o=null==e?0:e.length;++i<o;)if(n(t,e[i]))return!0;return!1}t.exports=i},{}],68:[function(e,t,n){var i=e("./_baseTimes"),o=e("./isArguments"),r=e("./isArray"),a=e("./isBuffer"),s=e("./_isIndex"),d=e("./isTypedArray"),c=Object.prototype.hasOwnProperty;function l(e,t){var n=r(e),l=!n&&o(e),u=!n&&!l&&a(e),p=!n&&!l&&!u&&d(e),f=n||l||u||p,h=f?i(e.length,String):[],g=h.length;for(var y in e)!t&&!c.call(e,y)||f&&("length"==y||u&&("offset"==y||"parent"==y)||p&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||s(y,g))||h.push(y);return h}t.exports=l},{"./_baseTimes":125,"./_isIndex":181,"./isArguments":242,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],69:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o}t.exports=i},{}],70:[function(e,t,n){function i(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}t.exports=i},{}],71:[function(e,t,n){function i(e,t,n,i){var o=-1,r=null==e?0:e.length;for(i&&r&&(n=e[++o]);++o<r;)n=t(n,e[o],o,e);return n}t.exports=i},{}],72:[function(e,t,n){function i(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}t.exports=i},{}],73:[function(e,t,n){var i=e("./_baseProperty")("length");t.exports=i},{"./_baseProperty":117}],74:[function(e,t,n){var i=e("./_baseAssignValue"),o=e("./eq");function r(e,t,n){(void 0!==n&&!o(e[t],n)||void 0===n&&!(t in e))&&i(e,t,n)}t.exports=r},{"./_baseAssignValue":79,"./eq":231}],75:[function(e,t,n){var i=e("./_baseAssignValue"),o=e("./eq"),r=Object.prototype.hasOwnProperty;function a(e,t,n){var a=e[t];r.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||i(e,t,n)}t.exports=a},{"./_baseAssignValue":79,"./eq":231}],76:[function(e,t,n){var i=e("./eq");function o(e,t){for(var n=e.length;n--;)if(i(e[n][0],t))return n;return-1}t.exports=o},{"./eq":231}],77:[function(e,t,n){var i=e("./_copyObject"),o=e("./keys");function r(e,t){return e&&i(t,o(t),e)}t.exports=r},{"./_copyObject":143,"./keys":259}],78:[function(e,t,n){var i=e("./_copyObject"),o=e("./keysIn");function r(e,t){return e&&i(t,o(t),e)}t.exports=r},{"./_copyObject":143,"./keysIn":260}],79:[function(e,t,n){var i=e("./_defineProperty");function o(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}t.exports=o},{"./_defineProperty":153}],80:[function(e,t,n){var i=e("./_Stack"),o=e("./_arrayEach"),r=e("./_assignValue"),a=e("./_baseAssign"),s=e("./_baseAssignIn"),d=e("./_cloneBuffer"),c=e("./_copyArray"),l=e("./_copySymbols"),u=e("./_copySymbolsIn"),p=e("./_getAllKeys"),f=e("./_getAllKeysIn"),h=e("./_getTag"),g=e("./_initCloneArray"),y=e("./_initCloneByTag"),m=e("./_initCloneObject"),_=e("./isArray"),v=e("./isBuffer"),b=e("./isMap"),P=e("./isObject"),k=e("./isSet"),I=e("./keys"),N=1,E=2,S=4,O="[object Arguments]",C="[object Array]",j="[object Boolean]",T="[object Date]",w="[object Error]",L="[object Function]",A="[object GeneratorFunction]",x="[object Map]",D="[object Number]",M="[object Object]",R="[object RegExp]",U="[object Set]",F="[object String]",B="[object Symbol]",H="[object WeakMap]",G="[object ArrayBuffer]",q="[object DataView]",V="[object Float32Array]",z="[object Float64Array]",$="[object Int8Array]",W="[object Int16Array]",K="[object Int32Array]",Y="[object Uint8Array]",X="[object Uint8ClampedArray]",J="[object Uint16Array]",Z="[object Uint32Array]",Q={};function ee(e,t,n,C,j,T){var w,x=t&N,D=t&E,R=t&S;if(n&&(w=j?n(e,C,j,T):n(e)),void 0!==w)return w;if(!P(e))return e;var U=_(e);if(U){if(w=g(e),!x)return c(e,w)}else{var F=h(e),B=F==L||F==A;if(v(e))return d(e,x);if(F==M||F==O||B&&!j){if(w=D||B?{}:m(e),!x)return D?u(e,s(w,e)):l(e,a(w,e))}else{if(!Q[F])return j?e:{};w=y(e,F,x)}}T||(T=new i);var H=T.get(e);if(H)return H;T.set(e,w),k(e)?e.forEach((function(i){w.add(ee(i,t,n,i,e,T))})):b(e)&&e.forEach((function(i,o){w.set(o,ee(i,t,n,o,e,T))}));var G=R?D?f:p:D?keysIn:I,q=U?void 0:G(e);return o(q||e,(function(i,o){q&&(i=e[o=i]),r(w,o,ee(i,t,n,o,e,T))})),w}Q[O]=Q[C]=Q[G]=Q[q]=Q[j]=Q[T]=Q[V]=Q[z]=Q[$]=Q[W]=Q[K]=Q[x]=Q[D]=Q[M]=Q[R]=Q[U]=Q[F]=Q[B]=Q[Y]=Q[X]=Q[J]=Q[Z]=!0,Q[w]=Q[L]=Q[H]=!1,t.exports=ee},{"./_Stack":59,"./_arrayEach":64,"./_assignValue":75,"./_baseAssign":77,"./_baseAssignIn":78,"./_cloneBuffer":135,"./_copyArray":142,"./_copySymbols":144,"./_copySymbolsIn":145,"./_getAllKeys":159,"./_getAllKeysIn":160,"./_getTag":168,"./_initCloneArray":177,"./_initCloneByTag":178,"./_initCloneObject":179,"./isArray":243,"./isBuffer":246,"./isMap":250,"./isObject":251,"./isSet":254,"./keys":259}],81:[function(e,t,n){var i=e("./isObject"),o=Object.create,r=function(){function e(){}return function(t){if(!i(t))return{};if(o)return o(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();t.exports=r},{"./isObject":251}],82:[function(e,t,n){var i=e("./_baseForOwn"),o=e("./_createBaseEach")(i);t.exports=o},{"./_baseForOwn":88,"./_createBaseEach":148}],83:[function(e,t,n){var i=e("./isSymbol");function o(e,t,n){for(var o=-1,r=e.length;++o<r;){var a=e[o],s=t(a);if(null!=s&&(void 0===d?s==s&&!i(s):n(s,d)))var d=s,c=a}return c}t.exports=o},{"./isSymbol":256}],84:[function(e,t,n){var i=e("./_baseEach");function o(e,t){var n=[];return i(e,(function(e,i,o){t(e,i,o)&&n.push(e)})),n}t.exports=o},{"./_baseEach":82}],85:[function(e,t,n){function i(e,t,n,i){for(var o=e.length,r=n+(i?1:-1);i?r--:++r<o;)if(t(e[r],r,e))return r;return-1}t.exports=i},{}],86:[function(e,t,n){var i=e("./_arrayPush"),o=e("./_isFlattenable");function r(e,t,n,a,s){var d=-1,c=e.length;for(n||(n=o),s||(s=[]);++d<c;){var l=e[d];t>0&&n(l)?t>1?r(l,t-1,n,a,s):i(s,l):a||(s[s.length]=l)}return s}t.exports=r},{"./_arrayPush":70,"./_isFlattenable":180}],87:[function(e,t,n){var i=e("./_createBaseFor")();t.exports=i},{"./_createBaseFor":149}],88:[function(e,t,n){var i=e("./_baseFor"),o=e("./keys");function r(e,t){return e&&i(e,t,o)}t.exports=r},{"./_baseFor":87,"./keys":259}],89:[function(e,t,n){var i=e("./_castPath"),o=e("./_toKey");function r(e,t){for(var n=0,r=(t=i(t,e)).length;null!=e&&n<r;)e=e[o(t[n++])];return n&&n==r?e:void 0}t.exports=r},{"./_castPath":133,"./_toKey":223}],90:[function(e,t,n){var i=e("./_arrayPush"),o=e("./isArray");function r(e,t,n){var r=t(e);return o(e)?r:i(r,n(e))}t.exports=r},{"./_arrayPush":70,"./isArray":243}],91:[function(e,t,n){var i=e("./_Symbol"),o=e("./_getRawTag"),r=e("./_objectToString"),a="[object Null]",s="[object Undefined]",d=i?i.toStringTag:void 0;function c(e){return null==e?void 0===e?s:a:d&&d in Object(e)?o(e):r(e)}t.exports=c},{"./_Symbol":60,"./_getRawTag":165,"./_objectToString":205}],92:[function(e,t,n){function i(e,t){return e>t}t.exports=i},{}],93:[function(e,t,n){var i=Object.prototype.hasOwnProperty;function o(e,t){return null!=e&&i.call(e,t)}t.exports=o},{}],94:[function(e,t,n){function i(e,t){return null!=e&&t in Object(e)}t.exports=i},{}],95:[function(e,t,n){var i=e("./_baseFindIndex"),o=e("./_baseIsNaN"),r=e("./_strictIndexOf");function a(e,t,n){return t==t?r(e,t,n):i(e,o,n)}t.exports=a},{"./_baseFindIndex":85,"./_baseIsNaN":101,"./_strictIndexOf":220}],96:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isObjectLike"),r="[object Arguments]";function a(e){return o(e)&&i(e)==r}t.exports=a},{"./_baseGetTag":91,"./isObjectLike":252}],97:[function(e,t,n){var i=e("./_baseIsEqualDeep"),o=e("./isObjectLike");function r(e,t,n,a,s){return e===t||(null==e||null==t||!o(e)&&!o(t)?e!=e&&t!=t:i(e,t,n,a,r,s))}t.exports=r},{"./_baseIsEqualDeep":98,"./isObjectLike":252}],98:[function(e,t,n){var i=e("./_Stack"),o=e("./_equalArrays"),r=e("./_equalByTag"),a=e("./_equalObjects"),s=e("./_getTag"),d=e("./isArray"),c=e("./isBuffer"),l=e("./isTypedArray"),u=1,p="[object Arguments]",f="[object Array]",h="[object Object]",g=Object.prototype.hasOwnProperty;function y(e,t,n,y,m,_){var v=d(e),b=d(t),P=v?f:s(e),k=b?f:s(t),I=(P=P==p?h:P)==h,N=(k=k==p?h:k)==h,E=P==k;if(E&&c(e)){if(!c(t))return!1;v=!0,I=!1}if(E&&!I)return _||(_=new i),v||l(e)?o(e,t,n,y,m,_):r(e,t,P,n,y,m,_);if(!(n&u)){var S=I&&g.call(e,"__wrapped__"),O=N&&g.call(t,"__wrapped__");if(S||O){var C=S?e.value():e,j=O?t.value():t;return _||(_=new i),m(C,j,n,y,_)}}return!!E&&(_||(_=new i),a(e,t,n,y,m,_))}t.exports=y},{"./_Stack":59,"./_equalArrays":154,"./_equalByTag":155,"./_equalObjects":156,"./_getTag":168,"./isArray":243,"./isBuffer":246,"./isTypedArray":257}],99:[function(e,t,n){var i=e("./_getTag"),o=e("./isObjectLike"),r="[object Map]";function a(e){return o(e)&&i(e)==r}t.exports=a},{"./_getTag":168,"./isObjectLike":252}],100:[function(e,t,n){var i=e("./_Stack"),o=e("./_baseIsEqual"),r=1,a=2;function s(e,t,n,s){var d=n.length,c=d,l=!s;if(null==e)return!c;for(e=Object(e);d--;){var u=n[d];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++d<c;){var p=(u=n[d])[0],f=e[p],h=u[1];if(l&&u[2]){if(void 0===f&&!(p in e))return!1}else{var g=new i;if(s)var y=s(f,h,p,e,t,g);if(!(void 0===y?o(h,f,r|a,s,g):y))return!1}}return!0}t.exports=s},{"./_Stack":59,"./_baseIsEqual":97}],101:[function(e,t,n){function i(e){return e!=e}t.exports=i},{}],102:[function(e,t,n){var i=e("./isFunction"),o=e("./_isMasked"),r=e("./isObject"),a=e("./_toSource"),s=/[\\^$.*+?()[\]{}|]/g,d=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,p=l.hasOwnProperty,f=RegExp("^"+u.call(p).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function h(e){return!(!r(e)||o(e))&&(i(e)?f:d).test(a(e))}t.exports=h},{"./_isMasked":185,"./_toSource":224,"./isFunction":248,"./isObject":251}],103:[function(e,t,n){var i=e("./_getTag"),o=e("./isObjectLike"),r="[object Set]";function a(e){return o(e)&&i(e)==r}t.exports=a},{"./_getTag":168,"./isObjectLike":252}],104:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isLength"),r=e("./isObjectLike"),a="[object Arguments]",s="[object Array]",d="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",p="[object Map]",f="[object Number]",h="[object Object]",g="[object RegExp]",y="[object Set]",m="[object String]",_="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",P="[object Float64Array]",k="[object Int8Array]",I="[object Int16Array]",N="[object Int32Array]",E="[object Uint8Array]",S="[object Uint8ClampedArray]",O="[object Uint16Array]",C="[object Uint32Array]",j={};function T(e){return r(e)&&o(e.length)&&!!j[i(e)]}j["[object Float32Array]"]=j[P]=j[k]=j[I]=j[N]=j[E]=j[S]=j[O]=j[C]=!0,j[a]=j[s]=j[v]=j[d]=j[b]=j[c]=j[l]=j[u]=j[p]=j[f]=j[h]=j[g]=j[y]=j[m]=j[_]=!1,t.exports=T},{"./_baseGetTag":91,"./isLength":249,"./isObjectLike":252}],105:[function(e,t,n){var i=e("./_baseMatches"),o=e("./_baseMatchesProperty"),r=e("./identity"),a=e("./isArray"),s=e("./property");function d(e){return"function"==typeof e?e:null==e?r:"object"==typeof e?a(e)?o(e[0],e[1]):i(e):s(e)}t.exports=d},{"./_baseMatches":110,"./_baseMatchesProperty":111,"./identity":241,"./isArray":243,"./property":272}],106:[function(e,t,n){var i=e("./_isPrototype"),o=e("./_nativeKeys"),r=Object.prototype.hasOwnProperty;function a(e){if(!i(e))return o(e);var t=[];for(var n in Object(e))r.call(e,n)&&"constructor"!=n&&t.push(n);return t}t.exports=a},{"./_isPrototype":186,"./_nativeKeys":202}],107:[function(e,t,n){var i=e("./isObject"),o=e("./_isPrototype"),r=e("./_nativeKeysIn"),a=Object.prototype.hasOwnProperty;function s(e){if(!i(e))return r(e);var t=o(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}t.exports=s},{"./_isPrototype":186,"./_nativeKeysIn":203,"./isObject":251}],108:[function(e,t,n){function i(e,t){return e<t}t.exports=i},{}],109:[function(e,t,n){var i=e("./_baseEach"),o=e("./isArrayLike");function r(e,t){var n=-1,r=o(e)?Array(e.length):[];return i(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}t.exports=r},{"./_baseEach":82,"./isArrayLike":244}],110:[function(e,t,n){var i=e("./_baseIsMatch"),o=e("./_getMatchData"),r=e("./_matchesStrictComparable");function a(e){var t=o(e);return 1==t.length&&t[0][2]?r(t[0][0],t[0][1]):function(n){return n===e||i(n,e,t)}}t.exports=a},{"./_baseIsMatch":100,"./_getMatchData":162,"./_matchesStrictComparable":199}],111:[function(e,t,n){var i=e("./_baseIsEqual"),o=e("./get"),r=e("./hasIn"),a=e("./_isKey"),s=e("./_isStrictComparable"),d=e("./_matchesStrictComparable"),c=e("./_toKey"),l=1,u=2;function p(e,t){return a(e)&&s(t)?d(c(e),t):function(n){var a=o(n,e);return void 0===a&&a===t?r(n,e):i(t,a,l|u)}}t.exports=p},{"./_baseIsEqual":97,"./_isKey":183,"./_isStrictComparable":187,"./_matchesStrictComparable":199,"./_toKey":223,"./get":238,"./hasIn":240}],112:[function(e,t,n){var i=e("./_Stack"),o=e("./_assignMergeValue"),r=e("./_baseFor"),a=e("./_baseMergeDeep"),s=e("./isObject"),d=e("./keysIn"),c=e("./_safeGet");function l(e,t,n,u,p){e!==t&&r(t,(function(r,d){if(p||(p=new i),s(r))a(e,t,d,n,l,u,p);else{var f=u?u(c(e,d),r,d+"",e,t,p):void 0;void 0===f&&(f=r),o(e,d,f)}}),d)}t.exports=l},{"./_Stack":59,"./_assignMergeValue":74,"./_baseFor":87,"./_baseMergeDeep":113,"./_safeGet":209,"./isObject":251,"./keysIn":260}],113:[function(e,t,n){var i=e("./_assignMergeValue"),o=e("./_cloneBuffer"),r=e("./_cloneTypedArray"),a=e("./_copyArray"),s=e("./_initCloneObject"),d=e("./isArguments"),c=e("./isArray"),l=e("./isArrayLikeObject"),u=e("./isBuffer"),p=e("./isFunction"),f=e("./isObject"),h=e("./isPlainObject"),g=e("./isTypedArray"),y=e("./_safeGet"),m=e("./toPlainObject");function _(e,t,n,_,v,b,P){var k=y(e,n),I=y(t,n),N=P.get(I);if(N)i(e,n,N);else{var E=b?b(k,I,n+"",e,t,P):void 0,S=void 0===E;if(S){var O=c(I),C=!O&&u(I),j=!O&&!C&&g(I);E=I,O||C||j?c(k)?E=k:l(k)?E=a(k):C?(S=!1,E=o(I,!0)):j?(S=!1,E=r(I,!0)):E=[]:h(I)||d(I)?(E=k,d(k)?E=m(k):f(k)&&!p(k)||(E=s(I))):S=!1}S&&(P.set(I,E),v(E,I,_,b,P),P.delete(I)),i(e,n,E)}}t.exports=_},{"./_assignMergeValue":74,"./_cloneBuffer":135,"./_cloneTypedArray":139,"./_copyArray":142,"./_initCloneObject":179,"./_safeGet":209,"./isArguments":242,"./isArray":243,"./isArrayLikeObject":245,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isPlainObject":253,"./isTypedArray":257,"./toPlainObject":282}],114:[function(e,t,n){var i=e("./_arrayMap"),o=e("./_baseIteratee"),r=e("./_baseMap"),a=e("./_baseSortBy"),s=e("./_baseUnary"),d=e("./_compareMultiple"),c=e("./identity");function l(e,t,n){var l=-1;t=i(t.length?t:[c],s(o));var u=r(e,(function(e,n,o){return{criteria:i(t,(function(t){return t(e)})),index:++l,value:e}}));return a(u,(function(e,t){return d(e,t,n)}))}t.exports=l},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./_baseSortBy":124,"./_baseUnary":127,"./_compareMultiple":141,"./identity":241}],115:[function(e,t,n){var i=e("./_basePickBy"),o=e("./hasIn");function r(e,t){return i(e,t,(function(t,n){return o(e,n)}))}t.exports=r},{"./_basePickBy":116,"./hasIn":240}],116:[function(e,t,n){var i=e("./_baseGet"),o=e("./_baseSet"),r=e("./_castPath");function a(e,t,n){for(var a=-1,s=t.length,d={};++a<s;){var c=t[a],l=i(e,c);n(l,c)&&o(d,r(c,e),l)}return d}t.exports=a},{"./_baseGet":89,"./_baseSet":122,"./_castPath":133}],117:[function(e,t,n){function i(e){return function(t){return null==t?void 0:t[e]}}t.exports=i},{}],118:[function(e,t,n){var i=e("./_baseGet");function o(e){return function(t){return i(t,e)}}t.exports=o},{"./_baseGet":89}],119:[function(e,t,n){var i=Math.ceil,o=Math.max;function r(e,t,n,r){for(var a=-1,s=o(i((t-e)/(n||1)),0),d=Array(s);s--;)d[r?s:++a]=e,e+=n;return d}t.exports=r},{}],120:[function(e,t,n){function i(e,t,n,i,o){return o(e,(function(e,o,r){n=i?(i=!1,e):t(n,e,o,r)})),n}t.exports=i},{}],121:[function(e,t,n){var i=e("./identity"),o=e("./_overRest"),r=e("./_setToString");function a(e,t){return r(o(e,t,i),e+"")}t.exports=a},{"./_overRest":207,"./_setToString":213,"./identity":241}],122:[function(e,t,n){var i=e("./_assignValue"),o=e("./_castPath"),r=e("./_isIndex"),a=e("./isObject"),s=e("./_toKey");function d(e,t,n,d){if(!a(e))return e;for(var c=-1,l=(t=o(t,e)).length,u=l-1,p=e;null!=p&&++c<l;){var f=s(t[c]),h=n;if(c!=u){var g=p[f];void 0===(h=d?d(g,f,p):void 0)&&(h=a(g)?g:r(t[c+1])?[]:{})}i(p,f,h),p=p[f]}return e}t.exports=d},{"./_assignValue":75,"./_castPath":133,"./_isIndex":181,"./_toKey":223,"./isObject":251}],123:[function(e,t,n){var i=e("./constant"),o=e("./_defineProperty"),r=e("./identity"),a=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:r;t.exports=a},{"./_defineProperty":153,"./constant":228,"./identity":241}],124:[function(e,t,n){function i(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=i},{}],125:[function(e,t,n){function i(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}t.exports=i},{}],126:[function(e,t,n){var i=e("./_Symbol"),o=e("./_arrayMap"),r=e("./isArray"),a=e("./isSymbol"),s=1/0,d=i?i.prototype:void 0,c=d?d.toString:void 0;function l(e){if("string"==typeof e)return e;if(r(e))return o(e,l)+"";if(a(e))return c?c.call(e):"";var t=e+"";return"0"==t&&1/e==-s?"-0":t}t.exports=l},{"./_Symbol":60,"./_arrayMap":69,"./isArray":243,"./isSymbol":256}],127:[function(e,t,n){function i(e){return function(t){return e(t)}}t.exports=i},{}],128:[function(e,t,n){var i=e("./_SetCache"),o=e("./_arrayIncludes"),r=e("./_arrayIncludesWith"),a=e("./_cacheHas"),s=e("./_createSet"),d=e("./_setToArray"),c=200;function l(e,t,n){var l=-1,u=o,p=e.length,f=!0,h=[],g=h;if(n)f=!1,u=r;else if(p>=c){var y=t?null:s(e);if(y)return d(y);f=!1,u=a,g=new i}else g=t?[]:h;e:for(;++l<p;){var m=e[l],_=t?t(m):m;if(m=n||0!==m?m:0,f&&_==_){for(var v=g.length;v--;)if(g[v]===_)continue e;t&&g.push(_),h.push(m)}else u(g,_,n)||(g!==h&&g.push(_),h.push(m))}return h}t.exports=l},{"./_SetCache":58,"./_arrayIncludes":66,"./_arrayIncludesWith":67,"./_cacheHas":131,"./_createSet":152,"./_setToArray":212}],129:[function(e,t,n){var i=e("./_arrayMap");function o(e,t){return i(t,(function(t){return e[t]}))}t.exports=o},{"./_arrayMap":69}],130:[function(e,t,n){function i(e,t,n){for(var i=-1,o=e.length,r=t.length,a={};++i<o;){var s=i<r?t[i]:void 0;n(a,e[i],s)}return a}t.exports=i},{}],131:[function(e,t,n){function i(e,t){return e.has(t)}t.exports=i},{}],132:[function(e,t,n){var i=e("./identity");function o(e){return"function"==typeof e?e:i}t.exports=o},{"./identity":241}],133:[function(e,t,n){var i=e("./isArray"),o=e("./_isKey"),r=e("./_stringToPath"),a=e("./toString");function s(e,t){return i(e)?e:o(e,t)?[e]:r(a(e))}t.exports=s},{"./_isKey":183,"./_stringToPath":222,"./isArray":243,"./toString":283}],134:[function(e,t,n){var i=e("./_Uint8Array");function o(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}t.exports=o},{"./_Uint8Array":61}],135:[function(e,t,n){var i=e("./_root"),o="object"==typeof n&&n&&!n.nodeType&&n,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=r&&r.exports===o?i.Buffer:void 0,s=a?a.allocUnsafe:void 0;function d(e,t){if(t)return e.slice();var n=e.length,i=s?s(n):new e.constructor(n);return e.copy(i),i}t.exports=d},{"./_root":208}],136:[function(e,t,n){var i=e("./_cloneArrayBuffer");function o(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}t.exports=o},{"./_cloneArrayBuffer":134}],137:[function(e,t,n){var i=/\w*$/;function o(e){var t=new e.constructor(e.source,i.exec(e));return t.lastIndex=e.lastIndex,t}t.exports=o},{}],138:[function(e,t,n){var i=e("./_Symbol"),o=i?i.prototype:void 0,r=o?o.valueOf:void 0;function a(e){return r?Object(r.call(e)):{}}t.exports=a},{"./_Symbol":60}],139:[function(e,t,n){var i=e("./_cloneArrayBuffer");function o(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}t.exports=o},{"./_cloneArrayBuffer":134}],140:[function(e,t,n){var i=e("./isSymbol");function o(e,t){if(e!==t){var n=void 0!==e,o=null===e,r=e==e,a=i(e),s=void 0!==t,d=null===t,c=t==t,l=i(t);if(!d&&!l&&!a&&e>t||a&&s&&c&&!d&&!l||o&&s&&c||!n&&c||!r)return 1;if(!o&&!a&&!l&&e<t||l&&n&&r&&!o&&!a||d&&n&&r||!s&&r||!c)return-1}return 0}t.exports=o},{"./isSymbol":256}],141:[function(e,t,n){var i=e("./_compareAscending");function o(e,t,n){for(var o=-1,r=e.criteria,a=t.criteria,s=r.length,d=n.length;++o<s;){var c=i(r[o],a[o]);if(c)return o>=d?c:c*("desc"==n[o]?-1:1)}return e.index-t.index}t.exports=o},{"./_compareAscending":140}],142:[function(e,t,n){function i(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t}t.exports=i},{}],143:[function(e,t,n){var i=e("./_assignValue"),o=e("./_baseAssignValue");function r(e,t,n,r){var a=!n;n||(n={});for(var s=-1,d=t.length;++s<d;){var c=t[s],l=r?r(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?o(n,c,l):i(n,c,l)}return n}t.exports=r},{"./_assignValue":75,"./_baseAssignValue":79}],144:[function(e,t,n){var i=e("./_copyObject"),o=e("./_getSymbols");function r(e,t){return i(e,o(e),t)}t.exports=r},{"./_copyObject":143,"./_getSymbols":166}],145:[function(e,t,n){var i=e("./_copyObject"),o=e("./_getSymbolsIn");function r(e,t){return i(e,o(e),t)}t.exports=r},{"./_copyObject":143,"./_getSymbolsIn":167}],146:[function(e,t,n){var i=e("./_root")["__core-js_shared__"];t.exports=i},{"./_root":208}],147:[function(e,t,n){var i=e("./_baseRest"),o=e("./_isIterateeCall");function r(e){return i((function(t,n){var i=-1,r=n.length,a=r>1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(r--,a):void 0,s&&o(n[0],n[1],s)&&(a=r<3?void 0:a,r=1),t=Object(t);++i<r;){var d=n[i];d&&e(t,d,i,a)}return t}))}t.exports=r},{"./_baseRest":121,"./_isIterateeCall":182}],148:[function(e,t,n){var i=e("./isArrayLike");function o(e,t){return function(n,o){if(null==n)return n;if(!i(n))return e(n,o);for(var r=n.length,a=t?r:-1,s=Object(n);(t?a--:++a<r)&&!1!==o(s[a],a,s););return n}}t.exports=o},{"./isArrayLike":244}],149:[function(e,t,n){function i(e){return function(t,n,i){for(var o=-1,r=Object(t),a=i(t),s=a.length;s--;){var d=a[e?s:++o];if(!1===n(r[d],d,r))break}return t}}t.exports=i},{}],150:[function(e,t,n){var i=e("./_baseIteratee"),o=e("./isArrayLike"),r=e("./keys");function a(e){return function(t,n,a){var s=Object(t);if(!o(t)){var d=i(n,3);t=r(t),n=function(e){return d(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[d?t[c]:c]:void 0}}t.exports=a},{"./_baseIteratee":105,"./isArrayLike":244,"./keys":259}],151:[function(e,t,n){var i=e("./_baseRange"),o=e("./_isIterateeCall"),r=e("./toFinite");function a(e){return function(t,n,a){return a&&"number"!=typeof a&&o(t,n,a)&&(n=a=void 0),t=r(t),void 0===n?(n=t,t=0):n=r(n),a=void 0===a?t<n?1:-1:r(a),i(t,n,a,e)}}t.exports=a},{"./_baseRange":119,"./_isIterateeCall":182,"./toFinite":279}],152:[function(e,t,n){var i=e("./_Set"),o=e("./noop"),r=e("./_setToArray"),a=1/0,s=i&&1/r(new i([,-0]))[1]==a?function(e){return new i(e)}:o;t.exports=s},{"./_Set":57,"./_setToArray":212,"./noop":269}],153:[function(e,t,n){var i=e("./_getNative"),o=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.exports=o},{"./_getNative":163}],154:[function(e,t,n){var i=e("./_SetCache"),o=e("./_arraySome"),r=e("./_cacheHas"),a=1,s=2;function d(e,t,n,d,c,l){var u=n&a,p=e.length,f=t.length;if(p!=f&&!(u&&f>p))return!1;var h=l.get(e);if(h&&l.get(t))return h==t;var g=-1,y=!0,m=n&s?new i:void 0;for(l.set(e,t),l.set(t,e);++g<p;){var _=e[g],v=t[g];if(d)var b=u?d(v,_,g,t,e,l):d(_,v,g,e,t,l);if(void 0!==b){if(b)continue;y=!1;break}if(m){if(!o(t,(function(e,t){if(!r(m,t)&&(_===e||c(_,e,n,d,l)))return m.push(t)}))){y=!1;break}}else if(_!==v&&!c(_,v,n,d,l)){y=!1;break}}return l.delete(e),l.delete(t),y}t.exports=d},{"./_SetCache":58,"./_arraySome":72,"./_cacheHas":131}],155:[function(e,t,n){var i=e("./_Symbol"),o=e("./_Uint8Array"),r=e("./eq"),a=e("./_equalArrays"),s=e("./_mapToArray"),d=e("./_setToArray"),c=1,l=2,u="[object Boolean]",p="[object Date]",f="[object Error]",h="[object Map]",g="[object Number]",y="[object RegExp]",m="[object Set]",_="[object String]",v="[object Symbol]",b="[object ArrayBuffer]",P="[object DataView]",k=i?i.prototype:void 0,I=k?k.valueOf:void 0;function N(e,t,n,i,k,N,E){switch(n){case P:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!N(new o(e),new o(t)));case u:case p:case g:return r(+e,+t);case f:return e.name==t.name&&e.message==t.message;case y:case _:return e==t+"";case h:var S=s;case m:var O=i&c;if(S||(S=d),e.size!=t.size&&!O)return!1;var C=E.get(e);if(C)return C==t;i|=l,E.set(e,t);var j=a(S(e),S(t),i,k,N,E);return E.delete(e),j;case v:if(I)return I.call(e)==I.call(t)}return!1}t.exports=N},{"./_Symbol":60,"./_Uint8Array":61,"./_equalArrays":154,"./_mapToArray":198,"./_setToArray":212,"./eq":231}],156:[function(e,t,n){var i=e("./_getAllKeys"),o=1,r=Object.prototype.hasOwnProperty;function a(e,t,n,a,s,d){var c=n&o,l=i(e),u=l.length;if(u!=i(t).length&&!c)return!1;for(var p=u;p--;){var f=l[p];if(!(c?f in t:r.call(t,f)))return!1}var h=d.get(e);if(h&&d.get(t))return h==t;var g=!0;d.set(e,t),d.set(t,e);for(var y=c;++p<u;){var m=e[f=l[p]],_=t[f];if(a)var v=c?a(_,m,f,t,e,d):a(m,_,f,e,t,d);if(!(void 0===v?m===_||s(m,_,n,a,d):v)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=e.constructor,P=t.constructor;b==P||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof P&&P instanceof P||(g=!1)}return d.delete(e),d.delete(t),g}t.exports=a},{"./_getAllKeys":159}],157:[function(e,t,n){var i=e("./flatten"),o=e("./_overRest"),r=e("./_setToString");function a(e){return r(o(e,void 0,i),e+"")}t.exports=a},{"./_overRest":207,"./_setToString":213,"./flatten":235}],158:[function(e,n,i){(function(e){var t="object"==typeof e&&e&&e.Object===Object&&e;n.exports=t}).call(this,void 0!==t.commonjsGlobal?t.commonjsGlobal:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],159:[function(e,t,n){var i=e("./_baseGetAllKeys"),o=e("./_getSymbols"),r=e("./keys");function a(e){return i(e,r,o)}t.exports=a},{"./_baseGetAllKeys":90,"./_getSymbols":166,"./keys":259}],160:[function(e,t,n){var i=e("./_baseGetAllKeys"),o=e("./_getSymbolsIn"),r=e("./keysIn");function a(e){return i(e,r,o)}t.exports=a},{"./_baseGetAllKeys":90,"./_getSymbolsIn":167,"./keysIn":260}],161:[function(e,t,n){var i=e("./_isKeyable");function o(e,t){var n=e.__data__;return i(t)?n["string"==typeof t?"string":"hash"]:n.map}t.exports=o},{"./_isKeyable":184}],162:[function(e,t,n){var i=e("./_isStrictComparable"),o=e("./keys");function r(e){for(var t=o(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,i(a)]}return t}t.exports=r},{"./_isStrictComparable":187,"./keys":259}],163:[function(e,t,n){var i=e("./_baseIsNative"),o=e("./_getValue");function r(e,t){var n=o(e,t);return i(n)?n:void 0}t.exports=r},{"./_baseIsNative":102,"./_getValue":169}],164:[function(e,t,n){var i=e("./_overArg")(Object.getPrototypeOf,Object);t.exports=i},{"./_overArg":206}],165:[function(e,t,n){var i=e("./_Symbol"),o=Object.prototype,r=o.hasOwnProperty,a=o.toString,s=i?i.toStringTag:void 0;function d(e){var t=r.call(e,s),n=e[s];try{e[s]=void 0;var i=!0}catch(e){}var o=a.call(e);return i&&(t?e[s]=n:delete e[s]),o}t.exports=d},{"./_Symbol":60}],166:[function(e,t,n){var i=e("./_arrayFilter"),o=e("./stubArray"),r=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),i(a(e),(function(t){return r.call(e,t)})))}:o;t.exports=s},{"./_arrayFilter":65,"./stubArray":277}],167:[function(e,t,n){var i=e("./_arrayPush"),o=e("./_getPrototype"),r=e("./_getSymbols"),a=e("./stubArray"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)i(t,r(e)),e=o(e);return t}:a;t.exports=s},{"./_arrayPush":70,"./_getPrototype":164,"./_getSymbols":166,"./stubArray":277}],168:[function(e,t,n){var i=e("./_DataView"),o=e("./_Map"),r=e("./_Promise"),a=e("./_Set"),s=e("./_WeakMap"),d=e("./_baseGetTag"),c=e("./_toSource"),l="[object Map]",u="[object Object]",p="[object Promise]",f="[object Set]",h="[object WeakMap]",g="[object DataView]",y=c(i),m=c(o),_=c(r),v=c(a),b=c(s),P=d;(i&&P(new i(new ArrayBuffer(1)))!=g||o&&P(new o)!=l||r&&P(r.resolve())!=p||a&&P(new a)!=f||s&&P(new s)!=h)&&(P=function(e){var t=d(e),n=t==u?e.constructor:void 0,i=n?c(n):"";if(i)switch(i){case y:return g;case m:return l;case _:return p;case v:return f;case b:return h}return t}),t.exports=P},{"./_DataView":51,"./_Map":54,"./_Promise":56,"./_Set":57,"./_WeakMap":62,"./_baseGetTag":91,"./_toSource":224}],169:[function(e,t,n){function i(e,t){return null==e?void 0:e[t]}t.exports=i},{}],170:[function(e,t,n){var i=e("./_castPath"),o=e("./isArguments"),r=e("./isArray"),a=e("./_isIndex"),s=e("./isLength"),d=e("./_toKey");function c(e,t,n){for(var c=-1,l=(t=i(t,e)).length,u=!1;++c<l;){var p=d(t[c]);if(!(u=null!=e&&n(e,p)))break;e=e[p]}return u||++c!=l?u:!!(l=null==e?0:e.length)&&s(l)&&a(p,l)&&(r(e)||o(e))}t.exports=c},{"./_castPath":133,"./_isIndex":181,"./_toKey":223,"./isArguments":242,"./isArray":243,"./isLength":249}],171:[function(e,t,n){var i=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function o(e){return i.test(e)}t.exports=o},{}],172:[function(e,t,n){var i=e("./_nativeCreate");function o(){this.__data__=i?i(null):{},this.size=0}t.exports=o},{"./_nativeCreate":201}],173:[function(e,t,n){function i(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=i},{}],174:[function(e,t,n){var i=e("./_nativeCreate"),o="__lodash_hash_undefined__",r=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(i){var n=t[e];return n===o?void 0:n}return r.call(t,e)?t[e]:void 0}t.exports=a},{"./_nativeCreate":201}],175:[function(e,t,n){var i=e("./_nativeCreate"),o=Object.prototype.hasOwnProperty;function r(e){var t=this.__data__;return i?void 0!==t[e]:o.call(t,e)}t.exports=r},{"./_nativeCreate":201}],176:[function(e,t,n){var i=e("./_nativeCreate"),o="__lodash_hash_undefined__";function r(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=i&&void 0===t?o:t,this}t.exports=r},{"./_nativeCreate":201}],177:[function(e,t,n){var i=Object.prototype.hasOwnProperty;function o(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&i.call(e,"index")&&(n.index=e.index,n.input=e.input),n}t.exports=o},{}],178:[function(e,t,n){var i=e("./_cloneArrayBuffer"),o=e("./_cloneDataView"),r=e("./_cloneRegExp"),a=e("./_cloneSymbol"),s=e("./_cloneTypedArray"),d="[object Boolean]",c="[object Date]",l="[object Map]",u="[object Number]",p="[object RegExp]",f="[object Set]",h="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",m="[object DataView]",_="[object Float32Array]",v="[object Float64Array]",b="[object Int8Array]",P="[object Int16Array]",k="[object Int32Array]",I="[object Uint8Array]",N="[object Uint8ClampedArray]",E="[object Uint16Array]",S="[object Uint32Array]";function O(e,t,n){var O=e.constructor;switch(t){case y:return i(e);case d:case c:return new O(+e);case m:return o(e,n);case _:case v:case b:case P:case k:case I:case N:case E:case S:return s(e,n);case l:return new O;case u:case h:return new O(e);case p:return r(e);case f:return new O;case g:return a(e)}}t.exports=O},{"./_cloneArrayBuffer":134,"./_cloneDataView":136,"./_cloneRegExp":137,"./_cloneSymbol":138,"./_cloneTypedArray":139}],179:[function(e,t,n){var i=e("./_baseCreate"),o=e("./_getPrototype"),r=e("./_isPrototype");function a(e){return"function"!=typeof e.constructor||r(e)?{}:i(o(e))}t.exports=a},{"./_baseCreate":81,"./_getPrototype":164,"./_isPrototype":186}],180:[function(e,t,n){var i=e("./_Symbol"),o=e("./isArguments"),r=e("./isArray"),a=i?i.isConcatSpreadable:void 0;function s(e){return r(e)||o(e)||!!(a&&e&&e[a])}t.exports=s},{"./_Symbol":60,"./isArguments":242,"./isArray":243}],181:[function(e,t,n){var i=9007199254740991,o=/^(?:0|[1-9]\d*)$/;function r(e,t){var n=typeof e;return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e<t}t.exports=r},{}],182:[function(e,t,n){var i=e("./eq"),o=e("./isArrayLike"),r=e("./_isIndex"),a=e("./isObject");function s(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?o(n)&&r(t,n.length):"string"==s&&t in n)&&i(n[t],e)}t.exports=s},{"./_isIndex":181,"./eq":231,"./isArrayLike":244,"./isObject":251}],183:[function(e,t,n){var i=e("./isArray"),o=e("./isSymbol"),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function s(e,t){if(i(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||a.test(e)||!r.test(e)||null!=t&&e in Object(t)}t.exports=s},{"./isArray":243,"./isSymbol":256}],184:[function(e,t,n){function i(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}t.exports=i},{}],185:[function(e,t,n){var i,o=e("./_coreJsData"),r=(i=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"";function a(e){return!!r&&r in e}t.exports=a},{"./_coreJsData":146}],186:[function(e,t,n){var i=Object.prototype;function o(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||i)}t.exports=o},{}],187:[function(e,t,n){var i=e("./isObject");function o(e){return e==e&&!i(e)}t.exports=o},{"./isObject":251}],188:[function(e,t,n){function i(){this.__data__=[],this.size=0}t.exports=i},{}],189:[function(e,t,n){var i=e("./_assocIndexOf"),o=Array.prototype.splice;function r(e){var t=this.__data__,n=i(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}t.exports=r},{"./_assocIndexOf":76}],190:[function(e,t,n){var i=e("./_assocIndexOf");function o(e){var t=this.__data__,n=i(t,e);return n<0?void 0:t[n][1]}t.exports=o},{"./_assocIndexOf":76}],191:[function(e,t,n){var i=e("./_assocIndexOf");function o(e){return i(this.__data__,e)>-1}t.exports=o},{"./_assocIndexOf":76}],192:[function(e,t,n){var i=e("./_assocIndexOf");function o(e,t){var n=this.__data__,o=i(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}t.exports=o},{"./_assocIndexOf":76}],193:[function(e,t,n){var i=e("./_Hash"),o=e("./_ListCache"),r=e("./_Map");function a(){this.size=0,this.__data__={hash:new i,map:new(r||o),string:new i}}t.exports=a},{"./_Hash":52,"./_ListCache":53,"./_Map":54}],194:[function(e,t,n){var i=e("./_getMapData");function o(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}t.exports=o},{"./_getMapData":161}],195:[function(e,t,n){var i=e("./_getMapData");function o(e){return i(this,e).get(e)}t.exports=o},{"./_getMapData":161}],196:[function(e,t,n){var i=e("./_getMapData");function o(e){return i(this,e).has(e)}t.exports=o},{"./_getMapData":161}],197:[function(e,t,n){var i=e("./_getMapData");function o(e,t){var n=i(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}t.exports=o},{"./_getMapData":161}],198:[function(e,t,n){function i(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}t.exports=i},{}],199:[function(e,t,n){function i(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}t.exports=i},{}],200:[function(e,t,n){var i=e("./memoize"),o=500;function r(e){var t=i(e,(function(e){return n.size===o&&n.clear(),e})),n=t.cache;return t}t.exports=r},{"./memoize":265}],201:[function(e,t,n){var i=e("./_getNative")(Object,"create");t.exports=i},{"./_getNative":163}],202:[function(e,t,n){var i=e("./_overArg")(Object.keys,Object);t.exports=i},{"./_overArg":206}],203:[function(e,t,n){function i(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.exports=i},{}],204:[function(e,t,n){var i=e("./_freeGlobal"),o="object"==typeof n&&n&&!n.nodeType&&n,r=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=r&&r.exports===o&&i.process,s=function(){try{var e=r&&r.require&&r.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();t.exports=s},{"./_freeGlobal":158}],205:[function(e,t,n){var i=Object.prototype.toString;function o(e){return i.call(e)}t.exports=o},{}],206:[function(e,t,n){function i(e,t){return function(n){return e(t(n))}}t.exports=i},{}],207:[function(e,t,n){var i=e("./_apply"),o=Math.max;function r(e,t,n){return t=o(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,s=o(r.length-t,0),d=Array(s);++a<s;)d[a]=r[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=r[a];return c[t]=n(d),i(e,this,c)}}t.exports=r},{"./_apply":63}],208:[function(e,t,n){var i=e("./_freeGlobal"),o="object"==typeof self&&self&&self.Object===Object&&self,r=i||o||Function("return this")();t.exports=r},{"./_freeGlobal":158}],209:[function(e,t,n){function i(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}t.exports=i},{}],210:[function(e,t,n){var i="__lodash_hash_undefined__";function o(e){return this.__data__.set(e,i),this}t.exports=o},{}],211:[function(e,t,n){function i(e){return this.__data__.has(e)}t.exports=i},{}],212:[function(e,t,n){function i(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}t.exports=i},{}],213:[function(e,t,n){var i=e("./_baseSetToString"),o=e("./_shortOut")(i);t.exports=o},{"./_baseSetToString":123,"./_shortOut":214}],214:[function(e,t,n){var i=800,o=16,r=Date.now;function a(e){var t=0,n=0;return function(){var a=r(),s=o-(a-n);if(n=a,s>0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a},{}],215:[function(e,t,n){var i=e("./_ListCache");function o(){this.__data__=new i,this.size=0}t.exports=o},{"./_ListCache":53}],216:[function(e,t,n){function i(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=i},{}],217:[function(e,t,n){function i(e){return this.__data__.get(e)}t.exports=i},{}],218:[function(e,t,n){function i(e){return this.__data__.has(e)}t.exports=i},{}],219:[function(e,t,n){var i=e("./_ListCache"),o=e("./_Map"),r=e("./_MapCache"),a=200;function s(e,t){var n=this.__data__;if(n instanceof i){var s=n.__data__;if(!o||s.length<a-1)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new r(s)}return n.set(e,t),this.size=n.size,this}t.exports=s},{"./_ListCache":53,"./_Map":54,"./_MapCache":55}],220:[function(e,t,n){function i(e,t,n){for(var i=n-1,o=e.length;++i<o;)if(e[i]===t)return i;return-1}t.exports=i},{}],221:[function(e,t,n){var i=e("./_asciiSize"),o=e("./_hasUnicode"),r=e("./_unicodeSize");function a(e){return o(e)?r(e):i(e)}t.exports=a},{"./_asciiSize":73,"./_hasUnicode":171,"./_unicodeSize":225}],222:[function(e,t,n){var i=e("./_memoizeCapped"),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,a=i((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,i,o){t.push(i?o.replace(r,"$1"):n||e)})),t}));t.exports=a},{"./_memoizeCapped":200}],223:[function(e,t,n){var i=e("./isSymbol"),o=1/0;function r(e){if("string"==typeof e||i(e))return e;var t=e+"";return"0"==t&&1/e==-o?"-0":t}t.exports=r},{"./isSymbol":256}],224:[function(e,t,n){var i=Function.prototype.toString;function o(e){if(null!=e){try{return i.call(e)}catch(e){}try{return e+""}catch(e){}}return""}t.exports=o},{}],225:[function(e,t,n){var i="\\ud800-\\udfff",o="["+i+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",a="\\ud83c[\\udffb-\\udfff]",s="[^"+i+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",c="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+a+")?",u="[\\ufe0e\\ufe0f]?",p=u+l+"(?:\\u200d(?:"+[s,d,c].join("|")+")"+u+l+")*",f="(?:"+[s+r+"?",r,d,c,o].join("|")+")",h=RegExp(a+"(?="+a+")|"+f+p,"g");function g(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}t.exports=g},{}],226:[function(e,t,n){var i=e("./_baseClone"),o=4;function r(e){return i(e,o)}t.exports=r},{"./_baseClone":80}],227:[function(e,t,n){var i=e("./_baseClone"),o=1,r=4;function a(e){return i(e,o|r)}t.exports=a},{"./_baseClone":80}],228:[function(e,t,n){function i(e){return function(){return e}}t.exports=i},{}],229:[function(e,t,n){var i=e("./_baseRest"),o=e("./eq"),r=e("./_isIterateeCall"),a=e("./keysIn"),s=Object.prototype,d=s.hasOwnProperty,c=i((function(e,t){e=Object(e);var n=-1,i=t.length,c=i>2?t[2]:void 0;for(c&&r(t[0],t[1],c)&&(i=1);++n<i;)for(var l=t[n],u=a(l),p=-1,f=u.length;++p<f;){var h=u[p],g=e[h];(void 0===g||o(g,s[h])&&!d.call(e,h))&&(e[h]=l[h])}return e}));t.exports=c},{"./_baseRest":121,"./_isIterateeCall":182,"./eq":231,"./keysIn":260}],230:[function(e,t,n){t.exports=e("./forEach")},{"./forEach":236}],231:[function(e,t,n){function i(e,t){return e===t||e!=e&&t!=t}t.exports=i},{}],232:[function(e,t,n){var i=e("./_arrayFilter"),o=e("./_baseFilter"),r=e("./_baseIteratee"),a=e("./isArray");function s(e,t){return(a(e)?i:o)(e,r(t,3))}t.exports=s},{"./_arrayFilter":65,"./_baseFilter":84,"./_baseIteratee":105,"./isArray":243}],233:[function(e,t,n){var i=e("./_createFind")(e("./findIndex"));t.exports=i},{"./_createFind":150,"./findIndex":234}],234:[function(e,t,n){var i=e("./_baseFindIndex"),o=e("./_baseIteratee"),r=e("./toInteger"),a=Math.max;function s(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var d=null==n?0:r(n);return d<0&&(d=a(s+d,0)),i(e,o(t,3),d)}t.exports=s},{"./_baseFindIndex":85,"./_baseIteratee":105,"./toInteger":280}],235:[function(e,t,n){var i=e("./_baseFlatten");function o(e){return null!=e&&e.length?i(e,1):[]}t.exports=o},{"./_baseFlatten":86}],236:[function(e,t,n){var i=e("./_arrayEach"),o=e("./_baseEach"),r=e("./_castFunction"),a=e("./isArray");function s(e,t){return(a(e)?i:o)(e,r(t))}t.exports=s},{"./_arrayEach":64,"./_baseEach":82,"./_castFunction":132,"./isArray":243}],237:[function(e,t,n){var i=e("./_baseFor"),o=e("./_castFunction"),r=e("./keysIn");function a(e,t){return null==e?e:i(e,o(t),r)}t.exports=a},{"./_baseFor":87,"./_castFunction":132,"./keysIn":260}],238:[function(e,t,n){var i=e("./_baseGet");function o(e,t,n){var o=null==e?void 0:i(e,t);return void 0===o?n:o}t.exports=o},{"./_baseGet":89}],239:[function(e,t,n){var i=e("./_baseHas"),o=e("./_hasPath");function r(e,t){return null!=e&&o(e,t,i)}t.exports=r},{"./_baseHas":93,"./_hasPath":170}],240:[function(e,t,n){var i=e("./_baseHasIn"),o=e("./_hasPath");function r(e,t){return null!=e&&o(e,t,i)}t.exports=r},{"./_baseHasIn":94,"./_hasPath":170}],241:[function(e,t,n){function i(e){return e}t.exports=i},{}],242:[function(e,t,n){var i=e("./_baseIsArguments"),o=e("./isObjectLike"),r=Object.prototype,a=r.hasOwnProperty,s=r.propertyIsEnumerable,d=i(function(){return arguments}())?i:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};t.exports=d},{"./_baseIsArguments":96,"./isObjectLike":252}],243:[function(e,t,n){var i=Array.isArray;t.exports=i},{}],244:[function(e,t,n){var i=e("./isFunction"),o=e("./isLength");function r(e){return null!=e&&o(e.length)&&!i(e)}t.exports=r},{"./isFunction":248,"./isLength":249}],245:[function(e,t,n){var i=e("./isArrayLike"),o=e("./isObjectLike");function r(e){return o(e)&&i(e)}t.exports=r},{"./isArrayLike":244,"./isObjectLike":252}],246:[function(e,t,n){var i=e("./_root"),o=e("./stubFalse"),r="object"==typeof n&&n&&!n.nodeType&&n,a=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===r?i.Buffer:void 0,d=(s?s.isBuffer:void 0)||o;t.exports=d},{"./_root":208,"./stubFalse":278}],247:[function(e,t,n){var i=e("./_baseKeys"),o=e("./_getTag"),r=e("./isArguments"),a=e("./isArray"),s=e("./isArrayLike"),d=e("./isBuffer"),c=e("./_isPrototype"),l=e("./isTypedArray"),u="[object Map]",p="[object Set]",f=Object.prototype.hasOwnProperty;function h(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||d(e)||l(e)||r(e)))return!e.length;var t=o(e);if(t==u||t==p)return!e.size;if(c(e))return!i(e).length;for(var n in e)if(f.call(e,n))return!1;return!0}t.exports=h},{"./_baseKeys":106,"./_getTag":168,"./_isPrototype":186,"./isArguments":242,"./isArray":243,"./isArrayLike":244,"./isBuffer":246,"./isTypedArray":257}],248:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isObject"),r="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",d="[object Proxy]";function c(e){if(!o(e))return!1;var t=i(e);return t==a||t==s||t==r||t==d}t.exports=c},{"./_baseGetTag":91,"./isObject":251}],249:[function(e,t,n){var i=9007199254740991;function o(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}t.exports=o},{}],250:[function(e,t,n){var i=e("./_baseIsMap"),o=e("./_baseUnary"),r=e("./_nodeUtil"),a=r&&r.isMap,s=a?o(a):i;t.exports=s},{"./_baseIsMap":99,"./_baseUnary":127,"./_nodeUtil":204}],251:[function(e,t,n){function i(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=i},{}],252:[function(e,t,n){function i(e){return null!=e&&"object"==typeof e}t.exports=i},{}],253:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./_getPrototype"),r=e("./isObjectLike"),a="[object Object]",s=Function.prototype,d=Object.prototype,c=s.toString,l=d.hasOwnProperty,u=c.call(Object);function p(e){if(!r(e)||i(e)!=a)return!1;var t=o(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==u}t.exports=p},{"./_baseGetTag":91,"./_getPrototype":164,"./isObjectLike":252}],254:[function(e,t,n){var i=e("./_baseIsSet"),o=e("./_baseUnary"),r=e("./_nodeUtil"),a=r&&r.isSet,s=a?o(a):i;t.exports=s},{"./_baseIsSet":103,"./_baseUnary":127,"./_nodeUtil":204}],255:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isArray"),r=e("./isObjectLike"),a="[object String]";function s(e){return"string"==typeof e||!o(e)&&r(e)&&i(e)==a}t.exports=s},{"./_baseGetTag":91,"./isArray":243,"./isObjectLike":252}],256:[function(e,t,n){var i=e("./_baseGetTag"),o=e("./isObjectLike"),r="[object Symbol]";function a(e){return"symbol"==typeof e||o(e)&&i(e)==r}t.exports=a},{"./_baseGetTag":91,"./isObjectLike":252}],257:[function(e,t,n){var i=e("./_baseIsTypedArray"),o=e("./_baseUnary"),r=e("./_nodeUtil"),a=r&&r.isTypedArray,s=a?o(a):i;t.exports=s},{"./_baseIsTypedArray":104,"./_baseUnary":127,"./_nodeUtil":204}],258:[function(e,t,n){function i(e){return void 0===e}t.exports=i},{}],259:[function(e,t,n){var i=e("./_arrayLikeKeys"),o=e("./_baseKeys"),r=e("./isArrayLike");function a(e){return r(e)?i(e):o(e)}t.exports=a},{"./_arrayLikeKeys":68,"./_baseKeys":106,"./isArrayLike":244}],260:[function(e,t,n){var i=e("./_arrayLikeKeys"),o=e("./_baseKeysIn"),r=e("./isArrayLike");function a(e){return r(e)?i(e,!0):o(e)}t.exports=a},{"./_arrayLikeKeys":68,"./_baseKeysIn":107,"./isArrayLike":244}],261:[function(e,t,n){function i(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}t.exports=i},{}],262:[function(e,t,n){var i=e("./_arrayMap"),o=e("./_baseIteratee"),r=e("./_baseMap"),a=e("./isArray");function s(e,t){return(a(e)?i:r)(e,o(t,3))}t.exports=s},{"./_arrayMap":69,"./_baseIteratee":105,"./_baseMap":109,"./isArray":243}],263:[function(e,t,n){var i=e("./_baseAssignValue"),o=e("./_baseForOwn"),r=e("./_baseIteratee");function a(e,t){var n={};return t=r(t,3),o(e,(function(e,o,r){i(n,o,t(e,o,r))})),n}t.exports=a},{"./_baseAssignValue":79,"./_baseForOwn":88,"./_baseIteratee":105}],264:[function(e,t,n){var i=e("./_baseExtremum"),o=e("./_baseGt"),r=e("./identity");function a(e){return e&&e.length?i(e,r,o):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseGt":92,"./identity":241}],265:[function(e,t,n){var i=e("./_MapCache"),o="Expected a function";function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var a=e.apply(this,i);return n.cache=r.set(o,a)||r,a};return n.cache=new(r.Cache||i),n}r.Cache=i,t.exports=r},{"./_MapCache":55}],266:[function(e,t,n){var i=e("./_baseMerge"),o=e("./_createAssigner")((function(e,t,n){i(e,t,n)}));t.exports=o},{"./_baseMerge":112,"./_createAssigner":147}],267:[function(e,t,n){var i=e("./_baseExtremum"),o=e("./_baseLt"),r=e("./identity");function a(e){return e&&e.length?i(e,r,o):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseLt":108,"./identity":241}],268:[function(e,t,n){var i=e("./_baseExtremum"),o=e("./_baseIteratee"),r=e("./_baseLt");function a(e,t){return e&&e.length?i(e,o(t,2),r):void 0}t.exports=a},{"./_baseExtremum":83,"./_baseIteratee":105,"./_baseLt":108}],269:[function(e,t,n){function i(){}t.exports=i},{}],270:[function(e,t,n){var i=e("./_root"),o=function(){return i.Date.now()};t.exports=o},{"./_root":208}],271:[function(e,t,n){var i=e("./_basePick"),o=e("./_flatRest")((function(e,t){return null==e?{}:i(e,t)}));t.exports=o},{"./_basePick":115,"./_flatRest":157}],272:[function(e,t,n){var i=e("./_baseProperty"),o=e("./_basePropertyDeep"),r=e("./_isKey"),a=e("./_toKey");function s(e){return r(e)?i(a(e)):o(e)}t.exports=s},{"./_baseProperty":117,"./_basePropertyDeep":118,"./_isKey":183,"./_toKey":223}],273:[function(e,t,n){var i=e("./_createRange")();t.exports=i},{"./_createRange":151}],274:[function(e,t,n){var i=e("./_arrayReduce"),o=e("./_baseEach"),r=e("./_baseIteratee"),a=e("./_baseReduce"),s=e("./isArray");function d(e,t,n){var d=s(e)?i:a,c=arguments.length<3;return d(e,r(t,4),n,c,o)}t.exports=d},{"./_arrayReduce":71,"./_baseEach":82,"./_baseIteratee":105,"./_baseReduce":120,"./isArray":243}],275:[function(e,t,n){var i=e("./_baseKeys"),o=e("./_getTag"),r=e("./isArrayLike"),a=e("./isString"),s=e("./_stringSize"),d="[object Map]",c="[object Set]";function l(e){if(null==e)return 0;if(r(e))return a(e)?s(e):e.length;var t=o(e);return t==d||t==c?e.size:i(e).length}t.exports=l},{"./_baseKeys":106,"./_getTag":168,"./_stringSize":221,"./isArrayLike":244,"./isString":255}],276:[function(e,t,n){var i=e("./_baseFlatten"),o=e("./_baseOrderBy"),r=e("./_baseRest"),a=e("./_isIterateeCall"),s=r((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),o(e,i(t,1),[])}));t.exports=s},{"./_baseFlatten":86,"./_baseOrderBy":114,"./_baseRest":121,"./_isIterateeCall":182}],277:[function(e,t,n){function i(){return[]}t.exports=i},{}],278:[function(e,t,n){function i(){return!1}t.exports=i},{}],279:[function(e,t,n){var i=e("./toNumber"),o=1/0,r=17976931348623157e292;function a(e){return e?(e=i(e))===o||e===-o?(e<0?-1:1)*r:e==e?e:0:0===e?e:0}t.exports=a},{"./toNumber":281}],280:[function(e,t,n){var i=e("./toFinite");function o(e){var t=i(e),n=t%1;return t==t?n?t-n:t:0}t.exports=o},{"./toFinite":279}],281:[function(e,t,n){var i=e("./isObject"),o=e("./isSymbol"),r=NaN,a=/^\s+|\s+$/g,s=/^[-+]0x[0-9a-f]+$/i,d=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if("number"==typeof e)return e;if(o(e))return r;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var n=d.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):s.test(e)?r:+e}t.exports=u},{"./isObject":251,"./isSymbol":256}],282:[function(e,t,n){var i=e("./_copyObject"),o=e("./keysIn");function r(e){return i(e,o(e))}t.exports=r},{"./_copyObject":143,"./keysIn":260}],283:[function(e,t,n){var i=e("./_baseToString");function o(e){return null==e?"":i(e)}t.exports=o},{"./_baseToString":126}],284:[function(e,t,n){var i=e("./_arrayEach"),o=e("./_baseCreate"),r=e("./_baseForOwn"),a=e("./_baseIteratee"),s=e("./_getPrototype"),d=e("./isArray"),c=e("./isBuffer"),l=e("./isFunction"),u=e("./isObject"),p=e("./isTypedArray");function f(e,t,n){var f=d(e),h=f||c(e)||p(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=h?f?new g:[]:u(e)&&l(g)?o(s(e)):{}}return(h?i:r)(e,(function(e,i,o){return t(n,e,i,o)})),n}t.exports=f},{"./_arrayEach":64,"./_baseCreate":81,"./_baseForOwn":88,"./_baseIteratee":105,"./_getPrototype":164,"./isArray":243,"./isBuffer":246,"./isFunction":248,"./isObject":251,"./isTypedArray":257}],285:[function(e,t,n){var i=e("./_baseFlatten"),o=e("./_baseRest"),r=e("./_baseUniq"),a=e("./isArrayLikeObject"),s=o((function(e){return r(i(e,1,a,!0))}));t.exports=s},{"./_baseFlatten":86,"./_baseRest":121,"./_baseUniq":128,"./isArrayLikeObject":245}],286:[function(e,t,n){var i=e("./toString"),o=0;function r(e){var t=++o;return i(e)+t}t.exports=r},{"./toString":283}],287:[function(e,t,n){var i=e("./_baseValues"),o=e("./keys");function r(e){return null==e?[]:i(e,o(e))}t.exports=r},{"./_baseValues":129,"./keys":259}],288:[function(e,t,n){var i=e("./_assignValue"),o=e("./_baseZipObject");function r(e,t){return o(e||[],t||[],i)}t.exports=r},{"./_assignValue":75,"./_baseZipObject":130}]},{},[1])(1);var rt=ot.exports;function at(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return st(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var dt=function(){function n(t,i){e._classCallCheck(this,n),this.pipelineId=t,this.objectModel=i,this.store=i.store}return e._createClass(n,[{key:"getPipeline",value:function(){return this.objectModel.getCanvasInfoPipeline(this.pipelineId)}},{key:"isPipelineExternal",value:function(){return this.objectModel.getCanvasInfoPipeline(this.pipelineId).parentUrl}},{key:"getObjects",value:function(){var e=this.objectModel.getCanvasInfoPipeline(this.pipelineId);return e?e.nodes.concat(e.comments):[]}},{key:"moveObjects",value:function(e){this.store.dispatch({type:"MOVE_OBJECTS",data:e,pipelineId:this.pipelineId})}},{key:"deleteObject",value:function(e){this.deleteObjects([e])}},{key:"deleteObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){var n=t.filterNodesAndComments(e),i=n.nodes,o=n.comments;t.deleteNodesInternal(i),t.deleteCommentsInternal(o)}),e)}},{key:"addAndUpdateObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"ADD_AND_UPDATE_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"deleteAndUpdateObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"DELETE_AND_UPDATE_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"addPastedObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"ADD_PASTED_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"deletePastedObjects",value:function(e){var t=this;this.objectModel.executeWithSelectionChange((function(e){t.store.dispatch({type:"DELETE_PASTED_OBJECTS",data:e,pipelineId:t.pipelineId})}),e)}},{key:"filterNodesAndComments",value:function(e){var t=this,n=[],i=[];return e.forEach((function(e){var o=t.getComment(e);o?i.push(o):n.push(t.getNode(e))})),{nodes:n,comments:i}}},{key:"getObjectStyle",value:function(e,t){var n=this.getObject(e);return t?n&&n.style_temp?n.style_temp:null:n&&n.style?n.style:null}},{key:"setObjectsClassName",value:function(e,t){this.store.dispatch({type:"SET_OBJECTS_CLASS_NAME",data:{objIds:e,newClassName:t},pipelineId:this.pipelineId})}},{key:"setObjectsColorClassName",value:function(e,t){this.store.dispatch({type:"SET_OBJECTS_COLOR_CLASS_NAME",data:{objIds:e,newColorClass:t},pipelineId:this.pipelineId})}},{key:"disconnectObjects",value:function(e){var t=this,n=[];return e.forEach((function(e){t.getLinksContainingId(e).forEach((function(e){n=t.pushUniqueLinks(e,n)}))})),this.store.dispatch({type:"DELETE_LINKS",data:{linksToDelete:n},pipelineId:this.pipelineId}),n}},{key:"isEmpty",value:function(){return this.store.isEmpty(this.pipelineId)}},{key:"getObject",value:function(e){var t=this.getNode(e);if(t)return t;var n=this.getComment(e);return n||null}},{key:"exactlyOverlaps",value:function(e,t,n){var i=this,o=!1;e&&e.length>0&&(e.findIndex((function(e){return i.exactlyOverlapsNodes(e)}))>-1&&(o=!0));!1===o&&t&&t.length>0&&(t.findIndex((function(e){return i.exactlyOverlapsComments(e)}))>-1&&(o=!0));!1===o&&n&&n.length>0&&(n.findIndex((function(e){return i.exactlyOverlapsLinks(e)}))>-1&&(o=!0));return o}},{key:"exactlyOverlapsNodes",value:function(e){var t=!1;return this.getNodes().forEach((function(n){n.x_pos===e.x_pos&&n.y_pos===e.y_pos&&(t=!0)})),t}},{key:"overlapsNodes",value:function(e,t){var n=!1;return(t||this.getNodes()).forEach((function(t){var i=t.x_pos+t.width,o=t.y_pos+t.height;e.id!==t.id&&(e.x_pos===t.x_pos&&e.y_pos===t.y_pos||e.x_pos>=t.x_pos&&e.x_pos<=i&&e.y_pos>=t.y_pos&&e.y_pos<=o||e.x_pos+e.width>t.x_pos&&e.x_pos+e.width<i&&e.y_pos>t.y_pos&&e.y_pos<o||e.x_pos>t.x_pos&&e.x_pos<i&&e.y_pos+e.height>t.y_pos&&e.y_pos+e.height<o||e.x_pos+e.width>t.x_pos&&e.x_pos+e.width<i&&e.y_pos+e.height>t.y_pos&&e.y_pos+e.height<o)&&(n=!0)})),n}},{key:"exactlyOverlapsComments",value:function(e){var t=!1;return this.getComments().forEach((function(n){n.x_pos===e.x_pos&&n.y_pos===e.y_pos&&(t=!0)})),t}},{key:"exactlyOverlapsLinks",value:function(e){var t=!1;return this.getLinks().forEach((function(n){n.srcPos&&e.srcPos&&n.srcPos.x_pos===e.srcPos.x_pos&&n.srcPos.y_pos===e.srcPos.y_pos&&(t=!0),n.trgPos&&e.trgPos&&n.trgPos.x_pos===e.trgPos.x_pos&&n.trgPos.y_pos===e.trgPos.y_pos&&(t=!0)})),t}},{key:"isObjectIdInObjects",value:function(e,t){return!!t&&t.findIndex((function(t){return t.id===e}))>-1}},{key:"createNode",value:function(e){var n=e.nodeTemplate;t.has_1(e.nodeTemplate,"app_data.ui_data")&&(n=this.objectModel.convertNodeTemplate(n));var i={};return null!==n&&(i=Object.assign({},n,{id:this.objectModel.getUniqueId(o.CREATE_NODE,{nodeType:n,pipelineId:this.pipelineId}),x_pos:e.offsetX,y_pos:e.offsetY}),i=this.objectModel.setNodeAttributes(i)),i}},{key:"getAutoSourceNode",value:function(e){var t=null,n=this.objectModel.getSelectedNodes();if(1===n.length&&this.isViableAutoSourceNode(n[0]))t=n[0];else if(!e){var i=this.getNodes();if(i.length>0){var o=i[i.length-1];if(o.outputs)t=o;else if(i.length>1){var r=i[i.length-2];r.outputs&&(t=r)}}}return t}},{key:"isViableAutoSourceNode",value:function(e){return e.outputs&&e.outputs.length>0&&!h.isSrcCardinalityAtMax(e.outputs[0].id,e,this.getLinks())}},{key:"createAutoNode",value:function(e,t){var n=this.objectModel.getCanvasLayout().autoLayoutInitialMarginX,i=this.objectModel.getCanvasLayout().autoLayoutInitialMarginY,o=this.objectModel.getCanvasLayout().autoLayoutHorizontalSpacing,r=this.objectModel.getCanvasLayout().autoLayoutVerticalSpacing,a=0,s=0;null===t?(a=n,s=i):(a=t.x_pos+t.width+o,s=t.y_pos),e.offsetX=a,e.offsetY=s;var d=this.createNode(e);this.getNodes().length>0&&this.isEntryBindingNode(d)&&(d.x_pos=n,d.y_pos+=d.height+r);for(var c=!0;c;)(c=this.isNodeOverlappingOthers(d))&&(d.y_pos+=d.height+r);return d}},{key:"createNodesForPalette",value:function(e){var t=this,n=[];return e.forEach((function(e){var r=t.getNode(e);if(r){if((r=o.cloneDeep_1(r)).id=t.objectModel.getUUID(),r.x_pos=0,r.y_pos=0,(r=nt.createSchemaNode(r,[])).type===o.SUPER_NODE){var a=t.objectModel.getSchemaPipelinesForSupernode(r);i.set_1(r,"app_data.ui_data.sub_pipelines",a)}n.push(r)}})),n}},{key:"replaceNodes",value:function(e){this.store.dispatch({type:"REPLACE_NODES",data:e,pipelineId:this.pipelineId})}},{key:"isLinkNeededWithAutoNode",value:function(e,t){var n=!1;return e&&t&&e.inputs&&t.outputs&&1===e.inputs.length&&1===t.outputs.length&&!h.isCardinalityAtMax(t.outputs[0].id,e.inputs[0].id,t,e,this.getLinks())&&(n=!0),n}},{key:"isEntryBindingNode",value:function(e){return!(e.type!==o.BINDING||e.inputs&&0!==e.inputs.length)}},{key:"isExitBindingNode",value:function(e){return!!(e.type===o.BINDING&&e.inputs&&e.inputs.length>0)}},{key:"isNodeOverlappingOthers",value:function(e){var t=this;return-1!==this.getNodes().findIndex((function(n){return t.isSourceOverlappingTarget(n,e)}))}},{key:"isSourceOverlappingTarget",value:function(e,t){var n=e.layout.nodeHighlightGap,i=t.layout.nodeHighlightGap;return e.x_pos+e.width+n>=t.x_pos-i&&t.x_pos+t.width+i>=e.x_pos-n&&e.y_pos+e.height+n>=t.y_pos-i&&t.y_pos+t.height+i>=e.y_pos-n}},{key:"addNode",value:function(e){e&&(e.type===o.SUPER_NODE?this.addSupernode(e,t.get_1(e,"sub_pipelines")):this.store.dispatch({type:"ADD_NODE",data:{newNode:e},pipelineId:this.pipelineId}))}},{key:"addSupernodes",value:function(e,t,n){this.store.dispatch({type:"ADD_SUPERNODES",data:{supernodesToAdd:e,pipelinesToAdd:t,extPipelineFlowsToAdd:n,pipelineId:this.pipelineId}})}},{key:"addSupernode",value:function(e,t){var n=this,o=this.objectModel.getCanvasInfo(),r=this.objectModel.getCanvasInfo().pipelines.concat(t||[]);r=r.map((function(t){if(t.id===n.pipelineId){var o=[].concat(i._toConsumableArray(t.nodes),[n.cloneSupernodeRemovePipelineData(e)]);return Object.assign({},t,{nodes:o})}return t}));var a=Object.assign({},o,{pipelines:r});this.objectModel.setCanvasInfo(a)}},{key:"cloneSupernodeRemovePipelineData",value:function(e){var t=Object.assign({},e);return t.app_data&&(t.app_data=Object.assign({},t.app_data),t.app_data.ui_data&&delete t.app_data.ui_data.sub_pipelines),t}},{key:"deleteNode",value:function(e){var t=this.getNode(e);t&&this.deleteNodes([t])}},{key:"deleteNodes",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&e.length>0&&this.objectModel.executeWithSelectionChange((function(e){t.deleteNodesInternal(e.nodes,e.removePipelines)}),{nodes:e,removePipelines:n})}},{key:"deleteNodesInternal",value:function(e,t){var n=this;e.filter((function(e){return e.type!==o.SUPER_NODE})).forEach((function(e){n.store.dispatch({type:"DELETE_OBJECT",data:{id:e.id},pipelineId:n.pipelineId})}));var i=e.filter((function(e){return e.type===o.SUPER_NODE}));t?this.deleteSupernodesAndDescPipelines(i):this.deleteSupernodes(i,[],[])}},{key:"deleteSupernodesAndDescPipelines",value:function(e){var t=this.objectModel.getDescPipelinesToDelete(e,this.pipelineId),n=this.objectModel.getExternalPipelineFlowsForPipelines(t);this.deleteSupernodes(e,t,n)}},{key:"deleteSupernodes",value:function(e,t,n){this.store.dispatch({type:"DELETE_SUPERNODES",data:{supernodesToDelete:e,pipelinesToDelete:t,extPipelineFlowsToDelete:n,pipelineId:this.pipelineId}})}},{key:"deconstructSupernode",value:function(e){this.store.dispatch({type:"DECONSTRUCT_SUPERNODE",data:e})}},{key:"reconstructSupernode",value:function(e){this.store.dispatch({type:"RECONSTRUCT_SUPERNODE",data:e})}},{key:"getNodes",value:function(){return this.store.getNodes(this.pipelineId)}},{key:"getNodeIds",value:function(){return this.getNodes().map((function(e){return e.id}))}},{key:"getNode",value:function(e){return this.store.getNode(e,this.pipelineId)}},{key:"getSupernodes",value:function(){return h.filterSupernodes(this.getNodes())}},{key:"isDataNode",value:function(e){return this.getNode(e)}},{key:"sizeAndPositionObjects",value:function(e,t){this.store.dispatch({type:"SIZE_AND_POSITION_OBJECTS",data:{objectsInfo:e,linksInfo:t},pipelineId:this.pipelineId})}},{key:"filterDataNodes",value:function(e){var t=this;return e.filter((function(e){return t.isDataNode(e)}))}},{key:"expandSuperNodeInPlace",value:function(e,t,n){var i=Object.assign({},this.getNode(e),{is_expanded:!0});i=this.objectModel.setNodeAttributes(i),this.store.dispatch({type:"SET_SUPERNODE_EXPAND_STATE",data:{node:i,objectPositions:t,linkPositions:n},pipelineId:this.pipelineId})}},{key:"collapseSuperNodeInPlace",value:function(e,t,n){var i=Object.assign({},this.getNode(e),{is_expanded:!1});i=this.objectModel.setNodeAttributes(i),this.store.dispatch({type:"SET_SUPERNODE_EXPAND_STATE",data:{node:i,objectPositions:t,linkPositions:n},pipelineId:this.pipelineId})}},{key:"isSuperNodeExpandedInPlace",value:function(e){return!0===this.getNode(e).is_expanded}},{key:"isSupernode",value:function(e){return this.getNode(e).type===o.SUPER_NODE}},{key:"getNodeParameters",value:function(e){var t=this.getNode(e);return t?t.parameters:null}},{key:"getNodeUiParameters",value:function(e){var t=this.getNode(e);return t?t.ui_parameters:null}},{key:"setNodeLabel",value:function(e,t){this.store.dispatch({type:"SET_NODE_LABEL",data:{nodeId:e,label:t},pipelineId:this.pipelineId})}},{key:"setNodeDecorations",value:function(e,t){this.store.dispatch({type:"SET_NODE_DECORATIONS",data:{nodeId:e,decorations:this.ensureDecorationsHaveIds(t)},pipelineId:this.pipelineId})}},{key:"setInputPortLabel",value:function(e,t,n){this.store.dispatch({type:"SET_INPUT_PORT_LABEL",data:{nodeId:e,portId:t,label:n},pipelineId:this.pipelineId})}},{key:"setOutputPortLabel",value:function(e,t,n){this.store.dispatch({type:"SET_OUTPUT_PORT_LABEL",data:{nodeId:e,portId:t,label:n},pipelineId:this.pipelineId})}},{key:"setInputPortSubflowNodeRef",value:function(e,t,n){this.store.dispatch({type:"SET_INPUT_PORT_SUBFLOW_NODE_REF",data:{nodeId:e,portId:t,subflowNodeRef:n},pipelineId:this.pipelineId})}},{key:"setOutputPortSubflowNodeRef",value:function(e,t,n){this.store.dispatch({type:"SET_OUTPUT_PORT_SUBFLOW_NODE_REF",data:{nodeId:e,portId:t,subflowNodeRef:n},pipelineId:this.pipelineId})}},{key:"setNodeProperties",value:function(e,t){var n=o.cloneDeep_1(this.getNode(e));n=Object.assign(n,t),n=this.objectModel.setNodeAttributes(n),this.store.dispatch({type:"REPLACE_NODE",data:{node:n},pipelineId:this.pipelineId})}},{key:"setNodeMessage",value:function(e,t){this.store.dispatch({type:"SET_NODE_MESSAGE",data:{nodeId:e,message:t},pipelineId:this.pipelineId})}},{key:"setNodeMessages",value:function(e,t){this.store.dispatch({type:"SET_NODE_MESSAGES",data:{nodeId:e,messages:t},pipelineId:this.pipelineId})}},{key:"setNodeUiParameters",value:function(e,t){this.store.dispatch({type:"SET_NODE_UI_PARAMETERS",data:{nodeId:e,ui_parameters:t},pipelineId:this.pipelineId})}},{key:"setNodeParameters",value:function(e,t){this.store.dispatch({type:"SET_NODE_PARAMETERS",data:{nodeId:e,parameters:t},pipelineId:this.pipelineId})}},{key:"setNodeInputPorts",value:function(e,t){this.setNodeProperties(e,{inputs:t})}},{key:"setNodeOutputPorts",value:function(e,t){this.setNodeProperties(e,{outputs:t})}},{key:"addCustomAttrToNodes",value:function(e,t,n){this.store.dispatch({type:"ADD_NODE_ATTR",data:{objIds:e,attrName:t,attrValue:n},pipelineId:this.pipelineId})}},{key:"removeCustomAttrFromNodes",value:function(e,t,n){this.store.dispatch({type:"REMOVE_NODE_ATTR",data:{objIds:e,attrName:t},pipelineId:this.pipelineId})}},{key:"getNodeDecorations",value:function(e){var t=this.getNode(e);return t?t.decorations:null}},{key:"getNodeMessages",value:function(e){var t=this.getNode(e);return t?t.messages:null}},{key:"getNodeMessage",value:function(e,t){var n=this.getNodeMessages(e);if(n){var i,o=at(n);try{for(o.s();!(i=o.n()).done;){var r=i.value;if(r.id_ref===t)return r}}catch(e){o.e(e)}finally{o.f()}}return null}},{key:"getNodeInputPorts",value:function(e){var t=this.getNode(e);return t?t.inputs:null}},{key:"getNodeOutputPorts",value:function(e){var t=this.getNode(e);return t?t.outputs:null}},{key:"getNodeClassName",value:function(e){var t=this.getNode(e);return t?t.class_name:null}},{key:"getNodeStyle",value:function(e,t){var n=this.getNode(e);return t?n?n.style_temp:null:n?n.style:null}},{key:"hasErrorMessage",value:function(e){var t=this.getNode(e);return this.objectModel.hasErrorMessage(t)}},{key:"hasWarningMessage",value:function(e){var t=this.getNode(e);return this.objectModel.hasWarningMessage(t)}},{key:"isFlowValid",value:function(e){var t,n=!0,i=at(this.getNodes());try{for(i.s();!(t=i.n()).done;){var o=t.value;n&&(n=this.isNodeValid(o,e))}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"isNodeValid",value:function(e,t){var n=!0;if(t&&Array.isArray(t)&&t.length>0){var i,o=at(e.messages);try{for(o.s();!(i=o.n()).done;){var r=i.value;-1!==t.indexOf(r.type)&&(n=!1)}}catch(e){o.e(e)}finally{o.f()}}else e.messages&&e.messages.length>0&&(n=!1);return n}},{key:"getFlowMessages",value:function(){var e=this.getNodes(),t={};return e.forEach((function(e){e.messages&&e.messages.length>0&&(t[e.id]=e.messages)})),t}},{key:"autoLayout",value:function(e){var t=this.objectModel.getCanvasInfoPipeline(this.pipelineId),n={};n=e===o.VERTICAL?this.dagreAutolayout(o.DAGRE_VERTICAL,t):this.dagreAutolayout(o.DAGRE_HORIZONTAL,t),this.sizeAndPositionObjects(n)}},{key:"dagreAutolayout",value:function(e,t){var n=this,i=this.objectModel.getCanvasLayout(),r=t.links.filter((function(e){return e.type===o.NODE_LINK||e.type===o.ASSOCIATION_LINK})).map((function(e){return{v:e.srcNodeId,w:e.trgNodeId,value:{points:[]}}})),a=t.nodes.map((function(r){var a=r.width;return e===o.DAGRE_HORIZONTAL&&(a=r.width+Math.max(n.getPaddingForNode(r,i,t),i.autoLayoutHorizontalSpacing)),{v:r.id,value:{width:a,height:r.height}}})),s={};["TB","BT","LR","RL"].indexOf(e)>=0&&(s={rankDir:e});var d={nodes:a,edges:r,value:s},c=i.autoLayoutInitialMarginX,l=i.autoLayoutInitialMarginY,u=i.autoLayoutVerticalSpacing,p=i.autoLayoutHorizontalSpacing;e===o.DAGRE_HORIZONTAL&&(p=0);var f=rt.graphlib.json.read(d);f.graph().marginx=c,f.graph().marginy=l,"TB"===e?(f.graph().nodesep=p,f.graph().ranksep=u):(f.graph().nodesep=u,f.graph().ranksep=p),rt.layout(f);var h=rt.graphlib.json.write(f);return this.convertGraphToMovedNodes(h,t.nodes)}},{key:"convertGraphToMovedNodes",value:function(e,t){for(var n=[],i={},o=0,r=e.nodes.length;o<r;o++)i[e.nodes[o].v]=e.nodes[o];return t.forEach((function(e){n[e.id]={id:e.id,x_pos:i[e.id].value.x-i[e.id].value.width/2,y_pos:i[e.id].value.y-i[e.id].value.height/2,width:e.width,height:e.height}})),n}},{key:"getPaddingForNode",value:function(e,t,n){return h.getNodePaddingToTargetNodes(e,n.nodes,n.links,t.linkType)}},{key:"getBoundingRectForNodes",value:function(e){var t=e[0].x_pos,n=e[0].y_pos,i=e[0].width+t,o=e[0].height+n;return e.forEach((function(e){t=Math.min(t,e.x_pos),n=Math.min(n,e.y_pos),i=Math.max(i,e.x_pos+e.width),o=Math.max(o,e.y_pos+e.height)})),{x:t,y:n,width:i-t,height:o-n}}},{key:"ensureDecorationsHaveIds",value:function(e){var t=this;return e?e.map((function(e){return Object.assign({},e,{id:e.id||t.objectModel.getUUID()})})):e}},{key:"createComment",value:function(e){var t=this,n={id:this.objectModel.getUniqueId(o.CREATE_COMMENT),content:"",height:42,width:175,x_pos:e.mousePos.x,y_pos:e.mousePos.y,linkIds:[],selectedObjectIds:[]};return n=this.objectModel.setCommentAttributes(n),e.selectedObjectIds.forEach((function(e){t.isDataNode(e)&&(n.selectedObjectIds.push(e),n.linkIds.push(t.objectModel.getUniqueId(o.CREATE_COMMENT_LINK,{comment:n,targetNode:t.getNode(e)})))})),n}},{key:"addComment",value:function(e){this.store.dispatch({type:"ADD_COMMENT",data:e,pipelineId:this.pipelineId}),this.store.dispatch({type:"SHOW_COMMENTS"})}},{key:"getAdjustedCommentPosition",value:function(e){for(var t=this.objectModel.getCanvasConfig().enableSnapToGridType,n={x_pos:e.x,y_pos:e.y};this.exactlyOverlaps(null,[n],null);)t===o.SNAP_TO_GRID_DURING||t===o.SNAP_TO_GRID_AFTER?(n.x_pos+=this.objectModel.getCanvasLayout().snapToGridXPx,n.y_pos+=this.objectModel.getCanvasLayout().snapToGridYPx):(n.x_pos+=10,n.y_pos+=10);return n}},{key:"deleteComment",value:function(e){var t=this.getComment(e);t&&this.deleteComments([t])}},{key:"deleteComments",value:function(e){var t=this;e&&e.length>0&&this.objectModel.executeWithSelectionChange((function(e){t.deleteCommentsInternal(e)}),e)}},{key:"deleteCommentsInternal",value:function(e){var t=this;e.forEach((function(e){t.store.dispatch({type:"DELETE_OBJECT",data:{id:e.id},pipelineId:t.pipelineId})}))}},{key:"getComments",value:function(){return this.store.getComments(this.pipelineId)}},{key:"getComment",value:function(e){return this.store.getComment(e,this.pipelineId)}},{key:"editComment",value:function(e){this.store.dispatch({type:"EDIT_COMMENT",data:e,pipelineId:this.pipelineId})}},{key:"addCustomAttrToComments",value:function(e,t,n){this.store.dispatch({type:"ADD_COMMENT_ATTR",data:{objIds:e,attrName:t,attrValue:n},pipelineId:this.pipelineId})}},{key:"removeCustomAttrFromComments",value:function(e,t){this.store.dispatch({type:"REMOVE_COMMENT_ATTR",data:{objIds:e,attrName:t},pipelineId:this.pipelineId})}},{key:"getCommentClassName",value:function(e){var t=this.getComment(e);return t?t.class_name:null}},{key:"getCommentStyle",value:function(e,t){var n=this.getComment(e);return t?n?n.style_temp:null:n?n.style:null}},{key:"createLink",value:function(e,t){var n={id:this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNode:t,targetNode:e}),srcNodeId:t.id,trgNodeId:e.id,type:o.NODE_LINK};return t.outputs&&t.outputs.length>0&&(n=Object.assign(n,{srcNodePortId:t.outputs[0].id})),e.inputs&&e.inputs.length>0&&(n=Object.assign(n,{trgNodePortId:e.inputs[0].id})),n}},{key:"createLinkFromInfo",value:function(e){var t=this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNodeId:e.srcNodeId,targetNodeId:e.trgNodeId});return Object.assign({id:t,type:o.NODE_LINK},e)}},{key:"deleteLink",value:function(e){this.store.dispatch({type:"DELETE_LINK",data:e,pipelineId:this.pipelineId})}},{key:"deleteLinks",value:function(e){this.store.dispatch({type:"DELETE_LINKS",data:{linksToDelete:e},pipelineId:this.pipelineId})}},{key:"updateLinks",value:function(e){this.store.dispatch({type:"UPDATE_LINKS",data:{linksToUpdate:e},pipelineId:this.pipelineId})}},{key:"updateLink",value:function(e){this.updateLinks([e])}},{key:"createNodeLinks",value:function(e){var t=this,n=[];return e.nodes.forEach((function(i){e.targetNodes.forEach((function(o){var r=t.createNodeLink(i,o,e);r&&n.push(r)}))})),n}},{key:"createNodeLink",value:function(e,t,n){var i=this.getNode(e.id),r=this.getNode(t.id),a=this.getLinks();if(e.srcPos&&t.trgPos||e.srcPos&&h.isTrgConnectionAllowedWithDetachedLinks(t.portId,r,a)||t.trgPos&&h.isSrcConnectionAllowedWithDetachedLinks(e.portId,i,a)||h.isConnectionAllowed(e.portId,t.portId,i,r,a,n.type)){var s={};return s.id=n.id?n.id:this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNode:i,targetNode:r}),s.type=n.type,e.srcPos?s.srcPos=e.srcPos:(s.srcNodeId=e.id,s.srcNodePortId=e.portId),t.trgPos?s.trgPos=t.trgPos:(s.trgNodeId=t.id,s.trgNodePortId=t.portId),n.class_name&&(s.class_name=n.class_name),n.linkName&&(s.linkName=n.linkName),s}return null}},{key:"createNodeLinkDetached",value:function(e){var t={};return t.id=e.id?e.id:this.objectModel.getUniqueId(o.CREATE_NODE_LINK,{sourceNode:this.getNode(e.srcNodeId)}),t.type=e.type,t.srcNodeId=e.srcNodeId,t.srcNodePortId=e.srcNodePortId,t.trgPos={x_pos:e.trgPos.x,y_pos:e.trgPos.y},e.class_name&&(t.class_name=e.class_name),e.linkName&&(t.linkName=e.linkName),e.typeAttr&&(t.typeAttr=e.typeAttr),e.description&&(t.description=e.description),t}},{key:"createCommentLinks",value:function(e){var t=this,n=[];return e.nodes.forEach((function(i){e.targetNodes.forEach((function(r){if(h.isCommentLinkConnectionAllowed(i,r,t.getLinks())){var a={};a.id=t.objectModel.getUniqueId(o.CREATE_COMMENT_LINK,{comment:t.getComment(i),targetNode:t.getNode(r)}),a.type=e.type,a.srcNodeId=i,a.trgNodeId=r,n.push(a)}}))})),n}},{key:"addLinks",value:function(e){var t=this;e.forEach((function(e){t.addLink(e)}))}},{key:"addLink",value:function(e){this.store.dispatch({type:"ADD_LINK",data:e,pipelineId:this.pipelineId})}},{key:"setLinks",value:function(e){this.store.dispatch({type:"SET_LINKS",data:e,pipelineId:this.pipelineId})}},{key:"getLinks",value:function(){return this.store.getLinks(this.pipelineId)}},{key:"getLinkIds",value:function(){return this.getLinks().map((function(e){return e.id}))}},{key:"getLinksBetween",value:function(e,t){var n=this;return this.getLinks().filter((function(i){return!(!n.isObjectIdInObjects(i.trgNodeId,e)||!n.isObjectIdInObjects(i.srcNodeId,e)&&!n.isObjectIdInObjects(i.srcNodeId,t))}))}},{key:"getLinksContainingId",value:function(e){return this.getLinks().filter((function(t){return t.srcNodeId===e||t.trgNodeId===e})).map((function(e){return Object.assign({},e)}))}},{key:"getLinksContainingIds",value:function(e){var t=this,n=[];return e.forEach((function(e){var i=t.getLinksContainingId(e);i.length>0&&(n=h.concatUniqueBasedOnId(i,n))})),n}},{key:"getNodeDataLinksContainingIds",value:function(e){return this.getLinksContainingIds(e).filter((function(e){return e.type===o.NODE_LINK}))}},{key:"getLinksContainingSourceId",value:function(e){return this.getLinks().filter((function(t){return t.srcNodeId===e}))}},{key:"getLinksContainingTargetId",value:function(e){return this.getLinks().filter((function(t){return t.trgNodeId===e}))}},{key:"getAttachedLinksContainingSourceId",value:function(e){return this.getLinks().filter((function(t){return t.srcNodeId===e&&t.trgNodeId}))}},{key:"getAttachedLinksContainingTargetId",value:function(e){return this.getLinks().filter((function(t){return t.trgNodeId===e&&t.srcNodeId}))}},{key:"getNodeLinks",value:function(e){var t=this,n=[];return e.forEach((function(e){t.getLinksContainingId(e.id).forEach((function(e){e.type!==o.NODE_LINK&&e.type!==o.ASSOCIATION_LINK||n.push(e)}))})),n}},{key:"getNodeDataLinks",value:function(){return this.getLinks().filter((function(e){return e.type===o.NODE_LINK}))}},{key:"getNodeDataLinkFromInfo",value:function(e,t,n,i){var r=this,a=this.getDefaultSrcPortId(e,t),s=this.getDefaultTrgPortId(n,i);return a&&s?this.getLinks().find((function(t){if(t.type===o.NODE_LINK){var i=r.getDefaultSrcPortId(t.srcNodeId,t.srcNodePortId),d=r.getDefaultTrgPortId(t.trgNodeId,t.trgNodePortId);return t.srcNodeId===e&&i===a&&t.trgNodeId===n&&d===s}return!1})):null}},{key:"getCommentLinkFromInfo",value:function(e,t){return this.getLinks().find((function(n){return n.type===o.COMMENT_LINK&&(n.srcNodeId===e&&n.trgNodeId===t||n.srcNodeId===t&&n.trgNodeId===e)}))}},{key:"setCommentProperties",value:function(e,t){this.store.dispatch({type:"SET_COMMENT_PROPERTIES",data:{commentId:e,commentProperties:t},pipelineId:this.pipelineId})}},{key:"getNodeAssocLinkFromInfo",value:function(e,t){return this.getLinks().find((function(n){return n.type===o.ASSOCIATION_LINK&&(n.srcNodeId===e&&n.trgNodeId===t||n.srcNodeId===t&&n.trgNodeId===e)}))}},{key:"getDefaultSrcPortId",value:function(e,t){if(!t){var n=this.getNode(e);if(n&&n.outputs&&n.outputs.length>0)return n.outputs[0].id}return t}},{key:"getDefaultTrgPortId",value:function(e,t){if(!t){var n=this.getNode(e);if(n&&n.inputs&&n.inputs.length>0)return n.inputs[0].id}return t}},{key:"getLink",value:function(e){return this.store.getLink(e,this.pipelineId)}},{key:"setLinkProperties",value:function(e,t){this.store.dispatch({type:"SET_LINK_PROPERTIES",data:{linkId:e,linkProperties:t},pipelineId:this.pipelineId})}},{key:"setNodeDataLinkSrcInfo",value:function(e,t,n){this.store.dispatch({type:"SET_LINK_SRC_INFO",data:{linkId:e,srcNodeId:t,srcNodePortId:n},pipelineId:this.pipelineId})}},{key:"setNodeDataLinkTrgInfo",value:function(e,t,n){this.store.dispatch({type:"SET_LINK_TRG_INFO",data:{linkId:e,trgNodeId:t,trgNodePortId:n},pipelineId:this.pipelineId})}},{key:"getLinkClassName",value:function(e){var t=this.getLink(e);return t&&t.class_name?t.class_name:null}},{key:"getLinkStyle",value:function(e,t){var n=this.getLink(e);return t?n&&n.style_temp?n.style_temp:null:n&&n.style?n.style:null}},{key:"setLinksClassName",value:function(e,t){this.store.dispatch({type:"SET_LINKS_CLASS_NAME",data:{linkIds:e,newClassName:t},pipelineId:this.pipelineId})}},{key:"setLinkDecorations",value:function(e,t){this.store.dispatch({type:"SET_LINK_DECORATIONS",data:{linkId:e,decorations:this.ensureDecorationsHaveIds(t)},pipelineId:this.pipelineId})}},{key:"getLinkDecorations",value:function(e){var t=this.getLink(e);return t?t.decorations:null}},{key:"isCommentLinkedToNonSelectedNodes",value:function(e){var t,n=this.getLinksContainingId(e),i=this.objectModel.getSelectedObjectIds(),o=!1,r=at(n);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(o=!i.includes(a.trgNodeId))return o}}catch(e){r.e(e)}finally{r.f()}return o}},{key:"pushUniqueLinks",value:function(e,t){return-1===t.findIndex((function(t){return t.id===e.id}))&&t.push(e),t}}]),n}(),ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_TOOLTIP_DEF"===t.type&&t.data.tooltipDef?t.data.tooltipDef:e},lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NODE_TYPES_TO_PALETTE":return t.data.nodeTypes?[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.nodeTypes)):e;case"REMOVE_NODE_TYPES_FROM_PALETTE":return e.filter((function(e){return-1===t.data.selObjectIds.findIndex((function(t){return t===e.id}))}));default:return e}},ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NODE_TYPES_TO_PALETTE":var n=e.find((function(e){return e.id===t.data.categoryId}));return n?e.map((function(e){return t.data.categoryId===e.id?Object.assign({},e,{node_types:lt(e.node_types,t)}):e})):(n={id:t.data.categoryId,label:t.data.categoryLabel?t.data.categoryLabel:t.data.categoryId},t.data.categoryDescription&&(n.description=t.data.categoryDescription),t.data.categoryImage&&(n.image=t.data.categoryImage),n.node_types=[],[].concat(i._toConsumableArray(e),[Object.assign({},n,{node_types:lt(n.node_types,t)})]));case"REMOVE_NODE_TYPES_FROM_PALETTE":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{node_types:lt(e.node_types,t)}):e}));case"SET_CATEGORY_LOADING_TEXT":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{loading_text:t.data.loadingText}):e}));case"SET_CATEGORY_EMPTY_TEXT":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{empty_text:t.data.emptyText}):e}));case"SET_IS_OPEN_CATEGORY":return e.map((function(e){return e.id===t.data.categoryId?Object.assign({},e,{is_open:t.data.isOpen}):e}));case"SET_IS_OPEN_ALL_CATEGORIES":return e.map((function(e){return Object.assign({},e,{is_open:t.data.isOpen})}));default:return e}},pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_PALETTE_DATA":return{content:{}};case"SET_PALETTE_DATA":var n=Object.assign({},t.data.content);return Object.assign({},e,{content:n});case"ADD_NODE_TYPES_TO_PALETTE":case"REMOVE_NODE_TYPES_FROM_PALETTE":case"SET_IS_OPEN_CATEGORY":case"SET_IS_OPEN_ALL_CATEGORIES":case"SET_CATEGORY_LOADING_TEXT":case"SET_CATEGORY_EMPTY_TEXT":var i=Object.assign({},e.content,{categories:ut(e.content.categories,t)});return Object.assign({},e,{content:i,version:"3.0"});case"SET_PALETTE_OPEN_STATE":return Object.assign({},e,{isOpen:t.data.isOpen});default:return e}},ft=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_INPUT_PORT_LABEL":case"SET_OUTPUT_PORT_LABEL":return e.map((function(e,n){if(t.data.portId===e.id){var i=Object.assign({},e);return i.label=t.data.label,i}return e}));case"SET_INPUT_PORT_SUBFLOW_NODE_REF":case"SET_OUTPUT_PORT_SUBFLOW_NODE_REF":return e.map((function(e,n){if(t.data.portId===e.id){var i=Object.assign({},e);return i.subflow_node_ref=t.data.subflowNodeRef,i}return e}));default:return e}},ht=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NODE":return[].concat(i._toConsumableArray(e),[Object.assign({},t.data.newNode)]);case"ADD_NODES":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.nodesToAdd));case"REPLACE_NODES":return t.data;case"REPLACE_NODE":return e.map((function(e,n){return t.data.node.id===e.id?t.data.node:e}));case"MOVE_OBJECTS":return t.data.nodes?e.map((function(e,n){if(t.data.nodes.indexOf(e.id)>-1){var i=e.x_pos+t.data.offsetX,o=e.y_pos+t.data.offsetY;return Object.assign({},e,{x_pos:i,y_pos:o})}return e})):e;case"SIZE_AND_POSITION_OBJECTS":return e.map((function(e,n){var i=t.data.objectsInfo[e.id];if(void 0!==i){var r=Object.assign({},e,{height:i.height,width:i.width,x_pos:i.x_pos,y_pos:i.y_pos});return r.type===o.SUPER_NODE&&r.is_expanded?(r.expanded_width=i.width,r.expanded_height=i.height):i.isResized?(r.isResized=i.isResized,r.resizeWidth=i.resizeWidth,r.resizeHeight=i.resizeHeight):(delete r.isResized,delete r.resizeWidth,delete r.resizeHeight),r}return e}));case"SET_NODE_POSITIONS":return e.map((function(e,n){if(t.data.nodePositions&&void 0!==t.data.nodePositions[e.id]){var i=t.data.nodePositions[e.id];return Object.assign({},e,{x_pos:i.x_pos,y_pos:i.y_pos})}return e}));case"ADD_SUPERNODES":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.supernodesToAdd));case"DELETE_SUPERNODES":return e.filter((function(e){return!t.data.supernodesToDelete.some((function(t){return t.id===e.id}))}));case"DELETE_OBJECT":return e.filter((function(e){return e.id!==t.data.id}));case"DELETE_NODES":return e.filter((function(e){return!t.data.nodesToDelete.some((function(t){return t.id===e.id}))}));case"SET_NODE_PARAMETERS":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.parameters=t.data.parameters,i}return e}));case"SET_NODE_UI_PARAMETERS":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.ui_parameters=t.data.ui_parameters,i}return e}));case"SET_NODE_MESSAGE":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);if(i.messages){var o=i.messages.findIndex((function(e){return e.id_ref===t.data.message.id_ref}));o>-1?i.messages[o]=t.data.message:i.messages.push(t.data.message)}else i.messages=[t.data.message];return i}return e}));case"SET_NODE_MESSAGES":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.messages=t.data.messages,i}return e}));case"ADD_NODE_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs=i.customAttrs||[],i.customAttrs.push(t.data.attrName),i}return e}));case"REMOVE_NODE_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs&&(i.customAttrs=i.customAttrs.filter((function(e){return e!==t.data.attrName}))),i}return e}));case"SET_NODE_LABEL":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.label=t.data.label,i}return e}));case"SET_NODE_DECORATIONS":return e.map((function(e,n){if(t.data.nodeId===e.id){var i=Object.assign({},e);return i.decorations=t.data.decorations,i}return e}));case"SET_NODES_MULTI_DECORATIONS":return e.map((function(e){var n=t.data.pipelineNodeDecorations.find((function(n){return n.pipelineId===t.data.pipelineId&&n.nodeId===e.id}));return n?Object.assign({},e,{decorations:n.decorations}):e}));case"SET_OBJECTS_CLASS_NAME":return e.map((function(e){var n=t.data.objIds.indexOf(e.id);if(n>-1){var i=Object.assign({},e);return i.class_name=Array.isArray(t.data.newClassName)?t.data.newClassName[n]||null:t.data.newClassName,i}return e}));case"SET_OBJECTS_STYLE":return e.map((function(e){if(t.data.objIds.indexOf(e.id)>-1){var n=Object.assign({},e);return t.data.temporary?n.style_temp=t.data.newStyle:n.style=t.data.newStyle,n}return e}));case"SET_OBJECTS_MULTI_STYLE":return e.map((function(e){var n=t.data.pipelineObjStyles.find((function(n){return n.pipelineId===t.data.pipelineId&&n.objId===e.id}));if(n){var i=Object.assign({},e),o=n&&n.style?n.style:null;return t.data.temporary?i.style_temp=o:i.style=o,i}return e}));case"REMOVE_ALL_STYLES":return e.map((function(e){if(t.data.temporary&&e.style_temp){var n=Object.assign({},e);return delete n.style_temp,n}if(!t.data.temporary&&e.style){var i=Object.assign({},e);return delete i.style,i}return e}));case"SET_INPUT_PORT_LABEL":case"SET_INPUT_PORT_SUBFLOW_NODE_REF":return e.map((function(e,n){return t.data.nodeId===e.id?Object.assign({},e,{inputs:ft(e.inputs,t)}):e}));case"SET_OUTPUT_PORT_LABEL":case"SET_OUTPUT_PORT_SUBFLOW_NODE_REF":return e.map((function(e,n){return t.data.nodeId===e.id?Object.assign({},e,{outputs:ft(e.outputs,t)}):e}));case"SET_SUPERNODE_EXPAND_STATE":return e.map((function(e){return t.data.node.id===e.id?t.data.node:e}));case"REPLACE_SN_AND_PIPELINES":return e.map((function(e,n){return e.id===t.data.topSupernode.id?Object.assign({},t.data.topSupernode):e}));default:return e}},gt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"MOVE_OBJECTS":return t.data.nodes?e.map((function(e,n){if(t.data.nodes.indexOf(e.id)>-1){var i=e.x_pos+t.data.offsetX,o=e.y_pos+t.data.offsetY;return Object.assign({},e,{x_pos:i,y_pos:o})}return e})):e;case"SET_COMMENT_POSITIONS":return e.map((function(e,n){if(t.data.commentPositions&&void 0!==t.data.commentPositions[e.id]){var i=t.data.commentPositions[e.id];return Object.assign({},e,{x_pos:i.x_pos,y_pos:i.y_pos})}return e}));case"DELETE_OBJECT":return e.filter((function(e){return e.id!==t.data.id}));case"DELETE_COMMENTS":return e.filter((function(e){return!t.data.commentsToDelete.some((function(t){return t.id===e.id}))}));case"ADD_COMMENT":var n=yt(t.data);return[].concat(i._toConsumableArray(e),[n]);case"ADD_COMMENTS":var o=t.data.commentsToAdd.map((function(e){return yt(e)}));return[].concat(i._toConsumableArray(e),i._toConsumableArray(o));case"EDIT_COMMENT":return e.map((function(e,n){return t.data.id===e.id?Object.assign({},e,{content:t.data.content,height:t.data.height,width:t.data.width,x_pos:t.data.x_pos?t.data.x_pos:e.x_pos,y_pos:t.data.y_pos?t.data.y_pos:e.y_pos}):e}));case"SET_COMMENT_PROPERTIES":return e.map((function(e){return e.id===t.data.commentId?Object.assign({},e,t.data.commentProperties):e}));case"SIZE_AND_POSITION_OBJECTS":return e.map((function(e,n){var i=t.data.objectsInfo[e.id];return void 0!==i?Object.assign({},e,{height:i.height,width:i.width,x_pos:i.x_pos,y_pos:i.y_pos}):e}));case"ADD_COMMENT_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs=i.customAttrs||[],i.customAttrs.push(t.data.attrName),i}return e}));case"REMOVE_COMMENT_ATTR":return e.map((function(e,n){if(t.data.objIds.indexOf(e.id)>-1){var i=Object.assign({},e);return i.customAttrs&&(i.customAttrs=i.customAttrs.filter((function(e){return e!==t.data.attrName}))),i}return e}));case"SET_OBJECTS_COLOR_CLASS_NAME":return e.map((function(e){var n=t.data.objIds.indexOf(e.id);if(n>-1){var i=Array.isArray(t.data.newColorClass)?t.data.newColorClass[n]||null:t.data.newColorClass,o=function(e,t){var n="";e?(n=function(e){var t=e.split(" ").filter((function(e){return!h.getBkgColorClass(e)})).join(" ");return t}(e),n=function(e,t){return e?e+" "+t:t}(n,t)):n=t;return n}(e.class_name,i);return Object.assign({},e,{class_name:o})}return e}));case"SET_OBJECTS_CLASS_NAME":return e.map((function(e){var n=t.data.objIds.indexOf(e.id);if(n>-1){var i=Object.assign({},e);return i.class_name=Array.isArray(t.data.newClassName)?t.data.newClassName[n]||null:t.data.newClassName,i}return e}));case"SET_OBJECTS_STYLE":return e.map((function(e){if(t.data.objIds.indexOf(e.id)>-1){var n=Object.assign({},e);return t.data.temporary?n.style_temp=t.data.newStyle:n.style=t.data.newStyle,n}return e}));case"SET_OBJECTS_MULTI_STYLE":return e.map((function(e){var n=t.data.pipelineObjStyles.find((function(n){return n.pipelineId===t.data.pipelineId&&n.objId===e.id}));if(n){var i=Object.assign({},e),o=n&&n.style?n.style:null;return t.data.temporary?i.style_temp=o:i.style=o,i}return e}));case"REMOVE_ALL_STYLES":return e.map((function(e){if(t.data.temporary&&e.style_temp){var n=Object.assign({},e);return delete n.style_temp,n}if(!t.data.temporary&&e.style){var i=Object.assign({},e);return delete i.style,i}return e}));default:return e}};function yt(e){var t={id:e.id,content:e.content,height:e.height,width:e.width,x_pos:e.x_pos,y_pos:e.y_pos};return void 0!==e.class_name&&(t.class_name=e.class_name),t}var mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DELETE_SUPERNODES":return e.filter((function(e){return!t.data.supernodesToDelete.some((function(t){return e.srcNodeId===t.id||e.trgNodeId===t.id}))}));case"DELETE_OBJECT":return e.filter((function(e){return e.srcNodeId!==t.data.id&&e.trgNodeId!==t.data.id}));case"REMOVE_LINKS":return e.filter((function(e){return!t.data.linksToDelete.some((function(t){return t.id===e.id}))}));case"ADD_LINK":var n={id:t.data.id};return _t(n,"type",t.data.type),_t(n,"class_name",t.data.class_name),_t(n,"srcPos",t.data.srcPos),_t(n,"srcNodeId",t.data.srcNodeId),_t(n,"srcNodePortId",t.data.srcNodePortId),_t(n,"trgPos",t.data.trgPos),_t(n,"trgNodeId",t.data.trgNodeId),_t(n,"trgNodePortId",t.data.trgNodePortId),_t(n,"decorations",t.data.decorations),_t(n,"style",t.data.style),_t(n,"style_temp",t.data.style_temp),_t(n,"linkName",t.data.linkName),_t(n,"typeAttr",t.data.typeAttr),_t(n,"description",t.data.description),_t(n,"app_data",t.data.app_data),[].concat(i._toConsumableArray(e),[n]);case"ADD_LINKS":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.linksToAdd));case"SET_LINKS":return i._toConsumableArray(t.data);case"MOVE_OBJECTS":return e.map((function(e){if(t.data.links&&t.data.links.findIndex((function(t){return t.id===e.id}))>-1){var n=Object.assign({},e);n.srcPos&&(n.srcPos.x_pos+=t.data.offsetX,n.srcPos.y_pos+=t.data.offsetY),n.trgPos&&(n.trgPos.x_pos+=t.data.offsetX,n.trgPos.y_pos+=t.data.offsetY)}return e}));case"SET_LINK_POSITIONS":return e.map((function(e,n){if(t.data.linkPositions&&void 0!==t.data.linkPositions[e.id]){var i=Object.assign({},e);return t.data.linkPositions[e.id].srcPos&&(i=Object.assign(i,{srcPos:t.data.linkPositions[e.id].srcPos})),t.data.linkPositions[e.id].trgPos&&(i=Object.assign(i,{trgPos:t.data.linkPositions[e.id].trgPos})),i}return e}));case"SIZE_AND_POSITION_OBJECTS":return e.map((function(e,n){if(t.data.linksInfo&&void 0!==t.data.linksInfo[e.id]){var i=Object.assign({},e);return t.data.linksInfo[e.id].srcPos&&(i=Object.assign(i,{srcPos:t.data.linksInfo[e.id].srcPos})),t.data.linksInfo[e.id].trgPos&&(i=Object.assign(i,{trgPos:t.data.linksInfo[e.id].trgPos})),i}return e}));case"SET_LINK_PROPERTIES":return e.map((function(e){return e.id===t.data.linkId?Object.assign({},e,t.data.linkProperties):e}));case"SET_LINK_SRC_INFO":return e.map((function(e){if(e.id===t.data.linkId){var n=Object.assign({},e);return delete n.srcNodeId,delete n.srcNodePortId,delete n.srcPos,n.srcNodeId=t.data.srcNodeId,t.data.srcNodePortId&&(n.srcNodePortId=t.data.srcNodePortId),n}return e}));case"SET_LINK_TRG_INFO":return e.map((function(e){if(e.id===t.data.linkId){var n=Object.assign({},e);return delete n.trgNodeId,delete n.trgNodePortId,delete n.trgPos,n.trgNodeId=t.data.trgNodeId,t.data.trgNodePortId&&(n.trgNodePortId=t.data.trgNodePortId),n}return e}));case"DELETE_LINK":return e.filter((function(e){return e.id!==t.data.id}));case"DELETE_LINKS":return e.filter((function(e){return-1===t.data.linksToDelete.findIndex((function(t){return e.id===t.id}))}));case"UPDATE_LINKS":return t.data.linksToUpdate?e.map((function(e){var n=t.data.linksToUpdate.find((function(t){return t.id===e.id}));if(n){var i=Object.assign({},e,n);return n.srcPos?(delete i.srcNodeId,delete i.srcNodePortId):n.srcNodeId&&delete i.srcPos,n.trgPos?(delete i.trgNodeId,delete i.trgNodePortId):n.trgNodeId&&delete i.trgPos,i}return e})):e;case"SET_LINKS_CLASS_NAME":return e.map((function(e){var n=t.data.linkIds.indexOf(e.id);if(n>-1){var i=Object.assign({},e);return i.class_name=Array.isArray(t.data.newClassName)?t.data.newClassName[n]:t.data.newClassName,i}return e}));case"SET_LINKS_STYLE":return e.map((function(e){if(t.data.objIds.indexOf(e.id)>-1){var n=Object.assign({},e);return t.data.temporary?n.style_temp=t.data.newStyle:n.style=t.data.newStyle,n}return e}));case"SET_LINKS_MULTI_STYLE":return e.map((function(e){var n=t.data.pipelineObjStyles.find((function(n){return n.pipelineId===t.data.pipelineId&&n.objId===e.id}));if(n){var i=Object.assign({},e),o=n&&n.style?n.style:null;return t.data.temporary?i.style_temp=o:i.style=o,i}return e}));case"SET_LINK_DECORATIONS":return e.map((function(e,n){if(t.data.linkId===e.id){var i=Object.assign({},e);return i.decorations=t.data.decorations,i}return e}));case"SET_LINKS_MULTI_DECORATIONS":return e.map((function(e){var n=t.data.pipelineLinkDecorations.find((function(n){return n.pipelineId===t.data.pipelineId&&n.linkId===e.id}));return n?Object.assign({},e,{decorations:n.decorations}):e}));case"REMOVE_ALL_STYLES":return e.map((function(e){if(t.data.temporary&&e.style_temp){var n=Object.assign({},e);return delete n.style_temp,n}if(!t.data.temporary&&e.style){var i=Object.assign({},e);return delete i.style,i}return e}));case"ADD_COMMENT":var r=[];return t.data.selectedObjectIds&&t.data.selectedObjectIds.forEach((function(e,n){r.push({id:t.data.linkIds[n],srcNodeId:t.data.id,trgNodeId:t.data.selectedObjectIds[n],type:o.COMMENT_LINK})})),[].concat(i._toConsumableArray(e),r);default:return e}};function _t(e,t,n){void 0!==n&&(e[t]=n)}function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){o._defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Pt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CANVAS_INFO":return t.canvasInfo?Object.assign({},t.canvasInfo):e;case"SET_CANVAS_CONFIG_INFO":case"REPLACE_PIPELINES":return Object.assign({},e,{pipelines:t.data.pipelines});case"ADD_EXTERNAL_PIPELINE_FLOW":var n=t.newPipelines.map((function(e){return Object.assign({},e)})),r=e.pipelines.concat(n);return Object.assign({},e,{pipelines:r});case"REMOVE_EXTERNAL_PIPELINE_FLOW":var a=e.pipelines.filter((function(e){return!e.parentUrl||e.parentUrl!==t.externalUrl}));return Object.assign({},e,{pipelines:a});case"REPLACE_SN_AND_PIPELINES":var s=e.pipelines.filter((function(e){return!t.data.pipelinesToRemove.some((function(t){return t.id===e.id}))}));return s=(s=s.map((function(e){return e.id===t.data.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t)}):e}))).concat(t.data.pipelinesToAdd),Object.assign({},e,{pipelines:s});case"SET_PIPELINE_PARENT_URL":var d=e.pipelines.map((function(e){if(t.data.pipelines.some((function(t){return t.id===e.id}))){var n=Object.assign({},e);return t.data.url?n.parentUrl=t.data.url:delete n.parentUrl,n}return e}));return Object.assign({},e,{pipelines:d});case"DELETE_PIPELINE":var c=e.pipelines.filter((function(e){return e.id!==t.data.id}));return Object.assign({},e,{pipelines:c});case"SET_ZOOM":if(t.data.enableSaveZoom===o.SAVE_ZOOM_PIPELINE_FLOW){var l=e.pipelines.map((function(e){return e.id===t.pipelineId?Object.assign({},e,{zoom:{k:t.data.zoom.k,x:t.data.zoom.x,y:t.data.zoom.y}}):e}));return Object.assign({},e,{pipelines:l})}return e;case"ADD_SUPERNODES":var u=[].concat(i._toConsumableArray(e.pipelines),i._toConsumableArray(t.data.pipelinesToAdd));return u=u.map((function(e){return e.id===t.data.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t)}):e})),Object.assign({},e,{pipelines:u});case"DELETE_SUPERNODES":var p=e.pipelines.filter((function(e){return!t.data.pipelinesToDelete.some((function(t){return t.id===e.id}))}));return p=p.map((function(e){return e.id===t.data.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t),links:mt(e.links,t)}):e})),Object.assign({},e,{pipelines:p});case"SET_SUBDUE_STYLE":return Object.assign({},e,{subdueStyle:t.data.subdueStyle});case"HIDE_COMMENTS":return bt(bt({},e),{},{hideComments:!0});case"SHOW_COMMENTS":return bt(bt({},e),{},{hideComments:!1});case"ADD_NODE":case"REPLACE_NODES":case"REPLACE_NODE":case"SIZE_AND_POSITION_OBJECTS":case"SET_NODE_PARAMETERS":case"SET_NODE_UI_PARAMETERS":case"SET_NODE_MESSAGE":case"SET_NODE_MESSAGES":case"SET_NODE_DECORATIONS":case"SET_LINK_DECORATIONS":case"ADD_NODE_ATTR":case"REMOVE_NODE_ATTR":case"SET_NODE_LABEL":case"SET_OBJECTS_CLASS_NAME":case"SET_OBJECTS_COLOR_CLASS_NAME":case"SET_INPUT_PORT_LABEL":case"SET_OUTPUT_PORT_LABEL":case"SET_INPUT_PORT_SUBFLOW_NODE_REF":case"SET_OUTPUT_PORT_SUBFLOW_NODE_REF":case"MOVE_OBJECTS":case"DELETE_OBJECT":case"ADD_LINK":case"SET_LINKS":case"SET_LINK_PROPERTIES":case"SET_LINK_SRC_INFO":case"SET_LINK_TRG_INFO":case"SET_LINKS_CLASS_NAME":case"DELETE_LINK":case"DELETE_LINKS":case"UPDATE_LINKS":case"ADD_COMMENT":case"EDIT_COMMENT":case"SET_COMMENT_PROPERTIES":case"ADD_COMMENT_ATTR":case"REMOVE_COMMENT_ATTR":var f=e.pipelines.map((function(e){return e.id===t.pipelineId?Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)}):e}));return Object.assign({},e,{pipelines:f});case"DELETE_AND_UPDATE_OBJECTS":var h=e.pipelines.map((function(e){if(e.id===t.pipelineId){var n=mt(e.links,{type:"UPDATE_LINKS",data:{linksToUpdate:t.data.linksToUpdate||[]}});n=mt(n,{type:"DELETE_LINKS",data:{linksToDelete:t.data.linksToDelete||[]}});var i=ht(e.nodes,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:t.data.supernodesToDelete||[]}});n=mt(n,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:t.data.supernodesToDelete||[]}}),i=ht(i,{type:"DELETE_NODES",data:{nodesToDelete:t.data.nodesToDelete||[]}});var o=gt(e.comments,{type:"DELETE_COMMENTS",data:{commentsToDelete:t.data.commentsToDelete||[]}});return Object.assign({},e,{nodes:i,comments:o,links:n})}return e}));return h=h.filter((function(e){return!t.data.pipelinesToDelete.some((function(t){return t.id===e.id}))})),Object.assign({},e,{pipelines:h});case"ADD_PASTED_OBJECTS":case"ADD_AND_UPDATE_OBJECTS":var g=e.pipelines.map((function(e){if(e.id===t.pipelineId){var n=ht(e.nodes,{type:"ADD_SUPERNODES",data:{supernodesToAdd:t.data.supernodesToAdd||[]}});n=ht(n,{type:"ADD_NODES",data:{nodesToAdd:t.data.nodesToAdd||[]}});var i=gt(e.comments,{type:"ADD_COMMENTS",data:{commentsToAdd:t.data.commentsToAdd||[]}}),o=mt(e.links,{type:"ADD_LINKS",data:{linksToAdd:t.data.linksToAdd||[]}});return o=mt(o,{type:"UPDATE_LINKS",data:{linksToUpdate:t.data.linksToUpdate||[]}}),Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return g=[].concat(i._toConsumableArray(g),i._toConsumableArray(t.data.pipelinesToAdd)),Object.assign({},e,{pipelines:g});case"DELETE_PASTED_OBJECTS":var y=e.pipelines.filter((function(e){return!function(e,t){return t.some((function(t){return t.id===e.id}))}(e,t.data.pipelinesToDelete)})).map((function(e){if(e.id===t.pipelineId){var n=ht(e.nodes,{type:"DELETE_NODES",data:t.data}),i=gt(e.comments,{type:"DELETE_COMMENTS",data:t.data}),o=mt(e.links,{type:"REMOVE_LINKS",data:t.data});return Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return Object.assign({},e,{pipelines:y});case"SET_SUPERNODE_EXPAND_STATE":var m=e.pipelines.map((function(e){if(e.id===t.pipelineId){var n=ht(e.nodes,{type:"SET_SUPERNODE_EXPAND_STATE",data:t.data});n=ht(n,{type:"SET_NODE_POSITIONS",data:{nodePositions:t.data.objectPositions}});var i=gt(e.comments,{type:"SET_COMMENT_POSITIONS",data:{commentPositions:t.data.objectPositions}}),o=mt(e.links,{type:"SET_LINK_POSITIONS",data:t.data});return Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return Object.assign({},e,{pipelines:m});case"DECONSTRUCT_SUPERNODE":var _=e.pipelines.filter((function(e){return e.id!==t.data.pipelineToDelete.id})).map((function(e){if(e.id===t.data.pipelineId){var n=ht(e.nodes,{type:"ADD_NODES",data:t.data}),i=gt(e.comments,{type:"ADD_COMMENTS",data:t.data}),o=mt(e.links,{type:"ADD_LINKS",data:t.data});return n=ht(n,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:[t.data.supernodeToDelete]}}),o=mt(o,{type:"DELETE_SUPERNODES",data:{supernodesToDelete:[t.data.supernodeToDelete]}}),n=ht(n,{type:"SET_NODE_POSITIONS",data:{nodePositions:t.data.newObjectPositions}}),i=gt(i,{type:"SET_COMMENT_POSITIONS",data:{commentPositions:t.data.newObjectPositions}}),o=mt(o,{type:"SET_LINK_POSITIONS",data:{linkPositions:t.data.newLinkPositions}}),Object.assign({},e,{nodes:n,comments:i,links:o})}return e}));return Object.assign({},e,{pipelines:_});case"RECONSTRUCT_SUPERNODE":var v=[].concat(i._toConsumableArray(e.pipelines),[t.data.pipelineToDelete]);return v=v.map((function(e){if(e.id===t.data.pipelineId){var n=ht(e.nodes,{type:"DELETE_NODES",data:{nodesToDelete:t.data.nodesToAdd}}),i=gt(e.comments,{type:"DELETE_COMMENTS",data:{commentsToDelete:t.data.commentsToAdd}}),o=mt(e.links,{type:"REMOVE_LINKS",data:{linksToDelete:t.data.linksToAdd}});return n=ht(n,{type:"ADD_SUPERNODES",data:{supernodesToAdd:[t.data.supernodeToDelete]}}),o=mt(o,{type:"ADD_LINKS",data:{linksToAdd:t.data.linksToRemove}}),n=ht(n,{type:"SET_NODE_POSITIONS",data:{nodePositions:t.data.oldObjectPositions}}),i=gt(i,{type:"SET_COMMENT_POSITIONS",data:{commentPositions:t.data.oldObjectPositions}}),o=mt(o,{type:"SET_LINK_POSITIONS",data:{linkPositions:t.data.oldLinkPositions}}),Object.assign({},e,{nodes:n,comments:i,links:o})}return e})),Object.assign({},e,{pipelines:v});case"SET_OBJECTS_STYLE":case"SET_LINKS_STYLE":var b=Object.keys(t.data.pipelineObjIds),P=e.pipelines.map((function(e){return b.indexOf(e.id)>-1?(t.data.objIds=t.data.pipelineObjIds[e.id],t.data.pipelineId=e.id,Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)})):e}));return Object.assign({},e,{pipelines:P});case"SET_OBJECTS_MULTI_STYLE":case"SET_LINKS_MULTI_STYLE":var k=e.pipelines.map((function(e){return t.data.pipelineObjStyles.findIndex((function(t){return t.pipelineId===e.id}))>-1?(t.data.pipelineId=e.id,Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)})):e}));return Object.assign({},e,{pipelines:k});case"SET_NODES_MULTI_DECORATIONS":var I=e.pipelines.map((function(e){return t.data.pipelineNodeDecorations.findIndex((function(t){return t.pipelineId===e.id}))>-1?(t.data.pipelineId=e.id,Object.assign({},e,{nodes:ht(e.nodes,t),comments:e.comments,links:e.links})):e}));return Object.assign({},e,{pipelines:I});case"SET_LINKS_MULTI_DECORATIONS":var N=e.pipelines.map((function(e){return t.data.pipelineLinkDecorations.findIndex((function(t){return t.pipelineId===e.id}))>-1?(t.data.pipelineId=e.id,Object.assign({},e,{nodes:e.nodes,comments:e.comments,links:mt(e.links,t)})):e}));return Object.assign({},e,{pipelines:N});case"REMOVE_ALL_STYLES":var E=e.pipelines.map((function(e){return Object.assign({},e,{nodes:ht(e.nodes,t),comments:gt(e.comments,t),links:mt(e.links,t)})}));return Object.assign({},e,{pipelines:E});default:return e}};var kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_CONTEXT_MENU":var n=t.data.menuDef.map((function(e){return Object.assign({},e)}));return n.length>0?Object.assign({},e,{isOpen:!0,menuDef:n,source:t.data.source}):e;case"CLOSE_CONTEXT_MENU":return Object.assign({},e,{isOpen:!1});default:return e}},It=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_RIGHT_FLYOUT_CONFIG"===t.type&&t.data.config?{content:t.data.config.content,isOpen:t.data.config.isOpen}:e},Nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BOTTOM_PANEL_CONFIG"===t.type&&t.data.config?Object.assign({},e,t.data.config):e},Et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_TOP_PANEL_CONFIG"===t.type&&t.data.config?Object.assign({},e,t.data.config):e},St=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CANVAS_INFO":return t.canvasInfoIdChanged||!Ot(e,t.canvasInfo)?[{pipelineId:t.canvasInfo.primary_pipeline,pipelineFlowId:t.canvasInfo.id}]:e;case"SET_BREADCRUMBS":return t.data.breadcrumbs.map((function(e){return Object.assign({},e)}));case"ADD_BREADCRUMB":return[].concat(i._toConsumableArray(e),[{pipelineId:t.data.pipelineId,supernodeId:t.data.supernodeId,supernodeParentPipelineId:t.data.supernodeParentPipelineId,externalUrl:t.data.externalUrl,label:t.data.label}]);case"ADD_BREADCRUMBS":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.addBreadcrumbs));case"SET_TO_INDEXED_BREADCRUMB":return t.data.breadcrumbIndex>=0&&t.data.breadcrumbIndex<e.length?e.slice(0,t.data.breadcrumbIndex+1):e;case"SET_TO_PREVIOUS_BREADCRUMB":return e.length>1?e.slice(0,e.length-1):e;case"RESET_BREADCRUMB":return[{pipelineId:t.data.pipelineId}];default:return e}},Ot=function(e,t){if(t&&t.pipelines&&Array.isArray(e)&&e.length>0&&e[e.length-1].pipelineId){var n=e[e.length-1].pipelineId;return t.pipelines.findIndex((function(e){return e.id===n}))>-1}return!1},Ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return"SET_CANVAS_CONFIG_INFO"===t.type?t.data.canvasConfig:e},jt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ZOOM":return Object.assign({},e);case"SET_TOOLBAR_CONFIG":return Object.assign({},e,{config:t.data.toolbarConfig});default:return e}},Tt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_TEXT_TOOLBAR_DEF"===t.type&&t.data.textToolbarDef?Object.assign({},e,t.data.textToolbarDef):e},wt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_NOTIFICATION_MESSAGES":return[];case"SET_NOTIFICATION_MESSAGES":return t.data.messages.forEach((function(e){return function(e){null!==e.type&&""!==e.type&&void 0!==e.type||(e.type="unspecified");return e}(e)})),t.data.messages;case"DELETE_NOTIFICATION_MESSAGES":var n=Array.isArray(t.data.ids)?t.data.ids:[t.data.ids];return e.filter((function(e){return!n.includes(e.id)}));default:return e}};var Lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_CANVAS_INFO":return t.canvasInfoIdChanged?{}:e;case"CLEAR_SELECTIONS":case"SET_BREADCRUMBS":case"ADD_BREADCRUMB":case"ADD_BREADCRUMBS":case"SET_TO_INDEXED_BREADCRUMB":case"SET_TO_PREVIOUS_BREADCRUMB":case"RESET_BREADCRUMB":return{};case"ADD_PASTED_OBJECTS":case"SET_SELECTIONS":return{pipelineId:t.pipelineId,selections:i._toConsumableArray(t.data.selections)};case"DELETE_OBJECT":if(e.selections){var n=e.selections.filter((function(e){return t.data.id!==e}));return{pipelineId:e.pipelineId,selections:n}}return e;case"DELETE_AND_UPDATE_OBJECTS":if(e.selections){var o=[].concat(i._toConsumableArray(t.data.linksToDelete),i._toConsumableArray(t.data.supernodesToDelete),i._toConsumableArray(t.data.nodesToDelete),i._toConsumableArray(t.data.commentsToDelete)),r=e.selections.filter((function(e){return!o.some((function(t){return t.id===e}))}));return{pipelineId:e.pipelineId,selections:r}}return e;default:return e}},At=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NOTIFICATION_PANEL_CONFIG":return Object.assign({},e,{config:t.data.notificationPanelConfig});case"SET_NOTIFICATION_PANEL_OPEN_STATE":return Object.assign({},e,{isOpen:t.data.isOpen});default:return e}},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_EXTERNAL_PIPELINE_FLOW":var n=Object.assign({},t.newPipelineFlow);return[].concat(i._toConsumableArray(e),[n]);case"REMOVE_EXTERNAL_PIPELINE_FLOW":return e.filter((function(e){return e.url!==t.externalUrl}));case"REPLACE_SN_AND_PIPELINES":var o=e.filter((function(e){return!t.data.extPipelineFlowsToDelete.some((function(t){return t.url===e.url}))}));return[].concat(i._toConsumableArray(o),i._toConsumableArray(t.data.extPipelineFlowsToAdd));case"ADD_OBJECTS_AND_UPDATE":case"ADD_SUPERNODES":return[].concat(i._toConsumableArray(e),i._toConsumableArray(t.data.extPipelineFlowsToAdd));case"DELETE_PASTED_OBJECTS":case"DELETE_OBJECTS_AND_UPDATE":case"DELETE_SUPERNODES":return e.filter((function(e){return!t.data.extPipelineFlowsToDelete.some((function(t){return e.url===t.url}))}));case"DECONSTRUCT_SUPERNODE":return e.filter((function(e){return e.id!==t.data.extPipelineFlowToDelete.id}));case"RECONSTRUCT_SUPERNODE":return[].concat(i._toConsumableArray(e),[t.data.extPipelineFlowToDelete]);case"SET_CANVAS_INFO":return t.canvasInfoIdChanged?[]:e;default:return e}},Dt=function(){function n(t){e._classCallCheck(this,n);var i=d.combineReducers({selectioninfo:Lt,canvasconfig:Ct,canvasinfo:Pt,breadcrumbs:St,palette:pt,notifications:wt,notificationpanel:At,externalpipelineflows:xt,tooltip:ct,canvastoolbar:jt,texttoolbar:Tt,contextmenu:kt,rightflyout:It,bottompanel:Nt,toppanel:Et}),o={selectioninfo:{},canvasinfo:t,canvasconfig:S.getDefaultCanvasConfig(),breadcrumbs:[{pipelineId:t.primary_pipeline,pipelineFlowId:t.id}],palette:{content:{}},notifications:[],notificationpanel:{isOpen:!1,config:{}},externalpipelineflows:[],tooltip:{},canvastoolbar:{},texttoolbar:{isOpen:!1},contextmenu:{isOpen:!1,menuDef:[],source:{}},rightflyout:{},bottompanel:{panelHeight:393},toppanel:{}},r=!1;"undefined"!=typeof window&&(r=window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__()),this.store=d.createStore(i,o,r),this.dispatch=this.dispatch.bind(this)}return e._createClass(n,[{key:"dispatch",value:function(e){this.store.dispatch(e)}},{key:"subscribe",value:function(e){return this.store.subscribe(e)}},{key:"getStore",value:function(){return this.store}},{key:"getPalette",value:function(){return o.cloneDeep_1(this.store.getState().palette)}},{key:"getPaletteData",value:function(){return o.cloneDeep_1(this.store.getState().palette.content)}},{key:"getPaletteCategory",value:function(e){return o.cloneDeep_1(this.store.getState().palette.content.categories.find((function(t){return t.id===e})))}},{key:"getCanvasInfo",value:function(){return o.cloneDeep_1(this.store.getState().canvasinfo)}},{key:"getPipelineFlowId",value:function(){return this.store.getState().canvasinfo.id}},{key:"getPrimaryPipelineId",value:function(){return this.store.getState().canvasinfo.primary_pipeline}},{key:"getZoom",value:function(e){var t=this.getNonClonedPipeline(e);return t?o.cloneDeep_1(t.zoom):null}},{key:"isEmpty",value:function(e){var t=this.getNonClonedPipeline(e);return!!(t.nodes&&0===t.nodes.length&&t.comments&&0===t.comments.length&&t.links&&0===t.links.length)}},{key:"getNonClonedPipeline",value:function(e){return this.store.getState().canvasinfo.pipelines.find((function(t){return t.id===e}))}},{key:"getNonClonedSelectedObjs",value:function(e){var t=this.getSelectedPipelineId();if(t){var n=this.getNonClonedPipeline(t);if(n&&n[e]){var i=this.getSelectedObjectIds();return n[e].filter((function(e){return i.includes(e.id)}))}}return[]}},{key:"getNodes",value:function(e){var t=this.getNonClonedPipeline(e);return t&&t.nodes?o.cloneDeep_1(t.nodes):[]}},{key:"getNode",value:function(e,t){var n=this.getNonClonedPipeline(t),i=null;if(n&&n.nodes){var r=n.nodes.find((function(t){return t.id===e}));r&&(i=o.cloneDeep_1(r))}return i}},{key:"getComments",value:function(e){var t=this.getNonClonedPipeline(e);return t&&t.comments?o.cloneDeep_1(t.comments):[]}},{key:"getComment",value:function(e,t){var n=this.getNonClonedPipeline(t),i=null;if(n&&n.comments){var r=n.comments.find((function(t){return t.id===e}));r&&(i=o.cloneDeep_1(r))}return i}},{key:"getLinks",value:function(e){var t=this.getNonClonedPipeline(e);return t&&t.links?o.cloneDeep_1(t.links):[]}},{key:"getLink",value:function(e,t){var n=this.getNonClonedPipeline(t),i=null;if(n&&n.links){var r=n.links.find((function(t){return t.id===e}));r&&(i=o.cloneDeep_1(r))}return i}},{key:"getBreadcrumbs",value:function(){return o.cloneDeep_1(this.store.getState().breadcrumbs)}},{key:"getCanvasConfig",value:function(){return Object.assign({},this.store.getState().canvasconfig)}},{key:"getNodeLayout",value:function(){return this.cloneData(this.store.getState().canvasconfig.enableNodeLayout)}},{key:"getCanvasLayout",value:function(){return this.cloneData(this.store.getState().canvasconfig.enableCanvasLayout)}},{key:"isTooltipOpen",value:function(){return!t.isEmpty_1(this.store.getState().tooltip)}},{key:"getTooltip",value:function(){return this.cloneData(this.store.getState().tooltip)}},{key:"isRightFlyoutOpen",value:function(){return this.store.getState().rightflyout.isOpen}},{key:"isBottomPanelOpen",value:function(){return this.store.getState().bottompanel.isOpen}},{key:"isTopPanelOpen",value:function(){return this.store.getState().toppanel.isOpen}},{key:"getNotificationPanel",value:function(){return this.cloneData(this.store.getState().notificationpanel)}},{key:"getNotifications",value:function(){return this.store.getState().notifications.map((function(e,t){return Object.assign({},e)}))}},{key:"isNotificationPanelOpen",value:function(){return this.getNotificationPanel().isOpen}},{key:"getContextMenuSource",value:function(){return this.cloneData(this.store.getState().contextmenu.source)}},{key:"isContextMenuDisplayed",value:function(){return this.store.getState().contextmenu.isOpen}},{key:"getSelectionInfo",value:function(){return this.cloneData(this.store.getState().selectioninfo)}},{key:"getSelectedPipelineId",value:function(){return this.getSelectionInfo().pipelineId}},{key:"getSelectedObjectIds",value:function(){var e=this.store.getState().selectioninfo.selections||[];return this.cloneData(e)}},{key:"getSelectedNodes",value:function(){return o.cloneDeep_1(this.getNonClonedSelectedObjs("nodes"))}},{key:"getSelectedComments",value:function(){return o.cloneDeep_1(this.getNonClonedSelectedObjs("comments"))}},{key:"getSelectedLinks",value:function(){return o.cloneDeep_1(this.getNonClonedSelectedObjs("links"))}},{key:"areAllSelectedObjectsLinks",value:function(){return this.getNonClonedSelectedObjs("links").length===this.getSelectedObjectIds().length}},{key:"getExternalPipelineFlows",value:function(){return this.cloneData(this.store.getState().externalpipelineflows)}},{key:"getExternalPipelineFlow",value:function(e){var t=this.store.getState().externalpipelineflows.find((function(t){return t.url===e}));return t?this.cloneData(t):null}},{key:"cloneData",value:function(e){return o.cloneDeep_1(e)}}]),n}(),Mt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow Schema",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json",properties:{doc_type:{description:"Document type",type:"string"},version:{description:"Pipeline-flow schema version",enum:["1.0"]},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json"]},open_with_tool:{description:"Preferred authoring application",type:"string"},id:{description:"Document identifier, GUID recommended",type:"string"},primary_pipeline:{description:"Reference to the primary (main) pipeline flow within the document",type:"string"},pipelines:{description:"Array of pipelines",type:"array",minItems:1,items:{$ref:"#/definitions/pipeline_def"},uniqueItems:!0},schemas:{description:"Array of data record schemas used in the document",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json#/definitions/record_schema"},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["doc_type","version","primary_pipeline","pipelines"],additionalProperties:!1,definitions:{pipeline_def:{description:"Definition of a single pipeline flow",type:"object",properties:{id:{description:"Unique identifier",type:"string"},runtime:{description:"Runtime associated with the operations in the current pipeline",type:"string"},nodes:{description:"Array of pipeline nodes",type:"array",minItems:0,items:{oneOf:[{$ref:"#/definitions/node_def"},{$ref:"#/definitions/supernode_def"},{$ref:"#/definitions/binding_entry_node_def"},{$ref:"#/definitions/binding_exit_node_def"},{$ref:"#/definitions/model_node_def"}]},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","runtime","nodes"],additionalProperties:!1},node_def:{description:"Definition of a single pipeline node",type:"object",properties:{id:{description:"Unique identifier for node within the current pipeline",type:"string"},type:{description:"Node type - always 'execution_node' for non-model pipeline elements",enum:["execution_node"]},op:{description:"Operator type identifier",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","op"],additionalProperties:!1},supernode_def:{description:"Definition of a supernode which serves as the entry point for a sub-pipeline",type:"object",properties:{id:{description:"Unique identifier for the supernode within the current pipeline",type:"string"},type:{description:"Node type - always 'super_node' for supernode elements",enum:["super_node"]},subflow_ref:{description:"Refers to the sub-flow associated with this supernode",type:"object",properties:{url:{description:"Reference to an external sub-flow. When not present the sub-flow is assumed to be in the current document. A value of 'app_defined' indicates a sub-flow identifier is present, but the controlling application will serve up the sub-pipeline in the form of a new pipeline-flow document (no sub-flow is present in the document).",type:"string"},pipeline_id_ref:{description:"Sub-flow identifier reference",type:"string"}},required:["pipeline_id_ref"]},inputs:{$ref:"#/definitions/bound_ports_def"},outputs:{$ref:"#/definitions/bound_ports_def"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","subflow_ref","inputs"],additionalProperties:!1},binding_entry_node_def:{description:"Defines an entry point (source) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},output:{$ref:"#/definitions/port_binding_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_data_asset_def"}},required:["id","type"],additionalProperties:!1},binding_exit_node_def:{description:"Defines an exit point (sink) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},input:{$ref:"#/definitions/port_binding_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_data_asset_def"}},required:["id","type"],additionalProperties:!1},model_node_def:{description:"Definition of a single predictive model node",type:"object",properties:{id:{description:"Unique identifier for the model within the current pipeline",type:"string"},type:{description:"Node type - always 'model_node' for model pipeline elements",enum:["model_node"]},model_ref:{description:"Reference to the binary model",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","inputs"],additionalProperties:!1},port_def:{description:"Port definition (input/output) on a node",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema reference associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:0,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},port_binding_def:{description:"Definition (input/output) of a binding port on a node (bound or unbound). If no binding is present the port is bound at runtime via a configuration object or wrapper document.",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},link:{$ref:"#/definitions/link_def"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/port_def"},uniqueItems:!0},bound_ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/bound_port_def"},uniqueItems:!0},bound_port_def:{description:"Port definition (input/output) on a node with optional pipeline port binding for supernodes",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:1,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},subflow_node_ref:{description:"Optional node id binding within the current document.",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},link_def:{description:"Node link definition",type:"object",properties:{pipeline_id_ref:{description:"id of the pipeline this link connects to",type:"string"},node_id_ref:{description:"id of a node this link connects to",type:"string"},port_id_ref:{description:"optional port id of a node this link connects to",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["node_id_ref"],additionalProperties:!1},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{anyOf:[{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/pipeline_overview_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/pipeline_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/port_info_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#/definitions/node_info_def"}]}},additionalProperties:!0}}},Rt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow UI Schema. Defines UI-only constructs for pipeline flow documents.",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v1-schema.json#",properties:{},additionalProperties:!0,definitions:{pipeline_overview_def:{description:"Top level UI information",type:"object",properties:{name:{description:"User-defined name",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"}},additionalProperties:!0},pipeline_def:{description:"Pipeline level UI information",type:"object",properties:{zoom:{description:"Zoom factor",type:"integer"},comments:{description:"Array of Comments, optionally associated with nodes",type:"array",minItems:0,items:{$ref:"#/definitions/comment_def"},uniqueItems:!0}},additionalProperties:!0},port_info_def:{description:"Additional UI info for ports",type:"object",properties:{cardinality:{description:"Property to capture how many data assets are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of data assets. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1},class_name:{description:"CSS class name",type:"string"},label:{description:"Port name",type:"string"}},additionalProperties:!0},node_info_def:{description:"object with app-specific UI-information",type:"object",properties:{label:{description:"User-defined label",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},image:{description:"Image name (do not embed images inline!)",type:"string"},x_pos:{description:"x-position",type:"integer"},y_pos:{description:"y-position",type:"integer"},attributes:{description:"additional attributes",type:"string"},associations:{description:"Array of non-data node linkage",type:"array",minItems:0,items:{$ref:"#/definitions/association_def"}},messages:{descriptions:"An array of messages for the node",type:"array",minItems:0,items:{$ref:"#/definitions/message_def"},uniqueItems:!0},decorations:{description:"Array of decorations used to decorate nodes",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},association_def:{description:"Non-data link",type:"object",properties:{id:{description:"Association identifier",type:"string"},node_ref:{description:"Target node id",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["id","node_ref"],additionalProperties:!1},decoration_def:{description:"Decoration used to decorate a node",type:"object",properties:{id:{description:"An identifier used as a token when a hotspot is used",type:"string"},hotspot:{description:"Indicates whether teh decorator is a hotspot or not. ie does it send an event to consuming app. when clicked",type:"boolean"},class_name:{description:"CSS class name for decoration styling",type:"string"},positions:{description:"Shows where the decoration is displayed with respect to the node",enum:["topLeft","topRight","bottomLeft","bottomRight"]},image:{description:"Image displayed at the decoration position",type:"string"}}},message_def:{description:"Node message definition",type:"object",properties:{id_ref:{description:"Name of the parameter that has the message",type:"string"},validation_id:{description:"Validation identifier from the fail_message validation section.",type:"string"},type:{description:"Type of message",enum:["info","error","warning"]},text:{description:"Message string",type:"string"}}},comment_def:{type:"object",properties:{id:{description:"Comment identifier. Must be unique.",type:"string"},x_pos:{description:"Horizontal comment position",type:"integer",minimum:0},y_pos:{description:"Vertical comment position",type:"integer",minimum:0},width:{description:"Comment width",type:"integer",minimum:10},height:{description:"Comment height",type:"integer",minimum:10},class_name:{description:"CSS class(es) to apply to the comment",type:"string"},attributes:{description:"Optional attributes to be added to this element. For example: \"attributes\": \"attr1='value1'; attr2='value2'\"",type:"string"},content:{description:"Comment content",type:"string"},associated_id_refs:{description:"Optional array of associated node id references",type:"array",minItems:0,items:{$ref:"#/definitions/comment_link_def"},uniqueItems:!0}},required:["id","x_pos","y_pos","width","height"],additionalProperties:!0},comment_link_def:{description:"Comment link definition",type:"object",properties:{node_ref:{description:"Node reference",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["node_ref"],additionalProperties:!0}}},Ut={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v1-schema.json#",title:"Watson Data Platform Pipeline Connection Schema",description:"Connection schema for pipelines in the Watson Data Platform",definitions:{common_pipeline_connection_def:{description:"Details of the connection to use for a pipeline binding node.",properties:{app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a connection by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the connection. If neither this attribute nor project_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the connection. If neither this attribute nor catalog_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"The properties for the connection. The specific properties allowed depend on the type of connection referenced.",additionalProperties:{type:"object"},type:"object"}},required:["ref"],type:"object"},common_pipeline_data_asset_def:{description:"Details of the data asset contained in a catalog or project to use for a pipeline binding node.",properties:{app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v1-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a data asset by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the data asset. If neither this attribute nor project_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the data asset. If neither this attribute nor catalog_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"Properties controlling how the data asset is used.",type:"object",additionalProperties:{type:"object"},properties:{attachment_ref:{description:"The ID of the data asset attachment to use. If not specified and used as a source, the first suitable attachment found will be used. If not specified and used as a target, a new attachment will be created.",type:"string"},name:{description:"Specifies the name of the data asset to read, create or update if ref is unset.",type:"string",default:!1},no_write_schema:{description:"When used as a target, whether to update the data asset with the schema when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1},no_write_status:{description:"When used as a target, whether to update the data asset with the status when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1}}}},type:"object"}}},Ft={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json#",title:"Watson Data Platform Datarecord Metadata Schema",description:"Metadata schema for datarecords in the Watson Data Platform",definitions:{record_schema:{description:"Description of a datarecord including column types and metadata",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"Name of datarecord",type:"string"},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v1-schema.json"],type:"string"},type:{description:"Always 'struct' for datarecord schema",type:"string"},fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0}},required:["fields"]},field:{description:"Definition of a datarecord field",type:"object",properties:{name:{description:"Field name. Must be unique within the datarecord",type:"string"},type:{description:"Field type. Can be a primitive type (string, integer, double, date, time, timestamp, binary, boolean, or other)",type:"string"},nullable:{description:"Whether or not one can place null values into the field",type:"boolean",default:!1},metadata:{$ref:"#/definitions/metadata"}},required:["name","type"]},metadata:{description:"Additional field metadata",type:"object",properties:{description:{description:"Field description",type:"string"},measure:{description:"Field measurement level",enum:["range","discrete","flag","set","ordered-set","typeless","collection","geospatial","default"]},modeling_role:{description:"Field role for modeling",enum:["input","target","both","none","partition","split","frequency","record-id"]},max_length:{description:"Maximum length for fields. Length is unlimited when not present",type:"number"},decimal_precision:{description:"Precision for decimal types",type:"number"},decimal_scale:{description:"Scale for decimal types",type:"number"},values:{description:"Array of unique categorical values for the column",type:"array",minItems:0,items:{description:"A value discovered in the data",type:"string"},uniqueItems:!0},range:{description:"Minimum and maximum discovered values for scalar data",type:"object",properties:{min:{description:"Lowest value discovered in the data",type:"number"},max:{description:"Highest value discovered in the data",type:"number"}},required:["min","max"]}},required:[]}}},Bt={$schema:"http://json-schema.org/draft-04/schema#",type:"object",description:"Abstract Canvas diagram schema",id:"http://api.dataplatform.ibm.com/schemas/common-canvas/palette/palette-v1-schema.json",properties:{categories:{description:"Array of palette categories",type:"array",minItems:0,items:{type:"object",properties:{category:{description:"The palette category that the items belong within",type:"string"},label:{description:"Category label",type:"string"},image:{description:"Encoded image or image reference for the category",type:"string"},nodetypes:{description:"Array of nodes within the current category",type:"array",items:{type:"object",properties:{label:{description:"Node label",type:"string"},description:{description:"Node description",type:"string"},type:{description:"Node classification type",enum:["binding","execution_node","super_node","model_node"]},operator_id_ref:{description:"Unique node type identifier",type:"string"},image:{description:"Encoded image or image reference for the node",type:"string"},subDiagramId:{description:"Optional sub diagram identifier.",type:"string"},input_ports:{description:"Array of node input ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}},output_ports:{description:"Array of node output ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}}},required:["label","image"]}}},required:["category","label"]}}},definitions:{port:{description:"Defines a node port for links",type:"object",properties:{id:{description:"Port identifier",type:"string"},label:{description:"Port long label",type:"string"},cardinality:{description:"Property to capture how many connections are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of connections. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1}},required:["id"]}}},Ht={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow Schema",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json",properties:{doc_type:{description:"Document type",type:"string"},version:{description:"Pipeline-flow schema version",enum:["2.0"]},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json"]},open_with_tool:{description:"Preferred authoring application",type:"string"},id:{description:"Document identifier, GUID recommended",type:"string"},parameters:{description:"Parameters for the flow document",type:"object",properties:{},additionalProperties:!0},primary_pipeline:{description:"Reference to the primary (main) pipeline flow within the document",type:"string"},pipelines:{description:"Array of pipelines",type:"array",minItems:1,items:{$ref:"#/definitions/pipeline_def"},uniqueItems:!0},schemas:{description:"Array of data record schemas used in the document",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v2-schema.json#/definitions/record_schema"},uniqueItems:!0},runtimes:{description:"Array of runtime objects referred to in the document",type:"array",minItems:0,items:{$ref:"#/definitions/runtime_def"},uniqueItems:!0},external_parameters:{description:"Array of parameterized property references",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/parameters/parameters-v2-schema.json#/definitions/param_property_ref"},uniqueItems:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["doc_type","version","primary_pipeline","pipelines"],additionalProperties:!1,definitions:{pipeline_def:{description:"Definition of a single pipeline flow",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"User-readable name",type:"string"},runtime_ref:{description:"Reference to the id of the runtime associated with the operations in the current pipeline",type:"string"},nodes:{description:"Array of pipeline nodes",type:"array",minItems:0,items:{oneOf:[{$ref:"#/definitions/node_def"},{$ref:"#/definitions/supernode_def"},{$ref:"#/definitions/binding_entry_node_def"},{$ref:"#/definitions/binding_exit_node_def"},{$ref:"#/definitions/model_node_def"}]},uniqueItems:!0},parameters:{description:"Parameters for the pipeline",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","runtime_ref","nodes"],additionalProperties:!1},node_def:{description:"Definition of a single pipeline node",type:"object",properties:{id:{description:"Unique identifier for node within the current pipeline",type:"string"},type:{description:"Node type - always 'execution_node' for non-model pipeline elements",enum:["execution_node"]},op:{description:"Operator type identifier",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Optional reference to the id of the runtime associated with the current node",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","op"],additionalProperties:!1},supernode_def:{description:"Definition of a supernode which serves as the entry point for a sub-pipeline",type:"object",properties:{id:{description:"Unique identifier for the supernode within the current pipeline",type:"string"},type:{description:"Node type - always 'super_node' for supernode elements",enum:["super_node"]},open_with_tool:{description:"Name of the tool which can be used to view or edit the sub-flow for this supernode. The default is 'canvas'",type:"string"},subflow_ref:{description:"Refers to the sub-flow associated with this supernode",type:"object",properties:{url:{description:"Reference to an external sub-flow. When not present the sub-flow is assumed to be in the current document. A value of 'app_defined' indicates a sub-flow identifier is present, but the controlling application will serve up the sub-pipeline in the form of a new pipeline-flow document (no sub-flow is present in the document).",type:"string"},pipeline_id_ref:{description:"Sub-flow identifier reference",type:"string"}},required:["pipeline_id_ref"]},inputs:{$ref:"#/definitions/bound_ports_def"},outputs:{$ref:"#/definitions/bound_ports_def"},parameters:{description:"Input parameters for the supernode",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","subflow_ref","inputs"],additionalProperties:!1},binding_entry_node_def:{description:"Defines an entry point (source) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},outputs:{$ref:"#/definitions/ports_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the entry binding node",type:"object",properties:{},additionalProperties:!0}},required:["id","type"],additionalProperties:!1},binding_exit_node_def:{description:"Defines an exit point (sink) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},inputs:{$ref:"#/definitions/ports_def"},app_data:{$ref:"#/definitions/app_data_def"},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the binding exit node",type:"object",properties:{},additionalProperties:!0}},required:["id","type"],additionalProperties:!1},model_node_def:{description:"Definition of a single predictive model node",type:"object",properties:{id:{description:"Unique identifier for the model within the current pipeline",type:"string"},type:{description:"Node type - always 'model_node' for model pipeline elements",enum:["model_node"]},model_ref:{description:"Reference to the binary model",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Reference to the runtime associated with the current node",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","type","inputs"],additionalProperties:!1},port_def:{description:"Port definition (input/output) on a node",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema reference associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:0,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},parameters:{description:"Parameters for the port",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/port_def"},uniqueItems:!0},bound_ports_def:{type:"array",minItems:1,items:{$ref:"#/definitions/bound_port_def"},uniqueItems:!0},bound_port_def:{description:"Port definition (input/output) on a node with optional pipeline port binding for supernodes",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:1,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},subflow_node_ref:{description:"Optional node id binding within the current document.",type:"string"},parameters:{description:"Parameters for the binding port",type:"object",properties:{},additionalProperties:!0},app_data:{$ref:"#/definitions/app_data_def"}},required:["id"],additionalProperties:!1},link_def:{description:"Node link definition",type:"object",properties:{node_id_ref:{description:"id of a node this link connects to",type:"string"},port_id_ref:{description:"optional port id of a node this link connects to",type:"string"},link_name:{description:"optional link name (used in parameter sets when there are multiple input sources)",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["node_id_ref"],additionalProperties:!1},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{anyOf:[{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/pipeline_overview_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/pipeline_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/port_info_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/node_info_def"},{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#/definitions/runtime_info_def"}]}},additionalProperties:!0},runtime_def:{description:"Runtime associated with the operations in the current pipeline",type:"object",properties:{id:{description:"Unique internal runtime identifier",type:"string"},name:{description:"The runtime name",type:"string"},version:{description:"The runtime version. When not present the latest version is assumed",type:"string"},app_data:{$ref:"#/definitions/app_data_def"}},required:["id","name"]}}},Gt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow UI Schema. Defines UI-only constructs for pipeline flow documents.",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v2-schema.json#",properties:{},additionalProperties:!0,definitions:{pipeline_overview_def:{description:"Top level UI information",type:"object",properties:{name:{description:"User-defined name",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"}},additionalProperties:!0},pipeline_def:{description:"Pipeline level UI information",type:"object",properties:{zoom:{description:"Zoom factor",type:"integer"},comments:{description:"Array of Comments, optionally associated with nodes",type:"array",minItems:0,items:{$ref:"#/definitions/comment_def"},uniqueItems:!0}},additionalProperties:!0},port_info_def:{description:"Additional UI info for ports",type:"object",properties:{cardinality:{description:"Property to capture how many data assets are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of data assets. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1},class_name:{description:"CSS class name",type:"string"},label:{description:"Port name",type:"string"}},additionalProperties:!0},node_info_def:{description:"object with app-specific UI-information",type:"object",properties:{label:{description:"User-defined label",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},image:{description:"Image name (do not embed images inline!)",type:"string"},x_pos:{description:"x-position",type:"integer"},y_pos:{description:"y-position",type:"integer"},is_expanded:{description:"Indicates whether a supernode is shown in expanded state or as a regular node.",type:"boolean"},expanded_height:{description:"Height of expanded supernode. If not provided an appropriate height is calculated.",type:"string"},expanded_width:{description:"Width of expanded supernode. If not provided an appropriate width is calculated.",type:"string"},attributes:{description:"additional attributes",type:"string"},associations:{description:"Array of non-data node linkage",type:"array",minItems:0,items:{$ref:"#/definitions/association_def"}},messages:{descriptions:"An array of messages for the node",type:"array",minItems:0,items:{$ref:"#/definitions/message_def"},uniqueItems:!0},ui_parameters:{description:"UI only parameter values for the node",type:"object",properties:{},additionalProperties:!0},decorations:{description:"Array of decorations used to decorate nodes",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},runtime_info_def:{description:"Runtime information",type:"object",properties:{},required:[],additionalProperties:!0},association_def:{description:"Non-data link",type:"object",properties:{id:{description:"Association identifier",type:"string"},node_ref:{description:"Target node id",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["id","node_ref"],additionalProperties:!1},decoration_def:{description:"Decoration used to decorate a node",type:"object",properties:{id:{description:"An identifier used to identify the decoration",type:"string"},hotspot:{description:"Indicates whether the decorator is a hotspot or not. ie does it send an event to consuming app. when clicked",type:"boolean"},class_name:{description:"CSS class name for decoration styling",type:"string"},position:{description:"Shows where the decoration is displayed with respect to the node",enum:["topLeft","topRight","bottomLeft","bottomRight"]},x_pos:{description:"X position of the decorator relative to the node's top left corner. If provided, this is used in preference to the position field.",type:"integer"},y_pos:{description:"Y position of the decorator relative to the node's top left corner. If provided, this is used in preference to the position field.",type:"integer"},image:{description:"Image displayed at the decoration position. Provide either this or a label.",type:"string"},label:{description:"Label displayed at the decoration position. Provide either this or an image.",type:"string"}}},message_def:{description:"Node message definition",type:"object",properties:{id_ref:{description:"Name of the parameter that has the message",type:"string"},validation_id:{description:"Validation identifier from the fail_message validation section.",type:"string"},type:{description:"Type of message",enum:["info","error","warning"]},text:{description:"Message string",type:"string"}},required:["id_ref","type","text"]},comment_def:{type:"object",properties:{id:{description:"Comment identifier. Must be unique.",type:"string"},x_pos:{description:"Horizontal comment position",type:"integer",minimum:0},y_pos:{description:"Vertical comment position",type:"integer",minimum:0},width:{description:"Comment width",type:"integer",minimum:10},height:{description:"Comment height",type:"integer",minimum:10},class_name:{description:"CSS class(es) to apply to the comment",type:"string"},attributes:{description:"Optional attributes to be added to this element. For example: \"attributes\": \"attr1='value1'; attr2='value2'\"",type:"string"},content:{description:"Comment content",type:"string"},associated_id_refs:{description:"Optional array of associated node id references",type:"array",minItems:0,items:{$ref:"#/definitions/comment_link_def"},uniqueItems:!0}},required:["id","x_pos","y_pos","width","height"],additionalProperties:!0},comment_link_def:{description:"Comment link definition",type:"object",properties:{node_ref:{description:"Node reference",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"}},required:["node_ref"],additionalProperties:!0}}},qt={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v2-schema.json",title:"Watson Data Platform Pipeline Connection Schema",description:"Connection schema for pipelines in the Watson Data Platform",definitions:{common_pipeline_connection_def:{description:"Details of the connection to use for a pipeline binding node.",properties:{name:{description:"A name tag for disambiguating connections",type:"string"},app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a connection by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the connection. If neither this attribute nor project_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the connection. If neither this attribute nor catalog_ref are specified, the connection will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"The properties for the connection. The specific properties allowed depend on the type of connection referenced.",additionalProperties:{type:"object"},type:"object"}},required:["ref"],type:"object"},common_pipeline_data_asset_def:{description:"Details of the data asset contained in a catalog or project to use for a pipeline binding node.",properties:{app_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v2-schema.json#/definitions/app_data_def"},ref:{description:"A reference to a data asset by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the data asset. If neither this attribute nor project_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the data asset. If neither this attribute nor catalog_ref are specified, the data asset will be assumed to exist in the project or catalog which contains the pipeline.",type:"string"},properties:{description:"Properties controlling how the data asset is used.",type:"object",additionalProperties:{type:"object"},properties:{attachment_ref:{description:"The ID of the data asset attachment to use. If not specified and used as a source, the first suitable attachment found will be used. If not specified and used as a target, a new attachment will be created.",type:"string"},name:{description:"Specifies the name of the data asset to read, create or update if ref is unset.",type:"string",default:!1},no_write_schema:{description:"When used as a target, whether to update the data asset with the schema when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1},no_write_status:{description:"When used as a target, whether to update the data asset with the status when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1}}}},type:"object"}}},Vt={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v2-schema.json",title:"Watson Data Platform Datarecord Metadata Schema",description:"Metadata schema for datarecords in the Watson Data Platform",definitions:{record_schema:{description:"Description of a datarecord including column types and metadata",type:"object",properties:{id:{description:"Unique identifier",type:"string"},name:{description:"Name of datarecord",type:"string"},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v2-schema.json"],type:"string"},type:{description:"Always 'struct' for datarecord schema",type:"string"},fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0},struct_types:{description:"The list of custom struct types to be used as field types",type:"object",patternProperties:{".":{type:"object",properties:{fields:{description:"Array of field definitions",type:"array",minItems:0,items:{$ref:"#/definitions/field"},uniqueItems:!0}}}}}},required:["id","fields"]},field:{description:"Definition of a datarecord field",type:"object",properties:{name:{description:"Field name. Must be unique within the datarecord",type:"string"},type:{description:"Field type. Can be a primitive type (string, integer, double, date, time, timestamp, binary, boolean, array[type], map[type, type]. The type can also be a reference to a struct_type declaration.)",type:"string"},nullable:{description:"Whether or not one can place null values into the field",type:"boolean",default:!1},metadata:{$ref:"#/definitions/metadata"}},required:["name","type"]},metadata:{description:"Additional field metadata",type:"object",properties:{description:{description:"Field description",type:"string"},measure:{description:"Field measurement level",enum:["range","discrete","flag","set","ordered-set","typeless","collection","geospatial","default"]},modeling_role:{description:"Field role for modeling",enum:["input","target","both","none","partition","split","frequency","record-id"]},max_length:{description:"Maximum length for fields. Length is unlimited when not present",type:"number"},decimal_precision:{description:"Precision for decimal types",type:"number"},decimal_scale:{description:"Scale for decimal types",type:"number"},values:{description:"Array of unique categorical values for the column",type:"array",minItems:0,items:{description:"A value discovered in the data",type:"string"},uniqueItems:!0},range:{description:"Minimum and maximum discovered values for scalar data",type:"object",properties:{min:{description:"Lowest value discovered in the data",type:"number"},max:{description:"Highest value discovered in the data",type:"number"}},required:["min","max"]},runtime_type:{description:"Type of runtime",type:"string"}},required:[]}}},zt={$schema:"http://json-schema.org/draft-04/schema#",type:"object",description:"Common Canvas palette schema",id:"http://api.dataplatform.ibm.com/schemas/common-canvas/palette/palette-v2-schema.json",version:{description:"Palette schema version",enum:["2.0"]},properties:{categories:{description:"Array of palette categories",type:"array",minItems:0,items:{type:"object",properties:{category:{description:"The palette category that the items belong within",type:"string"},label:{description:"Category label",type:"string"},image:{description:"Encoded image or image reference for the category",type:"string"},nodetypes:{description:"Array of nodes within the current category",type:"array",items:{type:"object",properties:{label:{description:"Node label",type:"string"},description:{description:"Node description",type:"string"},type:{description:"Node classification type",enum:["binding","execution_node","super_node","model_node"]},operator_id_ref:{description:"Unique node type identifier",type:"string"},image:{description:"Encoded image or image reference for the node",type:"string"},subDiagramId:{description:"Optional sub diagram identifier.",type:"string"},input_ports:{description:"Array of node input ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}},output_ports:{description:"Array of node output ports",type:"array",minItems:0,items:{$ref:"#/definitions/port"}}},required:["label","image"]}}},required:["category","label"]}}},definitions:{port:{description:"Defines a node port for links",type:"object",properties:{id:{description:"Port identifier",type:"string"},label:{description:"Port long label",type:"string"},cardinality:{description:"Property to capture how many connections are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of connections. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1}},required:["id"]}}},$t={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow Schema",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",properties:{doc_type:{description:"Document type",type:"string"},version:{description:"Pipeline-flow schema version",enum:["3.0"]},json_schema:{description:"Refers to the JSON schema used to validate documents of this type",enum:["http://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json","https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json"]},open_with_tool:{description:"Preferred authoring application",type:"string"},id:{description:"Document identifier, GUID recommended",type:"string"},parameters:{description:"Parameters for the flow document",type:"object",properties:{},additionalProperties:!0},primary_pipeline:{description:"Reference to the primary (main) pipeline flow within the document",type:"string"},pipelines:{description:"Array of pipelines",type:"array",minItems:1,items:{$ref:"#/definitions/pipeline_def"},uniqueItems:!0},schemas:{description:"Array of data record schemas used in the document",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/datarecord-metadata/datarecord-metadata-v3-schema.json#/definitions/record_schema"},uniqueItems:!0},runtimes:{description:"Array of runtime objects referred to in the document",type:"array",minItems:0,items:{$ref:"#/definitions/runtime_def"},uniqueItems:!0},external_paramsets:{description:"Array of parameter set references",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/parameters/parametersets-v3-schema.json#/definitions/paramset_ref"},uniqueItems:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/pipeline_overview_def"}},additionalProperties:!0}},required:["doc_type","version","primary_pipeline","pipelines"],additionalProperties:!1,definitions:{pipeline_def:{description:"Definition of a single pipeline flow",type:"object",properties:{id:{description:"Unique identifier",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/pipeline_def instead.",type:"string",deprecated:!0},name:{description:"User-readable name",type:"string"},runtime_ref:{description:"Reference to the id of the runtime associated with the operations in the current pipeline",type:"string"},nodes:{description:"Array of pipeline nodes",type:"array",minItems:0,items:{$ref:"#/definitions/node_type_def"},uniqueItems:!0},parameters:{description:"Parameters for the pipeline",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/pipeline_def"}},additionalProperties:!0}},required:["id","runtime_ref","nodes"],additionalProperties:!1},node_type_def:{oneOf:[{$ref:"#/definitions/execution_node_def"},{$ref:"#/definitions/supernode_def"},{$ref:"#/definitions/binding_entry_node_def"},{$ref:"#/definitions/binding_exit_node_def"},{$ref:"#/definitions/model_node_def"}]},execution_node_def:{description:"Definition of a single execution pipeline node",type:"object",properties:{id:{description:"Unique identifier for node within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'execution_node' for non-model pipeline elements",enum:["execution_node"]},op:{description:"Operator type identifier",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Optional reference to the id of the runtime associated with the current node",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0}},required:["id","type","op"],additionalProperties:!1},supernode_def:{description:"Definition of a supernode which serves as the entry point for a sub-pipeline",type:"object",properties:{id:{description:"Unique identifier for the supernode within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'super_node' for supernode elements",enum:["super_node"]},open_with_tool:{description:"Name of the tool which can be used to view or edit the sub-flow for this supernode. The default is 'canvas'",type:"string"},subflow_ref:{description:"Refers to the sub-flow associated with this supernode",type:"object",properties:{url:{description:"Reference to an external sub-flow. When not present the sub-flow is assumed to be in the current document. A value of 'app_defined' indicates a sub-flow identifier is present, but the controlling application will serve up the sub-pipeline in the form of a new pipeline-flow document (no sub-flow is present in the document).",type:"string"},pipeline_id_ref:{description:"Sub-flow identifier reference",type:"string"}},required:["pipeline_id_ref"]},inputs:{$ref:"#/definitions/bound_ports_def"},outputs:{$ref:"#/definitions/bound_ports_def"},parameters:{description:"Input parameters for the supernode",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0}},required:["id","type","subflow_ref"],additionalProperties:!1},binding_entry_node_def:{description:"Defines an entry point (source) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},outputs:{$ref:"#/definitions/ports_def"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the binding entry node",type:"object",properties:{},additionalProperties:!0}},required:["id","type","outputs"],additionalProperties:!1},binding_exit_node_def:{description:"Defines an exit point (sink) for a pipeline. Bindings can be concrete: the concrete_binding element is present on the port; or bindings can be abstract: bindings are performed externally via configuration or a wrapper document.",type:"object",properties:{id:{description:"Unique identifier for the binding within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'binding' for binding elements",enum:["binding"]},inputs:{$ref:"#/definitions/ports_def"},outputs:{description:"An optional set of output ports, typically used for directing error information out of the binding node.",$ref:"#/definitions/ports_def"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0},connection:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_connection_def"},data_asset:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json#/definitions/common_pipeline_data_asset_def"},op:{description:"Binding node type identifier",type:"string"},parameters:{description:"Parameters for the binding exit node",type:"object",properties:{},additionalProperties:!0}},required:["id","type","inputs"],additionalProperties:!1},model_node_def:{description:"Definition of a single predictive model node",type:"object",properties:{id:{description:"Unique identifier for the model within the current pipeline",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_info_def instead.",type:"string",deprecated:!0},type:{description:"Node type - always 'model_node' for model pipeline elements",enum:["model_node"]},model_ref:{description:"Reference to the binary model",type:"string"},inputs:{$ref:"#/definitions/ports_def"},outputs:{$ref:"#/definitions/ports_def"},op:{description:"Node type identifier of modeling node that created this model.",type:"string"},parameters:{description:"Input parameters for the operator",type:"object",properties:{},additionalProperties:!0},runtime_ref:{description:"Reference to the runtime associated with the current node",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_info_def"}},additionalProperties:!0}},required:["id","type","inputs"],additionalProperties:!1},port_def:{description:"Port definition (input/output) on a node",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema reference associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:0,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},parameters:{description:"Parameters for the port",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/port_info_def"}},additionalProperties:!0}},required:["id"],additionalProperties:!1},ports_def:{type:"array",minItems:0,items:{$ref:"#/definitions/port_def"},uniqueItems:!0},bound_ports_def:{type:"array",minItems:0,items:{$ref:"#/definitions/bound_port_def"},uniqueItems:!0},bound_port_def:{description:"Port definition (input/output) on a node with optional pipeline port binding for supernodes",type:"object",properties:{id:{description:"Unique identifier",type:"string"},schema_ref:{description:"Optional data record schema associated with the port",type:"string"},links:{description:"Array of links going into the node. Applies to input ports and exit bindings only.",type:"array",minItems:1,items:{$ref:"#/definitions/link_def"},uniqueItems:!0},subflow_node_ref:{description:"Optional node id binding within the current document.",type:"string"},parameters:{description:"Parameters for the binding port",type:"object",properties:{},additionalProperties:!0},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/port_info_def"}},additionalProperties:!0}},required:["id"],additionalProperties:!1},link_def:{description:"Node link definition",type:"object",properties:{id:{description:"Unique id of this link within the pipelineFlow. If omitted a new link id will be generated.",type:"string"},node_id_ref:{description:"id of a node this link connects to",type:"string"},port_id_ref:{description:"optional port id of a node this link connects to",type:"string"},link_name:{description:"optional link name (used in parameter sets when there are multiple input sources)",type:"string"},type_attr:{description:"Link type attribute",type:"string"},description:{description:"Deprecated - use description in pipeline-flow-ui-v3-schema.json#/definitions/node_link_info_def instead.",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/node_link_info_def"}},additionalProperties:!0}},required:["node_id_ref"],additionalProperties:!1},runtime_def:{description:"Runtime associated with the operations in the current pipeline",type:"object",properties:{id:{description:"Unique internal runtime identifier",type:"string"},name:{description:"The runtime name",type:"string"},version:{description:"The runtime version. When not present the latest version is assumed",type:"string"},app_data:{description:"Object containing app-specific data",type:"object",properties:{ui_data:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json#/definitions/runtime_info_def"}},additionalProperties:!0}},required:["id","name"]}}},Wt={$schema:"https://json-schema.org/draft-04/schema#",description:"WDP Pipeline Flow UI Schema. Defines UI-only constructs for pipeline flow documents.",type:"object",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-ui-v3-schema.json",properties:{},additionalProperties:!0,definitions:{pipeline_overview_def:{description:"Top level UI information",type:"object",properties:{name:{description:"User-defined name",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"}},additionalProperties:!0},pipeline_def:{description:"Pipeline level UI information",type:"object",properties:{description:{description:"User-defined description",type:"string"},zoom:{oneOf:[{description:"Deprecated - use zoom object instead. Scale factor as a percentage. 100% is standard scale amount. Smaller values zoom out. Larger values zoom in.",type:"integer",deprecated:!0},{description:"A zoom object containing translation and scale amounts.",type:"object",properties:{x:{description:"Horizontal translation amount. Positive value moves right, negative to the left.",type:"number"},y:{description:"Vertical translation amount. Positive value moves down, negative moves up.",type:"number"},k:{description:"Scale amount. 1.0 is the standard scale amount. Smaller values zoom out. Larger values zoom in.",type:"number"}},required:["x","y","k"],additionalProperties:!1}]},comments:{description:"Array of Comments, optionally associated with nodes",type:"array",minItems:0,items:{$ref:"#/definitions/comment_def"},uniqueItems:!0}},additionalProperties:!0},port_info_def:{description:"Additional UI info for ports",type:"object",properties:{cardinality:{description:"Property to capture how many data assets are allowed for this port, e.g., min: 1, max:1 implies you must supply 1 and only 1; min:0, max:1 implies it is optional and a max of one, min:0, max:-1 means it is optional and you can may have any number of data assets. The default value is 1:1 for inputs and 1:-1 for outputs.",type:"object",properties:{min:{description:"Minimum data sets that are required for this port",type:"integer",default:1},max:{description:"Maximum data sets that are allowed on this port. A negative value indicates unlimited. The default value is 1 for inputs and -1 for outputs.",type:"integer"}},additionalProperties:!1},class_name:{description:"CSS class name",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the port.",type:["string","object"]},label:{description:"Port name",type:"string"}},additionalProperties:!0},node_info_def:{description:"object with app-specific UI-information",type:"object",properties:{label:{description:"User-defined label",type:"string"},description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the node.",type:["string","object"]},image:{description:"Image name (do not embed images inline!)",type:"string"},x_pos:{description:"x-position",type:"number"},y_pos:{description:"y-position",type:"number"},is_expanded:{description:"Indicates whether a supernode is shown in expanded state or as a regular node.",type:"boolean"},expanded_height:{description:"Height of expanded supernode. If not provided an appropriate height is calculated.",type:"number"},expanded_width:{description:"Width of expanded supernode. If not provided an appropriate width is calculated.",type:"number"},is_resized:{description:"Indicates whether a node has been resized or not. If true, resize_width and resize_height are used for node display. If false, the default width and height are used.",type:"boolean"},resize_height:{description:"Height of resized node. The node will be displayed with this height, when is_resized is true, in preference to its default height.",type:"number"},resize_width:{description:"Width of resized node. The node will be displayed with this width, when is_resized is true, in preference to its default width.",type:"number"},sub_pipelines:{description:"An array of pipelines referenced when this node is a supernode. This field is only used when the supernode is in a palette or on the clipboard. It will be an empty array when the supernode references an external pipeline.",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json#/definitions/pipeline_def"},uniqueItems:!0},attributes:{description:"additional attributes",type:"string"},associations:{description:"Array of non-data node linkage",type:"array",minItems:0,items:{$ref:"#/definitions/association_def"}},messages:{description:"An array of messages for the node",type:"array",minItems:0,items:{$ref:"#/definitions/message_def"},uniqueItems:!0},ui_parameters:{description:"UI only parameter values for the node",type:"object",properties:{},additionalProperties:!0},decorations:{description:"Array of decorations used to decorate nodes",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},node_link_info_def:{description:"object with app-specific UI-information",type:"object",properties:{description:{description:"User-defined description",type:"string"},class_name:{description:"CSS class name",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the node to node link.",type:["string","object"]},decorations:{description:"Array of decorations used to decorate node links",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},additionalProperties:!0},runtime_info_def:{description:"Runtime information",type:"object",properties:{},additionalProperties:!0},association_def:{description:"Non-data link",type:"object",properties:{id:{description:"Association identifier",type:"string"},node_ref:{description:"Target node id",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the association link.",type:["string","object"]},decorations:{description:"Array of decorations used to decorate association links",type:"array",minItems:0,items:{$ref:"#/definitions/decoration_def"},uniqueItems:!0}},required:["id","node_ref"],additionalProperties:!1},decoration_def:{description:"Decoration used to decorate a node",type:"object",properties:{id:{description:"An identifier used to identify the decoration",type:"string"},hotspot:{description:"Indicates whether the decorator is a hotspot or not. ie does it send an event to consuming app. when clicked",type:"boolean"},class_name:{description:"CSS class name for decoration styling",type:"string"},position:{description:"Indicates an anchor point on the node or link from which the decoration will be displayed. If x_pos and y_pos are not provided the decoration is displayed with a default offset from this position.",enum:["topLeft","topCenter","topRight","middleLeft","middleCenter","middleRight","bottomLeft","bottomCenter","bottomRight","source","middle","target"]},x_pos:{description:"X position of the decorator relative to the node's position field. If position is not provided it is relative to the 'topLeft' position",type:"integer"},y_pos:{description:"Y position of the decorator relative to the node's position field. If position is not provided it is relative to the 'topLeft' position",type:"integer"},image:{description:"Image displayed at the decoration position. Provide either this or a label.",type:"string"},label:{description:"Label displayed at the decoration position. Provide either this or an image.",type:"string"}}},message_def:{description:"Node message definition",type:"object",properties:{id_ref:{description:"Name of the parameter that has the message",type:"string"},validation_id:{description:"Validation identifier from the fail_message validation section.",type:"string"},type:{description:"Type of message",enum:["info","error","warning"]},text:{description:"Message string",type:"string"}},required:["id_ref","type","text"]},comment_def:{type:"object",properties:{id:{description:"Comment identifier. Must be unique.",type:"string"},x_pos:{description:"Horizontal comment position",type:"number"},y_pos:{description:"Vertical comment position",type:"number"},width:{description:"Comment width",type:"number",minimum:10},height:{description:"Comment height",type:"number",minimum:10},class_name:{description:"CSS class(es) to apply to the comment",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the comment.",type:["string","object"]},attributes:{description:"Optional attributes to be added to this element. For example: \"attributes\": \"attr1='value1'; attr2='value2'\"",type:"string"},content:{description:"Comment content",type:"string"},associated_id_refs:{description:"Optional array of associated node id references",type:"array",minItems:0,items:{$ref:"#/definitions/comment_link_def"},uniqueItems:!0}},required:["id","x_pos","y_pos","width","height"],additionalProperties:!0},comment_link_def:{description:"Comment link definition",type:"object",properties:{node_ref:{description:"Node reference",type:"string"},class_name:{description:"CSS class name for link styling",type:"string"},style:{description:"A 'style spec' object containing CSS strings to be applied to the SVG objects of the comment link.",type:["string","object"]}},required:["node_ref"],additionalProperties:!0}}},Kt={$schema:"https://json-schema.org/draft-04/schema#",id:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-connection/pipeline-connection-v3-schema.json",title:"Watson Data Platform Pipeline Connection Schema",description:"Connection schema for pipelines in the Watson Data Platform",definitions:{common_pipeline_connection_def:{description:"Details of the connection to use for a pipeline binding node.",properties:{name:{description:"A name tag for disambiguating connections",type:"string"},app_data:{$ref:"#/definitions/app_data_def"},ref:{description:"A reference to a connection by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the connection. If neither this attribute nor project_ref are specified, the connection will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the connection. If neither this attribute nor catalog_ref are specified, the connection will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},space_ref:{description:"If ref is set, this refers to the ID of the space which contains the connection. If neither this attribute nor space_ref are specified, the connection will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},properties:{description:"The properties for the connection. The specific properties allowed depend on the type of connection referenced.",type:"object"}},required:["ref"],type:"object"},common_pipeline_data_asset_def:{description:"Details of the data asset contained in a catalog or project to use for a pipeline binding node.",properties:{app_data:{$ref:"#/definitions/app_data_def"},ref:{description:"A reference to a data asset by ID.",type:"string"},catalog_ref:{description:"If ref is set, this refers to the ID of the catalog which contains the data asset. If neither this attribute nor project_ref are specified, the data asset will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},project_ref:{description:"If ref is set, this refers to the ID of the project which contains the data asset. If neither this attribute nor catalog_ref are specified, the data asset will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},space_ref:{description:"If ref is set, this refers to the ID of the space which contains the data asset. If neither this attribute nor space_ref are specified, the data asset will be assumed to exist in the project, space, or catalog which contains the pipeline.",type:"string"},properties:{description:"Properties controlling how the data asset is used.",type:"object",additionalProperties:{type:"object"},properties:{attachment_ref:{description:"The ID of the data asset attachment to use. If not specified and used as a source, the first suitable attachment found will be used. If not specified and used as a target, a new attachment will be created.",type:"string"},name:{description:"Specifies the name of the data asset to read, create or update if ref is unset.",type:"string",default:!1},no_write_schema:{description:"When used as a target, whether to update the data asset with the schema when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1},no_write_status:{description:"When used as a target, whether to update the data asset with the status when a run completes or not (will be automatically updated if not supplied by caller).",type:"boolean",default:!1}}}},type:"object"},app_data_def:{description:"Object containing app-specific data",type:"object",properties:{},additionalProperties:!0}}},Yt={$schema:"https://json-schema.org/draft-04/schema#",type:"object",description:"Common Canvas palette schema",id:"https://api.dataplatform.ibm.com/schemas/common-canvas/palette/palette-v3-schema.json",properties:{version:{description:"Palette schema version",enum:["3.0"]},categories:{description:"Array of palette categories",type:"array",minItems:0,items:{$ref:"#/definitions/category_def"},uniqueItems:!0}},additionalProperties:!1,definitions:{category_def:{description:"Palette Category",type:"object",properties:{id:{description:"ID of the category",type:"string"},label:{description:"Category label",type:"string"},description:{description:"Category description",type:"string"},is_open:{description:"Boolean to indicate if the category is open (true) or not (false).",type:"boolean"},empty_text:{description:"When set to a non-empty string and node_types is empty, is used to indicate that no nodes exist",type:"string"},loading_text:{description:"When set to a non-empty string, causes a loading indicator to appear with this text as a label",type:"string"},image:{description:"Encoded image or image reference for the category",type:"string"},node_types:{description:"Array of pipeline node types",type:"array",minItems:0,items:{$ref:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json#/definitions/node_type_def"},uniqueItems:!0}},required:["id","label"],additionalProperties:!1}}},Xt=new a.Logger("SchemaValidator");function Jt(e,t){switch(t){case 1:var n=function(){var e=new c.Validator,t="http://api.dataplatform.ibm.com/schemas/common-pipeline/";return e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/pipeline_overview_def"),e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/pipeline_def"),e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/port_info_def"),e.addSchema(Rt,t+"pipeline-flow/pipeline-flow-ui-schema.json#/definitions/node_info_def"),e.addSchema(Ut,t+"pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_connection_def"),e.addSchema(Ut,t+"pipeline-connection/pipeline-connection-v1-schema.json#/definitions/common_pipeline_data_asset_def"),e.addSchema(Ft,t+"datarecord-metadata/datarecord-metadata-v1-schema.json#/definitions/record_schema"),e}();Qt(e,Mt,"pipelineFlow",n);break;case 2:var i=function(){var e=new c.Validator,t="http://api.dataplatform.ibm.com/schemas/common-pipeline/";return e.addSchema(Ht,t+"pipeline-flow/pipeline-flow-v2-schema.json"),e.addSchema(Gt,t+"pipeline-flow/pipeline-flow-ui-v2-schema.json"),e.addSchema(qt,t+"pipeline-connection/pipeline-connection-v2-schema.json"),e.addSchema(Vt,t+"datarecord-metadata/datarecord-metadata-v2-schema.json"),e}();Qt(e,Ht,"pipelineFlow",i);break;default:var o=en();Qt(e,$t,"pipelineFlow",o)}}function Zt(e,t){switch(t){case 1:Qt(e,Bt,"palette",new c.Validator);break;case 2:Qt(e,zt,"palette",new c.Validator);break;default:var n=en();Qt(e,Yt,"palette",n)}}function Qt(e,t,n,i){Xt.logStartTimer("Schema validation");var o=i.validate(e,t,{nestedErrors:!0});if(Xt.logEndTimer("Schema validation"),Xt.log("Schema "+n+" - validation result:"),Xt.log(o),o&&o.errors&&o.errors.length>0)throw Xt.error(o),o}function en(){var e=new c.Validator,t="http://api.dataplatform.ibm.com/schemas/common-pipeline/";return e.addSchema($t,t+"pipeline-flow/pipeline-flow-v3-schema.json"),e.addSchema(Wt,t+"pipeline-flow/pipeline-flow-ui-v3-schema.json"),e.addSchema(Kt,t+"pipeline-connection/pipeline-connection-v3-schema.json"),e.addSchema(i.dataRecordMetadataV3Schema,t+"datarecord-metadata/datarecord-metadata-v3-schema.json"),e}function tn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var on=[function(e){return e},function(e){var t=Object.assign({},{version:"2.0"},e);return t},function(e){e.version="3.0";var t,n=tn(e.categories);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.id=i.category,delete i.category,i.node_types=[];for(var o=0;o<i.nodetypes.length;o++){var r=i.nodetypes[o],a={id:""};a.type=r.type,"execution_node"===r.type||"binding"===r.type?a.op=r.operator_id_ref:"super_node"===r.type&&(r.open_with_tool&&(a.open_with_tool=r.open_with_tool),a.subflow_ref={pipeline_id_ref:r.subDiagramId}),r.input_ports&&r.input_ports.length>0&&(a.inputs=an(r.input_ports)),r.output_ports&&r.output_ports.length>0&&(a.outputs=an(r.output_ports)),a.parameters={},a.app_data={},a.app_data.ui_data={},a.app_data.ui_data.label=r.label,a.app_data.ui_data.description=r.description,a.app_data.ui_data.image=r.image,a.app_data.ui_data.x_pos=0,a.app_data.ui_data.y_pos=0,i.node_types.push(a)}delete i.nodetypes}}catch(e){n.e(e)}finally{n.f()}return e}];function rn(e){var t;if(!e)throw new Error("Invalid palette document");if(e.version){if("string"!=typeof e.version||0===e.version.length)throw new Error("Invalid palette document: The 'version' attribute is missing or invalid");if(!(t=parseInt(e.version,10)))throw new Error("Invalid palette document: The 'version' attribute cannot be parsed")}else t=1;return t}function an(e){var t,n=[],i=tn(e);try{for(i.s();!(t=i.n()).done;){var o=t.value,r={};r.id=o.id,r.app_data={},r.app_data.ui_data={},o.cardinality&&(r.app_data.ui_data.cardinality=o.cardinality),r.app_data.ui_data.label=o.label,n.push(r)}}catch(e){i.e(e)}finally{i.f()}return n}function sn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return dn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dn(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var cn=function(){function n(){e._classCallCheck(this,n),this.logger=new a.Logger("Object Model");var t=this.getEmptyCanvasInfo();this.store=new Dt(t),this.oldCanvas=null,this.idGeneratorHandler=null,this.selectionChangeHandler=null,this.layoutHandler=null}return e._createClass(n,[{key:"dispatch",value:function(e){this.store.dispatch(e)}},{key:"subscribe",value:function(e){return this.store.subscribe(e)}},{key:"setSchemaValidation",value:function(e){this.setCanvasConfig({schemaValidation:e})}},{key:"setSelectionChangeHandler",value:function(e){this.selectionChangeHandler=e}},{key:"setLayoutHandler",value:function(e){if(e!==this.layoutHandler){this.layoutHandler=e;var t=this.prepareNodes(this.getCanvasInfo().pipelines,this.getNodeLayout(),this.getCanvasLayout());this.store.dispatch({type:"REPLACE_PIPELINES",data:{pipelines:t}})}}},{key:"getStore",value:function(){return this.store.getStore()}},{key:"getUUID",value:function(){return s.v4()}},{key:"setIdGeneratorHandler",value:function(e){this.idGeneratorHandler=e}},{key:"getUniqueId",value:function(e,t){var n;return this.idGeneratorHandler&&(n=this.idGeneratorHandler(e,t)),n||this.getUUID()}},{key:"clearPaletteData",value:function(){this.store.dispatch({type:"CLEAR_PALETTE_DATA"})}},{key:"setPaletteData",value:function(e){var t=Qe.convertPaletteToPipelineFlowPalette(e);this.setPipelineFlowPalette(t)}},{key:"setPipelineFlowPalette",value:function(e){if(e&&!t.isEmpty_1(e)){var n=e;Qe.isVersion0Palette(n)&&(n=Qe.convertPaletteToPipelineFlowPalette(n));var i=this.validateAndUpgradePalette(n);this.store.dispatch({type:"SET_PALETTE_DATA",data:{content:i}})}else this.clearPaletteData()}},{key:"getPaletteData",value:function(){return this.store.getPaletteData()}},{key:"togglePalette",value:function(){this.isPaletteOpen()?this.closePalette():this.openPalette()}},{key:"openPalette",value:function(){this.store.dispatch({type:"SET_PALETTE_OPEN_STATE",data:{isOpen:!0}})}},{key:"openPaletteIfNecessary",value:function(e){e&&void 0===this.store.getPalette().isOpen&&void 0!==e.paletteInitialState&&(e.paletteInitialState?this.openPalette():this.closePalette())}},{key:"closePalette",value:function(){this.store.dispatch({type:"SET_PALETTE_OPEN_STATE",data:{isOpen:!1}})}},{key:"isPaletteOpen",value:function(){var e=this.store.getPalette().isOpen;return void 0!==e&&e}},{key:"setCategoryLoadingText",value:function(e,t){this.store.dispatch({type:"SET_CATEGORY_LOADING_TEXT",data:{categoryId:e,loadingText:t}})}},{key:"setCategoryEmptyText",value:function(e,t){this.store.dispatch({type:"SET_CATEGORY_EMPTY_TEXT",data:{categoryId:e,emptyText:t}})}},{key:"addNodeTypeToPalette",value:function(e,t,n,i,o){this.addNodeTypesToPalette([e],t,n,i,o)}},{key:"addNodeTypesToPalette",value:function(e,t,n,i,o){var r={nodeTypes:e,categoryId:t,categoryLabel:n,categoryDescription:i,categoryImage:o};this.store.dispatch({type:"ADD_NODE_TYPES_TO_PALETTE",data:r}),this.store.getCanvasConfig().schemaValidation&&Zt(this.getPaletteData(),3)}},{key:"removeNodesFromPalette",value:function(e,t){this.store.dispatch({type:"REMOVE_NODE_TYPES_FROM_PALETTE",data:{selObjectIds:e,categoryId:t}})}},{key:"convertNodeTemplate",value:function(e){var t=null;return e?((t=tt.convertNode(e,this.getCanvasLayout())).type===o.SUPER_NODE&&(t=this.convertPipelineData(t)),t):null}},{key:"convertPipelineData",value:function(e){var n,o=t.get_1(e,"sub_pipelines");if(o)n=e.subflow_ref.url?[]:tt.convertPipelinesToCanvasInfoPipelines(o,this.getCanvasLayout()),n=this.cloneSupernodeContents(e,n),n=this.prepareNodes(n,this.getNodeLayout(),this.getCanvasLayout(),e);else{var r=this.createEmptyPipeline();n=[r],i.set_1(e,"subflow_ref.pipeline_id_ref",r.id)}return e.sub_pipelines=n,e}},{key:"extractAddDataPipelines",value:function(e){var n=[],o=[];return e.forEach((function(e){if(h.isSupernode(e)){var r=t.get_1(e,"sub_pipelines");r&&(n.push.apply(n,i._toConsumableArray(r)),e.sub_pipelines&&delete e.sub_pipelines)}o.push(e)})),{nodes:o,pipelines:n}}},{key:"getPaletteNode",value:function(e){var n=null;return e&&!t.isEmpty_1(this.getPaletteData())&&this.getPaletteData().categories.forEach((function(t){t.node_types.forEach((function(t){t.op===e&&(n=t)}))})),n}},{key:"getPaletteNodeById",value:function(e){var n=null;return t.isEmpty_1(this.getPaletteData())||this.getPaletteData().categories.forEach((function(t){t.node_types.forEach((function(t){t.id===e&&(n=t)}))})),n}},{key:"getCategoryForNode",value:function(e){var t=null;return this.getPaletteData().categories.forEach((function(n){n.node_types.forEach((function(i){i.op===e&&(t=n)}))})),t}},{key:"validateAndUpgradePalette",value:function(e){var t=o.cloneDeep_1(e),n=rn(t);return this.store.getCanvasConfig().schemaValidation&&Zt(t,n),3!==n&&(t=function(e){for(var t=Math.max(rn(e),1),n=o.cloneDeep_1(e),i=t;i<3;i++)n=on[i](n);return n}(t),this.store.getCanvasConfig().schemaValidation&&Zt(t,3)),t}},{key:"setIsOpenCategory",value:function(e,t){this.store.dispatch({type:"SET_IS_OPEN_CATEGORY",data:{categoryId:e,isOpen:t}})}},{key:"setIsOpenAllCategories",value:function(e){this.store.dispatch({type:"SET_IS_OPEN_ALL_CATEGORIES",data:{isOpen:e}})}},{key:"isPaletteCategoryOpen",value:function(e){var t=this.store.getPaletteCategory(e);return t?t.is_open:null}},{key:"getAPIPipeline",value:function(e){return new dt(e||this.getCurrentBreadcrumb().pipelineId,this)}},{key:"getSelectionAPIPipeline",value:function(){var e=this.getSelectedPipelineId();return e?this.getAPIPipeline(e):null}},{key:"clearPipelineFlow",value:function(){this.setCanvasInfo(this.getEmptyCanvasInfo())}},{key:"setCanvas",value:function(e){this.oldCanvas=e;var t=Qe.convertCanvasToCanvasInfo(e);this.setCanvasInfo(t)}},{key:"getCanvas",value:function(){return this.oldCanvas?et.getCanvasBasedOnCanvasInfo(this.oldCanvas,this.getCanvasInfo()):{}}},{key:"getEmptyCanvasInfo",value:function(){var e=this.getUUID(),t=this.getUUID();return{doc_type:"pipeline",version:"3.0",json_schema:"http://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",id:e,primary_pipeline:t,pipelines:[{id:t,runtime_ref:"",nodes:[],comments:[],links:[]}],schemas:[]}}},{key:"setPipelineFlow",value:function(e){if(e.objectData)this.setCanvas(e);else{var t=this.preparePipelineFlow(e);this.executeWithSelectionChange(this.store.dispatch,{type:"SET_CANVAS_INFO",canvasInfo:t,canvasInfoIdChanged:this.hasCanvasInfoIdChanged(t)})}}},{key:"ensurePipelineIsLoaded",value:function(e){var t=this.getSupernodePipelineUrl(e.targetObject),n=this.getSupernodePipelineId(e.targetObject);if(!this.isPipelineLoaded(n,t)){if(!e.externalPipelineFlow){var i="The external pipeline flow at '"+e.externalUrl+"' was not provided. Make sure you have implemented beforeEditActionHandler to support external pipeline flows.";throw this.logger.error(i),i}if(!this.flowContainsPipeline(e.externalPipelineFlow,n)){var o="The external pipeline flow '"+e.externalPipelineFlow.id+"' does not contain a pipeline with ID: "+n;throw this.logger.error(o),o}return this.addExternalPipelineFlow(e.externalPipelineFlow,t,e.targetObject,!0),!0}return!1}},{key:"getVisibleExpandedExternalSupernodes",value:function(){var e=this.getCurrentPipeline();return this.getVisibleExpandedExternalSupernodesForPipeline(e,this.getPipelines())}},{key:"getVisibleExpandedExternalSupernodesForPipeline",value:function(e,t){var n=this,i=[];return e.nodes.forEach((function(e){if(e.type===o.SUPER_NODE&&e.is_expanded){var r=t.find((function(t){return t.id===n.getSupernodePipelineId(e)}));if(e.subflow_ref.url&&!r&&i.push(e),r){var a=n.getVisibleExpandedExternalSupernodesForPipeline(r,t);i=i.concat(a)}}})),i}},{key:"flowContainsPipeline",value:function(e,t){return!!e.pipelines&&e.pipelines.some((function(e){return e.id===t}))}},{key:"addExternalPipelineFlow",value:function(e,t,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=this.preparePipelineFlow(e,n);o.pipelines.forEach((function(e){return e.parentUrl=t}));var r=Object.assign({},o);r.pipelines=[],r.url=t,this.store.dispatch({type:"ADD_EXTERNAL_PIPELINE_FLOW",newPipelineFlow:r,newPipelines:i?o.pipelines:[]})}},{key:"removeExternalPipelineFlow",value:function(e){this.store.dispatch({type:"REMOVE_EXTERNAL_PIPELINE_FLOW",externalUrl:e})}},{key:"createExternalPipelineFlowTemplate",value:function(e,t){return{doc_type:"pipeline",version:"3.0",json_schema:"https://api.dataplatform.ibm.com/schemas/common-pipeline/pipeline-flow/pipeline-flow-v3-schema.json",id:e,primary_pipeline:t,pipelines:[{id:"",runtime_ref:"",nodes:[]}],schemas:[],runtimes:[]}}},{key:"getExternalPipelineFlows",value:function(){return this.store.getExternalPipelineFlows()}},{key:"getExternalPipelineFlowsForPipelines",value:function(e){var t=this.getUniqueUrls(e);return this.getExternalPipelineFlowsForUrls(t)}},{key:"getUniqueUrls",value:function(e){var t=[];return e.forEach((function(e){e.parentUrl&&!t.includes(e.parentUrl)&&t.push(e.parentUrl)})),t}},{key:"getExternalPipelineFlowsForUrls",value:function(e){var t=this,n=[];return e.forEach((function(e){var i=t.getExternalPipelineFlow(e);i.url=e,n.push(i)})),n}},{key:"getExternalPipelineFlow",value:function(e){var t=this.store.getExternalPipelineFlow(e);if(t){delete t.url;var n=this.getCanvasInfo();t.pipelines=n.pipelines.filter((function(t){return t.parentUrl===e})),t.pipelines.forEach((function(e){return delete e.parentUrl})),t=nt.createPipelineFlow(t),this.store.getCanvasConfig().schemaValidation&&Jt(t)}return t}},{key:"setParentUrl",value:function(e,t){this.store.dispatch({type:"SET_PIPELINE_PARENT_URL",data:{pipelines:e,url:t}})}},{key:"replaceSupernodeAndPipelines",value:function(e){this.store.dispatch({type:"REPLACE_SN_AND_PIPELINES",data:e})}},{key:"preparePipelineFlow",value:function(e,t){var n=this.validateAndUpgrade(e),i=tt.convertPipelineFlowToCanvasInfo(n,this.getCanvasLayout());return i.pipelines=this.prepareNodes(i.pipelines,this.getNodeLayout(),this.getCanvasLayout(),t),i}},{key:"prepareNodes",value:function(e,t,n,i){var o=this;return this.setSupernodesBindingStatus(e,i).map((function(e){return o.setPipelineObjectAttributes(e,t,n)}))}},{key:"setSupernodesBindingStatus",value:function(e,t){var n=this;return e.forEach((function(e){e.nodes&&e.nodes.forEach((function(e){delete e.isSupernodeInputBinding,delete e.isSupernodeOutputBinding}))})),t&&this.setSupernodesBindingStatusForNode(t,e),e.forEach((function(t){t.nodes&&h.filterSupernodes(t.nodes).forEach((function(t){n.setSupernodesBindingStatusForNode(t,e)}))})),e}},{key:"setSupernodesBindingStatusForNode",value:function(e,t){var n=this,i=this.getSupernodePipelineId(e);i&&(e.inputs&&e.inputs.forEach((function(e){if(e.subflow_node_ref){var o=n.findNode(e.subflow_node_ref,i,t);o&&(o.isSupernodeInputBinding=!0)}})),e.outputs&&e.outputs.forEach((function(e){if(e.subflow_node_ref){var o=n.findNode(e.subflow_node_ref,i,t);o&&(o.isSupernodeOutputBinding=!0)}})))}},{key:"setPipelineObjectAttributes",value:function(e,t,n){var i=this,o=Object.assign({},e);return o.nodes?o.nodes=o.nodes.map((function(e){return i.setNodeAttributesWithLayout(e,t,n)})):o.nodes=[],o.comments?o.comments=o.comments.map((function(e){return i.setCommentAttributesWithLayout(e,n)})):o.comments=[],o}},{key:"setNodeAttributes",value:function(e){return this.setNodeAttributesWithLayout(e,this.getNodeLayout(),this.getCanvasLayout())}},{key:"setCommentAttributes",value:function(e){return this.setCommentAttributesWithLayout(e,this.getCanvasLayout())}},{key:"setNodeAttributesWithLayout",value:function(e,t,n){var i=Object.assign({},e);return i=this.setNodeLayoutAttributes(i,t),i="TopBottom"===n.linkDirection||"BottomTop"===n.linkDirection?this.setNodeDimensionAttributesVertical(i,n):this.setNodeDimensionAttributesLeftRight(i,n),n.snapToGridType!==o.SNAP_TO_GRID_DURING&&n.snapToGridType!==o.SNAP_TO_GRID_AFTER||(i.x_pos=h.snapToGrid(i.x_pos,n.snapToGridXPx),i.y_pos=h.snapToGrid(i.y_pos,n.snapToGridYPx)),i}},{key:"setCommentAttributesWithLayout",value:function(e,t){var n=Object.assign({},e);return t.snapToGridType!==o.SNAP_TO_GRID_DURING&&t.snapToGridType!==o.SNAP_TO_GRID_AFTER||(n.x_pos=h.snapToGrid(n.x_pos,t.snapToGridXPx),n.y_pos=h.snapToGrid(n.y_pos,t.snapToGridYPx)),n}},{key:"setNodeLayoutAttributes",value:function(e,n){if(e.layout=n,this.layoutHandler){var i=this.layoutHandler(e);if(i&&!t.isEmpty_1(i)){var o=h.getCombinedDecorations(e.layout.decorations,i.decorations);e.layout=Object.assign({},e.layout,i,{decorations:o})}}return e}},{key:"setNodeDimensionAttributesLeftRight",value:function(e,t){return e.inputPortsHeight=e.inputs?e.inputs.length*(2*e.layout.portArcRadius)+(e.inputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.outputPortsHeight=e.outputs?e.outputs.length*(2*e.layout.portArcRadius)+(e.outputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.layout.autoSizeNode?e.height=Math.max(e.inputPortsHeight,e.outputPortsHeight,e.layout.defaultNodeHeight):e.height=e.layout.defaultNodeHeight,e.width=e.layout.defaultNodeWidth,e.type===o.SUPER_NODE&&e.is_expanded?(e.height+=t.supernodeTopAreaHeight+t.supernodeSVGAreaPadding,e.expanded_height&&(e.expanded_height=Math.max(e.expanded_height,e.height)),e.width=h.getSupernodeExpandedWidth(e,t),e.height=h.getSupernodeExpandedHeight(e,t)):e.isResized&&(e.height=e.resizeHeight?e.resizeHeight:e.height,e.width=e.resizeWidth?e.resizeWidth:e.width),e}},{key:"setNodeDimensionAttributesVertical",value:function(e,t){return e.inputPortsWidth=e.inputs?e.inputs.length*(2*e.layout.portArcRadius)+(e.inputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.outputPortsWidth=e.outputs?e.outputs.length*(2*e.layout.portArcRadius)+(e.outputs.length-1)*e.layout.portArcSpacing+2*e.layout.portArcOffset:0,e.height=e.layout.defaultNodeHeight,e.layout.autoSizeNode?e.width=Math.max(e.inputPortsWidth,e.outputPortsWidth,e.layout.defaultNodeWidth):e.width=e.layout.defaultNodeWidth,e.type===o.SUPER_NODE&&e.is_expanded?(e.width+=2*t.supernodeSVGAreaPadding,e.expanded_width&&(e.expanded_width=Math.max(e.expanded_width,e.width)),e.width=h.getSupernodeExpandedWidth(e,t),e.height=h.getSupernodeExpandedHeight(e,t)):e.isResized&&(e.height=e.resizeHeight?e.resizeHeight:e.height,e.width=e.resizeWidth?e.resizeWidth:e.width),e}},{key:"validateAndUpgrade",value:function(e){var t=o.cloneDeep_1(e),n=l.extractVersion(t);return this.store.getCanvasConfig().schemaValidation&&Jt(t,n),n!==l.LATEST_VERSION&&(t=l.upgradePipelineFlow(t),this.store.getCanvasConfig().schemaValidation&&Jt(t,l.LATEST_VERSION)),t}},{key:"getCanvasInfoPipeline",value:function(e){var t=this.getCanvasInfo();if(!t)return null;var n=e;n||(n=this.getPrimaryPipelineId());var i=t.pipelines.find((function(e){return e.id===n}));return void 0===i?null:i}},{key:"getDescendantPipelineIds",value:function(e){var t=this,n=[];return this.getAPIPipeline(e).getSupernodes().forEach((function(e){var i=t.getSupernodePipelineId(e);i&&(n.push(i),n=n.concat(t.getDescendantPipelineIds(i)))})),n}},{key:"getDescendantPipelinesForSupernodes",value:function(e){var t=this,n=[];return e.forEach((function(e){n=n.concat(t.getDescendantPipelinesForSupernode(e))})),n}},{key:"getDescendantPipelinesForSupernode",value:function(e){var t=this,n=[],i=this.getSupernodePipelineId(e);if(i){var o=this.getCanvasInfoPipeline(i);o&&(n.push(o),this.getAPIPipeline(i).getSupernodes().forEach((function(e){n=n.concat(t.getDescendantPipelinesForSupernode(e))})))}return n}},{key:"getSchemaPipelinesForSupernode",value:function(e){return this.getDescendantPipelinesForSupernode(e).filter((function(e){return!e.parentUrl})).map((function(e){return nt.createPipeline(e)}))}},{key:"getDescPipelinesToDelete",value:function(e,t){var n=this,i=this.getDescendantSupernodeInfos(e,t),o=this.getOtherSupernodeInfos(e,t),r=[];return i.forEach((function(e){if(n.shouldBeDeleted(e,o)){var t=n.getCanvasInfoPipeline(e.pipelineId);r.push(t)}})),r}},{key:"shouldBeDeleted",value:function(e,t){var n=!0;return t.forEach((function(t){t.pipelineId===e.pipelineId&&(n=!1)})),n}},{key:"getOtherSupernodeInfos",value:function(e,t){var n=this.getPrimaryPipelineId(),i=this.getCanvasInfoPipeline(n),o=h.filterSupernodes(i.nodes);return this.getDescendantSupernodeInfos(o,n,{supernodesToIgnore:e,parentPipelineId:t})}},{key:"getDescendantSupernodeInfos",value:function(e,t,n){var i=this,o=[];return e.forEach((function(e){i.getDescendantSupernodeInfosForSupernode(e,t,n).forEach((function(e){i.isSupernodeInfoInArray(e,o)||o.push(e)}))})),o}},{key:"getDescendantSupernodeInfosForSupernode",value:function(e,t,n){var i=this,o=[];if(this.continueNavigation(e,t,n)){var r=this.getSupernodePipelineId(e),a=this.getCanvasInfoPipeline(r);if(a)o.push({pipelineId:r,supernode:e,parentPipelineId:t}),h.filterSupernodes(a.nodes).forEach((function(e){o=o.concat(i.getDescendantSupernodeInfosForSupernode(e,r,n))}))}return o}},{key:"continueNavigation",value:function(e,t,n){return!n||n.parentPipelineId!==t||!n.supernodesToIgnore.some((function(t){return t.id===e.id}))}},{key:"isSupernodeInfoInArray",value:function(e,t){var n=this,i=!1;return t.forEach((function(t){n.isSupernodeInfoEqual(t,e)&&(i=!0)})),i}},{key:"isSupernodeInfoEqual",value:function(e,t){return e.supernode.id===t.supernode.id&&e.parentPipelineId===t.parentPipelineId}},{key:"getAncestorPipelineIds",value:function(e){var t=this.getPrimaryPipelineId();return t===e?[{pipelineId:t}]:[{pipelineId:t}].concat(this.getAncestorsBetween(t,e))}},{key:"getAncestorsBetween",value:function(e,t){var n=this,i=[];return this.getAPIPipeline(e).getSupernodes().forEach((function(o){var r=n.getSupernodePipelineId(o);r&&((n.isAncestorOfPipeline(r,t)||r===t)&&i.push({pipelineId:r,label:o.label,supernodeId:o.id,parentPipelineId:e}),i=i.concat(n.getAncestorsBetween(r,t)))})),i}},{key:"isAncestorOfPipeline",value:function(e,t){return this.getDescendantPipelineIds(e).includes(t)}},{key:"getSupernodePipelineId",value:function(e){return e.type===o.SUPER_NODE&&t.has_1(e,"subflow_ref.pipeline_id_ref")?e.subflow_ref.pipeline_id_ref:null}},{key:"getSupernodePipelineUrl",value:function(e){return e.type===o.SUPER_NODE&&t.has_1(e,"subflow_ref.url")?e.subflow_ref.url:null}},{key:"getSupernodeObjReferencing",value:function(e){var n,i=this;e===this.getPrimaryPipelineId()?n=this.getAPIPipeline(e).getSupernodes().find((function(t){return i.getSupernodePipelineId(t)===e})).id:n=this.getAncestorPipelineIds(e).find((function(n){return n.pipelineId===e&&t.has_1(n,"supernodeId")}));return n}},{key:"setCanvasInfo",value:function(e){var t=Object.assign({},e);t.pipelines=this.prepareNodes(t.pipelines,this.getNodeLayout(),this.getCanvasLayout()),this.store.dispatch({type:"SET_CANVAS_INFO",canvasInfo:t,canvasInfoIdChanged:this.hasCanvasInfoIdChanged(t)})}},{key:"getPipelineFlow",value:function(){var e=nt.createPipelineFlow(this.getCanvasInfo());return this.store.getCanvasConfig().schemaValidation&&Jt(e),e}},{key:"getPipelines",value:function(){return this.getCanvasInfo().pipelines}},{key:"getPipelineFlowId",value:function(){return this.store.getPipelineFlowId()}},{key:"getPrimaryPipelineId",value:function(){return this.store.getPrimaryPipelineId()}},{key:"getPrimaryPipeline",value:function(){return this.getCanvasInfoPipeline(this.getPrimaryPipelineId())}},{key:"getCurrentPipeline",value:function(){return this.getCanvasInfoPipeline(this.getCurrentPipelineId())}},{key:"getCurrentPipelineId",value:function(){return this.getCurrentBreadcrumb().pipelineId}},{key:"isPrimaryPipelineEmpty",value:function(){return this.getAPIPipeline(this.getPrimaryPipelineId()).isEmpty()}},{key:"deletePipeline",value:function(e){this.store.dispatch({type:"DELETE_PIPELINE",data:{id:e}})}},{key:"isPipelineLoaded",value:function(e,t){var n=this,i=this.getCanvasInfo();return!!i&&i.pipelines.some((function(i){return n.isPipeline(i,e,t)}))}},{key:"isPipeline",value:function(e,t,n){return e.id===t&&(!e.parentUrl&&!n||e.parentUrl===n)}},{key:"cloneSupernodeContents",value:function(e,t){var n=this,i=[],r=this.getSupernodePipelineId(e);if(r){var a=t.find((function(e){return e.id===r}));if(a){var s=this.clonePipelineWithNewId(a);e.subflow_ref.pipeline_id_ref=s.id,i.push(s),s.nodes.forEach((function(e){if(e.type===o.SUPER_NODE){var r=n.cloneSupernodeContents(e,t);i=i.concat(r)}}))}}return i}},{key:"clonePipelineWithNewId",value:function(e){var t=o.cloneDeep_1(e);return Object.assign({},t,{id:this.getUniqueId(o.CLONE_PIPELINE,{pipeline:t})})}},{key:"createCanvasInfoPipeline",value:function(e){var t=this.getUniqueId(o.CREATE_PIPELINE,{pipeline:e});return Object.assign({},e,{id:t})}},{key:"getCanvasInfo",value:function(){return this.store.getCanvasInfo()}},{key:"hasCanvasInfoIdChanged",value:function(e){return e.id!==this.getCanvasInfo().id}},{key:"setSubdueStyle",value:function(e){this.store.dispatch({type:"SET_SUBDUE_STYLE",data:{subdueStyle:e}})}},{key:"removeAllStyles",value:function(e){this.store.dispatch({type:"REMOVE_ALL_STYLES",data:{temporary:e}})}},{key:"hideComments",value:function(){this.store.dispatch({type:"HIDE_COMMENTS"})}},{key:"showComments",value:function(){this.store.dispatch({type:"SHOW_COMMENTS"})}},{key:"isHidingComments",value:function(){return this.store.getCanvasInfo().hideComments}},{key:"findNode",value:function(e,t,n){var i=n.find((function(e){return e.id===t}));return i&&i.nodes?i.nodes.find((function(t){return t.id===e})):null}},{key:"createBreadcrumb",value:function(e,t){return{pipelineId:e.subflow_ref.pipeline_id_ref,supernodeId:e.id,supernodeParentPipelineId:t,externalUrl:e.subflow_ref.url,label:e.label}}},{key:"addBreadcrumb",value:function(e){e&&e.pipelineId!==this.getPrimaryPipelineId()?this.store.dispatch({type:"ADD_BREADCRUMB",data:e}):this.resetBreadcrumb()}},{key:"addBreadcrumbs",value:function(e){this.store.dispatch({type:"ADD_BREADCRUMBS",data:e})}},{key:"setIndexedBreadcrumb",value:function(e){this.store.dispatch({type:"SET_TO_INDEXED_BREADCRUMB",data:e})}},{key:"setBreadcrumbs",value:function(e){this.store.dispatch({type:"SET_BREADCRUMBS",data:{breadcrumbs:e}})}},{key:"setPreviousBreadcrumb",value:function(){this.store.dispatch({type:"SET_TO_PREVIOUS_BREADCRUMB"})}},{key:"resetBreadcrumb",value:function(){this.store.dispatch({type:"RESET_BREADCRUMB",data:{pipelineId:this.getPrimaryPipelineId()}})}},{key:"getBreadcrumbs",value:function(){return this.store.getBreadcrumbs()}},{key:"getCurrentBreadcrumb",value:function(){var e=this.getBreadcrumbs();return e[e.length-1]}},{key:"getPreviousBreadcrumb",value:function(){var e=this.getBreadcrumbs();return e.length<2?null:e[e.length-2]}},{key:"isInSubFlowBreadcrumb",value:function(e){return this.getBreadcrumbs().findIndex((function(t){return t.pipelineId===e}))>0}},{key:"setCanvasConfig",value:function(e){var t=this.getCanvasConfig(),n=S.mergeCanvasConfigs(t,e);if(!S.compareCanvasConfigs(t,n)){var i=this.prepareNodes(this.getCanvasInfo().pipelines,n.enableNodeLayout,n.enableCanvasLayout);this.store.dispatch({type:"SET_CANVAS_CONFIG_INFO",data:{canvasConfig:n,pipelines:i}})}}},{key:"setToolbarConfig",value:function(e){this.store.dispatch({type:"SET_TOOLBAR_CONFIG",data:{toolbarConfig:e}})}},{key:"setNotificationPanelConfig",value:function(e){this.store.dispatch({type:"SET_NOTIFICATION_PANEL_CONFIG",data:{notificationPanelConfig:e}})}},{key:"getCanvasConfig",value:function(){return this.store.getCanvasConfig()}},{key:"getNodeLayout",value:function(){return this.store.getNodeLayout()}},{key:"getCanvasLayout",value:function(){return this.store.getCanvasLayout()}},{key:"clearNotificationMessages",value:function(){this.store.dispatch({type:"CLEAR_NOTIFICATION_MESSAGES"})}},{key:"setNotificationMessages",value:function(e){this.store.dispatch({type:"SET_NOTIFICATION_MESSAGES",data:{messages:e}})}},{key:"getNotificationMessages",value:function(e){var t=this.store.getNotifications();return e?t.filter((function(t){return t.type===e})):t}},{key:"deleteNotificationMessages",value:function(e){this.store.dispatch({type:"DELETE_NOTIFICATION_MESSAGES",data:{ids:e}})}},{key:"toggleNotificationPanel",value:function(){this.isNotificationPanelOpen()?this.closeNotificationPanel():this.openNotificationPanel()}},{key:"openNotificationPanel",value:function(){this.store.dispatch({type:"SET_NOTIFICATION_PANEL_OPEN_STATE",data:{isOpen:!0}})}},{key:"closeNotificationPanel",value:function(){this.store.dispatch({type:"SET_NOTIFICATION_PANEL_OPEN_STATE",data:{isOpen:!1}})}},{key:"isNotificationPanelOpen",value:function(){return this.store.isNotificationPanelOpen()}},{key:"openContextMenu",value:function(e,t){this.store.dispatch({type:"OPEN_CONTEXT_MENU",data:{menuDef:e,source:t}})}},{key:"closeContextMenu",value:function(){this.store.dispatch({type:"CLOSE_CONTEXT_MENU"})}},{key:"isContextMenuDisplayed",value:function(){return this.store.isContextMenuDisplayed()}},{key:"getContextMenuSource",value:function(){return this.store.getContextMenuSource()}},{key:"setRightFlyoutConfig",value:function(e){this.store.dispatch({type:"SET_RIGHT_FLYOUT_CONFIG",data:{config:e}})}},{key:"isRightFlyoutOpen",value:function(){return this.store.isRightFlyoutOpen()}},{key:"setBottomPanelConfig",value:function(e){this.store.dispatch({type:"SET_BOTTOM_PANEL_CONFIG",data:{config:e}})}},{key:"isBottomPanelOpen",value:function(){return this.store.isBottomPanelOpen()}},{key:"setBottomPanelHeight",value:function(e){this.store.dispatch({type:"SET_BOTTOM_PANEL_CONFIG",data:{config:{panelHeight:e}}})}},{key:"setTopPanelConfig",value:function(e){this.store.dispatch({type:"SET_TOP_PANEL_CONFIG",data:{config:e}})}},{key:"isTopPanelOpen",value:function(){return this.store.isTopPanelOpen()}},{key:"cloneObjectsToPaste",value:function(e,t,n){var i=this,r=[],a=[],s=[];return e&&e.forEach((function(e){var t=i.cloneNode(e);t.type===o.SUPER_NODE&&(t=i.convertPipelineData(t)),r.push({originalId:e.id,node:t})})),t&&t.forEach((function(e){a.push({originalId:e.id,comment:i.cloneComment(e)})})),n&&n.forEach((function(e){if("nodeLink"===e.type||"associationLink"===e.type){var t=i.findClonedNode(e.srcNodeId,r),n=i.findClonedNode(e.trgNodeId,r),o=i.cloneNodeLink(e,t,n);s.push(o)}else{var d=i.findClonedComment(e.srcNodeId,a),c=i.findClonedNode(e.trgNodeId,r);if(d&&c){var l=i.cloneCommentLink(e,d.id,c.id);s.push(l)}}})),{clonedNodes:r.map((function(e){return e.node})),clonedComments:a.map((function(e){return e.comment})),clonedLinks:s}}},{key:"findClonedNode",value:function(e,t){var n=t.find((function(t){return t.originalId===e}));return n?n.node:null}},{key:"findClonedComment",value:function(e,t){var n=t.find((function(t){return t.originalId===e}));return n?n.comment:null}},{key:"cloneNode",value:function(e){var t=Object.assign({},e,{id:this.getUniqueId(o.CLONE_NODE,{node:e})});return t=this.setNodeAttributes(t)}},{key:"cloneComment",value:function(e){var t=this.setCommentAttributes(e);return Object.assign({},t,{id:this.getUniqueId(o.CLONE_COMMENT,{comment:t})})}},{key:"cloneNodeLink",value:function(e,t,n){var i=this.getUniqueId(o.CLONE_NODE_LINK,{link:e,sourceNodeId:t?t.id:null,targetNodeId:n?n.id:null}),r=Object.assign({},e,{id:i});return t?(r.srcNodeId=t.id,r.srcNodePortId=e.srcNodePortId):r.srcPos=e.srcPos,n?(r.trgNodeId=n.id,r.trgNodePortId=e.trgNodePortId):r.trgPos=e.trgPos,r}},{key:"cloneCommentLink",value:function(e,t,n){return{id:this.getUniqueId(o.CLONE_COMMENT_LINK,{link:e,commentId:t,targetNodeId:n}),type:e.type,class_name:e.class_name,srcNodeId:t,trgNodeId:n}}},{key:"getSelectedObjectIds",value:function(){return this.store.getSelectedObjectIds()}},{key:"getSelectedNodesIds",value:function(){return this.getSelectedNodes().map((function(e){return e.id}))}},{key:"getSelectedNodes",value:function(){return this.store.getSelectedNodes()}},{key:"getSelectedComments",value:function(){return this.store.getSelectedComments()}},{key:"getSelectedLinks",value:function(){return this.store.getSelectedLinks()}},{key:"getSelectedObjects",value:function(){return this.getSelectedNodes().concat(this.getSelectedComments()).concat(this.getSelectedLinks())}},{key:"getSelectionInfo",value:function(){return this.store.getSelectionInfo()}},{key:"getSelectedPipeline",value:function(){return this.getAPIPipeline(this.getSelectedPipelineId())}},{key:"getSelectedPipelineId",value:function(){return this.store.getSelectedPipelineId()}},{key:"clearSelections",value:function(){this.executeWithSelectionChange(this.store.dispatch,{type:"CLEAR_SELECTIONS"})}},{key:"selectObject",value:function(e,t,n,i){this.isSelected(e,i)?n&&this.toggleSelection(e,n,i):t?this.selectSubGraph(e,i):this.toggleSelection(e,n,i)}},{key:"isSelected",value:function(e,t){return t===this.getSelectedPipelineId()&&this.getSelectedObjectIds().indexOf(e)>=0}},{key:"toggleSelection",value:function(e,t,n){var i=[e];if(n===this.getSelectedPipelineId()&&t)if(this.isSelected(e,n)){var o=(i=this.getSelectedObjectIds().slice()).indexOf(e);i.splice(o,1)}else i=this.getSelectedObjectIds().concat(e);this.setSelections(i,n)}},{key:"setSelections",value:function(e,t){var n=this.getAPIPipeline(t).pipelineId;this.executeWithSelectionChange(this.store.dispatch,{type:"SET_SELECTIONS",data:{selections:e},pipelineId:n})}},{key:"deleteSelectedObjects",value:function(){this.getSelectedPipeline().deleteObjects(this.getSelectedObjectIds())}},{key:"selectAll",value:function(e,t){var n,i=[],o=this.getAPIPipeline(t),r=sn(o.getNodes());try{for(r.s();!(n=r.n()).done;){var a=n.value;h.isSuperBindingNode(a)||i.push(a.id)}}catch(e){r.e(e)}finally{r.f()}var s,d=sn(o.getComments());try{for(d.s();!(s=d.n()).done;){var c=s.value;i.push(c.id)}}catch(e){d.e(e)}finally{d.f()}if(e){var l,u=sn(o.getLinks());try{for(u.s();!(l=u.n()).done;){var p=l.value;i.push(p.id)}}catch(e){u.e(e)}finally{u.f()}}this.setSelections(i,o.pipelineId)}},{key:"findNodesInSubGraph",value:function(e,t,n,i){var o=this.getAPIPipeline(i),r=!1;if(n.push(e),e===t)r=!0;else{var a,s=sn(o.getLinks());try{for(s.s();!(a=s.n()).done;){var d=a.value;if(d.srcNodeId===e){var c=this.findNodesInSubGraph(d.trgNodeId,t,n,i);!0!==c&&n.pop(),r=r||c}}}catch(e){s.e(e)}finally{s.f()}}return r}},{key:"selectSubGraph",value:function(e,t){var n=[],i=[e];if(t===this.getSelectedPipelineId()){var o,r=!1,a=sn(this.getSelectedObjectIds());try{for(a.s();!(o=a.n()).done;){var s=o.value;r=r||this.findNodesInSubGraph(s,e,n,t)}}catch(e){a.e(e)}finally{a.f()}r||n.push(e),i=this.getSelectedObjectIds().slice();var d,c=sn(n);try{for(c.s();!(d=c.n()).done;){var l=d.value;this.isSelected(l,t)||i.push(l)}}catch(e){c.e(e)}finally{c.f()}}this.setSelections(i,t)}},{key:"areSelectedNodesContiguous",value:function(){var e,t=this.getSelectedNodesIds(),n=[t[0]],i=this.getSelectedPipeline(),o=sn(t);try{for(o.s();!(e=o.n()).done;){var r=e.value;this.addConnectedNodeIdToGroup(r,n,t,i)}}catch(e){o.e(e)}finally{o.f()}return n.length===t.length}},{key:"areAllSelectedObjectsLinks",value:function(){return this.store.areAllSelectedObjectsLinks()}},{key:"addConnectedNodeIdToGroup",value:function(e,t,n,i){if(t.includes(e)){var r,a=i.getLinksContainingId(e).filter((function(e){return e.type===o.NODE_LINK||e.type===o.ASSOCIATION_LINK})),s=sn(a);try{for(s.s();!(r=s.n()).done;){var d=r.value;n.includes(d.trgNodeId)&&n.includes(d.srcNodeId)&&(t.includes(d.trgNodeId)||(t.push(d.trgNodeId),this.addConnectedNodeIdToGroup(d.trgNodeId,t,n,i)),t.includes(d.srcNodeId)||(t.push(d.srcNodeId),this.addConnectedNodeIdToGroup(d.srcNodeId,t,n,i)))}}catch(e){s.e(e)}finally{s.f()}}}},{key:"createEmptyPipeline",value:function(){var e={runtime_ref:this.getCanvasInfoPipeline(this.getPrimaryPipelineId()).runtime_ref,nodes:[],comments:[],links:[]};return this.createCanvasInfoPipeline(e)}},{key:"createPipeline",value:function(e,t,n){var i={runtime_ref:this.getCanvasInfoPipeline(this.getPrimaryPipelineId()).runtime_ref,nodes:e,comments:t,links:n};return this.createCanvasInfoPipeline(i)}},{key:"executeWithSelectionChange",value:function(e,n){var i={nodes:[],comments:[],pipelineId:""};if(this.selectionChangeHandler&&(i={links:this.getSelectedLinks(),nodes:this.getSelectedNodes(),comments:this.getSelectedComments(),pipelineId:this.getSelectedPipelineId()}),e(n),this.selectionChangeHandler){var o=this.getSelectedLinks(),r=this.getSelectedNodes(),a=this.getSelectedComments(),s={selection:this.getSelectedObjectIds(),selectedLinks:o,selectedNodes:r,selectedComments:a,addedLinks:Ze(o,i.links,(function(e,t){return e.id===t.id})),addedNodes:Ze(r,i.nodes,(function(e,t){return e.id===t.id})),addedComments:Ze(a,i.comments,(function(e,t){return e.id===t.id})),deselectedLinks:Ze(i.links,o,(function(e,t){return e.id===t.id})),deselectedNodes:Ze(i.nodes,r,(function(e,t){return e.id===t.id})),deselectedComments:Ze(i.comments,a,(function(e,t){return e.id===t.id})),previousPipelineId:i.pipelineId,selectedPipelineId:this.getSelectedPipelineId()};t.isEmpty_1(s.addedLinks)&&t.isEmpty_1(s.addedNodes)&&t.isEmpty_1(s.addedComments)&&t.isEmpty_1(s.deselectedLinks)&&t.isEmpty_1(s.deselectedNodes)&&t.isEmpty_1(s.deselectedComments)||this.selectionChangeHandler(s)}}},{key:"hasErrorMessage",value:function(e){var t=this.getNodeMessages(e);return!!t&&t.some((function(e){return e.type===o.ERROR}))}},{key:"hasWarningMessage",value:function(e){var t=this.getNodeMessages(e);return!!t&&t.some((function(e){return e.type===o.WARNING}))}},{key:"getNodeMessages",value:function(e){return e?e.messages:null}},{key:"getNotificationMessagesMaxType",value:function(){var e=this.getNotificationMessages(),t=this.getNotificationMessages(o.ERROR),n=this.getNotificationMessages(o.WARNING),i=this.getNotificationMessages(o.SUCCESS),r=this.getNotificationMessages(o.INFO),a=null;return e.length>0&&(t.length>0?a=o.ERROR:n.length>0?a=o.WARNING:i.length>0?a=o.SUCCESS:r.length>0&&(a=o.INFO)),a}},{key:"isLink",value:function(e){return e.type===o.NODE_LINK||e.type===o.COMMENT_LINK||e.type===o.ASSOCIATION_LINK}},{key:"setZoom",value:function(e,t){var n=this.getCanvasConfig().enableSaveZoom;this.store.dispatch({type:"SET_ZOOM",data:{zoom:e,enableSaveZoom:n},pipelineId:t}),n===o.SAVE_ZOOM_LOCAL_STORAGE&&this.setSavedZoomLocal(e,t)}},{key:"getSavedZoom",value:function(e){var t=this.getCanvasConfig().enableSaveZoom;return t===o.SAVE_ZOOM_PIPELINE_FLOW?this.store.getZoom(e):t===o.SAVE_ZOOM_LOCAL_STORAGE?this.getSavedZoomLocal(e):null}},{key:"clearSavedZoomValues",value:function(){it.delete("canvasSavedZoomValues")}},{key:"setSavedZoomLocal",value:function(e,t){var n=it.get("canvasSavedZoomValues"),o=n?JSON.parse(n):{};i.set_1(o,[this.getPipelineFlowId(),t],e),it.set("canvasSavedZoomValues",JSON.stringify(o))}},{key:"getSavedZoomLocal",value:function(e){var n=it.get("canvasSavedZoomValues");if(n){var i=JSON.parse(n);return t.get_1(i,[this.getPipelineFlowId(),e])}return null}},{key:"setNodesMultiDecorations",value:function(e){this.store.dispatch({type:"SET_NODES_MULTI_DECORATIONS",data:{pipelineNodeDecorations:e}})}},{key:"setLinksMultiDecorations",value:function(e){this.store.dispatch({type:"SET_LINKS_MULTI_DECORATIONS",data:{pipelineLinkDecorations:e}})}},{key:"setObjectsStyle",value:function(e,t,n){this.store.dispatch({type:"SET_OBJECTS_STYLE",data:{pipelineObjIds:e,newStyle:t,temporary:n}})}},{key:"setObjectsMultiStyle",value:function(e,t){this.store.dispatch({type:"SET_OBJECTS_MULTI_STYLE",data:{pipelineObjStyles:e,temporary:t}})}},{key:"setLinksStyle",value:function(e,t,n){this.store.dispatch({type:"SET_LINKS_STYLE",data:{pipelineObjIds:e,newStyle:t,temporary:n}})}},{key:"setLinksMultiStyle",value:function(e,t){this.store.dispatch({type:"SET_LINKS_MULTI_STYLE",data:{pipelineObjStyles:e,temporary:t}})}},{key:"getObjectStyle",value:function(e,t){var n=this.getObject(e);return t?n&&n.style_temp?n.style_temp:null:n&&n.style?n.style:null}},{key:"getHighlightObjectIds",value:function(e,t,n){var i=this,r={},a={};return r[e]=[],a[e]=[],t.forEach((function(t){switch(r[e].push(t),n){case o.HIGHLIGHT_BRANCH:i.getUpstreamObjIdsFrom(t,e,r,a),i.getDownstreamObjIdsFrom(t,e,r,a);break;case o.HIGHLIGHT_UPSTREAM:i.getUpstreamObjIdsFrom(t,e,r,a);break;case o.HIGHLIGHT_DOWNSTREAM:i.getDownstreamObjIdsFrom(t,e,r,a)}i.getAPIPipeline(e).isSupernode(t)&&i.getSupernodeNodeIds(t,e,r,a)})),{nodes:r,links:a}}},{key:"getSupernodeNodeIds",value:function(e,t,n,r){var a=this,s=this.getAPIPipeline(t).getNode(e);if(s.type===o.SUPER_NODE){var d=this.getSupernodePipelineId(s);n[d]=n[d]||[],r[d]=r[d]||[];var c=this.getAPIPipeline(d).getNodeIds(),l=this.getAPIPipeline(d).getLinkIds();n[d]=i.union_1(n[d],c),r[d]=i.union_1(r[d],l),c.forEach((function(e){a.getSupernodeNodeIds(e,d,n,r)}))}}},{key:"getUpstreamObjIdsFrom",value:function(e,t,n,r){var a=this;n[t]=n[t]||[],r[t]=r[t]||[];var s=this.getAPIPipeline(t),d=s.getNode(e),c=s.getAttachedLinksContainingTargetId(e).filter((function(e){return e.type===o.NODE_LINK}));if(c.length>0)c.forEach((function(e){if(!r[t].includes(e.id)){var o=s.getNode(e.srcNodeId);r[t]=i.union_1(r[t],[e.id]),n[t]=i.union_1(n[t],[e.srcNodeId]);var d=a.getSupernodeOutputPortForLink(o,e);if(d){var c=a.getSupernodePipelineId(o),l=a.getAPIPipeline(c).getNode(d.subflow_node_ref);l&&(r[c]=r[c]||[],n[c]=n[c]||[],n[c]=i.union_1(n[c],[l.id]),a.getUpstreamObjIdsFrom(l.id,c,n,r))}else a.getUpstreamObjIdsFrom(e.srcNodeId,t,n,r)}}));else if(s.isEntryBindingNode(d)&&h.isSuperBindingNode(d)){var l=this.getSupernodeObjReferencing(t),u=l.parentPipelineId,p=this.getAPIPipeline(u),f=p.getNode(l.supernodeId);f.inputs.forEach((function(t){t.subflow_node_ref===e&&p.getAttachedLinksContainingTargetId(f.id).forEach((function(e){if(e.trgNodePortId===t.id)if(n[u]=n[u]||[],r[u]=r[u]||[],n[u]=i.union_1(n[u],[e.srcNodeId]),r[u]=i.union_1(r[u],[e.id]),p.isSupernode(e.srcNodeId)){var o=p.getNode(e.srcNodeId),s=a.getSupernodeOutputPortForLink(o,e);if(s){var d=s.subflow_node_ref;a.getUpstreamObjIdsFrom(d,a.getSupernodePipelineId(o),n,r)}}else a.getUpstreamObjIdsFrom(e.srcNodeId,u,n,r)}))}))}}},{key:"getDownstreamObjIdsFrom",value:function(e,t,n,r){var a=this;n[t]=n[t]||[],r[t]=r[t]||[];var s=this.getAPIPipeline(t),d=s.getNode(e),c=s.getAttachedLinksContainingSourceId(e).filter((function(e){return e.type===o.NODE_LINK}));if(c.length>0)c.forEach((function(e){if(!r[t].includes(e.id)){var o=s.getNode(e.trgNodeId);r[t]=i.union_1(r[t],[e.id]),n[t]=i.union_1(n[t],[e.trgNodeId]);var d=a.getSupernodeInputPortForLink(o,e);if(d){var c=a.getSupernodePipelineId(o),l=a.getAPIPipeline(c).getNode(d.subflow_node_ref);l&&(r[c]=r[c]||[],n[c]=n[c]||[],n[c]=i.union_1(n[c],[l.id]),a.getDownstreamObjIdsFrom(l.id,c,n,r))}else a.getDownstreamObjIdsFrom(e.trgNodeId,t,n,r)}}));else if(s.isExitBindingNode(d)&&h.isSuperBindingNode(d)){var l=this.getSupernodeObjReferencing(t),u=l.parentPipelineId,p=this.getAPIPipeline(u),f=p.getNode(l.supernodeId);f.outputs.forEach((function(t){t.subflow_node_ref===e&&p.getAttachedLinksContainingSourceId(f.id).forEach((function(e){if(e.srcNodePortId===t.id)if(n[u]=n[u]||[],r[u]=r[u]||[],n[u]=i.union_1(n[u],[e.trgNodeId]),r[u]=i.union_1(r[u],[e.id]),p.isSupernode(e.trgNodeId)){var o=p.getNode(e.trgNodeId),s=a.getSupernodeInputPortForLink(o,e);if(s){var d=s.subflow_node_ref;a.getDownstreamObjIdsFrom(d,a.getSupernodePipelineId(o),n,r)}}else a.getDownstreamObjIdsFrom(e.trgNodeId,u,n,r)}))}))}}},{key:"getSupernodeInputPortForLink",value:function(e,t){var n=null;return this.getSupernodePipelineId(e)&&t.trgNodePortId&&e.inputs.forEach((function(e){e.id!==t.trgNodePortId||(n=e)})),n}},{key:"getSupernodeOutputPortForLink",value:function(e,t){var n=null;return this.getSupernodePipelineId(e)&&t.srcNodePortId&&e.outputs.forEach((function(e){e.id!==t.srcNodePortId||(n=e)})),n}},{key:"copyToClipboard",value:function(e){var t=this,n={},i=this.getSelectionAPIPipeline();if(!i)return!1;var r=this.getSelectedNodes(),a=this.getSelectedComments(),s=i.getLinksBetween(r,a);if(e){var d=i.getNodeDataLinksContainingIds(r.map((function(e){return e.id})));s=h.concatUniqueBasedOnId(d,s),s=h.concatUniqueBasedOnId(this.getSelectedLinks(),s)}if(0===r.length&&0===a.length&&0===s.length)return!1;if(r&&r.length>0){n.nodes=r;var c=[];h.filterSupernodes(r).forEach((function(e){c=c.concat(t.getSchemaPipelinesForSupernode(e)),e.sub_pipelines=c}))}a&&a.length>0&&(n.comments=a),s&&s.length>0&&(n.links=s.map((function(e){var t=Object.assign({},e);return e.type===o.NODE_LINK&&e.srcNodeId&&-1===r.findIndex((function(t){return t.id===e.srcNodeId}))&&(delete t.srcNodeId,delete t.srcNodePortId,t.srcPos=h.getSrcPos(e,i)),e.type===o.NODE_LINK&&e.trgNodeId&&-1===r.findIndex((function(t){return t.id===e.trgNodeId}))&&(delete t.trgNodeId,delete t.trgNodePortId,t.trgPos=h.getTrgPos(e,i)),t})));var l=JSON.stringify(n);return it.set("canvasClipboard",l),!0}},{key:"isClipboardEmpty",value:function(){var e=it.get("canvasClipboard");return!e||""===e}},{key:"getObjectsToPaste",value:function(){var e=it.get("canvasClipboard");if(!e)return{};var t=JSON.parse(e);return t.nodes||t.comments||t.links?t:null}},{key:"setTooltipDef",value:function(e){this.store.dispatch({type:"SET_TOOLTIP_DEF",data:{tooltipDef:e}})}},{key:"isTooltipOpen",value:function(){return this.store.isTooltipOpen()}},{key:"setTextToolbarDef",value:function(e){this.store.dispatch({type:"SET_TEXT_TOOLBAR_DEF",data:{textToolbarDef:e}})}}]),n}();function ln(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=n._getPrototypeOf(e);if(t){var r=n._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return n._possibleConstructorReturn(this,i)}}var un=function(t){n._inherits(o,t);var i=ln(o);function o(t,n,r){var a;return e._classCallCheck(this,o),(a=i.call(this,t)).data=t,a.objectModel=n,a.labelUtil=r,a.apiPipeline=a.objectModel.getAPIPipeline(t.pipelineId),a.previousObjectsInfo=a.getPreviousObjectsInfo(t),a.previousDetLinksInfo=a.getPreviousDetachedLinksInfo(t),a}return e._createClass(o,[{key:"do",value:function(){this.apiPipeline.sizeAndPositionObjects(this.data.objectsInfo,this.data.linksInfo)}},{key:"undo",value:function(){this.apiPipeline.sizeAndPositionObjects(this.previousObjectsInfo,this.previousDetLinksInfo)}},{key:"redo",value:function(){this.do()}},{key:"getLabel",value:function(){return this.labelUtil.getActionLabel(this,"action.sizeAndPositionObjects")}},{key:"getPreviousObjectsInfo",value:function(e){var t=this,n=[];return Object.keys(e.objectsInfo).forEach((function(e){var i=t.apiPipeline.getObject(e);i&&(n[e]={id:i.id,x_pos:i.x_pos,y_pos:i.y_pos,width:i.width,height:i.height},i.isResized&&(n[e].isResized=i.isResized,n[e].resizeWidth=i.resizeWidth,n[e].resizeHeight=i.resizeHeight))})),n}},{key:"getPreviousDetachedLinksInfo",value:function(e){var t=this,n=[];return Object.keys(e.detachedLinksInfo).forEach((function(e){var i=t.apiPipeline.getLink(e);i&&(i.srcPos||i.trgPos)&&(n[e]={},i.srcPos&&(n[e].srcPos={x_pos:i.srcPos.x_pos,y_pos:i.srcPos.y_pos}),i.trgPos&&(n[e].trgPos={x_pos:i.trgPos.x_pos,y_pos:i.trgPos.y_pos}))})),n}}]),o}(i.Action),pn=null;var fn=function e(t){var n=[];return t.forEach((function(t){if(t.submenu){var i=e(t.menu);i&&i.length>0&&(t.menu=i,n.push(t))}else gn(t.action)||n.push(t)})),n},hn=function(e){var t=[],n=!0;return e.forEach((function(e){e.divider?n||(t.push(e),n=!0):(t.push(e),n=!1)})),t},gn=function(e){return"createComment"===e||"colorBackground"===e||"disconnectNode"===e||"setNodeLabelEditingMode"===e||"setCommentEditingMode"===e||"cut"===e||"copy"===e||"paste"===e||"undo"===e||"redo"===e||"deleteSelectedObjects"===e||"createSuperNode"===e||"createSuperNodeExternal"===e||"deconstructSuperNode"===e||"collapseSuperNodeInPlace"===e||"expandSuperNodeInPlace"===e||"convertSuperNodeExternalToLocal"===e||"convertSuperNodeLocalToExternal"===e||"deleteLink"===e||"saveToPalette"===e},yn=function(e){var n=[],i=pn.isContextMenuForNonSelectedObj(e);if("canvas"===e.type&&(n=n.concat([{action:"createComment",label:bn("canvas.addComment"),toolbarItem:!0},{action:"selectAll",label:bn("canvas.selectAll")},{divider:!0}])),"node"===e.type&&t.get_1(e,"targetObject.layout.labelEditable",!1)&&(n=n.concat({action:"setNodeLabelEditingMode",label:bn("node.renameNode"),toolbarItem:!0})),"comment"===e.type&&(n=n.concat({action:"setCommentEditingMode",label:bn("comment.editComment"),toolbarItem:!0})),"comment"===e.type&&t.get_1(pn,"contextMenuConfig.defaultMenuEntries.colorBackground",!0)&&(n=n.concat({action:"colorBackground",label:bn("comment.colorBackground")},{divider:!0})),"node"===e.type||"comment"===e.type){var r=i?[e.targetObject.id]:e.selectedObjectIds;pn.objectModel.getAPIPipeline(e.pipelineId).getLinksContainingIds(r).length>0&&(n=n.concat({action:"disconnectNode",label:bn("node.disconnectNode")},{divider:!0}))}if("node"===e.type||"comment"===e.type||"link"===e.type&&pn.areDetachableLinksInUse()||"canvas"===e.type){var a=mn(e,"canvas"===e.type);n=n.concat({action:"clipboard",submenu:!0,menu:a,label:bn("node.editMenu")},{divider:!0})}return"canvas"===e.type&&(n=n.concat({action:"undo",label:bn("canvas.undo"),enable:pn.canUndo()},{action:"redo",label:bn("canvas.redo"),enable:pn.canRedo()},{divider:!0})),("node"===e.type||"comment"===e.type||pn.getCanvasConfig().enableLinkSelection!==o.LINK_SELECTION_NONE&&"link"===e.type)&&(n=n.concat({action:"deleteSelectedObjects",label:bn("canvas.deleteObject"),toolbarItem:!0},{divider:!0})),"node"!==e.type&&"comment"!==e.type||t.get_1(pn,"contextMenuConfig.defaultMenuEntries.createSupernode",!1)&&(pn.areSelectedNodesContiguous()||t.get_1(pn,"contextMenuConfig.enableCreateSupernodeNonContiguous",!1)||i&&"node"===e.type)&&(n=n.concat({action:"createSuperNode",label:bn("node.createSupernode")}),pn.getCanvasConfig().enableExternalPipelineFlows&&(n=n.concat({action:"createSuperNodeExternal",label:bn("node.createSupernodeExternal")})),n=n.concat({divider:!0})),"node"!==e.type||e.targetObject.type!==o.SUPER_NODE||1!==e.selectedObjectIds.length&&!i||"canvas"!==e.targetObject.open_with_tool&&void 0!==e.targetObject.open_with_tool||(n=n.concat({action:"deconstructSuperNode",label:bn("node.deconstructSupernode")},{divider:!0}),n=pn.isSuperNodeExpandedInPlace(e.targetObject.id,e.pipelineId)?n.concat({action:"collapseSuperNodeInPlace",label:bn("node.collapseSupernodeInPlace")}):n.concat({action:"expandSuperNodeInPlace",label:bn("node.expandSupernode")}),t.get_1(pn,"contextMenuConfig.defaultMenuEntries.displaySupernodeFullPage")&&(n=n.concat({action:"displaySubPipeline",label:bn("node.displaySupernodeFullPage"),toolbarItem:!0})),n=n.concat({divider:!0}),pn.getCanvasConfig().enableExternalPipelineFlows&&(e.targetObject.subflow_ref.url?pn.isPipelineExternal(e.pipelineId)||(n=n.concat({action:"convertSuperNodeExternalToLocal",label:bn("node.convertSupernodeExternalToLocal")},{divider:!0})):n=n.concat({action:"convertSuperNodeLocalToExternal",label:bn("node.convertSupernodeLocalToExternal")},{divider:!0}))),"link"===e.type&&pn.getCanvasConfig().enableLinkSelection===o.LINK_SELECTION_NONE&&(n=n.concat({action:"deleteLink",label:bn("canvas.deleteObject"),toolbarItem:!0})),"node"===e.type&&(n=n.concat({action:"highlight",submenu:!0,menu:_n(e),label:bn("menu.highlight")})),"canvas"===e.type&&(n=n.concat({action:"unhighlight",label:bn("menu.unhighlight"),enable:pn.isHighlighted()})),"node"===e.type&&t.get_1(pn,"contextMenuConfig.defaultMenuEntries.saveToPalette",!1)&&(n=n.concat({divider:!0},{action:"saveToPalette",label:bn("node.saveToPalette")})),n},mn=function(e,t){var n=[{action:"cut",label:bn("edit.cutSelection"),enable:"canvas"!==e.type||e.selectedObjectIds.length>0},{action:"copy",label:bn("edit.copySelection"),enable:"canvas"!==e.type||e.selectedObjectIds.length>0}];return t&&n.push({action:"paste",label:bn("edit.pasteSelection"),enable:!pn.isClipboardEmpty()}),n},_n=function(e){var t=[{action:"highlightBranch",label:bn("menu.highlightBranch")},{action:"highlightUpstream",label:bn("menu.highlightUpstream")},{action:"highlightDownstream",label:bn("menu.highlightDownstream")}];return t.push({divider:!0}),t=t.concat(vn(e))},vn=function(e){return[{action:"unhighlight",label:bn("menu.unhighlight"),enable:pn.isHighlighted()}]},bn=function(e){return pn.labelUtil.getLabel(e)},Pn=0,kn=function(){function n(){e._classCallCheck(this,n),this.logger=new a.Logger("CanvasController"),this.contextMenuConfig={enableCreateSupernodeNonContiguous:!1,defaultMenuEntries:{saveToPalette:!1,createSupernode:!0,displaySupernodeFullPage:!0,colorBackground:!0}},this.keyboardConfig={actions:{delete:!0,undo:!0,redo:!0,selectAll:!0,copyToClipboard:!0,cutToClipboard:!0,pasteFromClipboard:!0}},this.handlers={contextMenuHandler:null,beforeEditActionHandler:null,editActionHandler:null,clickActionHandler:null,decorationActionHandler:null,tipHandler:null,layoutHandler:null,idGeneratorHandler:null,selectionChangeHandler:null,actionLabelHandler:null},this.objectModel=new cn,this.commandStack=new r,this.labelUtil=new $e,this.contextMenuActionHandler=this.contextMenuActionHandler.bind(this),this.closeContextMenu=this.closeContextMenu.bind(this),this.isContextMenuForNonSelectedObj=this.isContextMenuForNonSelectedObj.bind(this),this.instanceId=Pn++,this.highlight=!1}return e._createClass(n,[{key:"setCanvasConfig",value:function(e){this.logger.log("Setting Canvas Config");var t=this.correctTypo(e);this.objectModel.openPaletteIfNecessary(e),this.objectModel.setCanvasConfig(t)}},{key:"correctTypo",value:function(e){return t.isEmpty_1(e)||"boolean"!=typeof e.enableHightlightNodeOnNewLinkDrag||(e.enableHighlightNodeOnNewLinkDrag=e.enableHightlightNodeOnNewLinkDrag,delete e.enableHightlightNodeOnNewLinkDrag),e}},{key:"getCanvasConfig",value:function(){return this.objectModel.getCanvasConfig()}},{key:"setIntl",value:function(e){this.labelUtil.setIntl(e)}},{key:"setToolbarConfig",value:function(e){this.logger.log("Setting Toolbar Config"),this.objectModel.setToolbarConfig(e)}},{key:"setNotificationPanelConfig",value:function(e){this.logger.log("Setting Notif Panel Config"),this.objectModel.setNotificationPanelConfig(e)}},{key:"setRightFlyoutConfig",value:function(e){this.logger.log("Setting Right Flyout Config"),this.objectModel.setRightFlyoutConfig(e)}},{key:"setBottomPanelConfig",value:function(e){this.logger.log("Setting Bottom Panel Config"),this.objectModel.setBottomPanelConfig(e)}},{key:"setTopPanelConfig",value:function(e){this.logger.log("Setting Top Panel Config"),this.objectModel.setTopPanelConfig(e)}},{key:"setContextMenuConfig",value:function(e){if(this.logger.log("Setting Context Menu Config"),e){var t=Object.assign(this.contextMenuConfig.defaultMenuEntries,e.defaultMenuEntries);this.contextMenuConfig=Object.assign(this.contextMenuConfig,e,{defaultMenuEntries:t})}}},{key:"setKeyboardConfig",value:function(e){this.logger.log("Setting Keyboard Config"),e&&e.actions&&(this.keyboardConfig.actions=Object.assign({},this.keyboardConfig.actions,e.actions))}},{key:"getKeyboardConfig",value:function(){return this.keyboardConfig}},{key:"setHandlers",value:function(e){this.logger.log("Setting Handlers"),this.handlers=Object.assign(this.handlers,e),this.objectModel.setIdGeneratorHandler(e.idGeneratorHandler),this.objectModel.setSelectionChangeHandler(e.selectionChangeHandler),this.objectModel.setLayoutHandler(e.layoutHandler),this.labelUtil.setActionLabelHandler(e.actionLabelHandler)}},{key:"setCanvasContents",value:function(e){this.canvasContents=e}},{key:"getSVGCanvasD3",value:function(){return this.canvasContents?this.canvasContents.getSVGCanvasD3():null}},{key:"setInstanceId",value:function(e){this.instanceId=e}},{key:"getInstanceId",value:function(){return this.instanceId}},{key:"getObjectModel",value:function(){return this.objectModel}},{key:"isInternalObjectModelEnabled",value:function(){return this.getCanvasConfig().enableInternalObjectModel}},{key:"getStore",value:function(){return this.getObjectModel().getStore()}},{key:"setPipelineFlow",value:function(e){this.objectModel.setPipelineFlow(e),this.ensureVisibleExpandedPipelinesAreLoaded()}},{key:"clearPipelineFlow",value:function(){this.objectModel.clearPipelineFlow()}},{key:"getPipelineFlow",value:function(){return this.objectModel.getPipelineFlow()}},{key:"getPipelineFlowId",value:function(){return this.objectModel.getPipelineFlowId()}},{key:"getPrimaryPipelineId",value:function(){return this.objectModel.getPrimaryPipelineId()}},{key:"getExternalPipelineFlow",value:function(e){return this.objectModel.getExternalPipelineFlow(e)}},{key:"getCanvasInfo",value:function(){return this.objectModel.getCanvasInfo()}},{key:"getAncestorPipelineIds",value:function(e){return this.objectModel.getAncestorPipelineIds(e)}},{key:"removeAllStyles",value:function(e){this.objectModel.removeAllStyles(e)}},{key:"setSubdueStyle",value:function(e){this.objectModel.setSubdueStyle(e)}},{key:"getPipeline",value:function(e){return this.objectModel.getCanvasInfoPipeline(e)}},{key:"getCurrentPipelineId",value:function(){return this.objectModel.getCurrentBreadcrumb().pipelineId}},{key:"isPipelineExternal",value:function(e){return this.objectModel.getAPIPipeline(e).isPipelineExternal()}},{key:"getFlowMessages",value:function(e){return this.objectModel.getAPIPipeline(e).getFlowMessages()}},{key:"isFlowValid",value:function(e,t){return this.objectModel.getAPIPipeline(t).isFlowValid(e)}},{key:"autoLayout",value:function(e,t){this.objectModel.getAPIPipeline(t).autoLayout(e)}},{key:"setCanvas",value:function(e){this.objectModel.setCanvas(e)}},{key:"setPaletteData",value:function(e){this.objectModel.setPaletteData(e)}},{key:"getCanvas",value:function(){return this.objectModel.getCanvas()}},{key:"setPipelineFlowPalette",value:function(e){this.objectModel.setPipelineFlowPalette(e)}},{key:"clearPaletteData",value:function(){this.objectModel.clearPaletteData()}},{key:"setCategoryLoadingText",value:function(e,t){this.objectModel.setCategoryLoadingText(e,t)}},{key:"setCategoryEmptyText",value:function(e,t){this.objectModel.setCategoryEmptyText(e,t)}},{key:"addNodeTypeToPalette",value:function(e,t,n,i,o){this.objectModel.addNodeTypeToPalette(e,t,n,i,o)}},{key:"addNodeTypesToPalette",value:function(e,t,n,i,o){this.objectModel.addNodeTypesToPalette(e,t,n,i,o)}},{key:"removeNodesFromPalette",value:function(e,t){this.objectModel.addNodeTypesToPalette(e,t)}},{key:"getPaletteData",value:function(){return this.objectModel.getPaletteData()}},{key:"getPaletteNode",value:function(e){return this.objectModel.getPaletteNode(e)}},{key:"getPaletteNodeById",value:function(e){return this.objectModel.getPaletteNodeById(e)}},{key:"getCategoryForNode",value:function(e){return this.objectModel.getCategoryForNode(e)}},{key:"convertNodeTemplate",value:function(e){return this.objectModel.convertNodeTemplate(e)}},{key:"openPaletteCategory",value:function(e){this.objectModel.setIsOpenCategory(e,!0)}},{key:"closePaletteCategory",value:function(e){this.objectModel.setIsOpenCategory(e,!1)}},{key:"openAllPaletteCategories",value:function(){this.objectModel.setIsOpenAllCategories(!0)}},{key:"closeAllPaletteCategories",value:function(){this.objectModel.setIsOpenAllCategories(!1)}},{key:"isPaletteCategoryOpen",value:function(e){return this.objectModel.isPaletteCategoryOpen(e)}},{key:"setSelections",value:function(e,t){this.objectModel.setSelections(e,t)}},{key:"clearSelections",value:function(){this.objectModel.clearSelections()}},{key:"selectAll",value:function(e){var t=this.getCanvasConfig().enableLinkSelection!==o.LINK_SELECTION_NONE;this.objectModel.selectAll(t,e)}},{key:"isPrimaryPipelineEmpty",value:function(){return this.objectModel.isPrimaryPipelineEmpty()}},{key:"getSelectedObjectIds",value:function(){return this.objectModel.getSelectedObjectIds()}},{key:"getSelectedNodes",value:function(){return this.objectModel.getSelectedNodes()}},{key:"getSelectedComments",value:function(){return this.objectModel.getSelectedComments()}},{key:"getSelectedLinks",value:function(){return this.objectModel.getSelectedLinks()}},{key:"getSelectedObjects",value:function(){return this.objectModel.getSelectedObjects()}},{key:"getSelectedPipelineId",value:function(){return this.objectModel.getSelectedPipelineId()}},{key:"deleteSelectedObjects",value:function(){this.objectModel.deleteSelectedObjects()}},{key:"areSelectedNodesContiguous",value:function(){return this.objectModel.areSelectedNodesContiguous()}},{key:"areAllSelectedObjectsLinks",value:function(){return this.objectModel.areAllSelectedObjectsLinks()}},{key:"areDetachableLinksInUse",value:function(){return this.getCanvasConfig().enableLinkSelection===o.LINK_SELECTION_DETACHABLE}},{key:"isSnapToGridInUse",value:function(){return this.getCanvasConfig().enableSnapToGridType!==o.SNAP_TO_GRID_NONE}},{key:"selectObject",value:function(e,t,n,i){this.objectModel.selectObject(e,t,n,i)}},{key:"setNotificationMessages",value:function(e){this.objectModel.setNotificationMessages(e)}},{key:"clearNotificationMessages",value:function(){this.objectModel.clearNotificationMessages()}},{key:"deleteNotificationMessages",value:function(e){this.objectModel.deleteNotificationMessages(e)}},{key:"getNotificationMessages",value:function(e){return this.objectModel.getNotificationMessages(e)}},{key:"getNotificationMessagesMaxType",value:function(){return this.objectModel.getNotificationMessagesMaxType()}},{key:"moveObjects",value:function(e,t){this.objectModel.getAPIPipeline(t).moveObjects(e)}},{key:"deleteObjects",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteObjects(e)}},{key:"disconnectObjects",value:function(e,t){this.objectModel.getAPIPipeline(t).disconnectObjects(e)}},{key:"deleteObject",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteObject(e)}},{key:"setObjectsStyle",value:function(e,t,n){this.objectModel.setObjectsStyle(e,t,n)}},{key:"setObjectsMultiStyle",value:function(e,t){this.objectModel.setObjectsMultiStyle(e,t)}},{key:"getNodes",value:function(e){return this.objectModel.getAPIPipeline(e).getNodes()}},{key:"createNode",value:function(e,t){return this.objectModel.getAPIPipeline(t).createNode(e)}},{key:"addNode",value:function(e,t){this.objectModel.getAPIPipeline(t).addNode(e)}},{key:"createNodeCommand",value:function(e,t){var n=t||this.getCurrentPipelineId(),i=this.convertNodeTemplate(e.nodeTemplate);this.createNodeFromTemplateAt(i,{x:e.offsetX,y:e.offsetY},n)}},{key:"deleteNode",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteNode(e)}},{key:"setNodeProperties",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeProperties(e,t)}},{key:"setNodeParameters",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeParameters(e,t)}},{key:"setNodeUiParameters",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeUiParameters(e,t)}},{key:"setNodeMessages",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeMessages(e,t)}},{key:"setNodeMessage",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeMessage(e,t)}},{key:"setNodeLabel",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeLabel(e,t)}},{key:"setNodesClassName",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setObjectsClassName(e,t)}},{key:"setNodeDecorations",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeDecorations(e,t)}},{key:"setNodeInputPorts",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeInputPorts(e,t)}},{key:"setNodeOutputPorts",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setNodeOutputPorts(e,t)}},{key:"setNodesMultiDecorations",value:function(e){this.objectModel.setNodesMultiDecorations(e)}},{key:"setInputPortLabel",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setInputPortLabel(e,t,n)}},{key:"setOutputPortLabel",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setOutputPortLabel(e,t,n)}},{key:"getNode",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNode(e)}},{key:"getNodeUiParameters",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeUiParameters(e)}},{key:"getSupernodes",value:function(e){return this.objectModel.getAPIPipeline(e).getSupernodes()}},{key:"getSupernodeObjReferencing",value:function(e){return this.objectModel.getSupernodeObjReferencing(e)}},{key:"getNodeMessages",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeMessages(e)}},{key:"getNodeMessage",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getNodeMessage(e,t)}},{key:"getNodeInputPorts",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeInputPorts(e)}},{key:"getNodeOutputPorts",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeOutputPorts(e)}},{key:"getNodeDecorations",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeDecorations(e)}},{key:"getNodeClassName",value:function(e,t){return this.objectModel.getAPIPipeline(t).getNodeClassName(e)}},{key:"getNodeStyle",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getNodeStyle(e,t)}},{key:"getBranchNodes",value:function(e,t){var n=t||this.objectModel.getCurrentPipelineId();return this.objectModel.getHighlightObjectIds(n,e,o.HIGHLIGHT_BRANCH)}},{key:"getUpstreamNodes",value:function(e,t){var n=t||this.objectModel.getCurrentPipelineId();return this.objectModel.getHighlightObjectIds(n,e,o.HIGHLIGHT_UPSTREAM)}},{key:"getDownstreamNodes",value:function(e,t){var n=t||this.objectModel.getCurrentPipelineId();return this.objectModel.getHighlightObjectIds(n,e,o.HIGHLIGHT_DOWNSTREAM)}},{key:"addCustomAttrToNodes",value:function(e,t,n){this.objectModel.getAPIPipeline(n).addCustomAttrToNodes(e,t)}},{key:"removeCustomAttrFromNodes",value:function(e,t,n){this.objectModel.getAPIPipeline(n).removeCustomAttrFromNodes(e,t)}},{key:"isSuperNodeExpandedInPlace",value:function(e,t){return this.objectModel.getAPIPipeline(t).isSuperNodeExpandedInPlace(e)}},{key:"setNodeLabelEditingMode",value:function(e,t){this.canvasContents&&this.getSVGCanvasD3().setNodeLabelEditingMode(e,t)}},{key:"setNodeDecorationLabelEditingMode",value:function(e,t,n){this.canvasContents&&this.getSVGCanvasD3().setNodeDecorationLabelEditingMode(e,t,n)}},{key:"getComments",value:function(e){return this.objectModel.getAPIPipeline(e).getComments()}},{key:"getComment",value:function(e,t){return this.objectModel.getAPIPipeline(t).getComment(e)}},{key:"getNewCommentPosition",value:function(e){var t=this.objectModel.getAPIPipeline(e),n=this.getSVGCanvasD3().getDefaultCommentOffset(),i=t.getAdjustedCommentPosition(n);return{x:i.x_pos,y:i.y_pos}}},{key:"createComment",value:function(e,t){this.objectModel.getAPIPipeline(t).createComment(e)}},{key:"addComment",value:function(e,t){this.objectModel.getAPIPipeline(t).addComment(e)}},{key:"editComment",value:function(e,t){this.objectModel.getAPIPipeline(t).editComment(e)}},{key:"setCommentProperties",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setCommentProperties(e,t)}},{key:"setCommentsClassName",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setObjectsClassName(e,t)}},{key:"deleteComment",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteComment(e)}},{key:"addCustomAttrToComments",value:function(e,t,n){this.objectModel.getAPIPipeline(n).addCustomAttrToComments(e,t)}},{key:"removeCustomAttrFromComments",value:function(e,t,n){this.objectModel.getAPIPipeline(n).removeCustomAttrFromComments(e,t)}},{key:"getCommentClassName",value:function(e,t){return this.objectModel.getAPIPipeline(t).getCommentClassName(e)}},{key:"getCommentStyle",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getCommentStyle(e,t)}},{key:"hideComments",value:function(){this.objectModel.hideComments()}},{key:"showComments",value:function(){this.objectModel.showComments()}},{key:"isHidingComments",value:function(){return this.objectModel.isHidingComments()}},{key:"setCommentEditingMode",value:function(e,t){this.canvasContents&&this.getSVGCanvasD3().setCommentEditingMode(e,t)}},{key:"getLink",value:function(e,t){return this.objectModel.getAPIPipeline(t).getLink(e)}},{key:"getLinks",value:function(e){return this.objectModel.getAPIPipeline(e).getLinks()}},{key:"setLinkProperties",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setLinkProperties(e,t)}},{key:"setNodeDataLinkSrcInfo",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setNodeDataLinkSrcInfo(e,t,n)}},{key:"setNodeDataLinkTrgInfo",value:function(e,t,n,i){this.objectModel.getAPIPipeline(i).setNodeDataLinkTrgInfo(e,t,n)}},{key:"getNodeDataLinkFromInfo",value:function(e,t,n,i,o){return this.objectModel.getAPIPipeline(o).getNodeDataLinkFromInfo(e,t,n,i)}},{key:"getCommentLinkFromInfo",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getCommentLinkFromInfo(e,t)}},{key:"getNodeAssocLinkFromInfo",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getNodeAssocLinkFromInfo(e,t)}},{key:"addLinks",value:function(e,t){this.objectModel.getAPIPipeline(t).addLinks(e)}},{key:"setLinks",value:function(e,t){this.objectModel.getAPIPipeline(t).setLinks(e)}},{key:"deleteLink",value:function(e,t){this.objectModel.getAPIPipeline(t).deleteLink(e)}},{key:"createNodeLinks",value:function(e,t){return this.objectModel.getAPIPipeline(t).createNodeLinks(e)}},{key:"createCommentLinks",value:function(e,t){return this.objectModel.getAPIPipeline(t).createCommentLinks(e)}},{key:"setLinksClassName",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setLinksClassName(e,t)}},{key:"setLinksStyle",value:function(e,t,n){this.objectModel.setLinksStyle(e,t,n)}},{key:"setLinksMultiStyle",value:function(e,t){this.objectModel.setLinksMultiStyle(e,t)}},{key:"getLinkClassName",value:function(e,t){return this.objectModel.getAPIPipeline(t).getLinkClassName(e)}},{key:"getLinkStyle",value:function(e,t,n){return this.objectModel.getAPIPipeline(n).getLinkStyle(e,t)}},{key:"setLinkDecorations",value:function(e,t,n){this.objectModel.getAPIPipeline(n).setLinkDecorations(e,t)}},{key:"setLinksMultiDecorations",value:function(e){this.objectModel.setLinksMultiDecorations(e)}},{key:"getLinkDecorations",value:function(e,t){return this.objectModel.getAPIPipeline(t).getLinkDecorations(e)}},{key:"setLinkDecorationLabelEditingMode",value:function(e,t,n){this.canvasContents&&this.getSVGCanvasD3().setLinkDecorationLabelEditingMode(e,t,n)}},{key:"getCommandStack",value:function(){return this.commandStack}},{key:"undo",value:function(){this.canUndo()&&this.getCommandStack().undo()}},{key:"redo",value:function(){this.canRedo()&&this.getCommandStack().redo()}},{key:"canUndo",value:function(){return this.getCommandStack().canUndo()}},{key:"canRedo",value:function(){return this.getCommandStack().canRedo()}},{key:"getUndoLabel",value:function(){if(this.canUndo()){var e=this.getCommandStack().getUndoCommand();if(e&&e.getLabel)return e.getLabel()}return""}},{key:"getRedoLabel",value:function(){if(this.canRedo()){var e=this.getCommandStack().getRedoCommand();if(e&&e.getLabel)return e.getLabel()}return""}},{key:"getBreadcrumbs",value:function(){return this.objectModel.getBreadcrumbs()}},{key:"getCurrentBreadcrumb",value:function(){return this.objectModel.getCurrentBreadcrumb()}},{key:"createBreadcrumb",value:function(e,t){return this.objectModel.createBreadcrumb(e,t)}},{key:"setHighlightStyle",value:function(e,t){this.removeAllStyles(!0);var n={body:{default:"fill: ".concat(o.HIGHLIGHT_FILL," ;stroke: ").concat(o.HIGHLIGHT_STROKE,";"),hover:"fill: ".concat(o.HIGHLIGHT_HOVER_FILL,";")}},i={line:{default:"stroke: ".concat(o.HIGHLIGHT_STROKE,";"),hover:"stroke-width: ".concat(o.HIGHLIGHT_STROKE_WIDTH)}};this.setObjectsStyle(e.nodes,n,!0,!1),this.setLinksStyle(e.links,i,!0,!1),this.highlight=!0}},{key:"highlightBranch",value:function(e,t){var n=this.objectModel.getHighlightObjectIds(t,e,o.HIGHLIGHT_BRANCH);return this.setHighlightStyle(n,t),n}},{key:"highlightUpstream",value:function(e,t){var n=this.objectModel.getHighlightObjectIds(t,e,o.HIGHLIGHT_UPSTREAM);return this.setHighlightStyle(n,t),n}},{key:"highlightDownstream",value:function(e,t){var n=this.objectModel.getHighlightObjectIds(t,e,o.HIGHLIGHT_DOWNSTREAM);return this.setHighlightStyle(n,t),n}},{key:"isHighlighted",value:function(){return this.highlight}},{key:"getLoggingState",value:function(){return a.Logger.getLoggingState()}},{key:"setLoggingState",value:function(e){a.Logger.setLoggingState(e)}},{key:"log",value:function(e){new a.Logger("Host App").log(e)}},{key:"addAfterUpdateCallback",value:function(e){this.canvasContents&&this.canvasContents.addAfterUpdateCallback(e)}},{key:"removeAfterUpdateCallback",value:function(e){this.canvasContents&&this.canvasContents.removeAfterUpdateCallback(e)}},{key:"togglePalette",value:function(){this.getObjectModel().togglePalette()}},{key:"openPalette",value:function(){this.getObjectModel().openPalette()}},{key:"closePalette",value:function(){this.getObjectModel().closePalette()}},{key:"isPaletteOpen",value:function(){return this.getObjectModel().isPaletteOpen()}},{key:"openContextMenu",value:function(e,t){this.objectModel.openContextMenu(e,t)}},{key:"isBottomPanelOpen",value:function(){return this.getObjectModel().isBottomPanelOpen()}},{key:"setBottomPanelHeight",value:function(e){this.objectModel.setBottomPanelHeight(e)}},{key:"isTopPanelOpen",value:function(){return this.getObjectModel().isTopPanelOpen()}},{key:"closeContextMenu",value:function(){this.objectModel.closeContextMenu()}},{key:"isContextMenuDisplayed",value:function(){return this.objectModel.isContextMenuDisplayed()}},{key:"getContextMenuSource",value:function(){return this.objectModel.getContextMenuSource()}},{key:"closeContextToolbar",value:function(){this.mouseInContextToolbar||this.mouseInObject||this.objectModel.closeContextMenu()}},{key:"setMouseInContextToolbar",value:function(e){this.mouseInContextToolbar=e}},{key:"setMouseInObject",value:function(e){this.mouseInObject=e}},{key:"openNotificationPanel",value:function(){this.objectModel.openNotificationPanel()}},{key:"closeNotificationPanel",value:function(){this.objectModel.closeNotificationPanel()}},{key:"toggleNotificationPanel",value:function(){this.objectModel.toggleNotificationPanel()}},{key:"isRightFlyoutOpen",value:function(){return this.objectModel.isRightFlyoutOpen()}},{key:"displaySubPipeline",value:function(e){var t=this.objectModel.getBreadcrumbs(),n=t.findIndex((function(t){return t.pipelineId===e}));if(n>-1){var i={editType:"displaySubPipeline",editSource:"canvas",targetObject:this.getSupernodeFromBreadcrumb(t[n]),breadcrumbIndex:n};this.editActionHandler(i)}}},{key:"displaySubPipelineForSupernode",value:function(e,t){var n=this.getNode(e,t);if(n&&n.type===o.SUPER_NODE){var i=this.objectModel.getCurrentBreadcrumb(),r=this.objectModel.createBreadcrumb(n,i.pipelineId);this.displaySubPipelineForBreadcrumbs([r])}}},{key:"displaySubPipelineForBreadcrumbs",value:function(e){var t=e[e.length-1],n={editType:"displaySubPipeline",editSource:"canvas",targetObject:this.getSupernodeFromBreadcrumb(t),addBreadcrumbs:e};this.editActionHandler(n)}},{key:"getSupernodeFromBreadcrumb",value:function(e){return e.supernodeParentPipelineId?this.objectModel.getAPIPipeline(e.supernodeParentPipelineId).getNode(e.supernodeId):null}},{key:"displayPreviousPipeline",value:function(){var e={editType:"displayPreviousPipeline",pipelineInfo:this.objectModel.getPreviousBreadcrumb(),editSource:"canvas"};this.editActionHandler(e)}},{key:"zoomIn",value:function(){this.canvasContents&&this.getSVGCanvasD3().zoomIn()}},{key:"zoomOut",value:function(){this.canvasContents&&this.getSVGCanvasD3().zoomOut()}},{key:"zoomToFit",value:function(){this.canvasContents&&this.getSVGCanvasD3().zoomToFit()}},{key:"zoomTo",value:function(e){this.canvasContents&&this.getSVGCanvasD3().zoomTo(e)}},{key:"translateBy",value:function(e,t,n){this.canvasContents&&this.getSVGCanvasD3().translateBy(e,t,n)}},{key:"getZoom",value:function(){return this.canvasContents?this.getSVGCanvasD3().getZoom():null}},{key:"getZoomToReveal",value:function(e,t,n){return this.canvasContents?this.getSVGCanvasD3().getZoomToReveal(e,t,n):null}},{key:"clearSavedZoomValues",value:function(){this.objectModel.clearSavedZoomValues()}},{key:"getGhostNode",value:function(e){if(this.canvasContents){var t=this.convertNodeTemplate(e);return t=this.objectModel.setNodeAttributes(t),this.getSVGCanvasD3().getGhostNode(t)}return null}},{key:"nodeTemplateDragStart",value:function(e){n.dragNodeTemplate=e,this.canvasContents&&this.getSVGCanvasD3().nodeTemplateDragStart(n.dragNodeTemplate)}},{key:"nodeTemplateDragEnd",value:function(){this.canvasContents&&n.dragNodeTemplate&&this.getSVGCanvasD3().nodeTemplateDragEnd(n.dragNodeTemplate),n.dragNodeTemplate=null}},{key:"getDragNodeTemplate",value:function(){return n.dragNodeTemplate}},{key:"cutToClipboard",value:function(){this.editActionHandler({editType:"cut",editSource:"api"})}},{key:"copyToClipboard",value:function(){this.editActionHandler({editType:"copy",editSource:"api"})}},{key:"pasteFromClipboard",value:function(e){this.editActionHandler({editType:"paste",editSource:"api",pipelineId:e})}},{key:"isClipboardEmpty",value:function(){return this.objectModel.isClipboardEmpty()}},{key:"canPaste",value:function(){return!this.isClipboardEmpty()}},{key:"canCutCopy",value:function(){return this.getSelectedObjectIds().length>0&&!(this.areAllSelectedObjectsLinks()&&!this.areDetachableLinksInUse())}},{key:"canDelete",value:function(){return this.getSelectedObjectIds().length>0}},{key:"canZoomIn",value:function(){return!this.isPrimaryPipelineEmpty()&&(!this.getSVGCanvasD3()||!this.getSVGCanvasD3().isZoomedToMax())}},{key:"canZoomOut",value:function(){return!this.isPrimaryPipelineEmpty()&&(!this.getSVGCanvasD3()||!this.getSVGCanvasD3().isZoomedToMin())}},{key:"canZoomToFit",value:function(){return!this.isPrimaryPipelineEmpty()}},{key:"getSavedZoom",value:function(e){return this.objectModel.getSavedZoom(e)}},{key:"openTip",value:function(e){if(!this.isTipOpen()&&this.isTipEnabled(e.type)){if(this.handlers.tipHandler){var t={};switch(e.type){case o.TIP_TYPE_PALETTE_ITEM:t.nodeTemplate=e.nodeTemplate;break;case o.TIP_TYPE_PALETTE_CATEGORY:t.category=e.category;break;case o.TIP_TYPE_NODE:t.pipelineId=e.pipelineId,t.node=e.node;break;case o.TIP_TYPE_PORT:t.pipelineId=e.pipelineId,t.node=e.node,t.port=e.port;break;case o.TIP_TYPE_DEC:t.pipelineId=e.pipelineId,t.decoration=e.decoration;break;case o.TIP_TYPE_LINK:t.pipelineId=e.pipelineId,t.link=e.link;break;case o.TIP_TYPE_STATE_TAG:t.stateTagText=e.stateTagText,t.stateTagType=e.stateTagType}e.customContent=this.handlers.tipHandler(e.type,t)}var n=this;this.pendingTooltip&&clearTimeout(this.pendingTooltip),this.pendingTooltip=setTimeout((function(){n.objectModel.setTooltipDef(e)}),e.delay?e.delay:200)}}},{key:"closeTip",value:function(){this.pendingTooltip&&clearTimeout(this.pendingTooltip),this.isTipOpen()&&this.objectModel.setTooltipDef({})}},{key:"isTipOpen",value:function(){return this.objectModel.isTooltipOpen()}},{key:"isTipEnabled",value:function(e){var n=this.getCanvasConfig();switch(e){case o.TIP_TYPE_PALETTE_CATEGORY:return!0===n.tipConfig.palette||t.get_1(n,"tipConfig.palette.categories",!1);case o.TIP_TYPE_PALETTE_ITEM:return!0===n.tipConfig.palette||t.get_1(n,"tipConfig.palette.nodeTemplates",!1);case o.TIP_TYPE_NODE:return n.tipConfig.nodes;case o.TIP_TYPE_PORT:return n.tipConfig.ports;case o.TIP_TYPE_DEC:return n.tipConfig.decorations;case o.TIP_TYPE_LINK:return n.tipConfig.links;case o.TIP_TYPE_STATE_TAG:return n.tipConfig.stateTag;default:return!1}}},{key:"openTextToolbar",value:function(e,t,n,i){this.objectModel.setTextToolbarDef({isOpen:!0,pos_x:e,pos_y:t,actionHandler:n,blurHandler:i})}},{key:"closeTextToolbar",value:function(){this.objectModel.setTextToolbarDef({isOpen:!1})}},{key:"moveTextToolbar",value:function(e,t){this.objectModel.setTextToolbarDef({pos_x:e,pos_y:t})}},{key:"createDroppedExternalObject",value:function(e,t,n){e&&("createFromObject"===e.operation?this.createNodeFromObjectAt(e.sourceId,e.sourceObjectTypeId,e.label,t.x,t.y,n):this.createNodeFromDataAt(t.x,t.y,e,n))}},{key:"createAutoNode",value:function(e){var t=this.objectModel.getSelectionAPIPipeline(),n={editType:"createAutoNode",editSource:"canvas",nodeTemplate:e,pipelineId:(t||this.objectModel.getAPIPipeline()).pipelineId};this.editActionHandler(n)}},{key:"createNodeFromTemplateAt",value:function(e,t,n){var i={editType:"createNode",editSource:"canvas",nodeTemplate:e,offsetX:t.x,offsetY:t.y,pipelineId:n};this.editActionHandler(i)}},{key:"createNodeFromTemplateOnLinkAt",value:function(e,t,n,i){if(this.canNewNodeBeDroppedOnLink(e)){var o={editType:"createNodeOnLink",editSource:"canvas",nodeTemplate:e,offsetX:n.x,offsetY:n.y,link:t,pipelineId:i};this.editActionHandler(o)}}},{key:"createNodeFromTemplateAttachLinks",value:function(e,t,n,i){if(t&&this.canNewNodeBeAttachedToLinks(e)){var o={editType:"createNodeAttachLinks",editSource:"canvas",nodeTemplate:e,offsetX:n.x,offsetY:n.y,detachedLinks:t,pipelineId:i};this.editActionHandler(o)}}},{key:"createNodeFromObjectAt",value:function(e,t,n,i,o,r){var a={editType:"createNode",editSource:"canvas",label:n,offsetX:i,offsetY:o,sourceObjectId:e,sourceObjectTypeId:t,pipelineId:r};this.editActionHandler(a)}},{key:"createNodeFromDataAt",value:function(e,t,n,i){if(null!=n&&n.data){var o=n.data;o.offsetX=e,o.offsetY=t,o.pipelineId=i,o.editSource="canvas",this.editActionHandler(o)}}},{key:"canNewNodeBeDroppedOnLink",value:function(e){return!!(e.inputs&&e.inputs.length>0&&e.outputs&&e.outputs.length>0)}},{key:"canNewNodeBeAttachedToLinks",value:function(e){return!!(e.inputs&&e.inputs.length>0||e.outputs&&e.outputs.length>0)}},{key:"isContextMenuForNonSelectedObj",value:function(e){return!(!this.getCanvasConfig().enableContextToolbar||!e.targetObject)&&!e.selectedObjectIds.includes(e.targetObject.id)}},{key:"contextMenuHandler",value:function(e){var t=function(e,t){pn=t;var n,i=yn(e);if("function"==typeof pn.handlers.contextMenuHandler){var o=pn.handlers.contextMenuHandler(e,i);o&&o.length>0&&(n=o)}else n=i;return n&&n.length>0&&!1===pn.getCanvasConfig().enableEditingActions&&(n=fn(n)),n&&n.length>0&&(n=hn(n)),n}(e,this);t&&t.length>0&&this.openContextMenu(t,e)}},{key:"contextMenuActionHandler",value:function(e,t){var n=this.getContextMenuSource();this.logger.log("contextMenuActionHandler - action: "+e),this.logger.log(n),this.closeContextMenu(),this.getCanvasConfig().enableContextToolbar&&this.isContextMenuForNonSelectedObj(n)&&this.setSelections([n.targetObject.id]),this.canvasContents.focusOnCanvas();var i=Object.assign({},n,{editType:e,editParam:t,editSource:"contextmenu"});this.editActionHandler(i)}},{key:"toolbarActionHandler",value:function(e){this.logger.log("toolbarActionHandler - action: "+e),this.editActionHandler({editType:e,editSource:"toolbar",pipelineId:this.objectModel.getSelectedPipelineId()})}},{key:"keyboardActionHandler",value:function(e,t){this.logger.log("keyboardActionHandler - action: "+e),this.editActionHandler({editType:e,editSource:"keyboard",pipelineId:this.objectModel.getSelectedPipelineId(),mousePos:t})}},{key:"clickActionHandler",value:function(e){this.logger.log("clickActionHandler - "+e.clickType+" on "+e.objectType),this.handlers.clickActionHandler&&this.handlers.clickActionHandler(e)}},{key:"decorationActionHandler",value:function(e,t,n){this.logger.log("decorationActionHandler - node: "+e.id+" id: "+t),this.handlers.decorationActionHandler&&this.handlers.decorationActionHandler(e,t,n)}},{key:"editActionHandler",value:function(e){this.logger.log("editActionHandler - "+e.editType),this.logger.log(e);var t=e;if(t.selectedObjectIds=this.getSelectedObjectIds(),t.selectedObjects=this.getSelectedObjects(),"createSuperNodeExternal"===t.editType||"convertSuperNodeLocalToExternal"===t.editType?(t.externalUrl="",t.externalPipelineFlowId=""):"loadPipelineFlow"!==t.editType&&"expandSuperNodeInPlace"!==t.editType&&"displaySubPipeline"!==t.editType&&"deconstructSuperNode"!==t.editType&&"convertSuperNodeExternalToLocal"!==t.editType||(t=this.preProcessForExternalPipelines(t)),this.handlers.beforeEditActionHandler){var n=null;if("undo"===t.editType?n=this.getCommandStack().getUndoCommand():"redo"===t.editType&&(n=this.getCommandStack().getRedoCommand()),!(t=this.handlers.beforeEditActionHandler(t,n)))return;if(!this.wasExtPipelineFlowLoadSuccessful(t))return}this.editAction(t)}},{key:"editAction",value:function(e){var t=e;if("deleteSelectedObjects"!==t.editType||0!==t.selectedObjectIds.length){switch(t.editType){case"selectAll":this.selectAll(t.pipelineId);break;case"zoomIn":this.zoomIn();break;case"zoomOut":this.zoomOut();break;case"zoomToFit":this.zoomToFit();break;case"commentsHide":this.hideComments();break;case"commentsShow":this.showComments();break;case"setCommentEditingMode":this.setCommentEditingMode(t.id,t.pipelineId);break;case"setNodeLabelEditingMode":this.setNodeLabelEditingMode(t.id,t.pipelineId);break;case"setZoom":this.objectModel.setZoom(t.zoom,t.pipelineId);break;case"togglePalette":this.togglePalette();break;case"paletteOpen":this.openPalette();break;case"paletteClose":this.closePalette();break;case"toggleNotificationPanel":this.toggleNotificationPanel();break;case"loadPipelineFlow":this.objectModel.ensurePipelineIsLoaded(t)}var n=null;if(this.getCanvasConfig().enableInternalObjectModel)switch(t.editType){case"createNode":n=new G(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createNodeOnLink":n=new K(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createNodeAttachLinks":n=new X(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createAutoNode":var i=this.getCanvasConfig().enableAutoLinkOnlyFromSelNodes;n=new M(t,this.objectModel,this.labelUtil,i),this.commandStack.do(n),this.panToReveal(t),t=n.getData();break;case"createComment":n=new U(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"createAutoComment":var r=this.getNewCommentPosition(t.pipelineId);n=new U(t,this.objectModel,this.labelUtil,r),this.commandStack.do(n),t=n.getData();break;case"insertNodeIntoLink":n=new Oe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"attachNodeToLinks":n=new T(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"moveObjects":n=new je(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"resizeObjects":n=new un(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"setObjectsStyle":n=new Fe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"setLinksStyle":n=new He(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"updateLink":n=new qe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"setNodeLabel":n=new Ie(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"editComment":n=new ve(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"editDecorationLabel":n=new Pe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"linkNodes":n=new V(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"linkNodesAndReplace":n=new V(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"linkComment":n=new B(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"createDetachedLink":n=new $(t,this.objectModel,this.labelUtil),this.commandStack.do(n),t=n.getData();break;case"colorSelectedObjects":n=new re(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"deleteSelectedObjects":n=new ue(t,this.objectModel,this.labelUtil,this.areDetachableLinksInUse()),this.commandStack.do(n);break;case"displaySubPipeline":n=new me(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"displayPreviousPipeline":n=new ge(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"arrangeHorizontally":n=new C(t,this.objectModel,this.labelUtil,o.HORIZONTAL),this.commandStack.do(n);break;case"arrangeVertically":n=new C(t,this.objectModel,this.labelUtil,o.VERTICAL),this.commandStack.do(n);break;case"createSuperNode":case"createSuperNodeExternal":n=new te(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableUseCardFromOriginalPorts),this.commandStack.do(n);break;case"deconstructSuperNode":n=new se(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableMoveNodesOnSupernodeResize),this.commandStack.do(n);break;case"expandSuperNodeInPlace":n=new Ee(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableMoveNodesOnSupernodeResize),this.commandStack.do(n);break;case"collapseSuperNodeInPlace":n=new ie(t,this.objectModel,this.labelUtil,this.getCanvasConfig().enableMoveNodesOnSupernodeResize),this.commandStack.do(n);break;case"convertSuperNodeExternalToLocal":n=new L(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"convertSuperNodeLocalToExternal":n=new x(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"deleteLink":n=new ce(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"disconnectNode":n=new fe(t,this.objectModel,this.labelUtil),this.commandStack.do(n);break;case"saveToPalette":n=new Ae(t,this.objectModel,this.labelUtil,this.labelUtil),this.commandStack.do(n);break;case"cut":this.objectModel.copyToClipboard(this.areDetachableLinksInUse()),n=new ue(t,this.objectModel,this.labelUtil,this.areDetachableLinksInUse()),this.commandStack.do(n);break;case"copy":this.objectModel.copyToClipboard(this.areDetachableLinksInUse());break;case"paste":var a=this.objectModel.getObjectsToPaste();if(a){t.objects=a;var s=this.getSVGCanvasD3().getTransformedViewportDimensions();n=new we(t,this.objectModel,this.labelUtil,s,this.areDetachableLinksInUse(),this.isSnapToGridInUse()),this.commandStack.do(n),t=n.getData()}break;case"undo":n=this.getCommandStack().getUndoCommand(),this.commandStack.undo();break;case"redo":n=this.getCommandStack().getRedoCommand(),this.commandStack.redo();break;case"highlightBranch":t.highlightedObjectIds=this.highlightBranch(this.objectModel.getSelectedNodesIds(),t.pipelineId);break;case"highlightDownstream":t.highlightedObjectIds=this.highlightDownstream(this.objectModel.getSelectedNodesIds(),t.pipelineId);break;case"highlightUpstream":t.highlightedObjectIds=this.highlightUpstream(this.objectModel.getSelectedNodesIds(),t.pipelineId);break;case"unhighlight":this.removeAllStyles(!0),this.highlight=!1;break;case"openNotificationPanel":this.openNotificationPanel();break;case"closeNotificationPanel":this.closeNotificationPanel()}this.handlers.editActionHandler&&this.handlers.editActionHandler(t,n),this.ensureVisibleExpandedPipelinesAreLoaded()}}},{key:"preProcessForExternalPipelines",value:function(e){if(e.externalPipelineFlowLoad=!1,e.targetObject){var n=t.get_1(e,"targetObject.subflow_ref.url");n&&(e.externalUrl=n,e.externalPipelineFlow=this.objectModel.getExternalPipelineFlow(n),e.externalPipelineFlow||(e.externalPipelineFlowLoad=!0))}return e}},{key:"ensureVisibleExpandedPipelinesAreLoaded",value:function(){var e=this.objectModel.getVisibleExpandedExternalSupernodes();e&&e.length>0&&this.editActionHandler({editType:"loadPipelineFlow",targetObject:e[0]})}},{key:"wasExtPipelineFlowLoadSuccessful",value:function(e){if(e.externalPipelineFlowLoad&&!e.externalPipelineFlow){var t="The host app did not provide a pipeline flow when requested for action "+e.editType+" in beforeEditActionHandler, for URL: "+e.externalUrl;return this.logger.error(t),!1}return!0}},{key:"panToReveal",value:function(e){var t=this;this.addAfterUpdateCallback((function n(){var i=t.getZoomToReveal([e.newNode.id]);i&&t.zoomTo(i),t.removeAfterUpdateCallback(n)}))}}]),n}();kn.dragNodeTemplate=null,exports.CanvasController=kn,exports.CanvasUtils=h,exports.CanvasUtils$1=S,exports._castFunction=y,exports.defaultMessages1=u;
|
|
2
|
+
//# sourceMappingURL=canvas-controller-7beb80ec.js.map
|