window.dash_cytoscape=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=window.React},function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Cytoscape=void 0;var r,i=n(4),a=(r=i)&&r.__esModule?r:{default:r};t.Cytoscape=a.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&(this.props.setProps({generateImage:{}}),this._cy&&this.handleImageGeneration(w.type,w.options,w.action,w.filename)),this.cyResponsiveClass&&this.cyResponsiveClass.toggle(_),a.default.createElement(s.default,{id:t,cy:this.handleCy,className:r,style:n,elements:s.default.normalizeElements(i),stylesheet:o,layout:u,pan:l,zoom:c,panningEnabled:d,userPanningEnabled:h,minZoom:f,maxZoom:p,zoomingEnabled:v,userZoomingEnabled:g,boxSelectionEnabled:y,autoungrabify:m,autolock:b,autounselectify:x})}}]),t}(i.Component);d.propTypes={id:o.default.string,className:o.default.string,style:o.default.object,setProps:o.default.func,elements:o.default.oneOfType([o.default.arrayOf(o.default.shape({group:o.default.string,data:o.default.shape({id:o.default.string,label:o.default.string,parent:o.default.string,source:o.default.string,target:o.default.string}),position:o.default.shape({x:o.default.number,y:o.default.number}),selected:o.default.bool,selectable:o.default.bool,locked:o.default.bool,grabbable:o.default.bool,classes:o.default.string})),o.default.exact({nodes:o.default.array,edges:o.default.array})]),stylesheet:o.default.arrayOf(o.default.exact({selector:o.default.string.isRequired,style:o.default.object.isRequired})),layout:o.default.shape({name:o.default.oneOf(["random","preset","circle","concentric","grid","breadthfirst","cose","close-bilkent","cola","euler","spread","dagre","klay"]).isRequired,fit:o.default.bool,padding:o.default.number,animate:o.default.bool,animationDuration:o.default.number,boundingBox:o.default.object}),pan:o.default.exact({x:o.default.number,y:o.default.number}),zoom:o.default.number,panningEnabled:o.default.bool,userPanningEnabled:o.default.bool,minZoom:o.default.number,maxZoom:o.default.number,zoomingEnabled:o.default.bool,userZoomingEnabled:o.default.bool,boxSelectionEnabled:o.default.bool,autoungrabify:o.default.bool,autolock:o.default.bool,autounselectify:o.default.bool,autoRefreshLayout:o.default.bool,tapNode:o.default.exact({edgesData:o.default.array,renderedPosition:o.default.object,timeStamp:o.default.number,classes:o.default.string,data:o.default.object,grabbable:o.default.bool,group:o.default.string,locked:o.default.bool,position:o.default.object,selectable:o.default.bool,selected:o.default.bool,style:o.default.object,ancestorsData:o.default.oneOfType([o.default.object,o.default.array]),childrenData:o.default.oneOfType([o.default.object,o.default.array]),descendantsData:o.default.oneOfType([o.default.object,o.default.array]),parentData:o.default.oneOfType([o.default.object,o.default.array]),siblingsData:o.default.oneOfType([o.default.object,o.default.array]),isParent:o.default.bool,isChildless:o.default.bool,isChild:o.default.bool,isOrphan:o.default.bool,relativePosition:o.default.object}),tapNodeData:o.default.object,tapEdge:o.default.exact({isLoop:o.default.bool,isSimple:o.default.bool,midpoint:o.default.object,sourceData:o.default.object,sourceEndpoint:o.default.object,targetData:o.default.object,targetEndpoint:o.default.object,timeStamp:o.default.number,classes:o.default.string,data:o.default.object,grabbable:o.default.bool,group:o.default.string,locked:o.default.bool,selectable:o.default.bool,selected:o.default.bool,style:o.default.object}),tapEdgeData:o.default.object,mouseoverNodeData:o.default.object,mouseoverEdgeData:o.default.object,selectedNodeData:o.default.array,selectedEdgeData:o.default.array,generateImage:o.default.shape({type:o.default.oneOf(["svg","png","jpg","jpeg"]),options:o.default.object,action:o.default.oneOf(["store","download","both"]),filename:o.default.string}),imageData:o.default.string,responsive:o.default.bool},d.defaultProps={style:{width:"600px",height:"600px"},layout:{name:"grid"},pan:{x:0,y:0},zoom:1,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:!0,userZoomingEnabled:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,autolock:!1,autoungrabify:!1,autounselectify:!1,autoRefreshLayout:!0,generateImage:{},imageData:null,responsive:!1,elements:[]},t.default=d},function(e,t,n){"use strict";var r=n(6);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,n,i,a,o){if(o!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){var r,i,a,o;window,e.exports=(r=n(1),i=n(8),a=n(2),o=n(9),function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=r({}),a=function(e,t){return null==e||null==t};t.hashDiff=function(e,t){return a(e,t)||e.hash()!==t.hash()},t.shallowObjDiff=function(e,t){if(a(e,t)&&(null!=e||null!=t))return!0;if(e===t)return!1;if((void 0===e?"undefined":r(e))!==i||(void 0===t?"undefined":r(t))!==i)return e!==t;var n=Object.keys(e),o=Object.keys(t),s=function(n){return e[n]!==t[n]};return n.length!==o.length||!(!n.some(s)&&!o.some(s))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=function(e,t){return null!=e?e[t]:null},t.toJson=function(e){return e},t.forEach=function(e,t){return e.forEach(t)}},function(e,t,n){"use strict";e.exports=n(3).default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&e.remove(u),s.length>0&&e.add(s),l.forEach((function(t){var n=t.ele1,a=t.ele2;return c(e,n,a,r,i,o)}))},c=function(e,t,n,r,i,a){var o=i(i(n,"data"),"id"),s=e.getElementById(o),u={};["data","position","selected","selectable","locked","grabbable","classes"].forEach((function(e){var o=i(n,e);a(o,i(t,e))&&(u[e]=r(o))}));var l=i(n,"scratch");a(l,i(t,"scratch"))&&s.scratch(r(l)),Object.keys(u).length>0&&s.json(u)}}]))},function(e,t){e.exports=window.ReactDOM},function(e,t,n){"use strict";(function(t){function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=r(n(13)),a=r(n(14));function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;nt?1:0},j=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var u=n[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;t.push(u)}}return t}(e)||function(e){var t,n,r,i,a,o,s,u;function l(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^hsl[a]?\\(((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?)))\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))[%])(?:\\s*,\\s*((?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))))?\\)$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(a=c[4])&&((a=parseFloat(a))<0||a>1))return;if(0===r)o=s=u=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;o=Math.round(255*l(h,d,n+1/3)),s=Math.round(255*l(h,d,n)),u=Math.round(255*l(h,d,n-1/3))}t=[o,s,u,a]}return t}(e)},F={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},q=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(t=e.next()).done;)r=r*K+t.value|0;return r},$=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return t*K+e|0},Q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(t<<5)+t+e|0},J=function(e){return 2097152*e[0]+e[1]},ee=function(e,t){return[$(e[0],t[0]),Q(e[1],t[1])]},te=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return G({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),n));r--);},we=function(e){e.splice(0,e.length)},_e=function(e,t,n){return n&&(t=A(n,t)),e[t]},Ee=function(e,t,n,r){n&&(t=A(n,t)),e[t]=r},ke="undefined"!=typeof Map?Map:function(){function e(){s(this,e),this._obj={}}return l(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),Ce=function(){function e(t){if(s(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r0;){var k=m.pop(),C=g(k),S=k.id();if(h[S]=C,C!==1/0)for(var P=k.neighborhood().intersect(p),T=0;T0)for(n.unshift(t);d[i];){var a=d[i];n.unshift(a.edge),n.unshift(a.node),i=(r=a.node).id()}return s.spawn(n)}}}},ze={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=new Array(i),o=n,s=function(e){for(var t=0;t0;){if(l=g.pop(),c=l.id(),y.delete(c),_++,c===h){for(var E=[],k=i,C=h,S=b[C];E.unshift(k),null!=S&&E.unshift(S),null!=(k=m[C]);)S=b[C=k.id()];return{found:!0,distance:f[c],path:this.spawn(E),steps:_}}v[c]=!0;for(var P=l._private.edges,T=0;TP&&(f[S]=P,y[S]=C,m[S]=w),!i){var T=C*l+k;!i&&f[T]>P&&(f[T]=P,y[T]=k,m[T]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:a,r=y(e),i=[],o=r;;){if(null==o)return t.spawn();var u=g(o),l=u.edge,c=u.pred;if(i.unshift(o[0]),o.same(n)&&i.length>0)break;null!=l&&i.unshift(l),o=c}return s.spawn(i)},hasNegativeWeightCycle:p,negativeWeightCycles:[]}}},je=Math.sqrt(2),Ve=function(e,t,n){0===n.length&&he("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],u=n,l=u.length-1;l>=0;l--){var c=u[l],d=c[1],h=c[2];(t[d]===o&&t[h]===s||t[d]===s&&t[h]===o)&&u.splice(l,1)}for(var f=0;fr;){var i=Math.floor(Math.random()*t.length);t=Ve(i,e,t),n--}return t},qe={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,a=r.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/je);if(!(i<2)){for(var u=[],l=0;l0?1:e<0?-1:0},Ke=function(e,t){return Math.sqrt(Ge(e,t))},Ge=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},$e=function(e){for(var t=e.length,n=0,r=0;r=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}}},nt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},it=function(e){var t,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===a.length)t=n=r=i=a[0];else if(2===a.length)t=r=a[0],i=n=a[1];else if(4===a.length){var o=d(a,4);t=o[0],n=o[1],r=o[2],i=o[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},at=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},ot=function(e,t){e.x1+=t.x,e.x2+=t.x,e.y1+=t.y,e.y2+=t.y},st=function(e,t){return!(e.x1>t.x2)&&(!(t.x1>e.x2)&&(!(e.x2t.y2)&&!(t.y1>e.y2)))))))},ut=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},lt=function(e,t){return ut(e,t.x1,t.y1)&&ut(e,t.x2,t.y2)},ct=function(e,t,n,r,i,a,o){var s,u=Tt(i,a),l=i/2,c=a/2,d=r-c-o;if((s=_t(e,t,n,r,n-l+u-o,d,n+l-u+o,d,!1)).length>0)return s;var h=n+l+o;if((s=_t(e,t,n,r,h,r-c+u-o,h,r+c-u+o,!1)).length>0)return s;var f=r+c+o;if((s=_t(e,t,n,r,n-l+u-o,f,n+l-u+o,f,!1)).length>0)return s;var p,v=n-l-o;if((s=_t(e,t,n,r,v,r-c+u-o,v,r+c-u+o,!1)).length>0)return s;var g=n-l+u,y=r-c+u;if((p=xt(e,t,n,r,g,y,u+o)).length>0&&p[0]<=g&&p[1]<=y)return[p[0],p[1]];var m=n+l-u,b=r-c+u;if((p=xt(e,t,n,r,m,b,u+o)).length>0&&p[0]>=m&&p[1]<=b)return[p[0],p[1]];var x=n+l-u,w=r+c-u;if((p=xt(e,t,n,r,x,w,u+o)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var _=n-l+u,E=r+c-u;return(p=xt(e,t,n,r,_,E,u+o)).length>0&&p[0]<=_&&p[1]>=E?[p[0],p[1]]:[]},dt=function(e,t,n,r,i,a,o){var s=o,u=Math.min(n,i),l=Math.max(n,i),c=Math.min(r,a),d=Math.max(r,a);return u-s<=e&&e<=l+s&&c-s<=t&&t<=d+s},ht=function(e,t,n,r,i,a,o,s,u){var l=Math.min(n,o,i)-u,c=Math.max(n,o,i)+u,d=Math.min(r,s,a)-u,h=Math.max(r,s,a)+u;return!(ec||th)},ft=function(e,t,n,r,i,a,o,s){var u=[];!function(e,t,n,r,i){var a,o,s,u,l,c,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),a=(o=(3*n-t*t)/9)*o*o+(s/=54)*s,i[1]=0,d=t/3,a>0?(l=(l=s+Math.sqrt(a))<0?-Math.pow(-l,1/3):Math.pow(l,1/3),c=(c=s-Math.sqrt(a))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),i[0]=-d+l+c,d+=(l+c)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-c+l)/2,i[3]=d,i[5]=-d):(i[5]=i[3]=0,0===a?(h=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3),i[0]=2*h-d,i[4]=i[2]=-(h+d)):(u=(o=-o)*o*o,u=Math.acos(s/Math.sqrt(u)),h=2*Math.sqrt(o),i[0]=-d+h*Math.cos(u/3),i[2]=-d+h*Math.cos((u+2*Math.PI)/3),i[4]=-d+h*Math.cos((u+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,u);for(var l=[],c=0;c<6;c+=2)Math.abs(u[c+1])<1e-7&&u[c]>=0&&u[c]<=1&&l.push(u[c]);l.push(1),l.push(0);for(var d,h,f,p=-1,v=0;v=0?fu?(e-i)*(e-i)+(t-a)*(t-a):l-d},vt=function(e,t,n){for(var r,i,a,o,s=0,u=0;u=e&&e>=a||r<=e&&e<=a))continue;(e-r)/(a-r)*(o-i)+i>t&&s++}return s%2!=0},gt=function(e,t,n,r,i,a,o,s,u){var l,c=new Array(n.length);null!=s[0]?(l=Math.atan(s[1]/s[0]),s[0]<0?l+=Math.PI/2:l=-l-Math.PI/2):l=s;for(var d,h=Math.cos(-l),f=Math.sin(-l),p=0;p0){var v=mt(c,-u);d=yt(v)}else d=c;return vt(e,t,d)},yt=function(e){for(var t,n,r,i,a,o,s,u,l=new Array(e.length/2),c=0;c=0&&p<=1&&g.push(p),v>=0&&v<=1&&g.push(v),0===g.length)return[];var y=g[0]*s[0]+e,m=g[0]*s[1]+t;return g.length>1?g[0]==g[1]?[y,m]:[y,m,g[1]*s[0]+e,g[1]*s[1]+t]:[y,m]},wt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},_t=function(e,t,n,r,i,a,o,s,u){var l=e-i,c=n-e,d=o-i,h=t-a,f=r-t,p=s-a,v=d*h-p*l,g=c*h-f*l,y=p*c-d*f;if(0!==y){var m=v/y,b=g/y;return-.001<=m&&m<=1.001&&-.001<=b&&b<=1.001||u?[e+m*c,t+m*f]:[]}return 0===v||0===g?wt(e,n,o)===o?[o,s]:wt(e,n,i)===i?[i,a]:wt(i,o,n)===n?[n,r]:[]:[]},Et=function(e,t,n,r,i,a,o,s){var u,l,c,d,h,f,p=[],v=new Array(n.length),g=!0;if(null==a&&(g=!1),g){for(var y=0;y0){var m=mt(v,-s);l=yt(m)}else l=v}else l=n;for(var b=0;bc&&(c=t)},h=function(e){return l[e]},f=0;f0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var _=r(w);b=b.id(),f[b]>f[y]+_&&(f[b]=f[y]+_,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),c[b]=0,l[b]=[]),f[b]==f[y]+_&&(c[b]=c[b]+c[y],l[b].push(y))}else for(var E=0;E0;)for(var P=n.pop(),T=0;T0&&o.push(n[s]);0!==o.length&&i.push(r.collection(o))}return i}(c,u,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:Kt,o=r,s=0;s=2?tn(e,t,n,0,Qt,Jt):tn(e,t,n,0,$t)},squaredEuclidean:function(e,t,n){return tn(e,t,n,0,Qt)},manhattan:function(e,t,n){return tn(e,t,n,0,$t)},max:function(e,t,n){return tn(e,t,n,-1/0,en)}};function rn(e,t,n,r,i,a){var o;return o=x(e)?e:nn[e]||nn.euclidean,0===t&&x(e)?o(i,a):o(t,n,r,i,a)}nn["squared-euclidean"]=nn.squaredEuclidean,nn.squaredeuclidean=nn.squaredEuclidean;var an=be({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),on=function(e){return an(e)},sn=function(e,t,n,r,i){var a="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},o=n,s=t;return rn(e,r.length,a,(function(e){return r[e](t)}),o,s)},un=function(e,t,n){for(var r=n.length,i=new Array(r),a=new Array(r),o=new Array(t),s=null,u=0;un)return!1}return!0},hn=function(e,t,n){for(var r=0;ri&&(i=t[u][l],a=l);o[a].push(e[u])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var f,p=t[o],v=t[r[o]];f="dendrogram"===i.mode?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=f,e.splice(v.index,1),t[p.key]=f;for(var g=0;gn[v.key][y.key]&&(a=n[v.key][y.key])):"max"===i.linkage?(a=n[p.key][y.key],n[p.key][y.key]1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];r?e=e.slice(t,n):(n0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var u=e[s];a?isFinite(u)||(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort((function(e,t){return e-t}));var l=e.length,c=Math.floor(l/2);return l%2!=0?e[c+1+o]:(e[c-1+o]+e[c+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,a=t;a1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;io&&(a=u,o=t[i*e+u])}a>0&&r.push(a)}for(var l=0;l=P?(T=P,P=B,D=M):B>T&&(T=B);for(var z=0;z0?1:0;k[_%l.minIterations*t+R]=j,L+=j}if(L>0&&(_>=l.minIterations-1||_==l.maxIterations-1)){for(var V=0,F=0;F0&&r.push(i);return r}(t,a,o),Y=function(e,t,n){for(var r=Tn(e,t,n),i=0;iu&&(s=l,u=c)}n[i]=a[s]}return r=Tn(e,t,n)}(t,r,W),X={},H=0;H1)}}));var u=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(u),components:i}},On=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e);return e.forEach((function(o){if(o.isNode()){var s=o.id();s in t||function o(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var u=e.spawn();;){var l=i.pop();if(u.merge(e.getElementById(l)),t[l].low=t[s].index,t[l].explored=!0,l===s)break}var c=u.edgesWith(u),d=u.merge(c);r.push(d),a=a.difference(d)}}(s)}})),{cut:a,components:r}},In={};[De,Me,ze,Ie,Ne,Re,qe,zt,It,Nt,Rt,Ut,mn,kn,Bn,{hierholzer:function(e){if(!_(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,a=Mn(e),o=a.root,s=a.directed,u=this,l=!1;o&&(i=b(o)?this.filter(o)[0].id():o[0].id());var c={},d={};s?u.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),a=e.outdegree(!0),o=i-a,s=a-i;1==o?n?l=!0:n=t:1==s?r?l=!0:r=t:(s>1||o>1)&&(l=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):u.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?l=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(l)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=u[0].id());var f=function(e){for(var t,n,r,i=e,a=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),a.unshift(t),a.unshift(i);return a},p=[],v=[];for(v=f(i);1!=v.length;)0==c[v[0]].length?(p.unshift(u.getElementById(v.shift())),p.unshift(u.getElementById(v.shift()))):v=f(v.shift()).concat(v);for(var g in p.unshift(u.getElementById(v.shift())),c)if(c[g].length)return h;return h.found=!0,h.trail=this.spawn(p),h}},{hopcroftTarjanBiconnected:zn,htbc:zn,htb:zn,hopcroftTarjanBiconnectedComponents:zn},{tarjanStronglyConnected:On,tsc:On,tscc:On,tarjanStronglyConnectedComponents:On}].forEach((function(e){j(In,e)})); /*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) */ var An=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};An.prototype={fulfill:function(e){return Nn(this,1,"fulfillValue",e)},reject:function(e){return Nn(this,2,"rejectReason",e)},then:function(e,t){var n=new An;return this.onFulfilled.push(jn(e,n,"fulfill")),this.onRejected.push(jn(t,n,"reject")),Ln(this),n.proxy}};var Nn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Ln(e)),e},Ln=function(e){1===e.state?Rn(e,"onFulfilled",e.fulfillValue):2===e.state&&Rn(e,"onRejected",e.rejectReason)},Rn=function(e,n,r){if(0!==e[n].length){var i=e[n];e[n]=[];var a=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;for(var t=0;t0&&this.spawn(n).updateStyle().emit("class"),this},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=void 0===t,r=[],i=0,a=this.length;i0&&this.spawn(r).updateStyle().emit("class"),this},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Hn.className=Hn.classNames=Hn.classes;var Zn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:L,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Zn.variable="(?:[\\w-]|(?:\\\\"+Zn.metaChar+"))+",Zn.value=Zn.string+"|"+Zn.number,Zn.className=Zn.variable,Zn.id=Zn.variable,function(){var e,t,n;for(e=Zn.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Zn.comparatorOp+="|\\!"+t)}();var Un=0,Kn=1,Gn=2,$n=3,Qn=4,Jn=5,er=6,tr=7,nr=8,rr=9,ir=10,ar=11,or=12,sr=13,ur=14,lr=15,cr=16,dr=17,hr=18,fr=19,pr=20,vr=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*R(e,t)}(e.selector,t.selector)})),gr=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return pe("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return pe("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&pe("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(r,a){var o=r.type,s=r.value;switch(o){case Un:var u=e(s);return u.substring(0,u.length-1);case $n:var l=r.field,c=r.operator;return"["+l+n(e(c))+t(s)+"]";case Jn:var d=r.operator,h=r.field;return"["+e(d)+h+"]";case Qn:return"["+r.field+"]";case er:var f=r.operator;return"[["+r.field+n(e(f))+t(s)+"]]";case tr:return s;case nr:return"#"+s;case rr:return"."+s;case dr:case lr:return i(r.parent,a)+n(">")+i(r.child,a);case hr:case cr:return i(r.ancestor,a)+" "+i(r.descendant,a);case fr:var p=i(r.left,a),v=i(r.subject,a),g=i(r.right,a);return p+(p.length>0?" ":"")+v+g;case pr:return""}},i=function(e,t){return e.checks.reduce((function(n,i,a){return n+(t===e&&0===a?"$":"")+r(i,t)}),"")},a="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),l=!0),(o||u||l)&&(i=o||s?""+e:"",a=""+n),l&&(e=i=i.toLowerCase(),n=a=a.toLowerCase()),t){case"*=":r=i.indexOf(a)>=0;break;case"$=":r=i.indexOf(a,i.length-a.length)>=0;break;case"^=":r=0===i.indexOf(a);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var l=i.shift();t(l),a.add(l.id()),o&&r(i,a,l)}return e}function Ar(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1];return Ir(this,e,t,Ar)},Or.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ir(this,e,t,Nr)},Or.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Ir(this,e,t,Lr)},Or.ancestors=Or.parents,(Br=Mr={data:Yn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Yn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Yn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Yn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Yn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Yn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Br.data,Br.removeAttr=Br.removeData;var Rr,jr,Vr=Mr,Fr={};function qr(e){return function(t){if(void 0===t&&(t=!0),0!==this.length&&this.isNode()&&!this.removed()){for(var n=0,r=this[0],i=r._private.edges,a=0;at})),minIndegree:Wr("indegree",(function(e,t){return et})),minOutdegree:Wr("outdegree",(function(e,t){return et}))}),j(Fr,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=l;l&&(u=u[0]);var d=c?u.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,g=v;v&&(p=p[0]);var y=g?p.position():{x:0,y:0};void 0!==t?f.position(e,t+y[e]):void 0!==i&&f.position({x:i.x+y.x,y:i.y+y.y})}}else if(!a)return;return this}}).modelPosition=Rr.point=Rr.position,Rr.modelPositions=Rr.points=Rr.positions,Rr.renderedPoint=Rr.renderedPosition,Rr.relativePoint=Rr.relativePosition;var Hr,Zr,Ur=jr;Hr=Zr={},Zr.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,u=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:u,w:o-a,h:u-s}},Zr.dirtyCompoundBoundsCache=function(){var e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp((function(e){if(e.isParent()){var t=e._private;t.compoundBoundsClean=!1,t.bbCache=null,e.emitAndNotify("bounds")}})),this):this},Zr.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;0!==a.w&&0!==a.h||((a={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var u=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(u=100*u/i.width.val);var l=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(l=100*l/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-a.w,s,u),h=d.biasDiff,f=d.biasComplementDiff,p=y(i.height.val-a.h,l,c),v=p.biasDiff,g=p.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(a.w,a.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-h+a.x1+a.x2+f)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-v+a.y1+a.y2+g)/2}function y(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},$r=function(e,t){return null==t?e:Gr(e,t.x1,t.y1,t.x2,t.y2)},Qr=function(e,t,n){return _e(e,t,n)},Jr=function(e,t,n){if(!t.cy().headless()){var r,i,a=t._private,o=a.rstyle,s=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=o.srcX,i=o.srcY):"target"===n?(r=o.tgtX,i=o.tgtY):(r=o.midX,i=o.midY);var u=a.arrowBounds=a.arrowBounds||{},l=u[n]=u[n]||{};l.x1=r-s,l.y1=i-s,l.x2=r+s,l.y2=i+s,l.w=l.x2-l.x1,l.h=l.y2-l.y1,rt(l,1),Gr(e,l.x1,l.y1,l.x2,l.y2)}}},ei=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,a=i.rstyle;if(t.pstyle(r+"label").strValue){var o,s,u,l,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=Qr(a,"labelWidth",n),f=Qr(a,"labelHeight",n),p=Qr(a,"labelX",n),v=Qr(a,"labelY",n),g=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,_=t.pstyle("text-background-padding").pfValue,E=f,k=h,C=k/2,S=E/2;if(m)o=p-C,s=p+C,u=v-S,l=v+S;else{switch(c.value){case"left":o=p-k,s=p;break;case"center":o=p-C,s=p+C;break;case"right":o=p,s=p+k}switch(d.value){case"top":u=v-E,l=v;break;case"center":u=v-S,l=v+S;break;case"bottom":u=v,l=v+E}}o+=g-Math.max(x,w)-_,s+=g+Math.max(x,w)+_,u+=y-Math.max(x,w)-_,l+=y+Math.max(x,w)+_;var P=n||"main",T=i.labelBounds,D=T[P]=T[P]||{};D.x1=o,D.y1=u,D.x2=s,D.y2=l,D.w=s-o,D.h=l-u,rt(D,1);var B=m&&"autorotate"===b.strValue,M=null!=b.pfValue&&0!==b.pfValue;if(B||M){var z=B?Qr(i.rstyle,"labelAngle",n):b.pfValue,O=Math.cos(z),I=Math.sin(z),A=(o+s)/2,N=(u+l)/2;if(!m){switch(c.value){case"left":A=s;break;case"right":A=o}switch(d.value){case"top":N=l;break;case"bottom":N=u}}var L=function(e,t){return{x:(e-=A)*O-(t-=N)*I+A,y:e*I+t*O+N}},R=L(o,u),j=L(o,l),V=L(s,u),F=L(s,l);o=Math.min(R.x,j.x,V.x,F.x),s=Math.max(R.x,j.x,V.x,F.x),u=Math.min(R.y,j.y,V.y,F.y),l=Math.max(R.y,j.y,V.y,F.y)}var q=P+"Rot",W=T[q]=T[q]||{};W.x1=o,W.y1=u,W.x2=s,W.y2=l,W.w=s-o,W.h=l-u,Gr(e,o,u,s,l),Gr(i.labelBounds.all,o,u,s,l)}return e}},ti=function(e){var t=0,n=function(e){return(e?1:0)<(r=S[1].x)){var P=n;n=r,r=P}if(i>(a=S[1].y)){var T=i;i=a,a=T}Gr(h,n-w,i-w,r+w,a+w)}}else if("bezier"===C||"unbundled-bezier"===C||"segments"===C||"taxi"===C){var D;switch(C){case"bezier":case"unbundled-bezier":D=g.bezierPts;break;case"segments":case"taxi":D=g.linePts}if(null!=D)for(var B=0;B(r=O.x)){var I=n;n=r,r=I}if((i=z.y)>(a=O.y)){var A=i;i=a,a=A}Gr(h,n-=w,i-=w,r+=w,a+=w)}if(c&&t.includeEdges&&v&&(Jr(h,e,"mid-source"),Jr(h,e,"mid-target"),Jr(h,e,"source"),Jr(h,e,"target")),c)if("yes"===e.pstyle("ghost").value){var N=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue;Gr(h,h.x1+N,h.y1+L,h.x2+N,h.y2+L)}var R=f.bodyBounds=f.bodyBounds||{};at(R,h),it(R,y),rt(R,1),c&&(n=h.x1,r=h.x2,i=h.y1,a=h.y2,Gr(h,n-x,i-x,r+x,a+x));var j=f.overlayBounds=f.overlayBounds||{};at(j,h),it(j,y),rt(j,1);var V=f.labelBounds=f.labelBounds||{};null!=V.all?((u=V.all).x1=1/0,u.y1=1/0,u.x2=-1/0,u.y2=-1/0,u.w=0,u.h=0):V.all=tt(),c&&t.includeLabels&&(t.includeMainLabels&&ei(h,e,null),v&&(t.includeSourceLabels&&ei(h,e,"source"),t.includeTargetLabels&&ei(h,e,"target")))}return h.x1=Kr(h.x1),h.y1=Kr(h.y1),h.x2=Kr(h.x2),h.y2=Kr(h.y2),h.w=Kr(h.x2-h.x1),h.h=Kr(h.y2-h.y1),h.w>0&&h.h>0&&b&&(it(h,y),rt(h,1)),h}(e,ii),r.bbCache=n,r.bbCacheShift.x=r.bbCacheShift.y=0,r.bbCachePosKey=o):n=r.bbCache,!l&&(0!==r.bbCacheShift.x||0!==r.bbCacheShift.y)){var c=ot,d=r.bbCacheShift,h=function(e,t){null!=e&&c(e,t)};c(n,d);var f=r.bodyBounds,p=r.overlayBounds,v=r.labelBounds,g=r.arrowBounds;h(f,d),h(p,d),null!=g&&(h(g.source,d),h(g.target,d),h(g["mid-source"],d),h(g["mid-target"],d)),null!=v&&(h(v.main,d),h(v.all,d),h(v.source,d),h(v.target,d))}if(r.bbCacheShift.x=r.bbCacheShift.y=0,!a){var y=e.isNode();n=tt(),(t.includeNodes&&y||t.includeEdges&&!y)&&(t.includeOverlays?$r(n,r.overlayBounds):$r(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?$r(n,r.labelBounds.all):(t.includeMainLabels&&$r(n,r.labelBounds.mainRot),t.includeSourceLabels&&$r(n,r.labelBounds.sourceRot),t.includeTargetLabels&&$r(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},ii={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,useCache:!0},ai=ti(ii),oi=be(ii);Zr.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=tt();var n=oi(e=e||ii);if(this.cy().styleEnabled())for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:wi,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)o(s);return this},Ei.removeAllListeners=function(){return this.removeListener("*")},Ei.emit=Ei.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),Si(this,(function(e,a){null!=n&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(n){var i=r[n];if(i.type===a.type&&(!i.namespace||i.namespace===a.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,a)){var o=[a];null!=t&&function(e,t){for(var n=0;n1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--){e(this[t])&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=0;rr&&(r=o,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=0;i=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=n.style();if(_(e)){var i=e;r.applyBypass(this,i,!1),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?r.getStylePropertyValue(a,e):void 0}r.applyBypass(this,e,t,!1),this.emitAndNotify("style")}else if(void 0===e){var o=this[0];return o?r.getRawStyle(o):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=t.style();if(void 0===e)for(var r=0;r0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,{unique:!0}).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Gi.neighbourhood=Gi.neighborhood,Gi.closedNeighbourhood=Gi.closedNeighborhood,Gi.openNeighbourhood=Gi.openNeighborhood,j(Gi,{source:zr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:zr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ea({attr:"source"}),targets:ea({attr:"target"})}),j(Gi,{edgesWith:zr(ta(),"edgesWith"),edgesTo:zr(ta({thisIsSrc:!0}),"edgesTo")}),j(Gi,{connectedEdges:zr((function(e){for(var t=[],n=0;n0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Gi.componentsOf=Gi.components;var ra=function(e,t,n){for(var r=null!=n?n:ge();e.hasElementWithId(r);)r=ge();return r},ia=function(e,t,n){if(void 0!==e&&T(e)){var r=new ke,i=!1;if(t){if(t.length>0&&_(t[0])&&!S(t[0])){i=!0;for(var a=[],o=new Se,s=0,u=t.length;s0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,a=i.cy(),o=a._private,s=[],u=[],l=0,c=i.length;l0){for(var R=new ia(a,e),j=0;j0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},a=n._private.cy;function o(e){for(var t=e._private.edges,n=0;n0&&(e?P.emitAndNotify("remove"):t&&P.emit("remove"));for(var T=0;T1e-4&&Math.abs(s.v)>1e-4;);return a?function(e){return l[e*(l.length-1)|0]}:c}}(),ua=function(e,t,n,r){var i=function(e,t,n,r){var i=4,a=.001,o=1e-7,s=10,u=11,l=1/(u-1),c="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var h=c?new Float32Array(u):new Array(u);function f(e,t){return 1-3*t+3*e}function p(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((f(t,n)*e+p(t,n))*e+v(t))*e}function y(e,t,n){return 3*f(t,n)*e*e+2*p(t,n)*e+v(t)}function m(t,r){for(var a=0;a0?i=u:r=u}while(Math.abs(a)>o&&++l=a?m(t,s):0===c?s:x(t,r,r+l)}var _=!1;function E(){_=!0,e===t&&n===r||b()}var k=function(i){return _||E(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};k.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var C="generateBezier("+[e,t,n,r]+")";return k.toString=function(){return C},k}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},la={linear:function(e,t,n){return e+(t-e)*n},ease:ua(.25,.1,.25,1),"ease-in":ua(.42,0,1,1),"ease-out":ua(0,0,.58,1),"ease-in-out":ua(.42,0,.58,1),"ease-in-sine":ua(.47,0,.745,.715),"ease-out-sine":ua(.39,.575,.565,1),"ease-in-out-sine":ua(.445,.05,.55,.95),"ease-in-quad":ua(.55,.085,.68,.53),"ease-out-quad":ua(.25,.46,.45,.94),"ease-in-out-quad":ua(.455,.03,.515,.955),"ease-in-cubic":ua(.55,.055,.675,.19),"ease-out-cubic":ua(.215,.61,.355,1),"ease-in-out-cubic":ua(.645,.045,.355,1),"ease-in-quart":ua(.895,.03,.685,.22),"ease-out-quart":ua(.165,.84,.44,1),"ease-in-out-quart":ua(.77,0,.175,1),"ease-in-quint":ua(.755,.05,.855,.06),"ease-out-quint":ua(.23,1,.32,1),"ease-in-out-quint":ua(.86,0,.07,1),"ease-in-expo":ua(.95,.05,.795,.035),"ease-out-expo":ua(.19,1,.22,1),"ease-in-out-expo":ua(1,0,0,1),"ease-in-circ":ua(.6,.04,.98,.335),"ease-out-circ":ua(.075,.82,.165,1),"ease-in-out-circ":ua(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return la.linear;var r=sa(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":ua};function ca(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var a=i(t,n,r);return null==e||((e.roundValue||e.color)&&(a=Math.round(a)),void 0!==e.min&&(a=Math.max(a,e.min)),void 0!==e.max&&(a=Math.min(a,e.max))),a}function da(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function ha(e,t,n,r,i){var a=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var o=da(e,i),s=da(t,i);if(E(o)&&E(s))return ca(a,o,s,n,r);if(w(o)&&w(s)){for(var u=[],l=0;l0?("spring"===d&&h.push(o.duration),o.easingImpl=la[d].apply(null,h)):o.easingImpl=la[d]}var f,p=o.easingImpl;if(f=0===o.duration?1:(n-u)/o.duration,o.applying&&(f=o.progress),f<0?f=0:f>1&&(f=1),null==o.delay){var v=o.startPosition,g=o.position;if(g&&i&&!e.locked()){var y={};pa(v.x,g.x)&&(y.x=ha(v.x,g.x,f,p)),pa(v.y,g.y)&&(y.y=ha(v.y,g.y,f,p)),e.position(y)}var m=o.startPan,x=o.pan,w=a.pan,_=null!=x&&r;_&&(pa(m.x,x.x)&&(w.x=ha(m.x,x.x,f,p)),pa(m.y,x.y)&&(w.y=ha(m.y,x.y,f,p)),e.emit("pan"));var E=o.startZoom,k=o.zoom,C=null!=k&&r;C&&(pa(E,k)&&(a.zoom=et(a.minZoom,ha(E,k,f,p),a.maxZoom)),e.emit("zoom")),(_||C)&&e.emit("viewport");var S=o.style;if(S&&S.length>0&&i){for(var P=0;P=0;t--){(0,e[t])()}e.splice(0,e.length)},c=a.length-1;c>=0;c--){var d=a[c],h=d._private;h.stopped?(a.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,l(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||va(0,d,e),fa(t,d,e,n),h.applying&&(h.applying=!1),l(h.frames),null!=h.step&&h.step(e),d.completed()&&(a.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,l(h.completes)),s=!0)}return n||0!==a.length||0!==o.length||r.push(t),s}for(var a=!1,o=0;o0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var ya={animate:Yn.animate(),animation:Yn.animation(),animated:Yn.animated(),clearQueue:Yn.clearQueue(),delay:Yn.delay(),delayAnimation:Yn.delayAnimation(),stop:Yn.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){ga(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Z((function(n){ga(n,e),t()}))}()}}},ma={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&S(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},ba=function(e){return b(e)?new Pr(e):e},xa={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new _i(ma,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,ba(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,ba(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,ba(t),n),this},once:function(e,t,n){return this.emitter().one(e,ba(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Yn.eventAliasesOn(xa);var wa={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};wa.jpeg=wa.jpg;var _a={layout:function(e){if(null!=e)if(null!=e.name){var t=e.name,n=this.extension("layout",t);if(null!=n){var r;r=b(e.eles)?this.$(e.eles):null!=e.eles?e.eles:this.$();var i=new n(j({},e,{cy:this,eles:r}));return i}he("No such layout `"+t+"` found. Did you forget to import it and `cytoscape.use()` it?")}else he("A `name` must be specified to make a layout");else he("Layout options must be specified to make a layout")}};_a.createLayout=_a.makeLayout=_a.layout;var Ea={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)e.removeChild(e.childNodes[0]);this._private.renderer=null,this.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Ca.invalidateDimensions=Ca.resize;var Sa={collection:function(e,t){return b(e)?this.$(e):C(e)?e.collection():w(e)?new ia(this,e,t):new ia(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Sa.elements=Sa.filter=Sa.$;var Pa={};Pa.apply=function(e){var t=this._private,n=t.cy.collection();t.newStyle&&(t.contextStyles={},t.propDiffs={},this.cleanElements(e,!0));for(var r=0;r0;if(d||c&&h){var f=void 0;d&&h||d?f=u.properties:h&&(f=u.mappedProperties);for(var p=0;p1&&(v=1),s.color){var x=i.valueMin[0],w=i.valueMax[0],_=i.valueMin[1],k=i.valueMax[1],C=i.valueMin[2],S=i.valueMax[2],P=null==i.valueMin[3]?1:i.valueMin[3],T=null==i.valueMax[3]?1:i.valueMax[3],D=[Math.round(x+(w-x)*v),Math.round(_+(k-_)*v),Math.round(C+(S-C)*v),Math.round(P+(T-P)*v)];n={bypass:i.bypass,name:i.name,value:D,strValue:"rgb("+D[0]+", "+D[1]+", "+D[2]+")"}}else{if(!s.number)return!1;var B=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,B,i.bypass,"mapping")}if(!n)return p(),!1;n.mapping=i,i=n;break;case o.data:for(var M=i.field.split("."),z=d.data,O=0;O0&&a>0){for(var s={},u=!1,l=0;l0?e.delayAnimation(o).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:a,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Pa.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);null!=s&&s(n,r)&&a(o)},Pa.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Pa.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),"bezier"!==e.pstyle("curve-style").value&&("curve-style"!==t||"bezier"!==n&&"bezier"!==r)||!i.triggersBoundsOfParallelBeziers||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},Pa.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ta={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var a=0;at.length?i.substr(t.length):""}function o(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");;){if(i.match(/^\s*$/))break;var s=i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!s){pe("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+i);break}t=s[0];var u=s[1];if("core"!==u)if(new Pr(u).invalid){pe("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();continue}var l=s[2],c=!1;n=l;for(var d=[];;){if(n.match(/^\s*$/))break;var h=n.match(/^\s*(.+?)\s*:\s*(.+?)\s*;/);if(!h){pe("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+l),c=!0;break}r=h[0];var f=h[1],p=h[2];if(this.properties[f])this.parse(f,p)?(d.push({name:f,val:p}),o()):(pe("Skipping property: Invalid property definition in: "+r),o());else pe("Skipping property: Invalid property name in: "+r),o()}if(c){a();break}this.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(o.data.regex).exec(t))){if(n)return!1;var d=o.data;return{name:e,value:u,strValue:""+t,mapped:d,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(l=new RegExp(o.mapData.regex).exec(t))){if(n)return!1;if(c.multiple)return!1;var h=o.mapData;if(!c.color&&!c.number)return!1;var f=this.parse(e,l[4]);if(!f||f.mapped)return!1;var p=this.parse(e,l[5]);if(!p||p.mapped)return!1;if(f.pfValue===p.pfValue||f.strValue===p.strValue)return pe("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(c.color){var v=f.value,g=p.value;if(!(v[0]!==g[0]||v[1]!==g[1]||v[2]!==g[2]||v[3]!==g[3]&&(null!=v[3]&&1!==v[3]||null!=g[3]&&1!==g[3])))return!1}return{name:e,value:l,strValue:""+t,mapped:h,field:l[1],fieldMin:parseFloat(l[2]),fieldMax:parseFloat(l[3]),valueMin:f.value,valueMax:p.value,bypass:n}}}if(c.multiple&&"multiple"!==r){var y;if(y=s?t.split(/\s+/):w(t)?t:[t],c.evenMultiple&&y.length%2!=0)return null;for(var m=[],_=[],k=[],C="",S=!1,P=0;P0?" ":"")+T.strValue}return c.validate&&!c.validate(m,_)?null:c.singleEnum&&S?1===m.length&&b(m[0])?{name:e,value:m[0],strValue:m[0],bypass:n}:null:{name:e,value:m,pfValue:k,strValue:C,bypass:n,units:_}}var D,B,M=function(){for(var r=0;rc.max||c.strictMax&&t===c.max))return null;var R={name:e,value:t,strValue:""+t+(z||""),units:z,bypass:n};return c.unitless||"px"!==z&&"em"!==z?R.pfValue=t:R.pfValue="px"!==z&&z?this.getEmSizeInPixels()*t:t,"ms"!==z&&"s"!==z||(R.pfValue="ms"===z?t:1e3*t),"deg"!==z&&"rad"!==z||(R.pfValue="rad"===z?t:(D=t,Math.PI*D/180)),"%"===z&&(R.pfValue=t/100),R}if(c.propList){var j=[],F=""+t;if("none"===F);else{for(var q=F.split(/\s*,\s*|\s+/),W=0;W0&&u>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:o=(o=(o=Math.min((s-2*t)/n.w,(u-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:o)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,a=r.zoom,o=!1;if(r.zoomingEnabled||(o=!0),E(e)?n=e:_(e)&&(n=e.level,null!=e.position?t=We(e.position,a,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(o=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;E(u.x)&&(t.pan.x=u.x,o=!1),E(u.y)&&(t.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else C(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),a=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=h.getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}}};Ra.centre=Ra.center,Ra.autolockNodes=Ra.autolock,Ra.autoungrabifyNodes=Ra.autoungrabify;var ja={data:Yn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0}),removeData:Yn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0}),scratch:Yn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0}),removeScratch:Yn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0})};ja.attr=ja.data,ja.removeAttr=ja.removeData;var Va=function(e){var t=this,n=(e=j({},e)).container;n&&!k(n)&&k(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=void 0!==h&&void 0!==n&&!e.headless,o=e;o.layout=j({name:a?"grid":"null"},o.layout),o.renderer=j({name:a?"canvas":"null"},o.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},u=this._private={container:n,ready:!1,options:o,elements:new ia(this),listeners:[],aniEles:new ia(this),data:{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?a:o.styleEnabled,zoom:E(o.zoom)?o.zoom:1,pan:{x:_(o.pan)&&E(o.pan.x)?o.pan.x:0,y:_(o.pan)&&E(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});u.styleEnabled&&t.setStyle([]);var l=j({},o,o.renderer);t.initRenderer(l);!function(e,t){if(e.some(M))return Fn.all(e).then(t);t(e)}([o.style,o.elements],(function(e){var n=e[0],a=e[1];u.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(_(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var a=j({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()}(a,(function(){t.startAnimationLoop(),u.ready=!0,x(o.ready)&&t.on("ready",o.ready);for(var e=0;e0,l=tt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(C(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var z=D.shift(),O=T(z,B);if(O)z.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(M);else if(null===O){pe("Detected double maximal shift for node `"+z.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}P();var I=0;if(n.avoidOverlap)for(var A=0;A0&&y[0].length<=3?u/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:U+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:U+(i+1-(a+1)/2)*o,y:(r+1)*s}})),this};var Ha={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Za(e){this.options=j({},Ha,e)}Za.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));for(var o,s=tt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u=s.x1+s.w/2,l=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var g=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(g*g+y*y));o=Math.max(m,o)}return a.layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),a=o*Math.cos(r),s=o*Math.sin(r);return{x:u+a,y:l+s}})),this};var Ua,Ka={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ga(e){this.options=j({},Ka,e)}Ga.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles.nodes().not(":parent"),a=tt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o=a.x1+a.w/2,s=a.y1+a.h/2,u=[],l=0,c=0;c0)Math.abs(y[0].value-b.value)>=v&&(y=[],g.push(y));y.push(b)}var x=l+t.minNodeSpacing;if(!t.avoidOverlap){var w=g.length>0&&g[0].length>1,_=(Math.min(a.w,a.h)/2-x)/(g.length+w?1:0);x=Math.min(x,_)}for(var E=0,k=0;k1&&t.avoidOverlap){var T=Math.cos(P)-Math.cos(0),D=Math.sin(P)-Math.sin(0),B=Math.sqrt(x*x/(T*T+D*D));E=Math.max(B,E)}C.r=E,E+=x}if(t.equidistant){for(var M=0,z=0,O=0;O=e.numIter)&&(ao(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature=e.animationThreshold&&a(),Z(t)):(mo(r,e),s())}()}else{for(;l;)l=o(u),u++;mo(r,e),s()}return this},Qa.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Qa.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Ja=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:tt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},o=n.eles.components(),s={},u=0;u0){a.graphSet.push(w);for(u=0;ur.count?0:r.graph},to=function e(t,n,r,i){var a=i.graphSet[r];if(-10)var s=(l=r.nodeOverlap*o)*i/(v=Math.sqrt(i*i+a*a)),u=l*a/v;else{var l,c=co(e,i,a),d=co(t,-1*i,-1*a),h=d.x-c.x,f=d.y-c.y,p=h*h+f*f,v=Math.sqrt(p);s=(l=(e.nodeRepulsion+t.nodeRepulsion)/p)*h/v,u=l*f/v}e.isLocked||(e.offsetX-=s,e.offsetY-=u),t.isLocked||(t.offsetX+=s,t.offsetY+=u)}},lo=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},co=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,u=a/o,l={};return 0===t&&0n?(l.x=r,l.y=i+a/2,l):0t&&-1*u<=s&&s<=u?(l.x=r-o/2,l.y=i-o*n/2/t,l):0=u)?(l.x=r+a*t/2/n,l.y=i+a/2,l):0>n&&(s<=-1*u||s>=u)?(l.x=r-a*t/2/n,l.y=i-a/2,l):l},ho=function(e,t){for(var n=0;n1){var p=t.gravity*d/f,v=t.gravity*h/f;c.offsetX+=p,c.offsetY+=v}}}}},po=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],u=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},yo=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],a=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,a=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,a=!0),(null==i.minY||t.minY-i.padTopp&&(d+=f+t.componentSpacing,c=0,h=0,f=0)}}},bo={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function xo(e){this.options=j({},bo,e)}xo.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles.nodes().not(":parent");t.sort&&(r=r.sort(t.sort));var i=tt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===i.h||0===i.w)r.layoutPositions(this,t,(function(e){return{x:i.x1,y:i.y1}}));else{var a=r.size(),o=Math.sqrt(a*i.h/i.w),s=Math.round(o),u=Math.round(i.w/i.h*o),l=function(e){if(null==e)return Math.min(s,u);Math.min(s,u)==s?s=e:u=e},c=function(e){if(null==e)return Math.max(s,u);Math.max(s,u)==s?s=e:u=e},d=t.rows,h=null!=t.cols?t.cols:t.columns;if(null!=d&&null!=h)s=d,u=h;else if(null!=d&&null==h)s=d,u=Math.ceil(a/s);else if(null==d&&null!=h)u=h,s=Math.ceil(a/u);else if(u*s>a){var f=l(),p=c();(f-1)*p>=a?l(f-1):(p-1)*f>=a&&c(p-1)}else for(;u*s=a?c(g+1):l(v+1)}var y=i.w/u,m=i.h/s;if(t.condense&&(y=0,m=0),t.avoidOverlap)for(var b=0;b=u&&(B=0,D++)},z={},O=0;O(r=pt(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===a.edgeType||"multibezier"===a.edgeType||"self"===a.edgeType||"compound"===a.edgeType)for(x=a.allpts,w=0;w+5(r=ft(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return g(n,r),!0;m=m||i.source,b=b||i.target;var _=o.getArrowWidth(u,c),E=[{name:"source",x:a.arrowStartX,y:a.arrowStartY,angle:a.srcArrowAngle},{name:"target",x:a.arrowEndX,y:a.arrowEndY,angle:a.tgtArrowAngle},{name:"mid-source",x:a.midX,y:a.midY,angle:a.midsrcArrowAngle},{name:"mid-target",x:a.midX,y:a.midY,angle:a.midtgtArrowAngle}];for(w=0;w0&&(y(m),y(b))}function b(e,t,n){return _e(e,t,n)}function x(n,r){var i,a=n._private,o=p;i=r?r+"-":"",n.boundingBox();var s=a.labelBounds[r||"main"],u=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&u){var l=a.rstyle,c=b(l,"labelX",r),d=b(l,"labelY",r),h=b(a.rscratch,"labelAngle",r),f=s.x1-o,v=s.x2+o,y=s.y1-o,m=s.y2+o;if(h){var x=Math.cos(h),w=Math.sin(h),_=function(e,t){return{x:(e-=c)*x-(t-=d)*w+c,y:e*w+t*x+d}},E=_(f,y),k=_(f,m),C=_(v,y),S=_(v,m),P=[E.x,E.y,C.x,C.y,S.x,S.y,k.x,k.y];if(vt(e,t,P))return g(n),!0}else if(ut(s,e,t))return g(n),!0}}n&&(u=u.interactive);for(var w=u.length-1;w>=0;w--){var _=u[w];_.isNode()?y(_)||x(_):m(_)||x(_)||x(_,"source")||x(_,"target")}return l},getAllInBox:function(e,t,n,r){for(var i,a,o=this.getCachedZSortedEles().interactive,s=[],u=Math.min(e,n),l=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=tt({x1:e=u,y1:t=c,x2:n=l,y2:r=d}),f=0;f0?Math.max(e-t,0):Math.min(e+t,0)},w=x(m,g),_=x(b,y),E=!1;"auto"===c?l=Math.abs(w)>Math.abs(_)?"horizontal":"vertical":"upward"===c||"downward"===c?(l="vertical",E=!0):"leftward"!==c&&"rightward"!==c||(l="horizontal",E=!0);var k,C="vertical"===l,S=C?_:w,P=C?b:m,T=Ue(P),D=!1;(E&&(h||p)||!("downward"===c&&P<0||"upward"===c&&P>0||"leftward"===c&&P>0||"rightward"===c&&P<0)||(S=(T*=-1)*Math.abs(S),D=!0),h)?k=(f<0?1+f:f)*S:k=(f<0?S:0)+f*T;var B=function(e){return Math.abs(e)=Math.abs(S)},M=B(k),z=B(Math.abs(S)-Math.abs(k));if((M||z)&&!D)if(C){var O=Math.abs(P)<=a/2,I=Math.abs(m)<=o/2;if(O){var A=(r.x1+r.x2)/2,N=r.y1,L=r.y2;n.segpts=[A,N,A,L]}else if(I){var R=(r.y1+r.y2)/2,j=r.x1,V=r.x2;n.segpts=[j,R,V,R]}else n.segpts=[r.x1,r.y2]}else{var F=Math.abs(P)<=i/2,q=Math.abs(b)<=s/2;if(F){var W=(r.y1+r.y2)/2,Y=r.x1,X=r.x2;n.segpts=[Y,W,X,W]}else if(q){var H=(r.x1+r.x2)/2,Z=r.y1,U=r.y2;n.segpts=[H,Z,H,U]}else n.segpts=[r.x2,r.y1]}else if(C){var K=r.y1+k+(u?a/2*T:0),G=r.x1,$=r.x2;n.segpts=[G,K,$,K]}else{var Q=r.x1+k+(u?i/2*T:0),J=r.y1,ee=r.y2;n.segpts=[Q,J,Q,ee]}},Io.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,u=t.tgtH,l=t.srcShape,c=t.tgtShape,d=!E(n.startX)||!E(n.startY),h=!E(n.arrowStartX)||!E(n.arrowStartY),f=!E(n.endX)||!E(n.endY),p=!E(n.arrowEndX)||!E(n.arrowEndY),v=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),g=Ke({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=gh.poolIndex()){var f=d;d=h,h=f}var p=s.srcPos=d.position(),v=s.tgtPos=h.position(),g=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)];s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_0){var q=l,W=Ge(q,Xe(t)),Y=Ge(q,Xe(F)),X=W;if(Y2)Ge(q,{x:F[2],y:F[3]})0){var ie=c,ae=Ge(ie,Xe(t)),oe=Ge(ie,Xe(re)),se=ae;if(oe2)Ge(ie,{x:re[2],y:re[3]})=c||b){d={cp:g,segment:m};break}}if(d)break}var x=d.cp,w=d.segment,_=(c-f)/w.length,E=w.t1-w.t0,k=l?w.t0+E*_:w.t1-E*_;k=et(0,k,1),t=Je(x.p0,x.p1,x.p2,k),u=function(e,t,n,r){var i=et(0,r-.001,1),a=et(0,r+.001,1),o=Je(e,t,n,i),s=Je(e,t,n,a);return Fo(o,s)}(x.p0,x.p1,x.p2,k);break;case"straight":case"segments":case"haystack":for(var C,S,P,T,D=0,B=r.allpts.length,M=0;M+3=c));M+=2);var z=(c-S)/C;z=et(0,z,1),t=function(e,t,n,r){var i=t.x-e.x,a=t.y-e.y,o=Ke(e,t),s=i/o,u=a/o;return n=null==n?0:n,r=null!=r?r:n*o,{x:e.x+s*r,y:e.y+u*r}}(P,T,z),u=Fo(P,T)}o("labelX",s,t.x),o("labelY",s,t.y),o("labelAutoAngle",s,u)}};u("source"),u("target"),this.applyLabelDimensions(e)}},jo.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},jo.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),a=e.pstyle("line-height").pfValue,o=e.pstyle("text-wrap").strValue,s=_e(n.rscratch,"labelWrapCachedLines",t)||[],u="wrap"!==o?1:Math.max(s.length,1),l=i.height/u,c=l*a,d=i.width,h=i.height+(u-1)*(a-1)*l;Ee(n.rstyle,"labelWidth",t,d),Ee(n.rscratch,"labelWidth",t,d),Ee(n.rstyle,"labelHeight",t,h),Ee(n.rscratch,"labelHeight",t,h),Ee(n.rscratch,"labelLineHeight",t,c)},jo.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,a=e.pstyle("text-transform").value,o=function(e,r){return r?(Ee(n.rscratch,e,t,r),r):_e(n.rscratch,e,t)};if(!i)return"";"none"==a||("uppercase"==a?i=i.toUpperCase():"lowercase"==a&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var u=o("labelKey");if(null!=u&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l=i.split("\n"),c=e.pstyle("text-max-width").pfValue,d="anywhere"===e.pstyle("text-overflow-wrap").value,h=[],f=/[\s\u200b]+/,p=d?"":" ",v=0;vc){for(var b=g.split(f),x="",w=0;wk)break;C+=i[P],P===i.length-1&&(S=!0)}return S||(C+="…"),C}return i},jo.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},jo.calculateLabelDimensions=function(e,t){var n=te(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var a=e.pstyle("font-style").strValue,o=1*e.pstyle("font-size").pfValue+"px",s=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,l=this.labelCalcDiv;l||(l=this.labelCalcDiv=document.createElement("div"),document.body.appendChild(l));var c=l.style;return c.fontFamily=s,c.fontStyle=a,c.fontSize=o,c.fontWeight=u,c.position="absolute",c.left="-9999px",c.top="-9999px",c.zIndex="-1",c.visibility="hidden",c.pointerEvents="none",c.padding="0",c.lineHeight="1",c.whiteSpace="pre",l.textContent=t,r[n]={width:Math.ceil(l.clientWidth/1),height:Math.ceil(l.clientHeight/1)}},jo.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=t?t+"-":"",a=e.pstyle(i+"text-rotation"),o=a.strValue;return"none"===o?0:r&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:a.pfValue},jo.calculateLabelAngles=function(e){var t=this,n=e.isEdge(),r=e._private.rscratch;r.labelAngle=t.calculateLabelAngle(e),n&&(r.sourceLabelAngle=t.calculateLabelAngle(e,"source"),r.targetLabelAngle=t.calculateLabelAngle(e,"target"))};var qo={},Wo=!1;qo.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return Wo||(pe("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Wo=!0),"rectangle";if(e.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var Yo={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var P=r(t);g&&(e.hoverData.tapholdCancelled=!0);i=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var T=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||o.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),p[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):o.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(i=!0,o.panningEnabled()&&o.userPanningEnabled()){var B;if(e.hoverData.justStartedPan){var M=e.hoverData.mdownPos;B={x:(c[0]-M[0])*s,y:(c[1]-M[1])*s},e.hoverData.justStartedPan=!1}else B={x:x[0]*s,y:x[1]*s};o.panBy(B),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=p[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||v==y||(y&&n(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=v),b)if(g){if(o.boxSelectionEnabled()&&P)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),T();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var z=!e.dragData.didDrag;z&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var O=o.collection();e.hoverData.draggingEles||l(w,{inDragLayer:!0});var I={x:0,y:0};if(E(x[0])&&E(x[1])&&(I.x+=x[0],I.y+=x[1],z)){var A=e.hoverData.dragDelta;A&&E(A[0])&&E(A[1])&&(I.x+=A[0],I.y+=A[1])}for(var N=0;N0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=a.collection()),u!=c||e.dragData.didDrag||e.hoverData.selecting||null!=u&&u._private.selectable&&(e.hoverData.dragging||("additive"===a.selectionType()||h?u.selected()?u.unselect(["tapunselect"]):u.select(["tapselect"]):h||(a.$(t).unmerge(u).unselect(["tapunselect"]),u.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=a.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),a.emit({type:"boxend",originalEvent:i,position:{x:o[0],y:o[1]}});var g=function(e){return e.selectable()&&!e.selected()};"additive"===a.selectionType()||h||a.$(t).unmerge(v).unselect(),v.emit("box").stdFilter(g).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var y=c&&c.grabbed();d(l),y&&(c.emit("freeon"),l.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),l.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null}}),!1);var b,x,w,_,k,C,S,P,T,D,B,M,z,O=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),a=e.projectIntoViewport(t.clientX,t.clientY),o=[a[0]*r+i.x,a[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var u=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(u=e.gestureStartZoom*t.scale),n.zoom({level:u,renderedPosition:{x:o[0],y:o[1]}})}}};e.registerBinding(e.container,"wheel",O,!0),e.registerBinding(window,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||O(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var I,A,N,L,R=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},j=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",I=function(t){if(e.hasTouchStarted=!0,m(t)){f(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,a=e.touchData.earlier;if(t.touches[0]){var o=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=o[0],i[1]=o[1]}if(t.touches[1]){o=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY);i[2]=o[0],i[3]=o[1]}if(t.touches[2]){o=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY);i[4]=o[0],i[5]=o[1]}if(t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var u=e.findContainerClientCoords();T=u[0],D=u[1],B=u[2],M=u[3],b=t.touches[0].clientX-T,x=t.touches[0].clientY-D,w=t.touches[1].clientX-T,_=t.touches[1].clientY-D,z=0<=b&&b<=B&&0<=w&&w<=B&&0<=x&&x<=M&&0<=_&&_<=M;var h=r.pan(),p=r.zoom();k=R(b,x,w,_),C=j(b,x,w,_),P=[((S=[(b+w)/2,(x+_)/2])[0]-h.x)/p,(S[1]-h.y)/p];if(C<4e4&&!t.touches[2]){var v=e.findNearestElement(i[0],i[1],!0,!0),g=e.findNearestElement(i[2],i[3],!0,!0);return v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):r.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])r.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),E=y[0];if(null!=E&&(E.activate(),e.touchData.start=E,e.touchData.starts=y,e.nodeIsGrabbable(E))){var O=e.dragData.touchDragEles=r.collection(),I=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),E.selected()?(I=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(I,{addToList:O})):c(E,{addToList:O}),s(E);var A=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};E.emit(A("grabon")),I?I.forEach((function(e){e.emit(A("grab"))})):E.emit(A("grab"))}n(E,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==E&&(e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||n(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var N=e.touchData.startPosition=[],L=0;L=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var M=t.touches[0].clientX-T,O=t.touches[0].clientY-D,I=t.touches[1].clientX-T,A=t.touches[1].clientY-D,N=j(M,O,I,A);if(N/C>=2.25||N>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var L={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(L),e.touchData.start=null):o.emit(L)}}if(r&&e.touchData.cxt){L={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}};e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(L):o.emit(L),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var V=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&V===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=V,V&&V.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&o.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||o.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(r&&t.touches[1]&&!e.touchData.didSelect&&o.zoomingEnabled()&&o.panningEnabled()&&o.userZoomingEnabled()&&o.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(window,"touchcancel",N=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",L=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var a=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var o,s=e.cy,u=s.zoom(),l=e.touchData.now,c=e.touchData.earlier;if(r.touches[0]){var h=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);l[0]=h[0],l[1]=h[1]}if(r.touches[1]){h=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);l[2]=h[0],l[3]=h[1]}if(r.touches[2]){h=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);l[4]=h[0],l[5]=h[1]}if(i&&i.unactivate(),e.touchData.cxt){if(o={originalEvent:r,type:"cxttapend",position:{x:l[0],y:l[1]}},i?i.emit(o):s.emit(o),!e.touchData.cxtDragged){var f={originalEvent:r,type:"cxttap",position:{x:l[0],y:l[1]}};i?i.emit(f):s.emit(f)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!r.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var p=s.collection(e.getAllInBox(a[0],a[1],a[2],a[3]));a[0]=void 0,a[1]=void 0,a[2]=void 0,a[3]=void 0,a[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:l[0],y:l[1]}});p.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),p.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),r.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(r.touches[1]);else if(r.touches[0]);else if(!r.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var v=e.dragData.touchDragEles;if(null!=i){var g=i._private.grabbed;d(v),e.redrawHint("drag",!0),e.redrawHint("eles",!0),g&&(i.emit("freeon"),v.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),v.emit("dragfree"))),n(i,["touchend","tapend","vmouseup","tapdragout"],r,{x:l[0],y:l[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(l[0],l[1],!0,!0);n(y,["touchend","tapend","vmouseup","tapdragout"],r,{x:l[0],y:l[1]})}var m=e.touchData.startPosition[0]-l[0],b=m*m,x=e.touchData.startPosition[1]-l[1],w=(b+x*x)*u*u;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:l[0],y:l[1]})),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var T=[l[0],l[1]],D=Math.pow(T[0]-e,2)+Math.pow(T[1]-t,2),B=1;B0)return v[0]}return null},h=Object.keys(c),f=0;f0?u:ct(i,a,e,t,n,r,o)},checkPoint:function(e,t,n,r,i,a,o){var s=Tt(r,i),u=2*s;if(gt(e,t,this.points,a,o,r,i-u,[0,-1],n))return!0;if(gt(e,t,this.points,a,o,r-u,i,[0,-1],n))return!0;var l=r/2+2*n,c=i/2+2*n;return!!vt(e,t,[a-l,o-c,a-l,o,a+l,o,a+l,o-c])||(!!bt(e,t,u,u,a+r/2-s,o+i/2-s,n)||!!bt(e,t,u,u,a-r/2+s,o+i/2-s,n))}}},Ko.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Ct(3,0)),this.generateRoundPolygon("round-triangle",Ct(3,0)),this.generatePolygon("rectangle",Ct(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",Ct(5,0)),this.generateRoundPolygon("round-pentagon",Ct(5,0)),this.generatePolygon("hexagon",Ct(6,0)),this.generateRoundPolygon("round-hexagon",Ct(6,0)),this.generatePolygon("heptagon",Ct(7,0)),this.generateRoundPolygon("round-heptagon",Ct(7,0)),this.generatePolygon("octagon",Ct(8,0)),this.generateRoundPolygon("round-octagon",Ct(8,0));var r=new Array(20),i=Pt(5,0),a=Pt(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=e.deqFastCost*v)break}else if(i){if(f>=e.deqCost*u||f>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*(1e3/60))break;var g=e.deq(t,d,c);if(!(g.length>0))break;for(var y=0;y0&&(e.onDeqd(t,l),!i&&e.shouldRedraw(t,l,d,c)&&r())}),a(t))}}},ts=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le;s(this,e),this.idsByKey=new ke,this.keyForId=new ke,this.cachesByLvl=new ke,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return l(e,[{key:"getIdsFor",value:function(e){null==e&&he("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Se,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new ke,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),ns={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},rs=be({getKey:null,doesEleInvalidateKey:le,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ue,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),is=function(e,t){this.renderer=e,this.onDequeues=[];var n=rs(t);j(this,n),this.lookup=new ts(n.getKey,n.doesEleInvalidateKey),this.setupDequeueing()},as=is.prototype;as.reasons=ns,as.getTextureQueue=function(e){return this.eleImgCaches=this.eleImgCaches||{},this.eleImgCaches[e]=this.eleImgCaches[e]||[]},as.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},as.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new a((function(e,t){return t.reqs-e.reqs}))},as.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},as.getElement=function(e,t,n,r,i){var a=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible())return null;if(!a.allowEdgeTxrCaching&&e.isEdge()||!a.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Ze(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var l=Math.pow(2,r),c=t.h*l,d=t.w*l,h=o.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,h))return null;var f,p=u.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;if(f=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var v=a.getTextureQueue(f),g=v[v.length-2],y=function(){return a.recycleTexture(f,d)||a.addTexture(f,d)};g||(g=v[v.length-1]),g||(g=y()),g.width-g.usedWidthr;P--)C=a.getElement(e,t,n,P,ns.downscale);S()}else{var T;if(!x&&!w&&!_)for(var D=r-1;D>=-4;D--){var B=u.get(e,D);if(B){T=B;break}}if(b(T))return a.queueElement(e,r),T;g.context.translate(g.usedWidth,0),g.context.scale(l,l),this.drawElement(g.context,e,t,h,!1),g.context.scale(1/l,1/l),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:l,width:d,height:c,scaledLabelShown:h},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(p),u.set(e,r,p),a.checkTextureFullness(g),p},as.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},as.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?xe(t,e):e.fullnessChecks++},as.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;xe(n,e),e.retired=!0;for(var i=e.eleCaches,a=0;a=t)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,we(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),xe(r,a),n.push(a),a}},as.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),a=r[i];if(a)a.level=Math.max(a.level,t),a.eles.merge(e),a.reqs++,n.updateItem(a);else{var o={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(o),r[i]=o}},as.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,a=0;a<1&&t.size()>0;a++){var o=t.pop(),s=o.key,u=o.eles[0],l=i.hasCache(u,o.level);if(n[s]=null,!l){r.push(o);var c=this.getBoundingBox(u);this.getElement(u,c,e,o.level,ns.dequeue)}}return r},as.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=se,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},as.onDequeue=function(e){this.onDequeues.push(e)},as.offDequeue=function(e){xe(this.onDequeues,e)},as.setupDequeueing=es({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var o,s,u=r.layersByLevel,l=Math.pow(2,n),c=u[n]=u[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=u[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var a=c.length-1;a>=0;a--){var o=c[a];o.invalid&&xe(c,o)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!o){o=tt();for(var t=0;t16e6)return null;var a=r.makeLayer(o,n);if(null!=i){var s=c.indexOf(i)+1;c.splice(s,0,a)}else(void 0===t.insert||t.insert)&&c.unshift(a);return a};if(r.skipping&&!a)return null;for(var h=null,f=e.length/1,p=!a,v=0;v=f||!lt(h.bb,g.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||p?r.queueLayer(h,g):r.drawEleInLayer(h,g,n,t),h.eles.push(g),m[n]=h}}return s||(p?null:c)},ss.getEleLevelForLayerLevel=function(e,t){return e},ss.drawEleInLayer=function(e,t,n,r){var i=this.renderer,a=e.context,o=t.boundingBox();0!==o.w&&0!==o.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(a,!1),i.drawCachedElement(a,t,null,null,n,!0),i.setImgSmoothing(a,!0))},ss.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(a.invalid)return!1;r+=a.eles.length}return r===t.length},ss.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},ss.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=U(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},ss.invalidateLayer=function(e){if(this.lastInvalidationTime=U(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];xe(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=this,s=t._private.rscratch;if((!a||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var u;n&&(u=n,e.translate(-u.x1,-u.y1));var l=a?t.pstyle("opacity").value:1,c=t.pstyle("line-style").value,d=t.pstyle("width").pfValue,h=t.pstyle("line-cap").value,f=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;e.lineWidth=d,e.lineCap=h,o.eleStrokeStyle(e,t,n),o.drawEdgePath(t,e,s.allpts,c),e.lineCap="butt"},p=function(){i&&o.drawEdgeOverlay(e,t)},v=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;o.drawArrowheads(e,t,n)},g=function(){o.drawElementText(e,t,null,r)};e.lineJoin="round";var y="yes"===t.pstyle("ghost").value;if(y){var m=t.pstyle("ghost-offset-x").pfValue,b=t.pstyle("ghost-offset-y").pfValue,x=t.pstyle("ghost-opacity").value,w=l*x;e.translate(m,b),f(w),v(w),e.translate(-m,-b)}f(),v(),p(),g(),n&&e.translate(u.x1,u.y1)}},drawEdgeOverlay:function(e,t){if(t.visible()){var n=t.pstyle("overlay-opacity").value;if(0!==n){var r=this,i=r.usePaths(),a=t._private.rscratch,o=2*t.pstyle("overlay-padding").pfValue,s=t.pstyle("overlay-color").value;e.lineWidth=o,"self"!==a.edgeType||i?e.lineCap="round":e.lineCap="butt",r.colorStrokeStyle(e,s[0],s[1],s[2],n),r.drawEdgePath(t,e,a.allpts,"solid")}}},drawEdgePath:function(e,t,n,r){var i,a=e._private.rscratch,o=t,s=!1,u=this.usePaths(),l=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(u){var d=n.join("$");a.pathCacheKey&&a.pathCacheKey===d?(i=t=a.pathCache,s=!0):(i=t=new Path2D,a.pathCacheKey=d,a.pathCache=i)}if(o.setLineDash)switch(r){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(l),o.lineDashOffset=c;break;case"solid":o.setLineDash([])}if(!s&&!a.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+a,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+a,n+i),e.quadraticCurveTo(t,n+i,t,n+i-a),e.lineTo(t,n+a),e.quadraticCurveTo(t,n,t+a,n),e.closePath(),e.fill()}Ss.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Ze(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],o=this;if(null==r){if(a&&!o.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(t);e.textAlign=u,e.textBaseline="bottom"}else{var l=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(l||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var f,p=!n;n&&(f=n,e.translate(-f.x1,-f.y1)),null==i?(o.drawText(e,t,null,p,a),t.isEdge()&&(o.drawText(e,t,"source",p,a),o.drawText(e,t,"target",p,a))):o.drawText(e,t,i,p,a),n&&e.translate(f.x1,f.y1)},Ss.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",a=t.pstyle("font-family").strValue,o=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,u=t.pstyle("text-outline-opacity").value*s,l=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+o+" "+i+" "+a,e.lineJoin="round",this.colorFillStyle(e,l[0],l[1],l[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],u)},Ss.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),a=_e(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?a:0:"none"===i.strValue?0:i.pfValue},Ss.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=t._private,o=a.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var u,l,c=_e(o,"labelX",n),d=_e(o,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,i);var f,p=n?n+"-":"",v=_e(o,"labelWidth",n),g=_e(o,"labelHeight",n),y=t.pstyle(p+"text-margin-x").pfValue,m=t.pstyle(p+"text-margin-y").pfValue,b=t.isEdge(),x=t.pstyle("text-halign").value,w=t.pstyle("text-valign").value;switch(b&&(x="center",w="center"),c+=y,d+=m,0!==(f=r?this.getTextAngle(t,n):0)&&(u=c,l=d,e.translate(u,l),e.rotate(f),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var _=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,k=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue;if(_>0||k>0&&E>0){var S=c-C;switch(x){case"left":S-=v;break;case"center":S-=v/2}var P=d-g-C,T=v+2*C,D=g+2*C;if(_>0){var B=e.fillStyle,M=t.pstyle("text-background-color").value;e.fillStyle="rgba("+M[0]+","+M[1]+","+M[2]+","+_*s+")";var z=t.pstyle("text-background-shape").strValue;0===z.indexOf("round")?Ps(e,S,P,T,D,2):e.fillRect(S,P,T,D),e.fillStyle=B}if(k>0&&E>0){var O=e.strokeStyle,I=e.lineWidth,A=t.pstyle("text-border-color").value,N=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+A[0]+","+A[1]+","+A[2]+","+E*s+")",e.lineWidth=k,e.setLineDash)switch(N){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(S,P,T,D),"double"===N){var L=k/2;e.strokeRect(S+L,P+L,T-2*L,D-2*L)}e.setLineDash&&e.setLineDash([]),e.lineWidth=I,e.strokeStyle=O}}var R=2*t.pstyle("text-outline-width").pfValue;if(R>0&&(e.lineWidth=R),"wrap"===t.pstyle("text-wrap").value){var j=_e(o,"labelWrapCachedLines",n),V=_e(o,"labelLineHeight",n),F=v/2,q=this.getLabelJustification(t);switch("auto"===q||("left"===x?"left"===q?c+=-v:"center"===q&&(c+=-F):"center"===x?"left"===q?c+=-F:"right"===q&&(c+=F):"right"===x&&("center"===q?c+=F:"right"===q&&(c+=v))),w){case"top":d-=(j.length-1)*V;break;case"center":case"bottom":d-=(j.length-1)*V}for(var W=0;W0&&e.strokeText(j[W],c,d),e.fillText(j[W],c,d),d+=V}else R>0&&e.strokeText(h,c,d),e.fillText(h,c,d);0!==f&&(e.rotate(-f),e.translate(-u,-l))}}};var Ts={drawNode:function(e,t,n){var r,i,a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],u=this,l=t._private,c=l.rscratch,d=t.position();if(E(d.x)&&E(d.y)&&(!s||t.visible())){var h,f,p=s?t.effectiveOpacity():1,v=u.usePaths(),g=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(f=n,e.translate(-f.x1,-f.y1));for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),_=0,k=0;k0&&void 0!==arguments[0]?arguments[0]:B;u.eleFillStyle(e,t,n)},A=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:O;u.colorStrokeStyle(e,M[0],M[1],M[2],t)},N=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var R=u.nodePathCache=u.nodePathCache||[],j=ne("polygon"===N?N+","+L.join(","):N,""+i,""+r),V=R[j];null!=V?(h=V,g=!0,c.pathCache=h):(h=new Path2D,R[j]=c.pathCache=h)}var F=function(){if(!g){var n=d;v&&(n={x:0,y:0}),u.nodeShapes[u.getNodeShape(t)].draw(h||e,n.x,n.y,r,i)}v?e.fill(h):e.fill()},q=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,r=l.backgrounding,i=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;u.hasPie(t)&&(u.drawPie(e,t,a),n&&(v||u.nodeShapes[u.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},Y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,n=(T>0?T:-T)*t,r=T>0?0:255;0!==T&&(u.colorFillStyle(e,r,r,r,n),v?e.fill(h):e.fill())},X=function(){if(D>0){if(e.lineWidth=D,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}if(v?e.stroke(h):e.stroke(),"double"===z){e.lineWidth=D/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(h):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},H=function(){o&&u.drawNodeOverlay(e,t,d,r,i)},Z=function(){u.drawElementText(e,t,null,a)},U="yes"===t.pstyle("ghost").value;if(U){var K=t.pstyle("ghost-offset-x").pfValue,G=t.pstyle("ghost-offset-y").pfValue,$=t.pstyle("ghost-opacity").value,Q=$*p;e.translate(K,G),I($*B),F(),q(Q),W(0!==T||0!==D),Y(Q),A($*O),X(),e.translate(-K,-G)}I(),F(),q(),W(0!==T||0!==D),Y(),A(),X(),v&&e.translate(-d.x,-d.y),Z(),H(),n&&e.translate(f.x1,f.y1)}},drawNodeOverlay:function(e,t,n,r,i){if(t.visible()){var a=t.pstyle("overlay-padding").pfValue,o=t.pstyle("overlay-opacity").value,s=t.pstyle("overlay-color").value;if(o>0){if(n=n||t.position(),null==r||null==i){var u=t.padding();r=t.width()+2*u,i=t.height()+2*u}this.colorFillStyle(e,s[0],s[1],s[2],o),this.nodeShapes.roundrectangle.draw(e,n.x,n.y,r+2*a,i+2*a),e.fill()}}},hasPie:function(e){return(e=e[0])._private.hasPie},drawPie:function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),a=t.pstyle("pie-size"),o=r.x,s=r.y,u=t.width(),l=t.height(),c=Math.min(u,l)/2,d=0;this.usePaths()&&(o=0,s=0),"%"===a.units?c*=a.pfValue:void 0!==a.pfValue&&(c=a.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var f=t.pstyle("pie-"+h+"-background-size").value,p=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=f/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*g;0===f||d>=1||d+g>1||(e.beginPath(),e.moveTo(o,s),e.arc(o,s,c,y,m),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=g)}}},Ds={};Ds.getPixelRatio=function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(window.devicePixelRatio||1)/t},Ds.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;io.minMbLowQualFrames&&(o.motionBlurPxRatio=o.mbPxRBlurry)),o.clearingMotionBlur&&(o.motionBlurPxRatio=1),o.textureDrawLastFrame&&!d&&(c[o.NODE]=!0,c[o.SELECT_BOX]=!0);var m=u.style(),b=u.zoom(),x=void 0!==i?i:b,w=u.pan(),_={x:w.x,y:w.y},E={zoom:b,pan:{x:w.x,y:w.y}},k=o.prevViewport;void 0===k||E.zoom!==k.zoom||E.pan.x!==k.pan.x||E.pan.y!==k.pan.y||v&&!p||(o.motionBlurPxRatio=1),a&&(_=a),x*=s,_.x*=s,_.y*=s;var C=o.getCachedZSortedEles();function S(e,t,n,r,i){var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",o.colorFillStyle(e,255,255,255,o.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=a}function P(e,r){var s,u,c,d;o.clearingMotionBlur||e!==l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]&&e!==l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]?(s=_,u=x,c=o.canvasWidth,d=o.canvasHeight):(s={x:w.x*f,y:w.y*f},u=b*f,c=o.canvasWidth*f,d=o.canvasHeight*f),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?S(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(u,u)),a&&e.translate(a.x,a.y),i&&e.scale(i,i)}if(d||(o.textureDrawLastFrame=!1),d){if(o.textureDrawLastFrame=!0,!o.textureCache){o.textureCache={},o.textureCache.bb=u.mutableElements().boundingBox(),o.textureCache.texture=o.data.bufferCanvases[o.TEXTURE_BUFFER];var T=o.data.bufferContexts[o.TEXTURE_BUFFER];T.setTransform(1,0,0,1,0,0),T.clearRect(0,0,o.canvasWidth*o.textureMult,o.canvasHeight*o.textureMult),o.render({forcedContext:T,drawOnlyNodeLayer:!0,forcedPxRatio:s*o.textureMult}),(E=o.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:o.canvasWidth,height:o.canvasHeight}).mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}c[o.DRAG]=!1,c[o.NODE]=!1;var D=l.contexts[o.NODE],B=o.textureCache.texture;E=o.textureCache.viewport;D.setTransform(1,0,0,1,0,0),h?S(D,0,0,E.width,E.height):D.clearRect(0,0,E.width,E.height);var M=m.core("outside-texture-bg-color").value,z=m.core("outside-texture-bg-opacity").value;o.colorFillStyle(D,M[0],M[1],M[2],z),D.fillRect(0,0,E.width,E.height);b=u.zoom();P(D,!1),D.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),D.drawImage(B,E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s)}else o.textureOnViewport&&!t&&(o.textureCache=null);var O=u.extent(),I=o.pinching||o.hoverData.dragging||o.swipePanning||o.data.wheelZooming||o.hoverData.draggingEles||o.cy.animated(),A=o.hideEdgesOnViewport&&I,N=[];if(N[o.NODE]=!c[o.NODE]&&h&&!o.clearedForMotionBlur[o.NODE]||o.clearingMotionBlur,N[o.NODE]&&(o.clearedForMotionBlur[o.NODE]=!0),N[o.DRAG]=!c[o.DRAG]&&h&&!o.clearedForMotionBlur[o.DRAG]||o.clearingMotionBlur,N[o.DRAG]&&(o.clearedForMotionBlur[o.DRAG]=!0),c[o.NODE]||n||r||N[o.NODE]){var L=h&&!N[o.NODE]&&1!==f;P(D=t||(L?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE]:l.contexts[o.NODE]),h&&!L?"motionBlur":void 0),A?o.drawCachedNodes(D,C.nondrag,s,O):o.drawLayeredElements(D,C.nondrag,s,O),o.debug&&o.drawDebugPoints(D,C.nondrag),n||h||(c[o.NODE]=!1)}if(!r&&(c[o.DRAG]||n||N[o.DRAG])){L=h&&!N[o.DRAG]&&1!==f;P(D=t||(L?o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]:l.contexts[o.DRAG]),h&&!L?"motionBlur":void 0),A?o.drawCachedNodes(D,C.drag,s,O):o.drawCachedElements(D,C.drag,s,O),o.debug&&o.drawDebugPoints(D,C.drag),n||h||(c[o.DRAG]=!1)}if(o.showFps||!r&&c[o.SELECT_BOX]&&!n){if(P(D=t||l.contexts[o.SELECT_BOX]),1==o.selection[4]&&(o.hoverData.selecting||o.touchData.selecting)){b=o.cy.zoom();var R=m.core("selection-box-border-width").value/b;D.lineWidth=R,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]),R>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(o.selection[0],o.selection[1],o.selection[2]-o.selection[0],o.selection[3]-o.selection[1]))}if(l.bgActivePosistion&&!o.hoverData.selecting){b=o.cy.zoom();var j=l.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(j.x,j.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var V=o.lastRedrawTime;if(o.showFps&&V){V=Math.round(V);var F=Math.round(1e3/V);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+V+" ms = "+F+" fps",0,20);D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(F/60,1),20)}n||(c[o.SELECT_BOX]=!1)}if(h&&1!==f){var q=l.contexts[o.NODE],W=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE],Y=l.contexts[o.DRAG],X=o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,o.canvasWidth,o.canvasHeight):S(e,0,0,o.canvasWidth,o.canvasHeight);var r=f;e.drawImage(t,0,0,o.canvasWidth*r,o.canvasHeight*r,0,0,o.canvasWidth,o.canvasHeight)};(c[o.NODE]||N[o.NODE])&&(H(q,W,N[o.NODE]),c[o.NODE]=!1),(c[o.DRAG]||N[o.DRAG])&&(H(Y,X,N[o.DRAG]),c[o.DRAG]=!1)}o.prevViewport=E,o.clearingMotionBlur&&(o.clearingMotionBlur=!1,o.motionBlurCleared=!0,o.motionBlur=!0),h&&(o.motionBlurTimeout=setTimeout((function(){o.motionBlurTimeout=null,o.clearedForMotionBlur[o.NODE]=!1,o.clearedForMotionBlur[o.DRAG]=!1,o.motionBlur=!1,o.clearingMotionBlur=!d,o.mbFrames=0,c[o.NODE]=!0,c[o.DRAG]=!0,o.redraw()}),100)),t||u.emit("render")};for(var Bs={drawPolygonPath:function(e,t,n,r,i,a){var o=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+o*a[0],n+s*a[1]);for(var u=1;u0&&a>0){h.clearRect(0,0,i,a),h.globalCompositeOperation="source-over";var f=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*u,-n.y1*u),h.scale(u,u),this.drawElements(h,f),h.scale(1/u,1/u),h.translate(n.x1*u,n.y1*u);else{var p=t.pan(),v={x:p.x*u,y:p.y*u};u*=t.zoom(),h.translate(v.x,v.y),h.scale(u,u),this.drawElements(h,f),h.scale(1/u,1/u),h.translate(-v.x,-v.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,a),h.fill())}return d},Ls.png=function(e){return js(e,this.bufferCanvasImage(e),"image/png")},Ls.jpg=function(e){return js(e,this.bufferCanvasImage(e),"image/jpeg")};var Vs={nodeShapeImpl:function(e,t,n,r,i,a,o){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,a);case"polygon":return this.drawPolygonPath(t,n,r,i,a,o);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,a,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,a);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,a);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,a);case"barrel":return this.drawBarrelPath(t,n,r,i,a)}}},Fs=Ws,qs=Ws.prototype;function Ws(e){var t=this;t.data={canvases:new Array(qs.CANVAS_LAYERS),contexts:new Array(qs.CANVAS_LAYERS),canvasNeedsRedraw:new Array(qs.CANVAS_LAYERS),bufferCanvases:new Array(qs.BUFFER_COUNT),bufferContexts:new Array(qs.CANVAS_LAYERS)};t.data.canvasContainer=document.createElement("div");var n=t.data.canvasContainer.style;t.data.canvasContainer.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",n.position="relative",n.zIndex="0",n.overflow="hidden";var r=e.cy.container();r.appendChild(t.data.canvasContainer),r.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)";var i={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};f&&f.userAgent.match(/msie|trident|edge/i)&&(i["-ms-touch-action"]="none",i["touch-action"]="none");for(var a=0;a=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(11),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(0))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,l={},c=!1,d=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,r=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n=t||n<0||g&&e-l>=a}function w(){var e=f();if(x(e))return _(e);s=setTimeout(w,function(e){var n=t-(e-u);return g?h(n,a-(e-l)):n}(e))}function _(e){return s=void 0,y&&r?m(e):(r=i=void 0,o)}function E(){var e=f(),n=x(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return b(u);if(g)return s=setTimeout(w,t),m(u)}return void 0===s&&(s=setTimeout(w,t)),o}return t=v(t)||0,p(n)&&(c=!!n.leading,a=(g="maxWait"in n)?d(v(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},E.flush=function(){return void 0===s?o:_(f())},E}}).call(this,n(0))},function(e,t,n){e.exports=n(15)},function(e,t,n){var r,i,a;(function(){var n,o,s,u,l,c,d,h,f,p,v,g,y,m,b;s=Math.floor,p=Math.min,o=function(e,t){return et?1:0},f=function(e,t,n,r,i){var a;if(null==n&&(n=0),null==i&&(i=o),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);nn;0<=n?t++:t--)l.push(t);return l}.apply(this).reverse()).length;rv;0<=v?++c:--c)g.push(l(e,n));return g},m=function(e,t,n,r){var i,a,s;for(null==r&&(r=o),i=e[n];n>t&&r(i,a=e[s=n-1>>1])<0;)e[n]=a,n=s;return e[n]=i},b=function(e,t,n){var r,i,a,s,u;for(null==n&&(n=o),i=e.length,u=t,a=e[t],r=2*t+1;r * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var a="Expected a function",o="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",l="[object Array]",c="[object Boolean]",d="[object Date]",h="[object Error]",f="[object Function]",p="[object GeneratorFunction]",v="[object Map]",g="[object Number]",y="[object Object]",m="[object RegExp]",b="[object Set]",x="[object String]",w="[object Symbol]",_="[object WeakMap]",E="[object ArrayBuffer]",k="[object DataView]",C="[object Float32Array]",S="[object Float64Array]",P="[object Int8Array]",T="[object Int16Array]",D="[object Int32Array]",B="[object Uint8Array]",M="[object Uint16Array]",z="[object Uint32Array]",O=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,A=/(__e\(.*?\)|\b__t\)) \+\n'';/g,N=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,R=RegExp(N.source),j=RegExp(L.source),V=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,W=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,H=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(H.source),U=/^\s+|\s+$/g,K=/^\s+/,G=/\s+$/,$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,ee=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,ae=/^0b[01]+$/i,oe=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,de=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",fe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pe="[\\ud800-\\udfff]",ve="["+fe+"]",ge="["+he+"]",ye="\\d+",me="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",xe="[^\\ud800-\\udfff"+fe+ye+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",we="\\ud83c[\\udffb-\\udfff]",_e="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",ke="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Se="(?:"+be+"|"+xe+")",Pe="(?:"+Ce+"|"+xe+")",Te="(?:"+ge+"|"+we+")"+"?",De="[\\ufe0e\\ufe0f]?"+Te+("(?:\\u200d(?:"+[_e,Ee,ke].join("|")+")[\\ufe0e\\ufe0f]?"+Te+")*"),Be="(?:"+[me,Ee,ke].join("|")+")"+De,Me="(?:"+[_e+ge+"?",ge,Ee,ke,pe].join("|")+")",ze=RegExp("['’]","g"),Oe=RegExp(ge,"g"),Ie=RegExp(we+"(?="+we+")|"+Me+De,"g"),Ae=RegExp([Ce+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ve,Ce,"$"].join("|")+")",Pe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ve,Ce+Se,"$"].join("|")+")",Ce+"?"+Se+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ce+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ye,Be].join("|"),"g"),Ne=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Re=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],je=-1,Ve={};Ve[C]=Ve[S]=Ve[P]=Ve[T]=Ve[D]=Ve[B]=Ve["[object Uint8ClampedArray]"]=Ve[M]=Ve[z]=!0,Ve[u]=Ve[l]=Ve[E]=Ve[c]=Ve[k]=Ve[d]=Ve[h]=Ve[f]=Ve[v]=Ve[g]=Ve[y]=Ve[m]=Ve[b]=Ve[x]=Ve[_]=!1;var Fe={};Fe[u]=Fe[l]=Fe[E]=Fe[k]=Fe[c]=Fe[d]=Fe[C]=Fe[S]=Fe[P]=Fe[T]=Fe[D]=Fe[v]=Fe[g]=Fe[y]=Fe[m]=Fe[b]=Fe[x]=Fe[w]=Fe[B]=Fe["[object Uint8ClampedArray]"]=Fe[M]=Fe[z]=!0,Fe[h]=Fe[f]=Fe[_]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},We=parseFloat,Ye=parseInt,Xe="object"==typeof e&&e&&e.Object===Object&&e,He="object"==typeof self&&self&&self.Object===Object&&self,Ze=Xe||He||Function("return this")(),Ue=t&&!t.nodeType&&t,Ke=Ue&&"object"==typeof r&&r&&!r.nodeType&&r,Ge=Ke&&Ke.exports===Ue,$e=Ge&&Xe.process,Qe=function(){try{var e=Ke&&Ke.require&&Ke.require("util").types;return e||$e&&$e.binding&&$e.binding("util")}catch(e){}}(),Je=Qe&&Qe.isArrayBuffer,et=Qe&&Qe.isDate,tt=Qe&&Qe.isMap,nt=Qe&&Qe.isRegExp,rt=Qe&&Qe.isSet,it=Qe&&Qe.isTypedArray;function at(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)}function ot(e,t,n,r){for(var i=-1,a=null==e?0:e.length;++i-1}function ht(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function It(e,t){for(var n=e.length;n--&&wt(t,e[n],0)>-1;);return n}function At(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Nt=St({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=St({"&":"&","<":"<",">":">",'"':""","'":"'"});function Rt(e){return"\\"+qe[e]}function jt(e){return Ne.test(e)}function Vt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ft(e,t){return function(n){return e(t(n))}}function qt(e,t){for(var n=-1,r=e.length,i=0,a=[];++n",""":'"',"'":"'"});var Ut=function e(t){var n,r=(t=null==t?Ze:Ut.defaults(Ze.Object(),t,Ut.pick(Ze,Re))).Array,i=t.Date,he=t.Error,fe=t.Function,pe=t.Math,ve=t.Object,ge=t.RegExp,ye=t.String,me=t.TypeError,be=r.prototype,xe=fe.prototype,we=ve.prototype,_e=t["__core-js_shared__"],Ee=xe.toString,ke=we.hasOwnProperty,Ce=0,Se=(n=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Pe=we.toString,Te=Ee.call(ve),De=Ze._,Be=ge("^"+Ee.call(ke).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Me=Ge?t.Buffer:void 0,Ie=t.Symbol,Ne=t.Uint8Array,qe=Me?Me.allocUnsafe:void 0,Xe=Ft(ve.getPrototypeOf,ve),He=ve.create,Ue=we.propertyIsEnumerable,Ke=be.splice,$e=Ie?Ie.isConcatSpreadable:void 0,Qe=Ie?Ie.iterator:void 0,mt=Ie?Ie.toStringTag:void 0,St=function(){try{var e=Ji(ve,"defineProperty");return e({},"",{}),e}catch(e){}}(),Kt=t.clearTimeout!==Ze.clearTimeout&&t.clearTimeout,Gt=i&&i.now!==Ze.Date.now&&i.now,$t=t.setTimeout!==Ze.setTimeout&&t.setTimeout,Qt=pe.ceil,Jt=pe.floor,en=ve.getOwnPropertySymbols,tn=Me?Me.isBuffer:void 0,nn=t.isFinite,rn=be.join,an=Ft(ve.keys,ve),on=pe.max,sn=pe.min,un=i.now,ln=t.parseInt,cn=pe.random,dn=be.reverse,hn=Ji(t,"DataView"),fn=Ji(t,"Map"),pn=Ji(t,"Promise"),vn=Ji(t,"Set"),gn=Ji(t,"WeakMap"),yn=Ji(ve,"create"),mn=gn&&new gn,bn={},xn=Sa(hn),wn=Sa(fn),_n=Sa(pn),En=Sa(vn),kn=Sa(gn),Cn=Ie?Ie.prototype:void 0,Sn=Cn?Cn.valueOf:void 0,Pn=Cn?Cn.toString:void 0;function Tn(e){if(Yo(e)&&!Oo(e)&&!(e instanceof zn)){if(e instanceof Mn)return e;if(ke.call(e,"__wrapped__"))return Pa(e)}return new Mn(e)}var Dn=function(){function e(){}return function(t){if(!Wo(t))return{};if(He)return He(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Bn(){}function Mn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function On(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Gn(e,t,n,r,i,a){var o,s=1&t,l=2&t,h=4&t;if(n&&(o=i?n(e,r,i,a):n(e)),void 0!==o)return o;if(!Wo(e))return e;var _=Oo(e);if(_){if(o=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&ke.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return yi(e,o)}else{var O=na(e),I=O==f||O==p;if(Lo(e))return di(e,s);if(O==y||O==u||I&&!i){if(o=l||I?{}:ia(e),!s)return l?function(e,t){return mi(e,ta(e),t)}(e,function(e,t){return e&&mi(t,ws(t),e)}(o,e)):function(e,t){return mi(e,ea(e),t)}(e,Hn(o,e))}else{if(!Fe[O])return i?e:{};o=function(e,t,n){var r=e.constructor;switch(t){case E:return hi(e);case c:case d:return new r(+e);case k:return function(e,t){var n=t?hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case C:case S:case P:case T:case D:case B:case"[object Uint8ClampedArray]":case M:case z:return fi(e,n);case v:return new r;case g:case x:return new r(e);case m:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case w:return i=e,Sn?ve(Sn.call(i)):{}}var i}(e,O,s)}}a||(a=new Ln);var A=a.get(e);if(A)return A;a.set(e,o),Ko(e)?e.forEach((function(r){o.add(Gn(r,t,n,r,e,a))})):Xo(e)&&e.forEach((function(r,i){o.set(i,Gn(r,t,n,i,e,a))}));var N=_?void 0:(h?l?Hi:Xi:l?ws:xs)(e);return st(N||e,(function(r,i){N&&(r=e[i=r]),Wn(o,i,Gn(r,t,n,i,e,a))})),o}function $n(e,t,n){var r=n.length;if(null==e)return!r;for(e=ve(e);r--;){var i=n[r],a=t[i],o=e[i];if(void 0===o&&!(i in e)||!a(o))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new me(a);return ba((function(){e.apply(void 0,n)}),t)}function Jn(e,t,n,r){var i=-1,a=dt,o=!0,s=e.length,u=[],l=t.length;if(!s)return u;n&&(t=ft(t,Bt(n))),r?(a=ht,o=!1):t.length>=200&&(a=zt,o=!1,t=new Nn(t));e:for(;++i-1},In.prototype.set=function(e,t){var n=this.__data__,r=Yn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},An.prototype.clear=function(){this.size=0,this.__data__={hash:new On,map:new(fn||In),string:new On}},An.prototype.delete=function(e){var t=$i(this,e).delete(e);return this.size-=t?1:0,t},An.prototype.get=function(e){return $i(this,e).get(e)},An.prototype.has=function(e){return $i(this,e).has(e)},An.prototype.set=function(e,t){var n=$i(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Nn.prototype.add=Nn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new In,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof In){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new An(r)}return n.set(e,t),this.size=n.size,this};var er=wi(ur),tr=wi(lr,!0);function nr(e,t){var n=!0;return er(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function rr(e,t,n){for(var r=-1,i=e.length;++r0&&n(s)?t>1?ar(s,t-1,n,r,i):pt(i,s):r||(i[i.length]=s)}return i}var or=_i(),sr=_i(!0);function ur(e,t){return e&&or(e,t,xs)}function lr(e,t){return e&&sr(e,t,xs)}function cr(e,t){return ct(t,(function(t){return Vo(e[t])}))}function dr(e,t){for(var n=0,r=(t=si(t,e)).length;null!=e&&nt}function vr(e,t){return null!=e&&ke.call(e,t)}function gr(e,t){return null!=e&&t in ve(e)}function yr(e,t,n){for(var i=n?ht:dt,a=e[0].length,o=e.length,s=o,u=r(o),l=1/0,c=[];s--;){var d=e[s];s&&t&&(d=ft(d,Bt(t))),l=sn(d.length,l),u[s]=!n&&(t||a>=120&&d.length>=120)?new Nn(s&&d):void 0}d=e[0];var h=-1,f=u[0];e:for(;++h=s)return u;var l=n[r];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function Or(e,t,n){for(var r=-1,i=t.length,a={};++r-1;)s!==e&&Ke.call(s,u,1),Ke.call(e,u,1);return e}function Ar(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;oa(i)?Ke.call(e,i,1):Jr(e,i)}}return e}function Nr(e,t){return e+Jt(cn()*(t-e+1))}function Lr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=Jt(t/2))&&(e+=e)}while(t);return n}function Rr(e,t){return xa(pa(e,t,Hs),e+"")}function jr(e){return jn(Ds(e))}function Vr(e,t){var n=Ds(e);return Ea(n,Kn(t,0,n.length))}function Fr(e,t,n,r){if(!Wo(e))return e;for(var i=-1,a=(t=si(t,e)).length,o=a-1,s=e;null!=s&&++ia?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=r(a);++i>>1,o=e[a];null!==o&&!$o(o)&&(n?o<=t:o=200){var l=t?null:Li(e);if(l)return Wt(l);o=!1,i=zt,u=new Nn}else u=t?[]:s;e:for(;++r=r?e:Xr(e,t,n)}var ci=Kt||function(e){return Ze.clearTimeout(e)};function di(e,t){if(t)return e.slice();var n=e.length,r=qe?qe(n):new e.constructor(n);return e.copy(r),r}function hi(e){var t=new e.constructor(e.byteLength);return new Ne(t).set(new Ne(e)),t}function fi(e,t){var n=t?hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function pi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,a=$o(e),o=void 0!==t,s=null===t,u=t==t,l=$o(t);if(!s&&!l&&!a&&e>t||a&&o&&u&&!s&&!l||r&&o&&u||!n&&u||!i)return 1;if(!r&&!a&&!l&&e1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(i--,a):void 0,o&&sa(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=ve(t);++r-1?i[a?t[o]:o]:void 0}}function Pi(e){return Yi((function(t){var n=t.length,r=n,i=Mn.prototype.thru;for(e&&t.reverse();r--;){var o=t[r];if("function"!=typeof o)throw new me(a);if(i&&!s&&"wrapper"==Ui(o))var s=new Mn([],!0)}for(r=s?r:n;++r1&&b.reverse(),d&&ls))return!1;var l=a.get(e),c=a.get(t);if(l&&c)return l==t&&c==e;var d=-1,h=!0,f=2&n?new Nn:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace($,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return st(s,(function(n){var r="_."+n[0];t&n[1]&&!dt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(Q);return t?t[1].split(J):[]}(r),n)))}function _a(e){var t=0,n=0;return function(){var r=un(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ea(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Za(e,n)}));function eo(e){var t=Tn(e);return t.__chain__=!0,t}function to(e,t){return t(e)}var no=Yi((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Un(t,e)};return!(t>1||this.__actions__.length)&&r instanceof zn&&oa(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:to,args:[i],thisArg:void 0}),new Mn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var ro=bi((function(e,t,n){ke.call(e,n)?++e[n]:Zn(e,n,1)}));var io=Si(Ma),ao=Si(za);function oo(e,t){return(Oo(e)?st:er)(e,Gi(t,3))}function so(e,t){return(Oo(e)?ut:tr)(e,Gi(t,3))}var uo=bi((function(e,t,n){ke.call(e,n)?e[n].push(t):Zn(e,n,[t])}));var lo=Rr((function(e,t,n){var i=-1,a="function"==typeof t,o=Ao(e)?r(e.length):[];return er(e,(function(e){o[++i]=a?at(t,e,n):mr(e,t,n)})),o})),co=bi((function(e,t,n){Zn(e,n,t)}));function ho(e,t){return(Oo(e)?ft:Pr)(e,Gi(t,3))}var fo=bi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var po=Rr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&sa(e,t[0],t[1])?t=[]:n>2&&sa(t[0],t[1],t[2])&&(t=[t[0]]),zr(e,ar(t,1),[])})),vo=Gt||function(){return Ze.Date.now()};function go(e,t,n){return t=n?void 0:t,ji(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function yo(e,t){var n;if("function"!=typeof t)throw new me(a);return e=rs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var mo=Rr((function(e,t,n){var r=1;if(n.length){var i=qt(n,Ki(mo));r|=32}return ji(e,r,t,n,i)})),bo=Rr((function(e,t,n){var r=3;if(n.length){var i=qt(n,Ki(bo));r|=32}return ji(t,r,e,n,i)}));function xo(e,t,n){var r,i,o,s,u,l,c=0,d=!1,h=!1,f=!0;if("function"!=typeof e)throw new me(a);function p(t){var n=r,a=i;return r=i=void 0,c=t,s=e.apply(a,n)}function v(e){return c=e,u=ba(y,t),d?p(e):s}function g(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function y(){var e=vo();if(g(e))return m(e);u=ba(y,function(e){var n=t-(e-l);return h?sn(n,o-(e-c)):n}(e))}function m(e){return u=void 0,f&&r?p(e):(r=i=void 0,s)}function b(){var e=vo(),n=g(e);if(r=arguments,i=this,l=e,n){if(void 0===u)return v(l);if(h)return ci(u),u=ba(y,t),p(l)}return void 0===u&&(u=ba(y,t)),s}return t=as(t)||0,Wo(n)&&(d=!!n.leading,o=(h="maxWait"in n)?on(as(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),b.cancel=function(){void 0!==u&&ci(u),c=0,r=l=i=u=void 0},b.flush=function(){return void 0===u?s:m(vo())},b}var wo=Rr((function(e,t){return Qn(e,1,t)})),_o=Rr((function(e,t,n){return Qn(e,as(t)||0,n)}));function Eo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new me(a);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Eo.Cache||An),n}function ko(e){if("function"!=typeof e)throw new me(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Eo.Cache=An;var Co=ui((function(e,t){var n=(t=1==t.length&&Oo(t[0])?ft(t[0],Bt(Gi())):ft(ar(t,1),Bt(Gi()))).length;return Rr((function(r){for(var i=-1,a=sn(r.length,n);++i=t})),zo=br(function(){return arguments}())?br:function(e){return Yo(e)&&ke.call(e,"callee")&&!Ue.call(e,"callee")},Oo=r.isArray,Io=Je?Bt(Je):function(e){return Yo(e)&&fr(e)==E};function Ao(e){return null!=e&&qo(e.length)&&!Vo(e)}function No(e){return Yo(e)&&Ao(e)}var Lo=tn||au,Ro=et?Bt(et):function(e){return Yo(e)&&fr(e)==d};function jo(e){if(!Yo(e))return!1;var t=fr(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Zo(e)}function Vo(e){if(!Wo(e))return!1;var t=fr(e);return t==f||t==p||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Fo(e){return"number"==typeof e&&e==rs(e)}function qo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Wo(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Yo(e){return null!=e&&"object"==typeof e}var Xo=tt?Bt(tt):function(e){return Yo(e)&&na(e)==v};function Ho(e){return"number"==typeof e||Yo(e)&&fr(e)==g}function Zo(e){if(!Yo(e)||fr(e)!=y)return!1;var t=Xe(e);if(null===t)return!0;var n=ke.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Ee.call(n)==Te}var Uo=nt?Bt(nt):function(e){return Yo(e)&&fr(e)==m};var Ko=rt?Bt(rt):function(e){return Yo(e)&&na(e)==b};function Go(e){return"string"==typeof e||!Oo(e)&&Yo(e)&&fr(e)==x}function $o(e){return"symbol"==typeof e||Yo(e)&&fr(e)==w}var Qo=it?Bt(it):function(e){return Yo(e)&&qo(e.length)&&!!Ve[fr(e)]};var Jo=Ii(Sr),es=Ii((function(e,t){return e<=t}));function ts(e){if(!e)return[];if(Ao(e))return Go(e)?Ht(e):yi(e);if(Qe&&e[Qe])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Qe]());var t=na(e);return(t==v?Vt:t==b?Wt:Ds)(e)}function ns(e){return e?(e=as(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function rs(e){var t=ns(e),n=t%1;return t==t?n?t-n:t:0}function is(e){return e?Kn(rs(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if($o(e))return NaN;if(Wo(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Wo(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(U,"");var n=ae.test(e);return n||se.test(e)?Ye(e.slice(2),n?2:8):ie.test(e)?NaN:+e}function os(e){return mi(e,ws(e))}function ss(e){return null==e?"":$r(e)}var us=xi((function(e,t){if(da(t)||Ao(t))mi(t,xs(t),e);else for(var n in t)ke.call(t,n)&&Wn(e,n,t[n])})),ls=xi((function(e,t){mi(t,ws(t),e)})),cs=xi((function(e,t,n,r){mi(t,ws(t),e,r)})),ds=xi((function(e,t,n,r){mi(t,xs(t),e,r)})),hs=Yi(Un);var fs=Rr((function(e,t){e=ve(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&sa(t[0],t[1],i)&&(r=1);++n1),t})),mi(e,Hi(e),n),r&&(n=Gn(n,7,qi));for(var i=t.length;i--;)Jr(n,t[i]);return n}));var Cs=Yi((function(e,t){return null==e?{}:function(e,t){return Or(e,t,(function(t,n){return gs(e,n)}))}(e,t)}));function Ss(e,t){if(null==e)return{};var n=ft(Hi(e),(function(e){return[e]}));return t=Gi(t),Or(e,n,(function(e,n){return t(e,n[0])}))}var Ps=Ri(xs),Ts=Ri(ws);function Ds(e){return null==e?[]:Mt(e,xs(e))}var Bs=ki((function(e,t,n){return t=t.toLowerCase(),e+(n?Ms(t):t)}));function Ms(e){return js(ss(e).toLowerCase())}function zs(e){return(e=ss(e))&&e.replace(le,Nt).replace(Oe,"")}var Os=ki((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Is=ki((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),As=Ei("toLowerCase");var Ns=ki((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ls=ki((function(e,t,n){return e+(n?" ":"")+js(t)}));var Rs=ki((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),js=Ei("toUpperCase");function Vs(e,t,n){return e=ss(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Ae)||[]}(e):function(e){return e.match(ee)||[]}(e):e.match(t)||[]}var Fs=Rr((function(e,t){try{return at(e,void 0,t)}catch(e){return jo(e)?e:new he(e)}})),qs=Yi((function(e,t){return st(t,(function(t){t=Ca(t),Zn(e,t,mo(e[t],e))})),e}));function Ws(e){return function(){return e}}var Ys=Pi(),Xs=Pi(!0);function Hs(e){return e}function Zs(e){return Er("function"==typeof e?e:Gn(e,1))}var Us=Rr((function(e,t){return function(n){return mr(n,e,t)}})),Ks=Rr((function(e,t){return function(n){return mr(e,n,t)}}));function Gs(e,t,n){var r=xs(t),i=cr(t,r);null!=n||Wo(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=cr(t,xs(t)));var a=!(Wo(n)&&"chain"in n&&!n.chain),o=Vo(e);return st(i,(function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,pt([this.value()],arguments))})})),e}function $s(){}var Qs=Mi(ft),Js=Mi(lt),eu=Mi(yt);function tu(e){return ua(e)?Ct(Ca(e)):function(e){return function(t){return dr(t,e)}}(e)}var nu=Oi(),ru=Oi(!0);function iu(){return[]}function au(){return!1}var ou=Bi((function(e,t){return e+t}),0),su=Ni("ceil"),uu=Bi((function(e,t){return e/t}),1),lu=Ni("floor");var cu,du=Bi((function(e,t){return e*t}),1),hu=Ni("round"),fu=Bi((function(e,t){return e-t}),0);return Tn.after=function(e,t){if("function"!=typeof t)throw new me(a);return e=rs(e),function(){if(--e<1)return t.apply(this,arguments)}},Tn.ary=go,Tn.assign=us,Tn.assignIn=ls,Tn.assignInWith=cs,Tn.assignWith=ds,Tn.at=hs,Tn.before=yo,Tn.bind=mo,Tn.bindAll=qs,Tn.bindKey=bo,Tn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Oo(e)?e:[e]},Tn.chain=eo,Tn.chunk=function(e,t,n){t=(n?sa(e,t,n):void 0===t)?1:on(rs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=r(Qt(i/t));ai?0:i+n),(r=void 0===r||r>i?i:rs(r))<0&&(r+=i),r=n>r?0:is(r);n>>0)?(e=ss(e))&&("string"==typeof t||null!=t&&!Uo(t))&&!(t=$r(t))&&jt(e)?li(Ht(e),0,n):e.split(t,n):[]},Tn.spread=function(e,t){if("function"!=typeof e)throw new me(a);return t=null==t?0:on(rs(t),0),Rr((function(n){var r=n[t],i=li(n,0,t);return r&&pt(i,r),at(e,this,i)}))},Tn.tail=function(e){var t=null==e?0:e.length;return t?Xr(e,1,t):[]},Tn.take=function(e,t,n){return e&&e.length?Xr(e,0,(t=n||void 0===t?1:rs(t))<0?0:t):[]},Tn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?Xr(e,(t=r-(t=n||void 0===t?1:rs(t)))<0?0:t,r):[]},Tn.takeRightWhile=function(e,t){return e&&e.length?ti(e,Gi(t,3),!1,!0):[]},Tn.takeWhile=function(e,t){return e&&e.length?ti(e,Gi(t,3)):[]},Tn.tap=function(e,t){return t(e),e},Tn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new me(a);return Wo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xo(e,t,{leading:r,maxWait:t,trailing:i})},Tn.thru=to,Tn.toArray=ts,Tn.toPairs=Ps,Tn.toPairsIn=Ts,Tn.toPath=function(e){return Oo(e)?ft(e,Ca):$o(e)?[e]:yi(ka(ss(e)))},Tn.toPlainObject=os,Tn.transform=function(e,t,n){var r=Oo(e),i=r||Lo(e)||Qo(e);if(t=Gi(t,4),null==n){var a=e&&e.constructor;n=i?r?new a:[]:Wo(e)&&Vo(a)?Dn(Xe(e)):{}}return(i?st:ur)(e,(function(e,r,i){return t(n,e,r,i)})),n},Tn.unary=function(e){return go(e,1)},Tn.union=Wa,Tn.unionBy=Ya,Tn.unionWith=Xa,Tn.uniq=function(e){return e&&e.length?Qr(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?Qr(e,Gi(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||Jr(e,t)},Tn.unzip=Ha,Tn.unzipWith=Za,Tn.update=function(e,t,n){return null==e?e:ei(e,t,oi(n))},Tn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ei(e,t,oi(n),r)},Tn.values=Ds,Tn.valuesIn=function(e){return null==e?[]:Mt(e,ws(e))},Tn.without=Ua,Tn.words=Vs,Tn.wrap=function(e,t){return So(oi(t),e)},Tn.xor=Ka,Tn.xorBy=Ga,Tn.xorWith=$a,Tn.zip=Qa,Tn.zipObject=function(e,t){return ii(e||[],t||[],Wn)},Tn.zipObjectDeep=function(e,t){return ii(e||[],t||[],Fr)},Tn.zipWith=Ja,Tn.entries=Ps,Tn.entriesIn=Ts,Tn.extend=ls,Tn.extendWith=cs,Gs(Tn,Tn),Tn.add=ou,Tn.attempt=Fs,Tn.camelCase=Bs,Tn.capitalize=Ms,Tn.ceil=su,Tn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=as(n))==n?n:0),void 0!==t&&(t=(t=as(t))==t?t:0),Kn(as(e),t,n)},Tn.clone=function(e){return Gn(e,4)},Tn.cloneDeep=function(e){return Gn(e,5)},Tn.cloneDeepWith=function(e,t){return Gn(e,5,t="function"==typeof t?t:void 0)},Tn.cloneWith=function(e,t){return Gn(e,4,t="function"==typeof t?t:void 0)},Tn.conformsTo=function(e,t){return null==t||$n(e,t,xs(t))},Tn.deburr=zs,Tn.defaultTo=function(e,t){return null==e||e!=e?t:e},Tn.divide=uu,Tn.endsWith=function(e,t,n){e=ss(e),t=$r(t);var r=e.length,i=n=void 0===n?r:Kn(rs(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Tn.eq=Do,Tn.escape=function(e){return(e=ss(e))&&j.test(e)?e.replace(L,Lt):e},Tn.escapeRegExp=function(e){return(e=ss(e))&&Z.test(e)?e.replace(H,"\\$&"):e},Tn.every=function(e,t,n){var r=Oo(e)?lt:nr;return n&&sa(e,t,n)&&(t=void 0),r(e,Gi(t,3))},Tn.find=io,Tn.findIndex=Ma,Tn.findKey=function(e,t){return bt(e,Gi(t,3),ur)},Tn.findLast=ao,Tn.findLastIndex=za,Tn.findLastKey=function(e,t){return bt(e,Gi(t,3),lr)},Tn.floor=lu,Tn.forEach=oo,Tn.forEachRight=so,Tn.forIn=function(e,t){return null==e?e:or(e,Gi(t,3),ws)},Tn.forInRight=function(e,t){return null==e?e:sr(e,Gi(t,3),ws)},Tn.forOwn=function(e,t){return e&&ur(e,Gi(t,3))},Tn.forOwnRight=function(e,t){return e&&lr(e,Gi(t,3))},Tn.get=vs,Tn.gt=Bo,Tn.gte=Mo,Tn.has=function(e,t){return null!=e&&ra(e,t,vr)},Tn.hasIn=gs,Tn.head=Ia,Tn.identity=Hs,Tn.includes=function(e,t,n,r){e=Ao(e)?e:Ds(e),n=n&&!r?rs(n):0;var i=e.length;return n<0&&(n=on(i+n,0)),Go(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&wt(e,t,n)>-1},Tn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:rs(n);return i<0&&(i=on(r+i,0)),wt(e,t,i)},Tn.inRange=function(e,t,n){return t=ns(t),void 0===n?(n=t,t=0):n=ns(n),function(e,t,n){return e>=sn(t,n)&&e=-9007199254740991&&e<=9007199254740991},Tn.isSet=Ko,Tn.isString=Go,Tn.isSymbol=$o,Tn.isTypedArray=Qo,Tn.isUndefined=function(e){return void 0===e},Tn.isWeakMap=function(e){return Yo(e)&&na(e)==_},Tn.isWeakSet=function(e){return Yo(e)&&"[object WeakSet]"==fr(e)},Tn.join=function(e,t){return null==e?"":rn.call(e,t)},Tn.kebabCase=Os,Tn.last=Ra,Tn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=rs(n))<0?on(r+i,0):sn(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):xt(e,Et,i,!0)},Tn.lowerCase=Is,Tn.lowerFirst=As,Tn.lt=Jo,Tn.lte=es,Tn.max=function(e){return e&&e.length?rr(e,Hs,pr):void 0},Tn.maxBy=function(e,t){return e&&e.length?rr(e,Gi(t,2),pr):void 0},Tn.mean=function(e){return kt(e,Hs)},Tn.meanBy=function(e,t){return kt(e,Gi(t,2))},Tn.min=function(e){return e&&e.length?rr(e,Hs,Sr):void 0},Tn.minBy=function(e,t){return e&&e.length?rr(e,Gi(t,2),Sr):void 0},Tn.stubArray=iu,Tn.stubFalse=au,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=du,Tn.nth=function(e,t){return e&&e.length?Mr(e,rs(t)):void 0},Tn.noConflict=function(){return Ze._===this&&(Ze._=De),this},Tn.noop=$s,Tn.now=vo,Tn.pad=function(e,t,n){e=ss(e);var r=(t=rs(t))?Xt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return zi(Jt(i),n)+e+zi(Qt(i),n)},Tn.padEnd=function(e,t,n){e=ss(e);var r=(t=rs(t))?Xt(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=cn();return sn(e+i*(t-e+We("1e-"+((i+"").length-1))),t)}return Nr(e,t)},Tn.reduce=function(e,t,n){var r=Oo(e)?vt:Pt,i=arguments.length<3;return r(e,Gi(t,4),n,i,er)},Tn.reduceRight=function(e,t,n){var r=Oo(e)?gt:Pt,i=arguments.length<3;return r(e,Gi(t,4),n,i,tr)},Tn.repeat=function(e,t,n){return t=(n?sa(e,t,n):void 0===t)?1:rs(t),Lr(ss(e),t)},Tn.replace=function(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tn.result=function(e,t,n){var r=-1,i=(t=si(t,e)).length;for(i||(i=1,e=void 0);++r9007199254740991)return[];var n=4294967295,r=sn(e,4294967295);e-=4294967295;for(var i=Dt(r,t=Gi(t));++n=a)return e;var s=n-Xt(r);if(s<1)return r;var u=o?li(o,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(o&&(s+=u.length-s),Uo(i)){if(e.slice(s).search(i)){var l,c=u;for(i.global||(i=ge(i.source,ss(re.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var d=l.index;u=u.slice(0,void 0===d?s:d)}}else if(e.indexOf($r(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+r},Tn.unescape=function(e){return(e=ss(e))&&R.test(e)?e.replace(N,Zt):e},Tn.uniqueId=function(e){var t=++Ce;return ss(e)+t},Tn.upperCase=Rs,Tn.upperFirst=js,Tn.each=oo,Tn.eachRight=so,Tn.first=Ia,Gs(Tn,(cu={},ur(Tn,(function(e,t){ke.call(Tn.prototype,t)||(cu[t]=e)})),cu),{chain:!1}),Tn.VERSION="4.17.19",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Tn[e].placeholder=Tn})),st(["drop","take"],(function(e,t){zn.prototype[e]=function(n){n=void 0===n?1:on(rs(n),0);var r=this.__filtered__&&!t?new zn(this):this.clone();return r.__filtered__?r.__takeCount__=sn(n,r.__takeCount__):r.__views__.push({size:sn(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Gi(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}})),zn.prototype.compact=function(){return this.filter(Hs)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=Rr((function(e,t){return"function"==typeof e?new zn(this):this.map((function(n){return mr(n,e,t)}))})),zn.prototype.reject=function(e){return this.filter(ko(Gi(e)))},zn.prototype.slice=function(e,t){e=rs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new zn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=rs(t))<0?n.dropRight(-t):n.take(t-e)),n)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(4294967295)},ur(zn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Tn[r?"take"+("last"==t?"Right":""):t],a=r||/^find/.test(t);i&&(Tn.prototype[t]=function(){var t=this.__wrapped__,o=r?[1]:arguments,s=t instanceof zn,u=o[0],l=s||Oo(t),c=function(e){var t=i.apply(Tn,pt([e],o));return r&&d?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var d=this.__chain__,h=!!this.__actions__.length,f=a&&!d,p=s&&!h;if(!a&&l){t=p?t:new zn(this);var v=e.apply(t,o);return v.__actions__.push({func:to,args:[c],thisArg:void 0}),new Mn(v,d)}return f&&p?e.apply(this,o):(v=this.thru(c),f?r?v.value()[0]:v.value():v)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Tn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Oo(i)?i:[],e)}return this[n]((function(n){return t.apply(Oo(n)?n:[],e)}))}})),ur(zn.prototype,(function(e,t){var n=Tn[t];if(n){var r=n.name+"";ke.call(bn,r)||(bn[r]=[]),bn[r].push({name:t,func:n})}})),bn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=yi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yi(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Oo(e),r=t<0,i=n?e.length:0,a=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var t,n=this;n instanceof Bn;){var r=Pa(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:to,args:[qa],thisArg:void 0}),new Mn(t,this.__chain__)}return this.thru(qa)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ni(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,Qe&&(Tn.prototype[Qe]=function(){return this}),Tn}();Ze._=Ut,void 0===(i=function(){return Ut}.call(t,n,t,r))||(r.exports=i)}).call(this)}).call(this,n(0),n(17)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:!this.shouldResize,t=this.cy;e!==this.shouldResize&&(e?(t.on("render",this.updateViewport),t.on("resize",this.resize),this.updateViewport(t)):(t.removeListener("render",this.updateViewport),t.removeListener("resize",this.resize)),this.shouldResize=e)}},{key:"getViewport",value:function(){var e=this.cy;return{position:e.pan(),zoom:e.zoom(),renderedBB:Object.assign({},e.elements().renderedBoundingBox()),height:e.height(),width:e.width()}}},{key:"updateViewport",value:function(){var e=this.cy;this.prev=this.getViewport(e)}},{key:"_xConstrainedZoom",value:function(e){var t=this.curr,n=this.prev,r=this.marginPercentage.left*t.width;t.position.x=r+(n.position.x-n.renderedBB.x1);var i=t.renderedBB.y1+t.renderedBB.h/2-t.renderedBB.h/n.zoom*e/2;i+=(t.height-n.height)/2,t.position.y=i+(n.position.y-n.renderedBB.y1)}},{key:"_xChangeMargin",value:function(e){var t=this.curr,n=this.prev,r=n.renderedBB.x1+n.renderedBB.w/2,i=r/n.width*e;t.position.x=t.position.x+(i-r)}},{key:"_yConstrainedZoom",value:function(e){var t=this.curr,n=this.prev,r=this.marginPercentage.top*t.height;t.position.y=r+(n.position.y-n.renderedBB.y1);var i=t.renderedBB.x1+t.renderedBB.w/2-t.renderedBB.w/n.zoom*e/2;i+=(t.width-n.width)/2,t.position.x=i+(n.position.x-n.renderedBB.x1)}},{key:"_yChangeMargin",value:function(){var e=this.curr,t=this.prev,n=t.renderedBB.y1+t.renderedBB.h/2,r=n/t.height*e.height;e.position.y=e.position.y+(r-n)}},{key:"resize",value:function(){var e=this.cy;this.curr=this.getViewport(e);var t=this.curr,n=this.prev,r=n.renderedBB.x1>=0&&n.renderedBB.y1>=0&&n.renderedBB.x2<=n.width&&n.renderedBB.y2<=n.height;if(this.marginPercentage={left:n.renderedBB.x1/n.width,top:n.renderedBB.y1/n.height},Math.abs(1-t.width/n.width)>Math.abs(1-t.height/n.height)){var i=n.zoom/n.width*t.width;if(r)for(var a=Math.min((t.renderedBB.y1+t.renderedBB.h/2)*n.zoom*2/t.renderedBB.h,-(t.renderedBB.y1+t.renderedBB.h/2-n.height)*n.zoom*2/t.renderedBB.h)-this.containedZoomMargin,o=n.width/n.zoom*a,s=t.zoom