|
|
- /*!
- * This file is part of Cytoscape.js 2.4.5.
- *
- * Cytoscape.js is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation, either version 3 of the License, or (at your option) any
- * later version.
- *
- * Cytoscape.js is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public License along with
- * Cytoscape.js. If not, see <http://www.gnu.org/licenses/>.
- */
- var cytoscape;!function(e){"use strict";var t=cytoscape=function(){return cytoscape.init.apply(cytoscape,arguments)};t.version="2.4.5",t.init=function(e){return void 0===e&&(e={}),t.is.plainObject(e)?new t.Core(e):t.is.string(e)?t.extension.apply(t.extension,arguments):void 0},t.fn={},"undefined"!=typeof module&&module.exports&&(module.exports=cytoscape),"undefined"!=typeof define&&define.amd&&define("cytoscape",function(){return cytoscape}),e&&(e.cytoscape=cytoscape)}("undefined"==typeof window?null:window),this.cytoscape=cytoscape,function(e){"use strict";var t=0,r=1,i=2,n=function(e){return this instanceof n?(this.id="Thenable/1.0.7",this.state=t,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},void("function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this)))):new n(e)};n.prototype={fulfill:function(e){return a(this,r,"fulfillValue",e)},reject:function(e){return a(this,i,"rejectReason",e)},then:function(e,t){var r=this,i=new n;return r.onFulfilled.push(l(e,i,"fulfill")),r.onRejected.push(l(t,i,"reject")),o(r),i.proxy}};var a=function(e,r,i,n){return e.state===t&&(e.state=r,e[i]=n,o(e)),e},o=function(e){e.state===r?s(e,"onFulfilled",e.fulfillValue):e.state===i&&s(e,"onRejected",e.rejectReason)},s=function(e,t,r){if(0!==e[t].length){var i=e[t];e[t]=[];var n=function(){for(var e=0;e<i.length;e++)i[e](r)};"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick(n):"function"==typeof setImmediate?setImmediate(n):setTimeout(n,0)}},l=function(e,t,r){return function(i){if("function"!=typeof e)t[r].call(t,i);else{var n;try{n=e(i)}catch(a){return void t.reject(a)}u(t,n)}}},u=function(e,t){if(e===t||e.proxy===t)return void e.reject(new TypeError("cannot resolve promise with itself"));var r;if("object"==typeof t&&null!==t||"function"==typeof t)try{r=t.then}catch(i){return void e.reject(i)}if("function"!=typeof r)e.fulfill(t);else{var n=!1;try{r.call(t,function(r){n||(n=!0,r===t?e.reject(new TypeError("circular thenable chain")):u(e,r))},function(t){n||(n=!0,e.reject(t))})}catch(i){n||e.reject(i)}}};e.Promise="undefined"==typeof Promise?n:Promise,e.Promise.all=e.Promise.all||function(t){return new e.Promise(function(e,r){for(var i=new Array(t.length),n=0,a=function(r,a){i[r]=a,n++,n===t.length&&e(i)},o=0;o<t.length;o++)!function(e){var i=t[e],n=null!=i.then;if(n)i.then(function(t){a(e,t)},function(e){r(e)});else{var o=i;a(e,o)}}(o)})}}(cytoscape),function(e,t){"use strict";var r="string",i=typeof{},n="function";e.is={defined:function(e){return null!=e},string:function(e){return null!=e&&typeof e==r},fn:function(e){return null!=e&&typeof e===n},array:function(e){return Array.isArray?Array.isArray(e):null!=e&&e instanceof Array},plainObject:function(t){return null!=t&&typeof t===i&&!e.is.array(t)&&t.constructor===Object},object:function(e){return null!=e&&typeof e===i},number:function(e){return null!=e&&"number"==typeof e&&!isNaN(e)},integer:function(t){return e.is.number(t)&&Math.floor(t)===t},color:function(e){return null!=e&&"string"==typeof e&&""!==$.Color(e).toString()},bool:function(e){return null!=e&&typeof e==typeof!0},elementOrCollection:function(t){return e.is.element(t)||e.is.collection(t)},element:function(t){return t instanceof e.Element&&t._private.single},collection:function(t){return t instanceof e.Collection&&!t._private.single},core:function(t){return t instanceof e.Core},style:function(t){return t instanceof e.Style},stylesheet:function(t){return t instanceof e.Stylesheet},event:function(t){return t instanceof e.Event},thread:function(t){return t instanceof e.Thread},fabric:function(t){return t instanceof e.Fabric},emptyString:function(t){return t?e.is.string(t)&&(""===t||t.match(/^\s+$/))?!0:!1:!0},nonemptyString:function(t){return t&&e.is.string(t)&&""!==t&&!t.match(/^\s+$/)?!0:!1},domElement:function(e){return"undefined"==typeof HTMLElement?!1:e instanceof HTMLElement},boundingBox:function(t){return e.is.plainObject(t)&&e.is.number(t.x1)&&e.is.number(t.x2)&&e.is.number(t.y1)&&e.is.number(t
- return"undefined"!=typeof ActiveXObject||!1},windows:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Win/i)},mac:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Mac/i)},linux:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/Linux/i)},unix:function(){return"undefined"!=typeof navigator&&navigator.appVersion.match(/X11/i)}}}(cytoscape,"undefined"==typeof window?null:window),function(e,t){"use strict";e.util={extend:function(){var t,r,i,n,a,o,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||e.is.fn(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(t=arguments[l]))for(r in t)i=s[r],n=t[r],s!==n&&(c&&n&&(e.is.plainObject(n)||(a=e.is.array(n)))?(a?(a=!1,o=i&&e.is.array(i)?i:[]):o=i&&e.is.plainObject(i)?i:{},s[r]=e.util.extend(c,o,n)):void 0!==n&&(s[r]=n));return s},require:function(r,i,n){var a;n=e.util.extend({msgIfNotFound:!0},n);var o=!1,s=function(e){o=!0,i(e)},l=function(e){t&&(a=t[r]),void 0!==a&&s(a),e&&e()},u=function(){o||c(d)},c=function(e){"undefined"!=typeof module&&module.exports&&require&&(a=require(r)),void 0!==a&&s(a),e&&e()},d=function(){o||h(p)},h=function(e){"undefined"!=typeof define&&define.amd&&require&&require([r],function(t){a=t,void 0!==a&&s(a),e&&e()})},p=function(){!o&&n.msgIfNotFound&&e.util.error("Cytoscape.js tried to pull in dependency `"+r+"` but no module (i.e. CommonJS, AMD, or window) was found")};l(u)},requires:function(t,r){for(var i=[],n=[],a=function(){for(var e=0;e<t.length;e++)if(!n[e])return;r.apply(r,i)},o=0;o<t.length;o++)!function(){var r=t[o],s=o;e.util.require(r,function(e){i[s]=e,n[s]=!0,a()})}()},throttle:function(t,r,i){var n=!0,a=!0;return i===!1?n=!1:e.is.plainObject(i)&&(n="leading"in i?i.leading:n,a="trailing"in i?i.trailing:a),i=i||{},i.leading=n,i.maxWait=r,i.trailing=a,e.util.debounce(t,r,i)},now:function(){return+new Date},debounce:function(t,r,i){var n,a,o,s,l,u,c,d=0,h=!1,p=!0;if(e.is.fn(t)){if(r=Math.max(0,r)||0,i===!0){var v=!0;p=!1}else e.is.plainObject(i)&&(v=i.leading,h="maxWait"in i&&(Math.max(r,i.maxWait)||0),p="trailing"in i?i.trailing:p);var f=function(){var i=r-(e.util.now()-s);if(0>=i){a&&clearTimeout(a);var h=c;a=u=c=void 0,h&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))}else u=setTimeout(f,i)},g=function(){u&&clearTimeout(u),a=u=c=void 0,(p||h!==r)&&(d=e.util.now(),o=t.apply(l,n),u||a||(n=l=null))};return function(){if(n=arguments,s=e.util.now(),l=this,c=p&&(u||!v),h===!1)var i=v&&!u;else{a||v||(d=s);var y=h-(s-d),m=0>=y;m?(a&&(a=clearTimeout(a)),d=s,o=t.apply(l,n)):a||(a=setTimeout(g,y))}return m&&u?u=clearTimeout(u):u||r===h||(u=setTimeout(f,r)),i&&(m=!0,o=t.apply(l,n)),!m||u||a||(n=l=null),o}}},error:function(e){if(!console)throw e;if(console.error)console.error.apply(console,arguments);else{if(!console.log)throw e;console.log.apply(console,arguments)}},clone:function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t},copy:function(t){return null==t?t:e.is.array(t)?t.slice():e.is.plainObject(t)?e.util.clone(t):t},makeBoundingBox:function(e){if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},mapEmpty:function(e){var t=!0;if(null!=e)for(var r in e){t=!1;break}return t},pushMap:function(t){var r=e.util.getMap(t);null==r?e.util.setMap($.extend({},t,{value:[t.value]})):r.push(t.value)},setMap:function(t){for(var r,i=t.map,n=t.keys,a=n.length,o=0;a>o;o++){var r=n[o];e.is.plainObject(r)&&e.util.error("Tried to set map with object key"),o<n.length-1?(null==i[r]&&(i[r]={}),i=i[r]):i[r]=t.value}},getMap:function(t){for(var r=t.map,i=t.keys,n=i.length,a=0;n>a;a++){var o=i[a];if(e.is.plainObject(o)&&e.util.error("Tried to get map with object key"),r=r[o],null==r)return r}return r},deleteMap:function(t){for(var r=t.map,i=t.keys,n=i.length,a=t.keepChildren,o=0;n>o;o++){var s=i[o];e.is.plainObject(s)&&e.
-
- return n?n._private.animation.current.length>0:void 0}},clearQueue:function(t){var r={};return t=e.util.extend({},r,t),function(){var e=this,t=void 0!==e.length,r=t?e:[e],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var n=0;n<r.length;n++){var a=r[n];a._private.animation.queue=[]}return this}},delay:function(t){var r={};return t=e.util.extend({},r,t),function(e,t){var r=this._private.cy||this;return r.styleEnabled()?(this.animate({delay:e},{duration:e,complete:t}),this):this}},animate:function(t){var r={};return t=e.util.extend({},r,t),function(e,t){var r=this,i=void 0!==r.length,n=i?r:[r],a=this._private.cy||this,o=!i,s=!o;if(!a.styleEnabled())return this;var l,u=+new Date,c=a.style();switch(void 0===t&&(t={}),void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}var d=!0;if(e)for(var h in e){d=!1;break}if(d)return this;if(e.css&&s&&(e.css=c.getValueStyle(e.css,{array:!0})),e.renderedPosition&&s){var p=e.renderedPosition,v=a.pan(),f=a.zoom();e.position={x:(p.x-v.x)/f,y:(p.y-v.y)/f}}if(e.panBy&&o){var g=e.panBy,y=a.pan();e.pan={x:y.x+g.x,y:y.y+g.y}}var m=e.center||e.centre;if(m&&o){var x=a.getCenterPan(m.eles,e.zoom);x&&(e.pan=x)}if(e.fit&&o){var b=e.fit,w=a.getFitViewport(b.eles||b.boundingBox,b.padding);w&&(e.pan=w.pan,e.zoom=w.zoom)}for(var h=0;h<n.length;h++){var _=n[h];l=_.animated()&&(void 0===t.queue||t.queue)?_._private.animation.queue:_._private.animation.current,l.push({properties:e,duration:t.duration,params:t,callTime:u})}return s&&a.addToAnimationPool(this),this}},stop:function(t){var r={};return t=e.util.extend({},r,t),function(e,t){var r=this,i=void 0!==r.length,n=i?r:[r],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var o=0;o<n.length;o++){for(var s=n[o],l=s._private.animation.current,u=0;u<l.length;u++){var c=l[u];t&&(c.duration=0)}e&&(s._private.animation.queue=[]),t||(s._private.animation.current=[])}return a.notify({collection:this,type:"draw"}),this}}}}(cytoscape),function(e){"use strict";e.fn.selector=function(t,r){for(var i in t){var n=t[i];e.Selector.prototype[i]=n}},e.Selector=function(t,r){if(!(this instanceof e.Selector))return new e.Selector(t,r);void 0===r&&void 0!==t&&(r=t,t=void 0);var i=this;if(i._private={selectorText:null,invalid:!0},!r||e.is.string(r)&&r.match(/^\s*$/))null==t?i.length=0:(i[0]=o(),i[0].group=t,i.length=1);else if(e.is.element(r)){var n=new e.Collection(i.cy(),[r]);i[0]=o(),i[0].collection=n,i.length=1}else if(e.is.collection(r))i[0]=o(),i[0].collection=r,i.length=1;else if(e.is.fn(r))i[0]=o(),i[0].filter=r,i.length=1;else{if(!e.is.string(r))return void e.util.error("A selector must be created from a string; found "+r);var a=null,o=function(){return{classes:[],colonSelectors:[],data:[],group:null,ids:[],meta:[],collection:null,filter:null,parent:null,ancestor:null,subject:null,child:null,descendant:null}},s={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])+"|'+"'(?:\\\\'|[^'])+'",number:e.util.regex.number,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$"};s.variable="(?:[\\w-]|(?:\\\\"+s.metaChar+"))+",s.value=s.string+"|"+s.number,s.className=s.variable,s.id=s.variable;for(var l=function(e){return e.replace(new RegExp("\\\\("+s.metaChar+")","g"),function(e,t,r,i){return t})},u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];s.comparatorOp+="|@"+d}for(var u=s.comparatorOp.split("|"),c=0;c<u.length;c++){var d=u[c];d.indexOf("!")>=0||"="!==d&&(s.comparatorOp+="|\\!"+d)}var h={group:{query:!0,regex:"(node|edge|\\*)",populate:function(e){this.group="*"==e?e:e+"s"}},state:{query:!0,regex:"(:selected|:unselected|:locked|:unlocked|:visible|:hidden|:transparent|:grabbed|:free|:removed|:inside|:grabbable|:ungrabbable|:animated|:unanimated|:selectable|:unselectable|:orphan|:nonorphan|:parent|:child|:loop|:simple|:active|:inactive|:touch|:backgrounding|:nonbackgrounding)",populate:function
-
- }n||v(),n.mapping=a,a=n;break;case s.fn:var N=a.value,I=N(t);n=this.parse(a.name,I,a.bypass,!0),n.mapping=a,a=n;break;case void 0:break;default:return!1}return u?(a.bypassed=d?c.bypassed:c,o[a.name]=a):d?c.bypassed=a:o[a.name]=a,!0},e.styfn.update=function(){var e=this._private.cy,t=e.elements();t.updateStyle()},e.styfn.updateMappers=function(t){for(var r=0;r<t.length;r++){for(var i=t[r],n=i._private.style,a=0;a<e.style.properties.length;a++){var o=e.style.properties[a],s=n[o.name];if(s&&s.mapping){var l=s.mapping;this.applyParsedProperty(i,l)}}this.updateStyleHints(i)}},e.styfn.updateTransitions=function(t,r,i){var n=this,a=t._private.style,o=a["transition-property"].value,s=a["transition-duration"].msValue,l=a["transition-delay"].msValue,u={};if(o.length>0&&s>0){for(var c=!1,d=0;d<o.length;d++){var h=o[d],p=a[h],v=r[h];if(v){var f=v.prev,g=f,y=null!=v.next?v.next:p,m=!1;g&&(e.is.number(g.pxValue)&&e.is.number(y.pxValue)?m=g.pxValue!==y.pxValue:e.is.number(g.value)&&e.is.number(y.value)?m=g.value!==y.value:e.is.array(g.value)&&e.is.array(y.value)&&(m=g.value[0]!==y.value[0]||g.value[1]!==y.value[1]||g.value[2]!==y.value[2]),m&&(u[h]=y.strValue,this.applyBypass(t,h,g.strValue),c=!0))}}if(!c)return;t._private.transitioning=!0,t.stop(),l>0&&t.delay(l),t.animate({css:u},{duration:s,queue:!1,complete:function(){i||n.removeBypasses(t,o),t._private.transitioning=!1}})}else t._private.transitioning&&(t.stop(),this.removeBypasses(t,o),t._private.transitioning=!1)}}(cytoscape),function(e){"use strict";e.styfn.applyBypass=function(t,r,i,n){var a=[],o=!0;if("*"===r||"**"===r){if(void 0!==i)for(var s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],r=l.name,u=this.parse(r,i,!0);u&&a.push(u)}}else if(e.is.string(r)){var u=this.parse(r,i,!0);u&&a.push(u)}else{if(!e.is.plainObject(r))return!1;var c=r;n=i;for(var s=0;s<e.style.properties.length;s++){var l=e.style.properties[s],r=l.name,i=c[r];if(void 0===i&&(i=c[e.util.dash2camel(r)]),void 0!==i){var u=this.parse(r,i,!0);u&&a.push(u)}}}if(0===a.length)return!1;for(var d=!1,s=0;s<t.length;s++){for(var h,p=t[s],v=p._private.style,f={},g=0;g<a.length;g++){var l=a[g];if(n){var y=v[l.name];h=f[l.name]={prev:y}}d=this.applyParsedProperty(p,l)||d,n&&(h.next=v[l.name])}n&&this.updateTransitions(p,f,o)}return d},e.styfn.overrideBypass=function(t,r,i){for(var n=0;n<t.length;n++){var a=t[n],o=a._private.style[e.util.camel2dash(r)];o.bypass?(o.value=i,o.pxValue=i):this.applyBypass(a,r,i)}},e.styfn.removeAllBypasses=function(t,r){for(var i=!0,n=0;n<t.length;n++){for(var a=t[n],o={},s=a._private.style,l=0;l<e.style.properties.length;l++){var u=e.style.properties[l],c=u.name,d="",h=this.parse(c,d,!0),p=s[u.name],v=o[u.name]={prev:p};this.applyParsedProperty(a,h),v.next=s[u.name]}r&&this.updateTransitions(a,o,i)}},e.styfn.removeBypasses=function(t,r,i){for(var n=!0,a=0;a<t.length;a++){for(var o=t[a],s={},l=o._private.style,u=0;u<r.length;u++){var c=r[u],d=e.style.properties[c],h="",p=this.parse(c,h,!0),v=l[d.name],f=s[d.name]={prev:v};this.applyParsedProperty(o,p),f.next=l[d.name]}i&&this.updateTransitions(o,s,n)}}}(cytoscape),function(e,t){"use strict";e.styfn.getEmSizeInPixels=function(){var e=this._private.cy,r=e.container();if(t&&r&&t.getComputedStyle){var i=t.getComputedStyle(r).getPropertyValue("font-size"),n=parseFloat(i);return n}return 1},e.styfn.containerCss=function(e){var r=this._private.cy,i=r.container();return t&&i&&t.getComputedStyle?t.getComputedStyle(i).getPropertyValue(e):void 0},e.styfn.containerProperty=function(e){var t=this.containerCss(e),r=this.parse(e,t);return r},e.styfn.containerPropertyAsString=function(e){var t=this.containerProperty(e);return t?t.strValue:void 0}}(cytoscape,"undefined"==typeof window?null:window),function(e){"use strict";e.styfn.getRenderedStyle=function(t){var t=t[0];if(t){for(var r={},i=t._private.style,n=this._private.cy,a=n.zoom(),o=0;o<e.style.properties.length;o++){var s=e.style.properties[o],l=i[s.name];if(l){var u=l.unitless?l.strValue:l.pxValue*a+"px";r[s.name]=u,r[e.util.dash2camel(s.name)]=u}}return r}},e.styfn.getRawStyle=functi
-
- break;case 2:r=s[0],i=s[1],"x"!==r&&"y"!==r||!e.is.number(i)||(l[r]+=i),this.trigger("pan viewport")}return this.notify({type:"viewport"}),this},fit:function(e,t){var r=this.getFitViewport(e,t);if(r){var i=this._private;i.zoom=r.zoom,i.pan=r.pan,this.trigger("pan zoom viewport"),this.notify({type:"viewport"})}return this},getFitViewport:function(t,r){if(e.is.number(t)&&void 0===r&&(r=t,t=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var i;if(e.is.string(t)){var n=t;t=this.$(n)}else if(e.is.boundingBox(t)){var a=t;i={x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2},i.w=i.x2-i.x1,i.h=i.y2-i.y1}else e.is.elementOrCollection(t)||(t=this.elements());i=i||t.boundingBox();var o,s=this.width(),l=this.height();if(r=e.is.number(r)?r:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(i.w)&&!isNaN(i.h)&&i.w>0&&i.h>0){o=Math.min((s-2*r)/i.w,(l-2*r)/i.h),o=o>this._private.maxZoom?this._private.maxZoom:o,o=o<this._private.minZoom?this._private.minZoom:o;var u={x:(s-o*(i.x1+i.x2))/2,y:(l-o*(i.y1+i.y2))/2};return{zoom:o,pan:u}}}},minZoom:function(t){return void 0===t?this._private.minZoom:(e.is.number(t)&&(this._private.minZoom=t),this)},maxZoom:function(t){return void 0===t?this._private.maxZoom:(e.is.number(t)&&(this._private.maxZoom=t),this)},zoom:function(t){var r,i;if(void 0===t)return this._private.zoom;if(e.is.number(t))i=t;else if(e.is.plainObject(t)){if(i=t.level,t.position){var n=t.position,a=this._private.pan,o=this._private.zoom;r={x:n.x*o+a.x,y:n.y*o+a.y}}else t.renderedPosition&&(r=t.renderedPosition);if(r&&!this._private.panningEnabled)return this}if(!this._private.zoomingEnabled)return this;if(!e.is.number(i)||r&&(!e.is.number(r.x)||!e.is.number(r.y)))return this;if(i=i>this._private.maxZoom?this._private.maxZoom:i,i=i<this._private.minZoom?this._private.minZoom:i,r){var s=this._private.pan,l=this._private.zoom,u=i,c={x:-u/l*(r.x-s.x)+r.x,y:-u/l*(r.y-s.y)+r.y};this._private.zoom=i,this._private.pan=c;var d=s.x!==c.x||s.y!==c.y;this.trigger(" zoom "+(d?" pan ":"")+" viewport ")}else this._private.zoom=i,this.trigger("zoom viewport");return this.notify({type:"viewport"}),this},viewport:function(t){var r=this._private,i=!0,n=!0,a=[],o=!1,s=!1;if(!t)return this;if(e.is.number(t.zoom)||(i=!1),e.is.plainObject(t.pan)||(n=!1),!i&&!n)return this;if(i){var l=t.zoom;l<r.minZoom||l>r.maxZoom||!r.zoomingEnabled?o=!0:(r.zoom=l,a.push("zoom"))}if(n&&(!o||!t.cancelOnFailedZoom)&&r.panningEnabled){var u=t.pan;e.is.number(u.x)&&(r.pan.x=u.x,s=!1),e.is.number(u.y)&&(r.pan.y=u.y,s=!1),s||a.push("pan")}return a.length>0&&(a.push("viewport"),this.trigger(a.join(" ")),this.notify({type:"viewport"})),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.trigger("pan viewport"),this.notify({type:"viewport"})),this},getCenterPan:function(t,r){if(this._private.panningEnabled){if(e.is.string(t)){var i=t;t=this.elements(i)}else e.is.elementOrCollection(t)||(t=this.elements());var n=t.boundingBox(),a=this.width(),o=this.height();r=void 0===r?this._private.zoom:r;var s={x:(a-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2};return s}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},width:function(){var e=this._private.container;return e?e.clientWidth:1},height:function(){var e=this._private.container;return e?e.clientHeight:1},extent:function(){var e=this._private.pan,t=this._private.zoom,r=this.renderedExtent(),i={x1:(r.x1-e.x)/t,x2:(r.x2-e.x)/t,y1:(r.y1-e.y)/t,y2:(r.y2-e.y)/t};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}}}),e.corefn.centre=e.corefn.center,e.corefn.autolockNodes=e.corefn.autolock,e.corefn.autoungrabifyNodes=e.corefn.autoungrabify}(cytoscape),function(e){"use strict";e.fn.collection=e.fn.eles=function(t,r){for(var i in t){var n=t[i];e.Collection.prototype[i]=n}};var t={prefix:{nodes:"n",edges:"e"},id:{nodes:0,edges:0},generate:function(t,r,i){var n=e.is.element(r)?r._private:r,a=n.group,o=null!=i?i:this.prefix[a]+this.id[a];if(t.getElementBy
- allowGetting:!0}),removeRscratch:e.define.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];return e?e._private.data.id:void 0},position:e.define.data({field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"rtrigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){var t=e.updateCompoundBounds();t.rtrigger("position")},canSet:function(e){return!e.locked()}}),silentPosition:e.define.data({field:"position",bindingEvent:"position",allowBinding:!1,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!1,triggerFnName:"trigger",allowGetting:!0,validKeys:["x","y"],onSet:function(e){e.updateCompoundBounds()},canSet:function(e){return!e.locked()}}),positions:function(t,r){if(e.is.plainObject(t))this.position(t);else if(e.is.fn(t)){for(var i=t,n=0;n<this.length;n++){var a=this[n],t=i.apply(a,[n,a]);if(t&&!a.locked()){var o=a._private.position;o.x=t.x,o.y=t.y}}var s=this.updateCompoundBounds(),l=s.length>0?this.add(s):this;r?l.trigger("position"):l.rtrigger("position")}return this},silentPositions:function(e){return this.positions(e,!0)},updateCompoundBounds:function(){function t(e){var t=e.children(),r=e._private.style,n="include"===r["compound-sizing-wrt-labels"].value,a=t.boundingBox({includeLabels:n,includeEdges:!0}),o={top:r["padding-top"].pxValue,bottom:r["padding-bottom"].pxValue,left:r["padding-left"].pxValue,right:r["padding-right"].pxValue},s=e._private.position,l=!1;"auto"===r.width.value&&(e._private.autoWidth=a.w+o.left+o.right,s.x=(a.x1+a.x2-o.left+o.right)/2,l=!0),"auto"===r.height.value&&(e._private.autoHeight=a.h+o.top+o.bottom,s.y=(a.y1+a.y2-o.top+o.bottom)/2,l=!0),l&&i.push(e)}var r=this.cy();if(!r.styleEnabled()||!r.hasCompoundNodes())return r.collection();for(var i=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var o=n[a];t(o)}n=n.parent()}return new e.Collection(r,i)},renderedPosition:function(t,r){var i=this[0],n=this.cy(),a=n.zoom(),o=n.pan(),s=e.is.plainObject(t)?t:void 0,l=void 0!==s||void 0!==r&&e.is.string(t);if(i&&i.isNode()){if(!l){var u=i._private.position;return s={x:u.x*a+o.x,y:u.y*a+o.y},void 0===t?s:s[t]}for(var c=0;c<this.length;c++){var i=this[c];void 0!==r?i._private.position[t]=(r-o[t])/a:void 0!==s&&(i._private.position={x:(s.x-o.x)/a,y:(s.y-o.y)/a})}this.rtrigger("position")}else if(!l)return void 0;return this},relativePosition:function(t,r){var i=this[0],n=this.cy(),a=e.is.plainObject(t)?t:void 0,o=void 0!==a||void 0!==r&&e.is.string(t),s=n.hasCompoundNodes();if(i&&i.isNode()){if(!o){var l=i._private.position,u=s?i.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var h=d?u._private.position:{x:0,y:0};return a={x:l.x-h.x,y:l.y-h.y},void 0===t?a:a[t]}for(var p=0;p<this.length;p++){var i=this[p],u=s?i.parent():null,c=u&&u.length>0,d=c;c&&(u=u[0]);var h=d?u._private.position:{x:0,y:0};void 0!==r?i._private.position[t]=r+h[t]:void 0!==a&&(i._private.position={x:a.x+h.x,y:a.y+h.y})}this.rtrigger("position")}else if(!o)return void 0;return this},width:function(){var e=this[0],t=e._private.cy,r=t._private.styleEnabled;if(e){if(r){var i=e._private.style.width;return"auto"===i.strValue?e._private.autoWidth:i.pxValue}return 1}},outerWidth:function(){var e=this[0],i=e._private.cy,n=i._private.styleEnabled;if(e){if(n){var a=e._private.style,o="auto"===a.width.strValue?e._private.autoWidth:a.width.pxValue,s=a["border-width"]?a["border-width"].pxValue*t+r:0;return o+s}return 1}},renderedWidth:function(){var e=this[0];if(e){var t=e.width();return t*this.cy().zoom()}},renderedOuterWidth:function(){var e=this[0];if(e){var t=e.outerWidth();return t*this.cy().zoom()}},height:function(){var e=this[0],t=e._private.cy,r=t._private.styleEnabled;if(e&&"nodes"===e._private.group){if(r){var i=e._private.style.height;return"auto"===i.strValue?e._private.autoHeight:i.pxValue}return 1}},outerHeight:function(){var e=this[0],i=e._private.cy,n=i._private.styleEnabled;if(e&&"nodes"===e._private.group){if(!n)return 1;var a=e._private.style,o="auto"===a.height.strValue?e._private.autoHeight:a.he
-
- },t.prototype.destroy=function(){this.destroyed=!0;for(var e=0;e<this.bindings.length;e++){var t=this.bindings[e],r=t;r.target.removeEventListener(r.event,r.handler,r.useCapture)}if(this.removeObserver&&this.removeObserver.disconnect(),this.labelCalcDiv)try{document.body.removeChild(this.labelCalcDiv)}catch(i){}};for(var i in e.math)t.prototype[i]=e.math[i];e("renderer","canvas",t)}(cytoscape),function(e){"use strict";var t=e("renderer","canvas"),r=t.prototype,i=t.arrowShapes={};t.arrowShapeHeight=.3;var n=function(e,t,r,i,n,a,o,s){var l=r-n/2,u=r+n/2,c=i-a/2,d=i+a/2;return e>=l&&u>=e&&t>=c&&d>=t},a=function(e,t,r,i,n){i=-i;var a=e*Math.cos(i)-t*Math.sin(i),o=e*Math.sin(i)+t*Math.cos(i),s=a*r,l=o*r,u=s+n.x,c=l+n.y;return{x:u,y:c}};i.arrow={_points:[-.15,-.3,0,0,.15,-.3],collide:function(t,r,n,a,o,s,l,u){var c=i.arrow._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.arrow._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i.triangle=i.arrow,i["triangle-backcurve"]={_ctrlPt:[0,-.15],collide:function(t,r,n,a,o,s,l,u){var c=i.triangle._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o,s=i.triangle._points,l=0;l<s.length/2;l++){var u=a(s[2*l],s[2*l+1],t,r,n);0===l&&(o=u),e.lineTo(u.x,u.y)}var c=this._ctrlPt,d=a(c[0],c[1],t,r,n);e.quadraticCurveTo(d.x,d.y,o.x,o.y)},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i["triangle-tee"]={_points:[-.15,-.3,0,0,.15,-.3,-.15,-.3],_pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(t,r,n,a,o,s,l,u){var c=i["triangle-tee"]._points,d=i["triangle-tee"]._pointsTee,h=e.math.pointInsidePolygon(t,r,d,n,a,o,s,l,u)||e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u);return h},roughCollide:n,draw:function(e,t,r,n){for(var o=i["triangle-tee"]._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}var u=i["triangle-tee"]._pointsTee,c=a(u[0],u[1],t,r,n);e.moveTo(c.x,c.y);for(var s=0;s<u.length/2;s++){var l=a(u[2*s],u[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i["half-triangle-overshot"]={_points:[0,-.25,-.5,-.25,.5,.25],leavePathOpen:!0,matchEdgeWidth:!0,collide:function(t,r,i,n,a,o,s,l){var u=this._points;return e.math.pointInsidePolygon(t,r,u,i,n,a,o,s,l)},roughCollide:n,draw:function(e,t,r,i){for(var n=this._points,o=0;o<n.length/2;o++){var s=a(n[2*o],n[2*o+1],t,r,i);e.lineTo(s.x,s.y)}},spacing:function(e){return 0},gap:function(e){return 2*e._private.style.width.pxValue}},i.none={collide:function(e,t,r,i,n,a,o,s){return!1},roughCollide:function(e,t,r,i,n,a,o,s){return!1},draw:function(e){},spacing:function(e){return 0},gap:function(e){return 0}},i.circle={_baseRadius:.15,collide:function(e,t,r,n,a,o,s,l){if(a!=o){var u=(o+l)/(a+l);return t/=u,n/=u,Math.pow(r-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*i.circle._baseRadius,2)}return Math.pow(r-e,2)+Math.pow(n-t,2)<=Math.pow((a+l)*i.circle._baseRadius,2)},roughCollide:n,draw:function(e,t,r,n){e.arc(n.x,n.y,i.circle._baseRadius*t,0,2*Math.PI,!1)},spacing:function(e){return r.getArrowWidth(e._private.style.width.pxValue)*i.circle._baseRadius},gap:function(e){return 2*e._private.style.width.pxValue}},i.inhibitor={_points:[-.25,0,-.25,-.1,.25,-.1,.25,0],collide:function(t,r,n,a,o,s,l,u){var c=i.inhibitor._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.inhibitor._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:function(e){return 1},gap:function(e){return 1}},i.tee=i.inhibitor,i.square={_points:[-.15,0,.15,0,.15,-.3,-.15,-.3],collide:function(t,r,n,a,o,s,l,u){var c=i.square._points;return e.math.pointInsidePolygon(t,r,c,n,a,o,s,l,u)},roughCollide:n,draw:function(e,t,r,n){for(var o=i.square._points,s=0;s<o.length/2;s++){var l=a(o[2*s],o[2*s+1],t,r,n);e.lineTo(l.x,l.y)}},spacing:fu
- e.lineTo(t+a,r+n),e.quadraticCurveTo(t,r+n,t,r+n-a),e.lineTo(t,r+a),e.quadraticCurveTo(t,r,t+a,r),e.closePath(),e.fill()}var r=e("renderer","canvas"),i=r.prototype;i.drawEdgeText=function(t,r){var i=r._private.style.content.strValue;if(!(!i||i.match(/^\s+$/)||this.hideEdgesOnViewport&&(this.dragData.didDrag||this.pinching||this.hoverData.dragging||this.data.wheel||this.swipePanning))){var n=r._private.style["font-size"].pxValue*r.cy().zoom(),a=r._private.style["min-zoomed-font-size"].pxValue;if(!(a>n)){t.textAlign="center",t.textBaseline="middle";var o=r._private.rscratch;if(e.is.number(o.labelX)&&e.is.number(o.labelY)){var s,l,u,c=r._private.style,d="autorotate"===c["edge-text-rotation"].strValue;if(d){switch(o.edgeType){case"haystack":l=o.haystackPts[2]-o.haystackPts[0],u=o.haystackPts[3]-o.haystackPts[1];break;default:l=o.endX-o.startX,u=o.endY-o.startY}s=Math.atan(u/l),t.translate(o.labelX,o.labelY),t.rotate(s),this.drawText(t,r,0,0),t.rotate(-s),t.translate(-o.labelX,-o.labelY)}else this.drawText(t,r,o.labelX,o.labelY)}}}},i.drawNodeText=function(t,r){var i=r._private.style.content.strValue;if(i&&!i.match(/^\s+$/)){var n=r._private.style["font-size"].pxValue*r.cy().zoom(),a=r._private.style["min-zoomed-font-size"].pxValue;if(!(a>n)){var o=r._private.style["text-halign"].strValue,s=r._private.style["text-valign"].strValue,l=r._private.rscratch;if(e.is.number(l.labelX)&&e.is.number(l.labelY)){switch(o){case"left":t.textAlign="right";break;case"right":t.textAlign="left";break;default:t.textAlign="center"}switch(s){case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="top";break;default:t.textBaseline="middle"}this.drawText(t,r,l.labelX,l.labelY)}}}},i.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(t=this.fontCaches[r],t.context===e)return t;return t={context:e},this.fontCaches.push(t),t},i.setupTextStyle=function(e,t){var r=t.effectiveOpacity(),i=t._private.style,n=i["font-style"].strValue,a=i["font-size"].pxValue+"px",o=i["font-family"].strValue,s=i["font-weight"].strValue,l=i["text-opacity"].value*i.opacity.value*r,u=i["text-outline-opacity"].value*l,c=i.color.value,d=i["text-outline-color"].value,h=i["text-shadow-blur"].pxValue,p=i["text-shadow-opacity"].value,v=i["text-shadow-color"].value,f=i["text-shadow-offset-x"].pxValue,g=i["text-shadow-offset-y"].pxValue,y=t._private.fontKey,m=this.getFontCache(e);m.key!==y&&(e.font=n+" "+s+" "+a+" "+o,m.key=y);var x=this.getLabelText(t);return e.lineJoin="round",this.fillStyle(e,c[0],c[1],c[2],l),this.strokeStyle(e,d[0],d[1],d[2],u),this.shadowStyle(e,v,p,h,f,g),x},i.drawText=function(e,r,i,n){var a=r._private,o=a.style,s=a.rstyle,l=a.rscratch,u=r.effectiveOpacity();if(0!==u&&0!==o["text-opacity"].value){var c=this.setupTextStyle(e,r),d=o["text-halign"].value,h=o["text-valign"].value;if(r.isEdge()&&(d="center",h="center"),null!=c&&!isNaN(i)&&!isNaN(n)){var p=o["text-background-opacity"].value,v=o["text-border-opacity"].value,f=o["text-border-width"].pxValue;if(p>0||f>0&&v>0){var g=4+f/2;r.isNode()&&("top"===h?n-=g:"bottom"===h&&(n+=g),"left"===d?i-=g:"right"===d&&(i+=g));var y=s.labelWidth,m=s.labelHeight,x=i;d&&("center"==d?x-=y/2:"left"==d&&(x-=y));var b=n;if(r.isNode()?"top"==h?b-=m:"center"==h&&(b-=m/2):b-=m/2,"autorotate"===o["edge-text-rotation"].strValue?(n=0,y+=4,x=i-y/2,b=n-m/2):(x-=g,b-=g,m+=2*g,y+=2*g),p>0){var w=e.fillStyle,_=o["text-background-color"].value;e.fillStyle="rgba("+_[0]+","+_[1]+","+_[2]+","+p*u+")";var E=o["text-background-shape"].strValue;"roundrectangle"==E?t(e,x,b,y,m,2):e.fillRect(x,b,y,m),e.fillStyle=w}if(f>0&&v>0){var S=e.strokeStyle,D=e.lineWidth,k=o["text-border-color"].value,T=o["text-border-style"].value;if(e.strokeStyle="rgba("+k[0]+","+k[1]+","+k[2]+","+v*u+")",e.lineWidth=f,e.setLineDash)switch(T){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=f/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(x,b,y,m),"double"===T){var P=f/2;e.strokeRect(x+P,b+P,y-2*P,m-2*P)}e.setLineDash&&e.se
- level:i.zoom()*Math.pow(10,o),renderedPosition:{x:a[0],y:a[1]}})}}};t.registerBinding(t.data.container,"wheel",d,!0),t.registerBinding(window,"scroll",function(e){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.data.container,"mouseout",function(r){var i=t.projectIntoViewport(r.clientX,r.clientY);t.data.cy.trigger(new e.Event(r,{type:"mouseout",cyPosition:{x:i[0],y:i[1]}}))},!1),t.registerBinding(t.data.container,"mouseover",function(r){var i=t.projectIntoViewport(r.clientX,r.clientY);t.data.cy.trigger(new e.Event(r,{type:"mouseover",cyPosition:{x:i[0],y:i[1]}}))},!1);var h,p,v,f,g,y,m,x,b,w,_,E,S,D=function(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))},k=function(e,t,r,i){return(r-e)*(r-e)+(i-t)*(i-t)};t.registerBinding(t.data.container,"touchstart",function(i){clearTimeout(this.threeFingerSelectTimeout),i.target!==t.data.link&&i.preventDefault(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var n=t.data.cy,o=t.getCachedNodes(),s=t.getCachedEdges(),l=t.touchData.now,u=t.touchData.earlier,c=t.data.canvasNeedsRedraw;if(i.touches[0]){var d=t.projectIntoViewport(i.touches[0].clientX,i.touches[0].clientY);l[0]=d[0],l[1]=d[1]}if(i.touches[1]){var d=t.projectIntoViewport(i.touches[1].clientX,i.touches[1].clientY);l[2]=d[0],l[3]=d[1]}if(i.touches[2]){var d=t.projectIntoViewport(i.touches[2].clientX,i.touches[2].clientY);l[4]=d[0],l[5]=d[1]}if(i.touches[1]){var T=function(e){for(var t=0;t<e.length;t++)e[t]._private.grabbed=!1,e[t]._private.rscratch.inDragLayer=!1,e[t].active()&&e[t].unactivate()};T(o),T(s);var P=t.findContainerClientCoords();b=P[0],w=P[1],_=P[2],E=P[3],h=i.touches[0].clientX-b,p=i.touches[0].clientY-w,v=i.touches[1].clientX-b,f=i.touches[1].clientY-w,S=h>=0&&_>=h&&v>=0&&_>=v&&p>=0&&E>=p&&f>=0&&E>=f;var C=n.pan(),M=n.zoom();g=D(h,p,v,f),y=k(h,p,v,f),m=[(h+v)/2,(p+f)/2],x=[(m[0]-C.x)/M,(m[1]-C.y)/M];var B=200,N=B*B;if(N>y&&!i.touches[2]){var I=t.findNearestElement(l[0],l[1],!0,!0),O=t.findNearestElement(l[2],l[3],!0,!0);return I&&I.isNode()?(I.activate().trigger(new e.Event(i,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),t.touchData.start=I):O&&O.isNode()?(O.activate().trigger(new e.Event(i,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),t.touchData.start=O):(n.trigger(new e.Event(i,{type:"cxttapstart",cyPosition:{x:l[0],y:l[1]}})),t.touchData.start=null),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,void t.redraw()}}if(i.touches[2]);else if(i.touches[1]);else if(i.touches[0]){var z=t.findNearestElement(l[0],l[1],!0,!0);if(null!=z){if(z.activate(),t.touchData.start=z,z.isNode()&&t.nodeIsDraggable(z)){var L=t.dragData.touchDragEles=[];if(c[r.NODE]=!0,c[r.DRAG]=!0,z.selected())for(var R=n.$(function(){return this.isNode()&&this.selected()}),V=0;V<R.length;V++){var A=R[V];t.nodeIsDraggable(A)&&a(A,{addToList:L})}else a(z,{addToList:L});z.trigger(new e.Event(i,{type:"grab",cyPosition:{x:l[0],y:l[1]}}))}z.trigger(new e.Event(i,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"vmousdown",cyPosition:{x:l[0],y:l[1]}}))}null==z&&(n.trigger(new e.Event(i,{type:"touchstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"tapstart",cyPosition:{x:l[0],y:l[1]}})).trigger(new e.Event(i,{type:"vmousedown",cyPosition:{x:l[0],y:l[1]}})),t.data.bgActivePosistion={x:d[0],y:d[1]},c[r.SELECT_BOX]=!0,t.redraw());for(var X=0;X<l.length;X++)u[X]=l[X],t.touchData.startPosition[X]=l[X];t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved!==!1||t.pinching||(t.touchData.start?t.touchData.start.trigger(new e.Event(i,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})):(t.data.cy.trigger(new e.Event(i,{type:"taphold",cyPosition:{x:l[0],y:l[1]}})),n.$(":selected").unselect()))},t.tapholdDuration)}
-
- }for(var d=0;d<f.length;d++){var D=f[d],k=2*Math.PI/D.length;if(D.length>1&&r.avoidOverlap){var T=Math.cos(k)-Math.cos(0),P=Math.sin(k)-Math.sin(0),C=Math.sqrt(w*w/(T*T+P*P));b=Math.max(C,b)}for(var M=0;M<D.length;M++){var y=D[M],u=r.startAngle+(r.counterclockwise?-1:1)*k*M,B={x:s.x+b*Math.cos(u),y:s.y+b*Math.sin(u)};x[y.node.id()]=B}b+=w}return a.layoutPositions(this,r,function(){var e=this.id();return x[e]}),this},e("layout","concentric",t)}(cytoscape),function(e){"use strict";function t(t){this.options=e.util.extend({},i,t)}var r,i={ready:function(){},stop:function(){},animate:!0,refresh:4,fit:!0,padding:30,boundingBox:void 0,randomize:!0,debug:!1,nodeRepulsion:4e5,nodeOverlap:10,idealEdgeLength:10,edgeElasticity:100,nestingFactor:5,gravity:250,numIter:100,initialTemp:200,coolingFactor:.95,minTemp:1};t.prototype.run=function(){var t=this.options,i=t.cy,a=this;a.stopped=!1,a.trigger({type:"layoutstart",layout:a}),r=!0===t.debug?!0:!1;var o=new Date,d=n(i,a,t);r&&s(d),!0===t.randomize&&l(d,i),m(d,i,t);var h=function(e){return a.stopped?!1:(c(d,i,t,e),d.temperature=d.temperature*t.coolingFactor,d.temperature<t.minTemp?!1:!0)},p=function(){u(d,i,t),!0===t.fit&&i.fit(t.padding);var e=new Date;console.info("Layout took "+(e-o)+" ms"),a.one("layoutstop",t.stop),a.trigger({type:"layoutstop",layout:a})};if(t.animate){var v=0,f=function(){for(var r,n=0;n<t.refresh&&v<t.numIter;){var r=h(v);if(r===!1)break;n++,v++}u(d,i,t),t.fit&&i.fit(t.padding),r!==!1&&v+1<t.numIter?e.util.requestAnimationFrame(f):p()};e.util.requestAnimationFrame(f)}else{for(var v=0;v<t.numIter&&h(v)!==!1;v++);p()}return this},t.prototype.stop=function(){return this.stopped=!0,this};var n=function(t,r,i){for(var n=i.eles.edges(),o=i.eles.nodes(),s={layout:r,layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:i.initialTemp,clientWidth:t.width(),clientHeight:t.width(),boundingBox:e.util.makeBoundingBox(i.boundingBox?i.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()})},l=0;l<s.nodeSize;l++){var u={};u.id=o[l].data("id"),u.parentId=o[l].data("parent"),u.children=[],u.positionX=o[l].position("x"),u.positionY=o[l].position("y"),u.offsetX=0,u.offsetY=0,u.height=o[l].height(),u.width=o[l].width(),u.maxX=u.positionX+u.width/2,u.minX=u.positionX-u.width/2,u.maxY=u.positionY+u.height/2,u.minY=u.positionY-u.height/2,u.padLeft=o[l]._private.style["padding-left"].pxValue,u.padRight=o[l]._private.style["padding-right"].pxValue,u.padTop=o[l]._private.style["padding-top"].pxValue,u.padBottom=o[l]._private.style["padding-bottom"].pxValue,s.layoutNodes.push(u),s.idToIndex[u.id]=l}for(var c=[],d=0,h=-1,p=[],l=0;l<s.nodeSize;l++){var v=s.layoutNodes[l],f=v.parentId;null!=f?s.layoutNodes[s.idToIndex[f]].children.push(v.id):(c[++h]=v.id,p.push(v.id))}for(s.graphSet.push(p);h>=d;){var g=c[d++],y=s.idToIndex[g],m=s.layoutNodes[y],x=m.children;if(x.length>0){s.graphSet.push(x);for(var l=0;l<x.length;l++)c[++h]=x[l]}}for(var l=0;l<s.graphSet.length;l++)for(var b=s.graphSet[l],w=0;w<b.length;w++){var _=s.idToIndex[b[w]];s.indexToGraph[_]=l}for(var l=0;l<s.edgeSize;l++){var E=n[l],S={};S.id=E.data("id"),S.sourceId=E.data("source"),S.targetId=E.data("target");var D=i.idealEdgeLength,k=s.idToIndex[S.sourceId],T=s.idToIndex[S.targetId],P=s.indexToGraph[k],C=s.indexToGraph[T];if(P!=C){for(var M=a(S.sourceId,S.targetId,s),B=s.graphSet[M],N=0,u=s.layoutNodes[k];-1===$.inArray(u.id,B);)u=s.layoutNodes[s.idToIndex[u.parentId]],N++;for(u=s.layoutNodes[T];-1===$.inArray(u.id,B);)u=s.layoutNodes[s.idToIndex[u.parentId]],N++;D*=N*i.nestingFactor}S.idealLength=D,s.layoutEdges.push(S)}return s},a=function(e,t,r){var i=o(e,t,0,r);return 2>i.count?0:i.graph},o=function(e,t,r,i){var n=i.graphSet[r];if(-1<$.inArray(e,n)&&-1<$.inArray(t,n))return{count:2,graph:r};for(var a=0,s=0;s<n.length;s++){var l=n[s],u=i.idToIndex[l],c=i.layoutNodes[u].children;if(0!==c.length){var d=i.indexToGraph[i.idToIndex[c[0]]],h=o(e,t,d,i);if(0!==h.count){if(1!==h.count)return h;if(a++,2===a)break}}}return{count:a,graph:r}},s=function(e){if(r){console.debug("la
|