@nrwl/workspace 12.10.0 → 13.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +2 -3
  3. package/index.js.map +1 -1
  4. package/migrations.json +6 -0
  5. package/package.json +5 -5
  6. package/src/command-line/dep-graph.js +17 -21
  7. package/src/command-line/dep-graph.js.map +1 -1
  8. package/src/command-line/examples.js +38 -38
  9. package/src/command-line/examples.js.map +1 -1
  10. package/src/command-line/lint.js +5 -4
  11. package/src/command-line/lint.js.map +1 -1
  12. package/src/command-line/nx-commands.js +26 -3
  13. package/src/command-line/nx-commands.js.map +1 -1
  14. package/src/command-line/supported-nx-commands.js +1 -0
  15. package/src/command-line/supported-nx-commands.js.map +1 -1
  16. package/src/command-line/utils.js +1 -1
  17. package/src/command-line/utils.js.map +1 -1
  18. package/src/core/dep-graph/main.es5.js +1 -1
  19. package/src/core/dep-graph/main.esm.js +1 -1
  20. package/src/core/dep-graph/polyfills.es5.js +1 -1
  21. package/src/core/dep-graph/polyfills.esm.js +1 -1
  22. package/src/core/dep-graph/runtime.es5.js +1 -1
  23. package/src/core/dep-graph/runtime.esm.js +1 -1
  24. package/src/core/file-utils.d.ts +11 -4
  25. package/src/core/file-utils.js +103 -15
  26. package/src/core/file-utils.js.map +1 -1
  27. package/src/core/hasher/file-hasher.d.ts +1 -16
  28. package/src/core/hasher/file-hasher.js +4 -20
  29. package/src/core/hasher/file-hasher.js.map +1 -1
  30. package/src/core/nx-deps/nx-deps-cache.d.ts +6 -6
  31. package/src/core/nx-deps/nx-deps-cache.js +9 -5
  32. package/src/core/nx-deps/nx-deps-cache.js.map +1 -1
  33. package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.d.ts +2 -0
  34. package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.js +12 -0
  35. package/src/core/project-graph/build-dependencies/build-explicit-typescript-and-package-json-dependencies.js.map +1 -0
  36. package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.d.ts +3 -2
  37. package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.js +14 -8
  38. package/src/core/project-graph/build-dependencies/explicit-package-json-dependencies.js.map +1 -1
  39. package/src/core/project-graph/build-dependencies/explicit-project-dependencies.d.ts +3 -2
  40. package/src/core/project-graph/build-dependencies/explicit-project-dependencies.js +12 -6
  41. package/src/core/project-graph/build-dependencies/explicit-project-dependencies.js.map +1 -1
  42. package/src/core/project-graph/build-project-graph.d.ts +7 -0
  43. package/src/core/project-graph/build-project-graph.js +221 -0
  44. package/src/core/project-graph/build-project-graph.js.map +1 -0
  45. package/src/core/project-graph/daemon/cache.d.ts +5 -13
  46. package/src/core/project-graph/daemon/cache.js +39 -16
  47. package/src/core/project-graph/daemon/cache.js.map +1 -1
  48. package/src/core/project-graph/daemon/client/client.js +31 -57
  49. package/src/core/project-graph/daemon/client/client.js.map +1 -1
  50. package/src/core/project-graph/daemon/client/exec-is-server-available.d.ts +1 -0
  51. package/src/core/project-graph/daemon/client/exec-is-server-available.js +13 -0
  52. package/src/core/project-graph/daemon/client/exec-is-server-available.js.map +1 -0
  53. package/src/core/project-graph/daemon/client/generate-help-output.d.ts +1 -0
  54. package/src/core/project-graph/daemon/client/generate-help-output.js +28 -0
  55. package/src/core/project-graph/daemon/client/generate-help-output.js.map +1 -0
  56. package/src/core/project-graph/daemon/server/logger.d.ts +19 -0
  57. package/src/core/project-graph/daemon/server/logger.js +41 -0
  58. package/src/core/project-graph/daemon/server/logger.js.map +1 -0
  59. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.d.ts +6 -0
  60. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js +119 -0
  61. package/src/core/project-graph/daemon/server/project-graph-incremental-recomputation.js.map +1 -0
  62. package/src/core/project-graph/daemon/server/server.d.ts +1 -5
  63. package/src/core/project-graph/daemon/server/server.js +97 -184
  64. package/src/core/project-graph/daemon/server/server.js.map +1 -1
  65. package/src/core/project-graph/daemon/server/shutdown-utils.d.ts +13 -0
  66. package/src/core/project-graph/daemon/server/shutdown-utils.js +28 -0
  67. package/src/core/project-graph/daemon/server/shutdown-utils.js.map +1 -0
  68. package/src/core/project-graph/daemon/server/start.js +1 -8
  69. package/src/core/project-graph/daemon/server/start.js.map +1 -1
  70. package/src/core/project-graph/daemon/server/stop.js +1 -11
  71. package/src/core/project-graph/daemon/server/stop.js.map +1 -1
  72. package/src/core/project-graph/daemon/server/watcher.d.ts +1 -1
  73. package/src/core/project-graph/daemon/server/watcher.js +1 -1
  74. package/src/core/project-graph/daemon/socket-utils.d.ts +13 -0
  75. package/src/core/project-graph/daemon/socket-utils.js +39 -10
  76. package/src/core/project-graph/daemon/socket-utils.js.map +1 -1
  77. package/src/core/project-graph/daemon/tmp-dir.d.ts +7 -0
  78. package/src/core/project-graph/daemon/tmp-dir.js +59 -0
  79. package/src/core/project-graph/daemon/tmp-dir.js.map +1 -0
  80. package/src/core/project-graph/index.d.ts +1 -1
  81. package/src/core/project-graph/index.js +1 -3
  82. package/src/core/project-graph/index.js.map +1 -1
  83. package/src/core/project-graph/project-graph-worker.d.ts +1 -0
  84. package/src/core/project-graph/project-graph-worker.js +17 -0
  85. package/src/core/project-graph/project-graph-worker.js.map +1 -0
  86. package/src/core/project-graph/project-graph.d.ts +1 -30
  87. package/src/core/project-graph/project-graph.js +5 -195
  88. package/src/core/project-graph/project-graph.js.map +1 -1
  89. package/src/generators/init/init.js +27 -27
  90. package/src/generators/init/init.js.map +1 -1
  91. package/src/generators/new/new.js +1 -1
  92. package/src/generators/new/new.js.map +1 -1
  93. package/src/migrations/update-10-0-0/update-10-0-0.js +1 -1
  94. package/src/migrations/update-10-0-0/update-10-0-0.js.map +1 -1
  95. package/src/migrations/update-13-0-0/set-default-base-if-not-set.d.ts +3 -0
  96. package/src/migrations/update-13-0-0/set-default-base-if-not-set.js +30 -0
  97. package/src/migrations/update-13-0-0/set-default-base-if-not-set.js.map +1 -0
  98. package/src/utilities/default-base.js +2 -2
  99. package/src/utilities/default-base.js.map +1 -1
  100. package/src/utilities/run-webpack.d.ts +3 -2
  101. package/src/utilities/run-webpack.js +18 -34
  102. package/src/utilities/run-webpack.js.map +1 -1
  103. package/src/utils/ast-utils.d.ts +1 -10
  104. package/src/utils/ast-utils.js +1 -19
  105. package/src/utils/ast-utils.js.map +1 -1
  106. package/src/utils/testing-utils.js +1 -1
  107. package/src/utils/testing-utils.js.map +1 -1
  108. package/src/utils/versions.js +1 -1
  109. package/src/core/file-graph/index.d.ts +0 -1
  110. package/src/core/file-graph/index.js +0 -5
  111. package/src/core/file-graph/index.js.map +0 -1
  112. package/src/core/file-graph/project-file-map.d.ts +0 -3
  113. package/src/core/file-graph/project-file-map.js +0 -35
  114. package/src/core/file-graph/project-file-map.js.map +0 -1
  115. package/src/utilities/create-project-graph-from-tree.d.ts +0 -5
  116. package/src/utilities/create-project-graph-from-tree.js +0 -13
  117. package/src/utilities/create-project-graph-from-tree.js.map +0 -1
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see main.esm.js.LICENSE.txt */
2
- (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{"+3xT":function(e,t,n){var r=n("Hczf"),i=n("ceoc"),o=n("AdjD");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},"+Gly":function(e,t,n){var r=n("20jF");e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},"+n8R":function(e,t){e.exports=function(){return[]}},"+qHO":function(e,t,n){var r=n("2Pt6"),i=n("Ls/e");e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};return r.forEach(e.children(),(function(n){!function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}(n,1)})),t}(e),o=r.max(r.values(n))-1,a=2*o+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=a}));var s=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(u){!function e(t,n,o,a,s,u,c){var l=t.children(c);if(l.length){var d=i.addBorderNode(t,"_bt"),h=i.addBorderNode(t,"_bb"),f=t.node(c);t.setParent(d,c),f.borderTop=d,t.setParent(h,c),f.borderBottom=h,r.forEach(l,(function(r){e(t,n,o,a,s,u,r);var i=t.node(r),l=i.borderTop?i.borderTop:r,f=i.borderBottom?i.borderBottom:r,p=i.borderTop?a:2*a,v=l!==f?1:s-u[c]+1;t.setEdge(d,l,{weight:p,minlen:v,nestingEdge:!0}),t.setEdge(f,h,{weight:p,minlen:v,nestingEdge:!0})})),t.parent(c)||t.setEdge(n,d,{weight:0,minlen:s+u[c]})}else c!==n&&t.setEdge(n,c,{weight:0,minlen:o})}(e,t,a,s,o,n,u)})),e.graph().nodeRankFactor=a},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},"+y+b":function(e,t,n){var r;try{r=n("WlgI")}catch(i){}r||(r=window.graphlib),e.exports=r},"/Ktv":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n("0M5s"),i=n("hcIE"),o=n("UbiW"),a=n("PX5Y");function s(e){return["table","td","th"].indexOf(Object(i.a)(e))>=0}var u=n("Hwp0");function c(e){return Object(a.b)(e)&&"fixed"!==Object(o.a)(e).position?e.offsetParent:null}function l(e){for(var t=Object(r.a)(e),n=c(e);n&&s(n)&&"static"===Object(o.a)(n).position;)n=c(n);return n&&("html"===Object(i.a)(n)||"body"===Object(i.a)(n)&&"static"===Object(o.a)(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&Object(a.b)(e)&&"fixed"===Object(o.a)(e).position)return null;for(var n=Object(u.a)(e);Object(a.b)(n)&&["html","body"].indexOf(Object(i.a)(n))<0;){var r=Object(o.a)(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}},"/NDV":function(e,t,n){var r=n("nb5l"),i=n("wMi0"),o=n("20jF");e.exports=function(e){return o(e)?r(e):i(e)}},"/eF7":function(e,t,n){var r=n("omPs"),i=n("LlRA"),o=n("1/+g"),a=n("LK1c"),s=n("qifX"),u=n("iNcF"),c=n("qmgT"),l=n("gO+Z"),d=n("mqi7"),h=n("1sa0"),f=n("5TiC"),p=n("ZB1U"),v=n("aYTY"),g=n("90A/"),y=n("z9/d"),m=n("P/Kr"),b=n("FBB6"),x=n("dOWE"),w=n("XCkn"),E=n("2rze"),k=n("/NDV"),P=n("UwPs"),j={};j["[object Arguments]"]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j["[object Object]"]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j["[object Function]"]=j["[object WeakMap]"]=!1,e.exports=function e(t,n,C,_,S,O){var D,T=1&n,B=2&n,M=4&n;if(C&&(D=S?C(t,_,S,O):C(t)),void 0!==D)return D;if(!w(t))return t;var N=m(t);if(N){if(D=v(t),!T)return c(t,D)}else{var I=p(t),A="[object Function]"==I||"[object GeneratorFunction]"==I;if(b(t))return u(t,T);if("[object Object]"==I||"[object Arguments]"==I||A&&!S){if(D=B||A?{}:y(t),!T)return B?d(t,s(D,t)):l(t,a(D,t))}else{if(!j[I])return S?t:{};D=g(t,I,T)}}O||(O=new r);var L=O.get(t);if(L)return L;O.set(t,D),E(t)?t.forEach((function(r){D.add(e(r,n,C,r,t,O))})):x(t)&&t.forEach((function(r,i){D.set(i,e(r,n,C,i,t,O))}));var z=N?void 0:(M?B?f:h:B?P:k)(t);return i(z||t,(function(r,i){z&&(r=t[i=r]),o(D,i,e(r,n,C,i,t,O))})),D}},"/vEv":function(e,t,n){var r=n("P/Kr"),i=n("G1mR"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},"/wkG":function(e,t){e.exports="2.1.8"},"/wvS":function(e,t,n){var r=n("fn44"),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},0:function(e,t,n){e.exports=n("gmml")},"0A6J":function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},"0I+s":function(e,t,n){e.exports=n("pJDX")},"0M5s":function(e,t,n){"use strict";function r(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}n.d(t,"a",(function(){return r}))},"0Mpn":function(e,t,n){e.exports={graphlib:n("+y+b"),layout:n("CwrB"),debug:n("fOmH"),util:{time:n("Ls/e").time,notime:n("Ls/e").notime},version:n("i6g8")}},"0Y/0":function(e,t,n){var r=n("8Doe"),i=n("bZij"),o=n("PiTB");e.exports=function(e){return o(i(e,void 0,r),e+"")}},"0Zrb":function(e,t,n){var r=n("mqRG"),i=n("uLMv"),o=n("5wxO");e.exports=function(e){return i(e)?o(e):r(e)}},"1/+g":function(e,t,n){var r=n("vkS7"),i=n("hmyg"),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},"19QD":function(e,t,n){var r=n("Ms17"),i=n("etTJ"),o=n("UfSc");e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},"1OjK":function(e,t,n){var r=n("kt/b"),i=n("nHTl"),o=n("1iw3");e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},"1QEJ":function(e,t,n){"use strict";n.r(t);var r=n("P87u");n.d(t,"top",(function(){return r.u})),n.d(t,"bottom",(function(){return r.i})),n.d(t,"right",(function(){return r.s})),n.d(t,"left",(function(){return r.l})),n.d(t,"auto",(function(){return r.d})),n.d(t,"basePlacements",(function(){return r.e})),n.d(t,"start",(function(){return r.t})),n.d(t,"end",(function(){return r.k})),n.d(t,"clippingParents",(function(){return r.j})),n.d(t,"viewport",(function(){return r.w})),n.d(t,"popper",(function(){return r.p})),n.d(t,"reference",(function(){return r.r})),n.d(t,"variationPlacements",(function(){return r.v})),n.d(t,"placements",(function(){return r.o})),n.d(t,"beforeRead",(function(){return r.g})),n.d(t,"read",(function(){return r.q})),n.d(t,"afterRead",(function(){return r.b})),n.d(t,"beforeMain",(function(){return r.f})),n.d(t,"main",(function(){return r.m})),n.d(t,"afterMain",(function(){return r.a})),n.d(t,"beforeWrite",(function(){return r.h})),n.d(t,"write",(function(){return r.x})),n.d(t,"afterWrite",(function(){return r.c})),n.d(t,"modifierPhases",(function(){return r.n}));var i=n("Mjbo");n.d(t,"applyStyles",(function(){return i.a})),n.d(t,"arrow",(function(){return i.b})),n.d(t,"computeStyles",(function(){return i.c})),n.d(t,"eventListeners",(function(){return i.d})),n.d(t,"flip",(function(){return i.e})),n.d(t,"hide",(function(){return i.f})),n.d(t,"offset",(function(){return i.g})),n.d(t,"popperOffsets",(function(){return i.h})),n.d(t,"preventOverflow",(function(){return i.i}));var o=n("siKF");n.d(t,"popperGenerator",(function(){return o.b}));var a=n("4idG");n.d(t,"detectOverflow",(function(){return a.a})),n.d(t,"createPopperBase",(function(){return o.a}));var s=n("Jcpa");n.d(t,"createPopper",(function(){return s.a}));var u=n("i2na");n.d(t,"createPopperLite",(function(){return u.a}))},"1XSk":function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},"1iw3":function(e,t){e.exports=function(e,t){return e<t}},"1qE/":function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},"1sa0":function(e,t,n){var r=n("4cwg"),i=n("7LQ5"),o=n("/NDV");e.exports=function(e){return r(e,o,i)}},"20jF":function(e,t,n){var r=n("KFC0"),i=n("gWu1");e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},"2FGo":function(e,t,n){var r=n("MYHX"),i=n("eiA/")((function(e,t,n){r(e,t,n)}));e.exports=i},"2Pt6":function(e,t,n){var r;try{r={cloneDeep:n("l9Jy"),constant:n("iuDc"),defaults:n("Hmvy"),each:n("0I+s"),filter:n("xzHw"),find:n("b1Ea"),flatten:n("8Doe"),forEach:n("pJDX"),forIn:n("rhLl"),has:n("7jeQ"),isUndefined:n("TkAH"),last:n("gAdM"),map:n("jJDv"),mapValues:n("yMGJ"),max:n("2hwN"),merge:n("2FGo"),min:n("btk6"),minBy:n("1OjK"),now:n("58PG"),pick:n("2Z+u"),range:n("j5yP"),reduce:n("fG1K"),sortBy:n("TKCn"),uniqueId:n("o4PY"),values:n("R9Wj"),zipObject:n("vWe6")}}catch(i){}r||(r=window._),e.exports=r},"2Z+u":function(e,t,n){var r=n("Ekrn"),i=n("0Y/0")((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},"2hwN":function(e,t,n){var r=n("kt/b"),i=n("YWzE"),o=n("uYOL");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},"2jb1":function(e,t,n){var r=n("MVHo");e.exports=function(e){return r(this,e).has(e)}},"2rze":function(e,t,n){var r=n("9s1C"),i=n("wJPF"),o=n("Uc6l"),a=o&&o.isSet,s=a?i(a):r;e.exports=s},"2v8U":function(e,t,n){var r=n("4cIi"),i=n("+Gly")(r);e.exports=i},"35Nh":function(e,t,n){var r=n("aEqC"),i=n("Fv5L"),o=n("FbqI");e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var c=t[a],l=r(e,c);n(l,c)&&i(u,o(c,e),l)}return u}},"38y5":function(e,t,n){var r=n("UyqU"),i=n("wJPF"),o=n("Uc6l"),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},"3AN6":function(e,t){e.exports=function(e){return this.__data__.has(e)}},"3E1u":function(e,t,n){var r=n("FbqI"),i=n("x14d"),o=n("P/Kr"),a=n("68Jb"),s=n("gWu1"),u=n("sRgw");e.exports=function(e,t,n){for(var c=-1,l=(t=r(t,e)).length,d=!1;++c<l;){var h=u(t[c]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++c!=l?d:!!(l=null==e?0:e.length)&&s(l)&&a(h,l)&&(o(e)||i(e))}},"3YCG":function(e,t,n){var r=n("ih+a"),i=n("RNn5");function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},"3bG8":function(e,t,n){var r=n("aCzx"),i=n("Pt7R"),o=n("hmyg"),a=n("lhiQ"),s=n("fLsW"),u=n("1XSk"),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var f=s;case"[object Set]":if(f||(f=u),e.size!=t.size&&!(1&r))return!1;var p=h.get(e);if(p)return p==t;r|=2,h.set(e,t);var v=a(f(e),f(t),r,c,d,h);return h.delete(e),v;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},"3ftC":function(e,t,n){var r=n("aC0R"),i=n("XCkn"),o=n("G1mR"),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?c(e.slice(2),n?2:8):a.test(e)?NaN:+e}},"3reM":function(e,t,n){var r=n("vkNO")(n("/wvS"),"WeakMap");e.exports=r},"4O6w":function(e,t,n){var r=n("AdjD"),i=n("c7Ww"),o=n("3AN6");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},"4cIi":function(e,t,n){var r=n("BBZX"),i=n("/NDV");e.exports=function(e,t){return e&&r(e,t,i)}},"4cwg":function(e,t,n){var r=n("1qE/"),i=n("P/Kr");e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},"4idG":function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var r=n("ks2Z"),i=n("P87u"),o=n("0M5s"),a=n("m97I"),s=n("7ABo"),u=n("UbiW"),c=n("cyB8"),l=n("wJ0V"),d=n("U6T1"),h=n("/Ktv"),f=n("PX5Y"),p=n("Hwp0"),v=n("BBD8"),g=n("hcIE");function y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function m(e,t){return t===i.w?y(function(e){var t=Object(o.a)(e),n=Object(a.a)(e),r=t.visualViewport,i=n.clientWidth,u=n.clientHeight,c=0,l=0;return r&&(i=r.width,u=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(c=r.offsetLeft,l=r.offsetTop)),{width:i,height:u,x:c+Object(s.a)(e),y:l}}(e)):Object(f.b)(t)?function(e){var t=Object(r.a)(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):y(function(e){var t,n=Object(a.a)(e),r=Object(c.a)(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=Object(l.a)(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),d=Object(l.a)(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),h=-r.scrollLeft+Object(s.a)(e),f=-r.scrollTop;return"rtl"===Object(u.a)(i||n).direction&&(h+=Object(l.a)(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:d,x:h,y:f}}(Object(a.a)(e)))}function b(e,t,n){var r="clippingParents"===t?function(e){var t=Object(d.a)(Object(p.a)(e)),n=["absolute","fixed"].indexOf(Object(u.a)(e).position)>=0&&Object(f.b)(e)?Object(h.a)(e):e;return Object(f.a)(n)?t.filter((function(e){return Object(f.a)(e)&&Object(v.a)(e,n)&&"body"!==Object(g.a)(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i.reduce((function(t,n){var r=m(e,n);return t.top=Object(l.a)(r.top,t.top),t.right=Object(l.b)(r.right,t.right),t.bottom=Object(l.b)(r.bottom,t.bottom),t.left=Object(l.a)(r.left,t.left),t}),m(e,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var x=n("OXg1"),w=n("Y41C"),E=n("aXq5");function k(e,t){void 0===t&&(t={});var n=t.placement,o=void 0===n?e.placement:n,s=t.boundary,u=void 0===s?i.j:s,c=t.rootBoundary,l=void 0===c?i.w:c,d=t.elementContext,h=void 0===d?i.p:d,p=t.altBoundary,v=void 0!==p&&p,g=t.padding,m=void 0===g?0:g,k=Object(w.a)("number"!=typeof m?m:Object(E.a)(m,i.e)),P=e.elements.reference,j=e.rects.popper,C=e.elements[v?h===i.p?i.r:i.p:h],_=b(Object(f.a)(C)?C:C.contextElement||Object(a.a)(e.elements.popper),u,l),S=Object(r.a)(P),O=Object(x.a)({reference:S,element:j,strategy:"absolute",placement:o}),D=y(Object.assign({},j,O)),T=h===i.p?D:S,B={top:_.top-T.top+k.top,bottom:T.bottom-_.bottom+k.bottom,left:_.left-T.left+k.left,right:T.right-_.right+k.right},M=e.modifiersData.offset;if(h===i.p&&M){var N=M[o];Object.keys(B).forEach((function(e){var t=[i.s,i.i].indexOf(e)>=0?1:-1,n=[i.u,i.i].indexOf(e)>=0?"y":"x";B[e]+=N[n]*t}))}return B}},"4ips":function(e,t,n){var r=n("1qE/"),i=n("MlCX");e.exports=function e(t,n,o,a,s){var u=-1,c=t.length;for(o||(o=i),s||(s=[]);++u<c;){var l=t[u];n>0&&o(l)?n>1?e(l,n-1,o,a,s):r(s,l):a||(s[s.length]=l)}return s}},"58PG":function(e,t,n){var r=n("/wvS");e.exports=function(){return r.Date.now()}},"5N3H":function(e,t){e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},"5PFN":function(e,t){e.exports=function(e,t){return e.has(t)}},"5TiC":function(e,t,n){var r=n("4cwg"),i=n("zOYv"),o=n("UwPs");e.exports=function(e){return r(e,o,i)}},"5wxO":function(e,t){var n="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",r="\\ud83c[\\udffb-\\udfff]",i="[^\\ud800-\\udfff]",o="(?:\\ud83c[\\udde6-\\uddff]){2}",a="[\\ud800-\\udbff][\\udc00-\\udfff]",s="(?:"+n+"|"+r+")?",u="[\\ufe0e\\ufe0f]?"+s+"(?:\\u200d(?:"+[i,o,a].join("|")+")[\\ufe0e\\ufe0f]?"+s+")*",c="(?:"+[i+n+"?",n,o,a,"[\\ud800-\\udfff]"].join("|")+")",l=RegExp(r+"(?="+r+")|"+c+u,"g");e.exports=function(e){for(var t=l.lastIndex=0;l.test(e);)++t;return t}},"5yhz":function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},"68Jb":function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},"6cPL":function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},"7/U+":function(e,t,n){var r=n("yvRI"),i=n("QA6A");e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},"7ABo":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("ks2Z"),i=n("m97I"),o=n("cyB8");function a(e){return Object(r.a)(Object(i.a)(e)).left+Object(o.a)(e).scrollLeft}},"7Gq8":function(e,t,n){var r=n("BZxG");e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,u=n.length;++i<s;){var c=r(o[i],a[i]);if(c)return i>=u?c:c*("desc"==n[i]?-1:1)}return e.index-t.index}},"7LQ5":function(e,t,n){var r=n("seaz"),i=n("+n8R"),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},"7jeQ":function(e,t,n){var r=n("jtID"),i=n("3E1u");e.exports=function(e,t){return null!=e&&i(e,t,r)}},"7klG":function(e,t,n){var r=n("6cPL"),i=n("3E1u");e.exports=function(e,t){return null!=e&&i(e,t,r)}},"7wBR":function(e,t,n){"use strict";var r=n("2Pt6"),i=n("CfaP"),o=n("wp+v"),a=n("ESra"),s=n("E4gk"),u=n("Sqn1"),c=n("+y+b").Graph,l=n("Ls/e");function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new c;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),u(e,n,o.vs)}))}function f(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=l.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);f(e,s);for(var u,c=Number.POSITIVE_INFINITY,p=0,v=0;v<4;++p,++v){h(p%2?n:a,p%4>=2),s=l.buildLayerMatrix(e);var g=o(e,s);g<c&&(v=0,u=r.cloneDeep(s),c=g)}f(e,u)}},"8Doe":function(e,t,n){var r=n("4ips");e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},"8Ei6":function(e,t,n){var r=n("XpzN"),i=n("uF7Z"),o=n("QA6A"),a=Function.prototype.toString,s=Object.prototype.hasOwnProperty,u=a.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==u}},"9/DR":function(e,t,n){"use strict";var r=n("JHDW"),i=n("g4JO"),o=n("BBD8"),a=n("/Ktv"),s=n("KdpE"),u=n("cu0D"),c=n("Y41C"),l=n("aXq5"),d=n("P87u");t.a={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,h=e.options,f=n.elements.arrow,p=n.modifiersData.popperOffsets,v=Object(r.a)(n.placement),g=Object(s.a)(v),y=[d.l,d.s].indexOf(v)>=0?"height":"width";if(f&&p){var m=function(e,t){return e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e,Object(c.a)("number"!=typeof e?e:Object(l.a)(e,d.e))}(h.padding,n),b=Object(i.a)(f),x="y"===g?d.u:d.l,w="y"===g?d.i:d.s,E=n.rects.reference[y]+n.rects.reference[g]-p[g]-n.rects.popper[y],k=p[g]-n.rects.reference[g],P=Object(a.a)(f),j=P?"y"===g?P.clientHeight||0:P.clientWidth||0:0,C=m[x],_=j-b[y]-m[w],S=j/2-b[y]/2+(E/2-k/2),O=Object(u.a)(C,S,_);n.modifiersData[o]=((t={})[g]=O,t.centerOffset=O-S,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Object(o.a)(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}},"90A/":function(e,t,n){var r=n("TXW/"),i=n("p1dg"),o=n("zPTW"),a=n("VYh0"),s=n("b/GH");e.exports=function(e,t,n){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return o(e);case"[object Set]":return new u;case"[object Symbol]":return a(e)}}},"90g9":function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},"95R8":function(e,t,n){var r=n("90g9"),i=n("aEqC"),o=n("nHTl"),a=n("QwWC"),s=n("uHqx"),u=n("wJPF"),c=n("7Gq8"),l=n("uYOL"),d=n("P/Kr");e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[l];var h=-1;t=r(t,u(o));var f=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(f,(function(e,t){return c(e,t,n)}))}},"9RX+":function(e,t){e.exports=function(e){return e!=e}},"9qq3":function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},"9s1C":function(e,t,n){var r=n("ZB1U"),i=n("QA6A");e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},AHUu:function(e,t){e.exports=function(){this.__data__=[],this.size=0}},"AJU+":function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},AXJ8:function(e,t,n){var r=n("/wvS")["__core-js_shared__"];e.exports=r},AdjD:function(e,t,n){var r=n("GjTQ"),i=n("bF6N"),o=n("toVn"),a=n("2jb1"),s=n("nECo");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},Aj3n:function(e,t,n){"use strict";var r=n("2Pt6");function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},Aj6a:function(e,t,n){var r=n("nHTl"),i=n("20jF"),o=n("/NDV");e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var u=r(n,3);t=o(t),n=function(e){return u(s[e],e,s)}}var c=e(t,n,a);return c>-1?s[u?t[c]:c]:void 0}}},B0jI:function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},B42D:function(e,t,n){var r=n("aEqC");e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},BBD8:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("PX5Y");function i(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Object(r.c)(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}},BBZX:function(e,t,n){var r=n("JirB")();e.exports=r},BZxG:function(e,t,n){var r=n("G1mR");e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,u=null===t,c=t==t,l=r(t);if(!u&&!l&&!a&&e>t||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&e<t||l&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!c)return-1}return 0}},C5Sn:function(e,t,n){var r=n("rYqC"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},CcQI:function(e,t,n){"use strict";var r=n("hcIE"),i=n("PX5Y");t.a={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},a=t.elements[e];Object(i.b)(a)&&Object(r.a)(a)&&(Object.assign(a.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],a=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Object(i.b)(o)&&Object(r.a)(o)&&(Object.assign(o.style,s),Object.keys(a).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]}},CfaP:function(e,t,n){"use strict";var r=n("2Pt6");e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},CqBt:function(e,t,n){var r=n("ih+a");e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=t[n],i=o[n],a=o[e].distance+r.distance;a<i.distance&&(i.distance=a,i.predecessor=r.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},CwrB:function(e,t,n){"use strict";var r=n("2Pt6"),i=n("UzfO"),o=n("ql8D"),a=n("Zu/h"),s=n("Ls/e").normalizeRanks,u=n("EVSJ"),c=n("Ls/e").removeEmptyRanks,l=n("+qHO"),d=n("N7p8"),h=n("Aj3n"),f=n("7wBR"),p=n("a8YL"),v=n("Ls/e"),g=n("+y+b").Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=C(e.graph());return t.setGraph(r.merge({},m,j(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=C(e.node(n));t.setNode(n,r.defaults(j(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=C(e.edge(n));t.setEdge(n,r.merge({},k,j(i,E),r.pick(i,P)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){l.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};v.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){c(e)})),t(" nestingGraph.cleanup",(function(){l.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){u(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){f(e)})),t(" insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){p(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,u=a.marginy||0;function c(e){var r=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(e.nodes(),(function(t){c(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&c(n)})),t-=s,i-=u,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+u}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},P=["labelpos"];function j(e,t){return r.mapValues(r.pick(e,t),Number)}function C(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},Cxmr:function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},D3R9:function(e,t,n){var r=n("uYOL");e.exports=function(e){return"function"==typeof e?e:r}},DBCL:function(e,t,n){var r,i=n("AXJ8"),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},"DQ+0":function(e,t,n){var r=n("iuDc"),i=n("uHxH"),o=n("uYOL");e.exports=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o},"DRH/":function(e,t,n){var r=n("hmyg");e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},DZHY:function(e,t,n){var r=n("VWZU"),i=n("ih+a");e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},E4gk:function(e,t,n){var r=n("2Pt6"),i=n("+y+b").Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),u=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},ESra:function(e,t,n){var r=n("2Pt6"),i=n("WE2j"),o=n("T5CK"),a=n("fGml");e.exports=function e(t,n,s,u){var c=t.children(n),l=t.node(n),d=l?l.borderLeft:void 0,h=l?l.borderRight:void 0,f={};d&&(c=r.filter(c,(function(e){return e!==d&&e!==h})));var p=i(t,c);r.forEach(p,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,u);f[n.v]=i,r.has(i,"barycenter")&&(a=i,r.isUndefined((o=n).barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(p,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,f);var g=a(v,u);if(d&&(g.vs=r.flatten([d,g.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g}},EVSJ:function(e,t,n){var r=n("2Pt6");e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],u=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>u||c>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],l=!0;n!==i.w;){if(r=e.node(n),l){for(;(c=a[u])!==s&&e.node(c).maxRank<r.rank;)u++;c===s&&(l=!1)}if(!l){for(;u<a.length-1&&e.node(c=a[u+1]).minRank<=r.rank;)u++;c=a[u]}e.setParent(n,c),n=e.successors(n)[0]}}))}},Ekrn:function(e,t,n){var r=n("35Nh"),i=n("7klG");e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},FBB6:function(e,t,n){(function(e){var r=n("/wvS"),i=n("JKEm"),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0;e.exports=(s?s.isBuffer:void 0)||i}).call(this,n("Fs+f")(e))},FD1B:function(e,t,n){var r=n("fbik"),i=n("/NDV");e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},FbqI:function(e,t,n){var r=n("P/Kr"),i=n("/vEv"),o=n("fQli"),a=n("rhmX");e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},"Fs+f":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}},Fv5L:function(e,t,n){var r=n("1/+g"),i=n("FbqI"),o=n("68Jb"),a=n("XCkn"),s=n("sRgw");e.exports=function(e,t,n,u){if(!a(e))return e;for(var c=-1,l=(t=i(t,e)).length,d=l-1,h=e;null!=h&&++c<l;){var f=s(t[c]),p=n;if("__proto__"===f||"constructor"===f||"prototype"===f)return e;if(c!=d){var v=h[f];void 0===(p=u?u(v,f,h):void 0)&&(p=a(v)?v:o(t[c+1])?[]:{})}r(h,f,p),h=h[f]}return e}},G1mR:function(e,t,n){var r=n("XpzN"),i=n("QA6A");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},GY8p:function(e,t){e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},GjTQ:function(e,t,n){var r=n("MC7g"),i=n("Hczf"),o=n("ceoc");e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},HE6A:function(e,t,n){var r=n("Ihs8");e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},HbLn:function(e,t,n){var r=n("DRH/");e.exports=function(e){return r(this.__data__,e)>-1}},Hczf:function(e,t,n){var r=n("AHUu"),i=n("kDty"),o=n("s1IN"),a=n("HbLn"),s=n("xGrr");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},Hmvy:function(e,t,n){var r=n("Opi0"),i=n("hmyg"),o=n("etTJ"),a=n("UwPs"),s=Object.prototype,u=s.hasOwnProperty,c=r((function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(r=1);++n<r;)for(var l=t[n],d=a(l),h=-1,f=d.length;++h<f;){var p=d[h],v=e[p];(void 0===v||i(v,s[p])&&!u.call(e,p))&&(e[p]=l[p])}return e}));e.exports=c},Hwp0:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n("hcIE"),i=n("m97I"),o=n("PX5Y");function a(e){return"html"===Object(r.a)(e)?e:e.assignedSlot||e.parentNode||(Object(o.c)(e)?e.host:null)||Object(i.a)(e)}},IOXn:function(e,t,n){e.exports={Graph:n("RNn5"),version:n("/wkG")}},Idy0:function(e,t,n){var r=n("4ips"),i=n("Opi0"),o=n("dA+0"),a=n("QFSp"),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},Ihs8:function(e,t,n){var r=n("ih+a");function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},JHDW:function(e,t,n){"use strict";function r(e){return e.split("-")[0]}n.d(t,"a",(function(){return r}))},JKEm:function(e,t){e.exports=function(){return!1}},JXIS:function(e,t,n){"use strict";function r(){return{top:0,right:0,bottom:0,left:0}}n.d(t,"a",(function(){return r}))},Jcpa:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n("siKF"),i=n("oFCp"),o=n("oid+"),a=n("qJB9"),s=n("CcQI"),u=n("NKFK"),c=n("wYOv"),l=n("q6aP"),d=n("9/DR"),h=n("z8at"),f=[i.a,o.a,a.a,s.a,u.a,c.a,l.a,d.a,h.a],p=Object(r.b)({defaultModifiers:f})},JirB:function(e,t){e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},Jq22:function(e,t,n){var r=n("sjqF"),i=n("nHTl"),o=n("NDsS"),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(e,i(t,3),u)}},Jqlz:function(e,t,n){"use strict";var r=n("2Pt6");e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},Jz0R:function(e,t,n){var r;r=function(e){return 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.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),i=n(1).getRef,o=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=i(e,t),u=o(e,t.content),c=r({},a,t.popper);return s(n,u,c)}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},i=e.cy();return r({},{renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e);return{x:n.x-r.w/2,y:n.y-r.h/2}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:i},t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),i(this[0],a(this[0],e))},popperRef:function(e){return s(this),o(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return i(this,a(this,e))},popperRef:function(e){return o(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.renderedDimensions,i=t.cy.container().getBoundingClientRect(),o=r(e),a=n(e);return{top:a.y+i.top,left:a.x+i.left,right:a.x+o.w+i.left,bottom:a.y+o.h+i.top,width:o.w,height:o.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),i=n(3),o=function(e){e&&(e("core","popper",r.popper),e("collection","popper",i.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",i.popperRef))};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(t,n){t.exports=e}])},e.exports=r(n("1QEJ"))},KEuk:function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(t){}try{return e+""}catch(t){}}return""}},KFC0:function(e,t,n){var r=n("XpzN"),i=n("XCkn");e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},KZGt:function(e,t){e.exports=function(){}},KdpE:function(e,t,n){"use strict";function r(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}n.d(t,"a",(function(){return r}))},LK1c:function(e,t,n){var r=n("xJuT"),i=n("/NDV");e.exports=function(e,t){return e&&r(t,i(t),e)}},LbEC:function(e,t,n){var r=n("ih+a"),i=n("RNn5"),o=n("yIGb");e.exports=function(e,t){var n,a=new i,s={},u=new o;function c(e){var r=e.v===n?e.w:e.v,i=u.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){u.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),u.decrease(e.nodes()[0],0);for(var l=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(n).forEach(c)}return a}},LlRA:function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},LoTP:function(e,t,n){var r=n("ih+a");e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],a={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);!function e(t,n,i,o,a,s){r.has(o,n)||(o[n]=!0,i||s.push(n),r.each(a(n),(function(n){e(t,n,i,o,a,s)})),i&&s.push(n))}(e,t,"post"===n,a,i,o)})),o}},"Ls/e":function(e,t,n){"use strict";var r=n("2Pt6"),i=n("+y+b").Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,u=e.width/2,c=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},MC7g:function(e,t,n){var r=n("X8fK"),i=n("0A6J"),o=n("C5Sn"),a=n("UM4x"),s=n("z4dE");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},MVHo:function(e,t,n){var r=n("Cxmr");e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},MYHX:function(e,t,n){var r=n("omPs"),i=n("Xxsa"),o=n("BBZX"),a=n("f2WW"),s=n("XCkn"),u=n("UwPs"),c=n("VVrI");e.exports=function e(t,n,l,d,h){t!==n&&o(n,(function(o,u){if(h||(h=new r),s(o))a(t,n,u,l,e,d,h);else{var f=d?d(c(t,u),o,u+"",t,n,h):void 0;void 0===f&&(f=o),i(t,u,f)}}),u)}},Mjbo:function(e,t,n){"use strict";var r=n("CcQI");n.d(t,"a",(function(){return r.a}));var i=n("9/DR");n.d(t,"b",(function(){return i.a}));var o=n("qJB9");n.d(t,"c",(function(){return o.a}));var a=n("oFCp");n.d(t,"d",(function(){return a.a}));var s=n("wYOv");n.d(t,"e",(function(){return s.a}));var u=n("z8at");n.d(t,"f",(function(){return u.a}));var c=n("NKFK");n.d(t,"g",(function(){return c.a}));var l=n("oid+");n.d(t,"h",(function(){return l.a}));var d=n("q6aP");n.d(t,"i",(function(){return d.a}))},MlCX:function(e,t,n){var r=n("aCzx"),i=n("x14d"),o=n("P/Kr"),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},Mmx5:function(e,t){e.exports=function(e){return this.__data__.get(e)}},Ms17:function(e,t){var n=Math.ceil,r=Math.max;e.exports=function(e,t,i,o){for(var a=-1,s=r(n((t-e)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=e,e+=i;return u}},N7p8:function(e,t,n){var r=n("2Pt6"),i=n("Ls/e");function o(e,t,n,r,o,a){var s=o[t][a-1],u=i.addDummyNode(e,"border",{width:0,height:0,rank:a,borderType:t},n);o[t][a]=u,e.setParent(u,r),s&&e.setEdge(s,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)o(e,"borderLeft","_bl",n,a,s),o(e,"borderRight","_br",n,a,s)}}))}},NDho:function(e,t,n){var r=n("htNe");e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},NDsS:function(e,t,n){var r=n("UfSc");e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},NKFK:function(e,t,n){"use strict";var r=n("JHDW"),i=n("P87u");t.a={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=e.options.offset,a=void 0===o?[0,0]:o,s=i.o.reduce((function(e,n){return e[n]=function(e,t,n){var o=Object(r.a)(e),a=[i.l,i.u].indexOf(o)>=0?-1:1,s="function"==typeof n?n(Object.assign({},t,{placement:e})):n,u=s[0],c=s[1];return u=u||0,c=(c||0)*a,[i.l,i.s].indexOf(o)>=0?{x:c,y:u}:{x:u,y:c}}(n,t.rects,a),e}),{}),u=s[t.placement],c=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u.x,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=s}}},O0gm:function(e,t,n){var r=n("S/8i")(Object.keys,Object);e.exports=r},OXg1:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("JHDW"),i=n("k6AR"),o=n("KdpE"),a=n("P87u");function s(e){var t,n=e.reference,s=e.element,u=e.placement,c=u?Object(r.a)(u):null,l=u?Object(i.a)(u):null,d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(c){case a.u:t={x:d,y:n.y-s.height};break;case a.i:t={x:d,y:n.y+n.height};break;case a.s:t={x:n.x+n.width,y:h};break;case a.l:t={x:n.x-s.width,y:h};break;default:t={x:n.x,y:n.y}}var f=c?Object(o.a)(c):null;if(null!=f){var p="y"===f?"height":"width";switch(l){case a.t:t[f]=t[f]-(n[p]/2-s[p]/2);break;case a.k:t[f]=t[f]+(n[p]/2-s[p]/2)}}return t}},OksX:function(e,t,n){var r=n("/eF7");e.exports=function(e){return r(e,4)}},Opi0:function(e,t,n){var r=n("uYOL"),i=n("bZij"),o=n("PiTB");e.exports=function(e,t){return o(i(e,t,r),e+"")}},"P/Kr":function(e,t){e.exports=Array.isArray},P87u:function(e,t,n){"use strict";n.d(t,"u",(function(){return r})),n.d(t,"i",(function(){return i})),n.d(t,"s",(function(){return o})),n.d(t,"l",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"t",(function(){return c})),n.d(t,"k",(function(){return l})),n.d(t,"j",(function(){return d})),n.d(t,"w",(function(){return h})),n.d(t,"p",(function(){return f})),n.d(t,"r",(function(){return p})),n.d(t,"v",(function(){return v})),n.d(t,"o",(function(){return g})),n.d(t,"g",(function(){return y})),n.d(t,"q",(function(){return m})),n.d(t,"b",(function(){return b})),n.d(t,"f",(function(){return x})),n.d(t,"m",(function(){return w})),n.d(t,"a",(function(){return E})),n.d(t,"h",(function(){return k})),n.d(t,"x",(function(){return P})),n.d(t,"c",(function(){return j})),n.d(t,"n",(function(){return C}));var r="top",i="bottom",o="right",a="left",s="auto",u=[r,i,o,a],c="start",l="end",d="clippingParents",h="viewport",f="popper",p="reference",v=u.reduce((function(e,t){return e.concat([t+"-"+c,t+"-"+l])}),[]),g=[].concat(u,[s]).reduce((function(e,t){return e.concat([t,t+"-"+c,t+"-"+l])}),[]),y="beforeRead",m="read",b="afterRead",x="beforeMain",w="main",E="afterMain",k="beforeWrite",P="write",j="afterWrite",C=[y,m,b,x,w,E,k,P,j]},P9pc:function(e,t){e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},PIq0:function(e,t){e.exports=function(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)}},PPP7:function(e,t,n){e.exports=n("Q/Vy")},PX5Y:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a}));var r=n("0M5s");function i(e){return e instanceof Object(r.a)(e).Element||e instanceof Element}function o(e){return e instanceof Object(r.a)(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Object(r.a)(e).ShadowRoot||e instanceof ShadowRoot)}},PiTB:function(e,t,n){var r=n("DQ+0"),i=n("WtQT")(r);e.exports=i},Pt7R:function(e,t,n){var r=n("/wvS").Uint8Array;e.exports=r},"Q/Vy":function(e,t,n){var r,i,o;(function(){var n,a,s,u,c,l,d,h,f,p,v,g,y,m,b;s=Math.floor,p=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},f=function(e,t,n,r,i){var o;if(null==n&&(n=0),null==i&&(i=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[o=s((n+r)/2)])<0?r=o:n=o+1;return[].splice.apply(e,[n,n-n].concat(t)),t},l=function(e,t,n){return null==n&&(n=a),e.push(t),m(e,0,e.length-1,n)},c=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},h=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},u=function(e,t){var n,r,i,o,u;for(null==t&&(t=a),o=[],n=0,r=(i=(function(){u=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}).apply(this).reverse()).length;n<r;n++)o.push(b(e,i[n],t));return o},y=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return m(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,i,o,s;if(null==n&&(n=a),!(r=e.slice(0,t)).length)return r;for(u(r,n),i=0,o=(s=e.slice(t)).length;i<o;i++)d(r,s[i],n);return r.sort(n).reverse()},g=function(e,t,n){var r,i,o,s,l,d,h,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(o=e.slice(0,t).sort(n)).length)return o;for(i=o[o.length-1],s=0,d=(h=e.slice(t)).length;s<d;s++)n(r=h[s],i)<0&&(f(o,r,0,null,n),o.pop(),i=o[o.length-1]);return o}for(u(e,n),g=[],l=0,v=p(t,e.length);0<=v?l<v:l>v;0<=v?++l:--l)g.push(c(e,n));return g},m=function(e,t,n,r){var i,o,s;for(null==r&&(r=a),i=e[n];n>t&&r(i,o=e[s=n-1>>1])<0;)e[n]=o,n=s;return e[n]=i},b=function(e,t,n){var r,i,o,s,u;for(null==n&&(n=a),i=e.length,u=t,o=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=o,m(e,u,t,n)},n=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=l,e.pop=c,e.replace=h,e.pushpop=d,e.heapify=u,e.updateItem=y,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pop=function(){return c(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return h(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return u(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),i=[],void 0===(o="function"==typeof(r=function(){return n})?r.apply(t,i):r)||(e.exports=o)}).call(this)},Q33P:function(e,t,n){var r=n("wMi0"),i=n("ZB1U"),o=n("x14d"),a=n("P/Kr"),s=n("20jF"),u=n("FBB6"),c=n("B0jI"),l=n("38y5"),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||l(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},Q97t:function(e,t,n){var r=n("1sa0"),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,c=r(e),l=c.length;if(l!=r(t).length&&!u)return!1;for(var d=l;d--;){var h=c[d];if(!(u?h in t:i.call(t,h)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<l;){var y=e[h=c[d]],m=t[h];if(o)var b=u?o(m,y,h,t,e,s):o(y,m,h,e,t,s);if(!(void 0===b?y===m||a(y,m,n,o,s):b)){v=!1;break}g||(g="constructor"==h)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},QA6A:function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},QFSp:function(e,t,n){var r=n("20jF"),i=n("QA6A");e.exports=function(e){return i(e)&&r(e)}},QGTD:function(e,t,n){var r=n("vkNO")(n("/wvS"),"DataView");e.exports=r},QPL1:function(e,t,n){var r=n("pFYY"),i=n("KZGt"),o=n("1XSk"),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},QPeP:function(e,t,n){var r=n("q+Dt");e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},QwWC:function(e,t,n){var r=n("2v8U"),i=n("20jF");e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},QwzJ:function(e,t){function n(){var e={};e._next=e._prev=e,this._sentinel=e}function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=n,n.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return r(t),t},n.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},n.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,i)),n=n._prev;return"["+e.join(", ")+"]"}},R9Wj:function(e,t,n){var r=n("r6dd"),i=n("/NDV");e.exports=function(e){return null==e?[]:r(e,i(e))}},RNn5:function(e,t,n){"use strict";var r=n("ih+a");function i(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function o(e,t){e[t]?e[t]++:e[t]=1}function a(e,t){--e[t]||delete e[t]}function s(e,t,n,i){var o=""+t,a=""+n;if(!e&&o>a){var s=o;o=a,a=s}return o+""+a+""+(r.isUndefined(i)?"\0":i)}function u(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function c(e,t){return s(e,t.v,t.w,t.name)}e.exports=i,i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(e){return this._label=e,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},i.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},i.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},i.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},i.prototype.node=function(e){return this._nodes[e]},i.prototype.hasNode=function(e){return r.has(this._nodes,e)},i.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},i.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t="\0";else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},i.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},i.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}},i.prototype.children=function(e){if(r.isUndefined(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}},i.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},i.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},i.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},i.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},i.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,function e(r){var o=n.parent(r);return void 0===o||t.hasNode(o)?(i[r]=o,o):o in i?i[o]:e(o)}(e))})),t},i.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},i.prototype.setEdge=function(){var e,t,n,i,a=!1,c=arguments[0];"object"==typeof c&&null!==c&&"v"in c?(e=c.v,t=c.w,n=c.name,2===arguments.length&&(i=arguments[1],a=!0)):(e=c,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var l=s(this._isDirected,e,t,n);if(r.has(this._edgeLabels,l))return a&&(this._edgeLabels[l]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[l]=a?i:this._defaultEdgeLabelFn(e,t,n);var d=u(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[l]=d,o(this._preds[t],e),o(this._sucs[e],t),this._in[t][l]=d,this._out[e][l]=d,this._edgeCount++,this},i.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):s(this._isDirected,e,t,n);return this._edgeLabels[r]},i.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?c(this._isDirected,arguments[0]):s(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},i.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):s(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],a(this._preds[t],e),a(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},i.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},i.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},i.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},"S/8i":function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},Sqn1:function(e,t,n){var r=n("2Pt6");e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},T5CK:function(e,t,n){"use strict";var r=n("2Pt6");e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&function(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},TKCn:function(e,t,n){var r=n("4ips"),i=n("95R8"),o=n("Opi0"),a=n("etTJ"),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},TVu4:function(e,t){e.exports=function(e){return this.__data__.has(e)}},"TXW/":function(e,t,n){var r=n("Pt7R");e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},TkAH:function(e,t){e.exports=function(e){return void 0===e}},U6T1:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n("Hwp0"),i=n("oe4Z"),o=n("hcIE"),a=n("PX5Y"),s=n("0M5s");function u(e,t){var n;void 0===t&&(t=[]);var c=function e(t){return["html","body","#document"].indexOf(Object(o.a)(t))>=0?t.ownerDocument.body:Object(a.b)(t)&&Object(i.a)(t)?t:e(Object(r.a)(t))}(e),l=c===(null==(n=e.ownerDocument)?void 0:n.body),d=Object(s.a)(c),h=l?[d].concat(d.visualViewport||[],Object(i.a)(c)?c:[]):c,f=t.concat(h);return l?f:f.concat(u(Object(r.a)(h)))}},UM4x:function(e,t,n){var r=n("rYqC"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},UZnP:function(e,t,n){var r=n("KFC0"),i=n("DBCL"),o=n("XCkn"),a=n("KEuk"),s=/^\[object .+?Constructor\]$/,u=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?u:s).test(a(e))}},UbiW:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("0M5s");function i(e){return Object(r.a)(e).getComputedStyle(e)}},Uc6l:function(e,t,n){(function(e){var r=n("fn44"),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=s}).call(this,n("Fs+f")(e))},UfSc:function(e,t,n){var r=n("3ftC");e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},Upex:function(e,t,n){var r=n("ZkmW"),i=n("FD1B"),o=n("ZESC");e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},Ur9C:function(e,t,n){var r=n("tIEw"),i=n("rbAF"),o=n("/vEv"),a=n("sRgw");e.exports=function(e){return o(e)?r(a(e)):i(e)}},UwPs:function(e,t,n){var r=n("nb5l"),i=n("dBa1"),o=n("20jF");e.exports=function(e){return o(e)?r(e,!0):i(e)}},UyqU:function(e,t,n){var r=n("XpzN"),i=n("gWu1"),o=n("QA6A"),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},UzfO:function(e,t,n){"use strict";var r=n("2Pt6"),i=n("VIf8");e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},VIf8:function(e,t,n){var r=n("2Pt6"),i=n("+y+b").Graph,o=n("QwzJ");e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e);n.setEdge(e.v,e.w,r+i),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var c=r.range(s+a+3).map((function(){return new o})),l=a+1;return r.forEach(n.nodes(),(function(e){u(c,l,n.node(e))})),{graph:n,buckets:c,zeroIdx:l}}(e,t||a),c=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(r=t[u].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=e.node(r.w);o.in-=i,u(t,n,o)})),e.removeNode(i.v),a}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},VVrI:function(e,t){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},VWZU:function(e,t,n){var r=n("ih+a"),i=n("yIGb");e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},u=new i,c=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),c=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);c<r.distance&&(r.distance=c,r.predecessor=o,u.decrease(t,c))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},u.add(e,n)}));u.size()>0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},VYh0:function(e,t,n){var r=n("aCzx"),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},WE2j:function(e,t,n){var r=n("2Pt6");e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},WGWR:function(e,t,n){"use strict";var r=n("2Pt6"),i=n("prgG"),o=n("Jqlz").slack,a=n("Jqlz").longestPath,s=n("+y+b").alg.preorder,u=n("+y+b").alg.postorder,c=n("Ls/e").simplify;function l(e){e=c(e),a(e);var t,n=i(e);for(f(n),d(n,e);t=v(n);)y(n,e,t,g(n,e,t))}function d(e,t){var n=u(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a=r.v===n,u=a?r.w:r.v;if(u!==i){var c=a===o,l=t.edge(r).weight;if(s+=c?l:-l,e.hasEdge(n,u)){var d=e.edge(n,u).cutvalue;s+=c?-d:d}}})),s}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=p(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),u=e.node(a),c=s,l=!1;s.lim>u.lim&&(c=u,l=!0);var d=r.filter(t.edges(),(function(t){return l===m(0,e.node(t.v),c)&&l!==m(0,e.node(t.w),c)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){e.removeEdge(n.v,n.w),e.setEdge(i.v,i.w,{}),f(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=l,l.initLowLimValues=f,l.initCutValues=d,l.calcCutValue=h,l.leaveEdge=v,l.enterEdge=g,l.exchangeEdges=y},WlgI:function(e,t,n){var r=n("IOXn");e.exports={Graph:r.Graph,json:n("3YCG"),alg:n("whaD"),version:r.version}},WtQT:function(e,t){var n=Date.now;e.exports=function(e){var t=0,r=0;return function(){var i=n(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},"X/Qz":function(e,t,n){var r=n("aCzx"),i=n("90g9"),o=n("P/Kr"),a=n("G1mR"),s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},X8fK:function(e,t,n){var r=n("rYqC");e.exports=function(){this.__data__=r?r(null):{},this.size=0}},XCkn:function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},XJpW:function(e,t,n){var r=n("ih+a"),i=n("cwoc");e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},XpzN:function(e,t,n){var r=n("aCzx"),i=n("g6VN"),o=n("AJU+"),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},Xxsa:function(e,t,n){var r=n("vkS7"),i=n("hmyg");e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},Y41C:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("JXIS");function i(e){return Object.assign({},Object(r.a)(),e)}},YWzE:function(e,t){e.exports=function(e,t){return e>t}},ZB1U:function(e,t,n){var r=n("QGTD"),i=n("ceoc"),o=n("xspy"),a=n("pFYY"),s=n("3reM"),u=n("XpzN"),c=n("KEuk"),l=c(r),d=c(i),h=c(o),f=c(a),p=c(s),v=u;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||a&&"[object Set]"!=v(new a)||s&&"[object WeakMap]"!=v(new s))&&(v=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case l:return"[object DataView]";case d:return"[object Map]";case h:return"[object Promise]";case f:return"[object Set]";case p:return"[object WeakMap]"}return t}),e.exports=v},ZESC:function(e,t){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},ZfK0:function(e,t,n){var r=n("Hczf");e.exports=function(){this.__data__=new r,this.size=0}},ZjvN:function(e,t,n){var r=n("LlRA"),i=n("haxF"),o=n("4cIi"),a=n("nHTl"),s=n("uF7Z"),u=n("P/Kr"),c=n("FBB6"),l=n("KFC0"),d=n("XCkn"),h=n("38y5");e.exports=function(e,t,n){var f=u(e),p=f||c(e)||h(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=p?f?new v:[]:d(e)&&l(v)?i(s(e)):{}}return(p?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},ZkmW:function(e,t,n){var r=n("omPs"),i=n("7/U+");e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(u&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<s;){var l=(c=n[a])[0],d=e[l],h=c[1];if(u&&c[2]){if(void 0===d&&!(l in e))return!1}else{var f=new r;if(o)var p=o(d,h,l,e,t,f);if(!(void 0===p?i(h,d,3,o,f):p))return!1}}return!0}},"Zu/h":function(e,t,n){"use strict";var r=n("Jqlz").longestPath,i=n("prgG"),o=n("WGWR");e.exports=function(e){switch(e.graph().ranker){case"network-simplex":s(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e);break;default:s(e)}};var a=r;function s(e){o(e)}},a8YL:function(e,t,n){"use strict";var r=n("2Pt6"),i=n("Ls/e"),o=n("rV+L").positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},aC0R:function(e,t,n){var r=n("jy7A"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},aCzx:function(e,t,n){var r=n("/wvS").Symbol;e.exports=r},aEqC:function(e,t,n){var r=n("FbqI"),i=n("sRgw");e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},aXq5:function(e,t,n){"use strict";function r(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}n.d(t,"a",(function(){return r}))},aYTY:function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&n.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},akX6:function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},"b/GH":function(e,t,n){var r=n("TXW/");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},b1Ea:function(e,t,n){var r=n("Aj6a")(n("Jq22"));e.exports=r},bF6N:function(e,t,n){var r=n("MVHo");e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},bZij:function(e,t,n){var r=n("PIq0"),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=n(u),r(e,this,c)}}},bs3m:function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},btk6:function(e,t,n){var r=n("kt/b"),i=n("1iw3"),o=n("uYOL");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},c7Ww:function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},"cYA/":function(e,t,n){var r=n("LoTP");e.exports=function(e,t){return r(e,t,"pre")}},ceoc:function(e,t,n){var r=n("vkNO")(n("/wvS"),"Map");e.exports=r},ckW0:function(e,t,n){var r;r=function(e){return 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=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return(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})(e)}var i=n(2),o=n(3),a=n(4);function s(e){this.options=o({},i,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,i=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===o.x2&&(o.x2=o.x1+o.w),void 0===o.w&&(o.w=o.x2-o.x1),void 0===o.y2&&(o.y2=o.y1+o.h),void 0===o.h&&(o.h=o.y2-o.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("ranker",e.ranker),s.setGraph(u),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var l=n.nodes(),d=0;d<l.length;d++){var h=l[d],f=h.layoutDimensions(e);s.setNode(h.id(),{width:f.w,height:f.h,name:h.id()})}for(var p=0;p<l.length;p++){var v=l[p];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),y=0;y<g.length;y++){var m=g[y];s.setEdge(m.source().id(),m.target().id(),{minlen:i(m,e.minLen),weight:i(m,e.edgeWeight),name:m.id()},m.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var E=x[w],k=s.node(E);t.getElementById(E).scratch().dagre=k}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},l.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=o,l.layoutPositions(this,e,(function(t){var n=(t="object"===r(t)?t:this).scratch().dagre;return function(t){return e.boundingBox?{x:o.x1+(0===b.w?0:(t.x-b.x1)/b.w)*o.w,y:o.y1+(0===b.h?0:(t.y-b.y1)/b.h)*o.h}:t}({x:n.x,y:n.y})})),this},e.exports=s},function(e,t){e.exports={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}}},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n("0Mpn"))},cu0D:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("wJ0V");function i(e,t,n){return Object(r.a)(e,Object(r.b)(t,n))}},cwoc:function(e,t,n){var r=n("ih+a");e.exports=function(e){var t=0,n=[],i={},o=[];return e.nodes().forEach((function(a){r.has(i,a)||function a(s){var u=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(u.lowlink=Math.min(u.lowlink,i[e].index)):(a(e),u.lowlink=Math.min(u.lowlink,i[e].lowlink))})),u.lowlink===u.index){var c,l=[];do{c=n.pop(),i[c].onStack=!1,l.push(c)}while(s!==c);o.push(l)}}(a)})),o}},cyB8:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("0M5s");function i(e){var t=Object(r.a)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}},"dA+0":function(e,t,n){var r=n("4O6w"),i=n("QPeP"),o=n("GY8p"),a=n("5PFN"),s=n("QPL1"),u=n("1XSk");e.exports=function(e,t,n){var c=-1,l=i,d=e.length,h=!0,f=[],p=f;if(n)h=!1,l=o;else if(d>=200){var v=t?null:s(e);if(v)return u(v);h=!1,l=a,p=new r}else p=t?[]:f;e:for(;++c<d;){var g=e[c],y=t?t(g):g;if(g=n||0!==g?g:0,h&&y==y){for(var m=p.length;m--;)if(p[m]===y)continue e;t&&p.push(y),f.push(g)}else l(p,y,n)||(p!==f&&p.push(y),f.push(g))}return f}},dBa1:function(e,t,n){var r=n("XCkn"),i=n("B0jI"),o=n("5yhz"),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},dOWE:function(e,t,n){var r=n("w9hk"),i=n("wJPF"),o=n("Uc6l"),a=o&&o.isMap,s=a?i(a):r;e.exports=s},"eiA/":function(e,t,n){var r=n("Opi0"),i=n("etTJ");e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,a)}return t}))}},empl:function(e,t,n){var r=n("xJuT"),i=n("UwPs");e.exports=function(e){return r(e,i(e))}},etTJ:function(e,t,n){var r=n("hmyg"),i=n("20jF"),o=n("68Jb"),a=n("XCkn");e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},f2WW:function(e,t,n){var r=n("Xxsa"),i=n("iNcF"),o=n("b/GH"),a=n("qmgT"),s=n("z9/d"),u=n("x14d"),c=n("P/Kr"),l=n("QFSp"),d=n("FBB6"),h=n("KFC0"),f=n("XCkn"),p=n("8Ei6"),v=n("38y5"),g=n("VVrI"),y=n("empl");e.exports=function(e,t,n,m,b,x,w){var E=g(e,n),k=g(t,n),P=w.get(k);if(P)r(e,n,P);else{var j=x?x(E,k,n+"",e,t,w):void 0,C=void 0===j;if(C){var _=c(k),S=!_&&d(k),O=!_&&!S&&v(k);j=k,_||S||O?c(E)?j=E:l(E)?j=a(E):S?(C=!1,j=i(k,!0)):O?(C=!1,j=o(k,!0)):j=[]:p(k)||u(k)?(j=E,u(E)?j=y(E):f(E)&&!h(E)||(j=s(k))):C=!1}C&&(w.set(k,j),b(j,k,m,x,w),w.delete(k)),r(e,n,j)}}},fG1K:function(e,t,n){var r=n("5N3H"),i=n("2v8U"),o=n("nHTl"),a=n("r90I"),s=n("P/Kr");e.exports=function(e,t,n){var u=s(e)?r:a,c=arguments.length<3;return u(e,o(t,4),n,c,i)}},fGml:function(e,t,n){var r=n("2Pt6"),i=n("Ls/e");function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(e){return-e.i})),c=[],l=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(c,u,h),r.forEach(s,(function(e){h+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,d+=e.weight,h=o(c,u,h)}));var f={vs:r.flatten(c,!0)};return d&&(f.barycenter=l/d,f.weight=d),f}},fLsW:function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},fOmH:function(e,t,n){var r=n("2Pt6"),i=n("Ls/e"),o=n("+y+b").Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){n.setNode("layer"+t,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},fQli:function(e,t,n){var r=n("NDho"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},fbik:function(e,t,n){var r=n("XCkn");e.exports=function(e){return e==e&&!r(e)}},fn44:function(e,t){var n="object"==typeof global&&global&&global.Object===Object&&global;e.exports=n},g4JO:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("ks2Z");function i(e){var t=Object(r.a)(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}},g6VN:function(e,t,n){var r=n("aCzx"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(u){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},gAdM:function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},"gO+Z":function(e,t,n){var r=n("xJuT"),i=n("7LQ5");e.exports=function(e,t){return r(e,i(e),t)}},gWu1:function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},gmml:function(e,t,n){"use strict";n.r(t);var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e){return"function"==typeof e}var a=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&new Error,a=e},get useDeprecatedSynchronousErrorHandling(){return a}};function u(e){setTimeout((function(){throw e}),0)}var c={closed:!0,next:function(e){},error:function(e){if(s.useDeprecatedSynchronousErrorHandling)throw e;u(e)},complete:function(){}},l=Array.isArray||function(e){return e&&"number"==typeof e.length};function d(e){return null!==e&&"object"==typeof e}var h=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),f=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this._parentOrParents,r=this._ctorUnsubscribe,i=this._unsubscribe,a=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(var s=0;s<n.length;++s)n[s].remove(this);if(o(i)){r&&(this._unsubscribe=void 0);try{i.call(this)}catch(f){t=f instanceof h?p(f.errors):[f]}}if(l(a)){s=-1;for(var u=a.length;++s<u;){var c=a[s];if(d(c))try{c.unsubscribe()}catch(f){t=t||[],f instanceof h?t=t.concat(p(f.errors)):t.push(f)}}}if(t)throw new h(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof e){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function p(e){return e.reduce((function(e,t){return e.concat(t instanceof h?t.errors:t)}),[])}var v="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),g=function(e){function t(n,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=c;break;case 1:if(!n){o.destination=c;break}if("object"==typeof n){n instanceof t?(o.syncErrorThrowable=n.syncErrorThrowable,o.destination=n,n.add(o)):(o.syncErrorThrowable=!0,o.destination=new y(o,n));break}default:o.syncErrorThrowable=!0,o.destination=new y(o,n,r,i)}return o}return i(t,e),t.prototype[v]=function(){return this},t.create=function(e,n,r){var i=new t(e,n,r);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(f),y=function(e){function t(t,n,r,i){var a,s=e.call(this)||this;s._parentSubscriber=t;var u=s;return o(n)?a=n:n&&(a=n.next,r=n.error,i=n.complete,n!==c&&(o((u=Object.create(n)).unsubscribe)&&s.add(u.unsubscribe.bind(u)),u.unsubscribe=s.unsubscribe.bind(s))),s._context=u,s._next=a,s._error=r,s._complete=i,s}return i(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=s.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):u(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;u(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw n;u(n)}},t.prototype.__tryOrSetError=function(e,t,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(r){return s.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(u(r),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(g),m="function"==typeof Symbol&&Symbol.observable||"@@observable";function b(e){return e}function x(e){return 0===e.length?b:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var w=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,i=function(e,t,n){if(e){if(e instanceof g)return e;if(e[v])return e[v]()}return e||t||n?new g(e,t,n):new g(c)}(e,t,n);if(i.add(r?r.call(i,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),s.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e.destination;if(e.closed||e.isStopped)return!1;e=t&&t instanceof g?t:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=E(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(n){r(n),i&&i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[m]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:x(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=E(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function E(e){if(e||(e=s.Promise||Promise),!e)throw new Error("no Promise impl found");return e}function k(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new P(e,t))}}var P=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new j(e,this.project,this.thisArg))},e}(),j=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(g);function C(e,t,n,r){return o(n)&&(r=n,n=void 0),r?C(e,t,n).pipe(k((function(e){return l(e)?r.apply(void 0,e):r(e)}))):new w((function(r){!function e(t,n,r,i,o){var a;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var s=t;t.addEventListener(n,r,o),a=function(){return s.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var u=t;t.on(n,r),a=function(){return u.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var c=t;t.addListener(n,r),a=function(){return c.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var l=0,d=t.length;l<d;l++)e(t[l],n,r,i,o)}i.add(a)}(e,t,(function(e){r.next(arguments.length>1?Array.prototype.slice.call(arguments):e)}),r,n)}))}var _=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),S=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return i(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(f),O=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return i(t,e),t}(g),D=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype[v]=function(){return new O(this)},t.prototype.lift=function(e){var t=new T(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new _;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new _;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new _;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new _;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new _;return this.hasError?(e.error(this.thrownError),f.EMPTY):this.isStopped?(e.complete(),f.EMPTY):(this.observers.push(e),new S(this,e))},t.prototype.asObservable=function(){var e=new w;return e.source=this,e},t.create=function(e,t){return new T(e,t)},t}(w),T=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return i(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):f.EMPTY},t}(D);function B(e){return e&&"function"==typeof e.schedule}var M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(g),N=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(g),I=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}},A="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator",L=function(e){if(e&&"function"==typeof e[m])return r=e,function(e){var t=r[m]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if(function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}(e))return I(e);if(function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}(e))return n=e,function(e){return n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,u),e};if(e&&"function"==typeof e[A])return t=e,function(e){for(var n=t[A]();;){var r=void 0;try{r=n.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof n.return&&e.add((function(){n.return&&n.return()})),e};var t,n,r,i=d(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function z(e,t,n,r,i){if(void 0===i&&(i=new N(e,n,r)),!i.closed)return t instanceof w?t.subscribe(i):L(t)(i)}function R(e,t){return new w((function(n){var r=new f,i=0;return r.add(t.schedule((function(){i!==e.length?(n.next(e[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function F(e,t){return t?R(e,t):new w(I(e))}var V={};function q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0,r=void 0;return B(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&l(e[0])&&(e=e[0]),F(e,r).lift(new X(n))}var X=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new Y(e,this.resultSelector))},e}(),Y=function(e){function t(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return i(t,e),t.prototype._next=function(e){this.values.push(V),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++)this.add(z(this,e[n],void 0,n))}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n){var r=this.values,i=this.toRespond?r[n]===V?--this.toRespond:this.toRespond:0;r[n]=t,0===i&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(M);function W(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return B(n)?(e.pop(),R(e,n)):F(e)}var H=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,n}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(g),G=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(g);function U(e,t){if(!t.closed){if(e instanceof w)return e.subscribe(t);var n;try{n=L(e)(t)}catch(r){t.error(r)}return n}}var K=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new Z(e,this.project,this.concurrent))},e}(),Z=function(e){function t(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new H(this),n=this.destination;n.add(t);var r=U(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(G);function $(){return void 0===(e=1)&&(e=Number.POSITIVE_INFINITY),function e(t,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof n?function(i){return i.pipe(e((function(e,r){return(i=t(e,r),i instanceof w?i:new w(L(i))).pipe(k((function(t,i){return n(e,t,r,i)})));var i}),r))}:("number"==typeof n&&(r=n),function(e){return e.lift(new K(t,r))})}(b,e);var e}function Q(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $()(W.apply(void 0,e))}function J(e){return function(t){return t.lift(new ee(e))}}var ee=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new te(e),r=U(this.notifier,new H(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),te=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return i(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(G);function ne(e){Array.from(e.children).forEach(t=>e.removeChild(t))}function re(e){return e.replace(/\/$/,"")}function ie(e,t){const n=re(e).split("/");return n[0]===re(t)&&n.shift(),n.pop(),n}class oe{set renderTime(e){this.renderReportElement.innerText=`Last render took ${e.renderTime} milliseconds for ${e.numNodes} nodes and ${e.numEdges} edges.`}constructor(e,t){this.container=e,this.projectGraphs=t,this.selectProjectSubject=new D,this.selectProject$=this.selectProjectSubject.asObservable(),this.renderReportElement=void 0,this.render()}render(){ne(this.container);const e=document.createElement("h4");e.innerText="Debugger";const t=document.createElement("select");this.projectGraphs.forEach(e=>{const n=document.createElement("option");n.value=e.id,n.innerText=e.label,t.appendChild(n)}),t.value=window.selectedProjectGraph,t.dataset.cy="project-select",t.onchange=e=>this.selectProjectSubject.next(e.currentTarget.value),this.renderReportElement=document.createElement("p"),this.container.appendChild(e),this.container.appendChild(t),this.container.appendChild(this.renderReportElement)}}var ae=n("ljyG"),se=n("ckW0"),ue=n.n(se),ce=n("Jz0R"),le=n.n(ce);class de{constructor(e){this.node=e}render(){const e=document.createElement("div"),t=this.createHeader(),n=this.createTags(),r=this.createButtons();return e.appendChild(t),e.appendChild(n),e.appendChild(r),e}createHeader(){const e=document.createElement("h4"),t=document.createElement("span"),n=document.createTextNode(this.node.attr("id"));return t.classList.add("tag"),t.innerText=this.node.attr("type"),e.appendChild(t),e.appendChild(n),e}createTags(){var e,t;const n=document.createElement("p"),r=document.createElement("strong"),i=document.createTextNode(null!=(e=null==(t=this.node.attr("tags"))?void 0:t.join(", "))?e:"");return r.innerText="tags",n.appendChild(r),n.appendChild(document.createElement("br")),n.appendChild(i),n}createButtons(){const e=document.createElement("div"),t=document.createElement("button"),n=document.createElement("button");return e.classList.add("flex"),t.addEventListener("click",()=>window.focusProject(this.node.attr("id"))),t.innerText="Focus",n.addEventListener("click",()=>{window.excludeProject(this.node.attr("id"))}),n.innerText="Exclude",e.appendChild(t),e.appendChild(n),e}}let he;!function(e){e.blue="#48c4e5",e.lightBlue="#96d8e9",e.gray="#333333",e.navy="#143055",e.twilight="#086c9f",e.black="#231f20",e.red="#f85477",e.white="#fff"}(he||(he={}));const fe=[{selector:"edge",style:{width:"1px","line-color":he.black,"curve-style":"straight","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":he.black}},{selector:"edge.affected",style:{"line-color":he.red,"target-arrow-color":he.red}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","edge-text-rotation":"autorotate"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed"}}],pe=[{selector:"node",style:{"font-size":"32px","font-family":'"Helvetica Neue", sans-serif',"border-style":"solid","border-color":he.black,"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",label:"data(id)",width:"label",backgroundColor:he.white}},{selector:'node[type="app"]',style:{shape:"rectangle"}},{selector:'node[type="lib"]',style:{shape:"ellipse"}},{selector:'node[type="e2e"]',style:{shape:"rectangle"}},{selector:"node.focused",style:{color:he.twilight,"border-color":he.twilight}},{selector:"node.affected",style:{"border-color":he.red}},{selector:":parent",style:{"background-opacity":.5,"background-color":he.twilight,"border-color":he.black,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}}];class ve{constructor(e){this.dep=e,this.affected=!1}getCytosacpeNodeDef(){var e;let t;return t={group:"edges",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target}},t.classes=null!=(e=this.dep.type)?e:"",this.affected&&(t.classes+=" affected"),t}}class ge{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label},selectable:!1,grabbable:!1,pannable:!0}}}class ye{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null}}getClasses(){var e;let t=null!=(e=this.project.type)?e:"";return this.focused&&(t+=" focused"),this.affected&&(t+=" affected"),t}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){return this.project.data.root?ie(this.project.data.root,this.workspaceRoot).map((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:"dir-"+r,parentId:t>0?"dir-"+[...n].slice(0,t).join("/"):null}}):[]}}class me{constructor(e){this.tooltipService=e,this.graph=void 0,this.openTooltip=null,this.affectedProjects=void 0,this.projectGraph=void 0,this.renderTimesSubject=new D,this.renderTimes$=this.renderTimesSubject.asObservable(),ae.use(ue.a),ae.use(le.a)}render(e,t){const n=Date.now();this.tooltipService.hideAll(),this.generateCytoscapeLayout(e,t),this.listenForProjectNodeClicks();const r={renderTime:Date.now()-n,numNodes:this.graph.nodes().length,numEdges:this.graph.edges().length};this.renderTimesSubject.next(r)}generateCytoscapeLayout(e,t){const n=this.createElements(e,t);this.graph=ae({container:document.getElementById("graph-container"),elements:[...n],layout:{name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,edgeSep:50,ranker:"network-simplex"},boxSelectionEnabled:!1,style:[...pe,...fe]}),this.graph.on("zoom",()=>{this.openTooltip&&(this.openTooltip.hide(),this.openTooltip=null)})}createElements(e,t){let n=[];const r=e.map(e=>e.name),i=[],o=[],a={};e.forEach(e=>{const n="app"===e.type||"e2e"===e.type?window.workspaceLayout.appsDir:window.workspaceLayout.libsDir,s=new ye(e,n);s.focused=e.name===window.focusedProject,s.affected=this.affectedProjects.includes(e.name),i.push(s),this.projectGraph.dependencies[e.name].forEach(e=>{if(r.includes(e.target)){const t=new ve(e);t.affected=this.affectedProjects.includes(e.source)&&this.affectedProjects.includes(e.target),o.push(t)}}),t&&s.getAncestors().forEach(e=>a[e.id]=e)});const s=i.map(e=>e.getCytoscapeNodeDef(t)),u=o.map(e=>e.getCytosacpeNodeDef());return n=s.concat(u),t&&(n=Object.keys(a).map(e=>new ge(a[e]).getCytoscapeNodeDef()).concat(n)),n}listenForProjectNodeClicks(){this.graph.$("node:childless").on("click",e=>{const t=e.target;let n=t.popperRef();const r=new de(t).render();this.openTooltip=this.tooltipService.open(n,r)})}}const be={showDebugger:!1,projectGraphs:[],defaultProjectGraph:null,projectGraphService:null};var xe=n("Jcpa"),we=n("CcQI"),Ee={passive:!0,capture:!0};function ke(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function je(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Ce(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function _e(e){return[].concat(e)}function Se(e,t){-1===e.indexOf(t)&&e.push(t)}function Oe(e){return[].slice.call(e)}function De(){return document.createElement("div")}function Te(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function Be(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Me(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Ne(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Ie(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Ae={isTouch:!1},Le=0;function ze(){Ae.isTouch||(Ae.isTouch=!0,window.performance&&document.addEventListener("mousemove",Re))}function Re(){var e=performance.now();e-Le<20&&(Ae.isTouch=!1,document.removeEventListener("mousemove",Re)),Le=e}function Fe(){var e=document.activeElement;Be(e)&&e.blur&&!e._tippy.state.isVisible&&e.blur()}var Ve="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",qe=/MSIE |Trident\//.test(Ve),Xe=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Ye=Object.keys(Xe);function We(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name;return r&&(t[r]=void 0!==e[r]?e[r]:n.defaultValue),t}),{});return Object.assign({},e,{},t)}function He(e,t){var n=Object.assign({},t,{content:je(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(We(Object.assign({},Xe,{plugins:t}))):Ye).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(i){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Xe.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function Ge(e,t){e.innerHTML=t}function Ue(e){var t=De();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",Te(e)?t.appendChild(e):Ge(t,e)),t}function Ke(e,t){Te(t.content)?(Ge(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Ge(e,t.content):e.textContent=t.content)}function Ze(e){var t=e.firstElementChild,n=Oe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function $e(e){var t=De(),n=De();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=De();function i(n,r){var i=Ze(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ke(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(Ue(r.arrow))):o.appendChild(Ue(r.arrow)):s&&o.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),Ke(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}$e.$$tippy=!0;var Qe=1,Je=[],et=[];function tt(e,t){void 0===t&&(t={});var n=Xe.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",ze,Ee),window.addEventListener("blur",Fe);var r=Object.assign({},t,{plugins:n}),i=function(e){return Te(e)?[e]:function(e){return Pe(e,"NodeList")}(e)?Oe(e):Array.isArray(e)?e:Oe(document.querySelectorAll(e))}(e).reduce((function(e,t){var n=t&&function(e,t){var n,r,i,o,a,s,u,c,l,d=He(e,Object.assign({},Xe,{},We((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),h=!1,f=!1,p=!1,v=!1,g=[],y=Ce(U,d.interactiveDebounce),m=Qe++,b=(l=d.plugins).filter((function(e,t){return l.indexOf(e)===t})),x={id:m,reference:e,popper:De(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){if(!x.state.isDestroyed){N("onBeforeUpdate",[x,t]),H();var n=x.props,r=He(e,Object.assign({},x.props,{},t,{ignoreAttributes:!0}));x.props=r,W(),n.interactiveDebounce!==r.interactiveDebounce&&(L(),y=Ce(U,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?_e(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),A(),M(),k&&k(n,r),x.popperInstance&&(Q(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),N("onAfterUpdate",[x,t])}},setContent:function(e){x.setProps({content:e})},show:function(){var e=x.state.isVisible,t=x.state.isDestroyed,n=!x.state.isEnabled,r=Ae.isTouch&&!x.props.touch,i=ke(x.props.duration,0,Xe.duration);if(!(e||t||n||r||O().hasAttribute("disabled")||(N("onShow",[x],!1),!1===x.props.onShow(x)))){if(x.state.isVisible=!0,S()&&(E.style.visibility="visible"),M(),V(),x.state.isMounted||(E.style.transition="none"),S()){var o=T();Me([o.box,o.content],0)}u=function(){var e;if(x.state.isVisible&&!v){if(v=!0,E.style.transition=x.props.moveTransition,S()&&x.props.animation){var t=T(),n=t.box,r=t.content;Me([n,r],i),Ne([n,r],"visible")}I(),A(),Se(et,x),null==(e=x.popperInstance)||e.forceUpdate(),x.state.isMounted=!0,N("onMount",[x]),x.props.animation&&S()&&function(e,t){X(e,(function(){x.state.isShown=!0,N("onShown",[x])}))}(i)}},function(){var e,t=x.props.appendTo,n=O();(e=x.props.interactive&&t===Xe.appendTo||"parent"===t?n.parentNode:je(t,[n])).contains(E)||e.appendChild(E),Q()}()}},hide:function(){var e=!x.state.isVisible,t=x.state.isDestroyed,n=!x.state.isEnabled,r=ke(x.props.duration,1,Xe.duration);if(!(e||t||n)&&(N("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,v=!1,h=!1,S()&&(E.style.visibility="hidden"),L(),q(),M(),S()){var i=T(),o=i.box,a=i.content;x.props.animation&&(Me([o,a],r),Ne([o,a],"hidden"))}I(),A(),x.props.animation?S()&&function(e,t){X(e,(function(){!x.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(r,x.unmount):x.unmount()}},hideWithInteractivity:function(e){D().addEventListener("mousemove",y),Se(Je,y),y(e)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(J(),ee().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E),et=et.filter((function(e){return e!==x})),x.state.isMounted=!1,N("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),H(),delete e._tippy,x.state.isDestroyed=!0,N("onDestroy",[x]))}};if(!d.render)return x;var w=d.render(x),E=w.popper,k=w.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+x.id,x.popper=E,e._tippy=x,E._tippy=x;var P=b.map((function(e){return e.fn(x)})),j=e.hasAttribute("aria-expanded");return W(),A(),M(),N("onCreate",[x]),d.showOnCreate&&te(),E.addEventListener("mouseenter",(function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(e){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(D().addEventListener("mousemove",y),y(e))})),x;function C(){var e=x.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===C()[0]}function S(){var e;return!!(null==(e=x.props.render)?void 0:e.$$tippy)}function O(){return c||e}function D(){var e=O().parentNode;return e?function(e){var t,n=_e(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}(e):document}function T(){return Ze(E)}function B(e){return x.state.isMounted&&!x.state.isVisible||Ae.isTouch||a&&"focus"===a.type?0:ke(x.props.delay,e?0:1,Xe.delay)}function M(){E.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",E.style.zIndex=""+x.props.zIndex}function N(e,t,n){var r;void 0===n&&(n=!0),P.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n&&(r=x.props)[e].apply(r,t)}function I(){var t=x.props.aria;if(t.content){var n="aria-"+t.content,r=E.id;_e(x.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(x.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function A(){!j&&x.props.aria.expanded&&_e(x.props.triggerTarget||e).forEach((function(e){x.props.interactive?e.setAttribute("aria-expanded",x.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function L(){D().removeEventListener("mousemove",y),Je=Je.filter((function(e){return e!==y}))}function z(e){if(!(Ae.isTouch&&(p||"mousedown"===e.type)||x.props.interactive&&E.contains(e.target))){if(O().contains(e.target)){if(Ae.isTouch)return;if(x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[x,e]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),f=!0,setTimeout((function(){f=!1})),x.state.isMounted||q())}}function R(){p=!0}function F(){p=!1}function V(){var e=D();e.addEventListener("mousedown",z,!0),e.addEventListener("touchend",z,Ee),e.addEventListener("touchstart",F,Ee),e.addEventListener("touchmove",R,Ee)}function q(){var e=D();e.removeEventListener("mousedown",z,!0),e.removeEventListener("touchend",z,Ee),e.removeEventListener("touchstart",F,Ee),e.removeEventListener("touchmove",R,Ee)}function X(e,t){var n=T().box;function r(e){e.target===n&&(Ie(n,"remove",r),t())}if(0===e)return t();Ie(n,"remove",s),Ie(n,"add",r),s=r}function Y(t,n,r){void 0===r&&(r=!1),_e(x.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),g.push({node:e,eventType:t,handler:n,options:r})}))}function W(){var e;_()&&(Y("touchstart",G,{passive:!0}),Y("touchend",K,{passive:!0})),(e=x.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(Y(e,G),e){case"mouseenter":Y("mouseleave",K);break;case"focus":Y(qe?"focusout":"blur",Z);break;case"focusin":Y("focusout",Z)}}))}function H(){g.forEach((function(e){e.node.removeEventListener(e.eventType,e.handler,e.options)})),g=[]}function G(e){var t,n=!1;if(x.state.isEnabled&&!$(e)&&!f){var r="focus"===(null==(t=a)?void 0:t.type);a=e,c=e.currentTarget,A(),!x.state.isVisible&&function(e){return Pe(e,"MouseEvent")}(e)&&Je.forEach((function(t){return t(e)})),"click"===e.type&&(x.props.trigger.indexOf("mouseenter")<0||h)&&!1!==x.props.hideOnClick&&x.state.isVisible?n=!0:te(e),"click"===e.type&&(h=!n),n&&!r&&ne(e)}}function U(e){var t=e.target,n=O().contains(t)||E.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=function(e){return e.split("-")[0]}(i.placement),s=i.modifiersData.offset;return!s||t.top-r+("bottom"===a?s.top.y:0)>o||r-t.bottom-("top"===a?s.bottom.y:0)>o||t.left-n+("right"===a?s.left.x:0)>o||n-t.right-("left"===a?s.right.x:0)>o}))}(ee().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(L(),ne(e))}function K(e){$(e)||x.props.trigger.indexOf("click")>=0&&h||(x.props.interactive?x.hideWithInteractivity(e):ne(e))}function Z(e){x.props.trigger.indexOf("focusin")<0&&e.target!==O()||x.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||ne(e)}function $(e){return!!Ae.isTouch&&_()!==e.type.indexOf("touch")>=0}function Q(){J();var t=x.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=S()?Ze(E).arrow:null,c=o?{getBoundingClientRect:o,contextElement:o.contextElement||O()}:e,l=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(S()){var n=T().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];S()&&s&&l.push({name:"arrow",options:{element:s,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),x.popperInstance=Object(xe.a)(c,E,Object.assign({},n,{placement:r,onFirstUpdate:u,modifiers:l}))}function J(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return Oe(E.querySelectorAll("[data-tippy-root]"))}function te(e){x.clearDelayTimeouts(),e&&N("onTrigger",[x,e]),V();var t=B(!0),n=C(),i=n[1];Ae.isTouch&&"hold"===n[0]&&i&&(t=i),t?r=setTimeout((function(){x.show()}),t):x.show()}function ne(e){if(x.clearDelayTimeouts(),N("onUntrigger",[x,e]),x.state.isVisible){if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&h)){var t=B(!1);t?i=setTimeout((function(){x.state.isVisible&&x.hide()}),t):o=requestAnimationFrame((function(){x.hide()}))}}else q()}}(t,r);return n&&e.push(n),e}),[]);return Te(e)?i[0]:i}tt.defaultProps=Xe,tt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Xe[t]=e[t]}))},tt.currentInput=Ae,Object.assign({},we.a,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),tt.setDefaultProps({render:$e});var nt=tt;class rt{open(e,t){let n=nt(document.createElement("div"),{trigger:"manual",theme:"nx",interactive:!0,appendTo:document.body,content:t,getReferenceClientRect:e.getBoundingClientRect});return n.show(),n}hideAll(){var e,t,n;t=(e={}).exclude,n=e.duration,et.forEach((function(e){var r=!1;if(t&&(r=Be(t)?e.reference===t:e.popper===t.popper),!r){var i=e.props.duration;e.setProps({duration:n}),e.hide(),e.state.isDestroyed||e.setProps({duration:i})}}))}}var it=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new _;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(D),ot=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new at(e,this.compare,this.keySelector))},e}(),at=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(i){return this.destination.error(i)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(i){return this.destination.error(i)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(g),st=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new ut(e,this.observables,this.project))},e}(),ut=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.length;i.values=new Array(o);for(var a=0;a<o;a++)i.toRespond.push(a);for(a=0;a<o;a++)i.add(z(i,n[a],void 0,a));return i}return i(t,e),t.prototype.notifyNext=function(e,t,n){this.values[n]=t;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(M);class ct{constructor(e=!1,t=!1){this.showAffected=!1,this.groupByFolder=!1,this.selectAffectedSubject=new D,this.selectAllSubject=new D,this.deselectAllSubject=new D,this.groupByFolderSubject=new D,this.searchByDepthSubject=new it(1),this.searchByDepthEnabledSubject=new it(!1),this.searchDepthChangesSubject=new D,this.selectAffected$=this.selectAffectedSubject.asObservable(),this.selectAll$=this.selectAllSubject.asObservable(),this.deselectAll$=this.deselectAllSubject.asObservable(),this.groupByFolder$=this.groupByFolderSubject.asObservable(),this.searchDepth$=q([this.searchByDepthSubject,this.searchByDepthEnabledSubject]).pipe(k(([e,t])=>t?e:-1),(function(e){return e.lift(new ot(void 0,void 0))})),this.searchDepthDisplay=void 0,this.showAffected=e,this.groupByFolder=t,this.searchDepthChangesSubject.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new st(e,n))}}(this.searchByDepthSubject)).subscribe(([e,t])=>{"decrement"===e&&t>1?this.searchByDepthSubject.next(t-1):"increment"===e&&this.searchByDepthSubject.next(t+1)}),this.searchByDepthSubject.subscribe(e=>{this.searchDepthDisplay&&(this.searchDepthDisplay.innerText=e.toString())})}render(e){ne(e);const t=document.createElement("h4");t.innerText="Display Options";const n=document.createElement("div");if(n.classList.add("flex"),this.showAffected){const e=document.createElement("button");e.innerText="Select Affected",e.addEventListener("click",()=>this.selectAffectedSubject.next()),n.appendChild(e)}const r=document.createElement("button");r.innerText="Select All",r.dataset.cy="selectAllButton",r.addEventListener("click",()=>this.selectAllSubject.next()),n.appendChild(r);const i=document.createElement("button");i.innerText="Deselect All",i.dataset.cy="deselectAllButton",i.addEventListener("click",()=>this.deselectAllSubject.next()),n.appendChild(i);const o=document.createElement("label"),a=document.createElement("input");a.type="checkbox",a.name="displayOptions",a.value="groupByFolder",a.checked=this.groupByFolder,a.addEventListener("change",e=>this.groupByFolderSubject.next(e.target.checked)),o.appendChild(a),o.appendChild(document.createTextNode("group by folder"));const s=document.createElement("label");s.appendChild(document.createTextNode("Search Depth")),this.searchDepthDisplay=document.createElement("span"),this.searchDepthDisplay.innerText="1",this.searchDepthDisplay.classList.add("search-depth");const u=document.createElement("button");u.appendChild(document.createTextNode("+"));const c=document.createElement("button");c.appendChild(document.createTextNode("-")),u.addEventListener("click",()=>{this.searchDepthChangesSubject.next("increment")}),c.addEventListener("click",()=>{this.searchDepthChangesSubject.next("decrement")});const l=document.createElement("label"),d=document.createElement("input");d.type="checkbox",d.name="displayOptions",d.value="groupByFolder",d.checked=this.groupByFolder,d.addEventListener("change",e=>this.searchByDepthEnabledSubject.next(e.target.checked)),l.appendChild(d),l.appendChild(document.createTextNode("enabled")),e.appendChild(t),e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(c),e.appendChild(this.searchDepthDisplay),e.appendChild(u),e.appendChild(l)}}class lt{set projectName(e){this.render(e)}constructor(e){this.container=e,this.unfocusSubject=new D,this.unfocus$=this.unfocusSubject.asObservable(),this.render()}unfocusProject(){this.render()}render(e){ne(this.container);const t=document.createElement("h4");this.container.appendChild(t),e&&""!==e?(t.innerText="Focused on "+e,this.container.hidden=!1):this.container.hidden=!0;const n=document.createElement("button");n.innerText="Unfocus",n.dataset.cy="unfocusButton",n.addEventListener("click",()=>this.unfocusSubject.next()),this.container.appendChild(n)}}class dt{set projects(e){this._projects=e;const t=Object.values(this.checkboxes).filter(e=>e.checked).map(e=>e.value);this.render(),this.selectProjects(t)}get projects(){return this._projects}constructor(e){this.container=e,this.focusProjectSubject=new D,this.checkedProjectsChangeSubject=new D,this.checkboxes={},this.checkedProjectsChange$=this.checkedProjectsChangeSubject.asObservable(),this.focusProject$=this.focusProjectSubject.asObservable(),this._projects=[],this.render()}selectProjects(e){e.forEach(e=>{this.checkboxes[e]&&(this.checkboxes[e].checked=!0)}),this.emitChanges()}setCheckedProjects(e){Object.keys(this.checkboxes).forEach(t=>{this.checkboxes[t].checked=e.includes(t)})}checkAllProjects(){Object.values(this.checkboxes).forEach(e=>e.checked=!0)}uncheckAllProjects(){Object.values(this.checkboxes).forEach(e=>{e.checked=!1})}uncheckProject(e){this.checkboxes[e].checked=!1}emitChanges(){const e=Object.values(this.checkboxes).filter(e=>e.checked).map(e=>e.value);this.checkedProjectsChangeSubject.next(e)}render(){ne(this.container);const e=this.getProjectsByType("app"),t=this.getProjectsByType("lib"),n=this.getProjectsByType("e2e"),r=this.groupProjectsByDirectory(e),i=this.groupProjectsByDirectory(t),o=this.groupProjectsByDirectory(n),a=Object.keys(r).sort(),s=Object.keys(i).sort(),u=Object.keys(o).sort(),c=document.createElement("h4");c.textContent="app projects",this.container.append(c),a.forEach(e=>{this.createProjectList(e,r[e])});const l=document.createElement("h4");l.textContent="e2e projects",this.container.append(l),u.forEach(e=>{this.createProjectList(e,o[e])});const d=document.createElement("h4");d.textContent="lib projects",this.container.append(d),s.forEach(e=>{this.createProjectList(e,i[e])})}getProjectsByType(e){return this.projects.filter(t=>t.type===e).sort((e,t)=>e.name.localeCompare(t.name))}groupProjectsByDirectory(e){let t={};return e.forEach(e=>{const n="app"===e.type||"e2e"===e.type?window.workspaceLayout.appsDir:window.workspaceLayout.libsDir,r=ie(e.data.root,n).join("/");t.hasOwnProperty(r)||(t[r]=[]),t[r].push(e)}),t}createProjectList(e,t){const n=document.createElement("h5");n.textContent=e;const r=document.createElement("div");r.className="form-group",[...t].sort((e,t)=>e.name.localeCompare(t.name)),t.forEach(e=>{let t=document.createElement("div");t.className="form-line";let n=document.createElement("button");n.className="icon";let i=document.createElementNS("http://www.w3.org/2000/svg","svg"),o=document.createElementNS("http://www.w3.org/2000/svg","use");o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#crosshair"),i.appendChild(o),n.append(i),n.onclick=()=>{this.focusProjectSubject.next(e.name)};let a=document.createElement("label");a.className="form-checkbox";let s=document.createElement("input");s.type="checkbox",s.name="projectName",s.value=e.name,s.checked=!1,s.addEventListener("change",()=>this.emitChanges()),this.checkboxes[e.name]=s;const u=document.createTextNode(e.name);t.append(n),t.append(a),a.append(s),a.append(u),r.append(t)}),this.container.append(n),this.container.append(r)}}class ht{constructor(e){this.container=e,this.textInput=void 0,this.includeInPathCheckbox=void 0,this.changesSubject=new D,this.changes$=this.changesSubject.asObservable(),this.render()}emitChanges(){this.changesSubject.next({text:this.textInput.value.toLowerCase(),includeInPath:this.includeInPathCheckbox.checked})}render(){ne(this.container);const e=document.createElement("div");e.classList.add("flex");const t=document.createElement("label");t.appendChild(document.createTextNode("Text Filter")),this.textInput=document.createElement("input"),this.textInput.type="text",this.textInput.name="filter",this.textInput.dataset.cy="textFilterInput",this.textInput.addEventListener("keyup",e=>{"Enter"===e.key&&this.emitChanges()}),this.textInput.style.flex="1",this.textInput.style.marginRight="1.5em";const n=document.createElement("button");n.innerText="Filter",n.dataset.cy="textFilterButton",n.style.flex="none",n.addEventListener("click",()=>{this.emitChanges()}),e.appendChild(this.textInput),e.appendChild(n);const r=document.createElement("label");this.includeInPathCheckbox=document.createElement("input"),this.includeInPathCheckbox.type="checkbox",this.includeInPathCheckbox.name="textFilterCheckbox",this.includeInPathCheckbox.value="includeInPath",r.appendChild(this.includeInPathCheckbox),r.appendChild(document.createTextNode("include projects in path")),this.container.appendChild(t),this.container.appendChild(e),this.container.appendChild(r)}}class ft{set projects(e){this.projectList.projects=e,this.focusedProjectPanel.unfocusProject(),this.unfocusProject()}constructor(e){this.affectedProjects=e,this.selectedProjectsChangedSubject=new it([]),this.groupByFolderChangedSubject=new it(window.groupByFolder),this.focusProjectSubject=new D,this.filterByTextSubject=new D,this.selectedProjectsChanged$=this.selectedProjectsChangedSubject.asObservable(),this.groupByFolderChanged$=this.groupByFolderChangedSubject.asObservable(),this.displayOptionsPanel=void 0,this.focusedProjectPanel=void 0,this.textFilterPanel=void 0,this.projectList=void 0,this.groupByFolder=window.groupByFolder,this.selectedProjects=[];const t=this.affectedProjects.length>0,n=document.getElementById("display-options-panel");this.displayOptionsPanel=new ct(t,this.groupByFolder),this.displayOptionsPanel.render(n);const r=document.getElementById("focused-project");this.focusedProjectPanel=new lt(r);const i=document.getElementById("text-filter-panel");this.textFilterPanel=new ht(i);const o=document.getElementById("project-lists");this.projectList=new dt(o),this.projectList.projects=window.projects,t&&this.selectAffectedProjects(),window.focusProject=e=>{this.focusProjectSubject.next(e)},window.excludeProject=e=>{this.excludeProject(e)},this.listenForDOMEvents(),null!==window.focusedProject&&this.focusProject(window.focusedProject),window.exclude.length>0&&window.exclude.forEach(e=>this.excludeProject(e))}selectProjects(e){this.projectList.selectProjects(e)}resetSidebarVisibility(){const e=document.getElementById("sidebar");e.classList.contains("hidden")&&(e.classList.remove("hidden"),e.style.marginLeft="0px")}listenForDOMEvents(){const e=document.getElementById("sidebar"),t=document.getElementById("sidebar-toggle-button");t.style.left=e.clientWidth-1+"px",new ResizeObserver(e=>{e.forEach(e=>{t.style.left=e.contentRect.width-1+"px"})}).observe(e),C(t,"click").subscribe(t=>{e.classList.toggle("hidden"),e.style.marginLeft=e.classList.contains("hidden")?`-${e.clientWidth+1}px`:"0px"}),this.displayOptionsPanel.selectAll$.subscribe(()=>{this.selectAllProjects()}),this.displayOptionsPanel.deselectAll$.subscribe(()=>{this.deselectAllProjects()}),this.displayOptionsPanel.selectAffected$.subscribe(()=>{this.selectAffectedProjects()}),this.displayOptionsPanel.groupByFolder$.subscribe(e=>{this.groupByFolderChangedSubject.next(e)}),this.focusedProjectPanel.unfocus$.subscribe(()=>{this.unfocusProject()}),this.textFilterPanel.changes$.subscribe(e=>{this.filterByTextSubject.next(e)}),q([this.filterByTextSubject,this.displayOptionsPanel.searchDepth$]).subscribe(([e,t])=>{e.text&&this.filterProjectsByText(e.text,e.includeInPath,t)}),this.projectList.checkedProjectsChange$.subscribe(e=>{this.emitSelectedProjects(e)}),this.projectList.focusProject$.subscribe(e=>{this.focusProjectSubject.next(e)}),q([this.focusProjectSubject,this.displayOptionsPanel.searchDepth$]).subscribe(([e,t])=>{e&&this.focusProject(e,t)})}setFocusedProject(e=null){window.focusedProject=e,this.focusedProjectPanel.projectName=e?window.graph.nodes[e].name:null}selectAffectedProjects(){this.setFocusedProject(null),this.projectList.setCheckedProjects(this.affectedProjects),this.emitSelectedProjects(this.affectedProjects)}selectAllProjects(){this.setFocusedProject(null),this.projectList.checkAllProjects(),this.emitSelectedProjects(window.projects.map(e=>e.name))}deselectAllProjects(){this.setFocusedProject(null),this.projectList.uncheckAllProjects(),this.emitSelectedProjects([])}focusProject(e,t=-1){this.filterByTextSubject.next({text:null,includeInPath:!1}),this.setFocusedProject(e);const n=window.projects.map(e=>e.name).filter(n=>this.hasPath(e,n,[],1,t)||this.hasPath(n,e,[],1,t));this.projectList.setCheckedProjects(n),this.emitSelectedProjects(n)}unfocusProject(){this.focusProjectSubject.next(null),this.setFocusedProject(null),this.projectList.uncheckAllProjects(),this.emitSelectedProjects([])}excludeProject(e){const t=[...this.selectedProjects];t.splice(this.selectedProjects.indexOf(e),1),this.projectList.uncheckProject(e),this.emitSelectedProjects(t)}emitSelectedProjects(e){this.selectedProjects=e,this.selectedProjectsChangedSubject.next(e)}filterProjectsByText(e,t,n){this.focusProjectSubject.next(null),this.setFocusedProject(null),this.projectList.uncheckAllProjects();const r=e.split(",").map(e=>e.trim()),i=new Set;window.projects.map(e=>e.name).forEach(e=>{r.findIndex(t=>e.includes(t))>-1&&(i.add(e),t&&window.projects.map(e=>e.name).forEach(t=>{(this.hasPath(e,t,[],1,n)||this.hasPath(t,e,[],1,n))&&i.add(t)}))});const o=Array.from(i);this.projectList.setCheckedProjects(o),this.emitSelectedProjects(o)}hasPath(e,t,n,r,i=-1){if(e===t)return!0;if(-1===i||r<=i)for(let o of window.graph.dependencies[t]||[])if(!(n.indexOf(o.target)>-1)&&(n.push(o.target),this.hasPath(e,o.target,n,r+1,i)))return!0;return!1}}class pt{constructor(e=be){this.config=e,this.sidebar=void 0,this.tooltipService=new rt,this.graph=new me(this.tooltipService),this.debuggerPanel=void 0,this.windowResize$=C(window,"resize").pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return B(n)?(e.pop(),function(t){return Q(e,t,n)}):function(t){return Q(e,t)}}({})),this.render$=new D,this.render$.subscribe(e=>this.render(e)),this.loadProjectGraph(e.defaultProjectGraph),!0===window.watch&&setInterval(()=>this.loadProjectGraph(e.defaultProjectGraph),5e3)}async loadProjectGraph(e){const t=this.config.projectGraphs.find(t=>t.id===e),n=await this.config.projectGraphService.getProjectGraph(t.url),r=null==n?void 0:n.layout,i=Object.values(n.projects).filter(e=>"npm"!==e.type).reduce((e,t)=>(e[t.name]=t,e),{}),o=n.changes.added.filter(e=>!window.graph.nodes[e]);window.projects=n.projects,window.graph={dependencies:n.dependencies,nodes:i},window.focusedProject=null,window.projectGraphList=this.config.projectGraphs,window.selectedProjectGraph=e,window.workspaceLayout=r,this.sidebar?this.render$.next({newProjects:o}):this.render$.next()}render(e){const t=document.getElementById("debugger-panel");this.config.showDebugger&&(t.hidden=!1,t.style.display="flex",this.debuggerPanel=new oe(t,window.projectGraphList),this.debuggerPanel.selectProject$.subscribe(e=>{this.loadProjectGraph(e),this.sidebar.resetSidebarVisibility()})),this.graph.projectGraph=window.graph;const n=window.affected.filter(e=>!e.startsWith("npm:"));this.graph.affectedProjects=n,this.sidebar?(this.sidebar.projects=window.projects,(null==e?void 0:e.newProjects.length)>0&&this.sidebar.selectProjects(e.newProjects)):this.sidebar=new ft(n),q([this.sidebar.selectedProjectsChanged$,this.sidebar.groupByFolderChanged$,this.windowResize$]).pipe(J(this.render$)).subscribe(([e,t])=>{const n=[];e.forEach(e=>{window.graph.nodes[e]&&n.push(window.graph.nodes[e])}),0===n.length?document.getElementById("no-projects-chosen").style.display="flex":(document.getElementById("no-projects-chosen").style.display="none",this.graph.render(n,t))}),this.debuggerPanel&&this.graph.renderTimes$.pipe(J(this.render$)).subscribe(e=>this.debuggerPanel.renderTime=e)}}const vt={environment:"release",appConfig:{showDebugger:!1,projectGraphs:[{id:"local",label:"local",url:"projectGraph.json"}],defaultProjectGraph:"local",projectGraphService:new class{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}}};"dev-watch"===vt.environment&&(window.watch=!0),"release"===vt.environment&&"build"===window.localMode&&(vt.appConfig.projectGraphService=new class{async getHash(){return new Promise(e=>e("some-hash"))}async getProjectGraph(e){return new Promise(e=>e(window.projectGraphResponse))}}),setTimeout(()=>new pt(vt.appConfig))},haxF:function(e,t,n){var r=n("XCkn"),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},hcIE:function(e,t,n){"use strict";function r(e){return e?(e.nodeName||"").toLowerCase():null}n.d(t,"a",(function(){return r}))},hmyg:function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},htNe:function(e,t,n){var r=n("AdjD");function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},i2na:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n("siKF"),i=n("oFCp"),o=n("oid+"),a=n("qJB9"),s=n("CcQI"),u=[i.a,o.a,a.a,s.a],c=Object(r.b)({defaultModifiers:u})},i6g8:function(e,t){e.exports="0.8.5"},iNcF:function(e,t,n){(function(e){var r=n("/wvS"),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}}).call(this,n("Fs+f")(e))},iOrR:function(e,t,n){var r=n("XpzN"),i=n("QA6A");e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},"ih+a":function(e,t,n){var r;try{r={clone:n("OksX"),constant:n("iuDc"),each:n("0I+s"),filter:n("xzHw"),has:n("7jeQ"),isArray:n("P/Kr"),isEmpty:n("Q33P"),isFunction:n("KFC0"),isUndefined:n("TkAH"),keys:n("/NDV"),map:n("jJDv"),reduce:n("fG1K"),size:n("n3sS"),transform:n("ZjvN"),union:n("Idy0"),values:n("R9Wj")}}catch(i){}r||(r=window._),e.exports=r},iuDc:function(e,t){e.exports=function(e){return function(){return e}}},j5yP:function(e,t,n){var r=n("19QD")();e.exports=r},jJDv:function(e,t,n){var r=n("90g9"),i=n("nHTl"),o=n("QwWC"),a=n("P/Kr");e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},jtID:function(e,t){var n=Object.prototype.hasOwnProperty;e.exports=function(e,t){return null!=e&&n.call(e,t)}},jy7A:function(e,t){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},k6AR:function(e,t,n){"use strict";function r(e){return e.split("-")[1]}n.d(t,"a",(function(){return r}))},kDty:function(e,t,n){var r=n("DRH/"),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},"knj+":function(e,t,n){var r=n("7/U+"),i=n("B42D"),o=n("7klG"),a=n("/vEv"),s=n("fbik"),u=n("ZESC"),c=n("sRgw");e.exports=function(e,t){return a(e)&&s(t)?u(c(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},ks2Z:function(e,t,n){"use strict";function r(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}n.d(t,"a",(function(){return r}))},"kt/b":function(e,t,n){var r=n("G1mR");e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,c=a}return c}},l9Jy:function(e,t,n){var r=n("/eF7");e.exports=function(e){return r(e,5)}},lQBg:function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},lSuv:function(e,t){e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;)n(a,e[r],r<o?t[r]:void 0);return a}},lhiQ:function(e,t,n){var r=n("4O6w"),i=n("lQBg"),o=n("5PFN");e.exports=function(e,t,n,a,s,u){var c=1&n,l=e.length,d=t.length;if(l!=d&&!(c&&d>l))return!1;var h=u.get(e),f=u.get(t);if(h&&f)return h==t&&f==e;var p=-1,v=!0,g=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++p<l;){var y=e[p],m=t[p];if(a)var b=c?a(m,y,p,t,e,u):a(y,m,p,e,t,u);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(y===e||s(y,e,n,a,u)))return g.push(t)}))){v=!1;break}}else if(y!==m&&!s(y,m,n,a,u)){v=!1;break}}return u.delete(e),u.delete(t),v}},ljyG:function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=r(n("odWq")),o=r(n("PPP7"));function a(e){return(a="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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var h="undefined"==typeof window?null:window,f=h?h.navigator:null,p=a(""),v=a({}),g=a((function(){})),y="undefined"==typeof HTMLElement?"undefined":a(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&a(e)==p},x=function(e){return null!=e&&a(e)===g},w=function(e){return!j(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&a(e)===v&&!w(e)&&e.constructor===Object},k=function(e){return null!=e&&a(e)===a(1)&&!isNaN(e)},P=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},j=function(e){return C(e)||_(e)},C=function(e){return"collection"===m(e)&&e._private.single},_=function(e){return"collection"===m(e)&&!e._private.single},S=function(e){return"core"===m(e)},O=function(e){return"stylesheet"===m(e)},D=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},T=function(e){return function(e){return null!=e&&a(e)===v}(e)&&x(e.then)},B=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,o=arguments,a=t.apply(i,o),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(i,o)),r};return n.cache={},n},M=B((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),N=B((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),I=B((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),A=function(e){return D(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},L="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",z=function(e,t){return e<t?-1:e>t?1:0},R=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return e},F=function(e){return(w(e)?e:null)||function(e){return V[e.toLowerCase()]}(e)||function(e){var t,n,r;if((4===e.length||7===e.length)&&"#"===e[0])return 4===e.length?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):(t=parseInt(e[1]+e[2],16),n=parseInt(e[3]+e[4],16),r=parseInt(e[5]+e[6],16)),[t,n,r]}(e)||function(e){var t,n=new RegExp("^rgb[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(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}if((r[1]||r[2]||r[3])&&!(r[1]&&r[2]&&r[3]))return;var a=n[4];if(void 0!==a){if((a=parseFloat(a))<0||a>1)return;t.push(a)}}return t}(e)||function(e){var t,n,r,i,o,a,s,u;function c(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 l=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(l){if((n=parseInt(l[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(l[2]))<0||r>100)return;if(r/=100,(i=parseFloat(l[3]))<0||i>100)return;if(i/=100,void 0!==(o=l[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=u=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*c(h,d,n+1/3)),s=Math.round(255*c(h,d,n)),u=Math.round(255*c(h,d,n-1/3))}t=[a,s,u,o]}return t}(e)},V={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;i<r;i++){var o=n[i];if(E(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},X=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(E(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},Y=h?h.performance:null,W=Y&&Y.now?function(){return Y.now()}:function(){return Date.now()},H=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(W())}),1e3/60)}}(),G=function(e){return H(e)},U=W,K=65599,Z=function(e){for(var t,n=arguments.length>1&&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 Z({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},ne=function(){return re(arguments)},re=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?te(r):te(r,t)}return t},ie=!0,oe=null!=console.warn,ae=null!=console.trace,se=Number.MAX_SAFE_INTEGER||9007199254740991,ue=function(){return!0},ce=function(){return!1},le=function(){return 0},de=function(){},he=function(e){throw new Error(e)},fe=function(e){if(void 0===e)return ie;ie=!!e},pe=function(e){fe()&&(oe?console.warn(e):(console.log(e),ae&&console.trace()))},ve=function(e){return null==e?e:w(e)?e.slice():E(e)?function(e){return R({},e)}(e):e},ge=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},ye={},me=function(){return ye},be=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},xe=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},we=function(e){e.splice(0,e.length)},Ee=function(e,t,n){return n&&(t=I(n,t)),e[t]},ke=function(e,t,n,r){n&&(t=I(n,t)),e[t]=r},Pe="undefined"!=typeof Map?Map:function(){function e(){s(this,e),this._obj={}}return c(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}(),je=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;r<n.length;r++)this.add(n[r])}}return c(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Ce="undefined"!==("undefined"==typeof Set?"undefined":a(Set))?Set:je,_e=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&S(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Ce,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var u=[];w(t.classes)?u=t.classes:b(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,l=u.length;c<l;c++){var d=u[c];d&&""!==d&&i.classes.add(d)}this.createEmitter();var h=t.style||t.css;h&&(pe("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(void 0===n||n)&&this.restore()}else he("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else he("An element must have a core reference and parameters set")},Se=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;E(t)&&!j(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||x(n)?r:n,n=x(n)?n:function(){};for(var o,a=this._private.cy,s=t=b(t)?this.filter(t):t,u=[],c=[],l={},d={},h={},f=0,p=this.byGroup(),v=p.nodes,g=p.edges,y=0;y<s.length;y++){var m=s[y],w=m.id();m.isNode()&&(u.unshift(m),e.bfs&&(h[w]=!0,c.push(m)),d[w]=0)}var k=function(){var t=e.bfs?u.shift():u.pop(),i=t.id();if(e.dfs){if(h[i])return"continue";h[i]=!0,c.push(t)}var a,s=d[i],p=l[i],y=null!=p?p.source():null,m=null!=p?p.target():null,b=null==p?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,p,b,f++,s)))return o=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var E=x[w],k=E.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),P=k.id();0===k.length||h[P]||(u.push(k=k[0]),e.bfs&&(h[P]=!0,c.push(k)),l[P]=E,d[P]=d[i]+1)}};e:for(;0!==u.length;){var P=k();switch(P){case"continue":continue;case"break":break e}}for(var C=a.collection(),_=0;_<c.length;_++){var S=c[_],O=l[S.id()];null!=O&&C.push(O),C.push(S)}return{path:a.collection(C),found:a.collection(o)}}},Oe={breadthFirstSearch:Se({bfs:!0}),depthFirstSearch:Se({dfs:!0})};Oe.bfs=Oe.breadthFirstSearch,Oe.dfs=Oe.depthFirstSearch;var De=be({root:null,weight:function(e){return 1},directed:!1}),Te={dijkstra:function(e){if(!E(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=De(e),r=n.root,i=n.weight,a=n.directed,s=this,u=i,c=b(r)?this.filter(r)[0]:r[0],l={},d={},h={},f=this.byGroup(),p=f.nodes,v=f.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return l[e.id()]},y=function(e,t){l[e.id()]=t,m.updateItem(e)},m=new o((function(e,t){return g(e)-g(t)})),x=0;x<p.length;x++){var w=p[x];l[w.id()]=w.same(c)?0:1/0,m.push(w)}for(var k=function(e,t){for(var n,r=(a?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,o=0;o<r.length;o++){var s=r[o],c=u(s);(c<i||!n)&&(i=c,n=s)}return{edge:n,dist:i}};m.size()>0;){var P=m.pop(),j=g(P),C=P.id();if(h[C]=j,j!==1/0)for(var _=P.neighborhood().intersect(p),S=0;S<_.length;S++){var O=_[S],D=O.id(),T=k(P,O),B=j+T.dist;B<g(O)&&(y(O,B),d[D]={node:P,edge:T.edge})}}return{distanceTo:function(e){var t=b(e)?p.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=b(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var o=d[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return s.spawn(n)}}}},Be={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++)if(o[t].has(e))return t},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var c=r.sort((function(t,n){return e(t)-e(n)})),l=0;l<c.length;l++){var d=c[l],h=d.source()[0],f=d.target()[0],p=s(h),v=s(f),g=o[p],y=o[v];p!==v&&(a.merge(d),g.merge(y),o.splice(v,1))}return a}},Me=be({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Ne={aStar:function(e){var t=this.cy(),n=Me(e),r=n.root,i=n.goal,a=n.heuristic,s=n.directed,u=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var c,l,d=r.id(),h=i.id(),f={},p={},v={},g=new o((function(e,t){return p[e.id()]-p[t.id()]})),y=new Ce,m={},b={},x=function(e,t){g.push(e),y.add(t)};x(r,d),f[d]=0,p[d]=a(r);for(var w=0;g.size()>0;){if(l=(c=g.pop()).id(),y.delete(l),w++,l===h){for(var E=[],k=i,P=h,j=b[P];E.unshift(k),null!=j&&E.unshift(j),null!=(k=m[P]);)j=b[P=k.id()];return{found:!0,distance:f[l],path:this.spawn(E),steps:w}}v[l]=!0;for(var C=c._private.edges,_=0;_<C.length;_++){var S=C[_];if(this.hasElementWithId(S.id())&&(!s||S.data("source")===l)){var O=S.source(),D=S.target(),T=O.id()!==l?O:D,B=T.id();if(this.hasElementWithId(B)&&!v[B]){var M=f[l]+u(S);y.has(B)?M<f[B]&&(f[B]=M,p[B]=M+a(T),m[B]=c,b[B]=S):(f[B]=M,p[B]=M+a(T),x(T,B),m[B]=c,b[B]=S)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},Ie=be({weight:function(e){return 1},directed:!1}),Ae={floydWarshall:function(e){for(var t=this.cy(),n=Ie(e),r=n.directed,i=n.weight,o=this.byGroup(),a=o.nodes,s=o.edges,u=a.length,c=u*u,l=function(e){return a.indexOf(e)},d=function(e){return a[e]},h=new Array(c),f=0;f<c;f++){var p=f%u;h[f]=(f-p)/u===p?0:1/0}for(var v=new Array(c),g=new Array(c),y=0;y<s.length;y++){var m=s[y],x=m.source()[0],w=m.target()[0];if(x!==w){var E=l(x),k=l(w),P=E*u+k,j=i(m);if(h[P]>j&&(h[P]=j,v[P]=k,g[P]=m),!r){var C=k*u+E;!r&&h[C]>j&&(h[C]=j,v[C]=E,g[C]=m)}}}for(var _=0;_<u;_++)for(var S=0;S<u;S++)for(var O=S*u+_,D=0;D<u;D++){var T=S*u+D,B=_*u+D;h[O]+h[B]<h[T]&&(h[T]=h[O]+h[B],v[T]=v[O])}var M=function(e){return l(function(e){return(b(e)?t.filter(e):e)[0]}(e))};return{distance:function(e,t){var n=M(e),r=M(t);return h[n*u+r]},path:function(e,n){var r=M(e),i=M(n),o=d(r);if(r===i)return o.collection();if(null==v[r*u+i])return t.collection();var a=t.collection();for(a.merge(o);r!==i;)a.merge(g[r*u+(r=v[r*u+i])]),a.merge(d(r));return a}}}},Le=be({weight:function(e){return 1},directed:!1,root:null}),ze={bellmanFord:function(e){var t=this,n=Le(e),r=n.directed,i=n.root,o=n.weight,a=this,s=this.cy(),u=this.byGroup(),c=u.edges,l=u.nodes,d=l.length,h=new Pe,f=!1;i=s.collection(i)[0],c.unmergeBy((function(e){return e.isLoop()}));for(var p=c.length,v=function(e){var t=h.get(e.id());return t||(t={},h.set(e.id(),t)),t},g=function(e){return(b(e)?s.$(e):e)[0]},y=0;y<d;y++){var m=l[y],x=v(m);x.dist=m.same(i)?0:1/0,x.pred=null,x.edge=null}for(var w=!1,E=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,w=!0)},k=1;k<d;k++){w=!1;for(var P=0;P<p;P++){var j=c[P],C=j.source(),_=j.target(),S=o(j),O=v(C),D=v(_);E(C,0,j,O,D,S),r||E(_,0,j,D,O,S)}if(!w)break}if(w)for(var T=0;T<p;T++){var B=c[T],M=B.source(),N=B.target(),I=o(B),A=v(M).dist,L=v(N).dist;if(A+I<L||!r&&L+I<A){pe("Graph contains a negative weight cycle for Bellman-Ford"),f=!0;break}}return{distanceTo:function(e){return v(g(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=g(e),o=[],s=r;;){if(null==s)return t.spawn();var u=v(s),c=u.edge,l=u.pred;if(o.unshift(s[0]),s.same(n)&&o.length>0)break;null!=c&&o.unshift(c),s=l}return a.spawn(o)},hasNegativeWeightCycle:f,negativeWeightCycles:[]}}},Re=Math.sqrt(2),Fe=function(e,t,n){0===n.length&&he("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=t[r[1]],o=t[r[2]],a=n,s=a.length-1;s>=0;s--){var u=a[s],c=u[1],l=u[2];(t[c]===i&&t[l]===o||t[c]===o&&t[l]===i)&&a.splice(s,1)}for(var d=0;d<a.length;d++){var h=a[d];h[1]===o?(a[d]=h.slice(),a[d][1]=i):h[2]===o&&(a[d]=h.slice(),a[d][2]=i)}for(var f=0;f<t.length;f++)t[f]===o&&(t[f]=i);return a},Ve=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Fe(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,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/Re);if(!(i<2)){for(var u=[],c=0;c<o;c++){var l=r[c];u.push([c,n.indexOf(l.source()),n.indexOf(l.target())])}for(var d=1/0,h=[],f=new Array(i),p=new Array(i),v=new Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<i;m++)p[m]=m;var b=Ve(p,u.slice(),i,s),x=b.slice();g(p,v);var w=Ve(p,b,s,2),E=Ve(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,g(p,f)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,g(v,f))}for(var k=this.spawn(h.map((function(e){return r[e[0]]}))),P=this.spawn(),j=this.spawn(),C=f[0],_=0;_<f.length;_++){var S=n[_];f[_]===C?P.merge(S):j.merge(S)}var O=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!k.contains(t)&&n.merge(t)}))})),n},D=[O(P),O(j)];return{cut:k,components:D,partition1:P,partition2:j}}he("At least 2 nodes are required for Karger-Stein algorithm")}},Xe=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Ye=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},We=function(e){return{x:e[0],y:e[1]}},He=function(e,t){return Math.atan2(t,e)-Math.PI/2},Ge=Math.log2||function(e){return Math.log(e)/Math.log(2)},Ue=function(e){return e>0?1:e<0?-1:0},Ke=function(e,t){return Math.sqrt(Ze(e,t))},Ze=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<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},Qe=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},Je=function(e,t,n,r){return{x:Qe(e.x,t.x,n.x,r),y:Qe(e.y,t.y,n.y,r)}},et=function(e,t,n){return Math.max(e,Math.min(n,t))},tt=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},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,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=d(o,4);t=a[0],n=a[1],r=a[2],i=a[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},ot=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},at=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},st=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},ut=function(e,t){return st(e,t.x1,t.y1)&&st(e,t.x2,t.y2)},ct=function(e,t,n,r,i,o,a){var s,u=_t(i,o),c=i/2,l=o/2,d=r-l-a;if((s=wt(e,t,n,r,n-c+u-a,d,n+c-u+a,d,!1)).length>0)return s;var h=n+c+a;if((s=wt(e,t,n,r,h,r-l+u-a,h,r+l-u+a,!1)).length>0)return s;var f=r+l+a;if((s=wt(e,t,n,r,n-c+u-a,f,n+c-u+a,f,!1)).length>0)return s;var p,v=n-c-a;if((s=wt(e,t,n,r,v,r-l+u-a,v,r+l-u+a,!1)).length>0)return s;var g=n-c+u,y=r-l+u;if((p=bt(e,t,n,r,g,y,u+a)).length>0&&p[0]<=g&&p[1]<=y)return[p[0],p[1]];var m=n+c-u,b=r-l+u;if((p=bt(e,t,n,r,m,b,u+a)).length>0&&p[0]>=m&&p[1]<=b)return[p[0],p[1]];var x=n+c-u,w=r+l-u;if((p=bt(e,t,n,r,x,w,u+a)).length>0&&p[0]>=x&&p[1]>=w)return[p[0],p[1]];var E=n-c+u,k=r+l-u;return(p=bt(e,t,n,r,E,k,u+a)).length>0&&p[0]<=E&&p[1]>=k?[p[0],p[1]]:[]},lt=function(e,t,n,r,i,o,a){var s=a,u=Math.min(n,i),c=Math.max(n,i),l=Math.min(r,o),d=Math.max(r,o);return u-s<=e&&e<=c+s&&l-s<=t&&t<=d+s},dt=function(e,t,n,r,i,o,a,s,u){var c=Math.min(n,a,i)-u,l=Math.max(n,a,i)+u,d=Math.min(r,s,o)-u,h=Math.max(r,s,o)+u;return!(e<c||e>l||t<d||t>h)},ht=function(e,t,n,r,i,o,a,s){var u=[];!function(e,t,n,r,i){var o,a,s,u,c,l,d,h;0===e&&(e=1e-5),s=-27*(r/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(a=(3*n-t*t)/9)*a*a+(s/=54)*s,i[1]=0,d=t/3,o>0?(c=(c=s+Math.sqrt(o))<0?-Math.pow(-c,1/3):Math.pow(c,1/3),l=(l=s-Math.sqrt(o))<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-d+c+l,i[4]=i[2]=-(d+=(c+l)/2),d=Math.sqrt(3)*(-l+c)/2,i[3]=d,i[5]=-d):(i[5]=i[3]=0,0===o?(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=(a=-a)*a*a,u=Math.acos(s/Math.sqrt(u)),h=2*Math.sqrt(a),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*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,u);for(var c=[],l=0;l<6;l+=2)Math.abs(u[l+1])<1e-7&&u[l]>=0&&u[l]<=1&&c.push(u[l]);c.push(1),c.push(0);for(var d,h,f,p=-1,v=0;v<c.length;v++)d=Math.pow(1-c[v],2)*n+2*(1-c[v])*c[v]*i+c[v]*c[v]*a,h=Math.pow(1-c[v],2)*r+2*(1-c[v])*c[v]*o+c[v]*c[v]*s,f=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?f<p&&(p=f):p=f;return p},ft=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],u=s[0]*s[0]+s[1]*s[1],c=a[0]*a[0]+a[1]*a[1],l=a[0]*s[0]+a[1]*s[1],d=l*l/u;return l<0?c:d>u?(e-i)*(e-i)+(t-o)*(t-o):c-d},pt=function(e,t,n){for(var r,i,o,a,s=0,u=0;u<n.length/2;u++)if(i=n[2*u+1],u+1<n.length/2?(o=n[2*(u+1)],a=n[2*(u+1)+1]):(o=n[2*(u+1-n.length/2)],a=n[2*(u+1-n.length/2)+1]),(r=n[2*u])==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},vt=function(e,t,n,r,i,o,a,s,u){var c,l=new Array(n.length);null!=s[0]?(c=Math.atan(s[1]/s[0]),s[0]<0?c+=Math.PI/2:c=-c-Math.PI/2):c=s;for(var d,h=Math.cos(-c),f=Math.sin(-c),p=0;p<l.length/2;p++)l[2*p]=o/2*(n[2*p]*h-n[2*p+1]*f),l[2*p+1]=a/2*(n[2*p+1]*h+n[2*p]*f),l[2*p]+=r,l[2*p+1]+=i;if(u>0){var v=yt(l,-u);d=gt(v)}else d=l;return pt(e,t,d)},gt=function(e){for(var t,n,r,i,o=new Array(e.length/2),a=0;a<e.length/4;a++){a<e.length/4-1?(t=e[4*(a+1)],n=e[4*(a+1)+1],r=e[4*(a+1)+2],i=e[4*(a+1)+3]):(t=e[0],n=e[1],r=e[2],i=e[3]);var s=wt(e[4*a],e[4*a+1],e[4*a+2],e[4*a+3],t,n,r,i,!0);o[2*a]=s[0],o[2*a+1]=s[1]}return o},yt=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var u=o-(r=e[2*s+1]),c=-(i-(n=e[2*s])),l=Math.sqrt(u*u+c*c),d=u/l,h=c/l;a[4*s]=n+d*t,a[4*s+1]=r+h*t,a[4*s+2]=i+d*t,a[4*s+3]=o+h*t}return a},mt=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},bt=function(e,t,n,r,i,o,a){var s=[n-e,r-t],u=[e-i,t-o],c=s[0]*s[0]+s[1]*s[1],l=2*(u[0]*s[0]+u[1]*s[1]),d=l*l-4*c*(u[0]*u[0]+u[1]*u[1]-a*a);if(d<0)return[];var h=(-l+Math.sqrt(d))/(2*c),f=(-l-Math.sqrt(d))/(2*c),p=Math.min(h,f),v=Math.max(h,f),g=[];if(p>=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]},xt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},wt=function(e,t,n,r,i,o,a,s,u){var c=e-i,l=n-e,d=a-i,h=t-o,f=r-t,p=s-o,v=d*h-p*c,g=l*h-f*c,y=p*l-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*l,t+m*f]:[]}return 0===v||0===g?xt(e,n,a)===a?[a,s]:xt(e,n,i)===i?[i,o]:xt(i,a,n)===n?[n,r]:[]:[]},Et=function(e,t,n,r,i,o,a,s){var u,c,l,d,h=[],f=new Array(n.length),p=!0;if(null==o&&(p=!1),p){for(var v=0;v<f.length/2;v++)f[2*v]=n[2*v]*o+r,f[2*v+1]=n[2*v+1]*a+i;if(s>0){var g=yt(f,-s);c=gt(g)}else c=f}else c=n;for(var y=0;y<c.length/2;y++)y<c.length/2-1?(l=c[2*(y+1)],d=c[2*(y+1)+1]):(l=c[0],d=c[1]),0!==(u=wt(e,t,r,i,c[2*y],c[2*y+1],l,d)).length&&h.push(u[0],u[1]);return h},kt=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},Pt=function(e,t){var n=Ct(e,t);return jt(n)},jt=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,u=0;u<r;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var c=2/(a-i),l=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*c,n=e[2*d+1]=e[2*d+1]*l,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-o);return e},Ct=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},_t=function(e,t){return Math.min(e/4,t/4,8)},St=function(e,t){return Math.min(e/10,t/10,8)},Ot=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Dt=be({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Tt={pageRank:function(e){for(var t=Dt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),u=s.nodes,c=s.edges,l=u.length,d=c.length,h=new Array(l*l),f=new Array(l),p=(1-n)/l,v=0;v<l;v++){for(var g=0;g<l;g++)h[v*l+g]=0;f[v]=0}for(var y=0;y<d;y++){var m=c[y],b=m.data("source"),x=m.data("target");if(b!==x){var w=u.indexOfId(b),E=u.indexOfId(x),k=o(m);h[E*l+w]+=k,f[w]+=k}}for(var P=1/l+p,j=0;j<l;j++)if(0===f[j])for(var C=0;C<l;C++)h[C*l+j]=P;else for(var _=0;_<l;_++){var S=_*l+j;h[S]=h[S]/f[j]+p}for(var O,D=new Array(l),T=new Array(l),B=0;B<l;B++)D[B]=1;for(var M=0;M<i;M++){for(var N=0;N<l;N++)T[N]=0;for(var I=0;I<l;I++)for(var A=0;A<l;A++)T[I]+=h[I*l+A]*D[A];$e(T),O=D,D=T,T=O;for(var L=0,z=0;z<l;z++){var R=O[z]-D[z];L+=R*R}if(L<r)break}return{rank:function(e){return e=a.collection(e)[0],D[u.indexOf(e)]}}}},Bt=be({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Mt={degreeCentralityNormalized:function(e){e=Bt(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,u=0;u<r;u++){var c=n[u],l=c.id();e.root=c;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),i[l]=d.indegree,o[l]=d.outdegree}return{indegree:function(e){return 0==a?0:(b(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(b(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var h={},f=0,p=0;p<r;p++){var v=n[p];e.root=v;var g=this.degreeCentrality(e);f<g.degree&&(f=g.degree),h[v.id()]=g.degree}return{degree:function(e){return 0===f?0:(b(e)&&(e=t.filter(e)),h[e.id()]/f)}}},degreeCentrality:function(e){e=Bt(e);var t=this.cy(),n=this,r=e.root,i=e.weight,o=e.directed,a=e.alpha;if(r=t.collection(r)[0],o){for(var s=r.connectedEdges(),u=s.filter((function(e){return e.target().same(r)&&n.has(e)})),c=s.filter((function(e){return e.source().same(r)&&n.has(e)})),l=u.length,d=c.length,h=0,f=0,p=0;p<u.length;p++)h+=i(u[p]);for(var v=0;v<c.length;v++)f+=i(c[v]);return{indegree:Math.pow(l,1-a)*Math.pow(h,a),outdegree:Math.pow(d,1-a)*Math.pow(f,a)}}for(var g=r.connectedEdges().intersection(n),y=g.length,m=0,b=0;b<g.length;b++)m+=i(g[b]);return{degree:Math.pow(y,1-a)*Math.pow(m,a)}}};Mt.dc=Mt.degreeCentrality,Mt.dcn=Mt.degreeCentralityNormalised=Mt.degreeCentralityNormalized;var Nt=be({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),It={closenessCentralityNormalized:function(e){for(var t=Nt(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,u=this.nodes(),c=this.floydWarshall({weight:r,directed:i}),l=0;l<u.length;l++){for(var d=0,h=u[l],f=0;f<u.length;f++)if(l!==f){var p=c.distance(h,u[f]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),a[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=b(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=Nt(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,u=this.nodes(),c=0;c<u.length;c++){var l=u[c];if(!l.same(n)){var d=a.distanceTo(l);s+=o?1/d:d}}return o?s:1/s}};It.cc=It.closenessCentrality,It.ccn=It.closenessCentralityNormalised=It.closenessCentralityNormalized;var At=be({weight:null,directed:!1}),Lt={betweennessCentrality:function(e){for(var t=At(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),s=this.nodes(),u={},c={},l=0,d=function(e,t){c[e]=t,t>l&&(l=t)},h=function(e){return c[e]},f=0;f<s.length;f++){var p=s[f],v=p.id();u[v]=n?p.outgoers().nodes():p.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=s[e].id(),n=[],c={},l={},f={},p=new o((function(e,t){return f[e]-f[t]})),v=0;v<s.length;v++){var g=s[v].id();c[g]=[],l[g]=0,f[g]=1/0}for(l[t]=1,f[t]=0,p.push(t);!p.empty();){var y=p.pop();if(n.push(y),i)for(var m=0;m<u[y].length;m++){var b,x=u[y][m],w=a.getElementById(y);b=w.edgesTo(x).length>0?w.edgesTo(x)[0]:x.edgesTo(w)[0];var E=r(b);x=x.id(),f[x]>f[y]+E&&(f[x]=f[y]+E,p.nodes.indexOf(x)<0?p.push(x):p.updateItem(x),l[x]=0,c[x]=[]),f[x]==f[y]+E&&(l[x]=l[x]+l[y],c[x].push(y))}else for(var k=0;k<u[y].length;k++){var P=u[y][k].id();f[P]==1/0&&(p.push(P),f[P]=f[y]+1),f[P]==f[y]+1&&(l[P]=l[P]+l[y],c[P].push(y))}}for(var j={},C=0;C<s.length;C++)j[s[C].id()]=0;for(;n.length>0;){for(var _=n.pop(),S=0;S<c[_].length;S++){var O=c[_][S];j[O]=j[O]+l[O]/l[_]*(1+j[_])}_!=s[e].id()&&d(_,h(_)+j[_])}},y=0;y<s.length;y++)g(y);var m={betweenness:function(e){var t=a.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==l)return 0;var t=a.collection(e).id();return h(t)/l}};return m.betweennessNormalised=m.betweennessNormalized,m}};Lt.bc=Lt.betweennessCentrality;var zt=be({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),Rt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Ft=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Vt=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},qt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Vt(e,r,t);return e},Xt=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Ft(r,t),r},Yt=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!=Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1;return!0},Wt=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Ht=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return zt(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,u=t.length,c=u*u,l=new Array(c),d=0;d<c;d++)l[d]=0;for(var h=0;h<n.length;h++){var f=n[h],p=o[f.source().id()],v=o[f.target().id()],g=Rt(f,i.attributes);l[p*u+v]+=g,l[v*u+p]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(l,u,i.multFactor),Ft(l,u);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=qt(l,u,i.expandFactor),l=Xt(s,u,i.inflateFactor),Yt(l,s,c,4)||(y=!0),m++;return function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Wt(e[t],e[n])&&e.splice(n,1);return e}(function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(l,u,t,r))},Gt={markovClustering:Ht,mcl:Ht},Ut=function(e){return e},Kt=function(e,t){return Math.abs(t-e)},Zt=function(e,t,n){return e+Kt(t,n)},$t=function(e,t,n){return e+Math.pow(n-t,2)},Qt=function(e){return Math.sqrt(e)},Jt=function(e,t,n){return Math.max(e,Kt(t,n))},en=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Ut,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},tn={euclidean:function(e,t,n){return e>=2?en(e,t,n,0,$t,Qt):en(e,t,n,0,Zt)},squaredEuclidean:function(e,t,n){return en(e,t,n,0,$t)},manhattan:function(e,t,n){return en(e,t,n,0,Zt)},max:function(e,t,n){return en(e,t,n,-1/0,Jt)}};function nn(e,t,n,r,i,o){var a;return a=x(e)?e:tn[e]||tn.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}tn["squared-euclidean"]=tn.squaredEuclidean,tn.squaredeuclidean=tn.squaredEuclidean;var rn=be({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),on=function(e){return rn(e)},an=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)};return nn(e,r.length,o,(function(e){return r[e](t)}),n,t)},sn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,u=0;u<r;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var c=0;c<t;c++){s=[];for(var l=0;l<r;l++)s[l]=Math.random()*(o[l]-i[l])+i[l];a[c]=s}return a},un=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var u=an(n,e,t[s],r,i);u<o&&(o=u,a=s)}return a},cn=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},ln=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},dn=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},hn=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];dn(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},fn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=an("manhattan",t[i],e,n,"kMedoids");return r},pn=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var u=0;u<e.length;u++)r[s][u]=Math.pow(n[s][u],i.m);for(var c=0;c<e.length;c++)for(var l=0;l<i.attributes.length;l++){o=0,a=0;for(var d=0;d<t.length;d++)o+=r[d][c]*i.attributes[l](t[d]),a+=r[d][c];e[c][l]=o/a}},vn=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,u,c=2/(i.m-1),l=0;l<n.length;l++)for(var d=0;d<r.length;d++){a=0;for(var h=0;h<n.length;h++)s=an(i.distance,r[d],n[l],i.attributes,"cmeans"),u=an(i.distance,r[d],n[h],i.attributes,"cmeans"),a+=Math.pow(s/u,c);e[d][l]=1/a}},gn=function(e){var t,n,r,i,o=this.cy(),a=this.nodes(),s=on(e);r=new Array(a.length);for(var u=0;u<a.length;u++)r[u]=new Array(s.k);n=new Array(a.length);for(var c=0;c<a.length;c++)n[c]=new Array(s.k);for(var l=0;l<a.length;l++){for(var d=0,h=0;h<s.k;h++)n[l][h]=Math.random(),d+=n[l][h];for(var f=0;f<s.k;f++)n[l][f]=n[l][f]/d}t=new Array(s.k);for(var p=0;p<s.k;p++)t[p]=new Array(s.attributes.length);i=new Array(a.length);for(var v=0;v<a.length;v++)i[v]=new Array(s.k);for(var g=!0,y=0;g&&y<s.maxIterations;)g=!1,pn(t,a,n,i,s),vn(n,r,t,a,s),ln(n,r,s.sensitivityThreshold)||(g=!0),y++;return{clusters:function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var u=0;u<t.length;u++){i=-1/0,o=-1;for(var c=0;c<t[0].length;c++)t[u][c]>i&&(i=t[u][c],o=c);a[o].push(e[u])}for(var l=0;l<a.length;l++)a[l]=r.collection(a[l]);return a}(a,n,s,o),degreeOfMembership:n}},yn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=on(e),s=new Array(o.k),u={};t=o.testMode?"number"==typeof o.testCentroids?sn(r,o.k,o.attributes):"object"===a(o.testCentroids)?o.testCentroids:sn(r,o.k,o.attributes):sn(r,o.k,o.attributes);for(var c,l=!0,d=0;l&&d<o.maxIterations;){for(var h=0;h<r.length;h++)u[(i=r[h]).id()]=un(i,t,o.distance,o.attributes,"kMeans");l=!1;for(var f=0;f<o.k;f++){var p=cn(f,r,u);if(0!==p.length){for(var v=o.attributes.length,g=t[f],y=new Array(v),m=new Array(v),b=0;b<v;b++){m[b]=0;for(var x=0;x<p.length;x++)m[b]+=o.attributes[b](i=p[x]);y[b]=m[b]/p.length,c=o.sensitivityThreshold,Math.abs(g[b]-y[b])<=c||(l=!0)}t[f]=y,s[f]=n.collection(p)}}d++}return s},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,s=on(e),u=new Array(s.k),c={},l=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(t="object"===a(s.testCentroids)?s.testCentroids:hn(i,s.k)):t=hn(i,s.k);for(var d=!0,h=0;d&&h<s.maxIterations;){for(var f=0;f<i.length;f++)c[(o=i[f]).id()]=un(o,t,s.distance,s.attributes,"kMedoids");d=!1;for(var p=0;p<t.length;p++){var v=cn(p,i,c);if(0!==v.length){l[p]=fn(t[p],v,s.attributes);for(var g=0;g<v.length;g++)(n=fn(v[g],v,s.attributes))<l[p]&&(l[p]=n,t[p]=v[g],d=!0);u[p]=r.collection(v)}}h++}return u},fuzzyCMeans:gn,fcm:gn},mn=be({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),bn={single:"min",complete:"max"},xn=function(e,t,n,r,i){for(var o,a=0,s=1/0,u=i.attributes,c=function(e,t){return nn(i.distance,u.length,(function(t){return u[t](e)}),(function(e){return u[e](t)}),e,t)},l=0;l<e.length;l++){var d=e[l].key,h=n[d][r[d]];h<s&&(a=d,s=h)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var f,p=t[a],v=t[r[a]];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;g<e.length;g++){var y=e[g];p.key===y.key?o=1/0:"min"===i.linkage?(o=n[p.key][y.key],n[p.key][y.key]>n[v.key][y.key]&&(o=n[v.key][y.key])):"max"===i.linkage?(o=n[p.key][y.key],n[p.key][y.key]<n[v.key][y.key]&&(o=n[v.key][y.key])):o="mean"===i.linkage?(n[p.key][y.key]*p.size+n[v.key][y.key]*v.size)/(p.size+v.size):"dendrogram"===i.mode?c(y.value,p.value):c(y.value[0],p.value[0]),n[p.key][y.key]=n[y.key][p.key]=o}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===p.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return p.key=v.key=p.index=v.index=null,!0},wn=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},En=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=mn(e),n=bn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return nn(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},a=[],s=[],u=[],c=[],l=0;l<n.length;l++){var d={value:"dendrogram"===r.mode?n[l]:[n[l]],key:l,index:l};a[l]=d,c[l]=d,s[l]=[],u[l]=0}for(var h=0;h<a.length;h++)for(var f=0;f<=h;f++){var p;p="dendrogram"===r.mode?h===f?1/0:o(a[h].value,a[f].value):h===f?1/0:o(a[h].value[0],a[f].value[0]),s[h][f]=p,s[f][h]=p,p<s[h][u[h]]&&(u[h]=f)}for(var v,g=xn(a,c,s,u,r);g;)g=xn(a,c,s,u,r);return"dendrogram"===r.mode?(v=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&wn(t.left,i),t.right&&wn(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&wn(t.left,i),t.right&&wn(t.right,o),[r.collection(i),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),i.concat(o))}(a[0],r.dendrogramDepth,t),r.addDendrogram&&function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return t.value?t.value.id():void 0}(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},kn={hierarchicalClustering:En,hca:En},Pn=be({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),jn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-nn(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Cn=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var o=-1,a=-1/0,s=0;s<n.length;s++){var u=n[s];t[i*e+u]>a&&(o=u,a=t[i*e+u])}o>0&&r.push(o)}for(var c=0;c<n.length;c++)r[n[c]]=n[c];return r},_n=function(e){for(var t,n,r,i,o,a,s=this.cy(),u=this.nodes(),c=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||he("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||k(n)||he("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),Pn(e)}(e),l={},d=0;d<u.length;d++)l[u[d].id()]=d;n=(t=u.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var f=0;f<t;f++)for(var p=0;p<t;p++)f!==p&&(r[f*t+p]=jn(c.distance,u[f],u[p],c.attributes));i=function(e,t){return"median"===t?function(e){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=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var a=0,s=e.length-1;s>=0;s--){var u=e[s];o?isFinite(u)||(e[s]=-1/0,a++):e.splice(s,1)}i&&e.sort((function(e,t){return e-t}));var c=e.length,l=Math.floor(c/2);return c%2!=0?e[l+1+a]:(e[l-1+a]+e[l+a])/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,o=t;o<n;o++){var a=e[o];isFinite(a)&&(r+=a,i++)}return r/i}(e):"min"===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=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.min(o,r))}return r}(e):"max"===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=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.max(o,r))}return r}(e):t}(r,c.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var g=0;g<n;g++)o[g]=0;a=new Array(n);for(var y=0;y<n;y++)a[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,P=new Array(t*c.minIterations),j=0;j<P.length;j++)P[j]=0;for(E=0;E<c.maxIterations;E++){for(var C=0;C<t;C++){for(var _=-1/0,S=-1/0,O=-1,D=0,T=0;T<t;T++)m[T]=o[C*t+T],(D=a[C*t+T]+r[C*t+T])>=_?(S=_,_=D,O=T):D>S&&(S=D);for(var B=0;B<t;B++)o[C*t+B]=(1-c.damping)*(r[C*t+B]-_)+c.damping*m[B];o[C*t+O]=(1-c.damping)*(r[C*t+O]-S)+c.damping*m[O]}for(var M=0;M<t;M++){for(var N=0,I=0;I<t;I++)m[I]=a[I*t+M],b[I]=Math.max(0,o[I*t+M]),N+=b[I];N-=b[M],b[M]=o[M*t+M],N+=b[M];for(var A=0;A<t;A++)a[A*t+M]=(1-c.damping)*Math.min(0,N-b[A])+c.damping*m[A];a[M*t+M]=(1-c.damping)*(N-b[M])+c.damping*m[M]}for(var L=0,z=0;z<t;z++){var R=a[z*t+z]+o[z*t+z]>0?1:0;P[E%c.minIterations*t+z]=R,L+=R}if(L>0&&(E>=c.minIterations-1||E==c.maxIterations-1)){for(var F=0,V=0;V<t;V++){x[V]=0;for(var q=0;q<c.minIterations;q++)x[V]+=P[q*t+V];0!==x[V]&&x[V]!==c.minIterations||F++}if(F===t)break}}for(var X=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,o,a),Y=function(e,t,n){for(var r=Cn(e,t,n),i=0;i<n.length;i++){for(var o=[],a=0;a<r.length;a++)r[a]===n[i]&&o.push(a);for(var s=-1,u=-1/0,c=0;c<o.length;c++){for(var l=0,d=0;d<o.length;d++)l+=t[o[d]*e+o[c]];l>u&&(s=c,u=l)}n[i]=o[s]}return Cn(e,t,n)}(t,r,X),W={},H=0;H<X.length;H++)W[X[H]]=[];for(var G=0;G<u.length;G++){var U=Y[l[u[G].id()]];null!=U&&W[U].push(u[G])}for(var K=new Array(X.length),Z=0;Z<X.length;Z++)K[Z]=s.collection(W[X[Z]]);return K},Sn={affinityPropagation:_n,ap:_n},On=be({root:void 0,directed:!1}),Dn=function(){var e=this,t={},n=0,r=0,i=[],o=[],a={},s=function s(u,c,l){u===l&&(r+=1),t[c]={id:n,low:n++,cutVertex:!1};var d,h,f,p,v=e.getElementById(c).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(c))):v.forEach((function(n){d=n.source().id(),h=n.target().id(),(f=d===c?h:d)!==l&&(p=n.id(),a[p]||(a[p]=!0,o.push({x:c,y:f,edge:n})),f in t?t[c].low=Math.min(t[c].low,t[f].id):(s(u,f,c),t[c].low=Math.min(t[c].low,t[f].low),t[c].id<=t[f].low&&(t[c].cutVertex=!0,function(n,r){for(var a=o.length-1,s=[],u=e.spawn();o[a].x!=n||o[a].y!=r;)s.push(o.pop().edge),a--;s.push(o.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);u.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);u.merge(n),u.merge(t[r].cutVertex?i.filter((function(e){return e.isLoop()})):i)}))})),i.push(u)}(c,f))))}))};e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||(r=0,s(n,n),t[n].cutVertex=r>1)}}));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}},Tn=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e);return e.forEach((function(a){if(a.isNode()){var s=a.id();s in t||function a(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||a(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 c=i.pop();if(u.merge(e.getElementById(c)),t[c].low=t[s].index,t[c].explored=!0,c===s)break}var l=u.edgesWith(u),d=u.merge(l);r.push(d),o=o.difference(d)}}(s)}})),{cut:o,components:r}},Bn={};[Oe,Te,Be,Ne,Ae,ze,qe,Tt,Mt,It,Lt,Gt,yn,kn,Sn,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=On(e),a=o.root,s=o.directed,u=this,c=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var l={},d={};u.forEach(s?function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?c=!0:n=t:1==s?r?c=!0:r=t:(s>1||a>1)&&(c=!0),l[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&l[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]}:function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?c=!0:r=t:n=t),l[t]=[],e.connectedEdges().forEach((function(e){return l[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]});var h={found:!1,trail:void 0};if(c)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,o=[e];l[i].length;)t=l[i].shift(),n=d[t][0],i!=(r=d[t][1])?(l[r]=l[r].filter((function(e){return e!=t})),i=r):s||i==n||(l[n]=l[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},p=[],v=[];for(v=f(i);1!=v.length;)0==l[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())),l)if(l[g].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},{hopcroftTarjanBiconnected:Dn,htbc:Dn,htb:Dn,hopcroftTarjanBiconnectedComponents:Dn},{tarjanStronglyConnected:Tn,tsc:Tn,tscc:Tn,tarjanStronglyConnectedComponents:Tn}].forEach((function(e){R(Bn,e)}));var Mn=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))};Mn.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 Mn;return this.onFulfilled.push(Ln(e,n,"fulfill")),this.onRejected.push(Ln(t,n,"reject")),In(this),n.proxy}};var Nn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,In(e)),e},In=function(e){1===e.state?An(e,"onFulfilled",e.fulfillValue):2===e.state&&An(e,"onRejected",e.rejectReason)},An=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Ln=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(o){return void t.reject(o)}zn(t,i)}}},zn=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===a(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(o){return void t.reject(o)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(o){i||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};Mn.all=function(e){return new Mn((function(t,n){for(var r=new Array(e.length),i=0,o=function(n,o){r[n]=o,++i===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){o(t,e)}),(function(e){n(e)})):o(t,r)}(a)}))},Mn.resolve=function(e){return new Mn((function(t,n){t(e)}))},Mn.reject=function(e){return new Mn((function(t,n){n(e)}))};var Rn="undefined"!=typeof Promise?Promise:Mn,Fn=function(e,t,n){var r=S(e),i=!r,o=this._private=R({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&x(o.complete)&&o.completes.push(o.complete),i){var a=e.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(r){var s=e.pan();o.startPan={x:s.x,y:s.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Vn=Fn.prototype;R(Vn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),j(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],o=i.name,a=e.startStyle[o];e.startStyle[o]=i,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;switch(e){case"frame":t=n.frames;break;default:case"complete":case"completed":t=n.completes}return new Rn((function(e,n){t.push((function(){e()}))}))}}),Vn.complete=Vn.completed,Vn.run=Vn.play,Vn.running=Vn.playing;var qn={};[{animated:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return!1;var t=e[0];return t?t._private.animation.current.length>0: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;t<e.length;t++)e[t]._private.animation.queue=[];return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=void 0!==this.length,r=n?this:[this],i=this._private.cy||this,o=!n,a=!o;if(!i.styleEnabled())return this;var s=i.style();if(e=R({},e,t),0===Object.keys(e).length)return new Fn(r[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(a&&(e.style=s.getPropsList(e.style||e.css),e.css=void 0),a&&null!=e.renderedPosition){var u=e.renderedPosition,c=i.pan(),l=i.zoom();e.position=Ye(u,l,c)}if(o&&null!=e.panBy){var d=e.panBy,h=i.pan();e.pan={x:h.x+d.x,y:h.y+d.y}}var f=e.center||e.centre;if(o&&null!=f){var p=i.getCenterPan(f.eles,e.zoom);null!=p&&(e.pan=p)}if(o&&null!=e.fit){var v=e.fit,g=i.getFitViewport(v.eles||v.boundingBox,v.padding);null!=g&&(e.pan=g.pan,e.zoom=g.zoom)}if(o&&E(e.zoom)){var y=i.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new Fn(r[0],e)}},animate:function(){return function(e,t){var n=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=R({},e,t));for(var r=0;r<n.length;r++){var i=n[r],o=i.animated()&&(void 0===e.queue||e.queue);i.animation(e,o?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=void 0!==this.length?this:[this],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var i=0;i<n.length;i++){for(var o=n[i]._private,a=o.animation.current,s=0;s<a.length;s++)t&&(a[s]._private.duration=0);e&&(o.animation.queue=[]),t||(o.animation.current=[])}return r.notify("draw"),this}}},{data:function(e){return e=R({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=void 0!==this.length,o=i?this:[this],a=i?this[0]:this;if(b(t)){var s;if(r.allowGetting&&void 0===n)return a&&(r.beforeGet(a),s=a._private[r.field][t]),s;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var u=l({},t,n);r.beforeSet(this,u);for(var c=0,d=o.length;c<d;c++){var h=o[c];r.canSet(h)&&(h._private[r.field][t]=n)}r.updateStyle&&this.updateStyle(),r.onSet(this),r.settingTriggersEvent&&this[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&E(t)){var f,p,v=t,g=Object.keys(v);r.beforeSet(this,v);for(var y=0;y<g.length;y++)if(p=v[f=g[y]],!r.immutableKeys[f])for(var m=0;m<o.length;m++){var w=o[m];r.canSet(w)&&(w._private[r.field][f]=p)}r.updateStyle&&this.updateStyle(),r.onSet(this),r.settingTriggersEvent&&this[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&x(t))this.on(r.bindingEvent,t);else if(r.allowGetting&&void 0===t){var k;return a&&(r.beforeGet(a),k=a._private[r.field]),k}return this}},removeData:function(e){return e=R({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=void 0!==this.length?this:[this];if(b(t)){for(var i=t.split(/\s+/),o=i.length,a=0;a<o;a++){var s=i[a];if(!D(s)&&!n.immutableKeys[s])for(var u=0,c=r.length;u<c;u++)r[u]._private[n.field][s]=void 0}n.triggerEvent&&this[n.triggerFnName](n.event)}else if(void 0===t){for(var l=0,d=r.length;l<d;l++)for(var h=r[l]._private[n.field],f=Object.keys(h),p=0;p<f.length;p++){var v=f[p];!n.immutableKeys[v]&&(h[v]=void 0)}n.triggerEvent&&this[n.triggerFnName](n.event)}return this}}},{eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new Rn((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}}].forEach((function(e){R(qn,e)}));var Xn={animate:qn.animate(),animation:qn.animation(),animated:qn.animated(),clearQueue:qn.clearQueue(),delay:qn.delay(),delayAnimation:qn.delayAnimation(),stop:qn.stop()},Yn={classes:function(e){if(void 0===e){var t=[];return this[0]._private.classes.forEach((function(e){return t.push(e)})),t}w(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],r=new Ce(e),i=0;i<this.length;i++){for(var o=this[i],a=o._private,s=a.classes,u=!1,c=0;c<e.length;c++)if(!s.has(e[c])){u=!0;break}u||(u=s.size!==e.length),u&&(a.classes=r,n.push(o))}return n.length>0&&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,o=this.length;i<o;i++)for(var a=this[i],s=a._private.classes,u=!1,c=0;c<e.length;c++){var l=e[c],d=s.has(l),h=!1;t||n&&!d?(s.add(l),h=!0):(!t||n&&d)&&(s.delete(l),h=!0),!u&&h&&(r.push(a),u=!0)}return r.length>0&&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}};Yn.className=Yn.classNames=Yn.classes;var Wn={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+"};Wn.variable="(?:[\\w-]|(?:\\\\"+Wn.metaChar+"))+",Wn.value=Wn.string+"|"+Wn.number,Wn.className=Wn.variable,Wn.id=Wn.variable,function(){var e,t,n;for(e=Wn.comparatorOp.split("|"),n=0;n<e.length;n++)Wn.comparatorOp+="|@"+(t=e[n]);for(e=Wn.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(Wn.comparatorOp+="|\\!"+t)}();var Hn=[{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*z(e,t)}(e.selector,t.selector)})),Gn=function(){for(var e,t={},n=0;n<Hn.length;n++)t[(e=Hn[n]).selector]=e.matches;return t}(),Un="("+Hn.map((function(e){return e.selector})).join("|")+")",Kn=function(e){return e.replace(new RegExp("\\\\("+Wn.metaChar+")","g"),(function(e,t){return t}))},Zn=function(e,t,n){e[e.length-1]=n},$n=[{name:"group",query:!0,regex:"("+Wn.group+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:0,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Un,populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:7,value:r})}},{name:"id",query:!0,regex:"\\#("+Wn.id+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:8,value:Kn(r)})}},{name:"className",query:!0,regex:"\\.("+Wn.className+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:9,value:Kn(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Wn.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:4,field:Kn(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Wn.variable+")\\s*("+Wn.comparatorOp+")\\s*("+Wn.value+")\\s*\\]",populate:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+Wn.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:3,field:Kn(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Wn.boolOp+")\\s*("+Wn.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,2),i=r[0];t.checks.push({type:5,field:Kn(r[1]),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Wn.meta+")\\s*("+Wn.comparatorOp+")\\s*("+Wn.number+")\\s*\\]\\]",populate:function(e,t,n){var r=d(n,3),i=r[1],o=r[2];t.checks.push({type:6,field:Kn(r[0]),operator:i,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Wn.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return null!=n&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:Wn.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:11,source:t,target:r}),Zn(e,0,n),e.edgeCount++,r}var i={checks:[]},o={checks:[]};return i.checks.push({type:12,source:t,target:o}),Zn(e,0,i),e.edgeCount++,o}},{name:"undirectedEdge",separator:!0,regex:Wn.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:10,nodes:[t,r]}),Zn(e,0,n),e.edgeCount++,r}var i={checks:[]},o={checks:[]};return i.checks.push({type:14,node:t,neighbor:o}),Zn(e,0,i),o}},{name:"child",separator:!0,regex:Wn.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:15,parent:e[e.length-1],child:r}),Zn(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var i={checks:[]},o={checks:[]},a={checks:[]},s={checks:[]},u={checks:[]};return i.checks.push({type:19,left:e[e.length-1],right:o,subject:a}),a.checks=t.checks,t.checks=[{type:20}],u.checks.push({type:20}),o.checks.push({type:17,parent:u,child:s}),Zn(e,0,i),e.currentSubject=a,e.compoundCount++,s}var c={checks:[]},l={checks:[]},d=[{type:17,parent:c,child:l}];return c.checks=t.checks,t.checks=d,e.compoundCount++,l}},{name:"descendant",separator:!0,regex:Wn.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:16,ancestor:e[e.length-1],descendant:r}),Zn(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var i={checks:[]},o={checks:[]},a={checks:[]},s={checks:[]},u={checks:[]};return i.checks.push({type:19,left:e[e.length-1],right:o,subject:a}),a.checks=t.checks,t.checks=[{type:20}],u.checks.push({type:20}),o.checks.push({type:18,ancestor:u,descendant:s}),Zn(e,0,i),e.currentSubject=a,e.compoundCount++,s}var c={checks:[]},l={checks:[]},d=[{type:18,ancestor:c,descendant:l}];return c.checks=t.checks,t.checks=d,e.compoundCount++,l}},{name:"subject",modifier:!0,regex:Wn.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return pe("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;11===r?n.type=13:10===r&&(n.type=14,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];$n.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Qn=function(e){for(var t,n,r,i=0;i<$n.length;i++){var o=$n[i],a=o.name,s=e.match(o.regexObj);if(null!=s){n=s,t=o,r=a,e=e.substring(s[0].length);break}}return{expr:t,match:n,name:r,remaining:e}},Jn={parse:function(e){var t=this.inputText=e,n=this[0]={checks:[]};for(this.length=1,t=function(e){var t=e.match(/^\s+/);return t&&(e=e.substring(t[0].length)),e}(t);;){var r=Qn(t);if(null==r.expr)return pe("The selector `"+e+"`is invalid"),!1;var i=r.match.slice(1),o=r.expr.populate(this,n,i);if(!1===o)return!1;if(null!=o&&(n=o),(t=r.remaining).match(/^\s*$/))break}var a=this[this.length-1];null!=this.currentSubject&&(a.subject=this.currentSubject),a.edgeCount=this.edgeCount,a.compoundCount=this.compoundCount;for(var s=0;s<this.length;s++){var u=this[s];if(u.compoundCount>0&&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,o){var a=r.value;switch(r.type){case 0:var s=e(a);return s.substring(0,s.length-1);case 3:return"["+r.field+n(e(r.operator))+t(a)+"]";case 5:var u=r.field;return"["+e(r.operator)+u+"]";case 4:return"["+r.field+"]";case 6:return"[["+r.field+n(e(r.operator))+t(a)+"]]";case 7:return a;case 8:return"#"+a;case 9:return"."+a;case 17:case 15:return i(r.parent,o)+n(">")+i(r.child,o);case 18:case 16:return i(r.ancestor,o)+" "+i(r.descendant,o);case 19:var c=i(r.left,o),l=i(r.subject,o),d=i(r.right,o);return c+(c.length>0?" ":"")+l+d;case 20:return""}},i=function(e,t){return e.checks.reduce((function(n,i,o){return n+(t===e&&0===o?"$":"")+r(i,t)}),"")},o="",a=0;a<this.length;a++){var s=this[a];o+=i(s,s.subject),this.length>1&&a<this.length-1&&(o+=", ")}return this.toStringCache=o,o}},er=function(e,t,n){var r,i,o,a=b(e),s=k(e),u=b(n),c=!1,l=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),l=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(a||u||c)&&(i=a||s?""+e:"",o=""+n),c&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!l||null==e&&d||(r=!r),r},tr=function(e,t){return e.data(t)},nr=[],rr=function(e,t){return e.checks.every((function(e){return nr[e.type](e,t)}))};nr[0]=function(e,t){var n=e.value;return"*"===n||n===t.group()},nr[7]=function(e,t){return function(e,t){return Gn[e](t)}(e.value,t)},nr[8]=function(e,t){var n=e.value;return t.id()===n},nr[9]=function(e,t){return t.hasClass(e.value)},nr[6]=function(e,t){var n=e.operator,r=e.value;return er(function(e,t){return e[t]()}(t,e.field),n,r)},nr[3]=function(e,t){var n=e.operator,r=e.value;return er(tr(t,e.field),n,r)},nr[5]=function(e,t){var n=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(tr(t,e.field),n)},nr[4]=function(e,t){return void 0!==tr(t,e.field)},nr[10]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return rr(n,i)&&rr(r,o)||rr(r,i)&&rr(n,o)},nr[14]=function(e,t){return rr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&rr(e.neighbor,t)}))},nr[11]=function(e,t){return rr(e.source,t.source())&&rr(e.target,t.target())},nr[12]=function(e,t){return rr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&rr(e.target,t)}))},nr[13]=function(e,t){return rr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&rr(e.source,t)}))},nr[15]=function(e,t){return rr(e.child,t)&&rr(e.parent,t.parent())},nr[17]=function(e,t){return rr(e.parent,t)&&t.children().some((function(t){return rr(e.child,t)}))},nr[16]=function(e,t){return rr(e.descendant,t)&&t.ancestors().some((function(t){return rr(e.ancestor,t)}))},nr[18]=function(e,t){return rr(e.ancestor,t)&&t.descendants().some((function(t){return rr(e.descendant,t)}))},nr[19]=function(e,t){return rr(e.subject,t)&&rr(e.left,t)&&rr(e.right,t)},nr[20]=function(){return!0},nr[1]=function(e,t){return e.value.has(t)},nr[2]=function(e,t){return(0,e.value)(t)};var ir=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||b(e)&&e.match(/^\s*$/)||(j(e)?this.addQuery({checks:[{type:1,value:e.collection()}]}):x(e)?this.addQuery({checks:[{type:2,value:e}]}):b(e)?this.parse(e)||(this.invalid=!0):he("A selector must be created from a string; found "))},or=ir.prototype;[Jn,{matches:function(e){for(var t=0;t<this.length;t++)if(rr(this[t],e))return!0;return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&8===t[0].checks[0].type)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++)if(rr(t[n],e))return!0;return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}}].forEach((function(e){return R(or,e)})),or.text=function(){return this.inputText},or.size=function(){return this.length},or.eq=function(e){return this[e]},or.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},or.addQuery=function(e){this[this.length++]=e},or.selector=or.toString;var ar={allAre:function(e){var t=new ir(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new ir(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};ar.allAreNeighbours=ar.allAreNeighbors,ar.has=ar.contains,ar.equal=ar.equals=ar.same;var sr,ur,cr=function(e,t){return function(n,r,i,o){var a,s=n;if(null==s?a="":j(s)&&1===s.length&&(a=s.id()),1===this.length&&a){var u=this[0]._private,c=u.traversalCache=u.traversalCache||{},l=c[t]=c[t]||[],d=te(a);return l[d]||(l[d]=e.call(this,n,r,i,o))}return e.call(this,n,r,i,o)}},lr={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++)t.push(n[r]);n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:cr((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function dr(e,t,n,r){for(var i=[],o=new Ce,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var u=e[s];n?i.push(u):a&&r(i,o,u)}for(;i.length>0;){var c=i.shift();t(c),o.add(c.id()),a&&r(i,o,c)}return e}function hr(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var o=r[i];t.has(o.id())||e.push(o)}}function fr(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function pr(e,t,n){fr(e,t,n),hr(e,t,n)}lr.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return dr(this,e,t,hr)},lr.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return dr(this,e,t,fr)},lr.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return dr(this,e,t,pr)},lr.ancestors=lr.parents,(sr=ur={data:qn.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:qn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:qn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:qn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:qn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:qn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=sr.data,sr.removeAttr=sr.removeData;var vr,gr,yr=ur,mr={};function br(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,o=0;o<i.length;o++){var a=i[o];!t&&a.isLoop()||(n+=e(r,a))}return n}}}function xr(e,t){return function(n){for(var r,i=this.nodes(),o=0;o<i.length;o++){var a=i[o][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}R(mr,{degree:br((function(e,t){return t.source().same(t.target())?2:1})),indegree:br((function(e,t){return t.target().same(e)?1:0})),outdegree:br((function(e,t){return t.source().same(e)?1:0}))}),R(mr,{minDegree:xr("degree",(function(e,t){return e<t})),maxDegree:xr("degree",(function(e,t){return e>t})),minIndegree:xr("indegree",(function(e,t){return e<t})),maxIndegree:xr("indegree",(function(e,t){return e>t})),minOutdegree:xr("outdegree",(function(e,t){return e<t})),maxOutdegree:xr("outdegree",(function(e,t){return e>t}))}),R(mr,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var wr=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var o=i._private.position,a={x:null!=t.x?t.x-o.x:0,y:null!=t.y?t.y-o.y:0};!i.isParent()||0===a.x&&0===a.y||i.children().shift(a,n),i.dirtyBoundingBoxCache()}}},Er={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){wr(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};(vr=gr={position:qn.data(Er),silentPosition:qn.data(R({},Er,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){wr(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(E(e))t?this.silentPosition(e):this.position(e);else if(x(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var o,a=this[i];(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(E(e)?(r={x:k(e.x)?e.x:0,y:k(e.y)?e.y:0},n=t):b(e)&&k(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var a=this[o],s=a.position(),u={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(u):a.position(u)}i.endBatch()}return this},silentShift:function(e,t){return E(e)?this.shift(e,!0):b(e)&&k(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),o=r.pan(),a=E(e)?e:void 0,s=void 0!==a||void 0!==t&&b(e);if(n&&n.isNode()){if(!s){var u=n.position();return a=Xe(u,i,o),void 0===e?a:a[e]}for(var c=0;c<this.length;c++){var l=this[c];void 0!==t?l.position(e,(t-o[e])/i):void 0!==a&&l.position(Ye(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=E(e)?e:void 0,o=void 0!==i||void 0!==t&&b(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),u=a?n.parent():null,c=u&&u.length>0;c&&(u=u[0]);var l=c?u.position():{x:0,y:0};return i={x:s.x-l.x,y:s.y-l.y},void 0===e?i:i[e]}for(var d=0;d<this.length;d++){var h=this[d],f=a?h.parent():null,p=f&&f.length>0;p&&(f=f[0]);var v=p?f.position():{x:0,y:0};void 0!==t?h.position(e,t+v[e]):void 0!==i&&h.position({x:i.x+v.x,y:i.y+v.y})}}else if(!o)return;return this}}).modelPosition=vr.point=vr.position,vr.modelPositions=vr.points=vr.positions,vr.renderedPoint=vr.renderedPosition,vr.relativePoint=vr.relativePosition;var kr,Pr,jr=gr;kr=Pr={},Pr.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,u=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:u,w:a-o,h:u-s}},Pr.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},Pr.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")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.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 c=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(c=100*c/i.height.val);var l=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(l=100*l/i.height.val);var d=y(i.width.val-o.w,s,u),h=d.biasDiff,f=d.biasComplementDiff,p=y(i.height.val-o.h,c,l),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}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+f)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-v+o.y1+o.y2+g)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],o=i._private;o.compoundBoundsClean&&!e||(n(i),t.batching()||(o.compoundBoundsClean=!0))}return this};var Cr=function(e){return e===1/0||e===-1/0?0:e},_r=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Sr=function(e,t){return null==t?e:_r(e,t.x1,t.y1,t.x2,t.y2)},Or=function(e,t,n){return Ee(e,t,n)},Dr=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var u=o.arrowBounds=o.arrowBounds||{},c=u[n]=u[n]||{};c.x1=r-s,c.y1=i-s,c.x2=r+s,c.y2=i+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,rt(c,1),_r(e,c.x1,c.y1,c.x2,c.y2)}}},Tr=function(e,t,n){if(!t.cy().headless()){var r,i=t._private,o=i.rstyle;if(t.pstyle((r=n?n+"-":"")+"label").strValue){var a,s,u,c,l=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=Or(o,"labelWidth",n),f=Or(o,"labelHeight",n),p=Or(o,"labelX",n),v=Or(o,"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,E=t.pstyle("text-background-padding").pfValue,k=f,P=h,j=P/2,C=k/2;if(m)a=p-j,s=p+j,u=v-C,c=v+C;else{switch(l.value){case"left":a=p-P,s=p;break;case"center":a=p-j,s=p+j;break;case"right":a=p,s=p+P}switch(d.value){case"top":u=v-k,c=v;break;case"center":u=v-C,c=v+C;break;case"bottom":u=v,c=v+k}}a+=g-Math.max(x,w)-E-2,s+=g+Math.max(x,w)+E+2,u+=y-Math.max(x,w)-E-2,c+=y+Math.max(x,w)+E+2;var _=n||"main",S=i.labelBounds,O=S[_]=S[_]||{};O.x1=a,O.y1=u,O.x2=s,O.y2=c,O.w=s-a,O.h=c-u;var D=m&&"autorotate"===b.strValue;if(D||null!=b.pfValue&&0!==b.pfValue){var T=D?Or(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(T),M=Math.sin(T),N=(a+s)/2,I=(u+c)/2;if(!m){switch(l.value){case"left":N=s;break;case"right":N=a}switch(d.value){case"top":I=c;break;case"bottom":I=u}}var A=function(e,t){return{x:(e-=N)*B-(t-=I)*M+N,y:e*M+t*B+I}},L=A(a,u),z=A(a,c),R=A(s,u),F=A(s,c);a=Math.min(L.x,z.x,R.x,F.x),s=Math.max(L.x,z.x,R.x,F.x),u=Math.min(L.y,z.y,R.y,F.y),c=Math.max(L.y,z.y,R.y,F.y)}var V=_+"Rot",q=S[V]=S[V]||{};q.x1=a,q.y1=u,q.x2=s,q.y2=c,q.w=s-a,q.h=c-u,_r(e,a,u,s,c),_r(i.labelBounds.all,a,u,s,c)}return e}},Br=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),(r+=n(e.includeTargetLabels))+n(e.includeOverlays)},Mr=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Z({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},void 0)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},Nr=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?Ar:Br(t))===Ar,a=Mr(e),s=r.bbCachePosKey===a,u=t.useCache&&s,c=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!u||c(e)||i&&c(e.source())||c(e.target())?(s||e.recalculateRenderedStyle(u),n=function(e,t){var n,r,i,o,a,s,u,c=e._private.cy,l=c.styleEnabled(),d=c.headless(),h=tt(),f=e._private,p=e.isNode(),v=e.isEdge(),g=f.rstyle,y=p&&l?e.pstyle("bounds-expansion").pfValue:[0],m=function(e){return"none"!==e.pstyle("display").value},b=!l||m(e)&&(!v||m(e.source())&&m(e.target()));if(b){var x=0;l&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;if(l&&(w=e.pstyle("width").pfValue/2),p&&t.includeNodes){var E=e.position();a=E.x,s=E.y;var k=e.outerWidth()/2,P=e.outerHeight()/2;_r(h,n=a-k,i=s-P,r=a+k,o=s+P)}else if(v&&t.includeEdges)if(l&&!d){var j=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),i=Math.min(g.srcY,g.midY,g.tgtY),o=Math.max(g.srcY,g.midY,g.tgtY),_r(h,n-=w,i-=w,r+=w,o+=w),"haystack"===j){var C=g.haystackPts;if(C&&2===C.length){if((n=C[0].x)>(r=C[1].x)){var _=n;n=r,r=_}if((i=C[0].y)>(o=C[1].y)){var S=i;i=o,o=S}_r(h,n-w,i-w,r+w,o+w)}}else if("bezier"===j||"unbundled-bezier"===j||"segments"===j||"taxi"===j){var O;switch(j){case"bezier":case"unbundled-bezier":O=g.bezierPts;break;case"segments":case"taxi":O=g.linePts}if(null!=O)for(var D=0;D<O.length;D++){var T=O[D];_r(h,n=T.x-w,i=T.y-w,r=T.x+w,o=T.y+w)}}}else{var B=e.source().position(),M=e.target().position();if((n=B.x)>(r=M.x)){var N=n;n=r,r=N}if((i=B.y)>(o=M.y)){var I=i;i=o,o=I}_r(h,n-=w,i-=w,r+=w,o+=w)}if(l&&t.includeEdges&&v&&(Dr(h,e,"mid-source"),Dr(h,e,"mid-target"),Dr(h,e,"source"),Dr(h,e,"target")),l&&"yes"===e.pstyle("ghost").value){var A=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue;_r(h,h.x1+A,h.y1+L,h.x2+A,h.y2+L)}var z=f.bodyBounds=f.bodyBounds||{};ot(z,h),it(z,y),rt(z,1),l&&_r(h,(n=h.x1)-x,(i=h.y1)-x,(r=h.x2)+x,(o=h.y2)+x);var R=f.overlayBounds=f.overlayBounds||{};ot(R,h),it(R,y),rt(R,1);var F=f.labelBounds=f.labelBounds||{};null!=F.all?((u=F.all).x1=1/0,u.y1=1/0,u.x2=-1/0,u.y2=-1/0,u.w=0,u.h=0):F.all=tt(),l&&t.includeLabels&&(t.includeMainLabels&&Tr(h,e,null),v&&(t.includeSourceLabels&&Tr(h,e,"source"),t.includeTargetLabels&&Tr(h,e,"target")))}return h.x1=Cr(h.x1),h.y1=Cr(h.y1),h.x2=Cr(h.x2),h.y2=Cr(h.y2),h.w=Cr(h.x2-h.x1),h.h=Cr(h.y2-h.y1),h.w>0&&h.h>0&&b&&(it(h,y),rt(h,1)),h}(e,Ir),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var l=e.isNode();n=tt(),(t.includeNodes&&l||t.includeEdges&&!l)&&Sr(n,t.includeOverlays?r.overlayBounds:r.bodyBounds),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?Sr(n,r.labelBounds.all):(t.includeMainLabels&&Sr(n,r.labelBounds.mainRot),t.includeSourceLabels&&Sr(n,r.labelBounds.sourceRot),t.includeTargetLabels&&Sr(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Ir={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,useCache:!0},Ar=Br(Ir),Lr=be(Ir);Pr.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=tt();var n=Lr(e=e||Ir);if(this.cy().styleEnabled())for(var r=0;r<this.length;r++){var i=this[r],o=i._private,a=Mr(i);i.recalculateRenderedStyle(n.useCache&&o.bbCachePosKey===a&&!o.styleDirty)}this.updateCompoundBounds(!e.useCache);for(var s=0;s<this.length;s++)Sr(t,Nr(this[s],n))}else e=void 0===e?Ir:Lr(e),t=Nr(this[0],e);return t.x1=Cr(t.x1),t.y1=Cr(t.y1),t.x2=Cr(t.x2),t.y2=Cr(t.y2),t.w=Cr(t.x2-t.x1),t.h=Cr(t.y2-t.y1),t},Pr.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},Pr.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),E(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),a},kr.boundingbox=kr.bb=kr.boundingBox,kr.renderedBoundingbox=kr.renderedBoundingBox;var zr,Rr,Fr=Pr;zr=Rr={};var Vr=function(e){e.uppercaseName=A(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=A(e.outerName),zr[e.name]=function(){var t=this[0],n=t._private;if(t){if(!n.cy._private.styleEnabled)return 1;if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var r=t.pstyle(e.name);switch(r.strValue){case"label":return t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return r.pfValue}}},zr["outer"+e.uppercaseName]=function(){var t=this[0];if(t)return t._private.cy._private.styleEnabled?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},zr["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},zr["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};Vr({name:"width"}),Vr({name:"height"}),Rr.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},Rr.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},Rr.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var qr=Rr,Xr={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Yr=Object.keys(Xr).reduce((function(e,t){var n=Xr[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},e[r]=n.mult?function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return Xe(e,i,r)}))}}(this,n.get)}:function(){return function(e,t){if(e.isEdge()){var n=e.cy();return Xe(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),Wr=R({},jr,Fr,qr,Yr),Hr=function(e,t){this.recycle(e,t)};function Gr(){return!1}function Ur(){return!0}Hr.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Gr,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Ur:Gr):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Ur;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Ur;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Ur,this.stopPropagation()},isDefaultPrevented:Gr,isPropagationStopped:Gr,isImmediatePropagationStopped:Gr};var Kr=/^([^.]+)(\.(?:[^.]+))?$/,Zr={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},$r=Object.keys(Zr),Qr={};function Jr(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qr,t=arguments.length>1?arguments[1]:void 0,n=0;n<$r.length;n++){var r=$r[n];this[r]=e[r]||Zr[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var ei=Jr.prototype,ti=function(e,t,n,r,i,o,a){x(r)&&(i=r,r=null),a&&(o=null==o?a:R({},o,a));for(var s=w(n)?n:n.split(/\s+/),u=0;u<s.length;u++){var c=s[u];if(!D(c)){var l=c.match(Kr);if(l&&!1===t(e,c,l[1],l[2]?l[2]:null,r,i,o))break}}},ni=function(e,t){return e.addEventFields(e.context,t),new Hr(t.type,t)};ei.on=ei.addListener=function(e,t,n,r,i){return ti(this,(function(e,t,n,r,i,o,a){x(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},ei.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},ei.removeListener=ei.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var o=this.listeners,a=function(a){var s=o[a];ti(i,(function(t,n,r,i,u,c){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!u||t.qualifierCompare(s.qualifier,u))&&(!c||s.callback===c))return o.splice(a,1),!1}),e,t,n,r)},s=o.length-1;s>=0;s--)a(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]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,ni(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!D(o)){var a=o.match(Kr);a&&t(e,ni(e,{type:a[1],namespace:a[2]?a[2]:null,target:e.context}))}}else t(e,n)}(this,(function(e,o){null!=n&&(i=(r=[{event:o.event,type:o.type,namespace:o.namespace,callback:n}]).length);for(var a=function(n){var i=r[n];if(i.type===o.type&&(!i.namespace||i.namespace===o.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,o)){var a=[o];null!=t&&function(e,t){for(var n=0;n<t.length;n++)e.push(t[n])}(a,t),e.beforeEmit(e.context,i,o),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,o),u=i.callback.apply(s,a);e.afterEmit(e.context,i,o),!1===u&&(o.stopPropagation(),o.preventDefault())}},s=0;s<i;s++)a(s);e.bubble(e.context)&&!o.isPropagationStopped()&&e.parent(e.context).emit(o,t)}),e),this.emitting--,this};var ri={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&&C(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ii=function(e){return b(e)?new ir(e):e},oi={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Jr(ri,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=ii(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=ii(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=ii(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=ii(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};qn.eventAliasesOn(oi);var ai={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(b(e)||j(e))return new ir(e).filter(this);if(x(e)){for(var n=this.spawn(),r=0;r<this.length;r++){var i=this[r];(t?e.apply(t,[i,r,this]):e(i,r,this))&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){b(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(b(e))return this.filter(e);for(var t=this.spawn(),n=this.length<e.length,r=n?this:e,i=n?e:this,o=0;o<r.length;o++){var a=r[o];i.has(a)&&t.push(a)}return t},xor:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];t.hasElementWithId(i._private.data.id)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),o=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r];t.hasElementWithId(o._private.data.id)?i.merge(o):n.push(o)}};return a(this,o,n),a(o,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i];!this.has(o)&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&b(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,o=0;o<e.length;o++){var a=e[o],s=a._private.data.id;if(!i.has(s)){var u=this.length++;this[u]=a,i.set(s,{ele:a,index:u})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;if(this[e]=void 0,n.delete(t),this.length>1&&e!==this.length-1){var r=this.length-1,i=this[r],o=i._private.data.id;this[r]=void 0,this[e]=i,n.set(o,{ele:i,index:e})}return this.length--,this},unmergeOne:function(e){var t=this._private.map.get((e=e[0])._private.data.id);return t?(this.unmergeAt(t.index),this):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<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=0;r<this.length;r++){var i=this[r],o=t?e.apply(t,[i,r,this]):e(i,r,this);n.push(o)}return n},reduce:function(e,t){for(var n=t,r=0;r<this.length;r++)n=e(n,this[r],r,this);return n},max:function(e,t){for(var n,r=-1/0,i=0;i<this.length;i++){var o=this[i],a=t?e.apply(t,[o,i,this]):e(o,i,this);a>r&&(r=a,n=o)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=0;i<this.length;i++){var o=this[i],a=t?e.apply(t,[o,i,this]):e(o,i,this);a<r&&(r=a,n=o)}return{value:r,ele:n}}},si=ai;si.u=si["|"]=si["+"]=si.union=si.or=si.add,si["\\"]=si["!"]=si["-"]=si.difference=si.relativeComplement=si.subtract=si.not,si.n=si["&"]=si["."]=si.and=si.intersection=si.intersect,si["^"]=si["(+)"]=si["(-)"]=si.symmetricDifference=si.symdiff=si.xor,si.fnFilter=si.filterFn=si.stdFilter=si.filter,si.complement=si.abscomp=si.absoluteComplement;var ui=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?se:0}var i=r(e)-r(t);if(0!==i)return i;function o(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=o(e)-o(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},ci={forEach:function(e,t){if(x(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!x(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(ui)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:se-1}var r=t.target,i=t.source.zDepth(),o=r.zDepth();return Math.max(i,o,0)}}};ci.each=ci.forEach,"undefined"!=("undefined"==typeof Symbol?"undefined":a(Symbol))&&"undefined"!=a(Symbol.iterator)&&(ci[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return l({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var li=be({nodeDimensionsIncludeLabels:!1}),di={layoutDimensions:function(e){var t;if(e=li(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),o=t.eles,a=function(e){return e.id()},s=B(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=t.spacingFactor&&1!==t.spacingFactor,c=function(){if(!u)return null;for(var e=tt(),t=0;t<r.length;t++){var n=s(r[t],t);nt(e,n.x,n.y)}return e}(),l=B((function(e,n){var r=s(e,n);return u&&(r=function(e,t,n){var r=t.x1+t.w/2,i=t.y1+t.h/2;return{x:r+(n.x-r)*e,y:i+(n.y-i)*e}}(Math.abs(t.spacingFactor),c,r)),null!=t.transform&&(r=t.transform(e,r)),r}),a);if(t.animate){for(var d=0;d<r.length;d++){var h=r[d],f=l(h,d);if(null==t.animateFilter||t.animateFilter(h,d)){var p=h.animation({position:f,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(p)}else h.position(f)}if(t.fit){var v=i.animation({fit:{boundingBox:o.boundingBoxAt(l),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Rn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(l),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(R({},e,{eles:this}))}};function hi(e,t,n){var r,i=n._private,o=i.styleCache=i.styleCache||[];return null!=(r=o[e])?r:r=o[e]=t(n)}function fi(e,t){return e=te(e),function(n){return hi(e,t,n)}}function pi(e,t){e=te(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return hi(e,n,t)}}di.createLayout=di.makeLayout=di.layout;var vi={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};return t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)})),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();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(e))r.applyBypass(this,e,!1),this.emitAndNotify("style");else if(b(e)){if(void 0===t){var i=this[0];return i?r.getStylePropertyValue(i,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;r<this.length;r++)n.removeAllBypasses(this[r],!1);else{e=e.split(/\s+/);for(var i=0;i<this.length;i++)n.removeBypasses(this[i],e,!1)}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=r.data.parent?n.parents():null;if(o)for(var a=0;a<o.length;a++)i*=o[a].pstyle("opacity").value;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function gi(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++)if(!t(n[r]))return!1;return!0}function yi(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],o=e.hasCompoundNodes();if(i){var a=i._private;if(!t(i))return!1;if(i.isNode())return!o||gi(i,r);var s=a.source,u=a.target;return n(s)&&(!o||gi(s,n))&&(s===u||n(u)&&(!o||gi(u,n)))}}}var mi=fi("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));vi.takesUpSpace=pi("takesUpSpace",yi({ok:mi}));var bi=fi("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&mi(e)})),xi=fi("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&mi(e)}));vi.interactive=pi("interactive",yi({ok:bi,parentOk:xi,edgeOkViaNode:mi})),vi.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var wi=fi("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&mi(e)}));vi.visible=pi("visible",yi({ok:wi,edgeOkViaNode:mi})),vi.hidden=function(){var e=this[0];if(e)return!e.visible()},vi.isBundledBezier=pi("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()})),vi.bypass=vi.css=vi.style,vi.renderedCss=vi.renderedStyle,vi.removeBypass=vi.removeCss=vi.removeStyle,vi.pstyle=vi.parsedStyle;var Ei={};function ki(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&x(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&w(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var u=this[s],c=!e.ableField||u._private[e.ableField],l=u._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(u);if(void 0!==d&&(c=d,!d))return this}c&&(u._private[e.field]=e.value,l&&n.push(u))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),a&&h.emit(a)}return this}}function Pi(e){Ei[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},Ei[e.on]=ki({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),Ei[e.off]=ki({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}Pi({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),Pi({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),Pi({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),Pi({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),Ei.deselect=Ei.unselect,Ei.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},Pi({field:"active",on:"activate",off:"unactivate"}),Pi({field:"pannable",on:"panify",off:"unpanify"}),Ei.inactive=function(){var e=this[0];if(e)return!e._private.active};var ji={},Ci=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var o=!1,a=i.connectedEdges(),s=0;s<a.length;s++){var u=a[s],c=u.source(),l=u.target();if(e.noIncomingEdges&&l===i&&c!==i||e.noOutgoingEdges&&c===i&&l!==i){o=!0;break}}o||n.push(i)}}return this.spawn(n,!0).filter(t)}},_i=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],u=s.source(),c=s.target();e.outgoing&&u===i?(n.push(s),n.push(c)):e.incoming&&c===i&&(n.push(s),n.push(u))}}return this.spawn(n,!0).filter(t)}},Si=function(e){return function(t){for(var n=this,r=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(0===o.length)break;for(var a=!1,s=0;s<o.length;s++){var u=o[s],c=u.id();i[c]||(i[c]=!0,r.push(u),a=!0)}if(!a)break;n=o}return this.spawn(r,!0).filter(t)}};function Oi(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function Di(e){return function(t){var n=[],r=this._private.cy,i=e||{};b(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var a=t[o]._private.edges,s=0;s<a.length;s++){var u=a[s],c=u._private.data,l=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),d=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target);if(l||d){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!l)continue;if(i.thisIsTgt&&!d)continue}n.push(u)}}return this.spawn(n,!0)}}function Ti(e){return e=R({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,o=0;o<r.length;o++)for(var a=r[o]._private,s=a.source,u=s._private.data.id,c=a.data.target,l=s._private.edges,d=0;d<l.length;d++){var h=l[d],f=h._private.data,p=f.target,v=f.source,g=p===c&&v===u;(i.codirected&&g||!i.codirected&&(g||u===p&&c===v))&&n.push(h)}return this.spawn(n,!0).filter(t)}}ji.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},R(ji,{roots:Ci({noIncomingEdges:!0}),leaves:Ci({noOutgoingEdges:!0}),outgoers:cr(_i({outgoing:!0}),"outgoers"),successors:Si({outgoing:!0}),incomers:cr(_i({incoming:!0}),"incomers"),predecessors:Si({incoming:!0})}),R(ji,{neighborhood:cr((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],u=s.source(),c=s.target(),l=i===u?c:u;l.length>0&&t.push(l[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),ji.neighbourhood=ji.neighborhood,ji.closedNeighbourhood=ji.closedNeighborhood,ji.openNeighbourhood=ji.openNeighborhood,R(ji,{source:cr((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:cr((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:Oi({attr:"source"}),targets:Oi({attr:"target"})}),R(ji,{edgesWith:cr(Di(),"edgesWith"),edgesTo:cr(Di({thisIsSrc:!0}),"edgesTo")}),R(ji,{connectedEdges:cr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,o=0;o<i.length;o++)t.push(i[o])}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:cr((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:cr(Ti(),"parallelEdges"),codirectedEdges:cr(Ti({codirected:!0}),"codirectedEdges")}),R(ji,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),o=[];null!=e&&i.empty()&&(i=e.sources());var a=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();o.push(e);var r=i[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),ji.componentsOf=ji.components;var Bi=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0!==e){var r=new Pe,i=!1;if(t){if(t.length>0&&E(t[0])&&!C(t[0])){i=!0;for(var o=[],a=new Ce,s=0,u=t.length;s<u;s++){var c=t[s];null==c.data&&(c.data={});var l=c.data;if(null==l.id)l.id=ge();else if(e.hasElementWithId(l.id)||a.has(l.id))continue;var d=new _e(e,c,!1);o.push(d),a.add(l.id)}t=o}}else t=[];this.length=0;for(var h=0,f=t.length;h<f;h++){var p=t[h][0];if(null!=p){var v=p._private.data.id;n&&r.has(v)||(n&&r.set(v,{index:this.length,ele:p}),this[this.length]=p,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new Pe,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=r),i&&this.restore()}else he("A collection must have a reference to the core")},Mi=_e.prototype=Bi.prototype=Object.create(Array.prototype);Mi.instanceString=function(){return"collection"},Mi.spawn=function(e,t){return new Bi(this.cy(),e,t)},Mi.spawnSelf=function(){return this.spawn(this)},Mi.cy=function(){return this._private.cy},Mi.renderer=function(){return this._private.cy.renderer()},Mi.element=function(){return this[0]},Mi.collection=function(){return _(this)?this:new Bi(this._private.cy,[this])},Mi.unique=function(){return new Bi(this._private.cy,this,!0)},Mi.hasElementWithId=function(e){return this._private.map.has(e=""+e)},Mi.getElementById=function(e){var t=this._private.cy,n=this._private.map.get(e=""+e);return n?n.ele:new Bi(t)},Mi.$id=Mi.getElementById,Mi.poolIndex=function(){return this._private.cy._private.elements._private.map.get(this[0]._private.data.id).index},Mi.indexOf=function(e){return this._private.map.get(e[0]._private.data.id).index},Mi.indexOfId=function(e){return this._private.map.get(e=""+e).index},Mi.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(E(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var o=!1,a={},s=e.data.source,u=e.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=u&&u!=i.target&&(a.target=""+u,o=!0),o&&(t=t.move(a))}else{var c=e.data.parent;!("parent"in e.data)||null==c&&null==i.parent||c==i.parent||(void 0===c&&(c=null),null!=c&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var l=function(n,i,o){var a=e[n];null!=a&&a!==r[n]&&(a?t[i]():t[o]())};return l("removed","remove","restore"),l("selected","select","unselect"),l("selectable","selectify","unselectify"),l("locked","lock","unlock"),l("grabbable","grabify","ungrabify"),l("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var d={data:ve(r.data),position:ve(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:""},h=0;return r.classes.forEach((function(e){return d.classes+=0==h++?e:" "+e})),d}}},Mi.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},Mi.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new _e(e,r,!1);t.push(i)}return new Bi(e,t)},Mi.copy=Mi.clone,Mi.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],u=[],c=0,l=i.length;c<l;c++){var d=i[c];r&&!d.removed()||(d.isNode()?s.push(d):u.push(d))}e=s.concat(u);var h=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var f=e[t],p=f._private,v=p.data;if(f.clearTraversalCache(),r||p.removed)if(void 0===v.id)v.id=ge();else if(k(v.id))v.id=""+v.id;else{if(D(v.id)||!b(v.id)){he("Can not create element with invalid string ID `"+v.id+"`"),h();continue}if(o.hasElementWithId(v.id)){he("Can not create second element with ID `"+v.id+"`"),h();continue}}var g=v.id;if(f.isNode()){var y=p.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(f.isEdge()){for(var m=f,x=["source","target"],w=x.length,E=!1,P=0;P<w;P++){var j=x[P],C=v[j];k(C)&&(C=v[j]=""+v[j]),null==C||""===C?(he("Can not create edge `"+g+"` with unspecified "+j),E=!0):o.hasElementWithId(C)||(he("Can not create edge `"+g+"` with nonexistant "+j+" `"+C+"`"),E=!0)}if(E){h();continue}var _=o.getElementById(v.source),S=o.getElementById(v.target);_.same(S)?_._private.edges.push(m):(_._private.edges.push(m),S._private.edges.push(m)),m._private.source=_,m._private.target=S}p.map=new Pe,p.map.set(g,{ele:f,index:0}),p.removed=!1,r&&o.addToPool(f)}for(var O=0;O<s.length;O++){var T=s[O],B=T._private.data;k(B.parent)&&(B.parent=""+B.parent);var M=B.parent,N=null!=M;if(N){var I=o.getElementById(M);if(I.empty())B.parent=void 0;else{for(var A=!1,L=I;!L.empty();){if(T.same(L)){A=!0,B.parent=void 0;break}L=L.parent()}A||(I[0]._private.children.push(T),T._private.parent=I[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var z=e.length===i.length?i:new Bi(o,e),R=0;R<z.length;R++){var F=z[R];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(z).merge(z.connectedNodes()).merge(z.parent()):z).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?z.emitAndNotify("add"):r&&z.emit("add")}return i},Mi.removed=function(){var e=this[0];return e&&e._private.removed},Mi.inside=function(){var e=this[0];return e&&!e._private.removed},Mi.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)u(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)u(t[n])}function u(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var c=0,l=n.length;c<l;c++){var d=n[c];u(d)}function h(e,t){xe(e._private.edges,t),e.clearTraversalCache()}function f(e){e.clearTraversalCache()}var p=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();xe(n,t),t._private.parent=null,p.ids[r]||(p.ids[r]=!0,p.push(e))}p.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var y=r[g];if(y.isEdge()){var m=y.source()[0],b=y.target()[0];h(m,y),h(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var E=x[w];f(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var k=y.parent();0!==k.length&&v(k,y)}t&&(y._private.removed=!0)}var P=o._private.elements;o._private.hasCompoundNodes=!1;for(var j=0;j<P.length;j++){var C=P[j];if(C.isParent()){o._private.hasCompoundNodes=!0;break}}var _=new Bi(this.cy(),r);_.size()>0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var S=0;S<p.length;S++){var O=p[S];t&&O.removed()||O.updateStyle()}return _},Mi.move=function(e){var t=this._private.cy,n=this,r=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var i=r(e.source),o=r(e.target),a=null!=i&&t.hasElementWithId(i),s=null!=o&&t.hasElementWithId(o);(a||s)&&(t.batch((function(){n.remove(!1,!1),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],r=t._private.data;t.isEdge()&&(a&&(r.source=i),s&&(r.target=o))}n.restore(!1,!1)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var u=r(e.parent);if(null===u||t.hasElementWithId(u)){var c=null===u?void 0:u;t.batch((function(){var e=n.remove(!1,!1);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var r=n[t],i=r._private.data;r.isNode()&&(i.parent=c)}e.restore(!1,!1)})),n.emitAndNotify("move")}}return this},[Bn,Xn,Yn,ar,lr,yr,mr,Wr,oi,ai,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},ci,di,vi,Ei,ji].forEach((function(e){R(Mi,e)}));var Ni={add:function(e){var t,n=this;if(j(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],o=0;o<r.length;o++)i.push(r[o].json());t=new Bi(n,i)}}else if(w(e))t=new Bi(n,e);else if(E(e)&&(w(e.nodes)||w(e.edges))){for(var a=e,s=[],u=["nodes","edges"],c=0,l=u.length;c<l;c++){var d=u[c],h=a[d];if(w(h))for(var f=0,p=h.length;f<p;f++){var v=R({group:d},h[f]);s.push(v)}}t=new Bi(n,s)}else t=new _e(n,e).collection();return t},remove:function(e){return j(e)||b(e)&&(e=this.$(e)),e.remove()}},Ii=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+1/6*(i.dx+2*(o.dx+a.dx)+s.dx)*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,u={x:-1,v:0,tension:null,friction:null},c=[0],l=0;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,u.tension=t,u.friction=r,a=(o=null!==i)?(l=e(t,r))/i*.016:.016;s=n(s||u,a),c.push(1+s.x),l+=16,Math.abs(s.x)>1e-4&&Math.abs(s.v)>1e-4;);return o?function(e){return c[e*(c.length-1)|0]}:l}}(),Ai=function(e,t,n,r){var i=function(e,t,n,r){var i=4,o=.001,a=1e-7,s=10,u=11,c=1/(u-1),l="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=l?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 o=0;o<i;++o){var a=y(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<u;++t)h[t]=g(t*c,e,n)}function x(t,r,i){var o,u,c=0;do{(o=g(u=r+(i-r)/2,e,n)-t)>0?i=u:r=u}while(Math.abs(o)>a&&++c<s);return u}function w(t){for(var r=0,i=1,a=u-1;i!==a&&h[i]<=t;++i)r+=c;--i;var s=r+(t-h[i])/(h[i+1]-h[i])*c,l=y(s,e,n);return l>=o?m(t,s):0===l?s:x(t,r,r+c)}var E=!1;function k(){E=!0,e===t&&n===r||b()}var P=function(i){return E||k(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};P.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var j="generateBezier("+[e,t,n,r]+")";return P.toString=function(){return j},P}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Li={linear:function(e,t,n){return e+(t-e)*n},ease:Ai(.25,.1,.25,1),"ease-in":Ai(.42,0,1,1),"ease-out":Ai(0,0,.58,1),"ease-in-out":Ai(.42,0,.58,1),"ease-in-sine":Ai(.47,0,.745,.715),"ease-out-sine":Ai(.39,.575,.565,1),"ease-in-out-sine":Ai(.445,.05,.55,.95),"ease-in-quad":Ai(.55,.085,.68,.53),"ease-out-quad":Ai(.25,.46,.45,.94),"ease-in-out-quad":Ai(.455,.03,.515,.955),"ease-in-cubic":Ai(.55,.055,.675,.19),"ease-out-cubic":Ai(.215,.61,.355,1),"ease-in-out-cubic":Ai(.645,.045,.355,1),"ease-in-quart":Ai(.895,.03,.685,.22),"ease-out-quart":Ai(.165,.84,.44,1),"ease-in-out-quart":Ai(.77,0,.175,1),"ease-in-quint":Ai(.755,.05,.855,.06),"ease-out-quint":Ai(.23,1,.32,1),"ease-in-out-quint":Ai(.86,0,.07,1),"ease-in-expo":Ai(.95,.05,.795,.035),"ease-out-expo":Ai(.19,1,.22,1),"ease-in-out-expo":Ai(1,0,0,1),"ease-in-circ":Ai(.6,.04,.98,.335),"ease-out-circ":Ai(.075,.82,.165,1),"ease-in-out-circ":Ai(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Li.linear;var r=Ii(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":Ai};function zi(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Ri(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Fi(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Ri(e,i),s=Ri(t,i);if(k(a)&&k(s))return zi(o,a,s,n,r);if(w(a)&&w(s)){for(var u=[],c=0;c<s.length;c++){var l=a[c],d=s[c];if(null!=l&&null!=d){var h=zi(o,l,d,n,r);u.push(h)}else u.push(d)}return u}}function Vi(e,t,n,r){var i=!r,o=e._private,a=t._private,s=a.easing,u=a.startTime,c=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=Li.linear;else{var l,d,h;l=b(s)?c.parse("transition-timing-function",s).value:s,b(l)?(d=l,h=[]):(d=l[1],h=l.slice(2).map((function(e){return+e}))),h.length>0?("spring"===d&&h.push(a.duration),a.easingImpl=Li[d].apply(null,h)):a.easingImpl=Li[d]}var f,p=a.easingImpl;if(f=0===a.duration?1:(n-u)/a.duration,a.applying&&(f=a.progress),f<0?f=0:f>1&&(f=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&i&&!e.locked()){var y={};qi(v.x,g.x)&&(y.x=Fi(v.x,g.x,f,p)),qi(v.y,g.y)&&(y.y=Fi(v.y,g.y,f,p)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(qi(m.x,x.x)&&(w.x=Fi(m.x,x.x,f,p)),qi(m.y,x.y)&&(w.y=Fi(m.y,x.y,f,p)),e.emit("pan"));var k=a.startZoom,P=a.zoom,j=null!=P&&r;j&&(qi(k,P)&&(o.zoom=et(o.minZoom,Fi(k,P,f,p),o.maxZoom)),e.emit("zoom")),(E||j)&&e.emit("viewport");var C=a.style;if(C&&C.length>0&&i){for(var _=0;_<C.length;_++){var S=C[_],O=S.name,D=a.startStyle[O],T=Fi(D,S,f,p,c.properties[D.name]);c.overrideBypass(e,O,T)}e.emit("style")}}return a.progress=f,f}function qi(e,t){return!(null==e||null==t||!(k(e)&&k(t)||e&&t))}function Xi(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Yi(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,o=i.animation.current,a=i.animation.queue,s=!1;if(0===o.length){var u=a.shift();u&&o.push(u)}for(var c=function(e){for(var t=e.length-1;t>=0;t--)(0,e[t])();e.splice(0,e.length)},l=o.length-1;l>=0;l--){var d=o[l],h=d._private;h.stopped?(o.splice(l,1),h.hooked=!1,h.playing=!1,h.started=!1,c(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Xi(0,d,e),Vi(t,d,e,n),h.applying&&(h.applying=!1),c(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(l,1),h.hooked=!1,h.playing=!1,h.started=!1,c(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a<n.length;a++){var s=i(n[a]);o=o||s}var u=i(t,!0);(o||u)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Wi={animate:qn.animate(),animation:qn.animation(),animated:qn.animated(),clearQueue:qn.clearQueue(),delay:qn.delay(),delayAnimation:qn.delayAnimation(),stop:qn.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){Yi(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&G((function(n){Yi(n,e),t()}))}()}}},Hi={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&&C(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}},Gi=function(e){return b(e)?new ir(e):e},Ui={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Jr(Hi,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Gi(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Gi(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Gi(t),n),this},once:function(e,t,n){return this.emitter().one(e,Gi(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}};qn.eventAliasesOn(Ui);var Ki={png:function(e){return this._private.renderer.png(e=e||{})},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ki.jpeg=Ki.jpg;var Zi={layout:function(e){if(null!=e)if(null!=e.name){var t,n=e.name,r=this.extension("layout",n);if(null!=r)return t=b(e.eles)?this.$(e.eles):null!=e.eles?e.eles:this.$(),new r(R({},e,{cy:this,eles:t}));he("No such layout `"+n+"` 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")}};Zi.createLayout=Zi.makeLayout=Zi.layout;var $i={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;r<n.length;r++){var i=n[r],o=e[i];t.getElementById(i).data(o)}}))}},Qi=be({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Ji={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this.extension("renderer",e.name);if(null!=t){void 0!==e.wheelSensitivity&&pe("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Qi(e);n.cy=this,this._private.renderer=new t(n),this.notify("init")}else he("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){this.notify("destroy");var e=this.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)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)}};Ji.invalidateDimensions=Ji.resize;var eo={collection:function(e,t){return b(e)?this.$(e):j(e)?e.collection():w(e)?new Bi(this,e,t):new Bi(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}};eo.elements=eo.filter=eo.$;var to={apply:function(e){for(var t=this._private.cy.collection(),n=0;n<e.length;n++){var r=e[n],i=this.getContextMeta(r);if(!i.empty){var o=this.getContextStyle(i),a=this.applyContextStyle(i,o,r);r._private.appliedInitStyle?this.updateTransitions(r,a.diffProps):r._private.appliedInitStyle=!0,this.updateStyleHints(r)&&t.push(r)}}return t},getPropertiesDiff:function(e,t){var n=this._private.propDiffs=this._private.propDiffs||{},r=e+"-"+t,i=n[r];if(i)return i;for(var o=[],a={},s=0;s<this.length;s++){var u=this[s],c="t"===t[s],l="t"===e[s]!==c,d=u.mappedProperties.length>0;if(l||c&&d){var h=void 0;l&&d||l?h=u.properties:d&&(h=u.mappedProperties);for(var f=0;f<h.length;f++){for(var p=h[f],v=p.name,g=!1,y=s+1;y<this.length&&("t"!==t[y]||!(g=null!=this[y].properties[p.name]));y++);a[v]||g||(a[v]=!0,o.push(v))}}}return n[r]=o,o},getContextMeta:function(e){for(var t,n="",r=e._private.styleCxtKey||"",i=0;i<this.length;i++){var o=this[i];n+=o.selector&&o.selector.matches(e)?"t":"f"}return t=this.getPropertiesDiff(r,n),e._private.styleCxtKey=n,{key:n,diffPropNames:t,empty:0===t.length}},getContextStyle:function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var o=this[i];if("t"===t[i])for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},applyContextStyle:function(e,t,n){for(var r=e.diffPropNames,i={},o=this.types,a=0;a<r.length;a++){var s=r[a],u=t[s],c=n.pstyle(s);if(!u){if(!c)continue;u=c.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(c!==u){if(u.mapped===o.fn&&null!=c&&null!=c.mapping&&c.mapping.value===u.value){var l=c.mapping;if((l.fnValue=u.value(n))===l.prevFnValue)continue}var d=i[s]={prev:c};this.applyParsedProperty(n,u),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},updateStyleHints:function(e){var t,n=e._private,r=this,i=r.propertyGroupKeys,o=function(e,t,n){return r.getPropertiesHash(e,t,n)},a=n.styleKey;if(e.removed())return!1;var s="nodes"===n.group,u=e._private.style;t=Object.keys(u);for(var c=0;c<i.length;c++)n.styleKeys[i[c]]=[9261,5381];for(var l,d=function(e,t){return n.styleKeys[t][0]=$(e,n.styleKeys[t][0])},h=function(e,t){return n.styleKeys[t][1]=Q(e,n.styleKeys[t][1])},f=function(e,t){d(e,t),h(e,t)},p=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);d(r,t),h(r,t)}},v=0;v<t.length;v++){var g=t[v],y=u[g];if(null!=y){var m=this.properties[g],b=m.type,x=m.groupKey,w=void 0;null!=m.hashOverride?w=m.hashOverride(e,y):null!=y.pfValue&&(w=y.pfValue);var E=null==m.enums?y.value:null,k=null!=w,P=y.units;!b.number||!k&&null==E||b.multiple?p(y.strValue,x):(f(-128<(l=k?w:E)&&l<128&&Math.floor(l)!==l?2e9-(1024*l|0):l,x),k||null==P||p(P,x))}}for(var j=[9261,5381],C=0;C<i.length;C++){var _=n.styleKeys[i[C]];j[0]=$(_[0],j[0]),j[1]=Q(_[1],j[1])}n.styleKey=2097152*j[0]+j[1];var S=n.styleKeys;n.labelDimsKey=J(S.labelDimensions);var O=o(e,["label"],S.labelDimensions);if(n.labelKey=J(O),n.labelStyleKey=J(ee(S.commonLabel,O)),!s){var D=o(e,["source-label"],S.labelDimensions);n.sourceLabelKey=J(D),n.sourceLabelStyleKey=J(ee(S.commonLabel,D));var T=o(e,["target-label"],S.labelDimensions);n.targetLabelKey=J(T),n.targetLabelStyleKey=J(ee(S.commonLabel,T))}if(s){var B=n.styleKeys,M=B.pie,N=[B.nodeBody,B.nodeBorder,B.backgroundImage,B.compound,M].filter((function(e){return null!=e})).reduce(ee,[9261,5381]);n.nodeKey=J(N),n.hasPie=null!=M&&9261!==M[0]&&5381!==M[1]}return a!==n.styleKey},clearStyleHints:function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},applyParsedProperty:function(e,t){var n,r=this,i=t,o=e._private.style,a=r.types,s=r.properties[i.name].type,u=i.bypass,c=o[i.name],l=c&&c.bypass,d=e._private,h=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},f=function(){var t=h(c),n=h(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&pe("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",u)),i.delete)return o[i.name]=void 0,f(),!0;if(i.deleteBypassed)return c?!!c.bypass&&(c.bypassed=void 0,f(),!0):(f(),!0);if(i.deleteBypass)return c?!!c.bypass&&(o[i.name]=c.bypassed,f(),!0):(f(),!0);var p=function(){pe("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case a.mapData:for(var v,g=i.field.split("."),y=d.data,m=0;m<g.length&&y;m++)y=y[g[m]];if(null==y)return p(),!1;if(!k(y))return pe("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;var b=i.fieldMax-i.fieldMin;if((v=0===b?0:(y-i.fieldMin)/b)<0?v=0:v>1&&(v=1),s.color){var x=i.valueMin[0],w=i.valueMin[1],E=i.valueMax[1],P=i.valueMin[2],j=i.valueMax[2],C=null==i.valueMin[3]?1:i.valueMin[3],_=null==i.valueMax[3]?1:i.valueMax[3],S=[Math.round(x+(i.valueMax[0]-x)*v),Math.round(w+(E-w)*v),Math.round(P+(j-P)*v),Math.round(C+(_-C)*v)];n={bypass:i.bypass,name:i.name,value:S,strValue:"rgb("+S[0]+", "+S[1]+", "+S[2]+")"}}else{if(!s.number)return!1;n=this.parse(i.name,i.valueMin+(i.valueMax-i.valueMin)*v,i.bypass,"mapping")}if(!n)return p(),!1;n.mapping=i,i=n;break;case a.data:for(var O=i.field.split("."),D=d.data,T=0;T<O.length&&D;T++)D=D[O[T]];if(null!=D&&(n=this.parse(i.name,D,i.bypass,"mapping")),!n)return p(),!1;n.mapping=i,i=n;break;case a.fn:var B=null!=i.fnValue?i.fnValue:(0,i.value)(e);if(i.prevFnValue=B,null==B)return pe("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,B,i.bypass,"mapping")))return pe("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=ve(i),i=n;break;case void 0:break;default:return!1}return u?(i.bypassed=l?c.bypassed:c,o[i.name]=i):l?c.bypassed=i:o[i.name]=i,f(),!0},cleanElements:function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],u=i[s];null!=u&&(u.bypass?u.bypassed=null:i[s]=null)}else r._private.style={}}},update:function(){this._private.cy.mutableElements().updateStyle()},updateTransitions:function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},u=!1,c=0;c<i.length;c++){var l=i[c],d=e.pstyle(l),h=t[l];if(h){var f=h.prev,p=null!=h.next?h.next:d,v=!1,g=void 0;f&&(k(f.pfValue)&&k(p.pfValue)?g=f.pfValue+1e-6*(v=p.pfValue-f.pfValue):k(f.value)&&k(p.value)?g=f.value+1e-6*(v=p.value-f.value):w(f.value)&&w(p.value)&&(v=f.value[0]!==p.value[0]||f.value[1]!==p.value[1]||f.value[2]!==p.value[2],g=f.strValue),v&&(s[l]=p.strValue,this.applyBypass(e,l,g),u=!0))}}if(!u)return;r.transitioning=!0,new Rn((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,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)},checkTrigger:function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},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)}))},checkBoundsTrigger:function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),"curve-style"!==t||"bezier"!==n&&"bezier"!==r||!i.triggersBoundsOfParallelBeziers||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},checkTriggers:function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)}},no={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;o<this.properties.length;o++){var a=this.parse(this.properties[o].name,n,!0);a&&i.push(a)}}else if(b(t)){var s=this.parse(t,n,!0);s&&i.push(s)}else{if(!E(t))return!1;var u=t;r=n;for(var c=Object.keys(u),l=0;l<c.length;l++){var d=c[l],h=u[d];if(void 0===h&&(h=u[N(d)]),void 0!==h){var f=this.parse(d,h,!0);f&&i.push(f)}}}if(0===i.length)return!1;for(var p=!1,v=0;v<e.length;v++){for(var g=e[v],y={},m=void 0,x=0;x<i.length;x++){var w=i[x];if(r){var k=g.pstyle(w.name);m=y[w.name]={prev:k}}p=this.applyParsedProperty(g,ve(w))||p,r&&(m.next=g.pstyle(w.name))}p&&this.updateStyleHints(g),r&&this.updateTransitions(g,y,!0)}return p},overrideBypass:function(e,t,n){t=M(t);for(var r=0;r<e.length;r++){var i=e[r],o=i._private.style[t],a=this.properties[t].type,s=a.color,u=a.mutiple,c=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,null!=o.pfValue&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":u?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,c,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],o={},a=0;a<t.length;a++){var s=t[a],u=this.properties[s],c=i.pstyle(u.name);if(c&&c.bypass){var l=this.parse(s,"",!0),d=o[u.name]={prev:c};this.applyParsedProperty(i,l),d.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,o,!0)}}},ro={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(h&&t&&h.getComputedStyle)return h.getComputedStyle(t).getPropertyValue(e)}},io={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){if(e=e[0]){for(var n={},r=0;r<this.properties.length;r++){var i=this.properties[r],o=this.getStylePropertyValue(e,i.name,t);null!=o&&(n[i.name]=o,n[N(i.name)]=o)}return n}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,o=e.pstyle(r.name);if(o){var a=o.value,s=o.units,u=o.strValue;if(n&&i.number&&null!=a&&k(a)){var c=e.cy().zoom(),l=function(e){return e*c},d=function(e,t){return l(e)+t},h=w(a);return(h?s.every((function(e){return null!=e})):null!=s)?h?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):h?a.map((function(e){return b(e)?e:""+l(e)})).join(" "):""+l(a)}if(null!=u)return u}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,o=e.pstyle(i);void 0!==o&&(o=E(o)?this.parse(i,o.strValue):this.parse(i,o)),o&&(n[i]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a],u=r[a]||r[M(a)],c=this.parse(u.name,s);c&&t.push(c)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,o,a,s,u=n.slice();for(a=0;a<t.length;a++)if(null!=(r=e.pstyle(t[a],!1)))if(null!=r.pfValue)u[0]=$(o,u[0]),u[1]=Q(o,u[1]);else for(i=r.strValue,s=0;s<i.length;s++)o=i.charCodeAt(s),u[0]=$(o,u[0]),u[1]=Q(o,u[1]);return u}};io.getPropertiesHash=io.getNonDefaultPropertiesHash;var oo={appendFromJson:function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.selector,i=n.style||n.css,o=Object.keys(i);this.selector(r);for(var a=0;a<o.length;a++){var s=o[a];this.css(s,i[s])}}return this},fromJson:function(e){return this.resetToDefault(),this.appendFromJson(e),this},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},ao={appendFromString:function(e){var t,n,r,i=""+e;function o(){i=i.length>t.length?i.substr(t.length):""}function a(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");!i.match(/^\s*$/);){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&&new ir(u).invalid)pe("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),o();else{var c=s[2],l=!1;n=c;for(var d=[];!n.match(/^\s*$/);){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:"+c),l=!0;break}r=h[0];var f=h[1],p=h[2];this.properties[f]?this.parse(f,p)?(d.push({name:f,val:p}),a()):(pe("Skipping property: Invalid property definition in: "+r),a()):(pe("Skipping property: Invalid property name in: "+r),a())}if(l){o();break}this.selector(u);for(var v=0;v<d.length;v++){var g=d[v];this.css(g.name,g.val)}o()}}return this},fromString:function(e){return this.resetToDefault(),this.appendFromString(e),this}},so={};!function(){var e=L,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[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+)?))))?\\)|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+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];so.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return b(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||0==e&&0!=t||0!=e&&0==t},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=D(e),r=D(t);return n&&!r||!n&&r}},o=so.types,a=[{name:"label",type:o.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:o.text,triggersBounds:i.any},{name:"source-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:o.size,triggersBounds:i.any}],u=[{name:"target-label",type:o.text,triggersBounds:i.any},{name:"target-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:o.size,triggersBounds:i.any}],c=[{name:"font-family",type:o.fontFamily,triggersBounds:i.any},{name:"font-style",type:o.fontStyle,triggersBounds:i.any},{name:"font-weight",type:o.fontWeight,triggersBounds:i.any},{name:"font-size",type:o.size,triggersBounds:i.any},{name:"text-transform",type:o.textTransform,triggersBounds:i.any},{name:"text-wrap",type:o.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:o.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:o.size,triggersBounds:i.any},{name:"text-outline-width",type:o.size,triggersBounds:i.any},{name:"line-height",type:o.positiveNumber,triggersBounds:i.any}],l=[{name:"text-valign",type:o.valign,triggersBounds:i.any},{name:"text-halign",type:o.halign,triggersBounds:i.any},{name:"color",type:o.color},{name:"text-outline-color",type:o.color},{name:"text-outline-opacity",type:o.zeroOneNumber},{name:"text-background-color",type:o.color},{name:"text-background-opacity",type:o.zeroOneNumber},{name:"text-background-padding",type:o.size,triggersBounds:i.any},{name:"text-border-opacity",type:o.zeroOneNumber},{name:"text-border-color",type:o.color},{name:"text-border-width",type:o.size,triggersBounds:i.any},{name:"text-border-style",type:o.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:o.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:o.justification}],d=[{name:"events",type:o.bool},{name:"text-events",type:o.bool}],h=[{name:"display",type:o.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:o.visibility,triggersZOrder:i.any},{name:"opacity",type:o.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:o.zeroOneNumber},{name:"min-zoomed-font-size",type:o.size},{name:"z-compound-depth",type:o.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:o.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:o.nonNegativeInt,triggersZOrder:i.any}],f=[{name:"overlay-padding",type:o.size,triggersBounds:i.any},{name:"overlay-color",type:o.color},{name:"overlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero}],p=[{name:"transition-property",type:o.propList},{name:"transition-duration",type:o.time},{name:"transition-delay",type:o.time},{name:"transition-timing-function",type:o.easing}],v=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},g=[{name:"height",type:o.nodeSize,triggersBounds:i.any,hashOverride:v},{name:"width",type:o.nodeSize,triggersBounds:i.any,hashOverride:v},{name:"shape",type:o.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:o.polygonPointList,triggersBounds:i.any},{name:"background-color",type:o.color},{name:"background-fill",type:o.fill},{name:"background-opacity",type:o.zeroOneNumber},{name:"background-blacken",type:o.nOneOneNumber},{name:"background-gradient-stop-colors",type:o.colors},{name:"background-gradient-stop-positions",type:o.percentages},{name:"background-gradient-direction",type:o.gradientDirection},{name:"padding",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:o.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:o.boundsExpansion,triggersBounds:i.any}],y=[{name:"border-color",type:o.color},{name:"border-opacity",type:o.zeroOneNumber},{name:"border-width",type:o.size,triggersBounds:i.any},{name:"border-style",type:o.borderStyle}],m=[{name:"background-image",type:o.urls},{name:"background-image-crossorigin",type:o.bgCrossOrigin},{name:"background-image-opacity",type:o.zeroOneNumbers},{name:"background-image-containment",type:o.bgContainment},{name:"background-image-smoothing",type:o.bools},{name:"background-position-x",type:o.bgPos},{name:"background-position-y",type:o.bgPos},{name:"background-width-relative-to",type:o.bgRelativeTo},{name:"background-height-relative-to",type:o.bgRelativeTo},{name:"background-repeat",type:o.bgRepeat},{name:"background-fit",type:o.bgFit},{name:"background-clip",type:o.bgClip},{name:"background-width",type:o.bgWH},{name:"background-height",type:o.bgWH},{name:"background-offset-x",type:o.bgPos},{name:"background-offset-y",type:o.bgPos}],x=[{name:"position",type:o.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:o.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:o.size,triggersBounds:i.any},{name:"min-width-bias-left",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:o.size,triggersBounds:i.any},{name:"min-height-bias-top",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:o.sizeMaybePercent,triggersBounds:i.any}],w=[{name:"line-style",type:o.lineStyle},{name:"line-color",type:o.color},{name:"line-fill",type:o.fill},{name:"line-cap",type:o.lineCap},{name:"line-opacity",type:o.zeroOneNumber},{name:"line-dash-pattern",type:o.numbers},{name:"line-dash-offset",type:o.number},{name:"line-gradient-stop-colors",type:o.colors},{name:"line-gradient-stop-positions",type:o.percentages},{name:"curve-style",type:o.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:o.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:o.size,triggersBounds:i.any},{name:"control-point-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:o.numbers,triggersBounds:i.any},{name:"segment-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:o.numbers,triggersBounds:i.any},{name:"taxi-turn",type:o.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:o.size,triggersBounds:i.any},{name:"taxi-direction",type:o.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:o.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:o.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:o.angle,triggersBounds:i.any},{name:"loop-sweep",type:o.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:o.size,triggersBounds:i.any},{name:"target-distance-from-node",type:o.size,triggersBounds:i.any}],E=[{name:"ghost",type:o.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:o.zeroOneNumber}],k=[{name:"selection-box-color",type:o.color},{name:"selection-box-opacity",type:o.zeroOneNumber},{name:"selection-box-border-color",type:o.color},{name:"selection-box-border-width",type:o.size},{name:"active-bg-color",type:o.color},{name:"active-bg-opacity",type:o.zeroOneNumber},{name:"active-bg-size",type:o.size},{name:"outside-texture-bg-color",type:o.color},{name:"outside-texture-bg-opacity",type:o.zeroOneNumber}],P=[];so.pieBackgroundN=16,P.push({name:"pie-size",type:o.sizeMaybePercent});for(var j=1;j<=so.pieBackgroundN;j++)P.push({name:"pie-"+j+"-background-color",type:o.color}),P.push({name:"pie-"+j+"-background-size",type:o.percent}),P.push({name:"pie-"+j+"-background-opacity",type:o.zeroOneNumber});var C=[],_=so.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:o.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:o.color},{name:"arrow-fill",type:o.arrowFill}].forEach((function(e){_.forEach((function(t){C.push({name:t+"-"+e.name,type:e.type,triggersBounds:e.triggersBounds})}))}),{});var S=so.properties=[].concat(d,p,h,f,E,l,c,a,s,u,g,y,m,P,x,w,C,k),O=so.propertyGroups={behavior:d,transition:p,visibility:h,overlay:f,ghost:E,commonLabel:l,labelDimensions:c,mainLabel:a,sourceLabel:s,targetLabel:u,nodeBody:g,nodeBorder:y,backgroundImage:m,pie:P,compound:x,edgeLine:w,edgeArrow:C,core:k},T=so.propertyGroupNames={};(so.propertyGroupKeys=Object.keys(O)).forEach((function(e){T[e]=O[e].map((function(e){return e.name})),O[e].forEach((function(t){return t.groupKey=e}))}));var B=so.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];so.propertyNames=S.map((function(e){return e.name}));for(var M=0;M<S.length;M++){var N=S[M];S[N.name]=N}for(var I=0;I<B.length;I++){var A=B[I],z={name:A.name,alias:!0,pointsTo:S[A.pointsTo]};S.push(z),S[A.name]=z}}(),so.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},so.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=R({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=so.pieBackgroundN;n++)e[t.name.replace("{{i}}",n)]=t.value;return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return so.arrowPrefixes.forEach((function(n){e[n+"-"+t.name]=t.value})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var o=i.name,a=this.parse(o,t[o]);n[o]=a}}return e.defaultProperties=n,e.defaultProperties},so.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var uo={parse:function(e,t,n,r){if(x(t))return this.parseImplWarn(e,t,n,r);var i,o=ne(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),a=this.propCache=this.propCache||[];return(i=a[o])||(i=a[o]=this.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(i=ve(i))&&(i.value=ve(i.value)),i},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||pe("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||pe("The style value of `label` is deprecated for `"+i.name+"`"),i},parseImpl:function(e,t,n,r){e=M(e);var i=this.properties[e],o=t,a=this.types;if(!i)return null;if(void 0===t)return null;i.alias&&(e=(i=i.pointsTo).name);var s=b(t);s&&(t=t.trim());var u,c,l=i.type;if(!l)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(x(t))return{name:e,value:t,strValue:"fn",mapped:a.fn,bypass:n};if(!s||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(u=new RegExp(a.data.regex).exec(t)))return!n&&{name:e,value:u,strValue:""+t,mapped:a.data,field:u[1],bypass:n};if(t.length>=10&&"m"===t[0]&&(c=new RegExp(a.mapData.regex).exec(t))){if(n)return!1;if(l.multiple)return!1;var d=a.mapData;if(!l.color&&!l.number)return!1;var h=this.parse(e,c[4]);if(!h||h.mapped)return!1;var f=this.parse(e,c[5]);if(!f||f.mapped)return!1;if(h.pfValue===f.pfValue||h.strValue===f.strValue)return pe("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+h.strValue+"`"),this.parse(e,h.strValue);if(l.color){var p=h.value,v=f.value;if(!(p[0]!==v[0]||p[1]!==v[1]||p[2]!==v[2]||p[3]!==v[3]&&(null!=p[3]&&1!==p[3]||null!=v[3]&&1!==v[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:d,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:h.value,valueMax:f.value,bypass:n}}}if(l.multiple&&"multiple"!==r){var g;if(g=s?t.split(/\s+/):w(t)?t:[t],l.evenMultiple&&g.length%2!=0)return null;for(var y=[],m=[],E=[],P="",j=!1,C=0;C<g.length;C++){var _=this.parse(e,g[C],n,"multiple");j=j||b(_.value),y.push(_.value),E.push(null!=_.pfValue?_.pfValue:_.value),m.push(_.units),P+=(C>0?" ":"")+_.strValue}return l.validate&&!l.validate(y,m)?null:l.singleEnum&&j?1===y.length&&b(y[0])?{name:e,value:y[0],strValue:y[0],bypass:n}:null:{name:e,value:y,pfValue:E,strValue:P,bypass:n,units:m}}var S,O=function(){for(var r=0;r<l.enums.length;r++)if(l.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n};return null};if(l.number){var D,T="px";if(l.units&&(D=l.units),l.implicitUnits&&(T=l.implicitUnits),!l.unitless)if(s){var B="px|em"+(l.allowPercent?"|\\%":"");D&&(B=D);var N=t.match("^("+L+")("+B+")?$");N&&(t=N[1],D=N[2]||T)}else D&&!l.implicitUnits||(D=T);if(t=parseFloat(t),isNaN(t)&&void 0===l.enums)return null;if(isNaN(t)&&void 0!==l.enums)return t=o,O();if(l.integer&&(!k(S=t)||Math.floor(S)!==S))return null;if(void 0!==l.min&&(t<l.min||l.strictMin&&t===l.min)||void 0!==l.max&&(t>l.max||l.strictMax&&t===l.max))return null;var I={name:e,value:t,strValue:""+t+(D||""),units:D,bypass:n};return I.pfValue=l.unitless||"px"!==D&&"em"!==D?t:"px"!==D&&D?this.getEmSizeInPixels()*t:t,"ms"!==D&&"s"!==D||(I.pfValue="ms"===D?t:1e3*t),"deg"!==D&&"rad"!==D||(I.pfValue="rad"===D?t:Math.PI*t/180),"%"===D&&(I.pfValue=t/100),I}if(l.propList){var A=[],z=""+t;if("none"===z);else{for(var R=z.split(/\s*,\s*|\s+/),V=0;V<R.length;V++){var q=R[V].trim();this.properties[q]?A.push(q):pe("`"+q+"` is not a valid property name")}if(0===A.length)return null}return{name:e,value:A,strValue:0===A.length?"none":A.join(" "),bypass:n}}if(l.color){var X=F(t);return X?{name:e,value:X,pfValue:X,strValue:"rgb("+X[0]+","+X[1]+","+X[2]+")",bypass:n}:null}if(l.regex||l.regexes){if(l.enums){var Y=O();if(Y)return Y}for(var W=l.regexes?l.regexes:[l.regex],H=0;H<W.length;H++){var G=new RegExp(W[H]).exec(t);if(G)return{name:e,value:l.singleRegexMatchValue?G[1]:G,strValue:""+t,bypass:n}}return null}return l.string?{name:e,value:""+t,strValue:""+t,bypass:n}:l.enums?O():null}},co=function e(t){if(!(this instanceof e))return new e(t);S(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):he("A style must have a core reference")},lo=co.prototype;lo.instanceString=function(){return"style"},lo.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},lo.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},lo.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},lo.selector=function(e){var t="core"===e?null:new ir(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},lo.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],o=n[i.name];void 0===o&&(o=n[N(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},lo.style=lo.css,lo.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},lo.append=function(e){return O(e)?e.appendToStyle(this):w(e)?this.appendFromJson(e):b(e)&&this.appendFromString(e),this},co.fromJson=function(e,t){var n=new co(e);return n.fromJson(t),n},co.fromString=function(e,t){return new co(e).fromString(t)},[to,no,ro,io,oo,ao,so,uo].forEach((function(e){R(lo,e)})),co.types=lo.types,co.properties=lo.properties,co.propertyGroups=lo.propertyGroups,co.propertyGroupNames=lo.propertyGroupNames,co.propertyGroupKeys=lo.propertyGroupKeys;var ho={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=O(e)?e.generateStyle(this):w(e)?co.fromJson(this,e):b(e)?co.fromString(this,e):co(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},fo={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,o=arguments,a=this._private.pan;switch(o.length){case 0:return a;case 1:if(b(o[0]))return a[e=o[0]];if(E(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,i=n.y,k(r)&&(a.x=r),k(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[1],"x"!==(e=o[0])&&"y"!==e||!k(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,o,a,s=arguments,u=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:E(e)&&(o=(i=s[0]).x,a=i.y,k(o)&&(u.x+=o),k(a)&&(u.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!k(r)||(u[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){var n,r;if(k(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled&&(b(e)?e=this.$(e):E(r=e)&&k(r.x1)&&k(r.x2)&&k(r.y1)&&k(r.y2)?((n={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1):j(e)||(e=this.mutableElements()),!j(e)||!e.empty())){n=n||e.boundingBox();var i,o=this.width(),a=this.height();if(t=k(t)?t:0,!isNaN(o)&&!isNaN(a)&&o>0&&a>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:i=(i=(i=Math.min((o-2*t)/n.w,(a-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:i)<this._private.minZoom?this._private.minZoom:i,pan:{x:(o-i*(n.x1+n.x2))/2,y:(a-i*(n.y1+n.y2))/2}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return k(e)&&k(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):k(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:k(t)&&void 0===e&&t>=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,o=r.zoom,a=!1;return r.zoomingEnabled||(a=!0),k(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=Xe(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,!a&&k(n)&&n!==o&&(null==t||k(t.x)&&k(t.y))?null!=t?{zoomed:!0,panned:!0,zoom:n,pan:{x:-n/o*(t.x-i.x)+t.x,y:-n/o*(t.y-i.y)+t.y}}:{zoomed:!0,panned:!1,zoom:n,pan:i}:null},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],o=!1,a=!1;if(!e)return this;if(k(e.zoom)||(n=!1),E(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;k(u.x)&&(t.pan.x=u.x,a=!1),k(u.y)&&(t.pan.y=u.y,a=!1),a||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 j(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-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),{width:r.clientWidth-(t=function(t){return parseFloat(e.getPropertyValue(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}}};fo.centre=fo.center,fo.autolockNodes=fo.autolock,fo.autoungrabifyNodes=fo.autoungrabify;var po={data:qn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:qn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:qn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:qn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};po.attr=po.data,po.removeAttr=po.removeData;var vo=function(e){var t=this,n=(e=R({},e)).container;n&&!P(n)&&P(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 o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=R({name:o?"grid":"null"},a.layout),a.renderer=R({name:o?"canvas":"null"},a.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:a,elements:new Bi(this),listeners:[],aniEles:new Bi(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:k(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&k(a.pan.x)?a.pan.x:0,y:E(a.pan)&&k(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),u.styleEnabled&&t.setStyle([]);var c=R({},a,a.renderer);t.initRenderer(c),function(e,t){if(e.some(T))return Rn.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=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(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 o=R({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),u.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e<i.length;e++)t.on("ready",i[e]);r&&(r.readies=[]),t.emit("ready")}),a.done)}))},go=vo.prototype;R(go,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!P(e)&&P(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(R({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return ve(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(E(e)){if(t.startBatch(),e.elements){var i={},o=function(e,n){for(var r=[],o=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var u=""+s.data.id,c=t.getElementById(u);i[u]=!0,0!==c.length?o.push({ele:c,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else pe("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var l=0;l<o.length;l++){var d=o[l];d.ele.json(d.json)}};if(w(e.elements))o(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var u=a[s],c=e.elements[u];w(c)&&o(c,u)}var l=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?l.merge(e):e.remove()})),l.forEach((function(e){return e.children().move({parent:null})})),l.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify"],h=0;h<d.length;h++){var f=d[h];null!=e[f]&&t[f](e[f])}return t.endBatch(),this}var p={};e?p.elements=this.elements().map((function(e){return e.json()})):(p.elements={},r.forEach((function(e){var t=e.group();p.elements[t]||(p.elements[t]=[]),p.elements[t].push(e.json())}))),this._private.styleEnabled&&(p.style=t.style().json()),p.data=ve(t.data());var v=n.options;return p.zoomingEnabled=n.zoomingEnabled,p.userZoomingEnabled=n.userZoomingEnabled,p.zoom=n.zoom,p.minZoom=n.minZoom,p.maxZoom=n.maxZoom,p.panningEnabled=n.panningEnabled,p.userPanningEnabled=n.userPanningEnabled,p.pan=ve(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=ve(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p}}),go.$id=go.getElementById,[Ni,Wi,Ui,Ki,Zi,$i,Ji,eo,ho,fo,po].forEach((function(e){R(go,e)}));var yo={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,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}},mo=function(e){return e.scratch("breadthfirst")},bo=function(e,t){return e.scratch("breadthfirst",t)};function xo(e){this.options=R({},yo,e)}xo.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,o=i.nodes().filter((function(e){return!e.isParent()})),a=i,s=n.directed,u=n.maximal||n.maximalAdjustments>0,c=tt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(j(n.roots))e=n.roots;else if(w(n.roots)){for(var l=[],d=0;d<n.roots.length;d++){var h=r.getElementById(n.roots[d]);l.push(h)}e=r.collection(l)}else if(b(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var f=i.components();e=r.collection();for(var p=function(t){var n=f[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},v=0;v<f.length;v++)p(v)}var g=[],y={},m=function(e,t){null==g[t]&&(g[t]=[]);var n=g[t].length;g[t].push(e),bo(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var o=e[0],a=o.id();m(o,i),y[a]=!0}});for(var x=[],E=0;E<o.length;E++){var k=o[E];y[k.id()]||x.push(k)}var P=function(e){for(var t=g[e],n=0;n<t.length;n++){var r=t[n];null!=r?bo(r,{depth:e,index:n}):(t.splice(n,1),n--)}},C=function(){for(var e=0;e<g.length;e++)P(e)},_=function(e,t){for(var n=mo(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,a=e.id(),s=0;s<r.length;s++){var u=mo(r[s]);o=Math.max(o,u.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=mo(e);g[n.depth][n.index]=null,m(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&u){var S=[],O={},D=function(e){return S.push(e)};for(o.forEach((function(e){return S.push(e)}));S.length>0;){var T=S.shift(),B=_(T,O);if(B)T.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(D);else if(null===B){pe("Detected double maximal shift for node `"+T.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}C();var M=0;if(n.avoidOverlap)for(var N=0;N<o.length;N++){var I=o[N].layoutDimensions(n);M=Math.max(M,I.w,I.h)}for(var A={},L=function(e){if(A[e.id()])return A[e.id()];for(var t=mo(e).depth,n=e.neighborhood(),r=0,i=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&o.has(s)){var u=mo(s);if(null!=u){var c=u.index,l=u.depth;null!=c&&null!=l&&l<t&&(r+=c/g[l].length,i++)}}}return r/=i=Math.max(1,i),0===i&&(r=0),A[e.id()]=r,r},R=function(e,t){var n=L(e)-L(t);return 0===n?z(e.id(),t.id()):n},F=0;F<g.length;F++)g[F].sort(R),P(F);for(var V=[],q=0;q<x.length;q++)V.push(x[q]);g.unshift(V),C();for(var X=0,Y=0;Y<g.length;Y++)X=Math.max(g[Y].length,X);var W=c.x1+c.w/2,H=c.x1+c.h/2,G=g.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=mo(e),r=t.depth,i=t.index,o=g[r].length,a=Math.max(c.w/((n.grid?G:o)+1),M),s=Math.max(c.h/(g.length+1),M),u=Math.min(c.w/2/g.length,c.h/2/g.length);if(u=Math.max(u,M),n.circle){var l=u*r+u-(g.length>0&&g[0].length<=3?u/2:0),d=2*Math.PI/g[r].length*i;return 0===r&&1===g[0].length&&(l=1),{x:W+l*Math.cos(d),y:H+l*Math.sin(d)}}return{x:W+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var wo={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 Eo(e){this.options=R({},wo,e)}Eo.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=tt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),u=s.x1+s.w/2,c=s.y1+s.h/2,l=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h<o.length;h++){var f=o[h].layoutDimensions(t);d=Math.max(d,f.w,f.h)}if(a=k(t.radius)?t.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&t.avoidOverlap){d*=1.75;var p=Math.cos(l)-Math.cos(0),v=Math.sin(l)-Math.sin(0),g=Math.sqrt(d*d/(p*p+v*v));a=Math.max(g,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*l*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:u+o,y:c+s}})),this};var ko,Po={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 jo(e){this.options=R({},Po,e)}jo.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,o=i.nodes().not(":parent"),a=tt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,u=a.y1+a.h/2,c=[],l=0,d=0;d<o.length;d++){var h,f=o[d];h=t.concentric(f),c.push({value:h,node:f}),f._private.scratch.concentric=h}o.updateStyle();for(var p=0;p<o.length;p++){var v=o[p].layoutDimensions(t);l=Math.max(l,v.w,v.h)}c.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(o),y=[[]],m=y[0],b=0;b<c.length;b++){var x=c[b];m.length>0&&Math.abs(m[0].value-x.value)>=g&&y.push(m=[]),m.push(x)}var w=l+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,k=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,k)}for(var P=0,j=0;j<y.length;j++){var C=y[j],_=void 0===t.sweep?2*Math.PI-2*Math.PI/C.length:t.sweep,S=C.dTheta=_/Math.max(1,C.length-1);if(C.length>1&&t.avoidOverlap){var O=Math.cos(S)-Math.cos(0),D=Math.sin(S)-Math.sin(0),T=Math.sqrt(w*w/(O*O+D*D));P=Math.max(T,P)}C.r=P,P+=w}if(t.equidistant){for(var B=0,M=0,N=0;N<y.length;N++)B=Math.max(B,y[N].r-M);M=0;for(var I=0;I<y.length;I++){var A=y[I];0===I&&(M=A.r),A.r=M,M+=B}}for(var L={},z=0;z<y.length;z++)for(var R=y[z],F=R.dTheta,V=R.r,q=0;q<R.length;q++){var X=R[q],Y=t.startAngle+(n?1:-1)*F*q,W={x:s+V*Math.cos(Y),y:u+V*Math.sin(Y)};L[X.node.id()]=W}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return L[t]})),this};var Co={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function _o(e){this.options=R({},Co,e),this.options.layout=this}_o.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),ko=!0===e.debug;var r=So(t,n,e);ko&&(void 0)(r),e.randomize&&To(r);var i=U(),o=function(){Mo(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter||(No(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=Bo(r,e,t);t.layoutPositions(n,e,i)}},u=0,c=!0;if(!0===e.animate)!function t(){for(var n=0;c&&n<e.refresh;)c=a(u),u++,n++;c?(U()-i>=e.animationThreshold&&o(),G(t)):(Ho(r,e),s())}();else{for(;c;)c=a(u),u++;Ho(r,e),s()}return this},_o.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},_o.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var So=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o={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()})},a=n.eles.components(),s={},u=0;u<a.length;u++)for(var c=a[u],l=0;l<c.length;l++)s[c[l].id()]=u;for(u=0;u<o.nodeSize;u++){var d=(g=i[u]).layoutDimensions(n);(T={}).isLocked=g.locked(),T.id=g.data("id"),T.parentId=g.data("parent"),T.cmptId=s[g.id()],T.children=[],T.positionX=g.position("x"),T.positionY=g.position("y"),T.offsetX=0,T.offsetY=0,T.height=d.w,T.width=d.h,T.maxX=T.positionX+T.width/2,T.minX=T.positionX-T.width/2,T.maxY=T.positionY+T.height/2,T.minY=T.positionY-T.height/2,T.padLeft=parseFloat(g.style("padding")),T.padRight=parseFloat(g.style("padding")),T.padTop=parseFloat(g.style("padding")),T.padBottom=parseFloat(g.style("padding")),T.nodeRepulsion=x(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(T),o.idToIndex[T.id]=u}var h=[],f=0,p=-1,v=[];for(u=0;u<o.nodeSize;u++){var g,y=(g=o.layoutNodes[u]).parentId;null!=y?o.layoutNodes[o.idToIndex[y]].children.push(g.id):(h[++p]=g.id,v.push(g.id))}for(o.graphSet.push(v);f<=p;){var m=h[f++],b=o.layoutNodes[o.idToIndex[m]].children;if(b.length>0)for(o.graphSet.push(b),u=0;u<b.length;u++)h[++p]=b[u]}for(u=0;u<o.graphSet.length;u++){var w=o.graphSet[u];for(l=0;l<w.length;l++)o.indexToGraph[o.idToIndex[w[l]]]=u}for(u=0;u<o.edgeSize;u++){var E=r[u],k={};k.id=E.data("id"),k.sourceId=E.data("source"),k.targetId=E.data("target");var P=x(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,j=x(n.edgeElasticity)?n.edgeElasticity(E):n.edgeElasticity,C=o.idToIndex[k.sourceId],_=o.idToIndex[k.targetId];if(o.indexToGraph[C]!=o.indexToGraph[_]){for(var S=Oo(k.sourceId,k.targetId,o),O=o.graphSet[S],D=0,T=o.layoutNodes[C];-1===O.indexOf(T.id);)T=o.layoutNodes[o.idToIndex[T.parentId]],D++;for(T=o.layoutNodes[_];-1===O.indexOf(T.id);)T=o.layoutNodes[o.idToIndex[T.parentId]],D++;P*=D*n.nestingFactor}k.idealLength=P,k.elasticity=j,o.layoutEdges.push(k)}return o},Oo=function(e,t,n){var r=Do(e,t,0,n);return 2>r.count?0:r.graph},Do=function e(t,n,r,i){var o=i.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<o.length;s++){var u=i.layoutNodes[i.idToIndex[o[s]]].children;if(0!==u.length){var c=e(t,n,i.indexToGraph[i.idToIndex[u[0]]],i);if(0!==c.count){if(1!==c.count)return c;if(2==++a)break}}}return{count:a,graph:r}},To=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];0!==o.children.length||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},Bo=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,o){var a=e.layoutNodes[e.idToIndex[n.data("id")]];return t.boundingBox?{x:r.x1+(a.positionX-i.x1)/i.w*r.w,y:r.y1+(a.positionY-i.y1)/i.h*r.h}:{x:a.positionX,y:a.positionY}}},Mo=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=Bo(e,n,i);i.positions(o),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},No=function(e,t,n){Io(e,t),Fo(e),Vo(e,t),qo(e),Xo(e)},Io=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,o=0;o<i;o++)for(var a=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<i;s++)Lo(a,e.layoutNodes[e.idToIndex[r[s]]],e,t)},Ao=function(e){return-e+2*e*Math.random()},Lo=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,o=t.positionY-e.positionY;0===i&&0===o&&(i=Ao(1),o=Ao(1));var a=zo(e,t,i,o);if(a>0)var s=(c=r.nodeOverlap*a)*i/(v=Math.sqrt(i*i+o*o)),u=c*o/v;else{var c,l=Ro(e,i,o),d=Ro(t,-1*i,-1*o),h=d.x-l.x,f=d.y-l.y,p=h*h+f*f,v=Math.sqrt(p);s=(c=(e.nodeRepulsion+t.nodeRepulsion)/p)*h/v,u=c*f/v}e.isLocked||(e.offsetX-=s,e.offsetY-=u),t.isLocked||(t.offsetX+=s,t.offsetY+=u)}},zo=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ro=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,u=o/a,c={};return 0===t&&0<n||0===t&&0>n?(c.x=r,c.y=i+o/2,c):0<t&&-1*u<=s&&s<=u?(c.x=r+a/2,c.y=i+a*n/2/t,c):0>t&&-1*u<=s&&s<=u?(c.x=r-a/2,c.y=i-a*n/2/t,c):0<n&&(s<=-1*u||s>=u)?(c.x=r+o*t/2/n,c.y=i+o/2,c):0>n&&(s<=-1*u||s>=u)?(c.x=r-o*t/2/n,c.y=i-o/2,c):c},Fo=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.layoutNodes[e.idToIndex[r.sourceId]],o=e.layoutNodes[e.idToIndex[r.targetId]],a=o.positionX-i.positionX,s=o.positionY-i.positionY;if(0!==a||0!==s){var u=Ro(i,a,s),c=Ro(o,-1*a,-1*s),l=c.x-u.x,d=c.y-u.y,h=Math.sqrt(l*l+d*d),f=Math.pow(r.idealLength-h,2)/r.elasticity;if(0!==h)var p=f*l/h,v=f*d/h;else p=0,v=0;i.isLocked||(i.offsetX+=p,i.offsetY+=v),o.isLocked||(o.offsetX-=p,o.offsetY-=v)}}},Vo=function(e,t){for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var o=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[e.layoutNodes[e.idToIndex[r[0]]].parentId]];o=s.positionX,a=s.positionY}for(var u=0;u<i;u++){var c=e.layoutNodes[e.idToIndex[r[u]]];if(!c.isLocked){var l=o-c.positionX,d=a-c.positionY,h=Math.sqrt(l*l+d*d);if(h>1){var f=t.gravity*d/h;c.offsetX+=t.gravity*l/h,c.offsetY+=f}}}}},qo=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 o=n[r++],a=e.layoutNodes[e.idToIndex[o]],s=a.children;if(0<s.length&&!a.isLocked){for(var u=a.offsetX,c=a.offsetY,l=0;l<s.length;l++){var d=e.layoutNodes[e.idToIndex[s[l]]];d.offsetX+=u,d.offsetY+=c,n[++i]=s[l]}a.offsetX=0,a.offsetY=0}}},Xo=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=Yo(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,Wo(i,e)}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Yo=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},Wo=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,o=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,o=!0),o?e(i,n):void 0}},Ho=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var o=n[i],a=o.cmptId;(r[a]=r[a]||[]).push(o)}var s=0;for(i=0;i<r.length;i++)if(v=r[i]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var u=0;u<v.length;u++){var c=v[u];v.x1=Math.min(v.x1,c.positionX-c.width/2),v.x2=Math.max(v.x2,c.positionX+c.width/2),v.y1=Math.min(v.y1,c.positionY-c.height/2),v.y2=Math.max(v.y2,c.positionY+c.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var l=0,d=0,h=0,f=0,p=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var v;if(v=r[i]){for(u=0;u<v.length;u++)(c=v[u]).isLocked||(c.positionX+=l-v.x1,c.positionY+=d-v.y1);l+=v.w+t.componentSpacing,h+=v.w+t.componentSpacing,f=Math.max(f,v.h),h>p&&(d+=f+t.componentSpacing,l=0,h=0,f=0)}}},Go={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 Uo(e){this.options=R({},Go,e)}Uo.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=tt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),u=Math.round(s),c=Math.round(o.w/o.h*s),l=function(e){if(null==e)return Math.min(u,c);Math.min(u,c)==u?u=e:c=e},d=function(e){if(null==e)return Math.max(u,c);Math.max(u,c)==u?u=e:c=e},h=t.rows,f=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=f)u=h,c=f;else if(null!=h&&null==f)u=h,c=Math.ceil(a/u);else if(null==h&&null!=f)c=f,u=Math.ceil(a/c);else if(c*u>a){var p=l(),v=d();(p-1)*v>=a?l(p-1):(v-1)*p>=a&&d(v-1)}else for(;c*u<a;){var g=l(),y=d();(y+1)*g>=a?d(y+1):l(g+1)}var m=o.w/c,b=o.h/u;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var k=w.layoutDimensions(t),P=t.avoidOverlapPadding,j=k.h+P;m=Math.max(m,k.w+P),b=Math.max(b,j)}for(var C={},_=function(e,t){return!!C["c-"+e+"-"+t]},S=function(e,t){C["c-"+e+"-"+t]=!0},O=0,D=0,T=function(){++D>=c&&(D=0,O++)},B={},M=0;M<i.length;M++){var N=i[M],I=t.position(N);if(I&&(void 0!==I.row||void 0!==I.col)){var A={row:I.row,col:I.col};if(void 0===A.col)for(A.col=0;_(A.row,A.col);)A.col++;else if(void 0===A.row)for(A.row=0;_(A.row,A.col);)A.row++;B[N.id()]=A,S(A.row,A.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=B[e.id()];if(i)n=i.col*m+m/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;_(O,D);)T();n=D*m+m/2+o.x1,r=O*b+b/2+o.y1,S(O,D),T()}return{x:n,y:r}}))}return this};var Ko={ready:function(){},stop:function(){}};function Zo(e){this.options=R({},Ko,e)}Zo.prototype.run=function(){var e=this.options,t=e.eles;return this.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),this.one("layoutready",e.ready),this.emit("layoutready"),this.one("layoutstop",e.stop),this.emit("layoutstop"),this},Zo.prototype.stop=function(){return this};var $o={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,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 Qo(e){this.options=R({},$o,e)}Qo.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=x(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var Jo={fit:!0,padding:30,boundingBox: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 ea(e){this.options=R({},Jo,e)}ea.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=tt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var ta=[{name:"breadthfirst",impl:xo},{name:"circle",impl:Eo},{name:"concentric",impl:jo},{name:"cose",impl:_o},{name:"grid",impl:Uo},{name:"null",impl:Zo},{name:"preset",impl:Qo},{name:"random",impl:ea}];function na(e){this.options=e,this.notifications=0}var ra=function(){},ia=function(){throw new Error("A headless instance can not render images")};na.prototype={recalculateRenderedStyle:ra,notify:function(){this.notifications++},init:ra,isHeadless:function(){return!0},png:ia,jpg:ia};var oa={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,o,a){return i.x-n/2-a<=e&&e<=i.x+n/2+a&&i.y-n/2-a<=t&&t<=i.y+n/2+a},r=function(e,t,n,r,i){var o=e*Math.cos(r)-t*Math.sin(r),a=(e*Math.sin(r)+t*Math.cos(r))*n;return{x:o*n+i.x,y:a+i.y}},i=function(e,t,n,i){for(var o=[],a=0;a<e.length;a+=2)o.push(r(e[a],e[a+1],t,n,i));return o},o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){b(s)&&(s=e[s]),e[r]=R({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var u=o(i(this.points,n+2*s,r,a));return pt(e,t,u)},roughCollide:n,draw:function(e,n,r,o){var a=i(this.points,n,r,o);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:ce,roughCollide:ce,draw:de,spacing:le,gap:le}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,o,a,s){var u=i(this.points,n,o,a),c=this.controlPoint,l=r(c[0],c[1],n,o,a);t.arrowShapeImpl(this.name)(e,u,l)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,u){var c=o(i(this.points,n+2*u,r,a)),l=o(i(this.pointsTee,n+2*u,r,a));return pt(e,t,c)||pt(e,t,l)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),u=i(this.pointsTee,n,r,o);t.arrowShapeImpl(this.name)(e,s,u)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,u){var c=a,l=Math.pow(c.x-e,2)+Math.pow(c.y-t,2)<=Math.pow((n+2*u)*this.radius,2),d=o(i(this.points,n+2*u,r,a));return pt(e,t,d)||l},draw:function(e,n,r,o,a){var s=i(this.pointsTr,n,r,o);t.arrowShapeImpl(this.name)(e,s,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,u){var c=o(i(this.points,n+2*u,r,a)),l=o(i(this.crossLinePts(n,s),n+2*u,r,a));return pt(e,t,c)||pt(e,t,l)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),u=i(this.crossLinePts(n,a),n,r,o);t.arrowShapeImpl(this.name)(e,s,u)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,o,a){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,i,o){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},aa={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],o=r[1],a=r[4],s=n.pan(),u=n.zoom();return[((e-i)/a-s.x)/u,((t-o)/a-s.y)/u]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=h.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),o=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),u=r("border-left-width"),c=r("border-right-width"),l=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth);return this.containerBB=[t.left+i+u,t.top+a+l,d-(i+o),e.clientHeight-(a+s),t.width/(d+(u+c))]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,o,a=this,s=this,u=s.getCachedZSortedEles(),c=[],l=s.cy.zoom(),d=s.cy.hasCompoundNodes(),h=(r?24:8)/l,f=(r?8:2)/l,p=(r?8:2)/l,v=1/0;function g(e,t){if(e.isNode()){if(o)return;o=e,c.push(e)}if(e.isEdge()&&(null==t||t<v))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<c.length;n++)if(c[n].isEdge()){c[n]=e,i=e,v=null!=t?t:v;break}}else c.push(e),i=e,v=null!=t?t:v}function y(n){var r=n.outerWidth()+2*f,i=n.outerHeight()+2*f,o=r/2,u=i/2,c=n.position();if(c.x-o<=e&&e<=c.x+o&&c.y-u<=t&&t<=c.y+u&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,i,c.x,c.y))return g(n,0),!0}function m(n){var r,i=n._private,o=i.rscratch,u=n.pstyle("width").pfValue,l=n.pstyle("arrow-scale").value,f=u/2+h,p=f*f,v=2*f,m=i.source,b=i.target;if("segments"===o.edgeType||"straight"===o.edgeType||"haystack"===o.edgeType){for(var x=o.allpts,w=0;w+3<x.length;w+=2)if(lt(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&p>(r=ft(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5<o.allpts.length;w+=4)if(dt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&p>(r=ht(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 E=a.getArrowWidth(u,l),k=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<k.length;w++){var P=k[w],j=s.arrowShapes[n.pstyle(P.name+"-arrow-shape").value],C=n.pstyle("width").pfValue;if(j.roughCollide(e,t,E,P.angle,{x:P.x,y:P.y},C,h)&&j.collide(e,t,E,P.angle,{x:P.x,y:P.y},C,h))return g(n),!0}d&&c.length>0&&(y(m),y(b))}function b(e,t,n){return Ee(e,t,n)}function x(n,r){var i,o=n._private,a=p;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],u=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&u){var c=b(o.rscratch,"labelX",r),l=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,f=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-f,x=s.y2+a-f;if(d){var w=Math.cos(d),E=Math.sin(d),k=function(e,t){return{x:(e-=c)*w-(t-=l)*E+c,y:e*E+t*w+l}},P=k(v,m),j=k(v,x),C=k(y,m),_=k(y,x);if(pt(e,t,[P.x+h,P.y+f,C.x+h,C.y+f,_.x+h,_.y+f,j.x+h,j.y+f]))return g(n),!0}else if(st(s,e,t))return g(n),!0}}n&&(u=u.interactive);for(var w=u.length-1;w>=0;w--){var E=u[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return c},getAllInBox:function(e,t,n,r){for(var i,o=this.getCachedZSortedEles().interactive,a=[],s=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),l=Math.max(t,r),d=tt({x1:e=s,y1:t=c,x2:n=u,y2:r=l}),h=0;h<o.length;h++){var f=o[h];if(f.isNode()){var p=f,v=p.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});at(d,v)&&!ut(v,d)&&a.push(p)}else{var g=f,y=g._private,m=y.rscratch;if(null!=m.startX&&null!=m.startY&&!st(d,m.startX,m.startY))continue;if(null!=m.endX&&null!=m.endY&&!st(d,m.endX,m.endY))continue;if("bezier"===m.edgeType||"multibezier"===m.edgeType||"self"===m.edgeType||"compound"===m.edgeType||"segments"===m.edgeType||"haystack"===m.edgeType){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,x=!0,w=0;w<b.length;w++)if(!st(d,(i=b[w]).x,i.y)){x=!1;break}x&&a.push(g)}else"haystack"!==m.edgeType&&"straight"!==m.edgeType||a.push(g)}}return a}},sa={calculateArrowAngles:function(e){var t,n,r,i,o,a,s=e._private.rscratch,u="haystack"===s.edgeType,c="bezier"===s.edgeType,l="multibezier"===s.edgeType,d="segments"===s.edgeType,h="compound"===s.edgeType,f="self"===s.edgeType;u?(r=s.haystackPts[0],i=s.haystackPts[1],o=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,o=s.arrowEndX,a=s.arrowEndY),p=s.midX,v=s.midY,d?(t=r-s.segpts[0],n=i-s.segpts[1]):l||h||f||c?(t=r-Qe((k=s.allpts)[0],k[2],k[4],.1),n=i-Qe(k[1],k[3],k[5],.1)):(t=r-p,n=i-v),s.srcArrowAngle=He(t,n);var p=s.midX,v=s.midY;if(u&&(p=(r+o)/2,v=(i+a)/2),t=o-r,n=a-i,d)if((k=s.allpts).length/2%2==0){var g=(y=k.length/2)-2;t=k[y]-k[g],n=k[y+1]-k[g+1]}else{g=(y=k.length/2-1)-2;var y,m=y+2;t=k[y]-k[g],n=k[y+1]-k[g+1]}else if(l||h||f){var b,x,w,E,k=s.allpts;if(s.ctrlpts.length/2%2==0){var P=2+(j=2+(C=k.length/2-1));b=Qe(k[C],k[j],k[P],0),x=Qe(k[C+1],k[j+1],k[P+1],0),w=Qe(k[C],k[j],k[P],1e-4),E=Qe(k[C+1],k[j+1],k[P+1],1e-4)}else{var j,C;P=2+(j=k.length/2-1),b=Qe(k[C=j-2],k[j],k[P],.4999),x=Qe(k[C+1],k[j+1],k[P+1],.4999),w=Qe(k[C],k[j],k[P],.5),E=Qe(k[C+1],k[j+1],k[P+1],.5)}t=w-b,n=E-x}if(s.midtgtArrowAngle=He(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d&&((k=s.allpts).length/2%2==0||(t=-(k[m=2+(y=k.length/2-1)]-k[y]),n=-(k[m+1]-k[y+1]))),s.midsrcArrowAngle=He(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(l||h||f||c){var _=(k=s.allpts).length;t=o-Qe(k[_-6],k[_-4],k[_-2],.9),n=a-Qe(k[_-5],k[_-3],k[_-1],.9)}else t=o-p,n=a-v;s.tgtArrowAngle=He(t,n)}};sa.getArrowWidth=sa.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var ua={};function ca(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}}ua.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=r.source,s=r.target,u=a.position(),c=s.position(),l=a.width(),d=s.width(),h=a.height(),f=s.height(),p=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*l*p+u.x,i.source.y*h*p+u.y,i.target.x*d*p+c.x,i.target.y*f*p+c.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},ua.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,o=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),u=e.pstyle("segment-distances"),c=Math.min(s.pfValue.length,u.pfValue.length);n.edgeType="segments",n.segpts=[];for(var l=0;l<c;l++){var d=s.pfValue[l],h=u.pfValue[l],f=1-d,p="node-position"===a?r:i,v={x:p.x1*f+p.x2*d,y:p.y1*f+p.y2*d};n.segpts.push(v.x+o.x*h,v.y+o.y*h)}},ua.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,o=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,c=e.pstyle("loop-direction").pfValue,l=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var h=n,f=d;r&&(h=0,f=u);var p=c-Math.PI/2,v=p-l/2,g=p+l/2,y=String(c+"_"+l);h=void 0===o[y]?o[y]=0:++o[y],i.ctrlpts=[a.x+1.4*Math.cos(v)*f*(h/3+1),a.y+1.4*Math.sin(v)*f*(h/3+1),a.x+1.4*Math.cos(g)*f*(h/3+1),a.y+1.4*Math.sin(g)*f*(h/3+1)]},ua.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var o=t.srcPos,a=t.tgtPos,s=t.srcW,u=t.srcH,c=t.tgtW,l=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),f=n,p=d;r&&(f=0,p=h?h.pfValue[0]:void 0);var v={x:o.x-s/2,y:o.y-u/2},g={x:a.x-c/2,y:a.y-l/2},y={x:Math.min(v.x,g.x),y:Math.min(v.y,g.y)},m=Math.max(.5,Math.log(.01*s)),b=Math.max(.5,Math.log(.01*c));i.ctrlpts=[y.x,y.y-(1+Math.pow(50,1.12)/100)*p*(f/3+1)*m,y.x-(1+Math.pow(50,1.12)/100)*p*(f/3+1)*b,y.y]},ua.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},ua.findBezierPoints=function(e,t,n,r,i){var o=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,u=t.intersectionPts,c=e.pstyle("edge-distances").value,l=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),h=e.pstyle("control-point-weights"),f=d&&h?Math.min(d.value.length,h.value.length):1,p=d?d.pfValue[0]:void 0,v=h.value[0],g=r;o.edgeType=g?"multibezier":"bezier",o.ctrlpts=[];for(var y=0;y<f;y++){var m,b=(.5-t.eles.length/2+n)*l*(i?-1:1),x=Ue(b);g&&(p=d?d.pfValue[y]:l,v=h.value[y]);var w=void 0!==(m=r?p:void 0!==p?x*p:void 0)?m:b,E=1-v,k="node-position"===c?s:u,P={x:k.x1*E+k.x2*v,y:k.y1*E+k.y2*v};o.ctrlpts.push(P.x+a.x*w,P.y+a.y*w)}},ua.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r=t.posPts,i=t.srcW,o=t.srcH,a=t.tgtW,s=t.tgtH,u="node-position"!==e.pstyle("edge-distances").value,c=e.pstyle("taxi-direction").value,l=c,d=e.pstyle("taxi-turn"),h="%"===d.units,f=d.pfValue,p=f<0,v=e.pstyle("taxi-turn-min-distance").pfValue,g=u?(o+s)/2:0,y=r.x2-r.x1,m=r.y2-r.y1,b=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},x=b(y,u?(i+a)/2:0),w=b(m,g),E=!1;"auto"===l?c=Math.abs(x)>Math.abs(w)?"horizontal":"vertical":"upward"===l||"downward"===l?(c="vertical",E=!0):"leftward"!==l&&"rightward"!==l||(c="horizontal",E=!0);var k,P="vertical"===c,j=P?w:x,C=P?m:y,_=Ue(C),S=!1;E&&(h||p)||!("downward"===l&&C<0||"upward"===l&&C>0||"leftward"===l&&C>0||"rightward"===l&&C<0)||(j=(_*=-1)*Math.abs(j),S=!0);var O=function(e){return Math.abs(e)<v||Math.abs(e)>=Math.abs(j)},D=O(k=h?(f<0?1+f:f)*j:(f<0?j:0)+f*_),T=O(Math.abs(j)-Math.abs(k));if(!D&&!T||S)if(P){var B=r.y1+k+(u?o/2*_:0);n.segpts=[r.x1,B,r.x2,B]}else{var M=r.x1+k+(u?i/2*_:0);n.segpts=[M,r.y1,M,r.y2]}else if(P){var N=Math.abs(C)<=o/2,I=Math.abs(y)<=a/2;if(N){var A=(r.x1+r.x2)/2;n.segpts=[A,r.y1,A,r.y2]}else if(I){var L=(r.y1+r.y2)/2;n.segpts=[r.x1,L,r.x2,L]}else n.segpts=[r.x1,r.y2]}else{var z=Math.abs(C)<=i/2,R=Math.abs(m)<=s/2;if(z){var F=(r.y1+r.y2)/2;n.segpts=[r.x1,F,r.x2,F]}else if(R){var V=(r.x1+r.x2)/2;n.segpts=[V,r.y1,V,r.y2]}else n.segpts=[r.x2,r.y1]}},ua.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,u=t.tgtH,c=t.srcShape,l=t.tgtShape,d=!k(n.startX)||!k(n.startY),h=!k(n.arrowStartX)||!k(n.arrowStartY),f=!k(n.endX)||!k(n.endY),p=!k(n.arrowEndX)||!k(n.arrowEndY),v=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,g=Ke({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=g<v,m=Ke({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<v,x=!1;if(d||h||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),P={x:w.x/E,y:w.y/E},j=Math.max(o,a),C={x:n.ctrlpts[0]+2*P.x*j,y:n.ctrlpts[1]+2*P.y*j},_=c.intersectLine(r.x,r.y,o,a,C.x,C.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+P.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+P.y*(v-g)):(n.ctrlpts[0]=_[0]+P.x*v,n.ctrlpts[1]=_[1]+P.y*v)}if(f||p||b){x=!0;var S={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},O=Math.sqrt(S.x*S.x+S.y*S.y),D={x:S.x/O,y:S.y/O},T=Math.max(o,a),B={x:n.ctrlpts[0]+2*D.x*T,y:n.ctrlpts[1]+2*D.y*T},M=l.intersectLine(i.x,i.y,s,u,B.x,B.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+D.x*(v-m),n.ctrlpts[1]=n.ctrlpts[1]+D.y*(v-m)):(n.ctrlpts[0]=M[0]+D.x*v,n.ctrlpts[1]=M[1]+D.y*v)}x&&this.findEndpoints(e)}},ua.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(t.midX=t.allpts[r=t.allpts.length/2-1],t.midY=t.allpts[r+1]):(t.midX=Qe(t.allpts[r=t.allpts.length/2-3],t.allpts[r+2],t.allpts[r+4],.5),t.midY=Qe(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2,t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},ua.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||k(t.startX)&&k(t.startY)&&k(t.endX)&&k(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,pe("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},ua.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new Pe,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new Pe,this.map.set(e[0],n)),n.set(e[1],t)}},o=[],a=[],s=0;s<e.length;s++){var u=e[s],c=u._private,l=u.pstyle("curve-style").value;if(!u.removed()&&u.takesUpSpace())if("haystack"!==l){var d="unbundled-bezier"===l||"segments"===l||"straight"===l||"taxi"===l,h="unbundled-bezier"===l||"bezier"===l,f=c.target,p=[c.source.poolIndex(),f.poolIndex()].sort(),v=i.get(p);null==v&&(i.set(p,v={eles:[]}),o.push(p)),v.eles.push(u),d&&(v.hasUnbundled=!0),h&&(v.hasBezier=!0)}else a.push(u)}for(var g=function(e){var a=i.get(o[e]),s=void 0;if(!a.hasUnbundled){var u=a.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));we(a.eles),u.forEach((function(e){return a.eles.push(e)})),a.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var c=a.eles[0],l=c.source(),d=c.target();if(l.poolIndex()>d.poolIndex()){var h=l;l=d,d=h}var f=a.srcPos=l.position(),p=a.tgtPos=d.position(),v=a.srcW=l.outerWidth(),g=a.srcH=l.outerHeight(),y=a.tgtW=d.outerWidth(),m=a.tgtH=d.outerHeight(),b=a.srcShape=n.nodeShapes[t.getNodeShape(l)],x=a.tgtShape=n.nodeShapes[t.getNodeShape(d)];a.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var w=0;w<a.eles.length;w++){var E=a.eles[w],P=E[0]._private.rscratch,j=E.pstyle("curve-style").value,C="unbundled-bezier"===j||"segments"===j||"taxi"===j,_=!l.same(E.source());if(!a.calculatedIntersection&&l!==d&&(a.hasBezier||a.hasUnbundled)){a.calculatedIntersection=!0;var S=b.intersectLine(f.x,f.y,v,g,p.x,p.y,0),O=a.srcIntn=S,D=x.intersectLine(p.x,p.y,y,m,f.x,f.y,0),T=a.tgtIntn=D,B=a.intersectionPts={x1:S[0],x2:D[0],y1:S[1],y2:D[1]},M=a.posPts={x1:f.x,x2:p.x,y1:f.y,y2:p.y},N=D[1]-S[1],I=D[0]-S[0],A=Math.sqrt(I*I+N*N),L=a.vector={x:I,y:N},z=a.vectorNorm={x:L.x/A,y:L.y/A},R={x:-z.y,y:z.x};a.nodesOverlap=!k(A)||x.checkPoint(S[0],S[1],0,y,m,p.x,p.y)||b.checkPoint(D[0],D[1],0,v,g,f.x,f.y),a.vectorNormInverse=R,s={nodesOverlap:a.nodesOverlap,dirCounts:a.dirCounts,calculatedIntersection:!0,hasBezier:a.hasBezier,hasUnbundled:a.hasUnbundled,eles:a.eles,srcPos:p,tgtPos:f,srcW:y,srcH:m,tgtW:v,tgtH:g,srcIntn:T,tgtIntn:O,srcShape:x,tgtShape:b,posPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},intersectionPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},vector:{x:-L.x,y:-L.y},vectorNorm:{x:-z.x,y:-z.y},vectorNormInverse:{x:-R.x,y:-R.y}}}var F=_?s:a;P.nodesOverlap=F.nodesOverlap,P.srcIntn=F.srcIntn,P.tgtIntn=F.tgtIntn,r&&(l.isParent()||l.isChild()||d.isParent()||d.isChild())&&(l.parents().anySame(d)||d.parents().anySame(l)||l.same(d)&&l.isParent())?t.findCompoundLoopPoints(E,F,w,C):l===d?t.findLoopPoints(E,F,w,C):"segments"===j?t.findSegmentsPoints(E,F):"taxi"===j?t.findTaxiPoints(E,F):"straight"===j||!C&&a.eles.length%2==1&&w===Math.floor(a.eles.length/2)?t.findStraightEdgePoints(E):t.findBezierPoints(E,F,w,C,_),t.findEndpoints(E),t.tryToCorrectInvalidPoints(E,F),t.checkForInvalidEdgeWarning(E),t.storeAllpts(E),t.storeEdgeProjections(E),t.calculateArrowAngles(E),t.recalculateEdgeLabelProjections(E),t.calculateLabelAngles(E)}},y=0;y<o.length;y++)g(y);this.findHaystackPoints(a)}},ua.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),ca(t.segpts)},ua.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),ca(t.ctrlpts)},ua.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var la={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,i),u=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,u[0],u[1],0)},findEndpoints:function(e){var t,n,r,i,o,a=this,s=e.source()[0],u=e.target()[0],c=s.position(),l=u.position(),d=e.pstyle("target-arrow-shape").value,h=e.pstyle("source-arrow-shape").value,f=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,y=g.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,E="segments"===y,P=b||x||w,j=m||"taxi"===v,C=e.pstyle("source-endpoint"),_=j?"outside-to-node":C.value,S=e.pstyle("target-endpoint"),O=j?"outside-to-node":S.value;if(g.srcManEndpt=C,g.tgtManEndpt=S,b){var D=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:D,r=D}else if(w){var T=E?g.segpts.slice(0,2):[l.x,l.y];n=E?g.segpts.slice(g.segpts.length-2):[c.x,c.y],r=T}if("inside-to-node"===O)t=[l.x,l.y];else if(S.units)t=this.manualEndptToPx(u,S);else if("outside-to-line"===O)t=g.tgtIntn;else if("outside-to-node"===O||"outside-to-node-or-label"===O?i=n:"outside-to-line"!==O&&"outside-to-line-or-label"!==O||(i=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(u)].intersectLine(l.x,l.y,u.outerWidth(),u.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===O||"outside-to-line-or-label"===O){var B=u._private.rscratch,M=B.labelX,N=B.labelY,I=B.labelWidth/2,A=B.labelHeight/2,L=u.pstyle("text-valign").value;"top"===L?N-=A:"bottom"===L&&(N+=A);var z=u.pstyle("text-halign").value;"left"===z?M-=I:"right"===z&&(M+=I);var R=Et(i[0],i[1],[M-I,N-A,M+I,N-A,M+I,N+A,M-I,N+A],l.x,l.y);if(R.length>0){var F=c,V=Ze(F,We(t)),q=Ze(F,We(R)),X=V;q<V&&(t=R,X=q),R.length>2&&Ze(F,{x:R[2],y:R[3]})<X&&(t=[R[2],R[3]])}}var Y=kt(t,n,a.arrowShapes[d].spacing(e)+f),W=kt(t,n,a.arrowShapes[d].gap(e)+f);if(g.endX=W[0],g.endY=W[1],g.arrowEndX=Y[0],g.arrowEndY=Y[1],"inside-to-node"===_)t=[c.x,c.y];else if(C.units)t=this.manualEndptToPx(s,C);else if("outside-to-line"===_)t=g.srcIntn;else if("outside-to-node"===_||"outside-to-node-or-label"===_?o=r:"outside-to-line"!==_&&"outside-to-line-or-label"!==_||(o=[l.x,l.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(c.x,c.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===_||"outside-to-line-or-label"===_){var H=s._private.rscratch,G=H.labelX,U=H.labelY,K=H.labelWidth/2,Z=H.labelHeight/2,$=s.pstyle("text-valign").value;"top"===$?U-=Z:"bottom"===$&&(U+=Z);var Q=s.pstyle("text-halign").value;"left"===Q?G-=K:"right"===Q&&(G+=K);var J=Et(o[0],o[1],[G-K,U-Z,G+K,U-Z,G+K,U+Z,G-K,U+Z],c.x,c.y);if(J.length>0){var ee=l,te=Ze(ee,We(t)),ne=Ze(ee,We(J)),re=te;ne<te&&(t=[J[0],J[1]],re=ne),J.length>2&&Ze(ee,{x:J[2],y:J[3]})<re&&(t=[J[2],J[3]])}}var ie=kt(t,r,a.arrowShapes[h].spacing(e)+p),oe=kt(t,r,a.arrowShapes[h].gap(e)+p);g.startX=oe[0],g.startY=oe[1],g.arrowStartX=ie[0],g.arrowStartY=ie[1],P&&(g.badLine=!(k(g.startX)&&k(g.startY)&&k(g.endX)&&k(g.endY)))},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case"haystack":return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}}},da={};function ha(e,t,n){for(var r=function(e,t,n,r){return Qe(e,t,n,r)},i=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var a=e.bezierProjPcts[o];i.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}da.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)ha(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var o=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)o.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},da.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var fa={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!D(t)){var n,r,i=e._private,o=e.width(),a=e.height(),s=e.padding(),u=e.position(),c=e.pstyle("text-halign").strValue,l=e.pstyle("text-valign").strValue,d=i.rscratch,h=i.rstyle;switch(c){case"left":n=u.x-o/2-s;break;case"right":n=u.x+o/2+s;break;default:n=u.x}switch(l){case"top":r=u.y-a/2-s;break;case"bottom":r=u.y+a/2+s;break;default:r=u.y}d.labelX=n,d.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},pa=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},va=function(e,t){return pa(t.x-e.x,t.y-e.y)};fa.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,o={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(o.mid||o.source||o.target){var a=function(e,t,r){ke(n.rscratch,e,t,r),ke(n.rstyle,e,t,r)};a("labelX",null,(t={x:r.midX,y:r.midY}).x),a("labelY",null,t.y);var s=pa(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var u=function(s){var u,c="source"===s;if(o[s]){var l=e.pstyle(s+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var d,h=function e(){if(e.cache)return e.cache;for(var t=[],o=0;o+5<r.allpts.length;o+=4)t.push({p0:{x:r.allpts[o],y:r.allpts[o+1]},p1:{x:r.allpts[o+2],y:r.allpts[o+3]},p2:{x:r.allpts[o+4],y:r.allpts[o+5]},startDist:0,length:0,segments:[]});var a=n.rstyle.bezierPts,s=i.bezierProjPcts.length;function u(e,t,n,r,i){var o=Ke(t,n),a=e.segments[e.segments.length-1];e.segments.push({p0:t,p1:n,t0:r,t1:i,startDist:a?a.startDist+a.length:0,length:o}),e.length+=o}for(var c=0;c<t.length;c++){var l=t[c],d=t[c-1];d&&(l.startDist=d.startDist+d.length),u(l,l.p0,a[c*s],0,i.bezierProjPcts[0]);for(var h=0;h<s-1;h++)u(l,a[c*s+h],a[c*s+h+1],i.bezierProjPcts[h],i.bezierProjPcts[h+1]);u(l,a[c*s+s-1],l.p2,i.bezierProjPcts[s-1],1)}return e.cache=t}(),f=0,p=0,v=0;v<h.length;v++){for(var g=h[c?v:h.length-1-v],y=0;y<g.segments.length;y++){var m=g.segments[c?y:g.segments.length-1-y];if(f=p,(p+=m.length)>=l||v===h.length-1&&y===g.segments.length-1){d={cp:g,segment:m};break}}if(d)break}var b=d.cp,x=d.segment,w=(l-f)/x.length,E=x.t1-x.t0,k=c?x.t0+E*w:x.t1-E*w;k=et(0,k,1),t=Je(b.p0,b.p1,b.p2,k),u=function(e,t,n,r){var i=et(0,r-.001,1),o=et(0,r+.001,1),a=Je(e,t,n,i),s=Je(e,t,n,o);return va(a,s)}(b.p0,b.p1,b.p2,k);break;case"straight":case"segments":case"haystack":for(var P,j,C,_,S=0,O=r.allpts.length,D=0;D+3<O&&(c?(C={x:r.allpts[D],y:r.allpts[D+1]},_={x:r.allpts[D+2],y:r.allpts[D+3]}):(C={x:r.allpts[O-2-D],y:r.allpts[O-1-D]},_={x:r.allpts[O-4-D],y:r.allpts[O-3-D]}),j=S,!((S+=P=Ke(C,_))>=l));D+=2);var T=(l-j)/P;T=et(0,T,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Ke(e,t);return n=null==n?0:n,{x:e.x+i/a*(r=null!=r?r:n*a),y:e.y+o/a*r}}(C,_,T),u=va(C,_)}a("labelX",s,t.x),a("labelY",s,t.y),a("labelAutoAngle",s,u)}};u("source"),u("target"),this.applyLabelDimensions(e)}},fa.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},fa.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Ee(n.rscratch,"labelWrapCachedLines",t)||[],u="wrap"!==a?1:Math.max(s.length,1),c=i.height/u,l=c*o,d=i.width,h=i.height+(u-1)*(o-1)*c;ke(n.rstyle,"labelWidth",t,d),ke(n.rscratch,"labelWidth",t,d),ke(n.rstyle,"labelHeight",t,h),ke(n.rscratch,"labelHeight",t,h),ke(n.rscratch,"labelLineHeight",t,l)},fa.getLabelText=function(e,t){var n=e._private,r=e.pstyle((t?t+"-":"")+"label").strValue,i=e.pstyle("text-transform").value,o=function(e,r){return r?(ke(n.rscratch,e,t,r),r):Ee(n.rscratch,e,t)};if(!r)return"";"none"==i||("uppercase"==i?r=r.toUpperCase():"lowercase"==i&&(r=r.toLowerCase()));var a=e.pstyle("text-wrap").value;if("wrap"===a){var s=o("labelKey");if(null!=s&&o("labelWrapKey")===s)return o("labelWrapCachedText");for(var u=r.split("\n"),c=e.pstyle("text-max-width").pfValue,l="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],h=/[\s\u200b]+/,f=l?"":" ",p=0;p<u.length;p++){var v=u[p],g=this.calculateLabelDimensions(e,v).width;if(l){var y=v.split("").join("​");v=y}if(g>c){for(var m=v.split(h),b="",x=0;x<m.length;x++){var w=m[x];this.calculateLabelDimensions(e,0===b.length?w:b+f+w).width<=c?b+=w+f:(b&&d.push(b),b=w+f)}b.match(/^[\s\u200b]+$/)||d.push(b)}else d.push(v)}o("labelWrapCachedLines",d),r=o("labelWrapCachedText",d.join("\n")),o("labelWrapKey",s)}else if("ellipsis"===a){var E=e.pstyle("text-max-width").pfValue,k="",P=!1;if(this.calculateLabelDimensions(e,r).width<E)return r;for(var j=0;j<r.length&&!(this.calculateLabelDimensions(e,k+r[j]+"…").width>E);j++)k+=r[j],j===r.length-1&&(P=!0);return P||(k+="…"),k}return r},fa.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"}},fa.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 o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,c=this.labelCalcCanvas,l=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=document.createElement("canvas"),l=this.labelCalcCanvasContext=c.getContext("2d");var d=c.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}l.font="".concat(o," ").concat(u," ").concat(a,"px ").concat(s);for(var h=0,f=0,p=t.split("\n"),v=0;v<p.length;v++){var g=l.measureText(p[v]),y=Math.ceil(g.width),m=a;h=Math.max(y,h),f+=m}return r[n]={width:h+=0,height:f+=0}},fa.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=e.pstyle((t?t+"-":"")+"text-rotation"),o=i.strValue;return"none"===o?0:r&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:i.pfValue},fa.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 ga={},ya=!1;ga.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return ya||(pe("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),ya=!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 ma={};[aa,sa,ua,la,da,fa,ga,{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.length;r++){var i=e[r],o=i._private,a=o.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){r(e.target)})).on("style.* background.*",(function(e){r(e.target,!1)}));var i=function(i){if(i){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],u=s._private.rstyle;s.isNode()&&!u.cleanConnected&&(r(s.connectedEdges()),u.cleanConnected=!0)}if(o)for(var c=0;c<o.length;c++)(0,o[c])(i,t);n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var o=0;o<e.length;o++){var a=e[o],s=a._private,u=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(u.clean=!1),t&&u.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):r.push(a),u.clean=!0)}for(var c=0;c<i.length;c++){var l=i[c],d=l._private.rstyle,h=l.position();this.recalculateNodeLabelProjection(l),d.nodeX=h.x,d.nodeY=h.y,d.nodeW=l.pstyle("width").pfValue,d.nodeH=l.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var f=0;f<r.length;f++){var p=r[f]._private,v=p.rstyle,g=p.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},{updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i=t[n];e.drag.push(i)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(ui),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}}].forEach((function(e){R(ma,e)}));var ba={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var o=(i=r[e]=r[e]||{}).image=new Image;return o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0})),"data:"===e.substring(0,"data:".length).toLowerCase()||(o.crossOrigin=t),o.src=e,o}},xa={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)},binder:function(e){var t=this,n=e===window||e===document||e===document.body||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement;if(null==t.supportsPassiveEvents){var r=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return r=!0,!0}});window.addEventListener("test",null,i)}catch(s){}t.supportsPassiveEvents=r}var o=function(r,i,o){var a=Array.prototype.slice.call(arguments);return n&&t.supportsPassiveEvents&&(a[2]={capture:null!=o&&o,passive:!1,once:!1}),t.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:o,addEventListener:o,addListener:o,bind:o}},nodeIsDraggable:function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},nodeIsGrabbable:function(e){return this.nodeIsDraggable(e)&&e.interactive()},load:function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var o=0;o<n.length;o++)t.emit({originalEvent:r,type:n[o],position:i})},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable()){for(var i=0;n&&i<n.length;i++)if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},a=function(e){e[0]._private.rscratch.inDragLayer=!0},s=function(e){e[0]._private.rscratch.isGrabTarget=!0},u=function(e,t){var n=t.addToList;n.has(e)||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},c=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(a),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(a)),n.addToList&&t.forEach((function(e){u(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(a),n.connectedEdges().forEach(a)),t.addToList&&t.addToList.unmerge(n)}}(t,n),h(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},l=c,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},h=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(a),r.forEach(a)),t.addToList&&r.forEach((function(e){u(e,t)}))}}},f=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},p="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;p?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++)if(r[i]===e.container){e.destroy();break}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=i((function(){e.cy.resize()}),100);p&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var y=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",y),e.registerBinding(t,"animationend",y),e.registerBinding(t,"scroll",y)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var m=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],o=n[2],a=n[3],s=t.touches?t.touches:[t],u=!1,c=0;c<s.length;c++){var l=s[c];if(r<=l.clientX&&l.clientX<=r+o&&i<=l.clientY&&l.clientY<=i+a){u=!0;break}}if(!u)return!1;for(var d=e.container,h=t.target.parentNode,f=!1;h;){if(h===d){f=!0;break}h=h.parentNode}return!!f};e.registerBinding(e.container,"mousedown",(function(t){if(m(t)){t.preventDefault(),f(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],o=e.projectIntoViewport(i[0],i[1]),a=e.selection,u=e.findNearestElements(o[0],o[1],!0,!1),d=u[0],h=e.dragData.possibleDragElements;if(e.hoverData.mdownPos=o,e.hoverData.mdownGPos=i,3==t.which){e.hoverData.cxtStarted=!0;var p={originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}};d?(d.activate(),d.emit(p),e.hoverData.down=d):r.emit(p),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(s(d),d.selected()){h=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));c(g,{addToList:h}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else h=e.dragData.possibleDragElements=r.collection(),l(d,{addToList:h}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=u,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==d?(a[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(a[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}})}}),e.tapholdDuration)}a[0]=a[2]=o[0],a[1]=a[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||m(t)){var i=!1,a=e.cy,s=a.zoom(),u=[t.clientX,t.clientY],l=e.projectIntoViewport(u[0],u[1]),h=e.hoverData.mdownPos,f=e.hoverData.mdownGPos,p=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(l[0],l[1],!0,!1));var g,y=e.hoverData.last,b=e.hoverData.down,x=[l[0]-p[2],l[1]-p[3]],w=e.dragData.possibleDragElements;if(f){var E=u[0]-f[0],P=u[1]-f[1];e.hoverData.isOverThresholdDrag=g=E*E+P*P>=e.desktopTapThreshold2}var j=r(t);g&&(e.hoverData.tapholdCancelled=!0),i=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:l[0],y:l[1]});var C=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:l[0],y:l[1]}}),p[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var _={originalEvent:t,type:"cxtdrag",position:{x:l[0],y:l[1]}};b?b.emit(_):a.emit(_),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&v===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:l[0],y:l[1]}}),e.hoverData.cxtOver=v,v&&v.emit({originalEvent:t,type:"cxtdragover",position:{x:l[0],y:l[1]}}))}}else if(e.hoverData.dragging){if(i=!0,a.panningEnabled()&&a.userPanningEnabled()){var S;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;S={x:(l[0]-O[0])*s,y:(l[1]-O[1])*s},e.hoverData.justStartedPan=!1}else S={x:x[0]*s,y:x[1]*s};a.panBy(S),e.hoverData.dragged=!0}l=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:l[0],y:l[1]}),v&&n(v,["mouseover","tapdragover"],t,{x:l[0],y:l[1]}),e.hoverData.last=v),b)if(g){if(a.boxSelectionEnabled()&&j)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),C();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var D=!e.dragData.didDrag;D&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var T=a.collection();e.hoverData.draggingEles||c(w,{inDragLayer:!0});var B={x:0,y:0};if(k(x[0])&&k(x[1])&&(B.x+=x[0],B.y+=x[1],D)){var M=e.hoverData.dragDelta;M&&k(M[0])&&k(M[1])&&(B.x+=M[0],B.y+=M[1])}for(var N=0;N<w.length;N++){var I=w[N];e.nodeIsDraggable(I)&&I.grabbed()&&T.push(I)}e.hoverData.draggingEles=!0,T.silentShift(B).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();i=!0}else g&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!j&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,p[4]=0,e.data.bgActivePosistion=We(h),e.redrawHint("select",!0),e.redraw()):C(),b&&b.pannable()&&b.active()&&b.unactivate());return p[2]=l[0],p[3]=l[1],i?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,u=e.findNearestElement(a[0],a[1],!0,!1),c=e.dragData.possibleDragElements,l=e.hoverData.down,h=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,l&&l.unactivate(),3===e.hoverData.which){var f={originalEvent:i,type:"cxttapend",position:{x:a[0],y:a[1]}};if(l?l.emit(f):o.emit(f),!e.hoverData.cxtDragged){var p={originalEvent:i,type:"cxttap",position:{x:a[0],y:a[1]}};l?l.emit(p):o.emit(p)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(u,["mouseup","tapend","vmouseup"],i,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||n(l,["click","tap","vclick"],i,{x:a[0],y:a[1]}),null!=l||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(o.$(t).unselect(["tapunselect"]),c.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=c=o.collection()),u!=l||e.dragData.didDrag||e.hoverData.selecting||null!=u&&u._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?u.selected()?u.unselect(["tapunselect"]):u.select(["tapselect"]):h||(o.$(t).unmerge(u).unselect(["tapunselect"]),u.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:i,position:{x:a[0],y:a[1]}}),"additive"===o.selectionType()||h||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).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 g=l&&l.grabbed();d(c),g&&(l.emit("freeon"),c.emit("free"),e.dragData.didDrag&&(l.emit("dragfreeon"),c.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,E,P,j,C,_,S,O,D,T,B,M=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[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:a[0],y:a[1]}})}}};e.registerBinding(e.container,"wheel",M,!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||M(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 N,I,A,L,z=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},R=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",N=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,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var u=e.findContainerClientCoords();D=u[2],T=u[3],x=t.touches[0].clientY-(O=u[1]),w=t.touches[1].clientX-(S=u[0]),E=t.touches[1].clientY-O,B=0<=(b=t.touches[0].clientX-S)&&b<=D&&0<=w&&w<=D&&0<=x&&x<=T&&0<=E&&E<=T;var h=r.pan(),p=r.zoom();if(P=z(b,x,w,E),j=R(b,x,w,E),_=[((C=[(b+w)/2,(x+E)/2])[0]-h.x)/p,(C[1]-h.y)/p],j<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),k=y[0];if(null!=k&&(k.activate(),e.touchData.start=k,e.touchData.starts=y,e.nodeIsGrabbable(k))){var M=e.dragData.touchDragEles=r.collection(),N=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),k.selected()?(N=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),c(N,{addToList:M})):l(k,{addToList:M}),s(k);var I=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};k.emit(I("grabon")),N?N.forEach((function(e){e.emit(I("grab"))})):k.emit(I("grab"))}n(k,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==k&&(e.data.bgActivePosistion={x:a[0],y:a[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 A=e.touchData.startPosition=[],L=0;L<i.length;L++)A[L]=o[L]=i[L];var F=t.touches[0];e.touchData.startGPosition=[F.clientX,F.clientY]}}},!1),e.registerBinding(window,"touchmove",I=function(t){var r=e.touchData.capture;if(r||m(t)){var i=e.selection,a=e.cy,s=e.touchData.now,u=e.touchData.earlier,l=a.zoom();if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),s[2]=h[0],s[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),s[4]=h[0],s[5]=h[1]);var f,p=e.touchData.startGPosition;if(r&&t.touches[0]&&p){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-u[g];var y=t.touches[0].clientX-p[0],C=t.touches[0].clientY-p[1];f=y*y+C*C>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var D=t.touches[0].clientX-S,T=t.touches[0].clientY-O,M=t.touches[1].clientX-S,N=t.touches[1].clientY-O,I=R(D,T,M,N);if(I/j>=2.25||I>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var A={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(A),e.touchData.start=null):a.emit(A)}}if(r&&e.touchData.cxt){A={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(A):a.emit(A),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var L=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&L===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=L,L&&L.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.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&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),J=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var F=0;F<J.length;F++){var V=J[F]._private;V.grabbed=!1,V.rscratch.inDragLayer=!1}}var q=e.touchData.start,X=z(D=t.touches[0].clientX-S,T=t.touches[0].clientY-O,M=t.touches[1].clientX-S,N=t.touches[1].clientY-O),Y=X/P;if(B){var W=(D-b+(M-w))/2,H=(T-x+(N-E))/2,G=a.zoom(),U=G*Y,K=a.pan(),Z=_[0]*G+K.x,$=_[1]*G+K.y,Q={x:-U/G*(Z-K.x-W)+Z,y:-U/G*($-K.y-H)+$};if(q&&q.active()){var J=e.dragData.touchDragEles;d(J),e.redrawHint("drag",!0),e.redrawHint("eles",!0),q.unactivate().emit("freeon"),J.emit("free"),e.dragData.didDrag&&(q.emit("dragfreeon"),J.emit("dragfree"))}a.viewport({zoom:U,pan:Q,cancelOnFailedZoom:!0}),P=X,b=D,x=T,w=M,E=N,e.pinching=!0}t.touches[0]&&(h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY),s[0]=h[0],s[1]=h[1]),t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),s[2]=h[0],s[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),s[4]=h[0],s[5]=h[1])}else if(t.touches[0]&&!e.touchData.didSelect){var ee=e.touchData.start,te=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(L=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=ee&&t.preventDefault(),r&&null!=ee&&e.nodeIsDraggable(ee))if(f){J=e.dragData.touchDragEles;var ne=!e.dragData.didDrag;ne&&c(J,{inDragLayer:!0}),e.dragData.didDrag=!0;var re={x:0,y:0};k(v[0])&&k(v[1])&&(re.x+=v[0],re.y+=v[1],ne&&(e.redrawHint("eles",!0),(ie=e.touchData.dragDelta)&&k(ie[0])&&k(ie[1])&&(re.x+=ie[0],re.y+=ie[1]))),e.hoverData.draggingEles=!0,J.silentShift(re).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==u[0]&&e.touchData.startPosition[1]==u[1]&&e.redrawHint("eles",!0),e.redraw()}else{var ie;0===(ie=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(ie.push(v[0]),ie.push(v[1])):(ie[0]+=v[0],ie[1]+=v[1])}if(n(ee||L,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),ee&&ee.grabbed()||L==te||(te&&te.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),L&&L.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=L,r)for(F=0;F<s.length;F++)s[F]&&e.touchData.startPosition[F]&&f&&(e.touchData.singleTouchMoved=!0);r&&(null==ee||ee.pannable())&&a.panningEnabled()&&a.userPanningEnabled()&&(o(ee,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=We(e.touchData.startPosition)),e.swipePanning?a.panBy({x:v[0]*l,y:v[1]*l}):f&&(e.swipePanning=!0,a.panBy({x:y*l,y:C*l}),ee&&(ee.unactivate(),e.redrawHint("select",!0),e.touchData.start=null))),h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY),s[0]=h[0],s[1]=h[1])}for(g=0;g<s.length;g++)u[g]=s[g];r&&t.touches.length>0&&!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",A=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 o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,u=s.zoom(),c=e.touchData.now,l=e.touchData.earlier;if(r.touches[0]){var h=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);c[0]=h[0],c[1]=h[1]}if(r.touches[1]&&(h=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY),c[2]=h[0],c[3]=h[1]),r.touches[2]&&(h=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY),c[4]=h[0],c[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:c[0],y:c[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var f={originalEvent:r,type:"cxttap",position:{x:c[0],y:c[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(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:c[0],y:c[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:c[0],y:c[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(c[0],c[1],!0,!0);n(y,["touchend","tapend","vmouseup","tapdragout"],r,{x:c[0],y:c[1]})}var m=e.touchData.startPosition[0]-c[0],b=e.touchData.startPosition[1]-c[1],x=(m*m+b*b)*u*u;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),n(i,["tap","vclick"],r,{x:c[0],y:c[1]})),null!=i&&!e.dragData.didDrag&&i._private.selectable&&x<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var w=0;w<c.length;w++)l[w]=c[w];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var F=[],V=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},q=function(e){for(var t=0;t<F.length;t++)if(F[t].event.pointerId===e.pointerId)return void F.splice(t,1)},X=function(e){e.touches=F.map((function(e){return e.touch}))},Y=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){Y(e)||(e.preventDefault(),function(e){F.push(function(e){return{event:e,touch:V(e)}}(e))}(e),X(e),N(e))})),e.registerBinding(e.container,"pointerup",(function(e){Y(e)||(q(e),X(e),L(e))})),e.registerBinding(e.container,"pointercancel",(function(e){Y(e)||(q(e),X(e),A())})),e.registerBinding(e.container,"pointermove",(function(e){Y(e)||(e.preventDefault(),function(e){var t=F.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=V(e)}(e),X(e),I(e))}))}}},wa={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return Et(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return vt(e,t,this.points,o,a,r,i,[0,-1],n)}}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o){var a=n-e,s=r-t;a/=i,s/=o;var u=Math.sqrt(a*a+s*s),c=u-1;if(c<0)return[];var l=c/u;return[(n-e)*l+e,(r-t)*l+t]}(i,o,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,i,o,a){return mt(e,t,r,i,o,a,n)}}},generateRoundPolygon:function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i,o=2*r;i=r<t.length/2-1?2*(r+1):0,n[4*r]=t[o],n[4*r+1]=t[o+1];var a=t[i]-t[o],s=t[i+1]-t[o+1],u=Math.sqrt(a*a+s*s);n[4*r+2]=a/u,n[4*r+3]=s/u}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a,s){for(var u,c=[],l=new Array(n.length),d=o/2,h=a/2,f=St(o,a),p=0;p<n.length/4;p++){var v,g;g=0===p?n.length-2:4*p-2,v=4*p+2;var y=r+d*n[4*p],m=i+h*n[4*p+1],b=f/Math.tan(Math.acos(-n[g]*n[v]-n[g+1]*n[v+1])/2),x=y-b*n[g],w=m-b*n[g+1],E=y+b*n[v],k=m+b*n[v+1];0===p?(l[n.length-2]=x,l[n.length-1]=w):(l[4*p-2]=x,l[4*p-1]=w),l[4*p]=E,l[4*p+1]=k;var P=n[g+1],j=-n[g];P*n[v]+j*n[v+1]<0&&(P*=-1,j*=-1),0!==(u=bt(e,t,r,i,x+P*f,w+j*f,f)).length&&c.push(u[0],u[1])}for(var C=0;C<l.length/4;C++)0!==(u=wt(e,t,r,i,l[4*C],l[4*C+1],l[4*C+2],l[4*C+3],!1)).length&&c.push(u[0],u[1]);if(c.length>2){for(var _=[c[0],c[1]],S=Math.pow(_[0]-e,2)+Math.pow(_[1]-t,2),O=1;O<c.length/2;O++){var D=Math.pow(c[2*O]-e,2)+Math.pow(c[2*O+1]-t,2);D<=S&&(_[0]=c[2*O],_[1]=c[2*O+1],S=D)}return _}return c}(i,o,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a){for(var s=new Array(n.length),u=o/2,c=a/2,l=St(o,a),d=l*l,h=0;h<n.length/4;h++){var f,p;p=0===h?n.length-2:4*h-2,f=4*h+2;var v=r+u*n[4*h],g=i+c*n[4*h+1],y=l/Math.tan(Math.acos(-n[p]*n[f]-n[p+1]*n[f+1])/2),m=v-y*n[p],b=g-y*n[p+1],x=v+y*n[f],w=g+y*n[f+1];s[4*h]=m,s[4*h+1]=b,s[4*h+2]=x,s[4*h+3]=w;var E=n[p+1],k=-n[p];E*n[f]+k*n[f+1]<0&&(E*=-1,k*=-1);var P=b+k*l;if(Math.pow(m+E*l-e,2)+Math.pow(P-t,2)<=d)return!0}return pt(e,t,s)}(e,t,this.points,o,a,r,i)}}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return ct(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=_t(r,i),u=2*s;return!!(vt(e,t,this.points,o,a,r,i-u,[0,-1],n)||vt(e,t,this.points,o,a,r-u,i,[0,-1],n)||mt(e,t,u,u,o-r/2+s,a-i/2+s,n)||mt(e,t,u,u,o+r/2-s,a-i/2+s,n)||mt(e,t,u,u,o+r/2-s,a+i/2-s,n)||mt(e,t,u,u,o-r/2+s,a+i/2-s,n))}}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,o=t/2,a=e/2,s=n-a,u=n+a,c=r-o,l=r+o;return{topLeft:[s,c+i,s+i,c,s+i,c+i],topRight:[u-i,c,u,c+i,u-i,c+i],bottomRight:[u,l-i,u-i,l,u-i,l-i],bottomLeft:[s+i,l,s,l-i,s+i,l-i]}},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),u=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return Et(i,o,u,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(vt(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(vt(e,t,this.points,o,a,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,o,a);return pt(e,t,s.topLeft)||pt(e,t,s.topRight)||pt(e,t,s.bottomRight)||pt(e,t,s.bottomLeft)}}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),u=function(e){var t=Je({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=Je({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=Je({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},c=[].concat(u(s.topLeft),u(s.topRight),u(s.bottomRight),u(s.bottomLeft));return Et(i,o,c,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,o=e/2,a=n-o,s=n+o,u=r-i,c=r+i,l=Ot(e,t),d=l.heightOffset,h=l.widthOffset,f=l.ctrlPtOffsetPct*e,p={topLeft:[a,u+d,a+f,u,a+h,u],topRight:[s-h,u,s-f,u,s,u+d],bottomRight:[s,c-d,s-f,c,s-h,c],bottomLeft:[a+h,c,a+f,c,a,c-d]};return p.topLeft.isTop=!0,p.topRight.isTop=!0,p.bottomLeft.isBottom=!0,p.bottomRight.isBottom=!0,p},checkPoint:function(e,t,n,r,i,o,a){var s=Ot(r,i),u=s.widthOffset;if(vt(e,t,this.points,o,a,r,i-2*s.heightOffset,[0,-1],n))return!0;if(vt(e,t,this.points,o,a,r-2*u,i,[0,-1],n))return!0;for(var c=this.generateBarrelBezierPts(r,i,o,a),l=function(e,t,n){var r,i,o=n[4],a=n[2],s=n[0],u=n[5],c=n[1],l=Math.min(o,s),d=Math.max(o,s),h=Math.min(u,c),f=Math.max(u,c);if(l<=e&&e<=d&&h<=t&&t<=f){var p=[(r=o)-2*(i=a)+s,2*(i-r),r],v=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var o=Math.sqrt(i),a=2*e;return[(-t+o)/a,(-t-o)/a]}(p[0],p[1],p[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},d=Object.keys(c),h=0;h<d.length;h++){var f=c[d[h]],p=l(e,t,f);if(null!=p){var v=Qe(f[5],f[3],f[1],p);if(f.isTop&&v<=t)return!0;if(f.isBottom&&t<=v)return!0}}return!1}}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Pt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=t-(r/2+a),u=wt(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return u.length>0?u:ct(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=_t(r,i),u=2*s;if(vt(e,t,this.points,o,a,r,i-u,[0,-1],n))return!0;if(vt(e,t,this.points,o,a,r-u,i,[0,-1],n))return!0;var c=r/2+2*n,l=i/2+2*n;return!!pt(e,t,[o-c,a-l,o-c,a,o+c,a,o+c,a-l])||!!mt(e,t,u,u,o+r/2-s,a+i/2-s,n)||!!mt(e,t,u,u,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Pt(3,0)),this.generateRoundPolygon("round-triangle",Pt(3,0)),this.generatePolygon("rectangle",Pt(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",Pt(5,0)),this.generateRoundPolygon("round-pentagon",Pt(5,0)),this.generatePolygon("hexagon",Pt(6,0)),this.generateRoundPolygon("round-hexagon",Pt(6,0)),this.generatePolygon("heptagon",Pt(7,0)),this.generateRoundPolygon("round-heptagon",Pt(7,0)),this.generatePolygon("octagon",Pt(8,0)),this.generateRoundPolygon("round-octagon",Pt(8,0));var r=new Array(20),i=Ct(5,0),o=Ct(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=jt(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}}},Ea={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||me();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&he("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},ka=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};Ea.startRenderLoop=function(){var e=this,t=e.cy;e.renderLoopStarted||(e.renderLoopStarted=!0,G((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){ka(e,!0,r);var i=U();e.render(e.renderOptions);var o=e.lastDrawTime=U();void 0===e.averageRedrawTime&&(e.averageRedrawTime=o-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=o-i;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else ka(e,!1,r);e.skipFrame=!1,G(n)}})))};var Pa=function(e){this.init(e)},ja=Pa.prototype;ja.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ja.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(h){var r=h.document,i=r.head,o="__________cytoscape_container",a=null!=r.getElementById("__________cytoscape_stylesheet");if(n.className.indexOf(o)<0&&(n.className=(n.className||"")+" "+o),!a){var s=r.createElement("style");s.id="__________cytoscape_stylesheet",s.innerHTML="."+o+" { position: relative; }",i.insertBefore(s,i.children[0])}"static"===h.getComputedStyle(n).getPropertyValue("position")&&pe("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=k(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},ja.notify=function(e,t){var n=this;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&n.cy.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},ja.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},ja.isHeadless=function(){return!1},[oa,ma,ba,xa,wa,Ea].forEach((function(e){R(ja,e)}));var Ca=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=i((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold);n.beforeRender((function(i,o){var a=U(),s=n.averageRedrawTime,u=n.lastRedrawTime,c=[],l=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var h=U(),f=h-a,p=h-o;if(u<1e3/60){if(p>=e.deqFastCost*(1e3/60-(i?s:0)))break}else if(i){if(f>=e.deqCost*u||f>=e.deqAvgCost*s)break}else if(p>=e.deqNoDrawCost*(1e3/60))break;var v=e.deq(t,d,l);if(!(v.length>0))break;for(var g=0;g<v.length;g++)c.push(v[g])}c.length>0&&(e.onDeqd(t,c),!i&&e.shouldRedraw(t,c,d,l)&&r())}),(e.priority||de)(t))}}},_a=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ce;s(this,e),this.idsByKey=new Pe,this.keyForId=new Pe,this.cachesByLvl=new Pe,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return c(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 Ce,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 Pe,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}(),Sa={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Oa=be({getKey:null,doesEleInvalidateKey:ce,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:ue,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Da=function(e,t){this.renderer=e,this.onDequeues=[];var n=Oa(t);R(this,n),this.lookup=new _a(n.getKey,n.doesEleInvalidateKey),this.setupDequeueing()},Ta=Da.prototype;Ta.reasons=Sa,Ta.getTextureQueue=function(e){return this.eleImgCaches=this.eleImgCaches||{},this.eleImgCaches[e]=this.eleImgCaches[e]||[]},Ta.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Ta.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new o((function(e,t){return t.reqs-e.reqs}))},Ta.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Ta.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),u=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Ge(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var c=Math.pow(2,r),l=t.h*c,d=t.w*c,h=a.eleTextBiggerThanMin(e,c);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=l<=25?25:l<=50?50:50*Math.ceil(l/50),l>1024||d>1024)return null;var v=o.getTextureQueue(f),g=v[v.length-2],y=function(){return o.recycleTexture(f,d)||o.addTexture(f,d)};g||(g=v[v.length-1]),g||(g=y()),g.width-g.usedWidth<d&&(g=y());for(var m,b=function(e){return e&&e.scaledLabelShown===h},x=i&&i===Sa.dequeue,w=i&&i===Sa.highQuality,E=i&&i===Sa.downscale,k=r+1;k<=3;k++){var P=u.get(e,k);if(P){m=P;break}}var j=m&&m.level===r+1?m:null,C=function(){g.context.drawImage(j.texture.canvas,j.x,0,j.width,j.height,g.usedWidth,0,d,l)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,f),b(j))C();else if(b(m)){if(!w)return o.queueElement(e,m.level-1),m;for(var _=m.level;_>r;_--)j=o.getElement(e,t,n,_,Sa.downscale);C()}else{var S;if(!x&&!w&&!E)for(var O=r-1;O>=-4;O--){var D=u.get(e,O);if(D){S=D;break}}if(b(S))return o.queueElement(e,r),S;g.context.translate(g.usedWidth,0),g.context.scale(c,c),this.drawElement(g.context,e,t,h,!1),g.context.scale(1/c,1/c),g.context.translate(-g.usedWidth,0)}return p={x:g.usedWidth,texture:g,level:r,scale:c,width:d,height:l,scaledLabelShown:h},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(p),u.set(e,r,p),o.checkTextureFullness(g),p},Ta.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},Ta.invalidateElement=function(e){var t=this.lookup,n=[];if(t.isInvalid(e)){for(var r=-4;r<=3;r++){var i=t.getForCachedKey(e,r);i&&n.push(i)}if(t.invalidate(e))for(var o=0;o<n.length;o++){var a=n[o],s=a.texture;s.invalidatedWidth+=a.width,a.invalidated=!0,this.checkTextureUtility(s)}this.removeFromQueue(e)}},Ta.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},Ta.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?xe(t,e):e.fullnessChecks++},Ta.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,o=0;o<i.length;o++){var a=i[o];r.deleteCache(a.key,a.level)}we(i),this.getRetiredTextureQueue(t).push(e)},Ta.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},Ta.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var o=r[i];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,we(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),xe(r,o),n.push(o),o}},Ta.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Ta.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,o=0;o<1&&t.size()>0;o++){var a=t.pop(),s=a.key,u=a.eles[0],c=i.hasCache(u,a.level);if(n[s]=null,!c){r.push(a);var l=this.getBoundingBox(u);this.getElement(u,l,e,a.level,Sa.dequeue)}}return r},Ta.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))},Ta.onDequeue=function(e){this.onDequeues.push(e)},Ta.offDequeue=function(e){xe(this.onDequeues,e)},Ta.setupDequeueing=Ca({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<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var o=t[i].eles,a=0;a<o.length;a++){var s=o[a].boundingBox();if(at(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ba=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=U()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=i((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){t.skipping=n-t.lastInvalidationTime<=250}),n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new o((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},Ma=Ba.prototype,Na=0,Ia=Math.pow(2,53)-1;Ma.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,i),a={id:Na=++Na%Ia,bb:e,level:t,width:r,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,u=-a.bb.x1,c=-a.bb.y1;return s.scale(n,n),s.translate(u,c),a},Ma.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(Ge(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,u=r.layersByLevel,c=Math.pow(2,n),l=u[n]=u[n]||[];if(r.levelIsComplete(n,e))return l;!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 o=l.length-1;o>=0;o--){var a=l[o];a.invalid&&xe(l,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=tt();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*c*(a.h*c)>16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=l.indexOf(i)+1;l.splice(s,0,o)}else(void 0===t.insert||t.insert)&&l.unshift(o);return o};if(r.skipping&&!o)return null;for(var h=null,f=e.length/1,p=!o,v=0;v<e.length;v++){var g=e[v],y=g._private.rscratch,m=y.imgLayerCaches=y.imgLayerCaches||{},b=m[n];if(b)h=b;else{if((!h||h.eles.length>=f||!ut(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:l)},Ma.getEleLevelForLayerLevel=function(e,t){return e},Ma.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Ma.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Ma.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=-1,a=0;a<t.length;a++)if(i.eles[0]===t[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==t[s+a]){this.invalidateLayer(i);break}}}},Ma.updateElementsInLayers=function(e,t){for(var n=C(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],o=n?e[r]:e[r].ele,a=o._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},u=-4;u<=2;u++){var c=s[u];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||t(c,o,i))}},Ma.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},Ma.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)})))},Ma.invalidateLayer=function(e){if(this.lastInvalidationTime=U(),!e.invalid){var t=e.level,n=e.eles;xe(this.layersByLevel[t],e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var r=0;r<n.length;r++){var i=n[r]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},Ma.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)t.queueLayer(i,i.eles[o])}))},Ma.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Ma.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},Ma.dequeue=function(e){for(var t=this.layersQueue,n=[],r=0;r<1&&0!==t.size();){var i=t.peek();if(i.replacement)t.pop();else if(i.replaces&&i!==i.replaces.replacement)t.pop();else if(i.invalid)t.pop();else{var o=i.elesQueue.shift();o&&(this.drawEleInLayer(i,o,i.level,e),r++),0===n.length&&n.push(!0),0===i.elesQueue.length&&(t.pop(),i.reqs=0,i.replaces&&this.applyLayerReplacement(i),this.requestRedraw())}}return n},Ma.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private,a=o.imgLayerCaches=o.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},Ma.requestRedraw=i((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),Ma.setupDequeueing=Ca({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:de,shouldRedraw:ue,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Aa,La={};function za(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function Ra(e,t,n){for(var r,i=0;i<t.length;i++){var o=t[i];0===i&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Fa(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++){var o=r[i];e.lineTo(o.x,o.y)}var a=n,s=n[0];for(e.moveTo(s.x,s.y),i=1;i<a.length;i++)e.lineTo((o=a[i]).x,o.y);e.closePath&&e.closePath()}function Va(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var o=t,a=o[0];e.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var u=o[s];e.lineTo(u.x,u.y)}e.closePath&&e.closePath()}function qa(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}La.arrowShapeImpl=function(e){return(Aa||(Aa={polygon:za,"triangle-backcurve":Ra,"triangle-tee":Fa,"circle-triangle":Va,"triangle-cross":Fa,circle:qa}))[e]};var Xa={drawElement:function(e,t,n,r,i,o){t.isNode()?this.drawNode(e,t,n,r,i,o):this.drawEdge(e,t,n,r,i,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,o,a,s){var u=this,c=n.getBoundingBox(t);if(0!==c.w&&0!==c.h){var l=n.getElement(t,c,r,i,o);if(null!=l){var d=s(u,t);if(0===d)return;var h,f,p,v,g,y,m=a(u,t),b=c.x1,x=c.y1,w=c.w,E=c.h;if(0!==m){var k=n.getRotationPoint(t);e.translate(p=k.x,v=k.y),e.rotate(m),(g=u.getImgSmoothing(e))||u.setImgSmoothing(e,!0);var P=n.getRotationOffset(t);h=P.x,f=P.y}else h=b,f=x;1!==d&&(e.globalAlpha=(y=e.globalAlpha)*d),e.drawImage(l.texture.canvas,l.x,0,l.width,l.height,h,f,w,E),1!==d&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-p,-v),g||u.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Ya=function(){return 0},Wa=function(e,t){return e.getTextAngle(t,null)},Ha=function(e,t){return e.getTextAngle(t,"source")},Ga=function(e,t){return e.getTextAngle(t,"target")},Ua=function(e,t){return t.effectiveOpacity()},Ka=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Xa.drawCachedElement=function(e,t,n,r,i,o){var a=this,s=a.data,u=s.eleTxrCache,c=s.lblTxrCache,l=s.slbTxrCache,d=s.tlbTxrCache,h=t.boundingBox(),f=!0===o?u.reasons.highQuality:null;if(0!==h.w&&0!==h.h&&t.visible()&&(!r||at(h,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawCachedElementPortion(e,t,u,n,i,f,Ya,Ua),p&&v||a.drawCachedElementPortion(e,t,c,n,i,f,Wa,Ka),p&&!v&&(a.drawCachedElementPortion(e,t,l,n,i,f,Ha,Ka),a.drawCachedElementPortion(e,t,d,n,i,f,Ga,Ka)),a.drawElementOverlay(e,t)}},Xa.drawElements=function(e,t){for(var n=0;n<t.length;n++)this.drawElement(e,t[n])},Xa.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++)this.drawCachedElement(e,t[i],n,r)},Xa.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];o.isNode()&&this.drawCachedElement(e,o,n,r)}},Xa.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var o=0;o<i.length;o++){var a=i[o],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Za={drawEdge: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],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var u;n&&e.translate(-(u=n).x1,-u.y1);var c=o?t.pstyle("opacity").value:1,l=o?t.pstyle("line-opacity").value:1,d=t.pstyle("line-style").value,h=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,p=c*l,v=c*l,g=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p;e.lineWidth=h,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt"},y=function(){i&&a.drawEdgeOverlay(e,t)},m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;a.drawArrowheads(e,t,n)},b=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var x="yes"===t.pstyle("ghost").value;if(x){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,k=t.pstyle("ghost-opacity").value,P=p*k;e.translate(w,E),g(P),m(P),e.translate(-w,-E)}g(),m(),y(),b(),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(),o=t._private.rscratch,a=2*t.pstyle("overlay-padding").pfValue,s=t.pstyle("overlay-color").value;e.lineWidth=a,e.lineCap="self"!==o.edgeType||i?"round":"butt",r.colorStrokeStyle(e,s[0],s[1],s[2],n),r.drawEdgePath(t,e,o.allpts,"solid")}}},drawEdgePath:function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,u=this.usePaths(),c=e.pstyle("line-dash-pattern").pfValue,l=e.pstyle("line-dash-offset").pfValue;if(u){var d=n.join("$");o.pathCacheKey&&o.pathCacheKey===d?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=d,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(c),a.lineDashOffset=l;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<n.length;h+=4)t.quadraticCurveTo(n[h],n[h+1],n[h+2],n[h+3]);break;case"straight":case"segments":case"haystack":for(var f=2;f+1<n.length;f+=2)t.lineTo(n[f],n[f+1])}t=a,u?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},drawArrowheads:function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},drawArrowhead:function(e,t,n,r,i,o,a){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(o)||null==o)){var s=t.pstyle(n+"-arrow-shape").value;if("none"!==s){var u="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",c=t.pstyle(n+"-arrow-fill").value,l=t.pstyle("width").pfValue,d=t.pstyle("opacity").value;void 0===a&&(a=d);var h=e.globalCompositeOperation;1===a&&"hollow"!==c||(e.globalCompositeOperation="destination-out",this.colorFillStyle(e,255,255,255,1),this.colorStrokeStyle(e,255,255,255,1),this.drawArrowShape(t,e,u,l,s,r,i,o),e.globalCompositeOperation=h);var f=t.pstyle(n+"-arrow-color").value;this.colorFillStyle(e,f[0],f[1],f[2],a),this.colorStrokeStyle(e,f[0],f[1],f[2],a),this.drawArrowShape(t,e,c,l,s,r,i,o)}}},drawArrowShape:function(e,t,n,r,i,o,a,s){var u,c=this,l=this.usePaths()&&"triangle-cross"!==i,d=!1,h=t,f={x:o,y:a},p=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,p),g=c.arrowShapes[i];if(l){var y=c.arrowPathCache=c.arrowPathCache||[],m=te(i),b=y[m];null!=b?(u=t=b,d=!0):(u=t=new Path2D,y[m]=u)}d||(t.beginPath&&t.beginPath(),l?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,f,r),t.closePath&&t.closePath()),t=h,l&&(t.translate(o,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(l?t.fill(u):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(l?v:1),t.lineJoin="miter",l?t.stroke(u):t.stroke()),l&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-o,-a))}},$a={safeDrawImage:function(e,t,n,r,i,o,a,s,u,c){i<=0||o<=0||u<=0||c<=0||e.drawImage(t,n,r,i,o,a,s,u,c)},drawInscribedImage:function(e,t,n,r,i){var o=this,a=n.position(),s=a.x,u=a.y,c=n.cy().style(),l=c.getIndexedStyle.bind(c),d=l(n,"background-fit","value",r),h=l(n,"background-repeat","value",r),f=n.width(),p=n.height(),v=2*n.padding(),g=f+("inner"===l(n,"background-width-relative-to","value",r)?0:v),y=p+("inner"===l(n,"background-height-relative-to","value",r)?0:v),m=n._private.rscratch,b="node"===l(n,"background-clip","value",r),x=l(n,"background-image-opacity","value",r)*i,w=l(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,k=t.height||t.cachedH;null!=E&&null!=k||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,k=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var P=E,j=k;if("auto"!==l(n,"background-width","value",r)&&(P="%"===l(n,"background-width","units",r)?l(n,"background-width","pfValue",r)*g:l(n,"background-width","pfValue",r)),"auto"!==l(n,"background-height","value",r)&&(j="%"===l(n,"background-height","units",r)?l(n,"background-height","pfValue",r)*y:l(n,"background-height","pfValue",r)),0!==P&&0!==j){if("contain"===d)P*=C=Math.min(g/P,y/j),j*=C;else if("cover"===d){var C;P*=C=Math.max(g/P,y/j),j*=C}var _=s-g/2,S=l(n,"background-position-x","units",r),O=l(n,"background-position-x","pfValue",r);_+="%"===S?(g-P)*O:O;var D=l(n,"background-offset-x","units",r),T=l(n,"background-offset-x","pfValue",r);_+="%"===D?(g-P)*T:T;var B=u-y/2,M=l(n,"background-position-y","units",r),N=l(n,"background-position-y","pfValue",r);B+="%"===M?(y-j)*N:N;var I=l(n,"background-offset-y","units",r),A=l(n,"background-offset-y","pfValue",r);B+="%"===I?(y-j)*A:A,m.pathCache&&(_-=s,B-=u,s=0,u=0);var L=e.globalAlpha;e.globalAlpha=x;var z=o.getImgSmoothing(e),R=!1;if("no"===w&&z?(o.setImgSmoothing(e,!1),R=!0):"yes"!==w||z||(o.setImgSmoothing(e,!0),R=!0),"no-repeat"===h)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,u,g,y),e.clip())),o.safeDrawImage(e,t,0,0,E,k,_,B,P,j),b&&e.restore();else{var F=e.createPattern(t,h);e.fillStyle=F,o.nodeShapes[o.getNodeShape(n)].draw(e,s,u,g,y),e.translate(_,B),e.fill(),e.translate(-_,-B)}e.globalAlpha=L,R&&o.setImgSmoothing(e,z)}}},Qa={};function Ja(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill()}Qa.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Ge(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},Qa.drawElementText=function(e,t,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var u=a.getLabelJustification(t);e.textAlign=u,e.textBaseline="bottom"}else{var c=t.element()._private.rscratch.badLine,l=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(c||(!l||!l.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var f,p=!n;n&&e.translate(-(f=n).x1,-f.y1),null==i?(a.drawText(e,t,null,p,o),t.isEdge()&&(a.drawText(e,t,"source",p,o),a.drawText(e,t,"target",p,o))):a.drawText(e,t,i,p,o),n&&e.translate(f.x1,f.y1)},Qa.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return this.fontCaches.push(t={context:e}),t},Qa.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,u=t.pstyle("text-outline-opacity").value*s,c=t.pstyle("color").value,l=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,c[0],c[1],c[2],s),this.colorStrokeStyle(e,l[0],l[1],l[2],u)},Qa.getTextAngle=function(e,t){var n=e._private.rscratch,r=e.pstyle((t?t+"-":"")+"text-rotation"),i=Ee(n,"labelAngle",t);return"autorotate"===r.strValue?e.isEdge()?i:0:"none"===r.strValue?0:r.pfValue},Qa.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],o=t._private,a=o.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var u,c,l=Ee(a,"labelX",n),d=Ee(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(l)&&!isNaN(d)){this.setupTextStyle(e,t,i);var f,p=n?n+"-":"",v=Ee(a,"labelWidth",n),g=Ee(a,"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"),l+=y,d+=m,0!==(f=r?this.getTextAngle(t,n):0)&&(e.translate(u=l,c=d),e.rotate(f),l=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var E=t.pstyle("text-background-opacity").value,k=t.pstyle("text-border-opacity").value,P=t.pstyle("text-border-width").pfValue,j=t.pstyle("text-background-padding").pfValue;if(E>0||P>0&&k>0){var C=l-j;switch(x){case"left":C-=v;break;case"center":C-=v/2}var _=d-g-j,S=v+2*j,O=g+2*j;if(E>0){var D=e.fillStyle,T=t.pstyle("text-background-color").value;e.fillStyle="rgba("+T[0]+","+T[1]+","+T[2]+","+E*s+")";var B=t.pstyle("text-background-shape").strValue;0===B.indexOf("round")?Ja(e,C,_,S,O,2):e.fillRect(C,_,S,O),e.fillStyle=D}if(P>0&&k>0){var M=e.strokeStyle,N=e.lineWidth,I=t.pstyle("text-border-color").value,A=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+I[0]+","+I[1]+","+I[2]+","+k*s+")",e.lineWidth=P,e.setLineDash)switch(A){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=P/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(C,_,S,O),"double"===A){var L=P/2;e.strokeRect(C+L,_+L,S-2*L,O-2*L)}e.setLineDash&&e.setLineDash([]),e.lineWidth=N,e.strokeStyle=M}}var z=2*t.pstyle("text-outline-width").pfValue;if(z>0&&(e.lineWidth=z),"wrap"===t.pstyle("text-wrap").value){var R=Ee(a,"labelWrapCachedLines",n),F=Ee(a,"labelLineHeight",n),V=v/2,q=this.getLabelJustification(t);switch("auto"===q||("left"===x?"left"===q?l+=-v:"center"===q&&(l+=-V):"center"===x?"left"===q?l+=-V:"right"===q&&(l+=V):"right"===x&&("center"===q?l+=V:"right"===q&&(l+=v))),w){case"top":d-=(R.length-1)*F;break;case"center":case"bottom":d-=(R.length-1)*F}for(var X=0;X<R.length;X++)z>0&&e.strokeText(R[X],l,d),e.fillText(R[X],l,d),d+=F}else z>0&&e.strokeText(h,l,d),e.fillText(h,l,d);0!==f&&(e.rotate(-f),e.translate(-u,-c))}}};for(var es={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],u=this,c=t._private,l=c.rscratch,d=t.position();if(k(d.x)&&k(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&&e.translate(-(f=n).x1,-f.y1);for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),E=0,P=0;P<b.length;P++){var j=b[P],C=x[P]=null!=j&&"none"!==j;if(C){var _=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",P);E++,w[P]=u.getCachedImage(j,_,(function(){c.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var S=t.pstyle("background-blacken").value,O=t.pstyle("border-width").pfValue,D=t.pstyle("background-opacity").value*p,T=t.pstyle("border-color").value,B=t.pstyle("border-style").value,M=t.pstyle("border-opacity").value*p;e.lineJoin="miter";var N=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D;u.eleFillStyle(e,t,n)},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;u.colorStrokeStyle(e,T[0],T[1],T[2],t)},A=t.pstyle("shape").strValue,L=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var z=u.nodePathCache=u.nodePathCache||[],R=ne("polygon"===A?A+","+L.join(","):A,""+i,""+r),F=z[R];null!=F?(g=!0,l.pathCache=h=F):(h=new Path2D,z[R]=l.pathCache=h)}var V=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=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=c.backgrounding,o=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:x[a]&&w[a].complete&&!w[a].error&&(o++,u.drawInscribedImage(e,w[a],t,a,n))}c.backgrounding=!(o===E),i!==c.backgrounding&&t.updateStyle(!1)},X=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p;u.hasPie(t)&&(u.drawPie(e,t,o),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=(S>0?S:-S)*t,r=S>0?0:255;0!==S&&(u.colorFillStyle(e,r,r,r,n),v?e.fill(h):e.fill())},W=function(){if(O>0){if(e.lineWidth=O,e.lineCap="butt",e.setLineDash)switch(B){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"===B){e.lineWidth=O/3;var t=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(h):e.stroke(),e.globalCompositeOperation=t}e.setLineDash&&e.setLineDash([])}},H=function(){a&&u.drawNodeOverlay(e,t,d,r,i)},G=function(){u.drawElementText(e,t,null,o)},U="yes"===t.pstyle("ghost").value;if(U){var K=t.pstyle("ghost-offset-x").pfValue,Z=t.pstyle("ghost-offset-y").pfValue,$=t.pstyle("ghost-opacity").value,Q=$*p;e.translate(K,Z),N($*D),V(),q(Q,!0),I($*M),W(),X(0!==S||0!==O),q(Q,!1),Y(Q),e.translate(-K,-Z)}N(),V(),q(p,!0),I(),W(),X(0!==S||0!==O),q(p,!1),Y(),v&&e.translate(-d.x,-d.y),G(),H(),n&&e.translate(f.x1,f.y1)}},drawNodeOverlay:function(e,t,n,r,i){if(t.visible()){var o=t.pstyle("overlay-padding").pfValue,a=t.pstyle("overlay-opacity").value,s=t.pstyle("overlay-color").value;if(a>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],a),this.nodeShapes.roundrectangle.draw(e,n.x,n.y,r+2*o,i+2*o),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(),o=t.pstyle("pie-size"),a=r.x,s=r.y,u=t.width(),c=t.height(),l=Math.min(u,c)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?l*=o.pfValue:void 0!==o.pfValue&&(l=o.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(a,s),e.arc(a,s,l,y,m),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=g)}}},ts={getPixelRatio:function(){var e=this.data.contexts[0];return null!=this.forcedPixelRatio?this.forcedPixelRatio:(window.devicePixelRatio||1)/(e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&n.push(t={context:e}),t},createGradientStyleFor:function(e,t,n,r,i){var o,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,u=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var c=n.sourceEndpoint(),l=n.targetEndpoint(),d=n.midpoint(),h=Ke(c,d),f=Ke(l,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,f))}else{var p=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();o=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,g))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();o=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":o=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":o=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":o=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!o)return null;for(var E=u.length===s.length,k=s.length,P=0;P<k;P++)o.addColorStop(E?u[P]:P/(k-1),"rgba("+s[P][0]+","+s[P][1]+","+s[P][2]+","+i+")");return o},gradientFillStyle:function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},colorFillStyle:function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},eleFillStyle:function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},gradientStrokeStyle:function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},colorStrokeStyle:function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},eleStrokeStyle:function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},matchCanvasSize:function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],o=r[3],a=t.getPixelRatio();e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=t.motionBlurPxRatio);var s,u=i*a,c=o*a;if(u!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var l=n.canvasContainer;l.style.width=i+"px",l.style.height=o+"px";for(var d=0;d<t.CANVAS_LAYERS;d++)(s=n.canvases[d]).width=u,s.height=c,s.style.width=i+"px",s.style.height=o+"px";for(d=0;d<t.BUFFER_COUNT;d++)(s=n.bufferCanvases[d]).width=u,s.height=c,s.style.width=i+"px",s.style.height=o+"px";t.textureMult=1,a<=1&&(s=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,s.width=u*t.textureMult,s.height=c*t.textureMult),t.canvasWidth=u,t.canvasHeight=c}},renderTo:function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},render:function(e){var t=(e=e||me()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,o=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,u=a.cy,c=a.data,l=c.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),h=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,f=a.motionBlurPxRatio,p=u.hasCompoundNodes(),v=a.hoverData.draggingEles,g=h=h&&!t&&a.motionBlurEnabled&&!(a.hoverData.selecting||a.touchData.selecting);t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),h&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(g=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(l[a.NODE]=!0,l[a.SELECT_BOX]=!0);var y=u.style(),m=u.zoom(),b=void 0!==i?i:m,x=u.pan(),w={x:x.x,y:x.y},E={zoom:m,pan:{x:x.x,y:x.y}},k=a.prevViewport;void 0===k||E.zoom!==k.zoom||E.pan.x!==k.pan.x||E.pan.y!==k.pan.y||v&&!p||(a.motionBlurPxRatio=1),o&&(w=o),b*=s,w.x*=s,w.y*=s;var P=a.getCachedZSortedEles();function j(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function C(e,r){var s,u,l,d;a.clearingMotionBlur||e!==c.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==c.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=w,u=b,l=a.canvasWidth,d=a.canvasHeight):(s={x:x.x*f,y:x.y*f},u=m*f,l=a.canvasWidth*f,d=a.canvasHeight*f),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?j(e,0,0,l,d):t||void 0!==r&&!r||e.clearRect(0,0,l,d),n||(e.translate(s.x,s.y),e.scale(u,u)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=u.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var _=a.data.bufferContexts[a.TEXTURE_BUFFER];_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:_,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(E=a.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}l[a.DRAG]=!1,l[a.NODE]=!1;var S=c.contexts[a.NODE],O=a.textureCache.texture;E=a.textureCache.viewport,S.setTransform(1,0,0,1,0,0),h?j(S,0,0,E.width,E.height):S.clearRect(0,0,E.width,E.height);var D=y.core("outside-texture-bg-color").value,T=y.core("outside-texture-bg-opacity").value;a.colorFillStyle(S,D[0],D[1],D[2],T),S.fillRect(0,0,E.width,E.height),m=u.zoom(),C(S,!1),S.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),S.drawImage(O,E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var B=u.extent(),M=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),N=a.hideEdgesOnViewport&&M,I=[];if(I[a.NODE]=!l[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,I[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),I[a.DRAG]=!l[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,I[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),l[a.NODE]||n||r||I[a.NODE]){var A=h&&!I[a.NODE]&&1!==f;C(S=t||(A?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:c.contexts[a.NODE]),h&&!A?"motionBlur":void 0),N?a.drawCachedNodes(S,P.nondrag,s,B):a.drawLayeredElements(S,P.nondrag,s,B),a.debug&&a.drawDebugPoints(S,P.nondrag),n||h||(l[a.NODE]=!1)}if(!r&&(l[a.DRAG]||n||I[a.DRAG])&&(A=h&&!I[a.DRAG]&&1!==f,C(S=t||(A?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:c.contexts[a.DRAG]),h&&!A?"motionBlur":void 0),N?a.drawCachedNodes(S,P.drag,s,B):a.drawCachedElements(S,P.drag,s,B),a.debug&&a.drawDebugPoints(S,P.drag),n||h||(l[a.DRAG]=!1)),a.showFps||!r&&l[a.SELECT_BOX]&&!n){if(C(S=t||c.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){m=a.cy.zoom();var L=y.core("selection-box-border-width").value/m;S.lineWidth=L,S.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",S.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),L>0&&(S.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",S.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(c.bgActivePosistion&&!a.hoverData.selecting){m=a.cy.zoom();var z=c.bgActivePosistion;S.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",S.beginPath(),S.arc(z.x,z.y,y.core("active-bg-size").pfValue/m,0,2*Math.PI),S.fill()}var R=a.lastRedrawTime;if(a.showFps&&R){R=Math.round(R);var F=Math.round(1e3/R);S.setTransform(1,0,0,1,0,0),S.fillStyle="rgba(255, 0, 0, 0.75)",S.strokeStyle="rgba(255, 0, 0, 0.75)",S.lineWidth=1,S.fillText("1 frame = "+R+" ms = "+F+" fps",0,20),S.strokeRect(0,30,250,20),S.fillRect(0,30,250*Math.min(F/60,1),20)}n||(l[a.SELECT_BOX]=!1)}if(h&&1!==f){var V=c.contexts[a.DRAG],q=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],X=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!g?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):j(e,0,0,a.canvasWidth,a.canvasHeight),e.drawImage(t,0,0,a.canvasWidth*f,a.canvasHeight*f,0,0,a.canvasWidth,a.canvasHeight)};(l[a.NODE]||I[a.NODE])&&(X(c.contexts[a.NODE],a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],I[a.NODE]),l[a.NODE]=!1),(l[a.DRAG]||I[a.DRAG])&&(X(V,q,I[a.DRAG]),l[a.DRAG]=!1)}a.prevViewport=E,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,l[a.NODE]=!0,l[a.DRAG]=!0,a.redraw()}),100)),t||u.emit("render")}},ns={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var u=1;u<o.length/2;u++)e.lineTo(t+a*o[2*u],n+s*o[2*u+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2,u=St(r,i);e.beginPath&&e.beginPath();for(var c=0;c<o.length/4;c++){var l,d;d=0===c?o.length-2:4*c-2,l=4*c+2;var h=t+a*o[4*c],f=n+s*o[4*c+1],p=u/Math.tan(Math.acos(-o[d]*o[l]-o[d+1]*o[l+1])/2),v=h-p*o[d],g=f-p*o[d+1],y=h+p*o[l],m=f+p*o[l+1];0===c?e.moveTo(v,g):e.lineTo(v,g),e.arcTo(h,f,y,m,u)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=_t(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+o,n-a,t+o,n,s),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.arcTo(t-o,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=_t(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+o,n-a),e.lineTo(t+o,n),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.lineTo(t-o,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-o+8,n-a),e.lineTo(t+o-8,n-a),e.lineTo(t+o,n-a+8),e.lineTo(t+o,n+a-8),e.lineTo(t+o-8,n+a),e.lineTo(t-o+8,n+a),e.lineTo(t-o,n+a-8),e.lineTo(t-o,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var o=r/2,a=i/2,s=t-o,u=t+o,c=n-a,l=n+a,d=Ot(r,i),h=d.widthOffset,f=d.heightOffset,p=d.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(s,c+f),e.lineTo(s,l-f),e.quadraticCurveTo(s+p,l,s+h,l),e.lineTo(u-h,l),e.quadraticCurveTo(u-p,l,u,l-f),e.lineTo(u,c+f),e.quadraticCurveTo(u-p,c,u-h,c),e.lineTo(s+h,c),e.quadraticCurveTo(s+p,c,s,c+f),e.closePath()}},rs=Math.sin(0),is=Math.cos(0),os={},as={},ss=Math.PI/40,us=0*Math.PI;us<2*Math.PI;us+=ss)os[us]=Math.sin(us),as[us]=Math.cos(us);ns.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var o,a,s=r/2,u=i/2,c=0*Math.PI;c<2*Math.PI;c+=ss)o=t-s*os[c]*rs+s*as[c]*is,a=n+u*as[c]*rs+u*os[c]*is,0===c?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var cs={};function ls(e){var t=e.indexOf(",");return e.substr(t+1)}function ds(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new Rn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(o){i(o)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:t})}(ls(r()),n);case"base64":return ls(r());case"base64uri":default:return r()}}cs.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},cs.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],a=k(e.maxWidth)||k(e.maxHeight),s=this.getPixelRatio(),u=1;if(void 0!==e.scale)i*=e.scale,o*=e.scale,u=e.scale;else if(a){var c=1/0,l=1/0;k(e.maxWidth)&&(c=u*e.maxWidth/i),k(e.maxHeight)&&(l=u*e.maxHeight/o),i*=u=Math.min(c,l),o*=u}a||(i*=s,o*=s,u*=s);var d=document.createElement("canvas");d.width=i,d.height=o,d.style.width=i+"px",d.style.height=o+"px";var h=d.getContext("2d");if(i>0&&o>0){h.clearRect(0,0,i,o),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,o),h.fill())}return d},cs.png=function(e){return ds(e,this.bufferCanvasImage(e),"image/png")},cs.jpg=function(e){return ds(e,this.bufferCanvasImage(e),"image/jpeg")};var hs=ps,fs=ps.prototype;function ps(e){var t=this;t.data={canvases:new Array(fs.CANVAS_LAYERS),contexts:new Array(fs.CANVAS_LAYERS),canvasNeedsRedraw:new Array(fs.CANVAS_LAYERS),bufferCanvases:new Array(fs.BUFFER_COUNT),bufferContexts:new Array(fs.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 o=0;o<fs.CANVAS_LAYERS;o++){var a=t.data.canvases[o]=document.createElement("canvas");t.data.contexts[o]=a.getContext("2d"),Object.keys(i).forEach((function(e){a.style[e]=i[e]})),a.style.position="absolute",a.setAttribute("data-id","layer"+o),a.style.zIndex=String(fs.CANVAS_LAYERS-o),t.data.canvasContainer.appendChild(a),t.data.canvasNeedsRedraw[o]=!1}for(t.data.topCanvas=t.data.canvases[0],t.data.canvases[fs.NODE].setAttribute("data-id","layer"+fs.NODE+"-node"),t.data.canvases[fs.SELECT_BOX].setAttribute("data-id","layer"+fs.SELECT_BOX+"-selectbox"),t.data.canvases[fs.DRAG].setAttribute("data-id","layer"+fs.DRAG+"-drag"),o=0;o<fs.BUFFER_COUNT;o++)t.data.bufferCanvases[o]=document.createElement("canvas"),t.data.bufferContexts[o]=t.data.bufferCanvases[o].getContext("2d"),t.data.bufferCanvases[o].style.position="absolute",t.data.bufferCanvases[o].setAttribute("data-id","buffer"+o),t.data.bufferCanvases[o].style.zIndex=String(-o-1),t.data.bufferCanvases[o].style.visibility="hidden";t.pathsEnabled=!0;var s=tt(),u=function(e){return{x:-e.w/2,y:-e.h/2}},c=function(e){return e.boundingBox(),e[0]._private.bodyBounds},l=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||s},d=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||s},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||s},p=function(e,t){return t},v=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},g=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},y=t.data.eleTxrCache=new Da(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,o){return t.drawElement(e,n,r,!1,!1,o)},getBoundingBox:c,getRotationPoint:function(e){return{x:((t=c(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return u(c(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),m=t.data.lblTxrCache=new Da(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"main",o)},getBoundingBox:l,getRotationPoint:function(e){return v("",g(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=l(e),n=u(l(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:p}),b=t.data.slbTxrCache=new Da(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"source",o)},getBoundingBox:d,getRotationPoint:function(e){return v("source",g(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return u(d(e))},isVisible:p}),x=t.data.tlbTxrCache=new Da(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"target",o)},getBoundingBox:h,getRotationPoint:function(e){return v("target",g(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return u(h(e))},isVisible:p}),w=t.data.lyrTxrCache=new Ba(t);t.onUpdateEleCalcs((function(e,t){y.invalidateElements(t),m.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var E=function(e){for(var t=0;t<e.length;t++)w.enqueueElementRefinement(e[t].ele)};y.onDequeue(E),m.onDequeue(E),b.onDequeue(E),x.onDequeue(E)}fs.CANVAS_LAYERS=3,fs.SELECT_BOX=0,fs.DRAG=1,fs.NODE=2,fs.BUFFER_COUNT=3,fs.TEXTURE_BUFFER=0,fs.MOTIONBLUR_BUFFER_NODE=1,fs.MOTIONBLUR_BUFFER_DRAG=2,fs.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[fs.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[fs.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[fs.SELECT_BOX]=t}};var vs="undefined"!=typeof Path2D;fs.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},fs.usePaths=function(){return vs&&this.pathsEnabled},fs.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},fs.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},fs.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":a(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[La,Xa,Za,$a,Qa,es,ts,ns,cs,{nodeShapeImpl:function(e,t,n,r,i,o,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}}}].forEach((function(e){R(fs,e)}));var gs=[{type:"layout",extensions:ta},{type:"renderer",extensions:[{name:"null",impl:na},{name:"base",impl:Pa},{name:"canvas",impl:hs}]}],ys={},ms={};function bs(e,t,n){var r=n,i=function(n){he("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(vo.prototype[t])return i(t);vo.prototype[t]=n}else if("collection"===e){if(Bi.prototype[t])return i(t);Bi.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),E(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(n.prototype),s=[],u=0;u<s.length;u++){var c=s[u];a[c]=a[c]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var l=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return l?l.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},h={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};R(a,{createEmitter:function(){return this._private.emitter=new Jr(h,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),qn.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var f=xs("renderer","base"),p=f.prototype,v=n,g=n.prototype,y=function(){f.apply(this,arguments),v.apply(this,arguments)},m=y.prototype;for(var b in p){var x=p[b];if(null!=g[b])return i(b);m[b]=x}for(var w in g)m[w]=g[w];p.clientFunctions.forEach((function(e){m[e]=m[e]||function(){he("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}return q({map:ys,keys:[e,t],value:r})}function xs(e,t){return X({map:ys,keys:[e,t]})}function ws(e,t,n,r,i){return q({map:ms,keys:[e,t,n,r],value:i})}function Es(e,t,n,r){return X({map:ms,keys:[e,t,n,r]})}var ks=function(){return 2===arguments.length?xs.apply(null,arguments):3===arguments.length?bs.apply(null,arguments):4===arguments.length?Es.apply(null,arguments):5===arguments.length?ws.apply(null,arguments):void he("Invalid extension access syntax")};vo.prototype.extension=ks,gs.forEach((function(e){e.extensions.forEach((function(t){bs(e.type,t.name,t.impl)}))}));var Ps=function e(){if(!(this instanceof e))return new e;this.length=0},js=Ps.prototype;js.instanceString=function(){return"stylesheet"},js.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},js.css=function(e,t){var n=this.length-1;if(b(e))this[n].properties.push({name:e,value:t});else if(E(e))for(var r=e,i=Object.keys(r),o=0;o<i.length;o++){var a=i[o],s=r[a];if(null!=s){var u=co.properties[a]||co.properties[N(a)];null!=u&&this[n].properties.push({name:u.name,value:s})}}return this},js.style=js.css,js.generateStyle=function(e){var t=new co(e);return this.appendToStyle(t)},js.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.properties;e.selector(n.selector);for(var i=0;i<r.length;i++){var o=r[i];e.css(o.name,o.value)}}return e};var Cs=function(e){return void 0===e&&(e={}),E(e)?new vo(e):b(e)?ks.apply(ks,arguments):void 0};Cs.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Cs),e.apply(null,t),this},Cs.warnings=function(e){return fe(e)},Cs.version="3.18.2",Cs.stylesheet=Cs.Stylesheet=Ps,e.exports=Cs},lx39:function(e,t,n){var r=n("XpzN"),i=n("P/Kr"),o=n("QA6A");e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},m97I:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("PX5Y");function i(e){return((Object(r.a)(e)?e.ownerDocument:e.document)||window.document).documentElement}},mqRG:function(e,t,n){var r=n("tIEw")("length");e.exports=r},mqi7:function(e,t,n){var r=n("xJuT"),i=n("zOYv");e.exports=function(e,t){return r(e,i(e),t)}},n3sS:function(e,t,n){var r=n("wMi0"),i=n("ZB1U"),o=n("20jF"),a=n("lx39"),s=n("0Zrb");e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},nECo:function(e,t,n){var r=n("MVHo");e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},nHTl:function(e,t,n){var r=n("Upex"),i=n("knj+"),o=n("uYOL"),a=n("P/Kr"),s=n("Ur9C");e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},nb5l:function(e,t,n){var r=n("akX6"),i=n("x14d"),o=n("P/Kr"),a=n("FBB6"),s=n("68Jb"),u=n("38y5"),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),l=!n&&i(e),d=!n&&!l&&a(e),h=!n&&!l&&!d&&u(e),f=n||l||d||h,p=f?r(e.length,String):[],v=p.length;for(var g in e)!t&&!c.call(e,g)||f&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},o4PY:function(e,t,n){var r=n("rhmX"),i=0;e.exports=function(e){var t=++i;return r(e)+t}},oFCp:function(e,t,n){"use strict";var r=n("0M5s"),i={passive:!0};t.a={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,a=o.scroll,s=void 0===a||a,u=o.resize,c=void 0===u||u,l=Object(r.a)(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach((function(e){e.addEventListener("scroll",n.update,i)})),c&&l.addEventListener("resize",n.update,i),function(){s&&d.forEach((function(e){e.removeEventListener("scroll",n.update,i)})),c&&l.removeEventListener("resize",n.update,i)}},data:{}}},odWq:function(e,t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,c=s||u||Function("return this")(),l=Object.prototype.toString,d=Math.max,h=Math.min,f=function(){return c.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=i.test(e);return s||o.test(e)?a(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,u,c=0,l=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,o=i;return r=i=void 0,c=t,a=e.apply(o,n)}function b(e){return c=e,s=setTimeout(w,t),l?m(e):a}function x(e){var n=e-u;return void 0===u||n>=t||n<0||g&&e-c>=o}function w(){var e=f();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-u);return g?h(n,o-(e-c)):n}(e))}function E(e){return s=void 0,y&&r?m(e):(r=i=void 0,a)}function k(){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)),a}return t=v(t)||0,p(n)&&(l=!!n.leading,o=(g="maxWait"in n)?d(v(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0},k.flush=function(){return void 0===s?a:E(f())},k}},oe4Z:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("UbiW");function i(e){var t=Object(r.a)(e);return/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}},"oid+":function(e,t,n){"use strict";var r=n("OXg1");t.a={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=Object(r.a)({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}}},omPs:function(e,t,n){var r=n("Hczf"),i=n("ZfK0"),o=n("9qq3"),a=n("Mmx5"),s=n("TVu4"),u=n("+3xT");function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,e.exports=c},p1dg:function(e,t,n){var r=n("TXW/");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},pFYY:function(e,t,n){var r=n("vkNO")(n("/wvS"),"Set");e.exports=r},pJDX:function(e,t,n){var r=n("LlRA"),i=n("2v8U"),o=n("D3R9"),a=n("P/Kr");e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},prgG:function(e,t,n){"use strict";var r=n("2Pt6"),i=n("+y+b").Graph,o=n("Jqlz").slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function u(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),c=e.nodes()[0],l=e.nodeCount();for(r.setNode(c,{});a(r,e)<l;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),u(r,e,n);return r}},"q+Dt":function(e,t,n){var r=n("sjqF"),i=n("9RX+"),o=n("P9pc");e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},q6aP:function(e,t,n){"use strict";var r=n("P87u"),i=n("JHDW"),o=n("KdpE"),a=n("cu0D"),s=n("g4JO"),u=n("/Ktv"),c=n("4idG"),l=n("k6AR"),d=n("JXIS"),h=n("wJ0V");t.a={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,f=e.name,p=n.mainAxis,v=void 0===p||p,g=n.altAxis,y=void 0!==g&&g,m=n.boundary,b=n.rootBoundary,x=n.altBoundary,w=n.padding,E=n.tether,k=void 0===E||E,P=n.tetherOffset,j=void 0===P?0:P,C=Object(c.a)(t,{boundary:m,rootBoundary:b,padding:w,altBoundary:x}),_=Object(i.a)(t.placement),S=Object(l.a)(t.placement),O=!S,D=Object(o.a)(_),T="x"===D?"y":"x",B=t.modifiersData.popperOffsets,M=t.rects.reference,N=t.rects.popper,I="function"==typeof j?j(Object.assign({},t.rects,{placement:t.placement})):j,A={x:0,y:0};if(B){if(v||y){var L="y"===D?r.u:r.l,z="y"===D?r.i:r.s,R="y"===D?"height":"width",F=B[D],V=B[D]+C[L],q=B[D]-C[z],X=k?-N[R]/2:0,Y=S===r.t?M[R]:N[R],W=S===r.t?-N[R]:-M[R],H=t.elements.arrow,G=k&&H?Object(s.a)(H):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Object(d.a)(),K=U[L],Z=U[z],$=Object(a.a)(0,M[R],G[R]),Q=O?M[R]/2-X-$-K-I:Y-$-K-I,J=O?-M[R]/2+X+$+Z+I:W+$+Z+I,ee=t.elements.arrow&&Object(u.a)(t.elements.arrow),te=t.modifiersData.offset?t.modifiersData.offset[t.placement][D]:0,ne=B[D]+Q-te-(ee?"y"===D?ee.clientTop||0:ee.clientLeft||0:0),re=B[D]+J-te;if(v){var ie=Object(a.a)(k?Object(h.b)(V,ne):V,F,k?Object(h.a)(q,re):q);B[D]=ie,A[D]=ie-F}if(y){var oe=B[T],ae=oe+C["x"===D?r.u:r.l],se=oe-C["x"===D?r.i:r.s],ue=Object(a.a)(k?Object(h.b)(ae,ne):ae,oe,k?Object(h.a)(se,re):se);B[T]=ue,A[T]=ue-oe}}t.modifiersData[f]=A}},requiresIfExists:["offset"]}},qJB9:function(e,t,n){"use strict";var r=n("P87u"),i=n("/Ktv"),o=n("0M5s"),a=n("m97I"),s=n("UbiW"),u=n("JHDW"),c=n("wJ0V"),l={top:"auto",right:"auto",bottom:"auto",left:"auto"};function d(e){var t,n=e.popper,u=e.popperRect,d=e.placement,h=e.offsets,f=e.position,p=e.gpuAcceleration,v=e.adaptive,g=e.roundOffsets,y=!0===g?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:Object(c.c)(Object(c.c)(t*r)/r)||0,y:Object(c.c)(Object(c.c)(n*r)/r)||0}}(h):"function"==typeof g?g(h):h,m=y.x,b=void 0===m?0:m,x=y.y,w=void 0===x?0:x,E=h.hasOwnProperty("x"),k=h.hasOwnProperty("y"),P=r.l,j=r.u,C=window;if(v){var _=Object(i.a)(n),S="clientHeight",O="clientWidth";_===Object(o.a)(n)&&(_=Object(a.a)(n),"static"!==Object(s.a)(_).position&&(S="scrollHeight",O="scrollWidth")),_=_,d===r.u&&(j=r.i,w-=_[S]-u.height,w*=p?1:-1),d===r.l&&(P=r.s,b-=_[O]-u.width,b*=p?1:-1)}var D,T=Object.assign({position:f},v&&l);return Object.assign({},T,p?((D={})[j]=k?"0":"",D[P]=E?"0":"",D.transform=(C.devicePixelRatio||1)<2?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",D):((t={})[j]=k?w+"px":"",t[P]=E?b+"px":"",t.transform="",t))}t.a={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,l={placement:Object(u.a)(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,d(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,d(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}}},qifX:function(e,t,n){var r=n("xJuT"),i=n("UwPs");e.exports=function(e,t){return e&&r(t,i(t),e)}},ql8D:function(e,t,n){"use strict";var r=n("2Pt6"),i=n("Ls/e");e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,u=t.w,c=e.node(u).rank,l=t.name,d=e.edge(t),h=d.labelRank;if(c!==s+1){for(e.removeEdge(t),o=0,++s;s<c;++o,++s)d.points=[],n=i.addDummyNode(e,"edge",r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},"_d"),s===h&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},l),0===o&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,u,{weight:d.weight},l)}}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),r=e.node(t=n)}))}}},qmgT:function(e,t){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},r6dd:function(e,t,n){var r=n("90g9");e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},r90I:function(e,t){e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},"rV+L":function(e,t,n){"use strict";var r=n("2Pt6"),i=n("+y+b").Graph,o=n("Ls/e");function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,c=r.last(i);return r.forEach(i,(function(t,l){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===c)&&(r.forEach(i.slice(a,l+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(a<o||h<a)||i.dummy&&e.node(t).dummy||u(n,r,t)}))})),a=l+1,o=h)})),i})),n}function s(e,t){var n={};function i(t,i,o,a,s){var c;r.forEach(r.range(i,o),(function(i){e.node(c=t[i]).dummy&&r.forEach(e.predecessors(c),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&u(n,t,c)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(o=e.node(c[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function u(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function c(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function l(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var u=i(e);if(u.length)for(var l=((u=r.sortBy(u,(function(e){return s[e]}))).length-1)/2,d=Math.floor(l),h=Math.ceil(l);d<=h;++d){var f=u[d];a[e]===e&&t<s[f]&&!c(n,e,f)&&(a[f]=e,a[e]=o[e]=o[f],t=s[f])}}))})),{root:o,align:a}}function d(e,t,n,o,a){var s={},u=function(e,t,n,o){var a=new i,s=e.graph(),u=function(e,t,n){return function(i,o,a){var s,u=i.node(o),c=i.node(a),l=0;if(l+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(l+=n?s:-s),s=0,l+=(u.dummy?t:e)/2,l+=(c.dummy?t:e)/2,l+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(l+=n?s:-s),s=0,l}}(s.nodesep,s.edgesep,o);return r.forEach(t,(function(t){var i;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(u(e,t,i),s||0))}i=t}))})),a}(e,t,n,a),c=a?"borderLeft":"borderRight";function l(e,t){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return l((function(e){s[e]=u.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+u.edge(t))}),0)}),u.predecessors.bind(u)),l((function(t){var n=u.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-u.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[t]=Math.max(s[t],n))}),u.successors.bind(u)),r.forEach(o,(function(e){s[e]=s[n[e]]})),s}function h(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)})),n-i}))}function f(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,c=e[u];if(c!==t){var l=r.values(c);(s="l"===a?i-r.min(l):o-r.max(l))&&(e[u]=r.mapValues(c,(function(e){return e+s})))}}))}))}function p(e,t){return r.mapValues(e.ul,(function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2}))}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(a(e,n),s(e,n)),u={};r.forEach(["u","d"],(function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===o?e.predecessors:e.successors).bind(e),s=l(0,t,i,a),c=d(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,(function(e){return-e}))),u[o+n]=c}))}));var c=h(e,u);return f(u,c),p(u,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:c,verticalAlignment:l,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}},rYqC:function(e,t,n){var r=n("vkNO")(Object,"create");e.exports=r},rbAF:function(e,t,n){var r=n("aEqC");e.exports=function(e){return function(t){return r(t,e)}}},rhLl:function(e,t,n){var r=n("BBZX"),i=n("D3R9"),o=n("UwPs");e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},rhmX:function(e,t,n){var r=n("X/Qz");e.exports=function(e){return null==e?"":r(e)}},s1IN:function(e,t,n){var r=n("DRH/");e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},sRgw:function(e,t,n){var r=n("G1mR");e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},seaz:function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},siKF:function(e,t,n){"use strict";n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return b}));var r=n("ks2Z"),i=n("cyB8"),o=n("0M5s"),a=n("PX5Y"),s=n("hcIE"),u=n("7ABo"),c=n("m97I"),l=n("oe4Z");function d(e,t,n){void 0===n&&(n=!1);var d,h,f=Object(c.a)(t),p=Object(r.a)(e),v=Object(a.b)(t),g={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(v||!v&&!n)&&(("body"!==Object(s.a)(t)||Object(l.a)(f))&&(g=(d=t)!==Object(o.a)(d)&&Object(a.b)(d)?{scrollLeft:(h=d).scrollLeft,scrollTop:h.scrollTop}:Object(i.a)(d)),Object(a.b)(t)?((y=Object(r.a)(t)).x+=t.clientLeft,y.y+=t.clientTop):f&&(y.x=Object(u.a)(f))),{x:p.left+g.scrollLeft-y.x,y:p.top+g.scrollTop-y.y,width:p.width,height:p.height}}var h=n("g4JO"),f=n("U6T1"),p=n("/Ktv"),v=n("P87u"),g={placement:"bottom",modifiers:[],strategy:"absolute"};function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function m(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=e.defaultOptions,i=void 0===r?g:r;return function(e,t,r){void 0===r&&(r=i);var o,s,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},g,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},c=[],l=!1,m={state:u,setOptions:function(r){b(),u.options=Object.assign({},i,u.options,r),u.scrollParents={reference:Object(a.a)(e)?Object(f.a)(e):e.contextElement?Object(f.a)(e.contextElement):[],popper:Object(f.a)(t)};var o=function(e){var t=function(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=t.get(r);i&&e(i)}})),r.push(i)}(e)})),r}(e);return v.n.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,u.options.modifiers)));return u.orderedModifiers=o.filter((function(e){return e.enabled})),u.orderedModifiers.forEach((function(e){var t=e.options,n=e.effect;if("function"==typeof n){var r=n({state:u,name:e.name,instance:m,options:void 0===t?{}:t});c.push(r||function(){})}})),m.update()},forceUpdate:function(){if(!l){var e=u.elements,t=e.reference,n=e.popper;if(y(t,n)){u.rects={reference:d(t,Object(p.a)(n),"fixed"===u.options.strategy),popper:Object(h.a)(n)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(e){return u.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var i=u.orderedModifiers[r],o=i.fn,a=i.options;"function"==typeof o&&(u=o({state:u,options:void 0===a?{}:a,name:i.name,instance:m})||u)}else u.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){m.forceUpdate(),e(u)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){b(),l=!0}};if(!y(e,t))return m;function b(){c.forEach((function(e){return e()})),c=[]}return m.setOptions(r).then((function(e){!l&&r.onFirstUpdate&&r.onFirstUpdate(e)})),m}}var b=m()},sjqF:function(e,t){e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},srX6:function(e,t,n){var r=n("2v8U");e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},tIEw:function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},toVn:function(e,t,n){var r=n("MVHo");e.exports=function(e){return r(this,e).get(e)}},uF7Z:function(e,t,n){var r=n("S/8i")(Object.getPrototypeOf,Object);e.exports=r},uHqx:function(e,t){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},uHxH:function(e,t,n){var r=n("vkNO"),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},uLMv:function(e,t){var n=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return n.test(e)}},uYOL:function(e,t){e.exports=function(e){return e}},v6aJ:function(e,t,n){var r=n("ih+a");e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},vWe6:function(e,t,n){var r=n("1/+g"),i=n("lSuv");e.exports=function(e,t){return i(e||[],t||[],r)}},vkNO:function(e,t,n){var r=n("UZnP"),i=n("bs3m");e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},vkS7:function(e,t,n){var r=n("uHxH");e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},vysb:function(e,t,n){var r=n("LoTP");e.exports=function(e,t){return r(e,t,"post")}},w9hk:function(e,t,n){var r=n("ZB1U"),i=n("QA6A");e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},wJ0V:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o}));var r=Math.max,i=Math.min,o=Math.round},wJPF:function(e,t){e.exports=function(e){return function(t){return e(t)}}},wMi0:function(e,t,n){var r=n("B0jI"),i=n("O0gm"),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},wYOv:function(e,t,n){"use strict";var r={left:"right",right:"left",bottom:"top",top:"bottom"};function i(e){return e.replace(/left|right|bottom|top/g,(function(e){return r[e]}))}var o=n("JHDW"),a={start:"end",end:"start"};function s(e){return e.replace(/start|end/g,(function(e){return a[e]}))}var u=n("4idG"),c=n("k6AR"),l=n("P87u");t.a={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,d=void 0===a||a,h=n.altAxis,f=void 0===h||h,p=n.fallbackPlacements,v=n.padding,g=n.boundary,y=n.rootBoundary,m=n.altBoundary,b=n.flipVariations,x=void 0===b||b,w=n.allowedAutoPlacements,E=t.options.placement,k=Object(o.a)(E),P=p||(k!==E&&x?function(e){if(Object(o.a)(e)===l.d)return[];var t=i(e);return[s(e),t,s(t)]}(E):[i(E)]),j=[E].concat(P).reduce((function(e,n){return e.concat(Object(o.a)(n)===l.d?function(e,t){void 0===t&&(t={});var n=t.placement,r=t.boundary,i=t.rootBoundary,a=t.padding,s=t.flipVariations,d=t.allowedAutoPlacements,h=void 0===d?l.o:d,f=Object(c.a)(n),p=f?s?l.v:l.v.filter((function(e){return Object(c.a)(e)===f})):l.e,v=p.filter((function(e){return h.indexOf(e)>=0}));0===v.length&&(v=p);var g=v.reduce((function(t,n){return t[n]=Object(u.a)(e,{placement:n,boundary:r,rootBoundary:i,padding:a})[Object(o.a)(n)],t}),{});return Object.keys(g).sort((function(e,t){return g[e]-g[t]}))}(t,{placement:n,boundary:g,rootBoundary:y,padding:v,flipVariations:x,allowedAutoPlacements:w}):n)}),[]),C=t.rects.reference,_=t.rects.popper,S=new Map,O=!0,D=j[0],T=0;T<j.length;T++){var B=j[T],M=Object(o.a)(B),N=Object(c.a)(B)===l.t,I=[l.u,l.i].indexOf(M)>=0,A=I?"width":"height",L=Object(u.a)(t,{placement:B,boundary:g,rootBoundary:y,altBoundary:m,padding:v}),z=I?N?l.s:l.l:N?l.i:l.u;C[A]>_[A]&&(z=i(z));var R=i(z),F=[];if(d&&F.push(L[M]<=0),f&&F.push(L[z]<=0,L[R]<=0),F.every((function(e){return e}))){D=B,O=!1;break}S.set(B,F)}if(O)for(var V=function(e){var t=j.find((function(t){var n=S.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},q=x?3:1;q>0&&"break"!==V(q);q--);t.placement!==D&&(t.modifiersData[r]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}}},whaD:function(e,t,n){e.exports={components:n("v6aJ"),dijkstra:n("VWZU"),dijkstraAll:n("DZHY"),findCycles:n("XJpW"),floydWarshall:n("CqBt"),isAcyclic:n("HE6A"),postorder:n("vysb"),preorder:n("cYA/"),prim:n("LbEC"),tarjan:n("cwoc"),topsort:n("Ihs8")}},"wp+v":function(e,t,n){"use strict";var r=n("2Pt6");function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),c=0;return r.forEach(o.forEach((function(e){var t=e.pos+a;u[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=u[t+1]),u[t=t-1>>1]+=e.weight;c+=e.weight*n}))),c}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},x14d:function(e,t,n){var r=n("iOrR"),i=n("QA6A"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},xGrr:function(e,t,n){var r=n("DRH/");e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},xJuT:function(e,t,n){var r=n("1/+g"),i=n("vkS7");e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=o?o(n[c],e[c],c,n,e):void 0;void 0===l&&(l=e[c]),a?i(n,c,l):r(n,c,l)}return n}},xspy:function(e,t,n){var r=n("vkNO")(n("/wvS"),"Promise");e.exports=r},xzHw:function(e,t,n){var r=n("seaz"),i=n("srX6"),o=n("nHTl"),a=n("P/Kr");e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},yIGb:function(e,t,n){var r=n("ih+a");function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},yMGJ:function(e,t,n){var r=n("vkS7"),i=n("4cIi"),o=n("nHTl");e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},yvRI:function(e,t,n){var r=n("omPs"),i=n("lhiQ"),o=n("3bG8"),a=n("Q97t"),s=n("ZB1U"),u=n("P/Kr"),c=n("FBB6"),l=n("38y5"),d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,f,p,v){var g=u(e),y=u(t),m=g?"[object Array]":s(e),b=y?"[object Array]":s(t),x=(m="[object Arguments]"==m?d:m)==d,w=(b="[object Arguments]"==b?d:b)==d,E=m==b;if(E&&c(e)){if(!c(t))return!1;g=!0,x=!1}if(E&&!x)return v||(v=new r),g||l(e)?i(e,t,n,f,p,v):o(e,t,m,n,f,p,v);if(!(1&n)){var k=x&&h.call(e,"__wrapped__"),P=w&&h.call(t,"__wrapped__");if(k||P){var j=k?e.value():e,C=P?t.value():t;return v||(v=new r),p(j,C,n,f,v)}}return!!E&&(v||(v=new r),a(e,t,n,f,p,v))}},z4dE:function(e,t,n){var r=n("rYqC");e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},z8at:function(e,t,n){"use strict";var r=n("P87u"),i=n("4idG");function o(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function a(e){return[r.u,r.s,r.i,r.l].some((function(t){return e[t]>=0}))}t.a={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,u=t.modifiersData.preventOverflow,c=Object(i.a)(t,{elementContext:"reference"}),l=Object(i.a)(t,{altBoundary:!0}),d=o(c,r),h=o(l,s,u),f=a(d),p=a(h);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:h,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}}},"z9/d":function(e,t,n){var r=n("haxF"),i=n("uF7Z"),o=n("B0jI");e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},zOYv:function(e,t,n){var r=n("1qE/"),i=n("uF7Z"),o=n("7LQ5"),a=n("+n8R"),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},zPTW:function(e,t){var n=/\w*$/;e.exports=function(e){var t=new e.constructor(e.source,n.exec(e));return t.lastIndex=e.lastIndex,t}}},[[0,0]]]);
2
+ (self.webpackChunk=self.webpackChunk||[]).push([[179],{MU0e:(e,t,n)=>{"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e){return"function"==typeof e}var a=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){a=e},get useDeprecatedSynchronousErrorHandling(){return a}};function u(e){setTimeout((function(){throw e}),0)}var l={closed:!0,next:function(e){},error:function(e){if(s.useDeprecatedSynchronousErrorHandling)throw e;u(e)},complete:function(){}},c=Array.isArray||function(e){return e&&"number"==typeof e.length};function d(e){return null!==e&&"object"==typeof e}var h=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),p=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var n=this._parentOrParents,r=this._ctorUnsubscribe,i=this._unsubscribe,a=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof e)n.remove(this);else if(null!==n)for(var s=0;s<n.length;++s)n[s].remove(this);if(o(i)){r&&(this._unsubscribe=void 0);try{i.call(this)}catch(p){t=p instanceof h?f(p.errors):[p]}}if(c(a)){s=-1;for(var u=a.length;++s<u;){var l=a[s];if(d(l))try{l.unsubscribe()}catch(p){t=t||[],p instanceof h?t=t.concat(f(p.errors)):t.push(p)}}}if(t)throw new h(t)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(typeof t){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=n._parentOrParents;if(null===i)n._parentOrParents=this;else if(i instanceof e){if(i===this)return n;n._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return n;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[n]:o.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function f(e){return e.reduce((function(e,t){return e.concat(t instanceof h?t.errors:t)}),[])}var v="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),g=function(e){function t(n,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=l;break;case 1:if(!n){o.destination=l;break}if("object"==typeof n){n instanceof t?(o.syncErrorThrowable=n.syncErrorThrowable,o.destination=n,n.add(o)):(o.syncErrorThrowable=!0,o.destination=new y(o,n));break}default:o.syncErrorThrowable=!0,o.destination=new y(o,n,r,i)}return o}return i(t,e),t.prototype[v]=function(){return this},t.create=function(e,n,r){var i=new t(e,n,r);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(p),y=function(e){function t(t,n,r,i){var a,s=e.call(this)||this;s._parentSubscriber=t;var u=s;return o(n)?a=n:n&&(a=n.next,r=n.error,i=n.complete,n!==l&&(o((u=Object.create(n)).unsubscribe)&&s.add(u.unsubscribe.bind(u)),u.unsubscribe=s.unsubscribe.bind(s))),s._context=u,s._next=a,s._error=r,s._complete=i,s}return i(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=s.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):u(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;u(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};s.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(n){if(this.unsubscribe(),s.useDeprecatedSynchronousErrorHandling)throw n;u(n)}},t.prototype.__tryOrSetError=function(e,t,n){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(r){return s.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=r,e.syncErrorThrown=!0,!0):(u(r),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(g),m="function"==typeof Symbol&&Symbol.observable||"@@observable";function b(e){return e}function x(e){return 0===e.length?b:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var w=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,i=function(e,t,n){if(e){if(e instanceof g)return e;if(e[v])return e[v]()}return e||t||n?new g(e,t,n):new g(l)}(e,t,n);if(i.add(r?r.call(i,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),s.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){s.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e.destination;if(e.closed||e.isStopped)return!1;e=t&&t instanceof g?t:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=E(t))((function(t,r){var i;i=n.subscribe((function(t){try{e(t)}catch(n){r(n),i&&i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[m]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:x(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=E(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function E(e){if(e||(e=s.Promise||Promise),!e)throw new Error("no Promise impl found");return e}function k(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new P(e,t))}}var P=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new C(e,this.project,this.thisArg))},e}(),C=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.project=n,i.count=0,i.thisArg=r||i,i}return i(t,e),t.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(g);function S(e,t,n,r){return o(n)&&(r=n,n=void 0),r?S(e,t,n).pipe(k((function(e){return c(e)?r.apply(void 0,e):r(e)}))):new w((function(r){!function e(t,n,r,i,o){var a;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var s=t;t.addEventListener(n,r,o),a=function(){return s.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var u=t;t.on(n,r),a=function(){return u.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var l=t;t.addListener(n,r),a=function(){return l.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,d=t.length;c<d;c++)e(t[c],n,r,i,o)}i.add(a)}(e,t,(function(e){r.next(arguments.length>1?Array.prototype.slice.call(arguments):e)}),r,n)}))}var _=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),j=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return i(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},t}(p),D=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return i(t,e),t}(g),T=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return i(t,e),t.prototype[v]=function(){return new D(this)},t.prototype.lift=function(e){var t=new B(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new _;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new _;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),i=0;i<n;i++)r[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new _;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new _;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new _;return this.hasError?(e.error(this.thrownError),p.EMPTY):this.isStopped?(e.complete(),p.EMPTY):(this.observers.push(e),new j(this,e))},t.prototype.asObservable=function(){var e=new w;return e.source=this,e},t.create=function(e,t){return new B(e,t)},t}(w),B=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return i(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):p.EMPTY},t}(T);function O(e){return e&&"function"==typeof e.schedule}var M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(g),N=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(g),I=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}},L="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator",A=function(e){if(e&&"function"==typeof e[m])return i=e,function(e){var t=i[m]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)};if((t=e)&&"number"==typeof t.length&&"function"!=typeof t)return I(e);var t;if(function(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}(e))return r=e,function(e){return r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,u),e};if(e&&"function"==typeof e[L])return n=e,function(e){for(var t=n[L]();;){var r=void 0;try{r=t.next()}catch(i){return e.error(i),e}if(r.done){e.complete();break}if(e.next(r.value),e.closed)break}return"function"==typeof t.return&&e.add((function(){t.return&&t.return()})),e};var n,r,i,o=d(e)?"an invalid object":"'"+e+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function z(e,t,n,r,i){if(void 0===i&&(i=new N(e,n,r)),!i.closed)return t instanceof w?t.subscribe(i):A(t)(i)}function R(e,t){return new w((function(n){var r=new p,i=0;return r.add(t.schedule((function(){i!==e.length?(n.next(e[i++]),n.closed||r.add(this.schedule())):n.complete()}))),r}))}function F(e,t){return t?R(e,t):new w(I(e))}var V={};function Z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=void 0,r=void 0;return O(e[e.length-1])&&(r=e.pop()),"function"==typeof e[e.length-1]&&(n=e.pop()),1===e.length&&c(e[0])&&(e=e[0]),F(e,r).lift(new Y(n))}var Y=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new q(e,this.resultSelector))},e}(),q=function(e){function t(t,n){var r=e.call(this,t)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return i(t,e),t.prototype._next=function(e){this.values.push(V),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.active=t,this.toRespond=t;for(var n=0;n<t;n++)this.add(z(this,e[n],void 0,n))}},t.prototype.notifyComplete=function(e){0==(this.active-=1)&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n){var r=this.values,i=this.toRespond?r[n]===V?--this.toRespond:this.toRespond:0;r[n]=t,0===i&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},t.prototype._tryResultSelector=function(e){var t;try{t=this.resultSelector.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(M);function X(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return O(n)?(e.pop(),R(e,n)):F(e)}var W=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,n}return i(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(g),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(g);function G(e,t){if(!t.closed){if(e instanceof w)return e.subscribe(t);var n;try{n=A(e)(t)}catch(r){t.error(r)}return n}}var U=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new K(e,this.project,this.concurrent))},e}(),K=function(e){function t(t,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var i=e.call(this,t)||this;return i.project=n,i.concurrent=r,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return i(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.project(e,n)}catch(r){return void this.destination.error(r)}this.active++,this._innerSub(t)},t.prototype._innerSub=function(e){var t=new W(this),n=this.destination;n.add(t);var r=G(e,t);r!==t&&n.add(r)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(H);function Q(){return void 0===(e=1)&&(e=Number.POSITIVE_INFINITY),function e(t,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof n?function(i){return i.pipe(e((function(e,r){return(i=t(e,r),i instanceof w?i:new w(A(i))).pipe(k((function(t,i){return n(e,t,r,i)})));var i}),r))}:("number"==typeof n&&(r=n),function(e){return e.lift(new U(t,r))})}(b,e);var e}function $(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Q()(X.apply(void 0,e))}function J(e){return function(t){return t.lift(new ee(e))}}var ee=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new te(e),r=G(this.notifier,new W(n));return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),te=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return i(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(H);function ne(e){Array.from(e.children).forEach((t=>e.removeChild(t)))}function re(e){return e.replace(/\/$/,"")}function ie(e,t){const n=re(e).split("/");return n[0]===re(t)&&n.shift(),n.pop(),n}class oe{set renderTime(e){this.renderReportElement.innerText=`Last render took ${e.renderTime} milliseconds for ${e.numNodes} nodes and ${e.numEdges} edges.`}constructor(e,t){this.container=e,this.projectGraphs=t,this.selectProjectSubject=new T,this.selectProject$=this.selectProjectSubject.asObservable(),this.renderReportElement=void 0,this.render()}render(){ne(this.container);const e=document.createElement("h4");e.innerText="Debugger";const t=document.createElement("select");this.projectGraphs.forEach((e=>{const n=document.createElement("option");n.value=e.id,n.innerText=e.label,t.appendChild(n)})),t.value=window.selectedProjectGraph,t.dataset.cy="project-select",t.onchange=e=>this.selectProjectSubject.next(e.currentTarget.value),this.renderReportElement=document.createElement("p"),this.container.appendChild(e),this.container.appendChild(t),this.container.appendChild(this.renderReportElement)}}var ae=n("rFOX"),se=n("Ded0"),ue=n.n(se),le=n("CQyY"),ce=n.n(le);class de{constructor(e){this.node=e}render(){const e=document.createElement("div"),t=this.createHeader(),n=this.createTags(),r=this.createButtons();return e.appendChild(t),e.appendChild(n),e.appendChild(r),e}createHeader(){const e=document.createElement("h4"),t=document.createElement("span"),n=document.createTextNode(this.node.attr("id"));return t.classList.add("tag"),t.innerText=this.node.attr("type"),e.appendChild(t),e.appendChild(n),e}createTags(){var e,t;const n=document.createElement("p"),r=document.createElement("strong"),i=document.createTextNode(null!==(e=null===(t=this.node.attr("tags"))||void 0===t?void 0:t.join(", "))&&void 0!==e?e:"");return r.innerText="tags",n.appendChild(r),n.appendChild(document.createElement("br")),n.appendChild(i),n}createButtons(){const e=document.createElement("div"),t=document.createElement("button"),n=document.createElement("button");return e.classList.add("flex"),t.addEventListener("click",(()=>window.focusProject(this.node.attr("id")))),t.innerText="Focus",n.addEventListener("click",(()=>{window.excludeProject(this.node.attr("id"))})),n.innerText="Exclude",e.appendChild(t),e.appendChild(n),e}}let he;!function(e){e.blue="#48c4e5",e.lightBlue="#96d8e9",e.gray="#333333",e.navy="#143055",e.twilight="#086c9f",e.black="#231f20",e.red="#f85477",e.white="#fff"}(he||(he={}));const pe=[{selector:"edge",style:{width:"1px","line-color":he.black,"curve-style":"straight","target-arrow-shape":"triangle","target-arrow-fill":"filled","target-arrow-color":he.black}},{selector:"edge.affected",style:{"line-color":he.red,"target-arrow-color":he.red}},{selector:"edge.implicit",style:{label:"implicit","font-size":"16px","edge-text-rotation":"autorotate"}},{selector:"edge.dynamic",style:{"line-dash-pattern":[5,5],"line-style":"dashed"}}],fe=[{selector:"node",style:{"font-size":"32px","font-family":'"Helvetica Neue", sans-serif',"border-style":"solid","border-color":he.black,"border-width":"1px","text-halign":"center","text-valign":"center","padding-left":"16px",label:"data(id)",width:"label",backgroundColor:he.white}},{selector:'node[type="app"]',style:{shape:"rectangle"}},{selector:'node[type="lib"]',style:{shape:"ellipse"}},{selector:'node[type="e2e"]',style:{shape:"rectangle"}},{selector:"node.focused",style:{color:he.twilight,"border-color":he.twilight}},{selector:"node.affected",style:{"border-color":he.red}},{selector:":parent",style:{"background-opacity":.5,"background-color":he.twilight,"border-color":he.black,label:"data(label)","text-halign":"center","text-valign":"top","font-weight":"bold","font-size":"48px"}}];class ve{constructor(e,t){this.project=e,this.workspaceRoot=t,this.affected=!1,this.focused=!1}getCytoscapeNodeDef(e){return{group:"nodes",data:this.getData(e),classes:this.getClasses(),selectable:!1,grabbable:!1,pannable:!0}}getData(e){return{id:this.project.name,type:this.project.type,tags:this.project.data.tags,parent:e&&this.project.data.hasOwnProperty("root")?this.getParentId():null}}getClasses(){var e;let t=null!==(e=this.project.type)&&void 0!==e?e:"";return this.focused&&(t+=" focused"),this.affected&&(t+=" affected"),t}getParentId(){const e=this.getAncestors();return e.length>0?e[e.length-1].id:null}getAncestors(){return this.project.data.root?ie(this.project.data.root,this.workspaceRoot).map(((e,t,n)=>{const r=[...n].slice(0,t+1).join("/");return{label:r,id:"dir-"+r,parentId:t>0?"dir-"+[...n].slice(0,t).join("/"):null}})):[]}}class ge{constructor(e){this.dep=e,this.affected=!1}getCytosacpeNodeDef(){var e;let t;return t={group:"edges",data:{id:`${this.dep.source}|${this.dep.target}`,source:this.dep.source,target:this.dep.target}},t.classes=null!==(e=this.dep.type)&&void 0!==e?e:"",this.affected&&(t.classes+=" affected"),t}}class ye{constructor(e){this.config=e}getCytoscapeNodeDef(){return{group:"nodes",data:{id:this.config.id,parent:this.config.parentId,label:this.config.label},selectable:!1,grabbable:!1,pannable:!0}}}class me{constructor(e){this.tooltipService=e,this.graph=void 0,this.openTooltip=null,this.affectedProjects=void 0,this.projectGraph=void 0,this.renderTimesSubject=new T,this.renderTimes$=this.renderTimesSubject.asObservable(),ae.use(ue()),ae.use(ce())}render(e,t){const n=Date.now();this.tooltipService.hideAll(),this.generateCytoscapeLayout(e,t),this.listenForProjectNodeClicks();const r={renderTime:Date.now()-n,numNodes:this.graph.nodes().length,numEdges:this.graph.edges().length};this.renderTimesSubject.next(r)}generateCytoscapeLayout(e,t){const n=this.createElements(e,t);this.graph=ae({container:document.getElementById("graph-container"),elements:[...n],layout:{name:"dagre",nodeDimensionsIncludeLabels:!0,rankSep:75,edgeSep:50,ranker:"network-simplex"},boxSelectionEnabled:!1,style:[...fe,...pe]}),this.graph.on("zoom",(()=>{this.openTooltip&&(this.openTooltip.hide(),this.openTooltip=null)}))}createElements(e,t){let n=[];const r=e.map((e=>e.name)),i=[],o=[],a={};e.forEach((e=>{const n="app"===e.type||"e2e"===e.type?window.workspaceLayout.appsDir:window.workspaceLayout.libsDir,s=new ve(e,n);s.focused=e.name===window.focusedProject,s.affected=this.affectedProjects.includes(e.name),i.push(s),this.projectGraph.dependencies[e.name].forEach((e=>{if(r.includes(e.target)){const t=new ge(e);t.affected=this.affectedProjects.includes(e.source)&&this.affectedProjects.includes(e.target),o.push(t)}})),t&&s.getAncestors().forEach((e=>a[e.id]=e))}));const s=i.map((e=>e.getCytoscapeNodeDef(t))),u=o.map((e=>e.getCytosacpeNodeDef()));return n=s.concat(u),t&&(n=Object.keys(a).map((e=>new ye(a[e]).getCytoscapeNodeDef())).concat(n)),n}listenForProjectNodeClicks(){this.graph.$("node:childless").on("click",(e=>{const t=e.target;let n=t.popperRef();const r=new de(t).render();this.openTooltip=this.tooltipService.open(n,r)}))}}const be={showDebugger:!1,projectGraphs:[],defaultProjectGraph:null,projectGraphService:null};var xe=n("UV7b"),we=n("Eutg"),Ee={passive:!0,capture:!0};function ke(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Pe(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function Ce(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Se(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function _e(e){return[].concat(e)}function je(e,t){-1===e.indexOf(t)&&e.push(t)}function De(e){return[].slice.call(e)}function Te(){return document.createElement("div")}function Be(e){return["Element","Fragment"].some((function(t){return Pe(e,t)}))}function Oe(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Me(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Ne(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Ie(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}var Le={isTouch:!1},Ae=0;function ze(){Le.isTouch||(Le.isTouch=!0,window.performance&&document.addEventListener("mousemove",Re))}function Re(){var e=performance.now();e-Ae<20&&(Le.isTouch=!1,document.removeEventListener("mousemove",Re)),Ae=e}function Fe(){var e=document.activeElement;Oe(e)&&e.blur&&!e._tippy.state.isVisible&&e.blur()}var Ve="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",Ze=/MSIE |Trident\//.test(Ve),Ye=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),qe=Object.keys(Ye);function Xe(e){var t=(e.plugins||[]).reduce((function(t,n){var r=n.name;return r&&(t[r]=void 0!==e[r]?e[r]:n.defaultValue),t}),{});return Object.assign({},e,{},t)}function We(e,t){var n=Object.assign({},t,{content:Ce(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Xe(Object.assign({},Ye,{plugins:t}))):qe).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(i){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ye.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function He(e,t){e.innerHTML=t}function Ge(e){var t=Te();return!0===e?t.className="tippy-arrow":(t.className="tippy-svg-arrow",Be(e)?t.appendChild(e):He(t,e)),t}function Ue(e,t){Be(t.content)?(He(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?He(e,t.content):e.textContent=t.content)}function Ke(e){var t=e.firstElementChild,n=De(t.children);return{box:t,content:n.find((function(e){return e.classList.contains("tippy-content")})),arrow:n.find((function(e){return e.classList.contains("tippy-arrow")||e.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(e){return e.classList.contains("tippy-backdrop")}))}}function Qe(e){var t=Te(),n=Te();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Te();function i(n,r){var i=Ke(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ue(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(Ge(r.arrow))):o.appendChild(Ge(r.arrow)):s&&o.removeChild(s)}return r.className="tippy-content",r.setAttribute("data-state","hidden"),Ue(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Qe.$$tippy=!0;var $e=1,Je=[],et=[];function tt(e,t){void 0===t&&(t={});var n=Ye.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",ze,Ee),window.addEventListener("blur",Fe);var r,i=Object.assign({},t,{plugins:n}),o=(r=e,Be(r)?[r]:function(e){return Pe(e,"NodeList")}(r)?De(r):Array.isArray(r)?r:De(document.querySelectorAll(r))).reduce((function(e,t){var n=t&&function(e,t){var n,r,i,o,a,s,u,l,c,d=We(e,Object.assign({},Ye,{},Xe((n=t,Object.keys(n).reduce((function(e,t){return void 0!==n[t]&&(e[t]=n[t]),e}),{}))))),h=!1,p=!1,f=!1,v=!1,g=[],y=Se(G,d.interactiveDebounce),m=$e++,b=(c=d.plugins).filter((function(e,t){return c.indexOf(e)===t})),x={id:m,reference:e,popper:Te(),popperInstance:null,props:d,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)},setProps:function(t){if(!x.state.isDestroyed){N("onBeforeUpdate",[x,t]),W();var n=x.props,r=We(e,Object.assign({},x.props,{},t,{ignoreAttributes:!0}));x.props=r,X(),n.interactiveDebounce!==r.interactiveDebounce&&(A(),y=Se(G,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?_e(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),L(),M(),k&&k(n,r),x.popperInstance&&($(),ee().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),N("onAfterUpdate",[x,t])}},setContent:function(e){x.setProps({content:e})},show:function(){var e=x.state.isVisible,t=x.state.isDestroyed,n=!x.state.isEnabled,r=Le.isTouch&&!x.props.touch,i=ke(x.props.duration,0,Ye.duration);if(!(e||t||n||r||D().hasAttribute("disabled")||(N("onShow",[x],!1),!1===x.props.onShow(x)))){if(x.state.isVisible=!0,j()&&(E.style.visibility="visible"),M(),V(),x.state.isMounted||(E.style.transition="none"),j()){var o=B();Me([o.box,o.content],0)}var a,s,l;u=function(){var e;if(x.state.isVisible&&!v){if(v=!0,E.style.transition=x.props.moveTransition,j()&&x.props.animation){var t=B(),n=t.box,r=t.content;Me([n,r],i),Ne([n,r],"visible")}I(),L(),je(et,x),null==(e=x.popperInstance)||e.forceUpdate(),x.state.isMounted=!0,N("onMount",[x]),x.props.animation&&j()&&function(e,t){Y(e,(function(){x.state.isShown=!0,N("onShown",[x])}))}(i)}},s=x.props.appendTo,l=D(),(a=x.props.interactive&&s===Ye.appendTo||"parent"===s?l.parentNode:Ce(s,[l])).contains(E)||a.appendChild(E),$()}},hide:function(){var e=!x.state.isVisible,t=x.state.isDestroyed,n=!x.state.isEnabled,r=ke(x.props.duration,1,Ye.duration);if(!(e||t||n)&&(N("onHide",[x],!1),!1!==x.props.onHide(x))){if(x.state.isVisible=!1,x.state.isShown=!1,v=!1,h=!1,j()&&(E.style.visibility="hidden"),A(),Z(),M(),j()){var i=B(),o=i.box,a=i.content;x.props.animation&&(Me([o,a],r),Ne([o,a],"hidden"))}I(),L(),x.props.animation?j()&&function(e,t){Y(e,(function(){!x.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&t()}))}(r,x.unmount):x.unmount()}},hideWithInteractivity:function(e){T().addEventListener("mousemove",y),je(Je,y),y(e)},enable:function(){x.state.isEnabled=!0},disable:function(){x.hide(),x.state.isEnabled=!1},unmount:function(){x.state.isVisible&&x.hide(),x.state.isMounted&&(J(),ee().forEach((function(e){e._tippy.unmount()})),E.parentNode&&E.parentNode.removeChild(E),et=et.filter((function(e){return e!==x})),x.state.isMounted=!1,N("onHidden",[x]))},destroy:function(){x.state.isDestroyed||(x.clearDelayTimeouts(),x.unmount(),W(),delete e._tippy,x.state.isDestroyed=!0,N("onDestroy",[x]))}};if(!d.render)return x;var w=d.render(x),E=w.popper,k=w.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+x.id,x.popper=E,e._tippy=x,E._tippy=x;var P=b.map((function(e){return e.fn(x)})),C=e.hasAttribute("aria-expanded");return X(),L(),M(),N("onCreate",[x]),d.showOnCreate&&te(),E.addEventListener("mouseenter",(function(){x.props.interactive&&x.state.isVisible&&x.clearDelayTimeouts()})),E.addEventListener("mouseleave",(function(e){x.props.interactive&&x.props.trigger.indexOf("mouseenter")>=0&&(T().addEventListener("mousemove",y),y(e))})),x;function S(){var e=x.props.touch;return Array.isArray(e)?e:[e,0]}function _(){return"hold"===S()[0]}function j(){var e;return!!(null==(e=x.props.render)?void 0:e.$$tippy)}function D(){return l||e}function T(){var e,t,n=D().parentNode;return n&&(null==(t=_e(n)[0])||null==(e=t.ownerDocument)?void 0:e.body)?t.ownerDocument:document}function B(){return Ke(E)}function O(e){return x.state.isMounted&&!x.state.isVisible||Le.isTouch||a&&"focus"===a.type?0:ke(x.props.delay,e?0:1,Ye.delay)}function M(){E.style.pointerEvents=x.props.interactive&&x.state.isVisible?"":"none",E.style.zIndex=""+x.props.zIndex}function N(e,t,n){var r;void 0===n&&(n=!0),P.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n&&(r=x.props)[e].apply(r,t)}function I(){var t=x.props.aria;if(t.content){var n="aria-"+t.content,r=E.id;_e(x.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(x.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function L(){!C&&x.props.aria.expanded&&_e(x.props.triggerTarget||e).forEach((function(e){x.props.interactive?e.setAttribute("aria-expanded",x.state.isVisible&&e===D()?"true":"false"):e.removeAttribute("aria-expanded")}))}function A(){T().removeEventListener("mousemove",y),Je=Je.filter((function(e){return e!==y}))}function z(e){if(!(Le.isTouch&&(f||"mousedown"===e.type)||x.props.interactive&&E.contains(e.target))){if(D().contains(e.target)){if(Le.isTouch)return;if(x.state.isVisible&&x.props.trigger.indexOf("click")>=0)return}else N("onClickOutside",[x,e]);!0===x.props.hideOnClick&&(x.clearDelayTimeouts(),x.hide(),p=!0,setTimeout((function(){p=!1})),x.state.isMounted||Z())}}function R(){f=!0}function F(){f=!1}function V(){var e=T();e.addEventListener("mousedown",z,!0),e.addEventListener("touchend",z,Ee),e.addEventListener("touchstart",F,Ee),e.addEventListener("touchmove",R,Ee)}function Z(){var e=T();e.removeEventListener("mousedown",z,!0),e.removeEventListener("touchend",z,Ee),e.removeEventListener("touchstart",F,Ee),e.removeEventListener("touchmove",R,Ee)}function Y(e,t){var n=B().box;function r(e){e.target===n&&(Ie(n,"remove",r),t())}if(0===e)return t();Ie(n,"remove",s),Ie(n,"add",r),s=r}function q(t,n,r){void 0===r&&(r=!1),_e(x.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),g.push({node:e,eventType:t,handler:n,options:r})}))}function X(){var e;_()&&(q("touchstart",H,{passive:!0}),q("touchend",U,{passive:!0})),(e=x.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(q(e,H),e){case"mouseenter":q("mouseleave",U);break;case"focus":q(Ze?"focusout":"blur",K);break;case"focusin":q("focusout",K)}}))}function W(){g.forEach((function(e){e.node.removeEventListener(e.eventType,e.handler,e.options)})),g=[]}function H(e){var t,n=!1;if(x.state.isEnabled&&!Q(e)&&!p){var r="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,L(),!x.state.isVisible&&Pe(e,"MouseEvent")&&Je.forEach((function(t){return t(e)})),"click"===e.type&&(x.props.trigger.indexOf("mouseenter")<0||h)&&!1!==x.props.hideOnClick&&x.state.isVisible?n=!0:te(e),"click"===e.type&&(h=!n),n&&!r&&ne(e)}}function G(e){var t=e.target,n=D().contains(t)||E.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=i.placement.split("-")[0],s=i.modifiersData.offset;return!s||t.top-r+("bottom"===a?s.top.y:0)>o||r-t.bottom-("top"===a?s.bottom.y:0)>o||t.left-n+("right"===a?s.left.x:0)>o||n-t.right-("left"===a?s.right.x:0)>o}))}(ee().concat(E).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:d}:null})).filter(Boolean),e)&&(A(),ne(e))}function U(e){Q(e)||x.props.trigger.indexOf("click")>=0&&h||(x.props.interactive?x.hideWithInteractivity(e):ne(e))}function K(e){x.props.trigger.indexOf("focusin")<0&&e.target!==D()||x.props.interactive&&e.relatedTarget&&E.contains(e.relatedTarget)||ne(e)}function Q(e){return!!Le.isTouch&&_()!==e.type.indexOf("touch")>=0}function $(){J();var t=x.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,s=j()?Ke(E).arrow:null,l=o?{getBoundingClientRect:o,contextElement:o.contextElement||D()}:e,c=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(j()){var n=B().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];j()&&s&&c.push({name:"arrow",options:{element:s,padding:3}}),c.push.apply(c,(null==n?void 0:n.modifiers)||[]),x.popperInstance=(0,xe.fi)(l,E,Object.assign({},n,{placement:r,onFirstUpdate:u,modifiers:c}))}function J(){x.popperInstance&&(x.popperInstance.destroy(),x.popperInstance=null)}function ee(){return De(E.querySelectorAll("[data-tippy-root]"))}function te(e){x.clearDelayTimeouts(),e&&N("onTrigger",[x,e]),V();var t=O(!0),n=S(),i=n[1];Le.isTouch&&"hold"===n[0]&&i&&(t=i),t?r=setTimeout((function(){x.show()}),t):x.show()}function ne(e){if(x.clearDelayTimeouts(),N("onUntrigger",[x,e]),x.state.isVisible){if(!(x.props.trigger.indexOf("mouseenter")>=0&&x.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&h)){var t=O(!1);t?i=setTimeout((function(){x.state.isVisible&&x.hide()}),t):o=requestAnimationFrame((function(){x.hide()}))}}else Z()}}(t,i);return n&&e.push(n),e}),[]);return Be(e)?o[0]:o}tt.defaultProps=Ye,tt.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ye[t]=e[t]}))},tt.currentInput=Le,Object.assign({},we.Z,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),tt.setDefaultProps({render:Qe});const nt=tt;class rt{open(e,t){let n=nt(document.createElement("div"),{trigger:"manual",theme:"nx",interactive:!0,appendTo:document.body,content:t,getReferenceClientRect:e.getBoundingClientRect});return n.show(),n}hideAll(){var e,t,n;t=(e={}).exclude,n=e.duration,et.forEach((function(e){var r=!1;if(t&&(r=Oe(t)?e.reference===t:e.popper===t.popper),!r){var i=e.props.duration;e.setProps({duration:n}),e.hide(),e.state.isDestroyed||e.setProps({duration:i})}}))}}var it=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return i(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new _;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(T),ot=function(){function e(e,t){this.compare=e,this.keySelector=t}return e.prototype.call=function(e,t){return t.subscribe(new at(e,this.compare,this.keySelector))},e}(),at=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return i(t,e),t.prototype.compare=function(e,t){return e===t},t.prototype._next=function(e){var t;try{var n=this.keySelector;t=n?n(e):e}catch(i){return this.destination.error(i)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,t)}catch(i){return this.destination.error(i)}else this.hasKey=!0;r||(this.key=t,this.destination.next(e))},t}(g),st=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new ut(e,this.observables,this.project))},e}(),ut=function(e){function t(t,n,r){var i=e.call(this,t)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.length;i.values=new Array(o);for(var a=0;a<o;a++)i.toRespond.push(a);for(a=0;a<o;a++)i.add(z(i,n[a],void 0,a));return i}return i(t,e),t.prototype.notifyNext=function(e,t,n){this.values[n]=t;var r=this.toRespond;if(r.length>0){var i=r.indexOf(n);-1!==i&&r.splice(i,1)}},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){if(0===this.toRespond.length){var t=[e].concat(this.values);this.project?this._tryProject(t):this.destination.next(t)}},t.prototype._tryProject=function(e){var t;try{t=this.project.apply(this,e)}catch(n){return void this.destination.error(n)}this.destination.next(t)},t}(M);class lt{constructor(e=!1,t=!1){this.showAffected=!1,this.groupByFolder=!1,this.selectAffectedSubject=new T,this.selectAllSubject=new T,this.deselectAllSubject=new T,this.groupByFolderSubject=new T,this.searchByDepthSubject=new it(1),this.searchByDepthEnabledSubject=new it(!1),this.searchDepthChangesSubject=new T,this.selectAffected$=this.selectAffectedSubject.asObservable(),this.selectAll$=this.selectAllSubject.asObservable(),this.deselectAll$=this.deselectAllSubject.asObservable(),this.groupByFolder$=this.groupByFolderSubject.asObservable(),this.searchDepth$=Z([this.searchByDepthSubject,this.searchByDepthEnabledSubject]).pipe(k((([e,t])=>t?e:-1)),(function(e){return e.lift(new ot(void 0,void 0))})),this.searchDepthDisplay=void 0,this.showAffected=e,this.groupByFolder=t,this.searchDepthChangesSubject.pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new st(e,n))}}(this.searchByDepthSubject)).subscribe((([e,t])=>{"decrement"===e&&t>1?this.searchByDepthSubject.next(t-1):"increment"===e&&this.searchByDepthSubject.next(t+1)})),this.searchByDepthSubject.subscribe((e=>{this.searchDepthDisplay&&(this.searchDepthDisplay.innerText=e.toString())}))}render(e){ne(e);const t=document.createElement("h4");t.innerText="Display Options";const n=document.createElement("div");if(n.classList.add("flex"),this.showAffected){const e=document.createElement("button");e.innerText="Select Affected",e.addEventListener("click",(()=>this.selectAffectedSubject.next())),n.appendChild(e)}const r=document.createElement("button");r.innerText="Select All",r.dataset.cy="selectAllButton",r.addEventListener("click",(()=>this.selectAllSubject.next())),n.appendChild(r);const i=document.createElement("button");i.innerText="Deselect All",i.dataset.cy="deselectAllButton",i.addEventListener("click",(()=>this.deselectAllSubject.next())),n.appendChild(i);const o=document.createElement("label"),a=document.createElement("input");a.type="checkbox",a.name="displayOptions",a.value="groupByFolder",a.checked=this.groupByFolder,a.addEventListener("change",(e=>this.groupByFolderSubject.next(e.target.checked))),o.appendChild(a),o.appendChild(document.createTextNode("group by folder"));const s=document.createElement("label");s.appendChild(document.createTextNode("Search Depth")),this.searchDepthDisplay=document.createElement("span"),this.searchDepthDisplay.innerText="1",this.searchDepthDisplay.classList.add("search-depth");const u=document.createElement("button");u.appendChild(document.createTextNode("+"));const l=document.createElement("button");l.appendChild(document.createTextNode("-")),u.addEventListener("click",(()=>{this.searchDepthChangesSubject.next("increment")})),l.addEventListener("click",(()=>{this.searchDepthChangesSubject.next("decrement")}));const c=document.createElement("label"),d=document.createElement("input");d.type="checkbox",d.name="displayOptions",d.value="groupByFolder",d.checked=this.groupByFolder,d.addEventListener("change",(e=>this.searchByDepthEnabledSubject.next(e.target.checked))),c.appendChild(d),c.appendChild(document.createTextNode("enabled")),e.appendChild(t),e.appendChild(n),e.appendChild(o),e.appendChild(s),e.appendChild(l),e.appendChild(this.searchDepthDisplay),e.appendChild(u),e.appendChild(c)}}class ct{set projectName(e){this.render(e)}constructor(e){this.container=e,this.unfocusSubject=new T,this.unfocus$=this.unfocusSubject.asObservable(),this.render()}unfocusProject(){this.render()}render(e){ne(this.container);const t=document.createElement("h4");this.container.appendChild(t),e&&""!==e?(t.innerText="Focused on "+e,this.container.hidden=!1):this.container.hidden=!0;const n=document.createElement("button");n.innerText="Unfocus",n.dataset.cy="unfocusButton",n.addEventListener("click",(()=>this.unfocusSubject.next())),this.container.appendChild(n)}}class dt{set projects(e){this._projects=e;const t=Object.values(this.checkboxes).filter((e=>e.checked)).map((e=>e.value));this.render(),this.selectProjects(t)}get projects(){return this._projects}constructor(e){this.container=e,this.focusProjectSubject=new T,this.checkedProjectsChangeSubject=new T,this.checkboxes={},this.checkedProjectsChange$=this.checkedProjectsChangeSubject.asObservable(),this.focusProject$=this.focusProjectSubject.asObservable(),this._projects=[],this.render()}selectProjects(e){e.forEach((e=>{this.checkboxes[e]&&(this.checkboxes[e].checked=!0)})),this.emitChanges()}setCheckedProjects(e){Object.keys(this.checkboxes).forEach((t=>{this.checkboxes[t].checked=e.includes(t)}))}checkAllProjects(){Object.values(this.checkboxes).forEach((e=>e.checked=!0))}uncheckAllProjects(){Object.values(this.checkboxes).forEach((e=>{e.checked=!1}))}uncheckProject(e){this.checkboxes[e].checked=!1}emitChanges(){const e=Object.values(this.checkboxes).filter((e=>e.checked)).map((e=>e.value));this.checkedProjectsChangeSubject.next(e)}render(){ne(this.container);const e=this.getProjectsByType("app"),t=this.getProjectsByType("lib"),n=this.getProjectsByType("e2e"),r=this.groupProjectsByDirectory(e),i=this.groupProjectsByDirectory(t),o=this.groupProjectsByDirectory(n),a=Object.keys(r).sort(),s=Object.keys(i).sort(),u=Object.keys(o).sort(),l=document.createElement("h4");l.textContent="app projects",this.container.append(l),a.forEach((e=>{this.createProjectList(e,r[e])}));const c=document.createElement("h4");c.textContent="e2e projects",this.container.append(c),u.forEach((e=>{this.createProjectList(e,o[e])}));const d=document.createElement("h4");d.textContent="lib projects",this.container.append(d),s.forEach((e=>{this.createProjectList(e,i[e])}))}getProjectsByType(e){return this.projects.filter((t=>t.type===e)).sort(((e,t)=>e.name.localeCompare(t.name)))}groupProjectsByDirectory(e){let t={};return e.forEach((e=>{const n="app"===e.type||"e2e"===e.type?window.workspaceLayout.appsDir:window.workspaceLayout.libsDir,r=ie(e.data.root,n).join("/");t.hasOwnProperty(r)||(t[r]=[]),t[r].push(e)})),t}createProjectList(e,t){const n=document.createElement("h5");n.textContent=e;const r=document.createElement("div");r.className="form-group",[...t].sort(((e,t)=>e.name.localeCompare(t.name))),t.forEach((e=>{let t=document.createElement("div");t.className="form-line";let n=document.createElement("button");n.className="icon";let i=document.createElementNS("http://www.w3.org/2000/svg","svg"),o=document.createElementNS("http://www.w3.org/2000/svg","use");o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","#crosshair"),i.appendChild(o),n.append(i),n.onclick=()=>{this.focusProjectSubject.next(e.name)};let a=document.createElement("label");a.className="form-checkbox";let s=document.createElement("input");s.type="checkbox",s.name="projectName",s.value=e.name,s.checked=!1,s.addEventListener("change",(()=>this.emitChanges())),this.checkboxes[e.name]=s;const u=document.createTextNode(e.name);t.append(n),t.append(a),a.append(s),a.append(u),r.append(t)})),this.container.append(n),this.container.append(r)}}class ht{constructor(e){this.container=e,this.textInput=void 0,this.includeInPathCheckbox=void 0,this.changesSubject=new T,this.changes$=this.changesSubject.asObservable(),this.render()}emitChanges(){this.changesSubject.next({text:this.textInput.value.toLowerCase(),includeInPath:this.includeInPathCheckbox.checked})}render(){ne(this.container);const e=document.createElement("div");e.classList.add("flex");const t=document.createElement("label");t.appendChild(document.createTextNode("Text Filter")),this.textInput=document.createElement("input"),this.textInput.type="text",this.textInput.name="filter",this.textInput.dataset.cy="textFilterInput",this.textInput.addEventListener("keyup",(e=>{"Enter"===e.key&&this.emitChanges()})),this.textInput.style.flex="1",this.textInput.style.marginRight="1.5em";const n=document.createElement("button");n.innerText="Filter",n.dataset.cy="textFilterButton",n.style.flex="none",n.addEventListener("click",(()=>{this.emitChanges()})),e.appendChild(this.textInput),e.appendChild(n);const r=document.createElement("label");this.includeInPathCheckbox=document.createElement("input"),this.includeInPathCheckbox.type="checkbox",this.includeInPathCheckbox.name="textFilterCheckbox",this.includeInPathCheckbox.value="includeInPath",r.appendChild(this.includeInPathCheckbox),r.appendChild(document.createTextNode("include projects in path")),this.container.appendChild(t),this.container.appendChild(e),this.container.appendChild(r)}}class pt{set projects(e){this.projectList.projects=e,this.focusedProjectPanel.unfocusProject(),this.unfocusProject()}constructor(e){this.affectedProjects=e,this.selectedProjectsChangedSubject=new it([]),this.groupByFolderChangedSubject=new it(window.groupByFolder),this.focusProjectSubject=new T,this.filterByTextSubject=new T,this.selectedProjectsChanged$=this.selectedProjectsChangedSubject.asObservable(),this.groupByFolderChanged$=this.groupByFolderChangedSubject.asObservable(),this.displayOptionsPanel=void 0,this.focusedProjectPanel=void 0,this.textFilterPanel=void 0,this.projectList=void 0,this.groupByFolder=window.groupByFolder,this.selectedProjects=[];const t=this.affectedProjects.length>0,n=document.getElementById("display-options-panel");this.displayOptionsPanel=new lt(t,this.groupByFolder),this.displayOptionsPanel.render(n);const r=document.getElementById("focused-project");this.focusedProjectPanel=new ct(r);const i=document.getElementById("text-filter-panel");this.textFilterPanel=new ht(i);const o=document.getElementById("project-lists");this.projectList=new dt(o),this.projectList.projects=window.projects,t&&this.selectAffectedProjects(),window.focusProject=e=>{this.focusProjectSubject.next(e)},window.excludeProject=e=>{this.excludeProject(e)},this.listenForDOMEvents(),null!==window.focusedProject&&this.focusProject(window.focusedProject),window.exclude.length>0&&window.exclude.forEach((e=>this.excludeProject(e)))}selectProjects(e){this.projectList.selectProjects(e)}resetSidebarVisibility(){const e=document.getElementById("sidebar");e.classList.contains("hidden")&&(e.classList.remove("hidden"),e.style.marginLeft="0px")}listenForDOMEvents(){const e=document.getElementById("sidebar"),t=document.getElementById("sidebar-toggle-button");t.style.left=e.clientWidth-1+"px",new ResizeObserver((e=>{e.forEach((e=>{t.style.left=e.contentRect.width-1+"px"}))})).observe(e),S(t,"click").subscribe((t=>{e.classList.toggle("hidden"),e.style.marginLeft=e.classList.contains("hidden")?`-${e.clientWidth+1}px`:"0px"})),this.displayOptionsPanel.selectAll$.subscribe((()=>{this.selectAllProjects()})),this.displayOptionsPanel.deselectAll$.subscribe((()=>{this.deselectAllProjects()})),this.displayOptionsPanel.selectAffected$.subscribe((()=>{this.selectAffectedProjects()})),this.displayOptionsPanel.groupByFolder$.subscribe((e=>{this.groupByFolderChangedSubject.next(e)})),this.focusedProjectPanel.unfocus$.subscribe((()=>{this.unfocusProject()})),this.textFilterPanel.changes$.subscribe((e=>{this.filterByTextSubject.next(e)})),Z([this.filterByTextSubject,this.displayOptionsPanel.searchDepth$]).subscribe((([e,t])=>{e.text&&this.filterProjectsByText(e.text,e.includeInPath,t)})),this.projectList.checkedProjectsChange$.subscribe((e=>{this.emitSelectedProjects(e)})),this.projectList.focusProject$.subscribe((e=>{this.focusProjectSubject.next(e)})),Z([this.focusProjectSubject,this.displayOptionsPanel.searchDepth$]).subscribe((([e,t])=>{e&&this.focusProject(e,t)}))}setFocusedProject(e=null){window.focusedProject=e,this.focusedProjectPanel.projectName=e?window.graph.nodes[e].name:null}selectAffectedProjects(){this.setFocusedProject(null),this.projectList.setCheckedProjects(this.affectedProjects),this.emitSelectedProjects(this.affectedProjects)}selectAllProjects(){this.setFocusedProject(null),this.projectList.checkAllProjects(),this.emitSelectedProjects(window.projects.map((e=>e.name)))}deselectAllProjects(){this.setFocusedProject(null),this.projectList.uncheckAllProjects(),this.emitSelectedProjects([])}focusProject(e,t=-1){this.filterByTextSubject.next({text:null,includeInPath:!1}),this.setFocusedProject(e);const n=window.projects.map((e=>e.name)).filter((n=>this.hasPath(e,n,[],1,t)||this.hasPath(n,e,[],1,t)));this.projectList.setCheckedProjects(n),this.emitSelectedProjects(n)}unfocusProject(){this.focusProjectSubject.next(null),this.setFocusedProject(null),this.projectList.uncheckAllProjects(),this.emitSelectedProjects([])}excludeProject(e){const t=[...this.selectedProjects];t.splice(this.selectedProjects.indexOf(e),1),this.projectList.uncheckProject(e),this.emitSelectedProjects(t)}emitSelectedProjects(e){this.selectedProjects=e,this.selectedProjectsChangedSubject.next(e)}filterProjectsByText(e,t,n){this.focusProjectSubject.next(null),this.setFocusedProject(null),this.projectList.uncheckAllProjects();const r=e.split(",").map((e=>e.trim())),i=new Set;window.projects.map((e=>e.name)).forEach((e=>{r.findIndex((t=>e.includes(t)))>-1&&(i.add(e),t&&window.projects.map((e=>e.name)).forEach((t=>{(this.hasPath(e,t,[],1,n)||this.hasPath(t,e,[],1,n))&&i.add(t)})))}));const o=Array.from(i);this.projectList.setCheckedProjects(o),this.emitSelectedProjects(o)}hasPath(e,t,n,r,i=-1){if(e===t)return!0;if(-1===i||r<=i)for(let o of window.graph.dependencies[t]||[])if(!(n.indexOf(o.target)>-1)&&(n.push(o.target),this.hasPath(e,o.target,n,r+1,i)))return!0;return!1}}class ft{constructor(e=be){this.config=e,this.sidebar=void 0,this.tooltipService=new rt,this.graph=new me(this.tooltipService),this.debuggerPanel=void 0,this.windowResize$=S(window,"resize").pipe(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];return O(n)?(e.pop(),function(t){return $(e,t,n)}):function(t){return $(e,t)}}({})),this.render$=new T,this.render$.subscribe((e=>this.render(e))),this.loadProjectGraph(e.defaultProjectGraph),!0===window.watch&&setInterval((()=>this.loadProjectGraph(e.defaultProjectGraph)),5e3)}async loadProjectGraph(e){const t=this.config.projectGraphs.find((t=>t.id===e)),n=await this.config.projectGraphService.getProjectGraph(t.url),r=null==n?void 0:n.layout,i=Object.values(n.projects).filter((e=>"npm"!==e.type)).reduce(((e,t)=>(e[t.name]=t,e)),{}),o=n.changes.added.filter((e=>!window.graph.nodes[e]));window.projects=n.projects,window.graph={dependencies:n.dependencies,nodes:i},window.focusedProject=null,window.projectGraphList=this.config.projectGraphs,window.selectedProjectGraph=e,window.workspaceLayout=r,this.sidebar?this.render$.next({newProjects:o}):this.render$.next()}render(e){const t=document.getElementById("debugger-panel");this.config.showDebugger&&(t.hidden=!1,t.style.display="flex",this.debuggerPanel=new oe(t,window.projectGraphList),this.debuggerPanel.selectProject$.subscribe((e=>{this.loadProjectGraph(e),this.sidebar.resetSidebarVisibility()}))),this.graph.projectGraph=window.graph;const n=window.affected.filter((e=>!e.startsWith("npm:")));this.graph.affectedProjects=n,this.sidebar?(this.sidebar.projects=window.projects,(null==e?void 0:e.newProjects.length)>0&&this.sidebar.selectProjects(e.newProjects)):this.sidebar=new pt(n),Z([this.sidebar.selectedProjectsChanged$,this.sidebar.groupByFolderChanged$,this.windowResize$]).pipe(J(this.render$)).subscribe((([e,t])=>{const n=[];e.forEach((e=>{window.graph.nodes[e]&&n.push(window.graph.nodes[e])})),0===n.length?document.getElementById("no-projects-chosen").style.display="flex":(document.getElementById("no-projects-chosen").style.display="none",this.graph.render(n,t))})),this.debuggerPanel&&this.graph.renderTimes$.pipe(J(this.render$)).subscribe((e=>this.debuggerPanel.renderTime=e))}}const vt={environment:"release",appConfig:{showDebugger:!1,projectGraphs:[{id:"local",label:"local",url:"projectGraph.json"}],defaultProjectGraph:"local",projectGraphService:new class{async getHash(){const e=new Request("currentHash",{mode:"no-cors"});return(await fetch(e)).json()}async getProjectGraph(e){const t=new Request(e,{mode:"no-cors"});return(await fetch(t)).json()}}}};"dev-watch"===vt.environment&&(window.watch=!0),"release"===vt.environment&&"build"===window.localMode&&(vt.appConfig.projectGraphService=new class{async getHash(){return new Promise((e=>e("some-hash")))}async getProjectGraph(e){return new Promise((e=>e(window.projectGraphResponse)))}}),setTimeout((()=>new ft(vt.appConfig)))},w44A:(e,t,n)=>{"use strict";n.d(t,{fi:()=>b,kZ:()=>m});var r=n("3RS9"),i=n("inAj"),o=n("mpRo"),a=n("fPi3"),s=n("kGCJ"),u=n("ZtNq"),l=n("OEhC"),c=n("eGNA");function d(e,t,n){void 0===n&&(n=!1);var d,h,p=(0,l.Z)(t),f=(0,r.Z)(e),v=(0,a.Re)(t),g={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(v||!v&&!n)&&(("body"!==(0,s.Z)(t)||(0,c.Z)(p))&&(g=(d=t)!==(0,o.Z)(d)&&(0,a.Re)(d)?{scrollLeft:(h=d).scrollLeft,scrollTop:h.scrollTop}:(0,i.Z)(d)),(0,a.Re)(t)?((y=(0,r.Z)(t)).x+=t.clientLeft,y.y+=t.clientTop):p&&(y.x=(0,u.Z)(p))),{x:f.left+g.scrollLeft-y.x,y:f.top+g.scrollTop-y.y,width:f.width,height:f.height}}var h=n("eAME"),p=n("Iiib"),f=n("WMZx"),v=n("RpdQ"),g={placement:"bottom",modifiers:[],strategy:"absolute"};function y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function m(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=e.defaultOptions,i=void 0===r?g:r;return function(e,t,r){void 0===r&&(r=i);var o,s,u={placement:"bottom",orderedModifiers:[],options:Object.assign({},g,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,m={state:u,setOptions:function(r){b(),u.options=Object.assign({},i,u.options,r),u.scrollParents={reference:(0,a.kK)(e)?(0,p.Z)(e):e.contextElement?(0,p.Z)(e.contextElement):[],popper:(0,p.Z)(t)};var o,s,c=function(e){var t=function(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=t.get(r);i&&e(i)}})),r.push(i)}(e)})),r}(e);return v.xs.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((o=[].concat(n,u.options.modifiers),s=o.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(s).map((function(e){return s[e]}))));return u.orderedModifiers=c.filter((function(e){return e.enabled})),u.orderedModifiers.forEach((function(e){var t=e.options,n=e.effect;if("function"==typeof n){var r=n({state:u,name:e.name,instance:m,options:void 0===t?{}:t});l.push(r||function(){})}})),m.update()},forceUpdate:function(){if(!c){var e=u.elements,t=e.reference,n=e.popper;if(y(t,n)){u.rects={reference:d(t,(0,f.Z)(n),"fixed"===u.options.strategy),popper:(0,h.Z)(n)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach((function(e){return u.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<u.orderedModifiers.length;r++)if(!0!==u.reset){var i=u.orderedModifiers[r],o=i.fn,a=i.options;"function"==typeof o&&(u=o({state:u,options:void 0===a?{}:a,name:i.name,instance:m})||u)}else u.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){m.forceUpdate(),e(u)}))},function(){return s||(s=new Promise((function(e){Promise.resolve().then((function(){s=void 0,e(o())}))}))),s}),destroy:function(){b(),c=!0}};if(!y(e,t))return m;function b(){l.forEach((function(e){return e()})),l=[]}return m.setOptions(r).then((function(e){!c&&r.onFirstUpdate&&r.onFirstUpdate(e)})),m}}var b=m()},WBDN:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("fPi3");function i(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&(0,r.Zq)(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}},"3RS9":(e,t,n)=>{"use strict";function r(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left,x:t.left,y:t.top}}n.d(t,{Z:()=>r})},CQjb:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("mpRo");function i(e){return(0,r.Z)(e).getComputedStyle(e)}},OEhC:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("fPi3");function i(e){return(((0,r.kK)(e)?e.ownerDocument:e.document)||window.document).documentElement}},eAME:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("3RS9");function i(e){var t=(0,r.Z)(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}},kGCJ:(e,t,n)=>{"use strict";function r(e){return e?(e.nodeName||"").toLowerCase():null}n.d(t,{Z:()=>r})},WMZx:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n("mpRo"),i=n("kGCJ"),o=n("CQjb"),a=n("fPi3");function s(e){return["table","td","th"].indexOf((0,i.Z)(e))>=0}var u=n("4IkK");function l(e){return(0,a.Re)(e)&&"fixed"!==(0,o.Z)(e).position?e.offsetParent:null}function c(e){for(var t=(0,r.Z)(e),n=l(e);n&&s(n)&&"static"===(0,o.Z)(n).position;)n=l(n);return n&&("html"===(0,i.Z)(n)||"body"===(0,i.Z)(n)&&"static"===(0,o.Z)(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&(0,a.Re)(e)&&"fixed"===(0,o.Z)(e).position)return null;for(var n=(0,u.Z)(e);(0,a.Re)(n)&&["html","body"].indexOf((0,i.Z)(n))<0;){var r=(0,o.Z)(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}},"4IkK":(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n("kGCJ"),i=n("OEhC"),o=n("fPi3");function a(e){return"html"===(0,r.Z)(e)?e:e.assignedSlot||e.parentNode||((0,o.Zq)(e)?e.host:null)||(0,i.Z)(e)}},mpRo:(e,t,n)=>{"use strict";function r(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}n.d(t,{Z:()=>r})},inAj:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("mpRo");function i(e){var t=(0,r.Z)(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}},ZtNq:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var r=n("3RS9"),i=n("OEhC"),o=n("inAj");function a(e){return(0,r.Z)((0,i.Z)(e)).left+(0,o.Z)(e).scrollLeft}},fPi3:(e,t,n)=>{"use strict";n.d(t,{kK:()=>i,Re:()=>o,Zq:()=>a});var r=n("mpRo");function i(e){return e instanceof(0,r.Z)(e).Element||e instanceof Element}function o(e){return e instanceof(0,r.Z)(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof(0,r.Z)(e).ShadowRoot||e instanceof ShadowRoot)}},eGNA:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("CQjb");function i(e){var t=(0,r.Z)(e);return/auto|scroll|overlay|hidden/.test(t.overflow+t.overflowY+t.overflowX)}},Iiib:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n("4IkK"),i=n("eGNA"),o=n("kGCJ"),a=n("fPi3"),s=n("mpRo");function u(e,t){var n;void 0===t&&(t=[]);var l=function e(t){return["html","body","#document"].indexOf((0,o.Z)(t))>=0?t.ownerDocument.body:(0,a.Re)(t)&&(0,i.Z)(t)?t:e((0,r.Z)(t))}(e),c=l===(null==(n=e.ownerDocument)?void 0:n.body),d=(0,s.Z)(l),h=c?[d].concat(d.visualViewport||[],(0,i.Z)(l)?l:[]):l,p=t.concat(h);return c?p:p.concat(u((0,r.Z)(h)))}},RpdQ:(e,t,n)=>{"use strict";n.d(t,{we:()=>r,I:()=>i,F2:()=>o,t$:()=>a,d7:()=>s,mv:()=>u,BL:()=>l,ut:()=>c,zV:()=>d,Pj:()=>h,k5:()=>p,YP:()=>f,bw:()=>v,Ct:()=>g,N7:()=>y,ij:()=>m,r5:()=>b,XM:()=>x,DH:()=>w,wX:()=>E,iv:()=>k,cW:()=>P,MS:()=>C,xs:()=>S});var r="top",i="bottom",o="right",a="left",s="auto",u=[r,i,o,a],l="start",c="end",d="clippingParents",h="viewport",p="popper",f="reference",v=u.reduce((function(e,t){return e.concat([t+"-"+l,t+"-"+c])}),[]),g=[].concat(u,[s]).reduce((function(e,t){return e.concat([t,t+"-"+l,t+"-"+c])}),[]),y="beforeRead",m="read",b="afterRead",x="beforeMain",w="main",E="afterMain",k="beforeWrite",P="write",C="afterWrite",S=[y,m,b,x,w,E,k,P,C]},"3O5V":(e,t,n)=>{"use strict";n.r(t),n.d(t,{afterMain:()=>r.wX,afterRead:()=>r.r5,afterWrite:()=>r.MS,applyStyles:()=>i.Z,arrow:()=>o.Z,auto:()=>r.d7,basePlacements:()=>r.mv,beforeMain:()=>r.XM,beforeRead:()=>r.N7,beforeWrite:()=>r.iv,bottom:()=>r.I,clippingParents:()=>r.zV,computeStyles:()=>a.Z,createPopper:()=>v.fi,createPopperBase:()=>p.fi,createPopperLite:()=>g,detectOverflow:()=>f.Z,end:()=>r.ut,eventListeners:()=>s.Z,flip:()=>u.Z,hide:()=>l.Z,left:()=>r.t$,main:()=>r.DH,modifierPhases:()=>r.xs,offset:()=>c.Z,placements:()=>r.Ct,popper:()=>r.k5,popperGenerator:()=>p.kZ,popperOffsets:()=>d.Z,preventOverflow:()=>h.Z,read:()=>r.ij,reference:()=>r.YP,right:()=>r.F2,start:()=>r.BL,top:()=>r.we,variationPlacements:()=>r.bw,viewport:()=>r.Pj,write:()=>r.cW});var r=n("RpdQ"),i=n("Eutg"),o=n("0TAE"),a=n("Y5E6"),s=n("eTX+"),u=n("oGAT"),l=n("q5dt"),c=n("w2kc"),d=n("WAEL"),h=n("P2Mx"),p=n("w44A"),f=n("teJC"),v=n("UV7b"),g=(0,p.kZ)({defaultModifiers:[s.Z,d.Z,a.Z,i.Z]})},Eutg:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n("kGCJ"),i=n("fPi3");const o={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},a=t.elements[e];(0,i.Re)(a)&&(0,r.Z)(a)&&(Object.assign(a.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],a=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});(0,i.Re)(o)&&(0,r.Z)(o)&&(Object.assign(o.style,s),Object.keys(a).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]}},"0TAE":(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n("FX2m"),i=n("eAME"),o=n("WBDN"),a=n("WMZx"),s=n("XQuZ"),u=n("0JNu"),l=n("gPUR"),c=n("VBHY"),d=n("RpdQ");const h={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,h=e.options,p=n.elements.arrow,f=n.modifiersData.popperOffsets,v=(0,r.Z)(n.placement),g=(0,s.Z)(v),y=[d.t$,d.F2].indexOf(v)>=0?"height":"width";if(p&&f){var m=function(e,t){return e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e,(0,l.Z)("number"!=typeof e?e:(0,c.Z)(e,d.mv))}(h.padding,n),b=(0,i.Z)(p),x="y"===g?d.we:d.t$,w="y"===g?d.I:d.F2,E=n.rects.reference[y]+n.rects.reference[g]-f[g]-n.rects.popper[y],k=f[g]-n.rects.reference[g],P=(0,a.Z)(p),C=P?"y"===g?P.clientHeight||0:P.clientWidth||0:0,S=C/2-b[y]/2+(E/2-k/2),_=(0,u.Z)(m[x],S,C-b[y]-m[w]);n.modifiersData[o]=((t={})[g]=_,t.centerOffset=_-S,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&(0,o.Z)(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]}},Y5E6:(e,t,n)=>{"use strict";n.d(t,{Z:()=>h});var r=n("RpdQ"),i=n("WMZx"),o=n("mpRo"),a=n("OEhC"),s=n("CQjb"),u=n("FX2m"),l=n("O4y7"),c={top:"auto",right:"auto",bottom:"auto",left:"auto"};function d(e){var t,n=e.popper,u=e.popperRect,d=e.placement,h=e.offsets,p=e.position,f=e.gpuAcceleration,v=e.adaptive,g=e.roundOffsets,y=!0===g?function(e){var t=e.y,n=window.devicePixelRatio||1;return{x:(0,l.NM)((0,l.NM)(e.x*n)/n)||0,y:(0,l.NM)((0,l.NM)(t*n)/n)||0}}(h):"function"==typeof g?g(h):h,m=y.x,b=void 0===m?0:m,x=y.y,w=void 0===x?0:x,E=h.hasOwnProperty("x"),k=h.hasOwnProperty("y"),P=r.t$,C=r.we,S=window;if(v){var _=(0,i.Z)(n),j="clientHeight",D="clientWidth";_===(0,o.Z)(n)&&(_=(0,a.Z)(n),"static"!==(0,s.Z)(_).position&&(j="scrollHeight",D="scrollWidth")),_=_,d===r.we&&(C=r.I,w-=_[j]-u.height,w*=f?1:-1),d===r.t$&&(P=r.F2,b-=_[D]-u.width,b*=f?1:-1)}var T,B=Object.assign({position:p},v&&c);return Object.assign({},B,f?((T={})[C]=k?"0":"",T[P]=E?"0":"",T.transform=(S.devicePixelRatio||1)<2?"translate("+b+"px, "+w+"px)":"translate3d("+b+"px, "+w+"px, 0)",T):((t={})[C]=k?w+"px":"",t[P]=E?b+"px":"",t.transform="",t))}const h={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:(0,u.Z)(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,d(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,d(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}}},"eTX+":(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n("mpRo"),i={passive:!0};const o={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,o=e.options,a=o.scroll,s=void 0===a||a,u=o.resize,l=void 0===u||u,c=(0,r.Z)(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach((function(e){e.addEventListener("scroll",n.update,i)})),l&&c.addEventListener("resize",n.update,i),function(){s&&d.forEach((function(e){e.removeEventListener("scroll",n.update,i)})),l&&c.removeEventListener("resize",n.update,i)}},data:{}}},oGAT:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r={left:"right",right:"left",bottom:"top",top:"bottom"};function i(e){return e.replace(/left|right|bottom|top/g,(function(e){return r[e]}))}var o=n("FX2m"),a={start:"end",end:"start"};function s(e){return e.replace(/start|end/g,(function(e){return a[e]}))}var u=n("teJC"),l=n("wB9+"),c=n("RpdQ");const d={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,d=void 0===a||a,h=n.altAxis,p=void 0===h||h,f=n.fallbackPlacements,v=n.padding,g=n.boundary,y=n.rootBoundary,m=n.altBoundary,b=n.flipVariations,x=void 0===b||b,w=n.allowedAutoPlacements,E=t.options.placement,k=(0,o.Z)(E),P=f||(k!==E&&x?function(e){if((0,o.Z)(e)===c.d7)return[];var t=i(e);return[s(e),t,s(t)]}(E):[i(E)]),C=[E].concat(P).reduce((function(e,n){return e.concat((0,o.Z)(n)===c.d7?function(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,i=t.padding,a=t.flipVariations,s=t.allowedAutoPlacements,d=void 0===s?c.Ct:s,h=(0,l.Z)(t.placement),p=h?a?c.bw:c.bw.filter((function(e){return(0,l.Z)(e)===h})):c.mv,f=p.filter((function(e){return d.indexOf(e)>=0}));0===f.length&&(f=p);var v=f.reduce((function(t,a){return t[a]=(0,u.Z)(e,{placement:a,boundary:n,rootBoundary:r,padding:i})[(0,o.Z)(a)],t}),{});return Object.keys(v).sort((function(e,t){return v[e]-v[t]}))}(t,{placement:n,boundary:g,rootBoundary:y,padding:v,flipVariations:x,allowedAutoPlacements:w}):n)}),[]),S=t.rects.reference,_=t.rects.popper,j=new Map,D=!0,T=C[0],B=0;B<C.length;B++){var O=C[B],M=(0,o.Z)(O),N=(0,l.Z)(O)===c.BL,I=[c.we,c.I].indexOf(M)>=0,L=I?"width":"height",A=(0,u.Z)(t,{placement:O,boundary:g,rootBoundary:y,altBoundary:m,padding:v}),z=I?N?c.F2:c.t$:N?c.I:c.we;S[L]>_[L]&&(z=i(z));var R=i(z),F=[];if(d&&F.push(A[M]<=0),p&&F.push(A[z]<=0,A[R]<=0),F.every((function(e){return e}))){T=O,D=!1;break}j.set(O,F)}if(D)for(var V=function(e){var t=C.find((function(t){var n=j.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},Z=x?3:1;Z>0&&"break"!==V(Z);Z--);t.placement!==T&&(t.modifiersData[r]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}}},q5dt:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n("RpdQ"),i=n("teJC");function o(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function a(e){return[r.we,r.F2,r.I,r.t$].some((function(t){return e[t]>=0}))}const s={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,u=t.modifiersData.preventOverflow,l=(0,i.Z)(t,{elementContext:"reference"}),c=(0,i.Z)(t,{altBoundary:!0}),d=o(l,r),h=o(c,s,u),p=a(d),f=a(h);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:h,isReferenceHidden:p,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":f})}}},w2kc:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n("FX2m"),i=n("RpdQ");const o={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=e.options.offset,a=void 0===o?[0,0]:o,s=i.Ct.reduce((function(e,n){return e[n]=function(e,t,n){var o=(0,r.Z)(e),a=[i.t$,i.we].indexOf(o)>=0?-1:1,s="function"==typeof n?n(Object.assign({},t,{placement:e})):n,u=s[0],l=s[1];return u=u||0,l=(l||0)*a,[i.t$,i.F2].indexOf(o)>=0?{x:l,y:u}:{x:u,y:l}}(n,t.rects,a),e}),{}),u=s[t.placement],l=u.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u.x,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=s}}},WAEL:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("TnWD");const i={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=(0,r.Z)({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}}},P2Mx:(e,t,n)=>{"use strict";n.d(t,{Z:()=>p});var r=n("RpdQ"),i=n("FX2m"),o=n("XQuZ"),a=n("0JNu"),s=n("eAME"),u=n("WMZx"),l=n("teJC"),c=n("wB9+"),d=n("0H+w"),h=n("O4y7");const p={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,p=e.name,f=n.mainAxis,v=void 0===f||f,g=n.altAxis,y=void 0!==g&&g,m=n.tether,b=void 0===m||m,x=n.tetherOffset,w=void 0===x?0:x,E=(0,l.Z)(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),k=(0,i.Z)(t.placement),P=(0,c.Z)(t.placement),C=!P,S=(0,o.Z)(k),_="x"===S?"y":"x",j=t.modifiersData.popperOffsets,D=t.rects.reference,T=t.rects.popper,B="function"==typeof w?w(Object.assign({},t.rects,{placement:t.placement})):w,O={x:0,y:0};if(j){if(v||y){var M="y"===S?r.we:r.t$,N="y"===S?r.I:r.F2,I="y"===S?"height":"width",L=j[S],A=j[S]+E[M],z=j[S]-E[N],R=b?-T[I]/2:0,F=P===r.BL?D[I]:T[I],V=P===r.BL?-T[I]:-D[I],Z=t.elements.arrow,Y=b&&Z?(0,s.Z)(Z):{width:0,height:0},q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:(0,d.Z)(),X=q[M],W=q[N],H=(0,a.Z)(0,D[I],Y[I]),G=C?D[I]/2-R-H-X-B:F-H-X-B,U=C?-D[I]/2+R+H+W+B:V+H+W+B,K=t.elements.arrow&&(0,u.Z)(t.elements.arrow),Q=t.modifiersData.offset?t.modifiersData.offset[t.placement][S]:0,$=j[S]+G-Q-(K?"y"===S?K.clientTop||0:K.clientLeft||0:0),J=j[S]+U-Q;if(v){var ee=(0,a.Z)(b?(0,h.VV)(A,$):A,L,b?(0,h.Fp)(z,J):z);j[S]=ee,O[S]=ee-L}if(y){var te=j[_],ne=te+E["x"===S?r.we:r.t$],re=te-E["x"===S?r.I:r.F2],ie=(0,a.Z)(b?(0,h.VV)(ne,$):ne,te,b?(0,h.Fp)(re,J):re);j[_]=ie,O[_]=ie-te}}t.modifiersData[p]=O}},requiresIfExists:["offset"]}},UV7b:(e,t,n)=>{"use strict";n.d(t,{fi:()=>p});var r=n("w44A"),i=n("eTX+"),o=n("WAEL"),a=n("Y5E6"),s=n("Eutg"),u=n("w2kc"),l=n("oGAT"),c=n("P2Mx"),d=n("0TAE"),h=n("q5dt"),p=(0,r.kZ)({defaultModifiers:[i.Z,o.Z,a.Z,s.Z,u.Z,l.Z,c.Z,d.Z,h.Z]})},TnWD:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n("FX2m"),i=n("wB9+"),o=n("XQuZ"),a=n("RpdQ");function s(e){var t,n=e.reference,s=e.element,u=e.placement,l=u?(0,r.Z)(u):null,c=u?(0,i.Z)(u):null,d=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2;switch(l){case a.we:t={x:d,y:n.y-s.height};break;case a.I:t={x:d,y:n.y+n.height};break;case a.F2:t={x:n.x+n.width,y:h};break;case a.t$:t={x:n.x-s.width,y:h};break;default:t={x:n.x,y:n.y}}var p=l?(0,o.Z)(l):null;if(null!=p){var f="y"===p?"height":"width";switch(c){case a.BL:t[p]=t[p]-(n[f]/2-s[f]/2);break;case a.ut:t[p]=t[p]+(n[f]/2-s[f]/2)}}return t}},teJC:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var r=n("3RS9"),i=n("RpdQ"),o=n("mpRo"),a=n("OEhC"),s=n("ZtNq"),u=n("CQjb"),l=n("inAj"),c=n("O4y7"),d=n("Iiib"),h=n("WMZx"),p=n("fPi3"),f=n("4IkK"),v=n("WBDN"),g=n("kGCJ");function y(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function m(e,t){return t===i.Pj?y(function(e){var t=(0,o.Z)(e),n=(0,a.Z)(e),r=t.visualViewport,i=n.clientWidth,u=n.clientHeight,l=0,c=0;return r&&(i=r.width,u=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=r.offsetLeft,c=r.offsetTop)),{width:i,height:u,x:l+(0,s.Z)(e),y:c}}(e)):(0,p.Re)(t)?function(e){var t=(0,r.Z)(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):y(function(e){var t,n=(0,a.Z)(e),r=(0,l.Z)(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=(0,c.Fp)(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),d=(0,c.Fp)(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),h=-r.scrollLeft+(0,s.Z)(e),p=-r.scrollTop;return"rtl"===(0,u.Z)(i||n).direction&&(h+=(0,c.Fp)(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:d,x:h,y:p}}((0,a.Z)(e)))}var b=n("TnWD"),x=n("gPUR"),w=n("VBHY");function E(e,t){void 0===t&&(t={});var n=t.placement,o=void 0===n?e.placement:n,s=t.boundary,l=void 0===s?i.zV:s,E=t.rootBoundary,k=void 0===E?i.Pj:E,P=t.elementContext,C=void 0===P?i.k5:P,S=t.altBoundary,_=void 0!==S&&S,j=t.padding,D=void 0===j?0:j,T=(0,x.Z)("number"!=typeof D?D:(0,w.Z)(D,i.mv)),B=e.elements.reference,O=e.rects.popper,M=e.elements[_?C===i.k5?i.YP:i.k5:C],N=function(e,t,n){var r="clippingParents"===t?function(e){var t=(0,d.Z)((0,f.Z)(e)),n=["absolute","fixed"].indexOf((0,u.Z)(e).position)>=0&&(0,p.Re)(e)?(0,h.Z)(e):e;return(0,p.kK)(n)?t.filter((function(e){return(0,p.kK)(e)&&(0,v.Z)(e,n)&&"body"!==(0,g.Z)(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i.reduce((function(t,n){var r=m(e,n);return t.top=(0,c.Fp)(r.top,t.top),t.right=(0,c.VV)(r.right,t.right),t.bottom=(0,c.VV)(r.bottom,t.bottom),t.left=(0,c.Fp)(r.left,t.left),t}),m(e,i[0]));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}((0,p.kK)(M)?M:M.contextElement||(0,a.Z)(e.elements.popper),l,k),I=(0,r.Z)(B),L=(0,b.Z)({reference:I,element:O,strategy:"absolute",placement:o}),A=y(Object.assign({},O,L)),z=C===i.k5?A:I,R={top:N.top-z.top+T.top,bottom:z.bottom-N.bottom+T.bottom,left:N.left-z.left+T.left,right:z.right-N.right+T.right},F=e.modifiersData.offset;if(C===i.k5&&F){var V=F[o];Object.keys(R).forEach((function(e){var t=[i.F2,i.I].indexOf(e)>=0?1:-1,n=[i.we,i.I].indexOf(e)>=0?"y":"x";R[e]+=V[n]*t}))}return R}},VBHY:(e,t,n)=>{"use strict";function r(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}n.d(t,{Z:()=>r})},FX2m:(e,t,n)=>{"use strict";function r(e){return e.split("-")[0]}n.d(t,{Z:()=>r})},"0H+w":(e,t,n)=>{"use strict";function r(){return{top:0,right:0,bottom:0,left:0}}n.d(t,{Z:()=>r})},XQuZ:(e,t,n)=>{"use strict";function r(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}n.d(t,{Z:()=>r})},"wB9+":(e,t,n)=>{"use strict";function r(e){return e.split("-")[1]}n.d(t,{Z:()=>r})},O4y7:(e,t,n)=>{"use strict";n.d(t,{Fp:()=>r,VV:()=>i,NM:()=>o});var r=Math.max,i=Math.min,o=Math.round},gPUR:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("0H+w");function i(e){return Object.assign({},(0,r.Z)(),e)}},"0JNu":(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n("O4y7");function i(e,t,n){return(0,r.Fp)(e,(0,r.VV)(t,n))}},Ded0:function(e,t,n){var r;r=function(e){return 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=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return(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})(e)}var i=n(2),o=n(3),a=n(4);function s(e){this.options=o({},i,e)}s.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,i=function(e,t){return"function"==typeof t?t.apply(e,[e]):t},o=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===o.x2&&(o.x2=o.x1+o.w),void 0===o.w&&(o.w=o.x2-o.x1),void 0===o.y2&&(o.y2=o.y1+o.h),void 0===o.h&&(o.h=o.y2-o.y1);var s=new a.graphlib.Graph({multigraph:!0,compound:!0}),u={},l=function(e,t){null!=t&&(u[e]=t)};l("nodesep",e.nodeSep),l("edgesep",e.edgeSep),l("ranksep",e.rankSep),l("rankdir",e.rankDir),l("ranker",e.ranker),s.setGraph(u),s.setDefaultEdgeLabel((function(){return{}})),s.setDefaultNodeLabel((function(){return{}}));for(var c=n.nodes(),d=0;d<c.length;d++){var h=c[d],p=h.layoutDimensions(e);s.setNode(h.id(),{width:p.w,height:p.h,name:h.id()})}for(var f=0;f<c.length;f++){var v=c[f];v.isChild()&&s.setParent(v.id(),v.parent().id())}for(var g=n.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()})),y=0;y<g.length;y++){var m=g[y];s.setEdge(m.source().id(),m.target().id(),{minlen:i(m,e.minLen),weight:i(m,e.edgeWeight),name:m.id()},m.id())}a.layout(s);for(var b,x=s.nodes(),w=0;w<x.length;w++){var E=x[w],k=s.node(E);t.getElementById(E).scratch().dagre=k}return e.boundingBox?(b={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},c.forEach((function(e){var t=e.scratch().dagre;b.x1=Math.min(b.x1,t.x),b.x2=Math.max(b.x2,t.x),b.y1=Math.min(b.y1,t.y),b.y2=Math.max(b.y2,t.y)})),b.w=b.x2-b.x1,b.h=b.y2-b.y1):b=o,c.layoutPositions(this,e,(function(t){var n,i=(t="object"===r(t)?t:this).scratch().dagre;return n={x:i.x,y:i.y},e.boundingBox?{x:o.x1+(0===b.w?0:(n.x-b.x1)/b.w)*o.w,y:o.y1+(0===b.h?0:(n.y-b.y1)/b.h)*o.h}:n})),this},e.exports=s},function(e,t){e.exports={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,t){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,t){return t},ready:function(){},stop:function(){}}},function(e,t){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(t,n){t.exports=e}])},e.exports=r(n("4e6e"))},CQyY:function(e,t,n){var r;r=function(e){return 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.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get: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=7)}([function(e,t,n){"use strict";e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){null!=t&&Object.keys(t).forEach((function(n){return e[n]=t[n]}))})),e}},function(e,t,n){"use strict";var r=n(5).getBoundingBox;e.exports={getRef:function(e,t){return{getBoundingClientRect:function(){return r(e,t)}}}}},function(e,t,n){"use strict";var r=n(0),i=n(1).getRef,o=n(6).getContent,a={},s=n(8).createPopper;e.exports={getPopper:function(e,t){var n=i(e,t),u=o(e,t.content),l=r({},a,t.popper);return s(n,u,l)}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){var n=function(e){return e.isNode()?{w:e.renderedWidth(),h:e.renderedHeight()}:{w:3,h:3}},i=e.cy();return r({},{renderedDimensions:n,renderedPosition:function(e){return e.isNode()?function(e,t){var n=e.renderedPosition(),r=t(e);return{x:n.x-r.w/2,y:n.y-r.h/2}}(e,n):function(e){var t=e.midpoint(),n=e.cy().pan(),r=e.cy().zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}(e)},popper:{},cy:i},t)}function s(e){e.length>1&&(console.warn("Popper.js Extension should only be used on one element."),console.warn("Ignoring all subsequent elements"))}e.exports={popper:function(e){return s(this),i(this[0],a(this[0],e))},popperRef:function(e){return s(this),o(this[0],a(this[0],e))}}},function(e,t,n){"use strict";var r=n(0),i=n(2).getPopper,o=n(1).getRef;function a(e,t){return r({},{boundingBox:{top:0,left:0,right:0,bottom:0,w:3,h:3},renderedDimensions:function(){return{w:3,h:3}},renderedPosition:function(){return{x:0,y:0}},popper:{},cy:e},t)}e.exports={popper:function(e){return i(this,a(this,e))},popperRef:function(e){return o(this,a(this,e))}}},function(e,t,n){"use strict";e.exports={getBoundingBox:function(e,t){var n=t.renderedPosition,r=t.renderedDimensions,i=t.cy.container().getBoundingClientRect(),o=r(e),a=n(e);return{top:a.y+i.top,left:a.x+i.left,right:a.x+o.w+i.left,bottom:a.y+o.h+i.top,width:o.w,height:o.h}}}},function(e,t,n){"use strict";e.exports={getContent:function(e,t){var n;if("function"!=typeof t){if(t instanceof HTMLElement)return t;throw new Error("Can not create popper from 'target' with unknown type")}if(null===(n=t(e)))throw new Error("No 'target' specified to create popper");return n}}},function(e,t,n){"use strict";var r=n(4),i=n(3),o=function(e){e&&(e("core","popper",r.popper),e("collection","popper",i.popper),e("core","popperRef",r.popperRef),e("collection","popperRef",i.popperRef))};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(t,n){t.exports=e}])},e.exports=r(n("3O5V"))},rFOX:(e,t,n)=>{"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var i=r(n("E/ZA")),o=r(n("3Ssf"));function a(e){return(a="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;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var h="undefined"==typeof window?null:window,p=h?h.navigator:null,f=a(""),v=a({}),g=a((function(){})),y="undefined"==typeof HTMLElement?"undefined":a(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&a(e)==f},x=function(e){return null!=e&&a(e)===g},w=function(e){return!C(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&a(e)===v&&!w(e)&&e.constructor===Object},k=function(e){return null!=e&&a(e)===a(1)&&!isNaN(e)},P=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},C=function(e){return S(e)||_(e)},S=function(e){return"collection"===m(e)&&e._private.single},_=function(e){return"collection"===m(e)&&!e._private.single},j=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},T=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},B=function(e){return function(e){return null!=e&&a(e)===v}(e)&&x(e.then)},O=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join("$")});var n=function n(){var r,i=this,o=arguments,a=t.apply(i,o),s=n.cache;return(r=s[a])||(r=s[a]=e.apply(i,o)),r};return n.cache={},n},M=O((function(e){return e.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}))})),N=O((function(e){return e.replace(/(-\w)/g,(function(e){return e[1].toUpperCase()}))})),I=O((function(e,t){return e+t[0].toUpperCase()+t.substring(1)}),(function(e,t){return e+"$"+t})),L=function(e){return T(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},A="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",z=function(e,t){return e<t?-1:e>t?1:0},R=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(null!=r)for(var i=Object.keys(r),o=0;o<i.length;o++){var a=i[o];e[a]=r[a]}}return 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]},V=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(E(o))throw Error("Tried to set map with object key");i<n.length-1?(null==t[o]&&(t[o]={}),t=t[o]):t[o]=e.value}},Z=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var o=n[i];if(E(o))throw Error("Tried to get map with object key");if(null==(t=t[o]))return t}return t},Y=h?h.performance:null,q=Y&&Y.now?function(){return Y.now()}:function(){return Date.now()},X=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(q())}),1e3/60)}}(),W=function(e){return X(e)},H=q,G=65599,U=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261,r=n;!(t=e.next()).done;)r=r*G+t.value|0;return r},K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9261;return t*G+e|0},Q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5381;return(t<<5)+t+e|0},$=function(e){return 2097152*e[0]+e[1]},J=function(e,t){return[K(e[0],t[0]),Q(e[1],t[1])]},ee=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return U({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},te=function(){return ne(arguments)},ne=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=0===n?ee(r):ee(r,t)}return t},re=!0,ie=null!=console.warn,oe=null!=console.trace,ae=Number.MAX_SAFE_INTEGER||9007199254740991,se=function(){return!0},ue=function(){return!1},le=function(){return 0},ce=function(){},de=function(e){throw new Error(e)},he=function(e){if(void 0===e)return re;re=!!e},pe=function(e){he()&&(ie?console.warn(e):(console.log(e),oe&&console.trace()))},fe=function(e){return null==e?e:w(e)?e.slice():E(e)?function(e){return R({},e)}(e):e},ve=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},ge={},ye=function(){return ge},me=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var o=t[i],a=null==n?void 0:n[o];r[o]=void 0===a?e[o]:a}return r}},be=function(e,t,n){for(var r=e.length-1;r>=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},xe=function(e){e.splice(0,e.length)},we=function(e,t,n){return n&&(t=I(n,t)),e[t]},Ee=function(e,t,n,r){n&&(t=I(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}(),Pe=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;r<n.length;r++)this.add(n[r])}}return l(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(e){var t=this._obj;1!==t[e]&&(t[e]=1,this.size++)}},{key:"delete",value:function(e){var t=this._obj;1===t[e]&&(t[e]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(e){return 1===this._obj[e]}},{key:"toArray",value:function(){var e=this;return Object.keys(this._obj).filter((function(t){return e.has(t)}))}},{key:"forEach",value:function(e,t){return this.toArray().forEach(e,t)}}]),e}(),Ce="undefined"!==("undefined"==typeof Set?"undefined":a(Set))?Set:Pe,Se=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&j(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new Ce,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var u=[];w(t.classes)?u=t.classes:b(t.classes)&&(u=t.classes.split(/\s+/));for(var l=0,c=u.length;l<c;l++){var d=u[l];d&&""!==d&&i.classes.add(d)}this.createEmitter();var h=t.style||t.css;h&&(pe("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(void 0===n||n)&&this.restore()}else de("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else de("An element must have a core reference and parameters set")},_e=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;E(t)&&!C(t)&&(t=(i=t).roots||i.root,n=i.visit,r=i.directed),r=2!==arguments.length||x(n)?r:n,n=x(n)?n:function(){};for(var o,a=this._private.cy,s=t=b(t)?this.filter(t):t,u=[],l=[],c={},d={},h={},p=0,f=this.byGroup(),v=f.nodes,g=f.edges,y=0;y<s.length;y++){var m=s[y],w=m.id();m.isNode()&&(u.unshift(m),e.bfs&&(h[w]=!0,l.push(m)),d[w]=0)}var k=function(){var t=e.bfs?u.shift():u.pop(),i=t.id();if(e.dfs){if(h[i])return"continue";h[i]=!0,l.push(t)}var a,s=d[i],f=c[i],y=null!=f?f.source():null,m=null!=f?f.target():null,b=null==f?void 0:t.same(y)?m[0]:y[0];if(!0===(a=n(t,f,b,p++,s)))return o=t,"break";if(!1===a)return"break";for(var x=t.connectedEdges().filter((function(e){return(!r||e.source().same(t))&&g.has(e)})),w=0;w<x.length;w++){var E=x[w],k=E.connectedNodes().filter((function(e){return!e.same(t)&&v.has(e)})),P=k.id();0===k.length||h[P]||(u.push(k=k[0]),e.bfs&&(h[P]=!0,l.push(k)),c[P]=E,d[P]=d[i]+1)}};e:for(;0!==u.length;){var P=k();switch(P){case"continue":continue;case"break":break e}}for(var S=a.collection(),_=0;_<l.length;_++){var j=l[_],D=c[j.id()];null!=D&&S.push(D),S.push(j)}return{path:a.collection(S),found:a.collection(o)}}},je={breadthFirstSearch:_e({bfs:!0}),depthFirstSearch:_e({dfs:!0})};je.bfs=je.breadthFirstSearch,je.dfs=je.depthFirstSearch;var De=me({root:null,weight:function(e){return 1},directed:!1}),Te={dijkstra:function(e){if(!E(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=De(e),r=n.root,i=n.weight,a=n.directed,s=this,u=i,l=b(r)?this.filter(r)[0]:r[0],c={},d={},h={},p=this.byGroup(),f=p.nodes,v=p.edges;v.unmergeBy((function(e){return e.isLoop()}));for(var g=function(e){return c[e.id()]},y=function(e,t){c[e.id()]=t,m.updateItem(e)},m=new o((function(e,t){return g(e)-g(t)})),x=0;x<f.length;x++){var w=f[x];c[w.id()]=w.same(l)?0:1/0,m.push(w)}for(var k=function(e,t){for(var n,r=(a?e.edgesTo(t):e.edgesWith(t)).intersect(v),i=1/0,o=0;o<r.length;o++){var s=r[o],l=u(s);(l<i||!n)&&(i=l,n=s)}return{edge:n,dist:i}};m.size()>0;){var P=m.pop(),C=g(P),S=P.id();if(h[S]=C,C!==1/0)for(var _=P.neighborhood().intersect(f),j=0;j<_.length;j++){var D=_[j],T=D.id(),B=k(P,D),O=C+B.dist;O<g(D)&&(y(D,O),d[T]={node:P,edge:B.edge})}}return{distanceTo:function(e){var t=b(e)?f.filter(e)[0]:e[0];return h[t.id()]},pathTo:function(e){var t=b(e)?f.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);d[i];){var o=d[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return s.spawn(n)}}}},Be={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t<o.length;t++)if(o[t].has(e))return t},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var l=r.sort((function(t,n){return e(t)-e(n)})),c=0;c<l.length;c++){var d=l[c],h=d.source()[0],p=d.target()[0],f=s(h),v=s(p),g=o[f],y=o[v];f!==v&&(a.merge(d),g.merge(y),o.splice(v,1))}return a}},Oe=me({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Me={aStar:function(e){var t=this.cy(),n=Oe(e),r=n.root,i=n.goal,a=n.heuristic,s=n.directed,u=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var l,c,d=r.id(),h=i.id(),p={},f={},v={},g=new o((function(e,t){return f[e.id()]-f[t.id()]})),y=new Ce,m={},b={},x=function(e,t){g.push(e),y.add(t)};x(r,d),p[d]=0,f[d]=a(r);for(var w=0;g.size()>0;){if(c=(l=g.pop()).id(),y.delete(c),w++,c===h){for(var E=[],k=i,P=h,C=b[P];E.unshift(k),null!=C&&E.unshift(C),null!=(k=m[P]);)C=b[P=k.id()];return{found:!0,distance:p[c],path:this.spawn(E),steps:w}}v[c]=!0;for(var S=l._private.edges,_=0;_<S.length;_++){var j=S[_];if(this.hasElementWithId(j.id())&&(!s||j.data("source")===c)){var D=j.source(),T=j.target(),B=D.id()!==c?D:T,O=B.id();if(this.hasElementWithId(O)&&!v[O]){var M=p[c]+u(j);y.has(O)?M<p[O]&&(p[O]=M,f[O]=M+a(B),m[O]=l,b[O]=j):(p[O]=M,f[O]=M+a(B),x(B,O),m[O]=l,b[O]=j)}}}}return{found:!1,distance:void 0,path:void 0,steps:w}}},Ne=me({weight:function(e){return 1},directed:!1}),Ie={floydWarshall:function(e){for(var t=this.cy(),n=Ne(e),r=n.directed,i=n.weight,o=this.byGroup(),a=o.nodes,s=o.edges,u=a.length,l=u*u,c=function(e){return a.indexOf(e)},d=function(e){return a[e]},h=new Array(l),p=0;p<l;p++){var f=p%u;h[p]=(p-f)/u===f?0:1/0}for(var v=new Array(l),g=new Array(l),y=0;y<s.length;y++){var m=s[y],x=m.source()[0],w=m.target()[0];if(x!==w){var E=c(x),k=c(w),P=E*u+k,C=i(m);if(h[P]>C&&(h[P]=C,v[P]=k,g[P]=m),!r){var S=k*u+E;!r&&h[S]>C&&(h[S]=C,v[S]=E,g[S]=m)}}}for(var _=0;_<u;_++)for(var j=0;j<u;j++)for(var D=j*u+_,T=0;T<u;T++){var B=j*u+T,O=_*u+T;h[D]+h[O]<h[B]&&(h[B]=h[D]+h[O],v[B]=v[D])}var M=function(e){return c(function(e){return(b(e)?t.filter(e):e)[0]}(e))};return{distance:function(e,t){var n=M(e),r=M(t);return h[n*u+r]},path:function(e,n){var r=M(e),i=M(n),o=d(r);if(r===i)return o.collection();if(null==v[r*u+i])return t.collection();var a=t.collection();for(a.merge(o);r!==i;)a.merge(g[r*u+(r=v[r*u+i])]),a.merge(d(r));return a}}}},Le=me({weight:function(e){return 1},directed:!1,root:null}),Ae={bellmanFord:function(e){var t=this,n=Le(e),r=n.directed,i=n.root,o=n.weight,a=this,s=this.cy(),u=this.byGroup(),l=u.edges,c=u.nodes,d=c.length,h=new ke,p=!1;i=s.collection(i)[0],l.unmergeBy((function(e){return e.isLoop()}));for(var f=l.length,v=function(e){var t=h.get(e.id());return t||(t={},h.set(e.id(),t)),t},g=function(e){return(b(e)?s.$(e):e)[0]},y=0;y<d;y++){var m=c[y],x=v(m);x.dist=m.same(i)?0:1/0,x.pred=null,x.edge=null}for(var w=!1,E=function(e,t,n,r,i,o){var a=r.dist+o;a<i.dist&&!n.same(r.edge)&&(i.dist=a,i.pred=e,i.edge=n,w=!0)},k=1;k<d;k++){w=!1;for(var P=0;P<f;P++){var C=l[P],S=C.source(),_=C.target(),j=o(C),D=v(S),T=v(_);E(S,0,C,D,T,j),r||E(_,0,C,T,D,j)}if(!w)break}if(w)for(var B=0;B<f;B++){var O=l[B],M=O.source(),N=O.target(),I=o(O),L=v(M).dist,A=v(N).dist;if(L+I<A||!r&&A+I<L){pe("Graph contains a negative weight cycle for Bellman-Ford"),p=!0;break}}return{distanceTo:function(e){return v(g(e)).dist},pathTo:function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=g(e),o=[],s=r;;){if(null==s)return t.spawn();var u=v(s),l=u.edge,c=u.pred;if(o.unshift(s[0]),s.same(n)&&o.length>0)break;null!=l&&o.unshift(l),s=c}return a.spawn(o)},hasNegativeWeightCycle:p,negativeWeightCycles:[]}}},ze=Math.sqrt(2),Re=function(e,t,n){0===n.length&&de("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=t[r[1]],o=t[r[2]],a=n,s=a.length-1;s>=0;s--){var u=a[s],l=u[1],c=u[2];(t[l]===i&&t[c]===o||t[l]===o&&t[c]===i)&&a.splice(s,1)}for(var d=0;d<a.length;d++){var h=a[d];h[1]===o?(a[d]=h.slice(),a[d][1]=i):h[2]===o&&(a[d]=h.slice(),a[d][2]=i)}for(var p=0;p<t.length;p++)t[p]===o&&(t[p]=i);return a},Fe=function(e,t,n,r){for(;n>r;){var i=Math.floor(Math.random()*t.length);t=Re(i,e,t),n--}return t},Ve={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,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/ze);if(!(i<2)){for(var u=[],l=0;l<o;l++){var c=r[l];u.push([l,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,h=[],p=new Array(i),f=new Array(i),v=new Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},y=0;y<=a;y++){for(var m=0;m<i;m++)f[m]=m;var b=Fe(f,u.slice(),i,s),x=b.slice();g(f,v);var w=Fe(f,b,s,2),E=Fe(v,x,s,2);w.length<=E.length&&w.length<d?(d=w.length,h=w,g(f,p)):E.length<=w.length&&E.length<d&&(d=E.length,h=E,g(v,p))}for(var k=this.spawn(h.map((function(e){return r[e[0]]}))),P=this.spawn(),C=this.spawn(),S=p[0],_=0;_<p.length;_++){var j=n[_];p[_]===S?P.merge(j):C.merge(j)}var D=function(t){var n=e.spawn();return t.forEach((function(t){n.merge(t),t.connectedEdges().forEach((function(t){e.contains(t)&&!k.contains(t)&&n.merge(t)}))})),n},T=[D(P),D(C)];return{cut:k,components:T,partition1:P,partition2:C}}de("At least 2 nodes are required for Karger-Stein algorithm")}},Ze=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Ye=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},qe=function(e){return{x:e[0],y:e[1]}},Xe=function(e,t){return Math.atan2(t,e)-Math.PI/2},We=Math.log2||function(e){return Math.log(e)/Math.log(2)},He=function(e){return e>0?1:e<0?-1:0},Ge=function(e,t){return Math.sqrt(Ue(e,t))},Ue=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Ke=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},Qe=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},$e=function(e,t,n,r){return{x:Qe(e.x,t.x,n.x,r),y:Qe(e.y,t.y,n.y,r)}},Je=function(e,t,n){return Math.max(e,Math.min(n,t))},et=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},tt=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},nt=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},rt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=d(o,4);t=a[0],n=a[1],r=a[2],i=a[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},it=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){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},at=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},st=function(e,t){return at(e,t.x1,t.y1)&&at(e,t.x2,t.y2)},ut=function(e,t,n,r,i,o,a){var s,u=St(i,o),l=i/2,c=o/2,d=r-c-a;if((s=xt(e,t,n,r,n-l+u-a,d,n+l-u+a,d,!1)).length>0)return s;var h=n+l+a;if((s=xt(e,t,n,r,h,r-c+u-a,h,r+c-u+a,!1)).length>0)return s;var p=r+c+a;if((s=xt(e,t,n,r,n-l+u-a,p,n+l-u+a,p,!1)).length>0)return s;var f,v=n-l-a;if((s=xt(e,t,n,r,v,r-c+u-a,v,r+c-u+a,!1)).length>0)return s;var g=n-l+u,y=r-c+u;if((f=mt(e,t,n,r,g,y,u+a)).length>0&&f[0]<=g&&f[1]<=y)return[f[0],f[1]];var m=n+l-u,b=r-c+u;if((f=mt(e,t,n,r,m,b,u+a)).length>0&&f[0]>=m&&f[1]<=b)return[f[0],f[1]];var x=n+l-u,w=r+c-u;if((f=mt(e,t,n,r,x,w,u+a)).length>0&&f[0]>=x&&f[1]>=w)return[f[0],f[1]];var E=n-l+u,k=r+c-u;return(f=mt(e,t,n,r,E,k,u+a)).length>0&&f[0]<=E&&f[1]>=k?[f[0],f[1]]:[]},lt=function(e,t,n,r,i,o,a){var s=a,u=Math.min(n,i),l=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return u-s<=e&&e<=l+s&&c-s<=t&&t<=d+s},ct=function(e,t,n,r,i,o,a,s,u){var l=Math.min(n,a,i)-u,c=Math.max(n,a,i)+u,d=Math.min(r,s,o)-u,h=Math.max(r,s,o)+u;return!(e<l||e>c||t<d||t>h)},dt=function(e,t,n,r,i,o,a,s){var u,l,c,d,h,p,f,v,g,y,m,b,x,w=[];l=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0==(u=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(u=1e-5),v=-27*(d/=u)+(l/=u)*(9*(c/=u)-l*l*2),p=(f=(3*c-l*l)/9)*f*f+(v/=54)*v,(h=w)[1]=0,b=l/3,p>0?(y=(y=v+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=v-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,h[4]=h[2]=-(b+=(y+m)/2),b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(g=(f=-f)*f*f,g=Math.acos(v/Math.sqrt(g)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(g/3),h[2]=-b+x*Math.cos((g+2*Math.PI)/3),h[4]=-b+x*Math.cos((g+4*Math.PI)/3)));for(var E=[],k=0;k<6;k+=2)Math.abs(w[k+1])<1e-7&&w[k]>=0&&w[k]<=1&&E.push(w[k]);E.push(1),E.push(0);for(var P,C,S,_=-1,j=0;j<E.length;j++)P=Math.pow(1-E[j],2)*n+2*(1-E[j])*E[j]*i+E[j]*E[j]*a,C=Math.pow(1-E[j],2)*r+2*(1-E[j])*E[j]*o+E[j]*E[j]*s,S=Math.pow(P-e,2)+Math.pow(C-t,2),_>=0?S<_&&(_=S):_=S;return _},ht=function(e,t,n,r,i,o){var a=[e-n,t-r],s=[i-n,o-r],u=s[0]*s[0]+s[1]*s[1],l=a[0]*a[0]+a[1]*a[1],c=a[0]*s[0]+a[1]*s[1],d=c*c/u;return c<0?l:d>u?(e-i)*(e-i)+(t-o)*(t-o):l-d},pt=function(e,t,n){for(var r,i,o,a,s=0,u=0;u<n.length/2;u++)if(i=n[2*u+1],u+1<n.length/2?(o=n[2*(u+1)],a=n[2*(u+1)+1]):(o=n[2*(u+1-n.length/2)],a=n[2*(u+1-n.length/2)+1]),(r=n[2*u])==e&&o==e);else{if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},ft=function(e,t,n,r,i,o,a,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),p=Math.sin(-l),f=0;f<c.length/2;f++)c[2*f]=o/2*(n[2*f]*h-n[2*f+1]*p),c[2*f+1]=a/2*(n[2*f+1]*h+n[2*f]*p),c[2*f]+=r,c[2*f+1]+=i;if(u>0){var v=gt(c,-u);d=vt(v)}else d=c;return pt(e,t,d)},vt=function(e){for(var t,n,r,i,o=new Array(e.length/2),a=0;a<e.length/4;a++){a<e.length/4-1?(t=e[4*(a+1)],n=e[4*(a+1)+1],r=e[4*(a+1)+2],i=e[4*(a+1)+3]):(t=e[0],n=e[1],r=e[2],i=e[3]);var s=xt(e[4*a],e[4*a+1],e[4*a+2],e[4*a+3],t,n,r,i,!0);o[2*a]=s[0],o[2*a+1]=s[1]}return o},gt=function(e,t){for(var n,r,i,o,a=new Array(2*e.length),s=0;s<e.length/2;s++){s<e.length/2-1?(i=e[2*(s+1)],o=e[2*(s+1)+1]):(i=e[0],o=e[1]);var u=o-(r=e[2*s+1]),l=-(i-(n=e[2*s])),c=Math.sqrt(u*u+l*l),d=u/c,h=l/c;a[4*s]=n+d*t,a[4*s+1]=r+h*t,a[4*s+2]=i+d*t,a[4*s+3]=o+h*t}return a},yt=function(e,t,n,r,i,o,a){return e-=i,t-=o,(e/=n/2+a)*e+(t/=r/2+a)*t<=1},mt=function(e,t,n,r,i,o,a){var s=[n-e,r-t],u=[e-i,t-o],l=s[0]*s[0]+s[1]*s[1],c=2*(u[0]*s[0]+u[1]*s[1]),d=c*c-4*l*(u[0]*u[0]+u[1]*u[1]-a*a);if(d<0)return[];var h=(-c+Math.sqrt(d))/(2*l),p=(-c-Math.sqrt(d))/(2*l),f=Math.min(h,p),v=Math.max(h,p),g=[];if(f>=0&&f<=1&&g.push(f),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]},bt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},xt=function(e,t,n,r,i,o,a,s,u){var l=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,v=d*h-f*l,g=c*h-p*l,y=f*c-d*p;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*p]:[]}return 0===v||0===g?bt(e,n,a)===a?[a,s]:bt(e,n,i)===i?[i,o]:bt(i,a,n)===n?[n,r]:[]:[]},wt=function(e,t,n,r,i,o,a,s){var u,l,c,d,h=[],p=new Array(n.length),f=!0;if(null==o&&(f=!1),f){for(var v=0;v<p.length/2;v++)p[2*v]=n[2*v]*o+r,p[2*v+1]=n[2*v+1]*a+i;if(s>0){var g=gt(p,-s);l=vt(g)}else l=p}else l=n;for(var y=0;y<l.length/2;y++)y<l.length/2-1?(c=l[2*(y+1)],d=l[2*(y+1)+1]):(c=l[0],d=l[1]),0!==(u=xt(e,t,r,i,l[2*y],l[2*y+1],c,d)).length&&h.push(u[0],u[1]);return h},Et=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},kt=function(e,t){var n=Ct(e,t);return Pt(n)},Pt=function(e){for(var t,n,r=e.length/2,i=1/0,o=1/0,a=-1/0,s=-1/0,u=0;u<r;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);for(var l=2/(a-i),c=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*l,n=e[2*d+1]=e[2*d+1]*c,i=Math.min(i,t),a=Math.max(a,t),o=Math.min(o,n),s=Math.max(s,n);if(o<-1)for(var h=0;h<r;h++)n=e[2*h+1]=e[2*h+1]+(-1-o);return e},Ct=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i,o=new Array(2*e),a=0;a<e;a++)i=a*n+r,o[2*a]=Math.cos(i),o[2*a+1]=Math.sin(-i);return o},St=function(e,t){return Math.min(e/4,t/4,8)},_t=function(e,t){return Math.min(e/10,t/10,8)},jt=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Dt=me({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Tt={pageRank:function(e){for(var t=Dt(e),n=t.dampingFactor,r=t.precision,i=t.iterations,o=t.weight,a=this._private.cy,s=this.byGroup(),u=s.nodes,l=s.edges,c=u.length,d=l.length,h=new Array(c*c),p=new Array(c),f=(1-n)/c,v=0;v<c;v++){for(var g=0;g<c;g++)h[v*c+g]=0;p[v]=0}for(var y=0;y<d;y++){var m=l[y],b=m.data("source"),x=m.data("target");if(b!==x){var w=u.indexOfId(b),E=u.indexOfId(x),k=o(m);h[E*c+w]+=k,p[w]+=k}}for(var P=1/c+f,C=0;C<c;C++)if(0===p[C])for(var S=0;S<c;S++)h[S*c+C]=P;else for(var _=0;_<c;_++){var j=_*c+C;h[j]=h[j]/p[C]+f}for(var D,T=new Array(c),B=new Array(c),O=0;O<c;O++)T[O]=1;for(var M=0;M<i;M++){for(var N=0;N<c;N++)B[N]=0;for(var I=0;I<c;I++)for(var L=0;L<c;L++)B[I]+=h[I*c+L]*T[L];Ke(B),D=T,T=B,B=D;for(var A=0,z=0;z<c;z++){var R=D[z]-T[z];A+=R*R}if(A<r)break}return{rank:function(e){return e=a.collection(e)[0],T[u.indexOf(e)]}}}},Bt=me({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Ot={degreeCentralityNormalized:function(e){e=Bt(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},o={},a=0,s=0,u=0;u<r;u++){var l=n[u],c=l.id();e.root=l;var d=this.degreeCentrality(e);a<d.indegree&&(a=d.indegree),s<d.outdegree&&(s=d.outdegree),i[c]=d.indegree,o[c]=d.outdegree}return{indegree:function(e){return 0==a?0:(b(e)&&(e=t.filter(e)),i[e.id()]/a)},outdegree:function(e){return 0===s?0:(b(e)&&(e=t.filter(e)),o[e.id()]/s)}}}for(var h={},p=0,f=0;f<r;f++){var v=n[f];e.root=v;var g=this.degreeCentrality(e);p<g.degree&&(p=g.degree),h[v.id()]=g.degree}return{degree:function(e){return 0===p?0:(b(e)&&(e=t.filter(e)),h[e.id()]/p)}}},degreeCentrality:function(e){e=Bt(e);var t=this.cy(),n=this,r=e.root,i=e.weight,o=e.directed,a=e.alpha;if(r=t.collection(r)[0],o){for(var s=r.connectedEdges(),u=s.filter((function(e){return e.target().same(r)&&n.has(e)})),l=s.filter((function(e){return e.source().same(r)&&n.has(e)})),c=u.length,d=l.length,h=0,p=0,f=0;f<u.length;f++)h+=i(u[f]);for(var v=0;v<l.length;v++)p+=i(l[v]);return{indegree:Math.pow(c,1-a)*Math.pow(h,a),outdegree:Math.pow(d,1-a)*Math.pow(p,a)}}for(var g=r.connectedEdges().intersection(n),y=g.length,m=0,b=0;b<g.length;b++)m+=i(g[b]);return{degree:Math.pow(y,1-a)*Math.pow(m,a)}}};Ot.dc=Ot.degreeCentrality,Ot.dcn=Ot.degreeCentralityNormalised=Ot.degreeCentralityNormalized;var Mt=me({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Nt={closenessCentralityNormalized:function(e){for(var t=Mt(e),n=t.harmonic,r=t.weight,i=t.directed,o=this.cy(),a={},s=0,u=this.nodes(),l=this.floydWarshall({weight:r,directed:i}),c=0;c<u.length;c++){for(var d=0,h=u[c],p=0;p<u.length;p++)if(c!==p){var f=l.distance(h,u[p]);d+=n?1/f:f}n||(d=1/d),s<d&&(s=d),a[h.id()]=d}return{closeness:function(e){return 0==s?0:(e=b(e)?o.filter(e)[0].id():e.id(),a[e]/s)}}},closenessCentrality:function(e){var t=Mt(e),n=t.root,r=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var a=this.dijkstra({root:n,weight:r,directed:i}),s=0,u=this.nodes(),l=0;l<u.length;l++){var c=u[l];if(!c.same(n)){var d=a.distanceTo(c);s+=o?1/d:d}}return o?s:1/s}};Nt.cc=Nt.closenessCentrality,Nt.ccn=Nt.closenessCentralityNormalised=Nt.closenessCentralityNormalized;var It=me({weight:null,directed:!1}),Lt={betweennessCentrality:function(e){for(var t=It(e),n=t.directed,r=t.weight,i=null!=r,a=this.cy(),s=this.nodes(),u={},l={},c=0,d=function(e,t){l[e]=t,t>c&&(c=t)},h=function(e){return l[e]},p=0;p<s.length;p++){var f=s[p],v=f.id();u[v]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),d(v,0)}for(var g=function(e){for(var t=s[e].id(),n=[],l={},c={},p={},f=new o((function(e,t){return p[e]-p[t]})),v=0;v<s.length;v++){var g=s[v].id();l[g]=[],c[g]=0,p[g]=1/0}for(c[t]=1,p[t]=0,f.push(t);!f.empty();){var y=f.pop();if(n.push(y),i)for(var m=0;m<u[y].length;m++){var b,x=u[y][m],w=a.getElementById(y);b=w.edgesTo(x).length>0?w.edgesTo(x)[0]:x.edgesTo(w)[0];var E=r(b);x=x.id(),p[x]>p[y]+E&&(p[x]=p[y]+E,f.nodes.indexOf(x)<0?f.push(x):f.updateItem(x),c[x]=0,l[x]=[]),p[x]==p[y]+E&&(c[x]=c[x]+c[y],l[x].push(y))}else for(var k=0;k<u[y].length;k++){var P=u[y][k].id();p[P]==1/0&&(f.push(P),p[P]=p[y]+1),p[P]==p[y]+1&&(c[P]=c[P]+c[y],l[P].push(y))}}for(var C={},S=0;S<s.length;S++)C[s[S].id()]=0;for(;n.length>0;){for(var _=n.pop(),j=0;j<l[_].length;j++){var D=l[_][j];C[D]=C[D]+c[D]/c[_]*(1+C[_])}_!=s[e].id()&&d(_,h(_)+C[_])}},y=0;y<s.length;y++)g(y);var m={betweenness:function(e){var t=a.collection(e).id();return h(t)},betweennessNormalized:function(e){if(0==c)return 0;var t=a.collection(e).id();return h(t)/c}};return m.betweennessNormalised=m.betweennessNormalized,m}};Lt.bc=Lt.betweennessCentrality;var At=me({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),zt=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Rt=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},Ft=function(e,t,n){for(var r=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)r[i*n+o]=0;for(var a=0;a<n;a++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+a]*t[a*n+s]}return r},Vt=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=Ft(e,r,t);return e},Zt=function(e,t,n){for(var r=new Array(t*t),i=0;i<t*t;i++)r[i]=Math.pow(e[i],n);return Rt(r,t),r},Yt=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*Math.pow(10,r))/Math.pow(10,r)!=Math.round(t[i]*Math.pow(10,r))/Math.pow(10,r))return!1;return!0},qt=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},Xt=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=function(e){return At(e)}(e),o={},a=0;a<t.length;a++)o[t[a].id()]=a;for(var s,u=t.length,l=u*u,c=new Array(l),d=0;d<l;d++)c[d]=0;for(var h=0;h<n.length;h++){var p=n[h],f=o[p.source().id()],v=o[p.target().id()],g=zt(p,i.attributes);c[f*u+v]+=g,c[v*u+f]+=g}!function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n}(c,u,i.multFactor),Rt(c,u);for(var y=!0,m=0;y&&m<i.maxIterations;)y=!1,s=Vt(c,u,i.expandFactor),c=Zt(s,u,i.inflateFactor),Yt(c,s,l,4)||(y=!0),m++;return function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&qt(e[t],e[n])&&e.splice(n,1);return e}(function(e,t,n,r){for(var i=[],o=0;o<t;o++){for(var a=[],s=0;s<t;s++)Math.round(1e3*e[o*t+s])/1e3>0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,u,t,r))},Wt={markovClustering:Xt,mcl:Xt},Ht=function(e){return e},Gt=function(e,t){return Math.abs(t-e)},Ut=function(e,t,n){return e+Gt(t,n)},Kt=function(e,t,n){return e+Math.pow(n-t,2)},Qt=function(e){return Math.sqrt(e)},$t=function(e,t,n){return Math.max(e,Gt(t,n))},Jt=function(e,t,n,r,i){for(var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Ht,a=r,s=0;s<e;s++)a=i(a,t(s),n(s));return o(a)},en={euclidean:function(e,t,n){return e>=2?Jt(e,t,n,0,Kt,Qt):Jt(e,t,n,0,Ut)},squaredEuclidean:function(e,t,n){return Jt(e,t,n,0,Kt)},manhattan:function(e,t,n){return Jt(e,t,n,0,Ut)},max:function(e,t,n){return Jt(e,t,n,-1/0,$t)}};function tn(e,t,n,r,i,o){var a;return a=x(e)?e:en[e]||en.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}en["squared-euclidean"]=en.squaredEuclidean,en.squaredeuclidean=en.squaredEuclidean;var nn=me({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),rn=function(e){return nn(e)},on=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)};return tn(e,r.length,o,(function(e){return r[e](t)}),n,t)},an=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,u=0;u<r;u++)i[u]=e.min(n[u]).value,o[u]=e.max(n[u]).value;for(var l=0;l<t;l++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(o[c]-i[c])+i[c];a[l]=s}return a},sn=function(e,t,n,r,i){for(var o=1/0,a=0,s=0;s<t.length;s++){var u=on(n,e,t[s],r,i);u<o&&(o=u,a=s)}return a},un=function(e,t,n){for(var r=[],i=null,o=0;o<t.length;o++)n[(i=t[o]).id()]===e&&r.push(i);return r},ln=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},cn=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},dn=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];cn(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},hn=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=on("manhattan",t[i],e,n,"kMedoids");return r},pn=function(e,t,n,r,i){for(var o,a,s=0;s<t.length;s++)for(var u=0;u<e.length;u++)r[s][u]=Math.pow(n[s][u],i.m);for(var l=0;l<e.length;l++)for(var c=0;c<i.attributes.length;c++){o=0,a=0;for(var d=0;d<t.length;d++)o+=r[d][l]*i.attributes[c](t[d]),a+=r[d][l];e[l][c]=o/a}},fn=function(e,t,n,r,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var a,s,u,l=2/(i.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){a=0;for(var h=0;h<n.length;h++)s=on(i.distance,r[d],n[c],i.attributes,"cmeans"),u=on(i.distance,r[d],n[h],i.attributes,"cmeans"),a+=Math.pow(s/u,l);e[d][c]=1/a}},vn=function(e){var t,n,r,i,o=this.cy(),a=this.nodes(),s=rn(e);r=new Array(a.length);for(var u=0;u<a.length;u++)r[u]=new Array(s.k);n=new Array(a.length);for(var l=0;l<a.length;l++)n[l]=new Array(s.k);for(var c=0;c<a.length;c++){for(var d=0,h=0;h<s.k;h++)n[c][h]=Math.random(),d+=n[c][h];for(var p=0;p<s.k;p++)n[c][p]=n[c][p]/d}t=new Array(s.k);for(var f=0;f<s.k;f++)t[f]=new Array(s.attributes.length);i=new Array(a.length);for(var v=0;v<a.length;v++)i[v]=new Array(s.k);for(var g=!0,y=0;g&&y<s.maxIterations;)g=!1,pn(t,a,n,i,s),fn(n,r,t,a,s),ln(n,r,s.sensitivityThreshold)||(g=!0),y++;return{clusters:function(e,t,n,r){for(var i,o,a=new Array(n.k),s=0;s<a.length;s++)a[s]=[];for(var u=0;u<t.length;u++){i=-1/0,o=-1;for(var l=0;l<t[0].length;l++)t[u][l]>i&&(i=t[u][l],o=l);a[o].push(e[u])}for(var c=0;c<a.length;c++)a[c]=r.collection(a[c]);return a}(a,n,s,o),degreeOfMembership:n}},gn={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),i=null,o=rn(e),s=new Array(o.k),u={};t=o.testMode?"number"==typeof o.testCentroids?an(r,o.k,o.attributes):"object"===a(o.testCentroids)?o.testCentroids:an(r,o.k,o.attributes):an(r,o.k,o.attributes);for(var l,c=!0,d=0;c&&d<o.maxIterations;){for(var h=0;h<r.length;h++)u[(i=r[h]).id()]=sn(i,t,o.distance,o.attributes,"kMeans");c=!1;for(var p=0;p<o.k;p++){var f=un(p,r,u);if(0!==f.length){for(var v=o.attributes.length,g=t[p],y=new Array(v),m=new Array(v),b=0;b<v;b++){m[b]=0;for(var x=0;x<f.length;x++)m[b]+=o.attributes[b](i=f[x]);y[b]=m[b]/f.length,l=o.sensitivityThreshold,Math.abs(g[b]-y[b])<=l||(c=!0)}t[p]=y,s[p]=n.collection(f)}}d++}return s},kMedoids:function(e){var t,n,r=this.cy(),i=this.nodes(),o=null,s=rn(e),u=new Array(s.k),l={},c=new Array(s.k);s.testMode?"number"==typeof s.testCentroids||(t="object"===a(s.testCentroids)?s.testCentroids:dn(i,s.k)):t=dn(i,s.k);for(var d=!0,h=0;d&&h<s.maxIterations;){for(var p=0;p<i.length;p++)l[(o=i[p]).id()]=sn(o,t,s.distance,s.attributes,"kMedoids");d=!1;for(var f=0;f<t.length;f++){var v=un(f,i,l);if(0!==v.length){c[f]=hn(t[f],v,s.attributes);for(var g=0;g<v.length;g++)(n=hn(v[g],v,s.attributes))<c[f]&&(c[f]=n,t[f]=v[g],d=!0);u[f]=r.collection(v)}}h++}return u},fuzzyCMeans:vn,fcm:vn},yn=me({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),mn={single:"min",complete:"max"},bn=function(e,t,n,r,i){for(var o,a=0,s=1/0,u=i.attributes,l=function(e,t){return tn(i.distance,u.length,(function(t){return u[t](e)}),(function(e){return u[e](t)}),e,t)},c=0;c<e.length;c++){var d=e[c].key,h=n[d][r[d]];h<s&&(a=d,s=h)}if("threshold"===i.mode&&s>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],v=t[r[a]];p="dendrogram"===i.mode?{left:f,right:v,key:f.key}:{value:f.value.concat(v.value),key:f.key},e[f.index]=p,e.splice(v.index,1),t[f.key]=p;for(var g=0;g<e.length;g++){var y=e[g];f.key===y.key?o=1/0:"min"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]>n[v.key][y.key]&&(o=n[v.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]<n[v.key][y.key]&&(o=n[v.key][y.key])):o="mean"===i.linkage?(n[f.key][y.key]*f.size+n[v.key][y.key]*v.size)/(f.size+v.size):"dendrogram"===i.mode?l(y.value,f.value):l(y.value[0],f.value[0]),n[f.key][y.key]=n[y.key][f.key]=o}for(var m=0;m<e.length;m++){var b=e[m].key;if(r[b]===f.key||r[b]===v.key){for(var x=b,w=0;w<e.length;w++){var E=e[w].key;n[b][E]<n[b][x]&&(x=E)}r[b]=x}e[m].index=m}return f.key=v.key=f.index=v.index=null,!0},xn=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},wn=function(e){for(var t=this.cy(),n=this.nodes(),r=function(e){var t=yn(e),n=mn[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=r.attributes,o=function(e,t){return tn(r.distance,i.length,(function(t){return i[t](e)}),(function(e){return i[e](t)}),e,t)},a=[],s=[],u=[],l=[],c=0;c<n.length;c++){var d={value:"dendrogram"===r.mode?n[c]:[n[c]],key:c,index:c};a[c]=d,l[c]=d,s[c]=[],u[c]=0}for(var h=0;h<a.length;h++)for(var p=0;p<=h;p++){var f;f="dendrogram"===r.mode?h===p?1/0:o(a[h].value,a[p].value):h===p?1/0:o(a[h].value[0],a[p].value[0]),s[h][p]=f,s[p][h]=f,f<s[h][u[h]]&&(u[h]=p)}for(var v,g=bn(a,l,s,u,r);g;)g=bn(a,l,s,u,r);return"dendrogram"===r.mode?(v=function e(t,n,r){if(!t)return[];var i=[],o=[],a=[];return 0===n?(t.left&&xn(t.left,i),t.right&&xn(t.right,o),a=i.concat(o),[r.collection(a)]):1===n?t.value?[r.collection(t.value)]:(t.left&&xn(t.left,i),t.right&&xn(t.right,o),[r.collection(i),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(i=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),i.concat(o))}(a[0],r.dendrogramDepth,t),r.addDendrogram&&function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),i=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+i}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return t.value?t.value.id():void 0}(a[0],t)):(v=new Array(a.length),a.forEach((function(e,n){e.key=e.index=null,v[n]=t.collection(e.value)}))),v},En={hierarchicalClustering:wn,hca:wn},kn=me({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Pn=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-tn(e,r.length,(function(e){return i(t,e)}),(function(e){return i(n,e)}),t,n)},Cn=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var o=-1,a=-1/0,s=0;s<n.length;s++){var u=n[s];t[i*e+u]>a&&(o=u,a=t[i*e+u])}o>0&&r.push(o)}for(var l=0;l<n.length;l++)r[n[l]]=n[l];return r},Sn=function(e){for(var t,n,r,i,o,a,s=this.cy(),u=this.nodes(),l=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||de("Damping must range on [0.5, 1). Got: ".concat(t));var r=["median","mean","min","max"];return r.some((function(e){return e===n}))||k(n)||de("Preference must be one of [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"] or a number. Got: ").concat(n)),kn(e)}(e),c={},d=0;d<u.length;d++)c[u[d].id()]=d;n=(t=u.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var p=0;p<t;p++)for(var f=0;f<t;f++)p!==f&&(r[p*t+f]=Pn(l.distance,u[p],u[f],l.attributes));i=function(e,t){return"median"===t?function(e){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=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var a=0,s=e.length-1;s>=0;s--){var u=e[s];o?isFinite(u)||(e[s]=-1/0,a++):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+a]:(e[c-1+a]+e[c+a])/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,o=t;o<n;o++){var a=e[o];isFinite(a)&&(r+=a,i++)}return r/i}(e):"min"===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=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.min(o,r))}return r}(e):"max"===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=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(r=Math.max(o,r))}return r}(e):t}(r,l.preference);for(var v=0;v<t;v++)r[v*t+v]=i;o=new Array(n);for(var g=0;g<n;g++)o[g]=0;a=new Array(n);for(var y=0;y<n;y++)a[y]=0;for(var m=new Array(t),b=new Array(t),x=new Array(t),w=0;w<t;w++)m[w]=0,b[w]=0,x[w]=0;for(var E,P=new Array(t*l.minIterations),C=0;C<P.length;C++)P[C]=0;for(E=0;E<l.maxIterations;E++){for(var S=0;S<t;S++){for(var _=-1/0,j=-1/0,D=-1,T=0,B=0;B<t;B++)m[B]=o[S*t+B],(T=a[S*t+B]+r[S*t+B])>=_?(j=_,_=T,D=B):T>j&&(j=T);for(var O=0;O<t;O++)o[S*t+O]=(1-l.damping)*(r[S*t+O]-_)+l.damping*m[O];o[S*t+D]=(1-l.damping)*(r[S*t+D]-j)+l.damping*m[D]}for(var M=0;M<t;M++){for(var N=0,I=0;I<t;I++)m[I]=a[I*t+M],b[I]=Math.max(0,o[I*t+M]),N+=b[I];N-=b[M],b[M]=o[M*t+M],N+=b[M];for(var L=0;L<t;L++)a[L*t+M]=(1-l.damping)*Math.min(0,N-b[L])+l.damping*m[L];a[M*t+M]=(1-l.damping)*(N-b[M])+l.damping*m[M]}for(var A=0,z=0;z<t;z++){var R=a[z*t+z]+o[z*t+z]>0?1:0;P[E%l.minIterations*t+z]=R,A+=R}if(A>0&&(E>=l.minIterations-1||E==l.maxIterations-1)){for(var F=0,V=0;V<t;V++){x[V]=0;for(var Z=0;Z<l.minIterations;Z++)x[V]+=P[Z*t+V];0!==x[V]&&x[V]!==l.minIterations||F++}if(F===t)break}}for(var Y=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r}(t,o,a),q=function(e,t,n){for(var r=Cn(e,t,n),i=0;i<n.length;i++){for(var o=[],a=0;a<r.length;a++)r[a]===n[i]&&o.push(a);for(var s=-1,u=-1/0,l=0;l<o.length;l++){for(var c=0,d=0;d<o.length;d++)c+=t[o[d]*e+o[l]];c>u&&(s=l,u=c)}n[i]=o[s]}return Cn(e,t,n)}(t,r,Y),X={},W=0;W<Y.length;W++)X[Y[W]]=[];for(var H=0;H<u.length;H++){var G=q[c[u[H].id()]];null!=G&&X[G].push(u[H])}for(var U=new Array(Y.length),K=0;K<Y.length;K++)U[K]=s.collection(X[Y[K]]);return U},_n={affinityPropagation:Sn,ap:Sn},jn=me({root:void 0,directed:!1}),Dn=function(){var e=this,t={},n=0,r=0,i=[],o=[],a={};e.forEach((function(s){if(s.isNode()){var u=s.id();u in t||(r=0,function s(u,l,c){u===c&&(r+=1),t[l]={id:n,low:n++,cutVertex:!1};var d,h,p,f,v=e.getElementById(l).connectedEdges().intersection(e);0===v.size()?i.push(e.spawn(e.getElementById(l))):v.forEach((function(n){d=n.source().id(),h=n.target().id(),(p=d===l?h:d)!==c&&(f=n.id(),a[f]||(a[f]=!0,o.push({x:l,y:p,edge:n})),p in t?t[l].low=Math.min(t[l].low,t[p].id):(s(u,p,l),t[l].low=Math.min(t[l].low,t[p].low),t[l].id<=t[p].low&&(t[l].cutVertex=!0,function(n,r){for(var a=o.length-1,s=[],u=e.spawn();o[a].x!=n||o[a].y!=r;)s.push(o.pop().edge),a--;s.push(o.pop().edge),s.forEach((function(n){var r=n.connectedNodes().intersection(e);u.merge(n),r.forEach((function(n){var r=n.id(),i=n.connectedEdges().intersection(e);u.merge(n),u.merge(t[r].cutVertex?i.filter((function(e){return e.isLoop()})):i)}))})),i.push(u)}(l,p))))}))}(u,u),t[u].cutVertex=r>1)}}));var s=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(s),components:i}},Tn=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e);return e.forEach((function(a){if(a.isNode()){var s=a.id();s in t||function a(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||a(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),o=o.difference(d)}}(s)}})),{cut:o,components:r}},Bn={};[je,Te,Be,Me,Ie,Ae,Ve,Tt,Ot,Nt,Lt,Wt,gn,En,_n,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=jn(e),a=o.root,s=o.directed,u=this,l=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};u.forEach(s?function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?l=!0:n=t:1==s?r?l=!0:r=t:(s>1||a>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()]}: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 p=function(e){for(var t,n,r,i=e,o=[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),o.unshift(t),o.unshift(i);return o},f=[],v=[];for(v=p(i);1!=v.length;)0==c[v[0]].length?(f.unshift(u.getElementById(v.shift())),f.unshift(u.getElementById(v.shift()))):v=p(v.shift()).concat(v);for(var g in f.unshift(u.getElementById(v.shift())),c)if(c[g].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:Dn,htbc:Dn,htb:Dn,hopcroftTarjanBiconnectedComponents:Dn},{tarjanStronglyConnected:Tn,tsc:Tn,tscc:Tn,tarjanStronglyConnectedComponents:Tn}].forEach((function(e){R(Bn,e)}));var On=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))};On.prototype={fulfill:function(e){return Mn(this,1,"fulfillValue",e)},reject:function(e){return Mn(this,2,"rejectReason",e)},then:function(e,t){var n=new On;return this.onFulfilled.push(Ln(e,n,"fulfill")),this.onRejected.push(Ln(t,n,"reject")),Nn(this),n.proxy}};var Mn=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,Nn(e)),e},Nn=function(e){1===e.state?In(e,"onFulfilled",e.fulfillValue):2===e.state&&In(e,"onRejected",e.rejectReason)},In=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Ln=function(e,t,n){return function(r){if("function"!=typeof e)t[n].call(t,r);else{var i;try{i=e(r)}catch(o){return void t.reject(o)}An(t,i)}}},An=function e(t,n){if(t!==n&&t.proxy!==n){var r;if("object"===a(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(o){return void t.reject(o)}if("function"!=typeof r)t.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?t.reject(new TypeError("circular thenable chain")):e(t,r))}),(function(e){i||(i=!0,t.reject(e))}))}catch(o){i||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};On.all=function(e){return new On((function(t,n){for(var r=new Array(e.length),i=0,o=function(n,o){r[n]=o,++i===e.length&&t(r)},a=0;a<e.length;a++)!function(t){var r=e[t];null!=r&&null!=r.then?r.then((function(e){o(t,e)}),(function(e){n(e)})):o(t,r)}(a)}))},On.resolve=function(e){return new On((function(t,n){t(e)}))},On.reject=function(e){return new On((function(t,n){n(e)}))};var zn="undefined"!=typeof Promise?Promise:On,Rn=function(e,t,n){var r=j(e),i=!r,o=this._private=R({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&x(o.complete)&&o.completes.push(o.complete),i){var a=e.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(r){var s=e.pan();o.startPan={x:s.x,y:s.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},Fn=Rn.prototype;R(Fn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t=e.target._private.animation;(e.queue?t.queue:t.current).push(this),C(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];null!=r&&(e[t]=e[n],e[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],o=i.name,a=e.startStyle[o];e.startStyle[o]=i,e.style[r]=a}return t&&this.play(),this},promise:function(e){var t,n=this._private;if("frame"===e)t=n.frames;else t=n.completes;return new zn((function(e,n){t.push((function(){e()}))}))}}),Fn.complete=Fn.completed,Fn.run=Fn.play,Fn.running=Fn.playing;var Vn={};[{animated:function(){return function(){var e=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return!1;var t=e[0];return t?t._private.animation.current.length>0: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;t<e.length;t++)e[t]._private.animation.queue=[];return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=void 0!==this.length,r=n?this:[this],i=this._private.cy||this,o=!n,a=!o;if(!i.styleEnabled())return this;var s=i.style();if(e=R({},e,t),0===Object.keys(e).length)return new Rn(r[0],e);switch(void 0===e.duration&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(a&&(e.style=s.getPropsList(e.style||e.css),e.css=void 0),a&&null!=e.renderedPosition){var u=e.renderedPosition,l=i.pan(),c=i.zoom();e.position=Ye(u,c,l)}if(o&&null!=e.panBy){var d=e.panBy,h=i.pan();e.pan={x:h.x+d.x,y:h.y+d.y}}var p=e.center||e.centre;if(o&&null!=p){var f=i.getCenterPan(p.eles,e.zoom);null!=f&&(e.pan=f)}if(o&&null!=e.fit){var v=e.fit,g=i.getFitViewport(v.eles||v.boundingBox,v.padding);null!=g&&(e.pan=g.pan,e.zoom=g.zoom)}if(o&&E(e.zoom)){var y=i.getZoomedViewport(e.zoom);null!=y?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new Rn(r[0],e)}},animate:function(){return function(e,t){var n=void 0!==this.length?this:[this];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=R({},e,t));for(var r=0;r<n.length;r++){var i=n[r],o=i.animated()&&(void 0===e.queue||e.queue);i.animation(e,o?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=void 0!==this.length?this:[this],r=this._private.cy||this;if(!r.styleEnabled())return this;for(var i=0;i<n.length;i++){for(var o=n[i]._private,a=o.animation.current,s=0;s<a.length;s++)t&&(a[s]._private.duration=0);e&&(o.animation.queue=[]),t||(o.animation.current=[])}return r.notify("draw"),this}}},{data:function(e){return e=R({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=void 0!==this.length,o=i?this:[this],a=i?this[0]:this;if(b(t)){var s;if(r.allowGetting&&void 0===n)return a&&(r.beforeGet(a),s=a._private[r.field][t]),s;if(r.allowSetting&&void 0!==n&&!r.immutableKeys[t]){var u=c({},t,n);r.beforeSet(this,u);for(var l=0,d=o.length;l<d;l++){var h=o[l];r.canSet(h)&&(h._private[r.field][t]=n)}r.updateStyle&&this.updateStyle(),r.onSet(this),r.settingTriggersEvent&&this[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&E(t)){var p,f,v=t,g=Object.keys(v);r.beforeSet(this,v);for(var y=0;y<g.length;y++)if(f=v[p=g[y]],!r.immutableKeys[p])for(var m=0;m<o.length;m++){var w=o[m];r.canSet(w)&&(w._private[r.field][p]=f)}r.updateStyle&&this.updateStyle(),r.onSet(this),r.settingTriggersEvent&&this[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&x(t))this.on(r.bindingEvent,t);else if(r.allowGetting&&void 0===t){var k;return a&&(r.beforeGet(a),k=a._private[r.field]),k}return this}},removeData:function(e){return e=R({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=void 0!==this.length?this:[this];if(b(t)){for(var i=t.split(/\s+/),o=i.length,a=0;a<o;a++){var s=i[a];if(!T(s)&&!n.immutableKeys[s])for(var u=0,l=r.length;u<l;u++)r[u]._private[n.field][s]=void 0}n.triggerEvent&&this[n.triggerFnName](n.event)}else if(void 0===t){for(var c=0,d=r.length;c<d;c++)for(var h=r[c]._private[n.field],p=Object.keys(h),f=0;f<p.length;f++){var v=p[f];!n.immutableKeys[v]&&(h[v]=void 0)}n.triggerEvent&&this[n.triggerFnName](n.event)}return this}}},{eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new zn((function(e,t){var i=r.concat([function(t){n.off.apply(n,o),e(t)}]),o=i.concat([]);n.on.apply(n,i)}))}}}].forEach((function(e){R(Vn,e)}));var Zn={animate:Vn.animate(),animation:Vn.animation(),animated:Vn.animated(),clearQueue:Vn.clearQueue(),delay:Vn.delay(),delayAnimation:Vn.delayAnimation(),stop:Vn.stop()},Yn={classes:function(e){if(void 0===e){var t=[];return this[0]._private.classes.forEach((function(e){return t.push(e)})),t}w(e)||(e=(e||"").match(/\S+/g)||[]);for(var n=[],r=new Ce(e),i=0;i<this.length;i++){for(var o=this[i],a=o._private,s=a.classes,u=!1,l=0;l<e.length;l++)if(!s.has(e[l])){u=!0;break}u||(u=s.size!==e.length),u&&(a.classes=r,n.push(o))}return n.length>0&&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,o=this.length;i<o;i++)for(var a=this[i],s=a._private.classes,u=!1,l=0;l<e.length;l++){var c=e[l],d=s.has(c),h=!1;t||n&&!d?(s.add(c),h=!0):(!t||n&&d)&&(s.delete(c),h=!0),!u&&h&&(r.push(a),u=!0)}return r.length>0&&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}};Yn.className=Yn.classNames=Yn.classes;var qn={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:A,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};qn.variable="(?:[\\w-]|(?:\\\\"+qn.metaChar+"))+",qn.value=qn.string+"|"+qn.number,qn.className=qn.variable,qn.id=qn.variable,function(){var e,t,n;for(e=qn.comparatorOp.split("|"),n=0;n<e.length;n++)qn.comparatorOp+="|@"+(t=e[n]);for(e=qn.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||"="!==t&&(qn.comparatorOp+="|\\!"+t)}();var Xn=[{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*z(e,t)}(e.selector,t.selector)})),Wn=function(){for(var e,t={},n=0;n<Xn.length;n++)t[(e=Xn[n]).selector]=e.matches;return t}(),Hn="("+Xn.map((function(e){return e.selector})).join("|")+")",Gn=function(e){return e.replace(new RegExp("\\\\("+qn.metaChar+")","g"),(function(e,t){return t}))},Un=function(e,t,n){e[e.length-1]=n},Kn=[{name:"group",query:!0,regex:"("+qn.group+")",populate:function(e,t,n){var r=d(n,1)[0];t.checks.push({type:0,value:"*"===r?r:r+"s"})}},{name:"state",query:!0,regex:Hn,populate:function(e,t,n){var r=d(n,1);t.checks.push({type:7,value:r[0]})}},{name:"id",query:!0,regex:"\\#("+qn.id+")",populate:function(e,t,n){var r=d(n,1);t.checks.push({type:8,value:Gn(r[0])})}},{name:"className",query:!0,regex:"\\.("+qn.className+")",populate:function(e,t,n){var r=d(n,1);t.checks.push({type:9,value:Gn(r[0])})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+qn.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,1);t.checks.push({type:4,field:Gn(r[0])})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+qn.variable+")\\s*("+qn.comparatorOp+")\\s*("+qn.value+")\\s*\\]",populate:function(e,t,n){var r=d(n,3),i=r[0],o=r[1],a=r[2];a=null!=new RegExp("^"+qn.string+"$").exec(a)?a.substring(1,a.length-1):parseFloat(a),t.checks.push({type:3,field:Gn(i),operator:o,value:a})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+qn.boolOp+")\\s*("+qn.variable+")\\s*\\]",populate:function(e,t,n){var r=d(n,2),i=r[0];t.checks.push({type:5,field:Gn(r[1]),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+qn.meta+")\\s*("+qn.comparatorOp+")\\s*("+qn.number+")\\s*\\]\\]",populate:function(e,t,n){var r=d(n,3),i=r[1],o=r[2];t.checks.push({type:6,field:Gn(r[0]),operator:i,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:qn.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,o=e[e.length-1];return null!=n&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:qn.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:11,source:t,target:r}),Un(e,0,n),e.edgeCount++,r}var i={checks:[]},o={checks:[]};return i.checks.push({type:12,source:t,target:o}),Un(e,0,i),e.edgeCount++,o}},{name:"undirectedEdge",separator:!0,regex:qn.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:10,nodes:[t,r]}),Un(e,0,n),e.edgeCount++,r}var i={checks:[]},o={checks:[]};return i.checks.push({type:14,node:t,neighbor:o}),Un(e,0,i),o}},{name:"child",separator:!0,regex:qn.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:15,parent:e[e.length-1],child:r}),Un(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var i={checks:[]},o={checks:[]},a={checks:[]},s={checks:[]},u={checks:[]};return i.checks.push({type:19,left:e[e.length-1],right:o,subject:a}),a.checks=t.checks,t.checks=[{type:20}],u.checks.push({type:20}),o.checks.push({type:17,parent:u,child:s}),Un(e,0,i),e.currentSubject=a,e.compoundCount++,s}var l={checks:[]},c={checks:[]},d=[{type:17,parent:l,child:c}];return l.checks=t.checks,t.checks=d,e.compoundCount++,c}},{name:"descendant",separator:!0,regex:qn.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},r={checks:[]};return n.checks.push({type:16,ancestor:e[e.length-1],descendant:r}),Un(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var i={checks:[]},o={checks:[]},a={checks:[]},s={checks:[]},u={checks:[]};return i.checks.push({type:19,left:e[e.length-1],right:o,subject:a}),a.checks=t.checks,t.checks=[{type:20}],u.checks.push({type:20}),o.checks.push({type:18,ancestor:u,descendant:s}),Un(e,0,i),e.currentSubject=a,e.compoundCount++,s}var l={checks:[]},c={checks:[]},d=[{type:18,ancestor:l,descendant:c}];return l.checks=t.checks,t.checks=d,e.compoundCount++,c}},{name:"subject",modifier:!0,regex:qn.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return pe("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=null==n?null:n.type;11===r?n.type=13:10===r&&(n.type=14,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Kn.forEach((function(e){return e.regexObj=new RegExp("^"+e.regex)}));var Qn=function(e){for(var t,n,r,i=0;i<Kn.length;i++){var o=Kn[i],a=o.name,s=e.match(o.regexObj);if(null!=s){n=s,t=o,r=a,e=e.substring(s[0].length);break}}return{expr:t,match:n,name:r,remaining:e}},$n={parse:function(e){var t=this.inputText=e,n=this[0]={checks:[]};for(this.length=1,t=function(e){var t=e.match(/^\s+/);return t&&(e=e.substring(t[0].length)),e}(t);;){var r=Qn(t);if(null==r.expr)return pe("The selector `"+e+"`is invalid"),!1;var i=r.match.slice(1),o=r.expr.populate(this,n,i);if(!1===o)return!1;if(null!=o&&(n=o),(t=r.remaining).match(/^\s*$/))break}var a=this[this.length-1];null!=this.currentSubject&&(a.subject=this.currentSubject),a.edgeCount=this.edgeCount,a.compoundCount=this.compoundCount;for(var s=0;s<this.length;s++){var u=this[s];if(u.compoundCount>0&&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(i,o){return i.checks.reduce((function(a,s,u){return a+(o===i&&0===u?"$":"")+function(i,o){var a=i.value;switch(i.type){case 0:var s=e(a);return s.substring(0,s.length-1);case 3:return"["+i.field+n(e(i.operator))+t(a)+"]";case 5:var u=i.field;return"["+e(i.operator)+u+"]";case 4:return"["+i.field+"]";case 6:return"[["+i.field+n(e(i.operator))+t(a)+"]]";case 7:return a;case 8:return"#"+a;case 9:return"."+a;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var l=r(i.left,o),c=r(i.subject,o),d=r(i.right,o);return l+(l.length>0?" ":"")+c+d;case 20:return""}}(s,o)}),"")},i="",o=0;o<this.length;o++){var a=this[o];i+=r(a,a.subject),this.length>1&&o<this.length-1&&(i+=", ")}return this.toStringCache=i,i}},Jn=function(e,t,n){var r,i,o,a=b(e),s=k(e),u=b(n),l=!1,c=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),l=!0),(a||u||l)&&(i=a||s?""+e:"",o=""+n),l&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e<n;break;case"<=":d=!0,r=e<=n;break;default:r=!1}return!c||null==e&&d||(r=!r),r},er=function(e,t){return e.data(t)},tr=[],nr=function(e,t){return e.checks.every((function(e){return tr[e.type](e,t)}))};tr[0]=function(e,t){var n=e.value;return"*"===n||n===t.group()},tr[7]=function(e,t){return function(e,t){return Wn[e](t)}(e.value,t)},tr[8]=function(e,t){var n=e.value;return t.id()===n},tr[9]=function(e,t){return t.hasClass(e.value)},tr[6]=function(e,t){var n=e.operator,r=e.value;return Jn(function(e,t){return e[t]()}(t,e.field),n,r)},tr[3]=function(e,t){var n=e.operator,r=e.value;return Jn(er(t,e.field),n,r)},tr[5]=function(e,t){var n=e.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(er(t,e.field),n)},tr[4]=function(e,t){return void 0!==er(t,e.field)},tr[10]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),o=t.target();return nr(n,i)&&nr(r,o)||nr(r,i)&&nr(n,o)},tr[14]=function(e,t){return nr(e.node,t)&&t.neighborhood().some((function(t){return t.isNode()&&nr(e.neighbor,t)}))},tr[11]=function(e,t){return nr(e.source,t.source())&&nr(e.target,t.target())},tr[12]=function(e,t){return nr(e.source,t)&&t.outgoers().some((function(t){return t.isNode()&&nr(e.target,t)}))},tr[13]=function(e,t){return nr(e.target,t)&&t.incomers().some((function(t){return t.isNode()&&nr(e.source,t)}))},tr[15]=function(e,t){return nr(e.child,t)&&nr(e.parent,t.parent())},tr[17]=function(e,t){return nr(e.parent,t)&&t.children().some((function(t){return nr(e.child,t)}))},tr[16]=function(e,t){return nr(e.descendant,t)&&t.ancestors().some((function(t){return nr(e.ancestor,t)}))},tr[18]=function(e,t){return nr(e.ancestor,t)&&t.descendants().some((function(t){return nr(e.descendant,t)}))},tr[19]=function(e,t){return nr(e.subject,t)&&nr(e.left,t)&&nr(e.right,t)},tr[20]=function(){return!0},tr[1]=function(e,t){return e.value.has(t)},tr[2]=function(e,t){return(0,e.value)(t)};var rr=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||b(e)&&e.match(/^\s*$/)||(C(e)?this.addQuery({checks:[{type:1,value:e.collection()}]}):x(e)?this.addQuery({checks:[{type:2,value:e}]}):b(e)?this.parse(e)||(this.invalid=!0):de("A selector must be created from a string; found "))},ir=rr.prototype;[$n,{matches:function(e){for(var t=0;t<this.length;t++)if(nr(this[t],e))return!0;return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&8===t[0].checks[0].type)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++)if(nr(t[n],e))return!0;return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}}].forEach((function(e){return R(ir,e)})),ir.text=function(){return this.inputText},ir.size=function(){return this.length},ir.eq=function(e){return this[e]},ir.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},ir.addQuery=function(e){this[this.length++]=e},ir.selector=ir.toString;var or={allAre:function(e){var t=new rr(e);return this.every((function(e){return t.matches(e)}))},is:function(e){var t=new rr(e);return this.some((function(e){return t.matches(e)}))},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every((function(t){return e.hasElementWithId(t.id())})))},anySame:function(e){return e=this.cy().collection(e),this.some((function(t){return e.hasElementWithId(t.id())}))},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every((function(e){return t.hasElementWithId(e.id())}))},contains:function(e){e=this.cy().collection(e);var t=this;return e.every((function(e){return t.hasElementWithId(e.id())}))}};or.allAreNeighbours=or.allAreNeighbors,or.has=or.contains,or.equal=or.equals=or.same;var ar,sr,ur=function(e,t){return function(n,r,i,o){var a,s=n;if(null==s?a="":C(s)&&1===s.length&&(a=s.id()),1===this.length&&a){var u=this[0]._private,l=u.traversalCache=u.traversalCache||{},c=l[t]=l[t]||[],d=ee(a);return c[d]||(c[d]=e.call(this,n,r,i,o))}return e.call(this,n,r,i,o)}},lr={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++)t.push(n[r]);n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t=(t=t||r).intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter((function(e){return e.isOrphan()})).filter(e)},nonorphans:function(e){return this.stdFilter((function(e){return e.isChild()})).filter(e)},children:ur((function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)}),"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function e(n){for(var r=0;r<n.length;r++){var i=n[r];t.push(i),i.children().nonempty()&&e(i.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function cr(e,t,n,r){for(var i=[],o=new Ce,a=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var u=e[s];n?i.push(u):a&&r(i,o,u)}for(;i.length>0;){var l=i.shift();t(l),o.add(l.id()),a&&r(i,o,l)}return e}function dr(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var o=r[i];t.has(o.id())||e.push(o)}}function hr(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function pr(e,t,n){hr(e,t,n),dr(e,t,n)}lr.forEachDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return cr(this,e,t,dr)},lr.forEachUp=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return cr(this,e,t,hr)},lr.forEachUpAndDown=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return cr(this,e,t,pr)},lr.ancestors=lr.parents,(ar=sr={data:Vn.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:Vn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Vn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Vn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Vn.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Vn.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=ar.data,ar.removeAttr=ar.removeData;var fr,vr,gr=sr,yr={};function mr(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,o=0;o<i.length;o++){var a=i[o];!t&&a.isLoop()||(n+=e(r,a))}return n}}}function br(e,t){return function(n){for(var r,i=this.nodes(),o=0;o<i.length;o++){var a=i[o][e](n);void 0===a||void 0!==r&&!t(a,r)||(r=a)}return r}}R(yr,{degree:mr((function(e,t){return t.source().same(t.target())?2:1})),indegree:mr((function(e,t){return t.target().same(e)?1:0})),outdegree:mr((function(e,t){return t.source().same(e)?1:0}))}),R(yr,{minDegree:br("degree",(function(e,t){return e<t})),maxDegree:br("degree",(function(e,t){return e>t})),minIndegree:br("indegree",(function(e,t){return e<t})),maxIndegree:br("indegree",(function(e,t){return e>t})),minOutdegree:br("outdegree",(function(e,t){return e<t})),maxOutdegree:br("outdegree",(function(e,t){return e>t}))}),R(yr,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var xr=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var o=i._private.position,a={x:null!=t.x?t.x-o.x:0,y:null!=t.y?t.y-o.y:0};!i.isParent()||0===a.x&&0===a.y||i.children().shift(a,n),i.dirtyBoundingBoxCache()}}},wr={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){xr(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};(fr=vr={position:Vn.data(wr),silentPosition:Vn.data(R({},wr,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){xr(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(E(e))t?this.silentPosition(e):this.position(e);else if(x(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var o,a=this[i];(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(E(e)?(r={x:k(e.x)?e.x:0,y:k(e.y)?e.y:0},n=t):b(e)&&k(t)&&((r={x:0,y:0})[e]=t),null!=r){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var a=this[o],s=a.position(),u={x:s.x+r.x,y:s.y+r.y};n?a.silentPosition(u):a.position(u)}i.endBatch()}return this},silentShift:function(e,t){return E(e)?this.shift(e,!0):b(e)&&k(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),o=r.pan(),a=E(e)?e:void 0,s=void 0!==a||void 0!==t&&b(e);if(n&&n.isNode()){if(!s){var u=n.position();return a=Ze(u,i,o),void 0===e?a:a[e]}for(var l=0;l<this.length;l++){var c=this[l];void 0!==t?c.position(e,(t-o[e])/i):void 0!==a&&c.position(Ye(a,i,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=E(e)?e:void 0,o=void 0!==i||void 0!==t&&b(e),a=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),u=a?n.parent():null,l=u&&u.length>0;l&&(u=u[0]);var c=l?u.position():{x:0,y:0};return i={x:s.x-c.x,y:s.y-c.y},void 0===e?i:i[e]}for(var d=0;d<this.length;d++){var h=this[d],p=a?h.parent():null,f=p&&p.length>0;f&&(p=p[0]);var v=f?p.position():{x:0,y:0};void 0!==t?h.position(e,t+v[e]):void 0!==i&&h.position({x:i.x+v.x,y:i.y+v.y})}}else if(!o)return;return this}}).modelPosition=fr.point=fr.position,fr.modelPositions=fr.points=fr.positions,fr.renderedPoint=fr.renderedPosition,fr.relativePoint=fr.relativePosition;var Er,kr,Pr=vr;Er=kr={},kr.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,u=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:u,w:a-o,h:u-s}},kr.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},kr.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")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.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-o.w,s,u),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,l,c),v=f.biasDiff,g=f.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}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-v+o.y1+o.y2+g)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;r<this.length;r++){var i=this[r],o=i._private;o.compoundBoundsClean&&!e||(n(i),t.batching()||(o.compoundBoundsClean=!0))}return this};var Cr=function(e){return e===1/0||e===-1/0?0:e},Sr=function(e,t,n,r,i){r-t!=0&&i-n!=0&&null!=t&&null!=n&&null!=r&&null!=i&&(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},_r=function(e,t){return null==t?e:Sr(e,t.x1,t.y1,t.x2,t.y2)},jr=function(e,t,n){return we(e,t,n)},Dr=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var u=o.arrowBounds=o.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,nt(l,1),Sr(e,l.x1,l.y1,l.x2,l.y2)}}},Tr=function(e,t,n){if(!t.cy().headless()){var r,i=t._private,o=i.rstyle;if(t.pstyle((r=n?n+"-":"")+"label").strValue){var a,s,u,l,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=jr(o,"labelWidth",n),p=jr(o,"labelHeight",n),f=jr(o,"labelX",n),v=jr(o,"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,E=t.pstyle("text-background-padding").pfValue,k=p,P=h,C=P/2,S=k/2;if(m)a=f-C,s=f+C,u=v-S,l=v+S;else{switch(c.value){case"left":a=f-P,s=f;break;case"center":a=f-C,s=f+C;break;case"right":a=f,s=f+P}switch(d.value){case"top":u=v-k,l=v;break;case"center":u=v-S,l=v+S;break;case"bottom":u=v,l=v+k}}a+=g-Math.max(x,w)-E-2,s+=g+Math.max(x,w)+E+2,u+=y-Math.max(x,w)-E-2,l+=y+Math.max(x,w)+E+2;var _=n||"main",j=i.labelBounds,D=j[_]=j[_]||{};D.x1=a,D.y1=u,D.x2=s,D.y2=l,D.w=s-a,D.h=l-u;var T=m&&"autorotate"===b.strValue;if(T||null!=b.pfValue&&0!==b.pfValue){var B=T?jr(i.rstyle,"labelAngle",n):b.pfValue,O=Math.cos(B),M=Math.sin(B),N=(a+s)/2,I=(u+l)/2;if(!m){switch(c.value){case"left":N=s;break;case"right":N=a}switch(d.value){case"top":I=l;break;case"bottom":I=u}}var L=function(e,t){return{x:(e-=N)*O-(t-=I)*M+N,y:e*M+t*O+I}},A=L(a,u),z=L(a,l),R=L(s,u),F=L(s,l);a=Math.min(A.x,z.x,R.x,F.x),s=Math.max(A.x,z.x,R.x,F.x),u=Math.min(A.y,z.y,R.y,F.y),l=Math.max(A.y,z.y,R.y,F.y)}var V=_+"Rot",Z=j[V]=j[V]||{};Z.x1=a,Z.y1=u,Z.x2=s,Z.y2=l,Z.w=s-a,Z.h=l-u,Sr(e,a,u,s,l),Sr(i.labelBounds.all,a,u,s,l)}return e}},Br=function(e){var t=0,n=function(e){return(e?1:0)<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),(r+=n(e.includeTargetLabels))+n(e.includeOverlays)},Or=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(e){return Math.round(e)};return function(e,t){var n={value:0,done:!1},r=0,i=e.length;return U({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},void 0)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},Mr=function(e,t){var n,r=e._private,i=e.isEdge(),o=(null==t?Ir:Br(t))===Ir,a=Or(e),s=r.bbCachePosKey===a,u=t.useCache&&s,l=function(e){return null==e._private.bbCache||e._private.styleDirty};if(!u||l(e)||i&&l(e.source())||l(e.target())?(s||e.recalculateRenderedStyle(u),n=function(e,t){var n,r,i,o,a,s,u,l=e._private.cy,c=l.styleEnabled(),d=l.headless(),h=et(),p=e._private,f=e.isNode(),v=e.isEdge(),g=p.rstyle,y=f&&c?e.pstyle("bounds-expansion").pfValue:[0],m=function(e){return"none"!==e.pstyle("display").value},b=!c||m(e)&&(!v||m(e.source())&&m(e.target()));if(b){var x=0;c&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(x=e.pstyle("overlay-padding").value);var w=0;if(c&&(w=e.pstyle("width").pfValue/2),f&&t.includeNodes){var E=e.position();a=E.x,s=E.y;var k=e.outerWidth()/2,P=e.outerHeight()/2;Sr(h,n=a-k,i=s-P,r=a+k,o=s+P)}else if(v&&t.includeEdges)if(c&&!d){var C=e.pstyle("curve-style").strValue;if(n=Math.min(g.srcX,g.midX,g.tgtX),r=Math.max(g.srcX,g.midX,g.tgtX),i=Math.min(g.srcY,g.midY,g.tgtY),o=Math.max(g.srcY,g.midY,g.tgtY),Sr(h,n-=w,i-=w,r+=w,o+=w),"haystack"===C){var S=g.haystackPts;if(S&&2===S.length){if((n=S[0].x)>(r=S[1].x)){var _=n;n=r,r=_}if((i=S[0].y)>(o=S[1].y)){var j=i;i=o,o=j}Sr(h,n-w,i-w,r+w,o+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 T=0;T<D.length;T++){var B=D[T];Sr(h,n=B.x-w,i=B.y-w,r=B.x+w,o=B.y+w)}}}else{var O=e.source().position(),M=e.target().position();if((n=O.x)>(r=M.x)){var N=n;n=r,r=N}if((i=O.y)>(o=M.y)){var I=i;i=o,o=I}Sr(h,n-=w,i-=w,r+=w,o+=w)}if(c&&t.includeEdges&&v&&(Dr(h,e,"mid-source"),Dr(h,e,"mid-target"),Dr(h,e,"source"),Dr(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var L=e.pstyle("ghost-offset-x").pfValue,A=e.pstyle("ghost-offset-y").pfValue;Sr(h,h.x1+L,h.y1+A,h.x2+L,h.y2+A)}var z=p.bodyBounds=p.bodyBounds||{};it(z,h),rt(z,y),nt(z,1),c&&Sr(h,(n=h.x1)-x,(i=h.y1)-x,(r=h.x2)+x,(o=h.y2)+x);var R=p.overlayBounds=p.overlayBounds||{};it(R,h),rt(R,y),nt(R,1);var F=p.labelBounds=p.labelBounds||{};null!=F.all?((u=F.all).x1=1/0,u.y1=1/0,u.x2=-1/0,u.y2=-1/0,u.w=0,u.h=0):F.all=et(),c&&t.includeLabels&&(t.includeMainLabels&&Tr(h,e,null),v&&(t.includeSourceLabels&&Tr(h,e,"source"),t.includeTargetLabels&&Tr(h,e,"target")))}return h.x1=Cr(h.x1),h.y1=Cr(h.y1),h.x2=Cr(h.x2),h.y2=Cr(h.y2),h.w=Cr(h.x2-h.x1),h.h=Cr(h.y2-h.y1),h.w>0&&h.h>0&&b&&(rt(h,y),nt(h,1)),h}(e,Nr),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=et(),(t.includeNodes&&c||t.includeEdges&&!c)&&_r(n,t.includeOverlays?r.overlayBounds: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},Nr={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,useCache:!0},Ir=Br(Nr),Lr=me(Nr);kr.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=et();var n=Lr(e=e||Nr);if(this.cy().styleEnabled())for(var r=0;r<this.length;r++){var i=this[r],o=i._private,a=Or(i);i.recalculateRenderedStyle(n.useCache&&o.bbCachePosKey===a&&!o.styleDirty)}this.updateCompoundBounds(!e.useCache);for(var s=0;s<this.length;s++)_r(t,Mr(this[s],n))}else e=void 0===e?Nr:Lr(e),t=Mr(this[0],e);return t.x1=Cr(t.x1),t.y1=Cr(t.y1),t.x2=Cr(t.x2),t.y2=Cr(t.y2),t.w=Cr(t.x2-t.x1),t.h=Cr(t.y2-t.y1),t},kr.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds["mid-source"]=null,t.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},kr.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter((function(e){return e.isParent()})),t=t.not(i)),E(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach((function(t,n){return t._private.bbAtOldPos=e(t,n)})).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var a=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return t.silentPositions((function(e){return e._private.bbAtOldPos})),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),a},Er.boundingbox=Er.bb=Er.boundingBox,Er.renderedBoundingbox=Er.renderedBoundingBox;var Ar,zr,Rr=kr;Ar=zr={};var Fr=function(e){e.uppercaseName=L(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=L(e.outerName),Ar[e.name]=function(){var t=this[0],n=t._private;if(t){if(!n.cy._private.styleEnabled)return 1;if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var r=t.pstyle(e.name);return"label"===r.strValue?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):r.pfValue}},Ar["outer"+e.uppercaseName]=function(){var t=this[0];if(t)return t._private.cy._private.styleEnabled?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},Ar["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},Ar["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};Fr({name:"width"}),Fr({name:"height"}),zr.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),void 0!==t.autoPadding?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},zr.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},zr.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var Vr=zr,Zr={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Yr=Object.keys(Zr).reduce((function(e,t){var n=Zr[t],r=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(t);return e[t]=function(){return function(e,t){if(e.isEdge())return t(e)}(this,n.get)},e[r]=n.mult?function(){return function(e,t){if(e.isEdge()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map((function(e){return Ze(e,i,r)}))}}(this,n.get)}:function(){return function(e,t){if(e.isEdge()){var n=e.cy();return Ze(t(e),n.zoom(),n.pan())}}(this,n.get)},e}),{}),qr=R({},Pr,Rr,Vr,Yr),Xr=function(e,t){this.recycle(e,t)};function Wr(){return!1}function Hr(){return!0}Xr.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Wr,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Hr:Wr):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Hr;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Hr;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Hr,this.stopPropagation()},isDefaultPrevented:Wr,isPropagationStopped:Wr,isImmediatePropagationStopped:Wr};var Gr=/^([^.]+)(\.(?:[^.]+))?$/,Ur={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Kr=Object.keys(Ur),Qr={};function $r(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qr,t=arguments.length>1?arguments[1]:void 0,n=0;n<Kr.length;n++){var r=Kr[n];this[r]=e[r]||Ur[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Jr=$r.prototype,ei=function(e,t,n,r,i,o,a){x(r)&&(i=r,r=null),a&&(o=null==o?a:R({},o,a));for(var s=w(n)?n:n.split(/\s+/),u=0;u<s.length;u++){var l=s[u];if(!T(l)){var c=l.match(Gr);if(c&&!1===t(e,l,c[1],c[2]?c[2]:null,r,i,o))break}}},ti=function(e,t){return e.addEventFields(e.context,t),new Xr(t.type,t)};Jr.on=Jr.addListener=function(e,t,n,r,i){return ei(this,(function(e,t,n,r,i,o,a){x(o)&&e.listeners.push({event:t,callback:o,type:n,namespace:r,qualifier:i,conf:a})}),e,t,n,r,i),this},Jr.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Jr.removeListener=Jr.off=function(e,t,n,r){var i=this;0!==this.emitting&&(this.listeners=this.listeners.slice());for(var o=this.listeners,a=function(a){var s=o[a];ei(i,(function(t,n,r,i,u,l){if((s.type===r||"*"===e)&&(!i&&".*"!==s.namespace||s.namespace===i)&&(!u||t.qualifierCompare(s.qualifier,u))&&(!l||s.callback===l))return o.splice(a,1),!1}),e,t,n,r)},s=o.length-1;s>=0;s--)a(s);return this},Jr.removeAllListeners=function(){return this.removeListener("*")},Jr.emit=Jr.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,ti(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var o=r[i];if(!T(o)){var a=o.match(Gr);a&&t(e,ti(e,{type:a[1],namespace:a[2]?a[2]:null,target:e.context}))}}else t(e,n)}(this,(function(e,o){null!=n&&(i=(r=[{event:o.event,type:o.type,namespace:o.namespace,callback:n}]).length);for(var a=function(n){var i=r[n];if(i.type===o.type&&(!i.namespace||i.namespace===o.namespace||".*"===i.namespace)&&e.eventMatches(e.context,i,o)){var a=[o];null!=t&&function(e,t){for(var n=0;n<t.length;n++)e.push(t[n])}(a,t),e.beforeEmit(e.context,i,o),i.conf&&i.conf.one&&(e.listeners=e.listeners.filter((function(e){return e!==i})));var s=e.callbackContext(e.context,i,o),u=i.callback.apply(s,a);e.afterEmit(e.context,i,o),!1===u&&(o.stopPropagation(),o.preventDefault())}},s=0;s<i;s++)a(s);e.bubble(e.context)&&!o.isPropagationStopped()&&e.parent(e.context).emit(o,t)}),e),this.emitting--,this};var ni={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.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ri=function(e){return b(e)?new rr(e):e},ii={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new $r(ni,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=ri(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=ri(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=ri(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=ri(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Vn.eventAliasesOn(ii);var oi={nodes:function(e){return this.filter((function(e){return e.isNode()})).filter(e)},edges:function(e){return this.filter((function(e){return e.isEdge()})).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(b(e)||C(e))return new rr(e).filter(this);if(x(e)){for(var n=this.spawn(),r=0;r<this.length;r++){var i=this[r];(t?e.apply(t,[i,r,this]):e(i,r,this))&&n.push(i)}return n}return this.spawn()},not:function(e){if(e){b(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(b(e))return this.filter(e);for(var t=this.spawn(),n=this.length<e.length,r=n?this:e,i=n?e:this,o=0;o<r.length;o++){var a=r[o];i.has(a)&&t.push(a)}return t},xor:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=e,i=function(e,t){for(var r=0;r<e.length;r++){var i=e[r];t.hasElementWithId(i._private.data.id)||n.push(i)}};return i(this,r),i(r,this),n},diff:function(e){var t=this._private.cy;b(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),o=e,a=function(e,t,n){for(var r=0;r<e.length;r++){var o=e[r];t.hasElementWithId(o._private.data.id)?i.merge(o):n.push(o)}};return a(this,o,n),a(o,this,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i];!this.has(o)&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&b(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,o=0;o<e.length;o++){var a=e[o],s=a._private.data.id;if(!i.has(s)){var u=this.length++;this[u]=a,i.set(s,{ele:a,index:u})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;if(this[e]=void 0,n.delete(t),this.length>1&&e!==this.length-1){var r=this.length-1,i=this[r],o=i._private.data.id;this[r]=void 0,this[e]=i,n.set(o,{ele:i,index:e})}return this.length--,this},unmergeOne:function(e){var t=this._private.map.get((e=e[0])._private.data.id);return t?(this.unmergeAt(t.index),this):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<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=0;r<this.length;r++){var i=this[r],o=t?e.apply(t,[i,r,this]):e(i,r,this);n.push(o)}return n},reduce:function(e,t){for(var n=t,r=0;r<this.length;r++)n=e(n,this[r],r,this);return n},max:function(e,t){for(var n,r=-1/0,i=0;i<this.length;i++){var o=this[i],a=t?e.apply(t,[o,i,this]):e(o,i,this);a>r&&(r=a,n=o)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=0;i<this.length;i++){var o=this[i],a=t?e.apply(t,[o,i,this]):e(o,i,this);a<r&&(r=a,n=o)}return{value:r,ele:n}}},ai=oi;ai.u=ai["|"]=ai["+"]=ai.union=ai.or=ai.add,ai["\\"]=ai["!"]=ai["-"]=ai.difference=ai.relativeComplement=ai.subtract=ai.not,ai.n=ai["&"]=ai["."]=ai.and=ai.intersection=ai.intersect,ai["^"]=ai["(+)"]=ai["(-)"]=ai.symmetricDifference=ai.symdiff=ai.xor,ai.fnFilter=ai.filterFn=ai.stdFilter=ai.filter,ai.complement=ai.abscomp=ai.absoluteComplement;var si=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle("z-compound-depth");return"auto"===t.value?n?e.zDepth():0:"bottom"===t.value?-1:"top"===t.value?ae:0}var i=r(e)-r(t);if(0!==i)return i;function o(e){return"auto"===e.pstyle("z-index-compare").value&&e.isNode()?1:0}var a=o(e)-o(t);if(0!==a)return a;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==s?s:e.poolIndex()-t.poolIndex()},ui={forEach:function(e,t){if(x(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if(!1===(t?e.apply(t,[i,r,this]):e(i,r,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;null==t&&(t=r),null==e&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!x(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(si)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:ae-1}var r=t.target,i=t.source.zDepth(),o=r.zDepth();return Math.max(i,o,0)}}};ui.each=ui.forEach,"undefined"!=("undefined"==typeof Symbol?"undefined":a(Symbol))&&"undefined"!=a(Symbol.iterator)&&(ui[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return c({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,(function(){return this}))});var li=me({nodeDimensionsIncludeLabels:!1}),ci={layoutDimensions:function(e){var t;if(e=li(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return 0!==t.w&&0!==t.h||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter((function(e){return!e.isParent()})),i=this.cy(),o=t.eles,a=function(e){return e.id()},s=O(n,a);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=t.spacingFactor&&1!==t.spacingFactor,l=function(){if(!u)return null;for(var e=et(),t=0;t<r.length;t++){var n=s(r[t],t);tt(e,n.x,n.y)}return e}(),c=O((function(e,n){var r,i,o,a,c,d=s(e,n);return u&&(r=Math.abs(t.spacingFactor),d={x:(a=(i=l).x1+i.w/2)+((o=d).x-a)*r,y:(c=i.y1+i.h/2)+(o.y-c)*r}),null!=t.transform&&(d=t.transform(e,d)),d}),a);if(t.animate){for(var d=0;d<r.length;d++){var h=r[d],p=c(h,d);if(null==t.animateFilter||t.animateFilter(h,d)){var f=h.animation({position:p,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(f)}else h.position(p)}if(t.fit){var v=i.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(void 0!==t.zoom&&void 0!==t.pan){var g=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}e.animations.forEach((function(e){return e.play()})),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),zn.all(e.animations.map((function(e){return e.promise()}))).then((function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})}))}else r.positions(c),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(R({},e,{eles:this}))}};function di(e,t,n){var r,i=n._private,o=i.styleCache=i.styleCache||[];return null!=(r=o[e])?r:r=o[e]=t(n)}function hi(e,t){return e=ee(e),function(n){return di(e,t,n)}}function pi(e,t){e=ee(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return di(e,n,t)}}ci.createLayout=ci.makeLayout=ci.layout;var fi={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e,t=this.cy(),n=function(e){return e._private.styleCache=null};return t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach((function(e){n(e),e.connectedEdges().forEach(n)})),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(n=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var r=n;return e?r.emitAndNotify("style"):r.emit("style"),n.forEach((function(e){return e._private.styleDirty=!0})),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();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(e))r.applyBypass(this,e,!1),this.emitAndNotify("style");else if(b(e)){if(void 0===t){var i=this[0];return i?r.getStylePropertyValue(i,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;r<this.length;r++)n.removeAllBypasses(this[r],!1);else{e=e.split(/\s+/);for(var i=0;i<this.length;i++)n.removeBypasses(this[i],e,!1)}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=r.data.parent?n.parents():null;if(o)for(var a=0;a<o.length;a++)i*=o[a].pstyle("opacity").value;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?0===e.effectiveOpacity():0===e.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function vi(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++)if(!t(n[r]))return!1;return!0}function gi(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],o=e.hasCompoundNodes();if(i){var a=i._private;if(!t(i))return!1;if(i.isNode())return!o||vi(i,r);var s=a.source,u=a.target;return n(s)&&(!o||vi(s,n))&&(s===u||n(u)&&(!o||vi(u,n)))}}}var yi=hi("eleTakesUpSpace",(function(e){return"element"===e.pstyle("display").value&&0!==e.width()&&(!e.isNode()||0!==e.height())}));fi.takesUpSpace=pi("takesUpSpace",gi({ok:yi}));var mi=hi("eleInteractive",(function(e){return"yes"===e.pstyle("events").value&&"visible"===e.pstyle("visibility").value&&yi(e)})),bi=hi("parentInteractive",(function(e){return"visible"===e.pstyle("visibility").value&&yi(e)}));fi.interactive=pi("interactive",gi({ok:mi,parentOk:bi,edgeOkViaNode:yi})),fi.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var xi=hi("eleVisible",(function(e){return"visible"===e.pstyle("visibility").value&&0!==e.pstyle("opacity").pfValue&&yi(e)}));fi.visible=pi("visible",gi({ok:xi,edgeOkViaNode:yi})),fi.hidden=function(){var e=this[0];if(e)return!e.visible()},fi.isBundledBezier=pi("isBundledBezier",(function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()})),fi.bypass=fi.css=fi.style,fi.renderedCss=fi.renderedStyle,fi.removeBypass=fi.removeCss=fi.removeStyle,fi.pstyle=fi.parsedStyle;var wi={};function Ei(e){return function(){var t=arguments,n=[];if(2===t.length){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(1===t.length&&x(t[0])){var o=t[0];this.on(e.event,o)}else if(0===t.length||1===t.length&&w(t[0])){for(var a=1===t.length?t[0]:null,s=0;s<this.length;s++){var u=this[s],l=!e.ableField||u._private[e.ableField],c=u._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(u);if(void 0!==d&&(l=d,!d))return this}l&&(u._private[e.field]=e.value,c&&n.push(u))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),a&&h.emit(a)}return this}}function ki(e){wi[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(void 0!==n)return n}return t._private[e.field]}},wi[e.on]=Ei({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),wi[e.off]=Ei({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}ki({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),ki({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),ki({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),ki({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),wi.deselect=wi.unselect,wi.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},ki({field:"active",on:"activate",off:"unactivate"}),ki({field:"pannable",on:"panify",off:"unpanify"}),wi.inactive=function(){var e=this[0];if(e)return!e._private.active};var Pi={},Ci=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode()){for(var o=!1,a=i.connectedEdges(),s=0;s<a.length;s++){var u=a[s],l=u.source(),c=u.target();if(e.noIncomingEdges&&c===i&&l!==i||e.noOutgoingEdges&&l===i&&c!==i){o=!0;break}}o||n.push(i)}}return this.spawn(n,!0).filter(t)}},Si=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r];if(i.isNode())for(var o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],u=s.source(),l=s.target();e.outgoing&&u===i?(n.push(s),n.push(l)):e.incoming&&l===i&&(n.push(s),n.push(u))}}return this.spawn(n,!0).filter(t)}},_i=function(e){return function(t){for(var n=this,r=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(0===o.length)break;for(var a=!1,s=0;s<o.length;s++){var u=o[s],l=u.id();i[l]||(i[l]=!0,r.push(u),a=!0)}if(!a)break;n=o}return this.spawn(r,!0).filter(t)}};function ji(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}function Di(e){return function(t){var n=[],r=this._private.cy,i=e||{};b(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var a=t[o]._private.edges,s=0;s<a.length;s++){var u=a[s],l=u._private.data,c=this.hasElementWithId(l.source)&&t.hasElementWithId(l.target),d=t.hasElementWithId(l.source)&&this.hasElementWithId(l.target);if(c||d){if(i.thisIsSrc||i.thisIsTgt){if(i.thisIsSrc&&!c)continue;if(i.thisIsTgt&&!d)continue}n.push(u)}}return this.spawn(n,!0)}}function Ti(e){return e=R({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,o=0;o<r.length;o++)for(var a=r[o]._private,s=a.source,u=s._private.data.id,l=a.data.target,c=s._private.edges,d=0;d<c.length;d++){var h=c[d],p=h._private.data,f=p.target,v=p.source,g=f===l&&v===u;(i.codirected&&g||!i.codirected&&(g||u===f&&l===v))&&n.push(h)}return this.spawn(n,!0).filter(t)}}Pi.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},R(Pi,{roots:Ci({noIncomingEdges:!0}),leaves:Ci({noOutgoingEdges:!0}),outgoers:ur(Si({outgoing:!0}),"outgoers"),successors:_i({outgoing:!0}),incomers:ur(Si({incoming:!0}),"incomers"),predecessors:_i({incoming:!0})}),R(Pi,{neighborhood:ur((function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],u=s.source(),l=s.target(),c=i===u?l:u;c.length>0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Pi.neighbourhood=Pi.neighborhood,Pi.closedNeighbourhood=Pi.closedNeighborhood,Pi.openNeighbourhood=Pi.openNeighborhood,R(Pi,{source:ur((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:ur((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ji({attr:"source"}),targets:ji({attr:"target"})}),R(Pi,{edgesWith:ur(Di(),"edgesWith"),edgesTo:ur(Di({thisIsSrc:!0}),"edgesTo")}),R(Pi,{connectedEdges:ur((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var i=r._private.edges,o=0;o<i.length;o++)t.push(i[o])}return this.spawn(t,!0).filter(e)}),"connectedEdges"),connectedNodes:ur((function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];r.isEdge()&&(t.push(r.source()[0]),t.push(r.target()[0]))}return this.spawn(t,!0).filter(e)}),"connectedNodes"),parallelEdges:ur(Ti(),"parallelEdges"),codirectedEdges:ur(Ti({codirected:!0}),"codirectedEdges")}),R(Pi,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=null==e?t.nodes():e.nodes(),o=[];null!=e&&i.empty()&&(i=e.sources());var a=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();o.push(e);var r=i[0];a(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return a(t,e)}}),e.forEach((function(n){n.connectedEdges().forEach((function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)}))}))};do{s()}while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Pi.componentsOf=Pi.components;var Bi=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(void 0!==e){var r=new ke,i=!1;if(t){if(t.length>0&&E(t[0])&&!S(t[0])){i=!0;for(var o=[],a=new Ce,s=0,u=t.length;s<u;s++){var l=t[s];null==l.data&&(l.data={});var c=l.data;if(null==c.id)c.id=ve();else if(e.hasElementWithId(c.id)||a.has(c.id))continue;var d=new Se(e,l,!1);o.push(d),a.add(c.id)}t=o}}else t=[];this.length=0;for(var h=0,p=t.length;h<p;h++){var f=t[h][0];if(null!=f){var v=f._private.data.id;n&&r.has(v)||(n&&r.set(v,{index:this.length,ele:f}),this[this.length]=f,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new ke,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=r),i&&this.restore()}else de("A collection must have a reference to the core")},Oi=Se.prototype=Bi.prototype=Object.create(Array.prototype);Oi.instanceString=function(){return"collection"},Oi.spawn=function(e,t){return new Bi(this.cy(),e,t)},Oi.spawnSelf=function(){return this.spawn(this)},Oi.cy=function(){return this._private.cy},Oi.renderer=function(){return this._private.cy.renderer()},Oi.element=function(){return this[0]},Oi.collection=function(){return _(this)?this:new Bi(this._private.cy,[this])},Oi.unique=function(){return new Bi(this._private.cy,this,!0)},Oi.hasElementWithId=function(e){return this._private.map.has(e=""+e)},Oi.getElementById=function(e){var t=this._private.cy,n=this._private.map.get(e=""+e);return n?n.ele:new Bi(t)},Oi.$id=Oi.getElementById,Oi.poolIndex=function(){return this._private.cy._private.elements._private.map.get(this[0]._private.data.id).index},Oi.indexOf=function(e){return this._private.map.get(e[0]._private.data.id).index},Oi.indexOfId=function(e){return this._private.map.get(e=""+e).index},Oi.json=function(e){var t=this.element(),n=this.cy();if(null==t&&e)return this;if(null!=t){var r=t._private;if(E(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var o=!1,a={},s=e.data.source,u=e.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=u&&u!=i.target&&(a.target=""+u,o=!0),o&&(t=t.move(a))}else{var l=e.data.parent;!("parent"in e.data)||null==l&&null==i.parent||l==i.parent||(void 0===l&&(l=null),null!=l&&(l=""+l),t=t.move({parent:l}))}}e.position&&t.position(e.position);var c=function(n,i,o){var a=e[n];null!=a&&a!==r[n]&&(a?t[i]():t[o]())};return c("removed","remove","restore"),c("selected","select","unselect"),c("selectable","selectify","unselectify"),c("locked","lock","unlock"),c("grabbable","grabify","ungrabify"),c("pannable","panify","unpanify"),null!=e.classes&&t.classes(e.classes),n.endBatch(),this}if(void 0===e){var d={data:fe(r.data),position:fe(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:(null,"")},h=0;return r.classes.forEach((function(e){return d.classes+=0==h++?e:" "+e})),d}}},Oi.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},Oi.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),i=new Se(e,r,!1);t.push(i)}return new Bi(e,t)},Oi.copy=Oi.clone,Oi.restore=function(){for(var e,t,n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],u=[],l=0,c=i.length;l<c;l++){var d=i[l];r&&!d.removed()||(d.isNode()?s.push(d):u.push(d))}e=s.concat(u);var h=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var p=e[t],f=p._private,v=f.data;if(p.clearTraversalCache(),r||f.removed)if(void 0===v.id)v.id=ve();else if(k(v.id))v.id=""+v.id;else{if(T(v.id)||!b(v.id)){de("Can not create element with invalid string ID `"+v.id+"`"),h();continue}if(o.hasElementWithId(v.id)){de("Can not create second element with ID `"+v.id+"`"),h();continue}}var g=v.id;if(p.isNode()){var y=f.position;null==y.x&&(y.x=0),null==y.y&&(y.y=0)}if(p.isEdge()){for(var m=p,x=["source","target"],w=x.length,E=!1,P=0;P<w;P++){var C=x[P],S=v[C];k(S)&&(S=v[C]=""+v[C]),null==S||""===S?(de("Can not create edge `"+g+"` with unspecified "+C),E=!0):o.hasElementWithId(S)||(de("Can not create edge `"+g+"` with nonexistant "+C+" `"+S+"`"),E=!0)}if(E){h();continue}var _=o.getElementById(v.source),j=o.getElementById(v.target);_.same(j)?_._private.edges.push(m):(_._private.edges.push(m),j._private.edges.push(m)),m._private.source=_,m._private.target=j}f.map=new ke,f.map.set(g,{ele:p,index:0}),f.removed=!1,r&&o.addToPool(p)}for(var D=0;D<s.length;D++){var B=s[D],O=B._private.data;k(O.parent)&&(O.parent=""+O.parent);var M=O.parent,N=null!=M;if(N){var I=o.getElementById(M);if(I.empty())O.parent=void 0;else{for(var L=!1,A=I;!A.empty();){if(B.same(A)){L=!0,O.parent=void 0;break}A=A.parent()}L||(I[0]._private.children.push(B),B._private.parent=I[0],a.hasCompoundNodes=!0)}}}if(e.length>0){for(var z=e.length===i.length?i:new Bi(o,e),R=0;R<z.length;R++){var F=z[R];F.isNode()||(F.parallelEdges().clearTraversalCache(),F.source().clearTraversalCache(),F.target().clearTraversalCache())}(a.hasCompoundNodes?o.collection().merge(z).merge(z.connectedNodes()).merge(z.parent()):z).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?z.emitAndNotify("add"):r&&z.emit("add")}return i},Oi.removed=function(){var e=this[0];return e&&e._private.removed},Oi.inside=function(){var e=this[0];return e&&!e._private.removed},Oi.remove=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){for(var t=e._private.edges,n=0;n<t.length;n++)u(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)u(t[n])}function u(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),a(e),s(e)):r.unshift(e))}for(var l=0,c=n.length;l<c;l++){var d=n[l];u(d)}function h(e,t){be(e._private.edges,t),e.clearTraversalCache()}function p(e){e.clearTraversalCache()}var f=[];function v(e,t){t=t[0];var n=(e=e[0])._private.children,r=e.id();be(n,t),t._private.parent=null,f.ids[r]||(f.ids[r]=!0,f.push(e))}f.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var y=r[g];if(y.isEdge()){var m=y.source()[0],b=y.target()[0];h(m,y),h(b,y);for(var x=y.parallelEdges(),w=0;w<x.length;w++){var E=x[w];p(E),E.isBundledBezier()&&E.dirtyBoundingBoxCache()}}else{var k=y.parent();0!==k.length&&v(k,y)}t&&(y._private.removed=!0)}var P=o._private.elements;o._private.hasCompoundNodes=!1;for(var C=0;C<P.length;C++){var S=P[C];if(S.isParent()){o._private.hasCompoundNodes=!0;break}}var _=new Bi(this.cy(),r);_.size()>0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var j=0;j<f.length;j++){var D=f[j];t&&D.removed()||D.updateStyle()}return _},Oi.move=function(e){var t=this._private.cy,n=this,r=function(e){return null==e?e:""+e};if(void 0!==e.source||void 0!==e.target){var i=r(e.source),o=r(e.target),a=null!=i&&t.hasElementWithId(i),s=null!=o&&t.hasElementWithId(o);(a||s)&&(t.batch((function(){n.remove(!1,!1),n.emitAndNotify("moveout");for(var e=0;e<n.length;e++){var t=n[e],r=t._private.data;t.isEdge()&&(a&&(r.source=i),s&&(r.target=o))}n.restore(!1,!1)})),n.emitAndNotify("move"))}else if(void 0!==e.parent){var u=r(e.parent);if(null===u||t.hasElementWithId(u)){var l=null===u?void 0:u;t.batch((function(){var e=n.remove(!1,!1);e.emitAndNotify("moveout");for(var t=0;t<n.length;t++){var r=n[t],i=r._private.data;r.isNode()&&(i.parent=l)}e.restore(!1,!1)})),n.emitAndNotify("move")}}return this},[Bn,Zn,Yn,or,lr,gr,yr,qr,ii,oi,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},ui,ci,fi,wi,Pi].forEach((function(e){R(Oi,e)}));var Mi={add:function(e){var t,n=this;if(C(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],o=0;o<r.length;o++)i.push(r[o].json());t=new Bi(n,i)}}else if(w(e))t=new Bi(n,e);else if(E(e)&&(w(e.nodes)||w(e.edges))){for(var a=e,s=[],u=["nodes","edges"],l=0,c=u.length;l<c;l++){var d=u[l],h=a[d];if(w(h))for(var p=0,f=h.length;p<f;p++){var v=R({group:d},h[p]);s.push(v)}}t=new Bi(n,s)}else t=new Se(n,e).collection();return t},remove:function(e){return C(e)||b(e)&&(e=this.$(e)),e.remove()}},Ni=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+1/6*(i.dx+2*(o.dx+a.dx)+s.dx)*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,u={x:-1,v:0,tension:null,friction:null},l=[0],c=0;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,u.tension=t,u.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||u,a),l.push(1+s.x),c+=16,Math.abs(s.x)>1e-4&&Math.abs(s.v)>1e-4;);return o?function(e){return l[e*(l.length-1)|0]}:c}}(),Ii=function(e,t,n,r){var i=function(e,t,n,r){var i=4,o=.001,a=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 p(e,t){return 1-3*t+3*e}function f(e,t){return 3*t-6*e}function v(e){return 3*e}function g(e,t,n){return((p(t,n)*e+f(t,n))*e+v(t))*e}function y(e,t,n){return 3*p(t,n)*e*e+2*f(t,n)*e+v(t)}function m(t,r){for(var o=0;o<i;++o){var a=y(r,e,n);if(0===a)return r;r-=(g(r,e,n)-t)/a}return r}function b(){for(var t=0;t<u;++t)h[t]=g(t*l,e,n)}function x(t,r,i){var o,u,l=0;do{(o=g(u=r+(i-r)/2,e,n)-t)>0?i=u:r=u}while(Math.abs(o)>a&&++l<s);return u}function w(t){for(var r=0,i=1,a=u-1;i!==a&&h[i]<=t;++i)r+=l;--i;var s=r+(t-h[i])/(h[i+1]-h[i])*l,c=y(s,e,n);return c>=o?m(t,s):0===c?s:x(t,r,r+l)}var E=!1;function k(){E=!0,e===t&&n===r||b()}var P=function(i){return E||k(),e===t&&n===r?i:0===i?0:1===i?1:g(w(i),t,r)};P.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var C="generateBezier("+[e,t,n,r]+")";return P.toString=function(){return C},P}(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Li={linear:function(e,t,n){return e+(t-e)*n},ease:Ii(.25,.1,.25,1),"ease-in":Ii(.42,0,1,1),"ease-out":Ii(0,0,.58,1),"ease-in-out":Ii(.42,0,.58,1),"ease-in-sine":Ii(.47,0,.745,.715),"ease-out-sine":Ii(.39,.575,.565,1),"ease-in-out-sine":Ii(.445,.05,.55,.95),"ease-in-quad":Ii(.55,.085,.68,.53),"ease-out-quad":Ii(.25,.46,.45,.94),"ease-in-out-quad":Ii(.455,.03,.515,.955),"ease-in-cubic":Ii(.55,.055,.675,.19),"ease-out-cubic":Ii(.215,.61,.355,1),"ease-in-out-cubic":Ii(.645,.045,.355,1),"ease-in-quart":Ii(.895,.03,.685,.22),"ease-out-quart":Ii(.165,.84,.44,1),"ease-in-out-quart":Ii(.77,0,.175,1),"ease-in-quint":Ii(.755,.05,.855,.06),"ease-out-quint":Ii(.23,1,.32,1),"ease-in-out-quint":Ii(.86,0,.07,1),"ease-in-expo":Ii(.95,.05,.795,.035),"ease-out-expo":Ii(.19,1,.22,1),"ease-in-out-expo":Ii(1,0,0,1),"ease-in-circ":Ii(.6,.04,.98,.335),"ease-out-circ":Ii(.075,.82,.165,1),"ease-in-out-circ":Ii(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Li.linear;var r=Ni(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":Ii};function Ai(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function zi(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ri(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=zi(e,i),s=zi(t,i);if(k(a)&&k(s))return Ai(o,a,s,n,r);if(w(a)&&w(s)){for(var u=[],l=0;l<s.length;l++){var c=a[l],d=s[l];if(null!=c&&null!=d){var h=Ai(o,c,d,n,r);u.push(h)}else u.push(d)}return u}}function Fi(e,t,n,r){var i=!r,o=e._private,a=t._private,s=a.easing,u=a.startTime,l=(r?e:e.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=Li.linear;else{var c,d,h;c=b(s)?l.parse("transition-timing-function",s).value:s,b(c)?(d=c,h=[]):(d=c[1],h=c.slice(2).map((function(e){return+e}))),h.length>0?("spring"===d&&h.push(a.duration),a.easingImpl=Li[d].apply(null,h)):a.easingImpl=Li[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-u)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var v=a.startPosition,g=a.position;if(g&&i&&!e.locked()){var y={};Vi(v.x,g.x)&&(y.x=Ri(v.x,g.x,p,f)),Vi(v.y,g.y)&&(y.y=Ri(v.y,g.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Vi(m.x,x.x)&&(w.x=Ri(m.x,x.x,p,f)),Vi(m.y,x.y)&&(w.y=Ri(m.y,x.y,p,f)),e.emit("pan"));var k=a.startZoom,P=a.zoom,C=null!=P&&r;C&&(Vi(k,P)&&(o.zoom=Je(o.minZoom,Ri(k,P,p,f),o.maxZoom)),e.emit("zoom")),(E||C)&&e.emit("viewport");var S=a.style;if(S&&S.length>0&&i){for(var _=0;_<S.length;_++){var j=S[_],D=j.name,T=a.startStyle[D],B=Ri(T,j,p,f,l.properties[T.name]);l.overrideBypass(e,D,B)}e.emit("style")}}return a.progress=p,p}function Vi(e,t){return!(null==e||null==t||!(k(e)&&k(t)||e&&t))}function Zi(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function Yi(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,o=i.animation.current,a=i.animation.queue,s=!1;if(0===o.length){var u=a.shift();u&&o.push(u)}for(var l=function(e){for(var t=e.length-1;t>=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.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||Zi(0,d,e),Fi(t,d,e,n),h.applying&&(h.applying=!1),l(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,l(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a<n.length;a++){var s=i(n[a]);o=o||s}var u=i(t,!0);(o||u)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var qi={animate:Vn.animate(),animation:Vn.animation(),animated:Vn.animated(),clearQueue:Vn.clearQueue(),delay:Vn.delay(),delayAnimation:Vn.delayAnimation(),stop:Vn.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){Yi(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&W((function(n){Yi(n,e),t()}))}()}}},Xi={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}},Wi=function(e){return b(e)?new rr(e):e},Hi={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new $r(Xi,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Wi(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Wi(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Wi(t),n),this},once:function(e,t,n){return this.emitter().one(e,Wi(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}};Vn.eventAliasesOn(Hi);var Gi={png:function(e){return this._private.renderer.png(e=e||{})},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Gi.jpeg=Gi.jpg;var Ui={layout:function(e){if(null!=e)if(null!=e.name){var t,n=e.name,r=this.extension("layout",n);if(null!=r)return t=b(e.eles)?this.$(e.eles):null!=e.eles?e.eles:this.$(),new r(R({},e,{cy:this,eles:t}));de("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else de("A `name` must be specified to make a layout");else de("Layout options must be specified to make a layout")}};Ui.createLayout=Ui.makeLayout=Ui.layout;var Ki={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;r<n.length;r++){var i=n[r],o=e[i];t.getElementById(i).data(o)}}))}},Qi=me({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),$i={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this.extension("renderer",e.name);if(null!=t){void 0!==e.wheelSensitivity&&pe("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var n=Qi(e);n.cy=this,this._private.renderer=new t(n),this.notify("init")}else de("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){this.notify("destroy");var e=this.container();if(e)for(e._cyreg=null;e.childNodes.length>0;)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)}};$i.invalidateDimensions=$i.resize;var Ji={collection:function(e,t){return b(e)?this.$(e):C(e)?e.collection():w(e)?new Bi(this,e,t):new Bi(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}};Ji.elements=Ji.filter=Ji.$;var eo={apply:function(e){for(var t=this._private.cy.collection(),n=0;n<e.length;n++){var r=e[n],i=this.getContextMeta(r);if(!i.empty){var o=this.getContextStyle(i),a=this.applyContextStyle(i,o,r);r._private.appliedInitStyle?this.updateTransitions(r,a.diffProps):r._private.appliedInitStyle=!0,this.updateStyleHints(r)&&t.push(r)}}return t},getPropertiesDiff:function(e,t){var n=this._private.propDiffs=this._private.propDiffs||{},r=e+"-"+t,i=n[r];if(i)return i;for(var o=[],a={},s=0;s<this.length;s++){var u=this[s],l="t"===t[s],c="t"===e[s]!==l,d=u.mappedProperties.length>0;if(c||l&&d){var h=void 0;c&&d||c?h=u.properties:d&&(h=u.mappedProperties);for(var p=0;p<h.length;p++){for(var f=h[p],v=f.name,g=!1,y=s+1;y<this.length&&("t"!==t[y]||!(g=null!=this[y].properties[f.name]));y++);a[v]||g||(a[v]=!0,o.push(v))}}}return n[r]=o,o},getContextMeta:function(e){for(var t,n="",r=e._private.styleCxtKey||"",i=0;i<this.length;i++){var o=this[i];n+=o.selector&&o.selector.matches(e)?"t":"f"}return t=this.getPropertiesDiff(r,n),e._private.styleCxtKey=n,{key:n,diffPropNames:t,empty:0===t.length}},getContextStyle:function(e){var t=e.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[t])return n[t];for(var r={_private:{key:t}},i=0;i<this.length;i++){var o=this[i];if("t"===t[i])for(var a=0;a<o.properties.length;a++){var s=o.properties[a];r[s.name]=s}}return n[t]=r,r},applyContextStyle:function(e,t,n){for(var r=e.diffPropNames,i={},o=this.types,a=0;a<r.length;a++){var s=r[a],u=t[s],l=n.pstyle(s);if(!u){if(!l)continue;u=l.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(l!==u){if(u.mapped===o.fn&&null!=l&&null!=l.mapping&&l.mapping.value===u.value){var c=l.mapping;if((c.fnValue=u.value(n))===c.prevFnValue)continue}var d=i[s]={prev:l};this.applyParsedProperty(n,u),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:i}},updateStyleHints:function(e){var t,n=e._private,r=this,i=r.propertyGroupKeys,o=function(e,t,n){return r.getPropertiesHash(e,t,n)},a=n.styleKey;if(e.removed())return!1;var s="nodes"===n.group,u=e._private.style;t=Object.keys(u);for(var l=0;l<i.length;l++)n.styleKeys[i[l]]=[9261,5381];for(var c,d=function(e,t){return n.styleKeys[t][0]=K(e,n.styleKeys[t][0])},h=function(e,t){return n.styleKeys[t][1]=Q(e,n.styleKeys[t][1])},p=function(e,t){d(e,t),h(e,t)},f=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);d(r,t),h(r,t)}},v=0;v<t.length;v++){var g=t[v],y=u[g];if(null!=y){var m=this.properties[g],b=m.type,x=m.groupKey,w=void 0;null!=m.hashOverride?w=m.hashOverride(e,y):null!=y.pfValue&&(w=y.pfValue);var E=null==m.enums?y.value:null,k=null!=w,P=y.units;!b.number||!k&&null==E||b.multiple?f(y.strValue,x):(p(-128<(c=k?w:E)&&c<128&&Math.floor(c)!==c?2e9-(1024*c|0):c,x),k||null==P||f(P,x))}}for(var C=[9261,5381],S=0;S<i.length;S++){var _=n.styleKeys[i[S]];C[0]=K(_[0],C[0]),C[1]=Q(_[1],C[1])}n.styleKey=2097152*C[0]+C[1];var j=n.styleKeys;n.labelDimsKey=$(j.labelDimensions);var D=o(e,["label"],j.labelDimensions);if(n.labelKey=$(D),n.labelStyleKey=$(J(j.commonLabel,D)),!s){var T=o(e,["source-label"],j.labelDimensions);n.sourceLabelKey=$(T),n.sourceLabelStyleKey=$(J(j.commonLabel,T));var B=o(e,["target-label"],j.labelDimensions);n.targetLabelKey=$(B),n.targetLabelStyleKey=$(J(j.commonLabel,B))}if(s){var O=n.styleKeys,M=O.pie,N=[O.nodeBody,O.nodeBorder,O.backgroundImage,O.compound,M].filter((function(e){return null!=e})).reduce(J,[9261,5381]);n.nodeKey=$(N),n.hasPie=null!=M&&9261!==M[0]&&5381!==M[1]}return a!==n.styleKey},clearStyleHints:function(e){var t=e._private;t.styleCxtKey="",t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null},applyParsedProperty:function(e,t){var n,r=this,i=t,o=e._private.style,a=r.types,s=r.properties[i.name].type,u=i.bypass,l=o[i.name],c=l&&l.bypass,d=e._private,h=function(e){return null==e?null:null!=e.pfValue?e.pfValue:e.value},p=function(){var t=h(l),n=h(i);r.checkTriggers(e,i.name,t,n)};if(i&&"pie"===i.name.substr(0,3)&&pe("The pie style properties are deprecated. Create charts using background images instead."),"curve-style"===t.name&&e.isEdge()&&("bezier"!==t.value&&e.isLoop()||"haystack"===t.value&&(e.source().isParent()||e.target().isParent()))&&(i=t=this.parse(t.name,"bezier",u)),i.delete)return o[i.name]=void 0,p(),!0;if(i.deleteBypassed)return l?!!l.bypass&&(l.bypassed=void 0,p(),!0):(p(),!0);if(i.deleteBypass)return l?!!l.bypass&&(o[i.name]=l.bypassed,p(),!0):(p(),!0);var f=function(){pe("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+i.name+"` with data field `"+i.field+"`); try a `["+i.field+"]` selector to limit scope to elements with `"+i.field+"` defined")};switch(i.mapped){case a.mapData:for(var v,g=i.field.split("."),y=d.data,m=0;m<g.length&&y;m++)y=y[g[m]];if(null==y)return f(),!1;if(!k(y))return pe("Do not use continuous mappers without specifying numeric data (i.e. `"+i.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;var b=i.fieldMax-i.fieldMin;if((v=0===b?0:(y-i.fieldMin)/b)<0?v=0:v>1&&(v=1),s.color){var x=i.valueMin[0],w=i.valueMin[1],E=i.valueMax[1],P=i.valueMin[2],C=i.valueMax[2],S=null==i.valueMin[3]?1:i.valueMin[3],_=null==i.valueMax[3]?1:i.valueMax[3],j=[Math.round(x+(i.valueMax[0]-x)*v),Math.round(w+(E-w)*v),Math.round(P+(C-P)*v),Math.round(S+(_-S)*v)];n={bypass:i.bypass,name:i.name,value:j,strValue:"rgb("+j[0]+", "+j[1]+", "+j[2]+")"}}else{if(!s.number)return!1;n=this.parse(i.name,i.valueMin+(i.valueMax-i.valueMin)*v,i.bypass,"mapping")}if(!n)return f(),!1;n.mapping=i,i=n;break;case a.data:for(var D=i.field.split("."),T=d.data,B=0;B<D.length&&T;B++)T=T[D[B]];if(null!=T&&(n=this.parse(i.name,T,i.bypass,"mapping")),!n)return f(),!1;n.mapping=i,i=n;break;case a.fn:var O=null!=i.fnValue?i.fnValue:(0,i.value)(e);if(i.prevFnValue=O,null==O)return pe("Custom function mappers may not return null (i.e. `"+i.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(i.name,O,i.bypass,"mapping")))return pe("Custom function mappers may not return invalid values for the property type (i.e. `"+i.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=fe(i),i=n;break;case void 0:break;default:return!1}return u?(i.bypassed=c?l.bypassed:l,o[i.name]=i):c?l.bypassed=i:o[i.name]=i,p(),!0},cleanElements:function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),t)for(var i=r._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],u=i[s];null!=u&&(u.bypass?u.bypassed=null:i[s]=null)}else r._private.style={}}},update:function(){this._private.cy.mutableElements().updateStyle()},updateTransitions:function(e,t){var n=this,r=e._private,i=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,a=e.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},u=!1,l=0;l<i.length;l++){var c=i[l],d=e.pstyle(c),h=t[c];if(h){var p=h.prev,f=null!=h.next?h.next:d,v=!1,g=void 0;p&&(k(p.pfValue)&&k(f.pfValue)?g=p.pfValue+1e-6*(v=f.pfValue-p.pfValue):k(p.value)&&k(f.value)?g=p.value+1e-6*(v=f.value-p.value):w(p.value)&&w(f.value)&&(v=p.value[0]!==f.value[0]||p.value[1]!==f.value[1]||p.value[2]!==f.value[2],g=p.strValue),v&&(s[c]=f.strValue,this.applyBypass(e,c,g),u=!0))}}if(!u)return;r.transitioning=!0,new zn((function(t){a>0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,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)},checkTrigger:function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},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)}))},checkBoundsTrigger:function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),"curve-style"!==t||"bezier"!==n&&"bezier"!==r||!i.triggersBoundsOfParallelBeziers||e.parallelEdges().forEach((function(e){e.isBundledBezier()&&e.dirtyBoundingBoxCache()}))}))},checkTriggers:function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)}},to={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;o<this.properties.length;o++){var a=this.parse(this.properties[o].name,n,!0);a&&i.push(a)}}else if(b(t)){var s=this.parse(t,n,!0);s&&i.push(s)}else{if(!E(t))return!1;var u=t;r=n;for(var l=Object.keys(u),c=0;c<l.length;c++){var d=l[c],h=u[d];if(void 0===h&&(h=u[N(d)]),void 0!==h){var p=this.parse(d,h,!0);p&&i.push(p)}}}if(0===i.length)return!1;for(var f=!1,v=0;v<e.length;v++){for(var g=e[v],y={},m=void 0,x=0;x<i.length;x++){var w=i[x];if(r){var k=g.pstyle(w.name);m=y[w.name]={prev:k}}f=this.applyParsedProperty(g,fe(w))||f,r&&(m.next=g.pstyle(w.name))}f&&this.updateStyleHints(g),r&&this.updateTransitions(g,y,!0)}return f},overrideBypass:function(e,t,n){t=M(t);for(var r=0;r<e.length;r++){var i=e[r],o=i._private.style[t],a=this.properties[t].type,s=a.color,u=a.mutiple,l=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,null!=o.pfValue&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":u?n.join(" "):""+n,this.updateStyleHints(i)):this.applyBypass(i,t,n),this.checkTriggers(i,t,l,n)}},removeAllBypasses:function(e,t){return this.removeBypasses(e,this.propertyNames,t)},removeBypasses:function(e,t,n){for(var r=0;r<e.length;r++){for(var i=e[r],o={},a=0;a<t.length;a++){var s=t[a],u=this.properties[s],l=i.pstyle(u.name);if(l&&l.bypass){var c=this.parse(s,"",!0),d=o[u.name]={prev:l};this.applyParsedProperty(i,c),d.next=i.pstyle(u.name)}}this.updateStyleHints(i),n&&this.updateTransitions(i,o,!0)}}},no={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return null!=e?parseFloat(e):1},containerCss:function(e){var t=this._private.cy.container();if(h&&t&&h.getComputedStyle)return h.getComputedStyle(t).getPropertyValue(e)}},ro={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){if(e=e[0]){for(var n={},r=0;r<this.properties.length;r++){var i=this.properties[r],o=this.getStylePropertyValue(e,i.name,t);null!=o&&(n[i.name]=o,n[N(i.name)]=o)}return n}},getIndexedStyle:function(e,t,n,r){var i=e.pstyle(t)[n][r];return null!=i?i:e.cy().style().getDefaultProperty(t)[n][0]},getStylePropertyValue:function(e,t,n){if(e=e[0]){var r=this.properties[t];r.alias&&(r=r.pointsTo);var i=r.type,o=e.pstyle(r.name);if(o){var a=o.value,s=o.units,u=o.strValue;if(n&&i.number&&null!=a&&k(a)){var l=e.cy().zoom(),c=function(e){return e*l},d=function(e,t){return c(e)+t},h=w(a);return(h?s.every((function(e){return null!=e})):null!=s)?h?a.map((function(e,t){return d(e,s[t])})).join(" "):d(a,s):h?a.map((function(e){return b(e)?e:""+c(e)})).join(" "):""+c(a)}if(null!=u)return u}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,o=e.pstyle(i);void 0!==o&&(o=E(o)?this.parse(i,o.strValue):this.parse(i,o)),o&&(n[i]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a],u=r[a]||r[M(a)],l=this.parse(u.name,s);l&&t.push(l)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,i,o,a,s,u=n.slice();for(a=0;a<t.length;a++)if(null!=(r=e.pstyle(t[a],!1)))if(null!=r.pfValue)u[0]=K(o,u[0]),u[1]=Q(o,u[1]);else for(i=r.strValue,s=0;s<i.length;s++)o=i.charCodeAt(s),u[0]=K(o,u[0]),u[1]=Q(o,u[1]);return u}};ro.getPropertiesHash=ro.getNonDefaultPropertiesHash;var io={appendFromJson:function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n.selector,i=n.style||n.css,o=Object.keys(i);this.selector(r);for(var a=0;a<o.length;a++){var s=o[a];this.css(s,i[s])}}return this},fromJson:function(e){return this.resetToDefault(),this.appendFromJson(e),this},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},oo={appendFromString:function(e){var t,n,r,i=""+e;function o(){i=i.length>t.length?i.substr(t.length):""}function a(){n=n.length>r.length?n.substr(r.length):""}for(i=i.replace(/[/][*](\s|.)+?[*][/]/g,"");!i.match(/^\s*$/);){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&&new rr(u).invalid)pe("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),o();else{var l=s[2],c=!1;n=l;for(var d=[];!n.match(/^\s*$/);){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 p=h[1],f=h[2];this.properties[p]?this.parse(p,f)?(d.push({name:p,val:f}),a()):(pe("Skipping property: Invalid property definition in: "+r),a()):(pe("Skipping property: Invalid property name in: "+r),a())}if(c){o();break}this.selector(u);for(var v=0;v<d.length;v++){var g=d[v];this.css(g.name,g.val)}o()}}return this},fromString:function(e){return this.resetToDefault(),this.appendFromString(e),this}},ao={};!function(){var e=A,t=function(e){return"^"+e+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},n=function(t){var n=e+"|\\w+|rgb[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+)?))))?\\)|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+)?))))?\\)|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+t+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+n+")\\s*\\,\\s*("+n+")\\)$"},r=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];ao.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","taxi"]},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","polygon"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:t("data")},layoutData:{mapping:!0,regex:t("layoutData")},scratch:{mapping:!0,regex:t("scratch")},mapData:{mapping:!0,regex:n("mapData")},mapLayoutData:{mapping:!0,regex:n("mapLayoutData")},mapScratch:{mapping:!0,regex:n("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:r,singleRegexMatchValue:!0},urls:{regexes:r,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return"deg"!==t[0]&&"rad"!==t[0]&&"deg"!==t[1]&&"rad"!==t[1];case 1:return b(e[0])||"deg"===t[0]||"rad"===t[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*,\\s*("+e+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return 1===t||2===t||4===t}}};var i={zeroNonZero:function(e,t){return(null==e||null==t)&&e!==t||0==e&&0!=t||0!=e&&0==t},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=T(e),r=T(t);return n&&!r||!n&&r}},o=ao.types,a=[{name:"label",type:o.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any}],s=[{name:"source-label",type:o.text,triggersBounds:i.any},{name:"source-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:o.size,triggersBounds:i.any}],u=[{name:"target-label",type:o.text,triggersBounds:i.any},{name:"target-text-rotation",type:o.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:o.size,triggersBounds:i.any}],l=[{name:"font-family",type:o.fontFamily,triggersBounds:i.any},{name:"font-style",type:o.fontStyle,triggersBounds:i.any},{name:"font-weight",type:o.fontWeight,triggersBounds:i.any},{name:"font-size",type:o.size,triggersBounds:i.any},{name:"text-transform",type:o.textTransform,triggersBounds:i.any},{name:"text-wrap",type:o.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:o.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:o.size,triggersBounds:i.any},{name:"text-outline-width",type:o.size,triggersBounds:i.any},{name:"line-height",type:o.positiveNumber,triggersBounds:i.any}],c=[{name:"text-valign",type:o.valign,triggersBounds:i.any},{name:"text-halign",type:o.halign,triggersBounds:i.any},{name:"color",type:o.color},{name:"text-outline-color",type:o.color},{name:"text-outline-opacity",type:o.zeroOneNumber},{name:"text-background-color",type:o.color},{name:"text-background-opacity",type:o.zeroOneNumber},{name:"text-background-padding",type:o.size,triggersBounds:i.any},{name:"text-border-opacity",type:o.zeroOneNumber},{name:"text-border-color",type:o.color},{name:"text-border-width",type:o.size,triggersBounds:i.any},{name:"text-border-style",type:o.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:o.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:o.justification}],d=[{name:"events",type:o.bool},{name:"text-events",type:o.bool}],h=[{name:"display",type:o.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"visibility",type:o.visibility,triggersZOrder:i.any},{name:"opacity",type:o.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:o.zeroOneNumber},{name:"min-zoomed-font-size",type:o.size},{name:"z-compound-depth",type:o.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:o.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:o.nonNegativeInt,triggersZOrder:i.any}],p=[{name:"overlay-padding",type:o.size,triggersBounds:i.any},{name:"overlay-color",type:o.color},{name:"overlay-opacity",type:o.zeroOneNumber,triggersBounds:i.zeroNonZero}],f=[{name:"transition-property",type:o.propList},{name:"transition-duration",type:o.time},{name:"transition-delay",type:o.time},{name:"transition-timing-function",type:o.easing}],v=function(e,t){return"label"===t.value?-e.poolIndex():t.pfValue},g=[{name:"height",type:o.nodeSize,triggersBounds:i.any,hashOverride:v},{name:"width",type:o.nodeSize,triggersBounds:i.any,hashOverride:v},{name:"shape",type:o.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:o.polygonPointList,triggersBounds:i.any},{name:"background-color",type:o.color},{name:"background-fill",type:o.fill},{name:"background-opacity",type:o.zeroOneNumber},{name:"background-blacken",type:o.nOneOneNumber},{name:"background-gradient-stop-colors",type:o.colors},{name:"background-gradient-stop-positions",type:o.percentages},{name:"background-gradient-direction",type:o.gradientDirection},{name:"padding",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:o.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:o.boundsExpansion,triggersBounds:i.any}],y=[{name:"border-color",type:o.color},{name:"border-opacity",type:o.zeroOneNumber},{name:"border-width",type:o.size,triggersBounds:i.any},{name:"border-style",type:o.borderStyle}],m=[{name:"background-image",type:o.urls},{name:"background-image-crossorigin",type:o.bgCrossOrigin},{name:"background-image-opacity",type:o.zeroOneNumbers},{name:"background-image-containment",type:o.bgContainment},{name:"background-image-smoothing",type:o.bools},{name:"background-position-x",type:o.bgPos},{name:"background-position-y",type:o.bgPos},{name:"background-width-relative-to",type:o.bgRelativeTo},{name:"background-height-relative-to",type:o.bgRelativeTo},{name:"background-repeat",type:o.bgRepeat},{name:"background-fit",type:o.bgFit},{name:"background-clip",type:o.bgClip},{name:"background-width",type:o.bgWH},{name:"background-height",type:o.bgWH},{name:"background-offset-x",type:o.bgPos},{name:"background-offset-y",type:o.bgPos}],x=[{name:"position",type:o.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:o.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:o.size,triggersBounds:i.any},{name:"min-width-bias-left",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:o.size,triggersBounds:i.any},{name:"min-height-bias-top",type:o.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:o.sizeMaybePercent,triggersBounds:i.any}],w=[{name:"line-style",type:o.lineStyle},{name:"line-color",type:o.color},{name:"line-fill",type:o.fill},{name:"line-cap",type:o.lineCap},{name:"line-opacity",type:o.zeroOneNumber},{name:"line-dash-pattern",type:o.numbers},{name:"line-dash-offset",type:o.number},{name:"line-gradient-stop-colors",type:o.colors},{name:"line-gradient-stop-positions",type:o.percentages},{name:"curve-style",type:o.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:o.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:o.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:o.size,triggersBounds:i.any},{name:"control-point-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:o.numbers,triggersBounds:i.any},{name:"segment-distances",type:o.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:o.numbers,triggersBounds:i.any},{name:"taxi-turn",type:o.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:o.size,triggersBounds:i.any},{name:"taxi-direction",type:o.axisDirection,triggersBounds:i.any},{name:"edge-distances",type:o.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:o.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:o.angle,triggersBounds:i.any},{name:"loop-sweep",type:o.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:o.size,triggersBounds:i.any},{name:"target-distance-from-node",type:o.size,triggersBounds:i.any}],E=[{name:"ghost",type:o.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:o.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:o.zeroOneNumber}],k=[{name:"selection-box-color",type:o.color},{name:"selection-box-opacity",type:o.zeroOneNumber},{name:"selection-box-border-color",type:o.color},{name:"selection-box-border-width",type:o.size},{name:"active-bg-color",type:o.color},{name:"active-bg-opacity",type:o.zeroOneNumber},{name:"active-bg-size",type:o.size},{name:"outside-texture-bg-color",type:o.color},{name:"outside-texture-bg-opacity",type:o.zeroOneNumber}],P=[];ao.pieBackgroundN=16,P.push({name:"pie-size",type:o.sizeMaybePercent});for(var C=1;C<=ao.pieBackgroundN;C++)P.push({name:"pie-"+C+"-background-color",type:o.color}),P.push({name:"pie-"+C+"-background-size",type:o.percent}),P.push({name:"pie-"+C+"-background-opacity",type:o.zeroOneNumber});var S=[],_=ao.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:o.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:o.color},{name:"arrow-fill",type:o.arrowFill}].forEach((function(e){_.forEach((function(t){S.push({name:t+"-"+e.name,type:e.type,triggersBounds:e.triggersBounds})}))}),{});var j=ao.properties=[].concat(d,f,h,p,E,c,l,a,s,u,g,y,m,P,x,w,S,k),D=ao.propertyGroups={behavior:d,transition:f,visibility:h,overlay:p,ghost:E,commonLabel:c,labelDimensions:l,mainLabel:a,sourceLabel:s,targetLabel:u,nodeBody:g,nodeBorder:y,backgroundImage:m,pie:P,compound:x,edgeLine:w,edgeArrow:S,core:k},B=ao.propertyGroupNames={};(ao.propertyGroupKeys=Object.keys(D)).forEach((function(e){B[e]=D[e].map((function(e){return e.name})),D[e].forEach((function(t){return t.groupKey=e}))}));var O=ao.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];ao.propertyNames=j.map((function(e){return e.name}));for(var M=0;M<j.length;M++){var N=j[M];j[N.name]=N}for(var I=0;I<O.length;I++){var L=O[I],z={name:L.name,alias:!0,pointsTo:j[L.pointsTo]};j.push(z),j[L.name]=z}}(),ao.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},ao.getDefaultProperties=function(){var e=this._private;if(null!=e.defaultProperties)return e.defaultProperties;for(var t=R({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce((function(e,t){for(var n=1;n<=ao.pieBackgroundN;n++)e[t.name.replace("{{i}}",n)]=t.value;return e}),{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"taxi-turn":"50%","taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"}].reduce((function(e,t){return ao.arrowPrefixes.forEach((function(n){e[n+"-"+t.name]=t.value})),e}),{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var o=i.name,a=this.parse(o,t[o]);n[o]=a}}return e.defaultProperties=n,e.defaultProperties},ao.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var so={parse:function(e,t,n,r){if(x(t))return this.parseImplWarn(e,t,n,r);var i,o=te(e,""+t,n?"t":"f","mapping"===r||!0===r||!1===r||null==r?"dontcare":r),a=this.propCache=this.propCache||[];return(i=a[o])||(i=a[o]=this.parseImplWarn(e,t,n,r)),(n||"mapping"===r)&&(i=fe(i))&&(i.value=fe(i.value)),i},parseImplWarn:function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return i||null==t||pe("The style property `".concat(e,": ").concat(t,"` is invalid")),!i||"width"!==i.name&&"height"!==i.name||"label"!==t||pe("The style value of `label` is deprecated for `"+i.name+"`"),i},parseImpl:function(e,t,n,r){e=M(e);var i=this.properties[e],o=t,a=this.types;if(!i)return null;if(void 0===t)return null;i.alias&&(e=(i=i.pointsTo).name);var s=b(t);s&&(t=t.trim());var u,l,c=i.type;if(!c)return null;if(n&&(""===t||null===t))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(x(t))return{name:e,value:t,strValue:"fn",mapped:a.fn,bypass:n};if(!s||r||t.length<7||"a"!==t[1]);else{if(t.length>=7&&"d"===t[0]&&(u=new RegExp(a.data.regex).exec(t)))return!n&&{name:e,value:u,strValue:""+t,mapped:a.data,field:u[1],bypass:n};if(t.length>=10&&"m"===t[0]&&(l=new RegExp(a.mapData.regex).exec(t))){if(n)return!1;if(c.multiple)return!1;var d=a.mapData;if(!c.color&&!c.number)return!1;var h=this.parse(e,l[4]);if(!h||h.mapped)return!1;var p=this.parse(e,l[5]);if(!p||p.mapped)return!1;if(h.pfValue===p.pfValue||h.strValue===p.strValue)return pe("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+h.strValue+"`"),this.parse(e,h.strValue);if(c.color){var f=h.value,v=p.value;if(!(f[0]!==v[0]||f[1]!==v[1]||f[2]!==v[2]||f[3]!==v[3]&&(null!=f[3]&&1!==f[3]||null!=v[3]&&1!==v[3])))return!1}return{name:e,value:l,strValue:""+t,mapped:d,field:l[1],fieldMin:parseFloat(l[2]),fieldMax:parseFloat(l[3]),valueMin:h.value,valueMax:p.value,bypass:n}}}if(c.multiple&&"multiple"!==r){var g;if(g=s?t.split(/\s+/):w(t)?t:[t],c.evenMultiple&&g.length%2!=0)return null;for(var y=[],m=[],E=[],P="",C=!1,S=0;S<g.length;S++){var _=this.parse(e,g[S],n,"multiple");C=C||b(_.value),y.push(_.value),E.push(null!=_.pfValue?_.pfValue:_.value),m.push(_.units),P+=(S>0?" ":"")+_.strValue}return c.validate&&!c.validate(y,m)?null:c.singleEnum&&C?1===y.length&&b(y[0])?{name:e,value:y[0],strValue:y[0],bypass:n}:null:{name:e,value:y,pfValue:E,strValue:P,bypass:n,units:m}}var j,D,T=function(){for(var r=0;r<c.enums.length;r++)if(c.enums[r]===t)return{name:e,value:t,strValue:""+t,bypass:n};return null};if(c.number){var B,O="px";if(c.units&&(B=c.units),c.implicitUnits&&(O=c.implicitUnits),!c.unitless)if(s){var N="px|em"+(c.allowPercent?"|\\%":"");B&&(N=B);var I=t.match("^("+A+")("+N+")?$");I&&(t=I[1],B=I[2]||O)}else B&&!c.implicitUnits||(B=O);if(t=parseFloat(t),isNaN(t)&&void 0===c.enums)return null;if(isNaN(t)&&void 0!==c.enums)return t=o,T();if(c.integer&&(!k(j=t)||Math.floor(j)!==j))return null;if(void 0!==c.min&&(t<c.min||c.strictMin&&t===c.min)||void 0!==c.max&&(t>c.max||c.strictMax&&t===c.max))return null;var L={name:e,value:t,strValue:""+t+(B||""),units:B,bypass:n};return L.pfValue=c.unitless||"px"!==B&&"em"!==B?t:"px"!==B&&B?this.getEmSizeInPixels()*t:t,"ms"!==B&&"s"!==B||(L.pfValue="ms"===B?t:1e3*t),"deg"!==B&&"rad"!==B||(L.pfValue="rad"===B?t:Math.PI*t/180),"%"===B&&(L.pfValue=t/100),L}if(c.propList){var z=[],R=""+t;if("none"===R);else{for(var V=R.split(/\s*,\s*|\s+/),Z=0;Z<V.length;Z++){var Y=V[Z].trim();this.properties[Y]?z.push(Y):pe("`"+Y+"` is not a valid property name")}if(0===z.length)return null}return{name:e,value:z,strValue:0===z.length?"none":z.join(" "),bypass:n}}if(c.color){var q=(w(D=t)?D:null)||function(e){return F[e.toLowerCase()]}(D)||function(e){var t,n,r;if((4===e.length||7===e.length)&&"#"===e[0])return 4===e.length?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):(t=parseInt(e[1]+e[2],16),n=parseInt(e[3]+e[4],16),r=parseInt(e[5]+e[6],16)),[t,n,r]}(D)||function(e){var t,n=new RegExp("^rgb[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(n){t=[];for(var r=[],i=1;i<=3;i++){var o=n[i];if("%"===o[o.length-1]&&(r[i]=!0),o=parseFloat(o),r[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}if((r[1]||r[2]||r[3])&&!(r[1]&&r[2]&&r[3]))return;var a=n[4];if(void 0!==a){if((a=parseFloat(a))<0||a>1)return;t.push(a)}}return t}(D)||function(e){var t,n,r,i,o,a,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!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=u=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=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=[a,s,u,o]}return t}(D);return q?{name:e,value:q,pfValue:q,strValue:"rgb("+q[0]+","+q[1]+","+q[2]+")",bypass:n}:null}if(c.regex||c.regexes){if(c.enums){var X=T();if(X)return X}for(var W=c.regexes?c.regexes:[c.regex],H=0;H<W.length;H++){var G=new RegExp(W[H]).exec(t);if(G)return{name:e,value:c.singleRegexMatchValue?G[1]:G,strValue:""+t,bypass:n}}return null}return c.string?{name:e,value:""+t,strValue:""+t,bypass:n}:c.enums?T():null}},uo=function e(t){if(!(this instanceof e))return new e(t);j(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):de("A style must have a core reference")},lo=uo.prototype;lo.instanceString=function(){return"style"},lo.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach((function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1})),this},lo.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},lo.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},lo.selector=function(e){var t="core"===e?null:new rr(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},lo.css=function(){var e=this,t=arguments;if(1===t.length)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],o=n[i.name];void 0===o&&(o=n[N(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===t.length&&this.cssRule(t[0],t[1]);return this},lo.style=lo.css,lo.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.mapped&&this[r].mappedProperties.push(n),!this[r].selector&&(this._private.coreStyle[n.name]=n)}return this},lo.append=function(e){return D(e)?e.appendToStyle(this):w(e)?this.appendFromJson(e):b(e)&&this.appendFromString(e),this},uo.fromJson=function(e,t){var n=new uo(e);return n.fromJson(t),n},uo.fromString=function(e,t){return new uo(e).fromString(t)},[eo,to,no,ro,io,oo,ao,so].forEach((function(e){R(lo,e)})),uo.types=lo.types,uo.properties=lo.properties,uo.propertyGroups=lo.propertyGroups,uo.propertyGroupNames=lo.propertyGroupNames,uo.propertyGroupKeys=lo.propertyGroupKeys;var co={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=D(e)?e.generateStyle(this):w(e)?uo.fromJson(this,e):b(e)?uo.fromString(this,e):uo(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},ho={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:("additive"!==e&&"single"!==e||(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,i,o=arguments,a=this._private.pan;switch(o.length){case 0:return a;case 1:if(b(o[0]))return a[e=o[0]];if(E(o[0])){if(!this._private.panningEnabled)return this;i=(n=o[0]).y,k(r=n.x)&&(a.x=r),k(i)&&(a.y=i),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[1],"x"!==(e=o[0])&&"y"!==e||!k(t)||(a[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,i,o,a,s=arguments,u=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:E(e)&&(a=(i=s[0]).y,k(o=i.x)&&(u.x+=o),k(a)&&(u.y+=a),this.emit("pan viewport"));break;case 2:r=t,"x"!==(n=e)&&"y"!==n||!k(r)||(u[n]+=r),this.emit("pan viewport")}return this.notify("viewport"),this},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){var n,r;if(k(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled&&(b(e)?e=this.$(e):E(r=e)&&k(r.x1)&&k(r.x2)&&k(r.y1)&&k(r.y2)?((n={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1):C(e)||(e=this.mutableElements()),!C(e)||!e.empty())){n=n||e.boundingBox();var i,o=this.width(),a=this.height();if(t=k(t)?t:0,!isNaN(o)&&!isNaN(a)&&o>0&&a>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:i=(i=(i=Math.min((o-2*t)/n.w,(a-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:i)<this._private.minZoom?this._private.minZoom:i,pan:{x:(o-i*(n.x1+n.x2))/2,y:(a-i*(n.y1+n.y2))/2}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var r=e;e=r.min,t=r.max}return k(e)&&k(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):k(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:k(t)&&void 0===e&&t>=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,o=r.zoom,a=!1;return r.zoomingEnabled||(a=!0),k(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=Ze(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,!a&&k(n)&&n!==o&&(null==t||k(t.x)&&k(t.y))?null!=t?{zoomed:!0,panned:!0,zoom:n,pan:{x:-n/o*(t.x-i.x)+t.x,y:-n/o*(t.y-i.y)+t.y}}:{zoomed:!0,panned:!1,zoom:n,pan:i}:null},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],o=!1,a=!1;if(!e)return this;if(k(e.zoom)||(n=!1),E(e.pan)||(r=!1),!n&&!r)return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;k(u.x)&&(t.pan.x=u.x,a=!1),k(u.y)&&(t.pan.y=u.y,a=!1),a||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(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-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),{width:r.clientWidth-(t=function(t){return parseFloat(e.getPropertyValue(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}}};ho.centre=ho.center,ho.autolockNodes=ho.autolock,ho.autoungrabifyNodes=ho.autoungrabify;var po={data:Vn.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Vn.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Vn.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Vn.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};po.attr=po.data,po.removeAttr=po.removeData;var fo=function(e){var t=this,n=(e=R({},e)).container;n&&!P(n)&&P(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 o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=R({name:o?"grid":"null"},a.layout),a.renderer=R({name:o?"canvas":"null"},a.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:a,elements:new Bi(this),listeners:[],aniEles:new Bi(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:k(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&k(a.pan.x)?a.pan.x:0,y:E(a.pan)&&k(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),u.styleEnabled&&t.setStyle([]);var l=R({},a,a.renderer);t.initRenderer(l),function(e,t){if(e.some(B))return zn.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=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(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 o=R({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),u.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e<i.length;e++)t.on("ready",i[e]);r&&(r.readies=[]),t.emit("ready")}),a.done)}))},vo=fo.prototype;R(vo,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},mount:function(e){if(null!=e){var t=this,n=t._private,r=n.options;return!P(e)&&P(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(R({},r,r.renderer,{name:"null"===r.renderer.name?"canvas":r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return fe(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(E(e)){if(t.startBatch(),e.elements){var i={},o=function(e,n){for(var r=[],o=[],a=0;a<e.length;a++){var s=e[a];if(s.data.id){var u=""+s.data.id,l=t.getElementById(u);i[u]=!0,0!==l.length?o.push({ele:l,json:s}):n?(s.group=n,r.push(s)):r.push(s)}else pe("cy.json() cannot handle elements without an ID attribute")}t.add(r);for(var c=0;c<o.length;c++){var d=o[c];d.ele.json(d.json)}};if(w(e.elements))o(e.elements);else for(var a=["nodes","edges"],s=0;s<a.length;s++){var u=a[s],l=e.elements[u];w(l)&&o(l,u)}var c=t.collection();r.filter((function(e){return!i[e.id()]})).forEach((function(e){e.isParent()?c.merge(e):e.remove()})),c.forEach((function(e){return e.children().move({parent:null})})),c.forEach((function(e){return function(e){return t.getElementById(e.id())}(e).remove()}))}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x===n.pan.x&&e.pan.y===n.pan.y||t.pan(e.pan)),e.data&&t.data(e.data);for(var d=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify"],h=0;h<d.length;h++){var p=d[h];null!=e[p]&&t[p](e[p])}return t.endBatch(),this}var f={};e?f.elements=this.elements().map((function(e){return e.json()})):(f.elements={},r.forEach((function(e){var t=e.group();f.elements[t]||(f.elements[t]=[]),f.elements[t].push(e.json())}))),this._private.styleEnabled&&(f.style=t.style().json()),f.data=fe(t.data());var v=n.options;return f.zoomingEnabled=n.zoomingEnabled,f.userZoomingEnabled=n.userZoomingEnabled,f.zoom=n.zoom,f.minZoom=n.minZoom,f.maxZoom=n.maxZoom,f.panningEnabled=n.panningEnabled,f.userPanningEnabled=n.userPanningEnabled,f.pan=fe(n.pan),f.boxSelectionEnabled=n.boxSelectionEnabled,f.renderer=fe(v.renderer),f.hideEdgesOnViewport=v.hideEdgesOnViewport,f.textureOnViewport=v.textureOnViewport,f.wheelSensitivity=v.wheelSensitivity,f.motionBlur=v.motionBlur,f}}),vo.$id=vo.getElementById,[Mi,qi,Hi,Gi,Ui,Ki,$i,Ji,co,ho,po].forEach((function(e){R(vo,e)}));var go={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,maximal:!1,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}},yo=function(e){return e.scratch("breadthfirst")},mo=function(e,t){return e.scratch("breadthfirst",t)};function bo(e){this.options=R({},go,e)}bo.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,i=n.eles,o=i.nodes().filter((function(e){return!e.isParent()})),a=i,s=n.directed,u=n.maximal||n.maximalAdjustments>0,l=et(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;d<n.roots.length;d++){var h=r.getElementById(n.roots[d]);c.push(h)}e=r.collection(c)}else if(b(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var p=i.components();e=r.collection();for(var f=function(t){var n=p[t],r=n.maxDegree(!1),i=n.filter((function(e){return e.degree(!1)===r}));e=e.add(i)},v=0;v<p.length;v++)f(v)}var g=[],y={},m=function(e,t){null==g[t]&&(g[t]=[]);var n=g[t].length;g[t].push(e),mo(e,{index:n,depth:t})};a.bfs({roots:e,directed:n.directed,visit:function(e,t,n,r,i){var o=e[0],a=o.id();m(o,i),y[a]=!0}});for(var x=[],E=0;E<o.length;E++){var k=o[E];y[k.id()]||x.push(k)}var P=function(e){for(var t=g[e],n=0;n<t.length;n++){var r=t[n];null!=r?mo(r,{depth:e,index:n}):(t.splice(n,1),n--)}},S=function(){for(var e=0;e<g.length;e++)P(e)},_=function(e,t){for(var n=yo(e),r=e.incomers().filter((function(e){return e.isNode()&&i.has(e)})),o=-1,a=e.id(),s=0;s<r.length;s++){var u=yo(r[s]);o=Math.max(o,u.depth)}return n.depth<=o&&(t[a]?null:(function(e,t){var n=yo(e);g[n.depth][n.index]=null,m(e,t)}(e,o+1),t[a]=!0,!0))};if(s&&u){var j=[],D={},T=function(e){return j.push(e)};for(o.forEach((function(e){return j.push(e)}));j.length>0;){var B=j.shift(),O=_(B,D);if(O)B.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(T);else if(null===O){pe("Detected double maximal shift for node `"+B.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}S();var M=0;if(n.avoidOverlap)for(var N=0;N<o.length;N++){var I=o[N].layoutDimensions(n);M=Math.max(M,I.w,I.h)}for(var L={},A=function(e){if(L[e.id()])return L[e.id()];for(var t=yo(e).depth,n=e.neighborhood(),r=0,i=0,a=0;a<n.length;a++){var s=n[a];if(!s.isEdge()&&!s.isParent()&&o.has(s)){var u=yo(s);if(null!=u){var l=u.index,c=u.depth;null!=l&&null!=c&&c<t&&(r+=l/g[c].length,i++)}}}return r/=i=Math.max(1,i),0===i&&(r=0),L[e.id()]=r,r},R=function(e,t){var n=A(e)-A(t);return 0===n?z(e.id(),t.id()):n},F=0;F<g.length;F++)g[F].sort(R),P(F);for(var V=[],Z=0;Z<x.length;Z++)V.push(x[Z]);g.unshift(V),S();for(var Y=0,q=0;q<g.length;q++)Y=Math.max(g[q].length,Y);var X=l.x1+l.w/2,W=l.x1+l.h/2,H=g.reduce((function(e,t){return Math.max(e,t.length)}),0);return i.nodes().layoutPositions(this,n,(function(e){var t=yo(e),r=t.depth,i=t.index,o=g[r].length,a=Math.max(l.w/((n.grid?H:o)+1),M),s=Math.max(l.h/(g.length+1),M),u=Math.min(l.w/2/g.length,l.h/2/g.length);if(u=Math.max(u,M),n.circle){var c=u*r+u-(g.length>0&&g[0].length<=3?u/2:0),d=2*Math.PI/g[r].length*i;return 0===r&&1===g[0].length&&(c=1),{x:X+c*Math.cos(d),y:W+c*Math.sin(d)}}return{x:X+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var xo={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 wo(e){this.options=R({},xo,e)}wo.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=et(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/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h<o.length;h++){var p=o[h].layoutDimensions(t);d=Math.max(d,p.w,p.h)}if(a=k(t.radius)?t.radius:o.length<=1?0:Math.min(s.h,s.w)/2-d,o.length>1&&t.avoidOverlap){d*=1.75;var f=Math.cos(c)-Math.cos(0),v=Math.sin(c)-Math.sin(0),g=Math.sqrt(d*d/(f*f+v*v));a=Math.max(g,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:u+o,y:l+s}})),this};var Eo,ko={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 Po(e){this.options=R({},ko,e)}Po.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,o=i.nodes().not(":parent"),a=et(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,u=a.y1+a.h/2,l=[],c=0,d=0;d<o.length;d++){var h,p=o[d];h=t.concentric(p),l.push({value:h,node:p}),p._private.scratch.concentric=h}o.updateStyle();for(var f=0;f<o.length;f++){var v=o[f].layoutDimensions(t);c=Math.max(c,v.w,v.h)}l.sort((function(e,t){return t.value-e.value}));for(var g=t.levelWidth(o),y=[[]],m=y[0],b=0;b<l.length;b++){var x=l[b];m.length>0&&Math.abs(m[0].value-x.value)>=g&&y.push(m=[]),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,k=Math.min(a.w,a.h)/2-w;w=Math.min(w,k/(y.length+E?1:0))}for(var P=0,C=0;C<y.length;C++){var S=y[C],_=void 0===t.sweep?2*Math.PI-2*Math.PI/S.length:t.sweep,j=S.dTheta=_/Math.max(1,S.length-1);if(S.length>1&&t.avoidOverlap){var D=Math.cos(j)-Math.cos(0),T=Math.sin(j)-Math.sin(0),B=Math.sqrt(w*w/(D*D+T*T));P=Math.max(B,P)}S.r=P,P+=w}if(t.equidistant){for(var O=0,M=0,N=0;N<y.length;N++)O=Math.max(O,y[N].r-M);M=0;for(var I=0;I<y.length;I++){var L=y[I];0===I&&(M=L.r),L.r=M,M+=O}}for(var A={},z=0;z<y.length;z++)for(var R=y[z],F=R.dTheta,V=R.r,Z=0;Z<R.length;Z++){var Y=R[Z],q=t.startAngle+(n?1:-1)*F*Z,X={x:s+V*Math.cos(q),y:u+V*Math.sin(q)};A[Y.node.id()]=X}return i.nodes().layoutPositions(this,t,(function(e){var t=e.id();return A[t]})),this};var Co={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function So(e){this.options=R({},Co,e),this.options.layout=this}So.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,!0!==e.animate&&!1!==e.animate||n.emit({type:"layoutstart",layout:n}),Eo=!0===e.debug;var r=_o(t,n,e);Eo&&(void 0)(r),e.randomize&&To(r);var i=H(),o=function(){Oo(r,t,e),!0===e.fit&&t.fit(e.padding)},a=function(t){return!(n.stopped||t>=e.numIter||(Mo(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature<e.minTemp))},s=function(){if(!0===e.animate||!1===e.animate)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var t=e.eles.nodes(),i=Bo(r,e,t);t.layoutPositions(n,e,i)}},u=0,l=!0;if(!0===e.animate)!function t(){for(var n=0;l&&n<e.refresh;)l=a(u),u++,n++;l?(H()-i>=e.animationThreshold&&o(),W(t)):(Xo(r,e),s())}();else{for(;l;)l=a(u),u++;Xo(r,e),s()}return this},So.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},So.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var _o=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:e.width(),clientHeight:e.width(),boundingBox:et(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()})},a=n.eles.components(),s={},u=0;u<a.length;u++)for(var l=a[u],c=0;c<l.length;c++)s[l[c].id()]=u;for(u=0;u<o.nodeSize;u++){var d=(g=i[u]).layoutDimensions(n);(B={}).isLocked=g.locked(),B.id=g.data("id"),B.parentId=g.data("parent"),B.cmptId=s[g.id()],B.children=[],B.positionX=g.position("x"),B.positionY=g.position("y"),B.offsetX=0,B.offsetY=0,B.height=d.w,B.width=d.h,B.maxX=B.positionX+B.width/2,B.minX=B.positionX-B.width/2,B.maxY=B.positionY+B.height/2,B.minY=B.positionY-B.height/2,B.padLeft=parseFloat(g.style("padding")),B.padRight=parseFloat(g.style("padding")),B.padTop=parseFloat(g.style("padding")),B.padBottom=parseFloat(g.style("padding")),B.nodeRepulsion=x(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,o.layoutNodes.push(B),o.idToIndex[B.id]=u}var h=[],p=0,f=-1,v=[];for(u=0;u<o.nodeSize;u++){var g,y=(g=o.layoutNodes[u]).parentId;null!=y?o.layoutNodes[o.idToIndex[y]].children.push(g.id):(h[++f]=g.id,v.push(g.id))}for(o.graphSet.push(v);p<=f;){var m=h[p++],b=o.layoutNodes[o.idToIndex[m]].children;if(b.length>0)for(o.graphSet.push(b),u=0;u<b.length;u++)h[++f]=b[u]}for(u=0;u<o.graphSet.length;u++){var w=o.graphSet[u];for(c=0;c<w.length;c++)o.indexToGraph[o.idToIndex[w[c]]]=u}for(u=0;u<o.edgeSize;u++){var E=r[u],k={};k.id=E.data("id"),k.sourceId=E.data("source"),k.targetId=E.data("target");var P=x(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,C=x(n.edgeElasticity)?n.edgeElasticity(E):n.edgeElasticity,S=o.idToIndex[k.sourceId],_=o.idToIndex[k.targetId];if(o.indexToGraph[S]!=o.indexToGraph[_]){for(var j=jo(k.sourceId,k.targetId,o),D=o.graphSet[j],T=0,B=o.layoutNodes[S];-1===D.indexOf(B.id);)B=o.layoutNodes[o.idToIndex[B.parentId]],T++;for(B=o.layoutNodes[_];-1===D.indexOf(B.id);)B=o.layoutNodes[o.idToIndex[B.parentId]],T++;P*=T*n.nestingFactor}k.idealLength=P,k.elasticity=C,o.layoutEdges.push(k)}return o},jo=function(e,t,n){var r=Do(e,t,0,n);return 2>r.count?0:r.graph},Do=function e(t,n,r,i){var o=i.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var a=0,s=0;s<o.length;s++){var u=i.layoutNodes[i.idToIndex[o[s]]].children;if(0!==u.length){var l=e(t,n,i.indexToGraph[i.idToIndex[u[0]]],i);if(0!==l.count){if(1!==l.count)return l;if(2==++a)break}}}return{count:a,graph:r}},To=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];0!==o.children.length||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},Bo=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach((function(t){var n=e.layoutNodes[e.idToIndex[t.data("id")]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)})),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,o){var a=e.layoutNodes[e.idToIndex[n.data("id")]];return t.boundingBox?{x:r.x1+(a.positionX-i.x1)/i.w*r.w,y:r.y1+(a.positionY-i.y1)/i.h*r.h}:{x:a.positionX,y:a.positionY}}},Oo=function(e,t,n){var r=n.layout,i=n.eles.nodes(),o=Bo(e,n,i);i.positions(o),!0!==e.ready&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},Mo=function(e,t,n){No(e,t),Ro(e),Fo(e,t),Vo(e),Zo(e)},No=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,o=0;o<i;o++)for(var a=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<i;s++)Lo(a,e.layoutNodes[e.idToIndex[r[s]]],e,t)},Io=function(e){return-e+2*e*Math.random()},Lo=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var i=t.positionX-e.positionX,o=t.positionY-e.positionY;0===i&&0===o&&(i=Io(1),o=Io(1));var a=Ao(e,t,i,o);if(a>0)var s=(l=r.nodeOverlap*a)*i/(v=Math.sqrt(i*i+o*o)),u=l*o/v;else{var l,c=zo(e,i,o),d=zo(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,v=Math.sqrt(f);s=(l=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/v,u=l*p/v}e.isLocked||(e.offsetX-=s,e.offsetY-=u),t.isLocked||(t.offsetX+=s,t.offsetY+=u)}},Ao=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},zo=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,u=o/a,l={};return 0===t&&0<n||0===t&&0>n?(l.x=r,l.y=i+o/2,l):0<t&&-1*u<=s&&s<=u?(l.x=r+a/2,l.y=i+a*n/2/t,l):0>t&&-1*u<=s&&s<=u?(l.x=r-a/2,l.y=i-a*n/2/t,l):0<n&&(s<=-1*u||s>=u)?(l.x=r+o*t/2/n,l.y=i+o/2,l):0>n&&(s<=-1*u||s>=u)?(l.x=r-o*t/2/n,l.y=i-o/2,l):l},Ro=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.layoutNodes[e.idToIndex[r.sourceId]],o=e.layoutNodes[e.idToIndex[r.targetId]],a=o.positionX-i.positionX,s=o.positionY-i.positionY;if(0!==a||0!==s){var u=zo(i,a,s),l=zo(o,-1*a,-1*s),c=l.x-u.x,d=l.y-u.y,h=Math.sqrt(c*c+d*d),p=Math.pow(r.idealLength-h,2)/r.elasticity;if(0!==h)var f=p*c/h,v=p*d/h;else f=0,v=0;i.isLocked||(i.offsetX+=f,i.offsetY+=v),o.isLocked||(o.offsetX-=f,o.offsetY-=v)}}},Fo=function(e,t){for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],i=r.length;if(0===n)var o=e.clientHeight/2,a=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[e.layoutNodes[e.idToIndex[r[0]]].parentId]];o=s.positionX,a=s.positionY}for(var u=0;u<i;u++){var l=e.layoutNodes[e.idToIndex[r[u]]];if(!l.isLocked){var c=o-l.positionX,d=a-l.positionY,h=Math.sqrt(c*c+d*d);if(h>1){var p=t.gravity*d/h;l.offsetX+=t.gravity*c/h,l.offsetY+=p}}}}},Vo=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 o=n[r++],a=e.layoutNodes[e.idToIndex[o]],s=a.children;if(0<s.length&&!a.isLocked){for(var u=a.offsetX,l=a.offsetY,c=0;c<s.length;c++){var d=e.layoutNodes[e.idToIndex[s[c]]];d.offsetX+=u,d.offsetY+=l,n[++i]=s[c]}a.offsetX=0,a.offsetY=0}}},Zo=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var r=Yo(i.offsetX,i.offsetY,e.temperature);i.positionX+=r.x,i.positionY+=r.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,qo(i,e)}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},Yo=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},qo=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLeft<i.minX)&&(i.minX=t.minX-i.padLeft,o=!0),(null==i.maxY||t.maxY+i.padBottom>i.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTop<i.minY)&&(i.minY=t.minY-i.padTop,o=!0),o?e(i,n):void 0}},Xo=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var o=n[i],a=o.cmptId;(r[a]=r[a]||[]).push(o)}var s=0;for(i=0;i<r.length;i++)if(v=r[i]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var u=0;u<v.length;u++){var l=v[u];v.x1=Math.min(v.x1,l.positionX-l.width/2),v.x2=Math.max(v.x2,l.positionX+l.width/2),v.y1=Math.min(v.y1,l.positionY-l.height/2),v.y2=Math.max(v.y2,l.positionY+l.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}r.sort((function(e,t){return t.w*t.h-e.w*e.h}));var c=0,d=0,h=0,p=0,f=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(i=0;i<r.length;i++){var v;if(v=r[i]){for(u=0;u<v.length;u++)(l=v[u]).isLocked||(l.positionX+=c-v.x1,l.positionY+=d-v.y1);c+=v.w+t.componentSpacing,h+=v.w+t.componentSpacing,p=Math.max(p,v.h),h>f&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Wo={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 Ho(e){this.options=R({},Wo,e)}Ho.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=et(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),u=Math.round(s),l=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(u,l);Math.min(u,l)==u?u=e:l=e},d=function(e){if(null==e)return Math.max(u,l);Math.max(u,l)==u?u=e:l=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)u=h,l=p;else if(null!=h&&null==p)u=h,l=Math.ceil(a/u);else if(null==h&&null!=p)l=p,u=Math.ceil(a/l);else if(l*u>a){var f=c(),v=d();(f-1)*v>=a?c(f-1):(v-1)*f>=a&&d(v-1)}else for(;l*u<a;){var g=c(),y=d();(y+1)*g>=a?d(y+1):c(g+1)}var m=o.w/l,b=o.h/u;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x<i.length;x++){var w=i[x],E=w._private.position;null!=E.x&&null!=E.y||(E.x=0,E.y=0);var k=w.layoutDimensions(t),P=t.avoidOverlapPadding,C=k.h+P;m=Math.max(m,k.w+P),b=Math.max(b,C)}for(var S={},_=function(e,t){return!!S["c-"+e+"-"+t]},j=function(e,t){S["c-"+e+"-"+t]=!0},D=0,T=0,B=function(){++T>=l&&(T=0,D++)},O={},M=0;M<i.length;M++){var N=i[M],I=t.position(N);if(I&&(void 0!==I.row||void 0!==I.col)){var L={row:I.row,col:I.col};if(void 0===L.col)for(L.col=0;_(L.row,L.col);)L.col++;else if(void 0===L.row)for(L.row=0;_(L.row,L.col);)L.row++;O[N.id()]=L,j(L.row,L.col)}}i.layoutPositions(this,t,(function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=O[e.id()];if(i)n=i.col*m+m/2+o.x1,r=i.row*b+b/2+o.y1;else{for(;_(D,T);)B();n=T*m+m/2+o.x1,r=D*b+b/2+o.y1,j(D,T),B()}return{x:n,y:r}}))}return this};var Go={ready:function(){},stop:function(){}};function Uo(e){this.options=R({},Go,e)}Uo.prototype.run=function(){var e=this.options,t=e.eles;return this.emit("layoutstart"),t.nodes().positions((function(){return{x:0,y:0}})),this.one("layoutready",e.ready),this.emit("layoutready"),this.one("layoutstop",e.stop),this.emit("layoutstop"),this},Uo.prototype.stop=function(){return this};var Ko={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,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 Qo(e){this.options=R({},Ko,e)}Qo.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=x(e.positions);return t.layoutPositions(this,e,(function(t,r){var i=function(t){if(null==e.positions)return function(e){return{x:e.x,y:e.y}}(t.position());if(n)return e.positions(t);var r=e.positions[t._private.data.id];return null==r?null:r}(t);return!t.locked()&&null!=i&&i})),this};var $o={fit:!0,padding:30,boundingBox: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 Jo(e){this.options=R({},$o,e)}Jo.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=et(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,(function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}})),this};var ea=[{name:"breadthfirst",impl:bo},{name:"circle",impl:wo},{name:"concentric",impl:Po},{name:"cose",impl:So},{name:"grid",impl:Ho},{name:"null",impl:Uo},{name:"preset",impl:Qo},{name:"random",impl:Jo}];function ta(e){this.options=e,this.notifications=0}var na=function(){},ra=function(){throw new Error("A headless instance can not render images")};ta.prototype={recalculateRenderedStyle:na,notify:function(){this.notifications++},init:na,isHeadless:function(){return!0},png:ra,jpg:ra};var ia={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,o,a){return i.x-n/2-a<=e&&e<=i.x+n/2+a&&i.y-n/2-a<=t&&t<=i.y+n/2+a},r=function(e,t,n,r,i){var o=e*Math.cos(r)-t*Math.sin(r),a=e*Math.sin(r)+t*Math.cos(r);return{x:o*n+i.x,y:a*n+i.y}},i=function(e,t,n,i){for(var o=[],a=0;a<e.length;a+=2)o.push(r(e[a],e[a+1],t,n,i));return o},o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},a=function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").pfValue*2},s=function(r,s){b(s)&&(s=e[s]),e[r]=R({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,a,s){var u=o(i(this.points,n+2*s,r,a));return pt(e,t,u)},roughCollide:n,draw:function(e,n,r,o){var a=i(this.points,n,r,o);t.arrowShapeImpl("polygon")(e,a)},spacing:function(e){return 0},gap:a},s)};s("none",{collide:ue,roughCollide:ue,draw:ce,spacing:le,gap:le}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,o,a,s){var u=i(this.points,n,o,a),l=this.controlPoint,c=r(l[0],l[1],n,o,a);t.arrowShapeImpl(this.name)(e,u,c)},gap:function(e){return.8*a(e)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,a,s,u){var l=o(i(this.points,n+2*u,r,a)),c=o(i(this.pointsTee,n+2*u,r,a));return pt(e,t,l)||pt(e,t,c)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),u=i(this.pointsTee,n,r,o);t.arrowShapeImpl(this.name)(e,s,u)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,a,s,u){var l=a,c=Math.pow(l.x-e,2)+Math.pow(l.y-t,2)<=Math.pow((n+2*u)*this.radius,2),d=o(i(this.points,n+2*u,r,a));return pt(e,t,d)||c},draw:function(e,n,r,o,a){var s=i(this.pointsTr,n,r,o);t.arrowShapeImpl(this.name)(e,s,o.x,o.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e;return n[3]=n[3]-r,n[5]=n[5]-r,n},collide:function(e,t,n,r,a,s,u){var l=o(i(this.points,n+2*u,r,a)),c=o(i(this.crossLinePts(n,s),n+2*u,r,a));return pt(e,t,l)||pt(e,t,c)},draw:function(e,n,r,o,a){var s=i(this.points,n,r,o),u=i(this.crossLinePts(n,a),n,r,o);t.arrowShapeImpl(this.name)(e,s,u)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return.525*a(e)}}),s("circle",{radius:.15,collide:function(e,t,n,r,i,o,a){var s=i;return Math.pow(s.x-e,2)+Math.pow(s.y-t,2)<=Math.pow((n+2*a)*this.radius,2)},draw:function(e,n,r,i,o){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return.95*e.pstyle("width").pfValue*e.pstyle("arrow-scale").value}})}},oa={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],o=r[1],a=r[4],s=n.pan(),u=n.zoom();return[((e-i)/a-s.x)/u,((t-o)/a-s.y)/u]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=h.getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i=r("padding-left"),o=r("padding-right"),a=r("padding-top"),s=r("padding-bottom"),u=r("border-left-width"),l=r("border-right-width"),c=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth);return this.containerBB=[t.left+i+u,t.top+a+c,d-(i+o),e.clientHeight-(a+s),t.width/(d+(u+l))]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},findNearestElements:function(e,t,n,r){var i,o,a=this,s=this,u=s.getCachedZSortedEles(),l=[],c=s.cy.zoom(),d=s.cy.hasCompoundNodes(),h=(r?24:8)/c,p=(r?8:2)/c,f=(r?8:2)/c,v=1/0;function g(e,t){if(e.isNode()){if(o)return;o=e,l.push(e)}if(e.isEdge()&&(null==t||t<v))if(i){if(i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value&&i.pstyle("z-compound-depth").value===e.pstyle("z-compound-depth").value)for(var n=0;n<l.length;n++)if(l[n].isEdge()){l[n]=e,i=e,v=null!=t?t:v;break}}else l.push(e),i=e,v=null!=t?t:v}function y(n){var r=n.outerWidth()+2*p,i=n.outerHeight()+2*p,o=r/2,u=i/2,l=n.position();if(l.x-o<=e&&e<=l.x+o&&l.y-u<=t&&t<=l.y+u&&s.nodeShapes[a.getNodeShape(n)].checkPoint(e,t,0,r,i,l.x,l.y))return g(n,0),!0}function m(n){var r,i=n._private,o=i.rscratch,u=n.pstyle("width").pfValue,c=n.pstyle("arrow-scale").value,p=u/2+h,f=p*p,v=2*p,m=i.source,b=i.target;if("segments"===o.edgeType||"straight"===o.edgeType||"haystack"===o.edgeType){for(var x=o.allpts,w=0;w+3<x.length;w+=2)if(lt(e,t,x[w],x[w+1],x[w+2],x[w+3],v)&&f>(r=ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return g(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5<o.allpts.length;w+=4)if(ct(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5],v)&&f>(r=dt(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 E=a.getArrowWidth(u,c),k=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<k.length;w++){var P=k[w],C=s.arrowShapes[n.pstyle(P.name+"-arrow-shape").value],S=n.pstyle("width").pfValue;if(C.roughCollide(e,t,E,P.angle,{x:P.x,y:P.y},S,h)&&C.collide(e,t,E,P.angle,{x:P.x,y:P.y},S,h))return g(n),!0}d&&l.length>0&&(y(m),y(b))}function b(e,t,n){return we(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],u=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&u){var l=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,v=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),k=function(e,t){return{x:(e-=l)*w-(t-=c)*E+l,y:e*E+t*w+c}},P=k(v,m),C=k(v,x),S=k(y,m),_=k(y,x);if(pt(e,t,[P.x+h,P.y+p,S.x+h,S.y+p,_.x+h,_.y+p,C.x+h,C.y+p]))return g(n),!0}else if(at(s,e,t))return g(n),!0}}n&&(u=u.interactive);for(var w=u.length-1;w>=0;w--){var E=u[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return l},getAllInBox:function(e,t,n,r){for(var i,o=this.getCachedZSortedEles().interactive,a=[],s=Math.min(e,n),u=Math.max(e,n),l=Math.min(t,r),c=Math.max(t,r),d=et({x1:e=s,y1:t=l,x2:n=u,y2:r=c}),h=0;h<o.length;h++){var p=o[h];if(p.isNode()){var f=p,v=f.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});ot(d,v)&&!st(v,d)&&a.push(f)}else{var g=p,y=g._private,m=y.rscratch;if(null!=m.startX&&null!=m.startY&&!at(d,m.startX,m.startY))continue;if(null!=m.endX&&null!=m.endY&&!at(d,m.endX,m.endY))continue;if("bezier"===m.edgeType||"multibezier"===m.edgeType||"self"===m.edgeType||"compound"===m.edgeType||"segments"===m.edgeType||"haystack"===m.edgeType){for(var b=y.rstyle.bezierPts||y.rstyle.linePts||y.rstyle.haystackPts,x=!0,w=0;w<b.length;w++)if(!at(d,(i=b[w]).x,i.y)){x=!1;break}x&&a.push(g)}else"haystack"!==m.edgeType&&"straight"!==m.edgeType||a.push(g)}}return a}},aa={calculateArrowAngles:function(e){var t,n,r,i,o,a,s=e._private.rscratch,u="haystack"===s.edgeType,l="bezier"===s.edgeType,c="multibezier"===s.edgeType,d="segments"===s.edgeType,h="compound"===s.edgeType,p="self"===s.edgeType;u?(r=s.haystackPts[0],i=s.haystackPts[1],o=s.haystackPts[2],a=s.haystackPts[3]):(r=s.arrowStartX,i=s.arrowStartY,o=s.arrowEndX,a=s.arrowEndY),f=s.midX,v=s.midY,d?(t=r-s.segpts[0],n=i-s.segpts[1]):c||h||p||l?(t=r-Qe((S=s.allpts)[0],S[2],S[4],.1),n=i-Qe(S[1],S[3],S[5],.1)):(t=r-f,n=i-v),s.srcArrowAngle=Xe(t,n);var f=s.midX,v=s.midY;if(u&&(f=(r+o)/2,v=(i+a)/2),t=o-r,n=a-i,d)if((S=s.allpts).length/2%2==0)t=S[g=S.length/2]-S[y=g-2],n=S[g+1]-S[y+1];else{var g,y,m=2+(g=S.length/2-1);t=S[g]-S[y=g-2],n=S[g+1]-S[y+1]}else if(c||h||p){var b,x,w,E,k,P,C,S=s.allpts;s.ctrlpts.length/2%2==0?(b=Qe(S[P=S.length/2-1],S[k=P+2],S[C=k+2],0),x=Qe(S[P+1],S[k+1],S[C+1],0),w=Qe(S[P],S[k],S[C],1e-4),E=Qe(S[P+1],S[k+1],S[C+1],1e-4)):(b=Qe(S[P=(k=S.length/2-1)-2],S[k],S[C=k+2],.4999),x=Qe(S[P+1],S[k+1],S[C+1],.4999),w=Qe(S[P],S[k],S[C],.5),E=Qe(S[P+1],S[k+1],S[C+1],.5)),t=w-b,n=E-x}if(s.midtgtArrowAngle=Xe(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d&&((S=s.allpts).length/2%2==0||(t=-(S[m=2+(g=S.length/2-1)]-S[g]),n=-(S[m+1]-S[g+1]))),s.midsrcArrowAngle=Xe(t,n),d)t=o-s.segpts[s.segpts.length-2],n=a-s.segpts[s.segpts.length-1];else if(c||h||p||l){var _=(S=s.allpts).length;t=o-Qe(S[_-6],S[_-4],S[_-2],.9),n=a-Qe(S[_-5],S[_-3],S[_-1],.9)}else t=o-f,n=a-v;s.tgtArrowAngle=Xe(t,n)}};aa.getArrowWidth=aa.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+", "+t];return r||(r=Math.max(Math.pow(13.37*e,.9),29)*t,n[e+", "+t]=r,r)};var sa={};function ua(e){var t=[];if(null!=e){for(var n=0;n<e.length;n+=2)t.push({x:e[n],y:e[n+1]});return t}}sa.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=r.source,s=r.target,u=a.position(),l=s.position(),c=a.width(),d=s.width(),h=a.height(),p=s.height(),f=n.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*f+u.x,i.source.y*h*f+u.y,i.target.x*d*f+l.x,i.target.y*p*f+l.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},sa.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=t.posPts,i=t.intersectionPts,o=t.vectorNormInverse,a=e.pstyle("edge-distances").value,s=e.pstyle("segment-weights"),u=e.pstyle("segment-distances"),l=Math.min(s.pfValue.length,u.pfValue.length);n.edgeType="segments",n.segpts=[];for(var c=0;c<l;c++){var d=s.pfValue[c],h=u.pfValue[c],p=1-d,f="node-position"===a?r:i,v={x:f.x1*p+f.x2*d,y:f.y1*p+f.y2*d};n.segpts.push(v.x+o.x*h,v.y+o.y*h)}},sa.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,o=t.dirCounts,a=t.srcPos,s=e.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;i.edgeType="self";var h=n,p=d;r&&(h=0,p=u);var f=l-Math.PI/2,v=f-c/2,g=f+c/2,y=String(l+"_"+c);h=void 0===o[y]?o[y]=0:++o[y],i.ctrlpts=[a.x+1.4*Math.cos(v)*p*(h/3+1),a.y+1.4*Math.sin(v)*p*(h/3+1),a.x+1.4*Math.cos(g)*p*(h/3+1),a.y+1.4*Math.sin(g)*p*(h/3+1)]},sa.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType="compound";var o=t.srcPos,a=t.tgtPos,s=t.srcW,u=t.srcH,l=t.tgtW,c=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),p=n,f=d;r&&(p=0,f=h?h.pfValue[0]:void 0);var v={x:o.x-s/2,y:o.y-u/2},g={x:a.x-l/2,y:a.y-c/2},y={x:Math.min(v.x,g.x),y:Math.min(v.y,g.y)},m=Math.max(.5,Math.log(.01*s)),b=Math.max(.5,Math.log(.01*l));i.ctrlpts=[y.x,y.y-(1+Math.pow(50,1.12)/100)*f*(p/3+1)*m,y.x-(1+Math.pow(50,1.12)/100)*f*(p/3+1)*b,y.y]},sa.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},sa.findBezierPoints=function(e,t,n,r,i){var o=e._private.rscratch,a=t.vectorNormInverse,s=t.posPts,u=t.intersectionPts,l=e.pstyle("edge-distances").value,c=e.pstyle("control-point-step-size").pfValue,d=e.pstyle("control-point-distances"),h=e.pstyle("control-point-weights"),p=d&&h?Math.min(d.value.length,h.value.length):1,f=d?d.pfValue[0]:void 0,v=h.value[0],g=r;o.edgeType=g?"multibezier":"bezier",o.ctrlpts=[];for(var y=0;y<p;y++){var m,b=(.5-t.eles.length/2+n)*c*(i?-1:1),x=He(b);g&&(f=d?d.pfValue[y]:c,v=h.value[y]);var w=void 0!==(m=r?f:void 0!==f?x*f:void 0)?m:b,E=1-v,k="node-position"===l?s:u,P={x:k.x1*E+k.x2*v,y:k.y1*E+k.y2*v};o.ctrlpts.push(P.x+a.x*w,P.y+a.y*w)}},sa.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r=t.posPts,i=t.srcW,o=t.srcH,a=t.tgtW,s=t.tgtH,u="node-position"!==e.pstyle("edge-distances").value,l=e.pstyle("taxi-direction").value,c=l,d=e.pstyle("taxi-turn"),h="%"===d.units,p=d.pfValue,f=p<0,v=e.pstyle("taxi-turn-min-distance").pfValue,g=u?(o+s)/2:0,y=r.x2-r.x1,m=r.y2-r.y1,b=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},x=b(y,u?(i+a)/2:0),w=b(m,g),E=!1;"auto"===c?l=Math.abs(x)>Math.abs(w)?"horizontal":"vertical":"upward"===c||"downward"===c?(l="vertical",E=!0):"leftward"!==c&&"rightward"!==c||(l="horizontal",E=!0);var k,P="vertical"===l,C=P?w:x,S=P?m:y,_=He(S),j=!1;E&&(h||f)||!("downward"===c&&S<0||"upward"===c&&S>0||"leftward"===c&&S>0||"rightward"===c&&S<0)||(C=(_*=-1)*Math.abs(C),j=!0);var D=function(e){return Math.abs(e)<v||Math.abs(e)>=Math.abs(C)},T=D(k=h?(p<0?1+p:p)*C:(p<0?C:0)+p*_),B=D(Math.abs(C)-Math.abs(k));if(!T&&!B||j)if(P){var O=r.y1+k+(u?o/2*_:0);n.segpts=[r.x1,O,r.x2,O]}else{var M=r.x1+k+(u?i/2*_:0);n.segpts=[M,r.y1,M,r.y2]}else if(P){var N=Math.abs(S)<=o/2,I=Math.abs(y)<=a/2;if(N){var L=(r.x1+r.x2)/2;n.segpts=[L,r.y1,L,r.y2]}else if(I){var A=(r.y1+r.y2)/2;n.segpts=[r.x1,A,r.x2,A]}else n.segpts=[r.x1,r.y2]}else{var z=Math.abs(S)<=i/2,R=Math.abs(m)<=s/2;if(z){var F=(r.y1+r.y2)/2;n.segpts=[r.x1,F,r.x2,F]}else if(R){var V=(r.x1+r.x2)/2;n.segpts=[V,r.y1,V,r.y2]}else n.segpts=[r.x2,r.y1]}},sa.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,u=t.tgtH,l=t.srcShape,c=t.tgtShape,d=!k(n.startX)||!k(n.startY),h=!k(n.arrowStartX)||!k(n.arrowStartY),p=!k(n.endX)||!k(n.endY),f=!k(n.arrowEndX)||!k(n.arrowEndY),v=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,g=Ge({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),y=g<v,m=Ge({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),b=m<v,x=!1;if(d||h||y){x=!0;var w={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(w.x*w.x+w.y*w.y),P={x:w.x/E,y:w.y/E},C=Math.max(o,a),S={x:n.ctrlpts[0]+2*P.x*C,y:n.ctrlpts[1]+2*P.y*C},_=l.intersectLine(r.x,r.y,o,a,S.x,S.y,0);y?(n.ctrlpts[0]=n.ctrlpts[0]+P.x*(v-g),n.ctrlpts[1]=n.ctrlpts[1]+P.y*(v-g)):(n.ctrlpts[0]=_[0]+P.x*v,n.ctrlpts[1]=_[1]+P.y*v)}if(p||f||b){x=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},D=Math.sqrt(j.x*j.x+j.y*j.y),T={x:j.x/D,y:j.y/D},B=Math.max(o,a),O={x:n.ctrlpts[0]+2*T.x*B,y:n.ctrlpts[1]+2*T.y*B},M=c.intersectLine(i.x,i.y,s,u,O.x,O.y,0);b?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(v-m),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(v-m)):(n.ctrlpts[0]=M[0]+T.x*v,n.ctrlpts[1]=M[1]+T.y*v)}x&&this.findEndpoints(e)}},sa.storeAllpts=function(e){var t=e._private.rscratch;if("multibezier"===t.edgeType||"bezier"===t.edgeType||"self"===t.edgeType||"compound"===t.edgeType){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);var r;t.allpts.push(t.endX,t.endY),t.ctrlpts.length/2%2==0?(t.midX=t.allpts[r=t.allpts.length/2-1],t.midY=t.allpts[r+1]):(t.midX=Qe(t.allpts[r=t.allpts.length/2-3],t.allpts[r+2],t.allpts[r+4],.5),t.midY=Qe(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if("straight"===t.edgeType)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if("segments"===t.edgeType)if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.segpts.length%4==0){var i=t.segpts.length/2,o=i-2;t.midX=(t.segpts[o]+t.segpts[i])/2,t.midY=(t.segpts[o+1]+t.segpts[i+1])/2}else{var a=t.segpts.length/2-1;t.midX=t.segpts[a],t.midY=t.segpts[a+1]}},sa.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||k(t.startX)&&k(t.startY)&&k(t.endX)&&k(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,pe("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},sa.findEdgeControlPoints=function(e){var t=this;if(e&&0!==e.length){for(var n=this,r=n.cy.hasCompoundNodes(),i={map:new ke,get:function(e){var t=this.map.get(e[0]);return null!=t?t.get(e[1]):null},set:function(e,t){var n=this.map.get(e[0]);null==n&&(n=new ke,this.map.set(e[0],n)),n.set(e[1],t)}},o=[],a=[],s=0;s<e.length;s++){var u=e[s],l=u._private,c=u.pstyle("curve-style").value;if(!u.removed()&&u.takesUpSpace())if("haystack"!==c){var d="unbundled-bezier"===c||"segments"===c||"straight"===c||"taxi"===c,h="unbundled-bezier"===c||"bezier"===c,p=l.target,f=[l.source.poolIndex(),p.poolIndex()].sort(),v=i.get(f);null==v&&(i.set(f,v={eles:[]}),o.push(f)),v.eles.push(u),d&&(v.hasUnbundled=!0),h&&(v.hasBezier=!0)}else a.push(u)}for(var g=function(e){var a=i.get(o[e]),s=void 0;if(!a.hasUnbundled){var u=a.eles[0].parallelEdges().filter((function(e){return e.isBundledBezier()}));xe(a.eles),u.forEach((function(e){return a.eles.push(e)})),a.eles.sort((function(e,t){return e.poolIndex()-t.poolIndex()}))}var l=a.eles[0],c=l.source(),d=l.target();if(c.poolIndex()>d.poolIndex()){var h=c;c=d,d=h}var p=a.srcPos=c.position(),f=a.tgtPos=d.position(),v=a.srcW=c.outerWidth(),g=a.srcH=c.outerHeight(),y=a.tgtW=d.outerWidth(),m=a.tgtH=d.outerHeight(),b=a.srcShape=n.nodeShapes[t.getNodeShape(c)],x=a.tgtShape=n.nodeShapes[t.getNodeShape(d)];a.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var w=0;w<a.eles.length;w++){var E=a.eles[w],P=E[0]._private.rscratch,C=E.pstyle("curve-style").value,S="unbundled-bezier"===C||"segments"===C||"taxi"===C,_=!c.same(E.source());if(!a.calculatedIntersection&&c!==d&&(a.hasBezier||a.hasUnbundled)){a.calculatedIntersection=!0;var j=b.intersectLine(p.x,p.y,v,g,f.x,f.y,0),D=a.srcIntn=j,T=x.intersectLine(f.x,f.y,y,m,p.x,p.y,0),B=a.tgtIntn=T,O=a.intersectionPts={x1:j[0],x2:T[0],y1:j[1],y2:T[1]},M=a.posPts={x1:p.x,x2:f.x,y1:p.y,y2:f.y},N=T[1]-j[1],I=T[0]-j[0],L=Math.sqrt(I*I+N*N),A=a.vector={x:I,y:N},z=a.vectorNorm={x:A.x/L,y:A.y/L},R={x:-z.y,y:z.x};a.nodesOverlap=!k(L)||x.checkPoint(j[0],j[1],0,y,m,f.x,f.y)||b.checkPoint(T[0],T[1],0,v,g,p.x,p.y),a.vectorNormInverse=R,s={nodesOverlap:a.nodesOverlap,dirCounts:a.dirCounts,calculatedIntersection:!0,hasBezier:a.hasBezier,hasUnbundled:a.hasUnbundled,eles:a.eles,srcPos:f,tgtPos:p,srcW:y,srcH:m,tgtW:v,tgtH:g,srcIntn:B,tgtIntn:D,srcShape:x,tgtShape:b,posPts:{x1:M.x2,y1:M.y2,x2:M.x1,y2:M.y1},intersectionPts:{x1:O.x2,y1:O.y2,x2:O.x1,y2:O.y1},vector:{x:-A.x,y:-A.y},vectorNorm:{x:-z.x,y:-z.y},vectorNormInverse:{x:-R.x,y:-R.y}}}var F=_?s:a;P.nodesOverlap=F.nodesOverlap,P.srcIntn=F.srcIntn,P.tgtIntn=F.tgtIntn,r&&(c.isParent()||c.isChild()||d.isParent()||d.isChild())&&(c.parents().anySame(d)||d.parents().anySame(c)||c.same(d)&&c.isParent())?t.findCompoundLoopPoints(E,F,w,S):c===d?t.findLoopPoints(E,F,w,S):"segments"===C?t.findSegmentsPoints(E,F):"taxi"===C?t.findTaxiPoints(E,F):"straight"===C||!S&&a.eles.length%2==1&&w===Math.floor(a.eles.length/2)?t.findStraightEdgePoints(E):t.findBezierPoints(E,F,w,S,_),t.findEndpoints(E),t.tryToCorrectInvalidPoints(E,F),t.checkForInvalidEdgeWarning(E),t.storeAllpts(E),t.storeEdgeProjections(E),t.calculateArrowAngles(E),t.recalculateEdgeLabelProjections(E),t.calculateLabelAngles(E)}},y=0;y<o.length;y++)g(y);this.findHaystackPoints(a)}},sa.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if("segments"===t.edgeType)return this.recalculateRenderedStyle(e),ua(t.segpts)},sa.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if("bezier"===n||"multibezier"===n||"self"===n||"compound"===n)return this.recalculateRenderedStyle(e),ua(t.ctrlpts)},sa.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var la={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),i=e.outerHeight();if(2===t.value.length){var o=[t.pfValue[0],t.pfValue[1]];return"%"===t.units[0]&&(o[0]=o[0]*r),"%"===t.units[1]&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}var a=t.pfValue[0];a=-Math.PI/2+a;var s=2*Math.max(r,i),u=[n.x+Math.cos(a)*s,n.y+Math.sin(a)*s];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,i,u[0],u[1],0)},findEndpoints:function(e){var t,n,r,i,o,a=this,s=e.source()[0],u=e.target()[0],l=s.position(),c=u.position(),d=e.pstyle("target-arrow-shape").value,h=e.pstyle("source-arrow-shape").value,p=e.pstyle("target-distance-from-node").pfValue,f=e.pstyle("source-distance-from-node").pfValue,v=e.pstyle("curve-style").value,g=e._private.rscratch,y=g.edgeType,m="self"===y||"compound"===y,b="bezier"===y||"multibezier"===y||m,x="bezier"!==y,w="straight"===y||"segments"===y,E="segments"===y,P=b||x||w,C=m||"taxi"===v,S=e.pstyle("source-endpoint"),_=C?"outside-to-node":S.value,j=e.pstyle("target-endpoint"),D=C?"outside-to-node":j.value;if(g.srcManEndpt=S,g.tgtManEndpt=j,b){var T=[g.ctrlpts[0],g.ctrlpts[1]];n=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:T,r=T}else if(w){var B=E?g.segpts.slice(0,2):[c.x,c.y];n=E?g.segpts.slice(g.segpts.length-2):[l.x,l.y],r=B}if("inside-to-node"===D)t=[c.x,c.y];else if(j.units)t=this.manualEndptToPx(u,j);else if("outside-to-line"===D)t=g.tgtIntn;else if("outside-to-node"===D||"outside-to-node-or-label"===D?i=n:"outside-to-line"!==D&&"outside-to-line-or-label"!==D||(i=[l.x,l.y]),t=a.nodeShapes[this.getNodeShape(u)].intersectLine(c.x,c.y,u.outerWidth(),u.outerHeight(),i[0],i[1],0),"outside-to-node-or-label"===D||"outside-to-line-or-label"===D){var O=u._private.rscratch,M=O.labelX,N=O.labelY,I=O.labelWidth/2,L=O.labelHeight/2,A=u.pstyle("text-valign").value;"top"===A?N-=L:"bottom"===A&&(N+=L);var z=u.pstyle("text-halign").value;"left"===z?M-=I:"right"===z&&(M+=I);var R=wt(i[0],i[1],[M-I,N-L,M+I,N-L,M+I,N+L,M-I,N+L],c.x,c.y);if(R.length>0){var F=l,V=Ue(F,qe(t)),Z=Ue(F,qe(R)),Y=V;Z<V&&(t=R,Y=Z),R.length>2&&Ue(F,{x:R[2],y:R[3]})<Y&&(t=[R[2],R[3]])}}var q=Et(t,n,a.arrowShapes[d].spacing(e)+p),X=Et(t,n,a.arrowShapes[d].gap(e)+p);if(g.endX=X[0],g.endY=X[1],g.arrowEndX=q[0],g.arrowEndY=q[1],"inside-to-node"===_)t=[l.x,l.y];else if(S.units)t=this.manualEndptToPx(s,S);else if("outside-to-line"===_)t=g.srcIntn;else if("outside-to-node"===_||"outside-to-node-or-label"===_?o=r:"outside-to-line"!==_&&"outside-to-line-or-label"!==_||(o=[c.x,c.y]),t=a.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0),"outside-to-node-or-label"===_||"outside-to-line-or-label"===_){var W=s._private.rscratch,H=W.labelX,G=W.labelY,U=W.labelWidth/2,K=W.labelHeight/2,Q=s.pstyle("text-valign").value;"top"===Q?G-=K:"bottom"===Q&&(G+=K);var $=s.pstyle("text-halign").value;"left"===$?H-=U:"right"===$&&(H+=U);var J=wt(o[0],o[1],[H-U,G-K,H+U,G-K,H+U,G+K,H-U,G+K],l.x,l.y);if(J.length>0){var ee=c,te=Ue(ee,qe(t)),ne=Ue(ee,qe(J)),re=te;ne<te&&(t=[J[0],J[1]],re=ne),J.length>2&&Ue(ee,{x:J[2],y:J[3]})<re&&(t=[J[2],J[3]])}}var ie=Et(t,r,a.arrowShapes[h].spacing(e)+f),oe=Et(t,r,a.arrowShapes[h].gap(e)+f);g.startX=oe[0],g.startY=oe[1],g.arrowStartX=ie[0],g.arrowStartY=ie[1],P&&(g.badLine=!(k(g.startX)&&k(g.startY)&&k(g.endX)&&k(g.endY)))},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return"haystack"===(this.recalculateRenderedStyle(e),t.edgeType)?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return"haystack"===(this.recalculateRenderedStyle(e),t.edgeType)?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},ca={};function da(e,t,n){for(var r=function(e,t,n,r){return Qe(e,t,n,r)},i=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var a=e.bezierProjPcts[o];i.push({x:r(n[0],n[2],n[4],a),y:r(n[1],n[3],n[5],a)})}}ca.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,"multibezier"===r||"bezier"===r||"self"===r||"compound"===r){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)da(this,e,n.allpts.slice(i,i+6))}else if("segments"===r){var o=t.rstyle.linePts=[];for(i=0;i+1<n.allpts.length;i+=2)o.push({x:n.allpts[i],y:n.allpts[i+1]})}else if("haystack"===r){var a=n.haystackPts;t.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},ca.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var ha={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!T(t)){var n,r,i=e._private,o=e.width(),a=e.height(),s=e.padding(),u=e.position(),l=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,d=i.rscratch,h=i.rstyle;switch(l){case"left":n=u.x-o/2-s;break;case"right":n=u.x+o/2+s;break;default:n=u.x}switch(c){case"top":r=u.y-a/2-s;break;case"bottom":r=u.y+a/2+s;break;default:r=u.y}d.labelX=n,d.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},pa=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},fa=function(e,t){return pa(t.x-e.x,t.y-e.y)};ha.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,o={mid:e.pstyle("label").strValue,source:e.pstyle("source-label").strValue,target:e.pstyle("target-label").strValue};if(o.mid||o.source||o.target){var a=function(e,t,r){Ee(n.rscratch,e,t,r),Ee(n.rstyle,e,t,r)};a("labelX",null,(t={x:r.midX,y:r.midY}).x),a("labelY",null,t.y);var s=pa(r.midDispX,r.midDispY);a("labelAutoAngle",null,s);var u=function(s){var u,l="source"===s;if(o[s]){var c=e.pstyle(s+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var d,h=function e(){if(e.cache)return e.cache;for(var t=[],o=0;o+5<r.allpts.length;o+=4)t.push({p0:{x:r.allpts[o],y:r.allpts[o+1]},p1:{x:r.allpts[o+2],y:r.allpts[o+3]},p2:{x:r.allpts[o+4],y:r.allpts[o+5]},startDist:0,length:0,segments:[]});var a=n.rstyle.bezierPts,s=i.bezierProjPcts.length;function u(e,t,n,r,i){var o=Ge(t,n),a=e.segments[e.segments.length-1];e.segments.push({p0:t,p1:n,t0:r,t1:i,startDist:a?a.startDist+a.length:0,length:o}),e.length+=o}for(var l=0;l<t.length;l++){var c=t[l],d=t[l-1];d&&(c.startDist=d.startDist+d.length),u(c,c.p0,a[l*s],0,i.bezierProjPcts[0]);for(var h=0;h<s-1;h++)u(c,a[l*s+h],a[l*s+h+1],i.bezierProjPcts[h],i.bezierProjPcts[h+1]);u(c,a[l*s+s-1],c.p2,i.bezierProjPcts[s-1],1)}return e.cache=t}(),p=0,f=0,v=0;v<h.length;v++){for(var g=h[l?v:h.length-1-v],y=0;y<g.segments.length;y++){var m=g.segments[l?y:g.segments.length-1-y];if(p=f,(f+=m.length)>=c||v===h.length-1&&y===g.segments.length-1){d={cp:g,segment:m};break}}if(d)break}var b=d.cp,x=d.segment,w=(c-p)/x.length,E=x.t1-x.t0,k=l?x.t0+E*w:x.t1-E*w;k=Je(0,k,1),t=$e(b.p0,b.p1,b.p2,k),u=function(e,t,n,r){var i=Je(0,r-.001,1),o=Je(0,r+.001,1),a=$e(e,t,n,i),s=$e(e,t,n,o);return fa(a,s)}(b.p0,b.p1,b.p2,k);break;case"straight":case"segments":case"haystack":for(var P,C,S,_,j=0,D=r.allpts.length,T=0;T+3<D&&(l?(S={x:r.allpts[T],y:r.allpts[T+1]},_={x:r.allpts[T+2],y:r.allpts[T+3]}):(S={x:r.allpts[D-2-T],y:r.allpts[D-1-T]},_={x:r.allpts[D-4-T],y:r.allpts[D-3-T]}),C=j,!((j+=P=Ge(S,_))>=c));T+=2);var B=(c-C)/P;B=Je(0,B,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Ge(e,t);return n=null==n?0:n,{x:e.x+i/a*(r=null!=r?r:n*a),y:e.y+o/a*r}}(S,_,B),u=fa(S,_)}a("labelX",s,t.x),a("labelY",s,t.y),a("labelAutoAngle",s,u)}};u("source"),u("target"),this.applyLabelDimensions(e)}},ha.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},ha.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=we(n.rscratch,"labelWrapCachedLines",t)||[],u="wrap"!==a?1:Math.max(s.length,1),l=i.height/u,c=l*o,d=i.width,h=i.height+(u-1)*(o-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)},ha.getLabelText=function(e,t){var n=e._private,r=e.pstyle((t?t+"-":"")+"label").strValue,i=e.pstyle("text-transform").value,o=function(e,r){return r?(Ee(n.rscratch,e,t,r),r):we(n.rscratch,e,t)};if(!r)return"";"none"==i||("uppercase"==i?r=r.toUpperCase():"lowercase"==i&&(r=r.toLowerCase()));var a=e.pstyle("text-wrap").value;if("wrap"===a){var s=o("labelKey");if(null!=s&&o("labelWrapKey")===s)return o("labelWrapCachedText");for(var u=r.split("\n"),l=e.pstyle("text-max-width").pfValue,c="anywhere"===e.pstyle("text-overflow-wrap").value,d=[],h=/[\s\u200b]+/,p=c?"":" ",f=0;f<u.length;f++){var v=u[f],g=this.calculateLabelDimensions(e,v).width;if(c){var y=v.split("").join("\u200b");v=y}if(g>l){for(var m=v.split(h),b="",x=0;x<m.length;x++){var w=m[x];this.calculateLabelDimensions(e,0===b.length?w:b+p+w).width<=l?b+=w+p:(b&&d.push(b),b=w+p)}b.match(/^[\s\u200b]+$/)||d.push(b)}else d.push(v)}o("labelWrapCachedLines",d),r=o("labelWrapCachedText",d.join("\n")),o("labelWrapKey",s)}else if("ellipsis"===a){var E=e.pstyle("text-max-width").pfValue,k="",P=!1;if(this.calculateLabelDimensions(e,r).width<E)return r;for(var C=0;C<r.length&&!(this.calculateLabelDimensions(e,k+r[C]+"\u2026").width>E);C++)k+=r[C],C===r.length-1&&(P=!0);return P||(k+="\u2026"),k}return r},ha.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"}},ha.calculateLabelDimensions=function(e,t){var n=ee(t,e._private.labelDimsKey),r=this.labelDimCache||(this.labelDimCache=[]),i=r[n];if(null!=i)return i;var o=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue,s=e.pstyle("font-family").strValue,u=e.pstyle("font-weight").strValue,l=this.labelCalcCanvas,c=this.labelCalcCanvasContext;if(!l){l=this.labelCalcCanvas=document.createElement("canvas"),c=this.labelCalcCanvasContext=l.getContext("2d");var d=l.style;d.position="absolute",d.left="-9999px",d.top="-9999px",d.zIndex="-1",d.visibility="hidden",d.pointerEvents="none"}c.font="".concat(o," ").concat(u," ").concat(a,"px ").concat(s);for(var h=0,p=0,f=t.split("\n"),v=0;v<f.length;v++){var g=c.measureText(f[v]),y=Math.ceil(g.width),m=a;h=Math.max(y,h),p+=m}return r[n]={width:h+=0,height:p+=0}},ha.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),i=e.pstyle((t?t+"-":"")+"text-rotation"),o=i.strValue;return"none"===o?0:r&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:i.pfValue},ha.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 va={},ga=!1;va.getNodeShape=function(e){var t=e.pstyle("shape").value;if("cutrectangle"===t&&(e.width()<28||e.height()<28))return ga||(pe("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),ga=!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 ya={};[oa,aa,sa,la,ca,ha,va,{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.length;r++){var i=e[r],o=i._private,a=o.rstyle;a.clean=!1,a.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",(function(e){r(e.target)})).on("style.* background.*",(function(e){r(e.target,!1)}));var i=function(i){if(i){var o=n.onUpdateEleCalcsFns;t.cleanStyle();for(var a=0;a<t.length;a++){var s=t[a],u=s._private.rstyle;s.isNode()&&!u.cleanConnected&&(r(s.connectedEdges()),u.cleanConnected=!0)}if(o)for(var l=0;l<o.length;l++)(0,o[l])(i,t);n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){i(!0)},n.beforeRender(i,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(e){return e._private.rstyle.cleanConnected},r=[],i=[];if(!this.destroyed){void 0===t&&(t=!0);for(var o=0;o<e.length;o++){var a=e[o],s=a._private,u=s.rstyle;!a.isEdge()||n(a.source())&&n(a.target())||(u.clean=!1),t&&u.clean||a.removed()||"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):r.push(a),u.clean=!0)}for(var l=0;l<i.length;l++){var c=i[l],d=c._private.rstyle,h=c.position();this.recalculateNodeLabelProjection(c),d.nodeX=h.x,d.nodeY=h.y,d.nodeW=c.pstyle("width").pfValue,d.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(r);for(var p=0;p<r.length;p++){var f=r[p]._private,v=f.rstyle,g=f.rscratch;v.srcX=g.arrowStartX,v.srcY=g.arrowStartY,v.tgtX=g.arrowEndX,v.tgtY=g.arrowEndY,v.midX=g.midX,v.midY=g.midY,v.labelAngle=g.labelAngle,v.sourceLabelAngle=g.sourceLabelAngle,v.targetLabelAngle=g.targetLabelAngle}}}},{updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(i=e[n])._private.rscratch;i.grabbed()&&!i.isParent()?t.push(i):r.inDragLayer?e.drag.push(i):e.nondrag.push(i)}for(n=0;n<t.length;n++){var i;e.drag.push(i=t[n])}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(si),t.interactive=t.filter((function(e){return e.interactive()})),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}}].forEach((function(e){R(ya,e)}));var ma={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},i=r[e];if(i)return i.image.complete||i.image.addEventListener("load",n),i.image;var o=(i=r[e]=r[e]||{}).image=new Image;return o.addEventListener("load",n),o.addEventListener("error",(function(){o.error=!0})),"data:"===e.substring(0,"data:".length).toLowerCase()||(o.crossOrigin=t),o.src=e,o}},ba={registerBinding:function(e,t,n,r){var i=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,i)},binder:function(e){var t=this,n=e===window||e===document||e===document.body||"undefined"!=typeof HTMLElement&&e instanceof HTMLElement;if(null==t.supportsPassiveEvents){var r=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return r=!0,!0}});window.addEventListener("test",null,i)}catch(a){}t.supportsPassiveEvents=r}var o=function(r,i,o){var a=Array.prototype.slice.call(arguments);return n&&t.supportsPassiveEvents&&(a[2]={capture:null!=o&&o,passive:!1,once:!1}),t.bindings.push({target:e,args:a}),(e.addEventListener||e.on).apply(e,a),this};return{on:o,addEventListener:o,addListener:o,bind:o}},nodeIsDraggable:function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},nodeIsGrabbable:function(e){return this.nodeIsDraggable(e)&&e.interactive()},load:function(){var e=this,t=function(e){return e.selected()},n=function(t,n,r,i){null==t&&(t=e.cy);for(var o=0;o<n.length;o++)t.emit({originalEvent:r,type:n[o],position:i})},r=function(e){return e.shiftKey||e.metaKey||e.ctrlKey},o=function(t,n){var r=!0;if(e.cy.hasCompoundNodes()&&t&&t.pannable()){for(var i=0;n&&i<n.length;i++)if((t=n[i]).isNode()&&t.isParent()&&!t.pannable()){r=!1;break}}else r=!0;return r},a=function(e){e[0]._private.rscratch.inDragLayer=!0},s=function(e){e[0]._private.rscratch.isGrabTarget=!0},u=function(e,t){var n=t.addToList;n.has(e)||(n.merge(e),function(e){e[0]._private.grabbed=!0}(e))},l=function(t,n){n=n||{};var r=t.cy().hasCompoundNodes();n.inDragLayer&&(t.forEach(a),t.neighborhood().stdFilter((function(e){return!r||e.isEdge()})).forEach(a)),n.addToList&&t.forEach((function(e){u(e,n)})),function(e,t){if(e.cy().hasCompoundNodes()&&(null!=t.inDragLayer||null!=t.addToList)){var n=e.descendants();t.inDragLayer&&(n.forEach(a),n.connectedEdges().forEach(a)),t.addToList&&t.addToList.unmerge(n)}}(t,n),h(t,{inDragLayer:n.inDragLayer}),e.updateCachedGrabbedEles()},c=l,d=function(t){t&&(e.getCachedZSortedEles().forEach((function(e){!function(e){e[0]._private.grabbed=!1}(e),function(e){e[0]._private.rscratch.inDragLayer=!1}(e),function(e){e[0]._private.rscratch.isGrabTarget=!1}(e)})),e.updateCachedGrabbedEles())},h=function(e,t){if((null!=t.inDragLayer||null!=t.addToList)&&e.cy().hasCompoundNodes()){var n=e.ancestors().orphans();if(!n.same(e)){var r=n.descendants().spawnSelf().merge(n).unmerge(e).unmerge(e.descendants()),i=r.connectedEdges();t.inDragLayer&&(i.forEach(a),r.forEach(a)),t.addToList&&r.forEach((function(e){u(e,t)}))}}},p=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},f="undefined"!=typeof MutationObserver,v="undefined"!=typeof ResizeObserver;f?(e.removeObserver=new MutationObserver((function(t){for(var n=0;n<t.length;n++){var r=t[n].removedNodes;if(r)for(var i=0;i<r.length;i++)if(r[i]===e.container){e.destroy();break}}})),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",(function(t){e.destroy()}));var g=i((function(){e.cy.resize()}),100);f&&(e.styleObserver=new MutationObserver(g),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(window,"resize",g),v&&(e.resizeObserver=new ResizeObserver(g),e.resizeObserver.observe(e.container));var y=function(){e.invalidateContainerClientCoordsCache()};!function(e,t){for(;null!=e;)t(e),e=e.parentNode}(e.container,(function(t){e.registerBinding(t,"transitionend",y),e.registerBinding(t,"animationend",y),e.registerBinding(t,"scroll",y)})),e.registerBinding(e.container,"contextmenu",(function(e){e.preventDefault()}));var m=function(t){for(var n=e.findContainerClientCoords(),r=n[0],i=n[1],o=n[2],a=n[3],s=t.touches?t.touches:[t],u=!1,l=0;l<s.length;l++){var c=s[l];if(r<=c.clientX&&c.clientX<=r+o&&i<=c.clientY&&c.clientY<=i+a){u=!0;break}}if(!u)return!1;for(var d=e.container,h=t.target.parentNode,p=!1;h;){if(h===d){p=!0;break}h=h.parentNode}return!!p};e.registerBinding(e.container,"mousedown",(function(t){if(m(t)){t.preventDefault(),p(),e.hoverData.capture=!0,e.hoverData.which=t.which;var r=e.cy,i=[t.clientX,t.clientY],o=e.projectIntoViewport(i[0],i[1]),a=e.selection,u=e.findNearestElements(o[0],o[1],!0,!1),d=u[0],h=e.dragData.possibleDragElements;if(e.hoverData.mdownPos=o,e.hoverData.mdownGPos=i,3==t.which){e.hoverData.cxtStarted=!0;var f={originalEvent:t,type:"cxttapstart",position:{x:o[0],y:o[1]}};d?(d.activate(),d.emit(f),e.hoverData.down=d):r.emit(f),e.hoverData.downTime=(new Date).getTime(),e.hoverData.cxtDragged=!1}else if(1==t.which){if(d&&d.activate(),null!=d&&e.nodeIsGrabbable(d)){var v=function(e){return{originalEvent:t,type:e,position:{x:o[0],y:o[1]}}};if(s(d),d.selected()){h=e.dragData.possibleDragElements=r.collection();var g=r.$((function(t){return t.isNode()&&t.selected()&&e.nodeIsGrabbable(t)}));l(g,{addToList:h}),d.emit(v("grabon")),g.forEach((function(e){e.emit(v("grab"))}))}else h=e.dragData.possibleDragElements=r.collection(),c(d,{addToList:h}),d.emit(v("grabon")).emit(v("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=d,e.hoverData.downs=u,e.hoverData.downTime=(new Date).getTime(),n(d,["mousedown","tapstart","vmousedown"],t,{x:o[0],y:o[1]}),null==d?(a[4]=1,e.data.bgActivePosistion={x:o[0],y:o[1]},e.redrawHint("select",!0),e.redraw()):d.pannable()&&(a[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout((function(){if(!e.hoverData.tapholdCancelled){var n=e.hoverData.down;n?n.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}}):r.emit({originalEvent:t,type:"taphold",position:{x:o[0],y:o[1]}})}}),e.tapholdDuration)}a[0]=a[2]=o[0],a[1]=a[3]=o[1]}}),!1),e.registerBinding(window,"mousemove",(function(t){if(e.hoverData.capture||m(t)){var i=!1,a=e.cy,s=a.zoom(),u=[t.clientX,t.clientY],c=e.projectIntoViewport(u[0],u[1]),h=e.hoverData.mdownPos,p=e.hoverData.mdownGPos,f=e.selection,v=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(v=e.findNearestElement(c[0],c[1],!0,!1));var g,y=e.hoverData.last,b=e.hoverData.down,x=[c[0]-f[2],c[1]-f[3]],w=e.dragData.possibleDragElements;if(p){var E=u[0]-p[0],P=u[1]-p[1];e.hoverData.isOverThresholdDrag=g=E*E+P*P>=e.desktopTapThreshold2}var C=r(t);g&&(e.hoverData.tapholdCancelled=!0),i=!0,n(v,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var S=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(g){var _={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(_):a.emit(_),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,a.panningEnabled()&&a.userPanningEnabled()){var j;if(e.hoverData.justStartedPan){var D=e.hoverData.mdownPos;j={x:(c[0]-D[0])*s,y:(c[1]-D[1])*s},e.hoverData.justStartedPan=!1}else j={x:x[0]*s,y:x[1]*s};a.panBy(j),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[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(a.boxSelectionEnabled()&&C)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),S();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var T=!e.dragData.didDrag;T&&e.redrawHint("eles",!0),e.dragData.didDrag=!0;var B=a.collection();e.hoverData.draggingEles||l(w,{inDragLayer:!0});var O={x:0,y:0};if(k(x[0])&&k(x[1])&&(O.x+=x[0],O.y+=x[1],T)){var M=e.hoverData.dragDelta;M&&k(M[0])&&k(M[1])&&(O.x+=M[0],O.y+=M[1])}for(var N=0;N<w.length;N++){var I=w[N];e.nodeIsDraggable(I)&&I.grabbed()&&B.push(I)}e.hoverData.draggingEles=!0,B.silentShift(O).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();i=!0}else g&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!C&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=qe(h),e.redrawHint("select",!0),e.redraw()):S(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],i?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(window,"mouseup",(function(i){if(e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(i.clientX,i.clientY),s=e.selection,u=e.findNearestElement(a[0],a[1],!0,!1),l=e.dragData.possibleDragElements,c=e.hoverData.down,h=r(i);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:i,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:i,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(n(u,["mouseup","tapend","vmouseup"],i,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||n(c,["click","tap","vclick"],i,{x:a[0],y:a[1]}),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||r(i)||(o.$(t).unselect(["tapunselect"]),l.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=l=o.collection()),u!=c||e.dragData.didDrag||e.hoverData.selecting||null!=u&&u._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?u.selected()?u.unselect(["tapunselect"]):u.select(["tapselect"]):h||(o.$(t).unmerge(u).unselect(["tapunselect"]),u.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var v=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),v.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:i,position:{x:a[0],y:a[1]}}),"additive"===o.selectionType()||h||o.$(t).unmerge(v).unselect(),v.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).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 g=c&&c.grabbed();d(l),g&&(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,E,P,C,S,_,j,D,T,B,O,M=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[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:a[0],y:a[1]}})}}};e.registerBinding(e.container,"wheel",M,!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||M(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 N,I,L,A,z=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},R=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",N=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var r=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var u=e.findContainerClientCoords();T=u[2],B=u[3],x=t.touches[0].clientY-(D=u[1]),w=t.touches[1].clientX-(j=u[0]),E=t.touches[1].clientY-D,O=0<=(b=t.touches[0].clientX-j)&&b<=T&&0<=w&&w<=T&&0<=x&&x<=B&&0<=E&&E<=B;var h=r.pan(),f=r.zoom();if(P=z(b,x,w,E),C=R(b,x,w,E),_=[((S=[(b+w)/2,(x+E)/2])[0]-h.x)/f,(S[1]-h.y)/f],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),k=y[0];if(null!=k&&(k.activate(),e.touchData.start=k,e.touchData.starts=y,e.nodeIsGrabbable(k))){var M=e.dragData.touchDragEles=r.collection(),N=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),k.selected()?(N=r.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),l(N,{addToList:M})):c(k,{addToList:M}),s(k);var I=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};k.emit(I("grabon")),N?N.forEach((function(e){e.emit(I("grab"))})):k.emit(I("grab"))}n(k,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==k&&(e.data.bgActivePosistion={x:a[0],y:a[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 L=e.touchData.startPosition=[],A=0;A<i.length;A++)L[A]=o[A]=i[A];var F=t.touches[0];e.touchData.startGPosition=[F.clientX,F.clientY]}}},!1),e.registerBinding(window,"touchmove",I=function(t){var r=e.touchData.capture;if(r||m(t)){var i=e.selection,a=e.cy,s=e.touchData.now,u=e.touchData.earlier,c=a.zoom();if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);s[0]=h[0],s[1]=h[1]}t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),s[2]=h[0],s[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),s[4]=h[0],s[5]=h[1]);var p,f=e.touchData.startGPosition;if(r&&t.touches[0]&&f){for(var v=[],g=0;g<s.length;g++)v[g]=s[g]-u[g];var y=t.touches[0].clientX-f[0],S=t.touches[0].clientY-f[1];p=y*y+S*S>=e.touchTapThreshold2}if(r&&e.touchData.cxt){t.preventDefault();var T=R(L=t.touches[0].clientX-j,A=t.touches[0].clientY-D,F=t.touches[1].clientX-j,V=t.touches[1].clientY-D);if(T/C>=2.25||T>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(r&&e.touchData.cxt){B={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(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var M=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&M===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=M,M&&M.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(r&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.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&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),te=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var N=0;N<te.length;N++){var I=te[N]._private;I.grabbed=!1,I.rscratch.inDragLayer=!1}}var L,A,F,V,Z=e.touchData.start,Y=z(L=t.touches[0].clientX-j,A=t.touches[0].clientY-D,F=t.touches[1].clientX-j,V=t.touches[1].clientY-D),q=Y/P;if(O){var X=(L-b+(F-w))/2,W=(A-x+(V-E))/2,H=a.zoom(),G=H*q,U=a.pan(),K=_[0]*H+U.x,Q=_[1]*H+U.y,$={x:-G/H*(K-U.x-X)+K,y:-G/H*(Q-U.y-W)+Q};Z&&Z.active()&&(d(te=e.dragData.touchDragEles),e.redrawHint("drag",!0),e.redrawHint("eles",!0),Z.unactivate().emit("freeon"),te.emit("free"),e.dragData.didDrag&&(Z.emit("dragfreeon"),te.emit("dragfree"))),a.viewport({zoom:G,pan:$,cancelOnFailedZoom:!0}),P=Y,b=L,x=A,w=F,E=V,e.pinching=!0}t.touches[0]&&(h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY),s[0]=h[0],s[1]=h[1]),t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),s[2]=h[0],s[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),s[4]=h[0],s[5]=h[1])}else if(t.touches[0]&&!e.touchData.didSelect){var J=e.touchData.start,ee=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(M=e.findNearestElement(s[0],s[1],!0,!0)),r&&null!=J&&t.preventDefault(),r&&null!=J&&e.nodeIsDraggable(J))if(p){var te=e.dragData.touchDragEles,ne=!e.dragData.didDrag;ne&&l(te,{inDragLayer:!0}),e.dragData.didDrag=!0;var re={x:0,y:0};k(v[0])&&k(v[1])&&(re.x+=v[0],re.y+=v[1],ne&&(e.redrawHint("eles",!0),(ie=e.touchData.dragDelta)&&k(ie[0])&&k(ie[1])&&(re.x+=ie[0],re.y+=ie[1]))),e.hoverData.draggingEles=!0,te.silentShift(re).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==u[0]&&e.touchData.startPosition[1]==u[1]&&e.redrawHint("eles",!0),e.redraw()}else{var ie;0===(ie=e.touchData.dragDelta=e.touchData.dragDelta||[]).length?(ie.push(v[0]),ie.push(v[1])):(ie[0]+=v[0],ie[1]+=v[1])}if(n(J||M,["touchmove","tapdrag","vmousemove"],t,{x:s[0],y:s[1]}),J&&J.grabbed()||M==ee||(ee&&ee.emit({originalEvent:t,type:"tapdragout",position:{x:s[0],y:s[1]}}),M&&M.emit({originalEvent:t,type:"tapdragover",position:{x:s[0],y:s[1]}})),e.touchData.last=M,r)for(N=0;N<s.length;N++)s[N]&&e.touchData.startPosition[N]&&p&&(e.touchData.singleTouchMoved=!0);r&&(null==J||J.pannable())&&a.panningEnabled()&&a.userPanningEnabled()&&(o(J,e.touchData.starts)&&(t.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=qe(e.touchData.startPosition)),e.swipePanning?a.panBy({x:v[0]*c,y:v[1]*c}):p&&(e.swipePanning=!0,a.panBy({x:y*c,y:S*c}),J&&(J.unactivate(),e.redrawHint("select",!0),e.touchData.start=null))),h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY),s[0]=h[0],s[1]=h[1])}for(g=0;g<s.length;g++)u[g]=s[g];r&&t.touches.length>0&&!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",L=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(window,"touchend",A=function(r){var i=e.touchData.start;if(e.touchData.capture){0===r.touches.length&&(e.touchData.capture=!1),r.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,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]),r.touches[2]&&(h=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY),l[4]=h[0],l[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:r,type:"cxttapend",position:{x:l[0],y:l[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:r,type:"cxttap",position:{x:l[0],y:l[1]}};i?i.emit(p):s.emit(p)}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 f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:r,position:{x:l[0],y:l[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.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=e.touchData.startPosition[1]-l[1],x=(m*m+b*b)*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&&x<e.touchTapThreshold2&&!e.pinching&&("single"===s.selectionType()?(s.$(t).unmerge(i).unselect(["tapunselect"]),i.select(["tapselect"])):i.selected()?i.unselect(["tapunselect"]):i.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}for(var w=0;w<l.length;w++)c[w]=l[w];e.dragData.didDrag=!1,0===r.touches.length&&(e.touchData.dragDelta=[],e.touchData.startPosition=null,e.touchData.startGPosition=null,e.touchData.didSelect=!1),r.touches.length<2&&(1===r.touches.length&&(e.touchData.startGPosition=[r.touches[0].clientX,r.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),"undefined"==typeof TouchEvent){var F=[],V=function(e){return{clientX:e.clientX,clientY:e.clientY,force:1,identifier:e.pointerId,pageX:e.pageX,pageY:e.pageY,radiusX:e.width/2,radiusY:e.height/2,screenX:e.screenX,screenY:e.screenY,target:e.target}},Z=function(e){for(var t=0;t<F.length;t++)if(F[t].event.pointerId===e.pointerId)return void F.splice(t,1)},Y=function(e){e.touches=F.map((function(e){return e.touch}))},q=function(e){return"mouse"===e.pointerType||4===e.pointerType};e.registerBinding(e.container,"pointerdown",(function(e){q(e)||(e.preventDefault(),function(e){F.push(function(e){return{event:e,touch:V(e)}}(e))}(e),Y(e),N(e))})),e.registerBinding(e.container,"pointerup",(function(e){q(e)||(Z(e),Y(e),A(e))})),e.registerBinding(e.container,"pointercancel",(function(e){q(e)||(Z(e),Y(e),L())})),e.registerBinding(e.container,"pointermove",(function(e){q(e)||(e.preventDefault(),function(e){var t=F.filter((function(t){return t.event.pointerId===e.pointerId}))[0];t.event=e,t.touch=V(e)}(e),Y(e),I(e))}))}}},xa={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return wt(i,o,this.points,e,t,n/2,r/2,a)},checkPoint:function(e,t,n,r,i,o,a){return ft(e,t,this.points,o,a,r,i,[0,-1],n)}}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o){var a=n-e,s=r-t;a/=i,s/=o;var u=Math.sqrt(a*a+s*s),l=u-1;if(l<0)return[];var c=l/u;return[(n-e)*c+e,(r-t)*c+t]}(i,o,e,t,n/2+a,r/2+a)},checkPoint:function(e,t,n,r,i,o,a){return yt(e,t,r,i,o,a,n)}}},generateRoundPolygon:function(e,t){for(var n=new Array(2*t.length),r=0;r<t.length/2;r++){var i,o=2*r;i=r<t.length/2-1?2*(r+1):0,n[4*r]=t[o],n[4*r+1]=t[o+1];var a=t[i]-t[o],s=t[i+1]-t[o+1],u=Math.sqrt(a*a+s*s);n[4*r+2]=a/u,n[4*r+3]=s/u}return this.nodeShapes[e]={renderer:this,name:e,points:n,draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl("round-polygon",e,t,n,r,i,this.points)},intersectLine:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a,s){for(var u,l=[],c=new Array(n.length),d=o/2,h=a/2,p=_t(o,a),f=0;f<n.length/4;f++){var v,g;g=0===f?n.length-2:4*f-2,v=4*f+2;var y=r+d*n[4*f],m=i+h*n[4*f+1],b=p/Math.tan(Math.acos(-n[g]*n[v]-n[g+1]*n[v+1])/2),x=y-b*n[g],w=m-b*n[g+1],E=y+b*n[v],k=m+b*n[v+1];0===f?(c[n.length-2]=x,c[n.length-1]=w):(c[4*f-2]=x,c[4*f-1]=w),c[4*f]=E,c[4*f+1]=k;var P=n[g+1],C=-n[g];P*n[v]+C*n[v+1]<0&&(P*=-1,C*=-1),0!==(u=mt(e,t,r,i,x+P*p,w+C*p,p)).length&&l.push(u[0],u[1])}for(var S=0;S<c.length/4;S++)0!==(u=xt(e,t,r,i,c[4*S],c[4*S+1],c[4*S+2],c[4*S+3],!1)).length&&l.push(u[0],u[1]);if(l.length>2){for(var _=[l[0],l[1]],j=Math.pow(_[0]-e,2)+Math.pow(_[1]-t,2),D=1;D<l.length/2;D++){var T=Math.pow(l[2*D]-e,2)+Math.pow(l[2*D+1]-t,2);T<=j&&(_[0]=l[2*D],_[1]=l[2*D+1],j=T)}return _}return l}(i,o,this.points,e,t,n,r)},checkPoint:function(e,t,n,r,i,o,a){return function(e,t,n,r,i,o,a){for(var s=new Array(n.length),u=o/2,l=a/2,c=_t(o,a),d=c*c,h=0;h<n.length/4;h++){var p,f;f=0===h?n.length-2:4*h-2,p=4*h+2;var v=r+u*n[4*h],g=i+l*n[4*h+1],y=c/Math.tan(Math.acos(-n[f]*n[p]-n[f+1]*n[p+1])/2),m=v-y*n[f],b=g-y*n[f+1],x=v+y*n[p],w=g+y*n[p+1];s[4*h]=m,s[4*h+1]=b,s[4*h+2]=x,s[4*h+3]=w;var E=n[f+1],k=-n[f];E*n[p]+k*n[p+1]<0&&(E*=-1,k*=-1);var P=b+k*c;if(Math.pow(m+E*c-e,2)+Math.pow(P-t,2)<=d)return!0}return pt(e,t,s)}(e,t,this.points,o,a,r,i)}}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:kt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){return ut(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=St(r,i),u=2*s;return!!(ft(e,t,this.points,o,a,r,i-u,[0,-1],n)||ft(e,t,this.points,o,a,r-u,i,[0,-1],n)||yt(e,t,u,u,o-r/2+s,a-i/2+s,n)||yt(e,t,u,u,o+r/2-s,a-i/2+s,n)||yt(e,t,u,u,o+r/2-s,a+i/2-s,n)||yt(e,t,u,u,o-r/2+s,a+i/2-s,n))}}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:kt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},generateCutTrianglePts:function(e,t,n,r){var i=this.cornerLength,o=t/2,a=e/2,s=n-a,u=n+a,l=r-o,c=r+o;return{topLeft:[s,l+i,s+i,l,s+i,l+i],topRight:[u-i,l,u,l+i,u-i,l+i],bottomRight:[u,c-i,u-i,c,u-i,c-i],bottomLeft:[s+i,c,s,c-i,s+i,c-i]}},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateCutTrianglePts(n+2*a,r+2*a,e,t),u=[].concat.apply([],[s.topLeft.splice(0,4),s.topRight.splice(0,4),s.bottomRight.splice(0,4),s.bottomLeft.splice(0,4)]);return wt(i,o,u,e,t)},checkPoint:function(e,t,n,r,i,o,a){if(ft(e,t,this.points,o,a,r,i-2*this.cornerLength,[0,-1],n))return!0;if(ft(e,t,this.points,o,a,r-2*this.cornerLength,i,[0,-1],n))return!0;var s=this.generateCutTrianglePts(r,i,o,a);return pt(e,t,s.topLeft)||pt(e,t,s.topRight)||pt(e,t,s.bottomRight)||pt(e,t,s.bottomLeft)}}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:kt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=this.generateBarrelBezierPts(n+2*a,r+2*a,e,t),u=function(e){var t=$e({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.15),n=$e({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.5),r=$e({x:e[0],y:e[1]},{x:e[2],y:e[3]},{x:e[4],y:e[5]},.85);return[e[0],e[1],t.x,t.y,n.x,n.y,r.x,r.y,e[4],e[5]]},l=[].concat(u(s.topLeft),u(s.topRight),u(s.bottomRight),u(s.bottomLeft));return wt(i,o,l,e,t)},generateBarrelBezierPts:function(e,t,n,r){var i=t/2,o=e/2,a=n-o,s=n+o,u=r-i,l=r+i,c=jt(e,t),d=c.heightOffset,h=c.widthOffset,p=c.ctrlPtOffsetPct*e,f={topLeft:[a,u+d,a+p,u,a+h,u],topRight:[s-h,u,s-p,u,s,u+d],bottomRight:[s,l-d,s-p,l,s-h,l],bottomLeft:[a+h,l,a+p,l,a,l-d]};return f.topLeft.isTop=!0,f.topRight.isTop=!0,f.bottomLeft.isBottom=!0,f.bottomRight.isBottom=!0,f},checkPoint:function(e,t,n,r,i,o,a){var s=jt(r,i),u=s.widthOffset;if(ft(e,t,this.points,o,a,r,i-2*s.heightOffset,[0,-1],n))return!0;if(ft(e,t,this.points,o,a,r-2*u,i,[0,-1],n))return!0;for(var l=this.generateBarrelBezierPts(r,i,o,a),c=function(e,t,n){var r,i,o=n[4],a=n[2],s=n[0],u=n[5],l=n[1],c=Math.min(o,s),d=Math.max(o,s),h=Math.min(u,l),p=Math.max(u,l);if(c<=e&&e<=d&&h<=t&&t<=p){var f=[(r=o)-2*(i=a)+s,2*(i-r),r],v=function(e,t,n,r){var i=t*t-4*e*(n-=r);if(i<0)return[];var o=Math.sqrt(i),a=2*e;return[(-t+o)/a,(-t-o)/a]}(f[0],f[1],f[2],e).filter((function(e){return 0<=e&&e<=1}));if(v.length>0)return v[0]}return null},d=Object.keys(l),h=0;h<d.length;h++){var p=l[d[h]],f=c(e,t,p);if(null!=f){var v=Qe(p[5],p[3],p[1],f);if(p.isTop&&v<=t)return!0;if(p.isBottom&&t<=v)return!0}}return!1}}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:kt(4,0),draw:function(e,t,n,r,i){this.renderer.nodeShapeImpl(this.name,e,t,n,r,i)},intersectLine:function(e,t,n,r,i,o,a){var s=t-(r/2+a),u=xt(i,o,e,t,e-(n/2+a),s,e+(n/2+a),s,!1);return u.length>0?u:ut(i,o,e,t,n,r,a)},checkPoint:function(e,t,n,r,i,o,a){var s=St(r,i),u=2*s;if(ft(e,t,this.points,o,a,r,i-u,[0,-1],n))return!0;if(ft(e,t,this.points,o,a,r-u,i,[0,-1],n))return!0;var l=r/2+2*n,c=i/2+2*n;return!!pt(e,t,[o-l,a-c,o-l,a,o+l,a,o+l,a-c])||!!yt(e,t,u,u,o+r/2-s,a+i/2-s,n)||!!yt(e,t,u,u,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",kt(3,0)),this.generateRoundPolygon("round-triangle",kt(3,0)),this.generatePolygon("rectangle",kt(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",kt(5,0)),this.generateRoundPolygon("round-pentagon",kt(5,0)),this.generatePolygon("hexagon",kt(6,0)),this.generateRoundPolygon("round-hexagon",kt(6,0)),this.generatePolygon("heptagon",kt(7,0)),this.generateRoundPolygon("round-heptagon",kt(7,0)),this.generatePolygon("octagon",kt(8,0)),this.generateRoundPolygon("round-octagon",kt(8,0));var r=new Array(20),i=Ct(5,0),o=Ct(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)r[4*s]=i[2*s],r[4*s+1]=i[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=Pt(r),this.generatePolygon("star",r),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u),e.makePolygon=function(e){var n,r="polygon-"+e.join("$");return(n=this[r])?n:t.generatePolygon(r,e)}}},wa={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||ye();var t=this;void 0===t.averageRedrawTime&&(t.averageRedrawTime=0),void 0===t.lastRedrawTime&&(t.lastRedrawTime=0),void 0===t.lastDrawTime&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){null==t&&de("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort((function(e,t){return t.priority-e.priority}))}}},Ea=function(e,t,n){for(var r=e.beforeRenderCallbacks,i=0;i<r.length;i++)r[i].fn(t,n)};wa.startRenderLoop=function(){var e=this,t=e.cy;e.renderLoopStarted||(e.renderLoopStarted=!0,W((function n(r){if(!e.destroyed){if(t.batching());else if(e.requestedFrame&&!e.skipFrame){Ea(e,!0,r);var i=H();e.render(e.renderOptions);var o=e.lastDrawTime=H();void 0===e.averageRedrawTime&&(e.averageRedrawTime=o-i),void 0===e.redrawCount&&(e.redrawCount=0),e.redrawCount++,void 0===e.redrawTotalTime&&(e.redrawTotalTime=0);var a=o-i;e.redrawTotalTime+=a,e.lastRedrawTime=a,e.averageRedrawTime=e.averageRedrawTime/2+a/2,e.requestedFrame=!1}else Ea(e,!1,r);e.skipFrame=!1,W(n)}})))};var ka=function(e){this.init(e)},Pa=ka.prototype;Pa.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Pa.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container();if(h){var r=h.document,i=r.head,o="__________cytoscape_container",a=null!=r.getElementById("__________cytoscape_stylesheet");if(n.className.indexOf(o)<0&&(n.className=(n.className||"")+" "+o),!a){var s=r.createElement("style");s.id="__________cytoscape_stylesheet",s.innerHTML="."+o+" { position: relative; }",i.insertBefore(s,i.children[0])}"static"===h.getComputedStyle(n).getPropertyValue("position")&&pe("A Cytoscape container has style position:static and so can not use UI extensions properly")}t.selection=[void 0,void 0,void 0,void 0,0],t.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],t.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},t.dragData={possibleDragElements:[]},t.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},t.redraws=0,t.showFps=e.showFps,t.debug=e.debug,t.hideEdgesOnViewport=e.hideEdgesOnViewport,t.textureOnViewport=e.textureOnViewport,t.wheelSensitivity=e.wheelSensitivity,t.motionBlurEnabled=e.motionBlur,t.forcedPixelRatio=k(e.pixelRatio)?e.pixelRatio:null,t.motionBlur=e.motionBlur,t.motionBlurOpacity=e.motionBlurOpacity,t.motionBlurTransparency=1-t.motionBlurOpacity,t.motionBlurPxRatio=1,t.mbPxRBlurry=1,t.minMbLowQualFrames=4,t.fullQualityMb=!1,t.clearedForMotionBlur=[],t.desktopTapThreshold=e.desktopTapThreshold,t.desktopTapThreshold2=e.desktopTapThreshold*e.desktopTapThreshold,t.touchTapThreshold=e.touchTapThreshold,t.touchTapThreshold2=e.touchTapThreshold*e.touchTapThreshold,t.tapholdDuration=500,t.bindings=[],t.beforeRenderCallbacks=[],t.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},t.registerNodeShapes(),t.registerArrowShapes(),t.registerCalculationListeners()},Pa.notify=function(e,t){var n=this;this.destroyed||("init"!==e?"destroy"!==e?(("add"===e||"remove"===e||"move"===e&&n.cy.hasCompoundNodes()||"load"===e||"zorder"===e||"mount"===e)&&n.invalidateCachedZSortedEles(),"viewport"===e&&n.redrawHint("select",!0),"load"!==e&&"resize"!==e&&"mount"!==e||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},Pa.destroy=function(){var e=this;e.destroyed=!0,e.cy.stopAnimationLoop();for(var t=0;t<e.bindings.length;t++){var n=e.bindings[t],r=n.target;(r.off||r.removeEventListener).apply(r,n.args)}if(e.bindings=[],e.beforeRenderCallbacks=[],e.onUpdateEleCalcsFns=[],e.removeObserver&&e.removeObserver.disconnect(),e.styleObserver&&e.styleObserver.disconnect(),e.resizeObserver&&e.resizeObserver.disconnect(),e.labelCalcDiv)try{document.body.removeChild(e.labelCalcDiv)}catch(i){}},Pa.isHeadless=function(){return!1},[ia,ya,ma,ba,xa,wa].forEach((function(e){R(Pa,e)}));var Ca=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=i((function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()}),e.deqRedrawThreshold);n.beforeRender((function(i,o){var a=H(),s=n.averageRedrawTime,u=n.lastRedrawTime,l=[],c=n.cy.extent(),d=n.getPixelRatio();for(i||n.flushRenderedStyleQueue();;){var h=H(),p=h-a,f=h-o;if(u<1e3/60){if(f>=e.deqFastCost*(1e3/60-(i?s:0)))break}else if(i){if(p>=e.deqCost*u||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*(1e3/60))break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var g=0;g<v.length;g++)l.push(v[g])}l.length>0&&(e.onDeqd(t,l),!i&&e.shouldRedraw(t,l,d,c)&&r())}),(e.priority||ce)(t))}}},Sa=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ue;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&&de("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new Ce,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}(),_a={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},ja=me({getKey:null,doesEleInvalidateKey:ue,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:se,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Da=function(e,t){this.renderer=e,this.onDequeues=[];var n=ja(t);R(this,n),this.lookup=new Sa(n.getKey,n.doesEleInvalidateKey),this.setupDequeueing()},Ta=Da.prototype;Ta.reasons=_a,Ta.getTextureQueue=function(e){return this.eleImgCaches=this.eleImgCaches||{},this.eleImgCaches[e]=this.eleImgCaches[e]||[]},Ta.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Ta.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new o((function(e,t){return t.reqs-e.reqs}))},Ta.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Ta.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),u=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(We(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=a.eleTextBiggerThanMin(e,l);if(!this.isVisible(e,h))return null;var p,f=u.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var v=o.getTextureQueue(p),g=v[v.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};g||(g=v[v.length-1]),g||(g=y()),g.width-g.usedWidth<d&&(g=y());for(var m,b=function(e){return e&&e.scaledLabelShown===h},x=i&&i===_a.dequeue,w=i&&i===_a.highQuality,E=i&&i===_a.downscale,k=r+1;k<=3;k++){var P=u.get(e,k);if(P){m=P;break}}var C=m&&m.level===r+1?m:null,S=function(){g.context.drawImage(C.texture.canvas,C.x,0,C.width,C.height,g.usedWidth,0,d,c)};if(g.context.setTransform(1,0,0,1,0,0),g.context.clearRect(g.usedWidth,0,d,p),b(C))S();else if(b(m)){if(!w)return o.queueElement(e,m.level-1),m;for(var _=m.level;_>r;_--)C=o.getElement(e,t,n,_,_a.downscale);S()}else{var j;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var T=u.get(e,D);if(T){j=T;break}}if(b(j))return o.queueElement(e,r),j;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 f={x:g.usedWidth,texture:g,level:r,scale:l,width:d,height:c,scaledLabelShown:h},g.usedWidth+=Math.ceil(d+8),g.eleCaches.push(f),u.set(e,r,f),o.checkTextureFullness(g),f},Ta.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},Ta.invalidateElement=function(e){var t=this.lookup,n=[];if(t.isInvalid(e)){for(var r=-4;r<=3;r++){var i=t.getForCachedKey(e,r);i&&n.push(i)}if(t.invalidate(e))for(var o=0;o<n.length;o++){var a=n[o],s=a.texture;s.invalidatedWidth+=a.width,a.invalidated=!0,this.checkTextureUtility(s)}this.removeFromQueue(e)}},Ta.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},Ta.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?be(t,e):e.fullnessChecks++},Ta.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;be(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o<i.length;o++){var a=i[o];r.deleteCache(a.key,a.level)}xe(i),this.getRetiredTextureQueue(t).push(e)},Ta.addTexture=function(e,t){var n={};return this.getTextureQueue(e).push(n),n.eleCaches=[],n.height=e,n.width=Math.max(1024,t),n.usedWidth=0,n.invalidatedWidth=0,n.fullnessChecks=0,n.canvas=this.renderer.makeOffscreenCanvas(n.width,n.height),n.context=n.canvas.getContext("2d"),n},Ta.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),i=0;i<r.length;i++){var o=r[i];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,xe(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),be(r,o),n.push(o),o}},Ta.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Ta.dequeue=function(e){for(var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=[],i=this.lookup,o=0;o<1&&t.size()>0;o++){var a=t.pop(),s=a.key,u=a.eles[0],l=i.hasCache(u,a.level);if(n[s]=null,!l){r.push(a);var c=this.getBoundingBox(u);this.getElement(u,c,e,a.level,_a.dequeue)}}return r},Ta.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=ae,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Ta.onDequeue=function(e){this.onDequeues.push(e)},Ta.offDequeue=function(e){be(this.onDequeues,e)},Ta.setupDequeueing=Ca({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<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,r){for(var i=0;i<t.length;i++)for(var o=t[i].eles,a=0;a<o.length;a++){var s=o[a].boundingBox();if(ot(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ba=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=H()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=i((function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)}),50),n.beforeRender((function(e,n){t.skipping=n-t.lastInvalidationTime<=250}),n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new o((function(e,t){return t.reqs-e.reqs})),t.setupDequeueing()},Oa=Ba.prototype,Ma=0,Na=Math.pow(2,53)-1;Oa.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),i=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,i),a={id:Ma=++Ma%Na,bb:e,level:t,width:r,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,u=-a.bb.x1,l=-a.bb.y1;return s.scale(n,n),s.translate(u,l),a},Oa.getLayers=function(e,t,n){var r=this,i=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,null==n)if((n=Math.ceil(We(i*t)))<-4)n=-4;else if(i>=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,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 o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&be(c,a)}}();var d=function(t){var i=(t=t||{}).after;if(function(){if(!a){a=et();for(var t=0;t<e.length;t++)n=a,r=e[t].boundingBox(),n.x1=Math.min(n.x1,r.x1),n.x2=Math.max(n.x2,r.x2),n.w=n.x2-n.x1,n.y1=Math.min(n.y1,r.y1),n.y2=Math.max(n.y2,r.y2),n.h=n.y2-n.y1}var n,r}(),a.w*l*(a.h*l)>16e6)return null;var o=r.makeLayer(a,n);if(null!=i){var s=c.indexOf(i)+1;c.splice(s,0,o)}else(void 0===t.insert||t.insert)&&c.unshift(o);return o};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,v=0;v<e.length;v++){var g=e[v],y=g._private.rscratch,m=y.imgLayerCaches=y.imgLayerCaches||{},b=m[n];if(b)h=b;else{if((!h||h.eles.length>=p||!st(h.bb,g.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,g):r.drawEleInLayer(h,g,n,t),h.eles.push(g),m[n]=h}}return s||(f?null:c)},Oa.getEleLevelForLayerLevel=function(e,t){return e},Oa.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Oa.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Oa.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=-1,a=0;a<t.length;a++)if(i.eles[0]===t[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==t[s+a]){this.invalidateLayer(i);break}}}},Oa.updateElementsInLayers=function(e,t){for(var n=S(e[0]),r=0;r<e.length;r++)for(var i=n?null:e[r],o=n?e[r]:e[r].ele,a=o._private.rscratch,s=a.imgLayerCaches=a.imgLayerCaches||{},u=-4;u<=2;u++){var l=s[u];l&&(i&&this.getEleLevelForLayerLevel(l.level)!==i.level||t(l,o,i))}},Oa.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},Oa.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=H(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Oa.invalidateLayer=function(e){if(this.lastInvalidationTime=H(),!e.invalid){var t=e.level,n=e.eles;be(this.layersByLevel[t],e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var r=0;r<n.length;r++){var i=n[r]._private.rscratch.imgLayerCaches;i&&(i[t]=null)}}},Oa.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,(function(e,n,r){var i=e.replacement;if(i||((i=e.replacement=t.makeLayer(e.bb,e.level)).replaces=e,i.eles=e.eles),!i.reqs)for(var o=0;o<i.eles.length;o++)t.queueLayer(i,i.eles[o])}))},Oa.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Oa.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,i=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(i[t.id()])return;r.push(t),i[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},Oa.dequeue=function(e){for(var t=this.layersQueue,n=[],r=0;r<1&&0!==t.size();){var i=t.peek();if(i.replacement)t.pop();else if(i.replaces&&i!==i.replaces.replacement)t.pop();else if(i.invalid)t.pop();else{var o=i.elesQueue.shift();o&&(this.drawEleInLayer(i,o,i.level,e),r++),0===n.length&&n.push(!0),0===i.elesQueue.length&&(t.pop(),i.reqs=0,i.replaces&&this.applyLayerReplacement(i),this.requestRedraw())}}return n},Oa.applyLayerReplacement=function(e){var t=this.layersByLevel[e.level],n=e.replaces,r=t.indexOf(n);if(!(r<0||n.invalid)){t[r]=e;for(var i=0;i<e.eles.length;i++){var o=e.eles[i]._private,a=o.imgLayerCaches=o.imgLayerCaches||{};a&&(a[e.level]=e)}this.requestRedraw()}},Oa.requestRedraw=i((function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()}),100),Oa.setupDequeueing=Ca({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:ce,shouldRedraw:se,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Ia,La={};function Aa(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function za(e,t,n){for(var r,i=0;i<t.length;i++){var o=t[i];0===i&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Ra(e,t,n){e.beginPath&&e.beginPath();for(var r=t,i=0;i<r.length;i++)e.lineTo((s=r[i]).x,s.y);var o=n,a=n[0];for(e.moveTo(a.x,a.y),i=1;i<o.length;i++){var s;e.lineTo((s=o[i]).x,s.y)}e.closePath&&e.closePath()}function Fa(e,t,n,r,i){e.beginPath&&e.beginPath(),e.arc(n,r,i,0,2*Math.PI,!1);var o=t,a=o[0];e.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var u=o[s];e.lineTo(u.x,u.y)}e.closePath&&e.closePath()}function Va(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}La.arrowShapeImpl=function(e){return(Ia||(Ia={polygon:Aa,"triangle-backcurve":za,"triangle-tee":Ra,"circle-triangle":Fa,"triangle-cross":Ra,circle:Va}))[e]};var Za={drawElement:function(e,t,n,r,i,o){t.isNode()?this.drawNode(e,t,n,r,i,o):this.drawEdge(e,t,n,r,i,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawCachedElementPortion:function(e,t,n,r,i,o,a,s){var u=this,l=n.getBoundingBox(t);if(0!==l.w&&0!==l.h){var c=n.getElement(t,l,r,i,o);if(null!=c){var d=s(u,t);if(0===d)return;var h,p,f,v,g,y,m=a(u,t),b=l.x1,x=l.y1,w=l.w,E=l.h;if(0!==m){var k=n.getRotationPoint(t);e.translate(f=k.x,v=k.y),e.rotate(m),(g=u.getImgSmoothing(e))||u.setImgSmoothing(e,!0);var P=n.getRotationOffset(t);h=P.x,p=P.y}else h=b,p=x;1!==d&&(e.globalAlpha=(y=e.globalAlpha)*d),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,h,p,w,E),1!==d&&(e.globalAlpha=y),0!==m&&(e.rotate(-m),e.translate(-f,-v),g||u.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},Ya=function(){return 0},qa=function(e,t){return e.getTextAngle(t,null)},Xa=function(e,t){return e.getTextAngle(t,"source")},Wa=function(e,t){return e.getTextAngle(t,"target")},Ha=function(e,t){return t.effectiveOpacity()},Ga=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Za.drawCachedElement=function(e,t,n,r,i,o){var a=this,s=a.data,u=s.eleTxrCache,l=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,h=t.boundingBox(),p=!0===o?u.reasons.highQuality:null;if(0!==h.w&&0!==h.h&&t.visible()&&(!r||ot(h,r))){var f=t.isEdge(),v=t.element()._private.rscratch.badLine;a.drawCachedElementPortion(e,t,u,n,i,p,Ya,Ha),f&&v||a.drawCachedElementPortion(e,t,l,n,i,p,qa,Ga),f&&!v&&(a.drawCachedElementPortion(e,t,c,n,i,p,Xa,Ga),a.drawCachedElementPortion(e,t,d,n,i,p,Wa,Ga)),a.drawElementOverlay(e,t)}},Za.drawElements=function(e,t){for(var n=0;n<t.length;n++)this.drawElement(e,t[n])},Za.drawCachedElements=function(e,t,n,r){for(var i=0;i<t.length;i++)this.drawCachedElement(e,t[i],n,r)},Za.drawCachedNodes=function(e,t,n,r){for(var i=0;i<t.length;i++){var o=t[i];o.isNode()&&this.drawCachedElement(e,o,n,r)}},Za.drawLayeredElements=function(e,t,n,r){var i=this.data.lyrTxrCache.getLayers(t,n);if(i)for(var o=0;o<i.length;o++){var a=i[o],s=a.bb;0!==s.w&&0!==s.h&&e.drawImage(a.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Ua={drawEdge: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],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var u;n&&e.translate(-(u=n).x1,-u.y1);var l=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("line-style").value,h=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,f=l*c,v=l*c,g=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;e.lineWidth=h,e.lineCap=p,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,d),e.lineCap="butt"},y=function(){i&&a.drawEdgeOverlay(e,t)},m=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v;a.drawArrowheads(e,t,n)},b=function(){a.drawElementText(e,t,null,r)};e.lineJoin="round";var x="yes"===t.pstyle("ghost").value;if(x){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,k=t.pstyle("ghost-opacity").value,P=f*k;e.translate(w,E),g(P),m(P),e.translate(-w,-E)}g(),m(),y(),b(),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(),o=t._private.rscratch,a=2*t.pstyle("overlay-padding").pfValue,s=t.pstyle("overlay-color").value;e.lineWidth=a,e.lineCap="self"!==o.edgeType||i?"round":"butt",r.colorStrokeStyle(e,s[0],s[1],s[2],n),r.drawEdgePath(t,e,o.allpts,"solid")}}},drawEdgePath:function(e,t,n,r){var i,o=e._private.rscratch,a=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("$");o.pathCacheKey&&o.pathCacheKey===d?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=d,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(l),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<n.length;h+=4)t.quadraticCurveTo(n[h],n[h+1],n[h+2],n[h+3]);break;case"straight":case"segments":case"haystack":for(var p=2;p+1<n.length;p+=2)t.lineTo(n[p],n[p+1])}t=a,u?t.stroke(i):t.stroke(),t.setLineDash&&t.setLineDash([])},drawArrowheads:function(e,t,n){var r=t._private.rscratch,i="haystack"===r.edgeType;i||this.drawArrowhead(e,t,"source",r.arrowStartX,r.arrowStartY,r.srcArrowAngle,n),this.drawArrowhead(e,t,"mid-target",r.midX,r.midY,r.midtgtArrowAngle,n),this.drawArrowhead(e,t,"mid-source",r.midX,r.midY,r.midsrcArrowAngle,n),i||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},drawArrowhead:function(e,t,n,r,i,o,a){if(!(isNaN(r)||null==r||isNaN(i)||null==i||isNaN(o)||null==o)){var s=t.pstyle(n+"-arrow-shape").value;if("none"!==s){var u="hollow"===t.pstyle(n+"-arrow-fill").value?"both":"filled",l=t.pstyle(n+"-arrow-fill").value,c=t.pstyle("width").pfValue,d=t.pstyle("opacity").value;void 0===a&&(a=d);var h=e.globalCompositeOperation;1===a&&"hollow"!==l||(e.globalCompositeOperation="destination-out",this.colorFillStyle(e,255,255,255,1),this.colorStrokeStyle(e,255,255,255,1),this.drawArrowShape(t,e,u,c,s,r,i,o),e.globalCompositeOperation=h);var p=t.pstyle(n+"-arrow-color").value;this.colorFillStyle(e,p[0],p[1],p[2],a),this.colorStrokeStyle(e,p[0],p[1],p[2],a),this.drawArrowShape(t,e,l,c,s,r,i,o)}}},drawArrowShape:function(e,t,n,r,i,o,a,s){var u,l=this,c=this.usePaths()&&"triangle-cross"!==i,d=!1,h=t,p={x:o,y:a},f=e.pstyle("arrow-scale").value,v=this.getArrowWidth(r,f),g=l.arrowShapes[i];if(c){var y=l.arrowPathCache=l.arrowPathCache||[],m=ee(i),b=y[m];null!=b?(u=t=b,d=!0):(u=t=new Path2D,y[m]=u)}d||(t.beginPath&&t.beginPath(),c?g.draw(t,1,0,{x:0,y:0},1):g.draw(t,v,s,p,r),t.closePath&&t.closePath()),t=h,c&&(t.translate(o,a),t.rotate(s),t.scale(v,v)),"filled"!==n&&"both"!==n||(c?t.fill(u):t.fill()),"hollow"!==n&&"both"!==n||(t.lineWidth=(g.matchEdgeWidth?r:1)/(c?v:1),t.lineJoin="miter",c?t.stroke(u):t.stroke()),c&&(t.scale(1/v,1/v),t.rotate(-s),t.translate(-o,-a))}},Ka={safeDrawImage:function(e,t,n,r,i,o,a,s,u,l){i<=0||o<=0||u<=0||l<=0||e.drawImage(t,n,r,i,o,a,s,u,l)},drawInscribedImage:function(e,t,n,r,i){var o=this,a=n.position(),s=a.x,u=a.y,l=n.cy().style(),c=l.getIndexedStyle.bind(l),d=c(n,"background-fit","value",r),h=c(n,"background-repeat","value",r),p=n.width(),f=n.height(),v=2*n.padding(),g=p+("inner"===c(n,"background-width-relative-to","value",r)?0:v),y=f+("inner"===c(n,"background-height-relative-to","value",r)?0:v),m=n._private.rscratch,b="node"===c(n,"background-clip","value",r),x=c(n,"background-image-opacity","value",r)*i,w=c(n,"background-image-smoothing","value",r),E=t.width||t.cachedW,k=t.height||t.cachedH;null!=E&&null!=k||(document.body.appendChild(t),E=t.cachedW=t.width||t.offsetWidth,k=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var P=E,C=k;if("auto"!==c(n,"background-width","value",r)&&(P="%"===c(n,"background-width","units",r)?c(n,"background-width","pfValue",r)*g:c(n,"background-width","pfValue",r)),"auto"!==c(n,"background-height","value",r)&&(C="%"===c(n,"background-height","units",r)?c(n,"background-height","pfValue",r)*y:c(n,"background-height","pfValue",r)),0!==P&&0!==C){if("contain"===d)P*=S=Math.min(g/P,y/C),C*=S;else if("cover"===d){var S;P*=S=Math.max(g/P,y/C),C*=S}var _=s-g/2,j=c(n,"background-position-x","units",r),D=c(n,"background-position-x","pfValue",r);_+="%"===j?(g-P)*D:D;var T=c(n,"background-offset-x","units",r),B=c(n,"background-offset-x","pfValue",r);_+="%"===T?(g-P)*B:B;var O=u-y/2,M=c(n,"background-position-y","units",r),N=c(n,"background-position-y","pfValue",r);O+="%"===M?(y-C)*N:N;var I=c(n,"background-offset-y","units",r),L=c(n,"background-offset-y","pfValue",r);O+="%"===I?(y-C)*L:L,m.pathCache&&(_-=s,O-=u,s=0,u=0);var A=e.globalAlpha;e.globalAlpha=x;var z=o.getImgSmoothing(e),R=!1;if("no"===w&&z?(o.setImgSmoothing(e,!1),R=!0):"yes"!==w||z||(o.setImgSmoothing(e,!0),R=!0),"no-repeat"===h)b&&(e.save(),m.pathCache?e.clip(m.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,u,g,y),e.clip())),o.safeDrawImage(e,t,0,0,E,k,_,O,P,C),b&&e.restore();else{var F=e.createPattern(t,h);e.fillStyle=F,o.nodeShapes[o.getNodeShape(n)].draw(e,s,u,g,y),e.translate(_,O),e.fill(),e.translate(-_,-O)}e.globalAlpha=A,R&&o.setImgSmoothing(e,z)}}},Qa={};function $a(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:5;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),e.fill()}Qa.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(We(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},Qa.drawElementText=function(e,t,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var u=a.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 p,f=!n;n&&e.translate(-(p=n).x1,-p.y1),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},Qa.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n<this.fontCaches.length;n++)if((t=this.fontCaches[n]).context===e)return t;return this.fontCaches.push(t={context:e}),t},Qa.setupTextStyle=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=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+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,l[0],l[1],l[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],u)},Qa.getTextAngle=function(e,t){var n=e._private.rscratch,r=e.pstyle((t?t+"-":"")+"text-rotation"),i=we(n,"labelAngle",t);return"autorotate"===r.strValue?e.isEdge()?i:0:"none"===r.strValue?0:r.pfValue},Qa.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],o=t._private,a=o.rscratch,s=i?t.effectiveOpacity():1;if(!i||0!==s&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var u,l,c=we(a,"labelX",n),d=we(a,"labelY",n),h=this.getLabelText(t,n);if(null!=h&&""!==h&&!isNaN(c)&&!isNaN(d)){this.setupTextStyle(e,t,i);var p,f=n?n+"-":"",v=we(a,"labelWidth",n),g=we(a,"labelHeight",n),y=t.pstyle(f+"text-margin-x").pfValue,m=t.pstyle(f+"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!==(p=r?this.getTextAngle(t,n):0)&&(e.translate(u=c,l=d),e.rotate(p),c=0,d=0),w){case"top":break;case"center":d+=g/2;break;case"bottom":d+=g}var E=t.pstyle("text-background-opacity").value,k=t.pstyle("text-border-opacity").value,P=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue;if(E>0||P>0&&k>0){var S=c-C;switch(x){case"left":S-=v;break;case"center":S-=v/2}var _=d-g-C,j=v+2*C,D=g+2*C;if(E>0){var T=e.fillStyle,B=t.pstyle("text-background-color").value;e.fillStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+E*s+")";var O=t.pstyle("text-background-shape").strValue;0===O.indexOf("round")?$a(e,S,_,j,D,2):e.fillRect(S,_,j,D),e.fillStyle=T}if(P>0&&k>0){var M=e.strokeStyle,N=e.lineWidth,I=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+I[0]+","+I[1]+","+I[2]+","+k*s+")",e.lineWidth=P,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=P/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(e.strokeRect(S,_,j,D),"double"===L){var A=P/2;e.strokeRect(S+A,_+A,j-2*A,D-2*A)}e.setLineDash&&e.setLineDash([]),e.lineWidth=N,e.strokeStyle=M}}var z=2*t.pstyle("text-outline-width").pfValue;if(z>0&&(e.lineWidth=z),"wrap"===t.pstyle("text-wrap").value){var R=we(a,"labelWrapCachedLines",n),F=we(a,"labelLineHeight",n),V=v/2,Z=this.getLabelJustification(t);switch("auto"===Z||("left"===x?"left"===Z?c+=-v:"center"===Z&&(c+=-V):"center"===x?"left"===Z?c+=-V:"right"===Z&&(c+=V):"right"===x&&("center"===Z?c+=V:"right"===Z&&(c+=v))),w){case"top":case"center":case"bottom":d-=(R.length-1)*F}for(var Y=0;Y<R.length;Y++)z>0&&e.strokeText(R[Y],c,d),e.fillText(R[Y],c,d),d+=F}else z>0&&e.strokeText(h,c,d),e.fillText(h,c,d);0!==p&&(e.rotate(-p),e.translate(-u,-l))}}};for(var Ja={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(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(k(d.x)&&k(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,v=u.usePaths(),g=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&e.translate(-(p=n).x1,-p.y1);for(var m=t.pstyle("background-image"),b=m.value,x=new Array(b.length),w=new Array(b.length),E=0,P=0;P<b.length;P++){var C=b[P],S=x[P]=null!=C&&"none"!==C;if(S){var _=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",P);E++,w[P]=u.getCachedImage(C,_,(function(){l.backgroundTimestamp=Date.now(),t.emitAndNotify("background")}))}}var j=t.pstyle("background-blacken").value,D=t.pstyle("border-width").pfValue,T=t.pstyle("background-opacity").value*f,B=t.pstyle("border-color").value,O=t.pstyle("border-style").value,M=t.pstyle("border-opacity").value*f;e.lineJoin="miter";var N=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:T;u.eleFillStyle(e,t,n)},I=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:M;u.colorStrokeStyle(e,B[0],B[1],B[2],t)},L=t.pstyle("shape").strValue,A=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var z=u.nodePathCache=u.nodePathCache||[],R=te("polygon"===L?L+","+A.join(","):L,""+i,""+r),F=z[R];null!=F?(g=!0,c.pathCache=h=F):(h=new Path2D,z[R]=c.pathCache=h)}var V=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()},Z=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=l.backgrounding,o=0,a=0;a<w.length;a++){var s=t.cy().style().getIndexedStyle(t,"background-image-containment","value",a);r&&"over"===s||!r&&"inside"===s?o++:x[a]&&w[a].complete&&!w[a].error&&(o++,u.drawInscribedImage(e,w[a],t,a,n))}l.backgrounding=!(o===E),i!==l.backgrounding&&t.updateStyle(!1)},Y=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;u.hasPie(t)&&(u.drawPie(e,t,o),n&&(v||u.nodeShapes[u.getNodeShape(t)].draw(e,d.x,d.y,r,i)))},q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,n=(j>0?j:-j)*t,r=j>0?0:255;0!==j&&(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(O){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"===O){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([])}},W=function(){a&&u.drawNodeOverlay(e,t,d,r,i)},H=function(){u.drawElementText(e,t,null,o)},G="yes"===t.pstyle("ghost").value;if(G){var U=t.pstyle("ghost-offset-x").pfValue,K=t.pstyle("ghost-offset-y").pfValue,Q=t.pstyle("ghost-opacity").value,$=Q*f;e.translate(U,K),N(Q*T),V(),Z($,!0),I(Q*M),X(),Y(0!==j||0!==D),Z($,!1),q($),e.translate(-U,-K)}N(),V(),Z(f,!0),I(),X(),Y(0!==j||0!==D),Z(f,!1),q(),v&&e.translate(-d.x,-d.y),H(),W(),n&&e.translate(p.x1,p.y1)}},drawNodeOverlay:function(e,t,n,r,i){if(t.visible()){var o=t.pstyle("overlay-padding").pfValue,a=t.pstyle("overlay-opacity").value,s=t.pstyle("overlay-color").value;if(a>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],a),this.nodeShapes.roundrectangle.draw(e,n.x,n.y,r+2*o,i+2*o),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(),o=t.pstyle("pie-size"),a=r.x,s=r.y,u=t.width(),l=t.height(),c=Math.min(u,l)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,g=p/100;g+d>1&&(g=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*g;0===p||d>=1||d+g>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],v),e.fill(),d+=g)}}},es={getPixelRatio:function(){var e=this.data.contexts[0];return null!=this.forcedPixelRatio?this.forcedPixelRatio:(window.devicePixelRatio||1)/(e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;i<n.length;i++)if((t=n[i]).context===e){r=!1;break}return r&&n.push(t={context:e}),t},createGradientStyleFor:function(e,t,n,r,i){var o,a=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,u=n.pstyle(t+"-gradient-stop-positions").pfValue;if("radial-gradient"===r)if(n.isEdge()){var l=n.sourceEndpoint(),c=n.targetEndpoint(),d=n.midpoint(),h=Ge(l,d),p=Ge(c,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,p))}else{var f=a?{x:0,y:0}:n.position(),v=n.paddedWidth(),g=n.paddedHeight();o=e.createRadialGradient(f.x,f.y,0,f.x,f.y,Math.max(v,g))}else if(n.isEdge()){var y=n.sourceEndpoint(),m=n.targetEndpoint();o=e.createLinearGradient(y.x,y.y,m.x,m.y)}else{var b=a?{x:0,y:0}:n.position(),x=n.paddedWidth()/2,w=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(b.x,b.y-w,b.x,b.y+w);break;case"to-top":o=e.createLinearGradient(b.x,b.y+w,b.x,b.y-w);break;case"to-left":o=e.createLinearGradient(b.x+x,b.y,b.x-x,b.y);break;case"to-right":o=e.createLinearGradient(b.x-x,b.y,b.x+x,b.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(b.x-x,b.y-w,b.x+x,b.y+w);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(b.x-x,b.y+w,b.x+x,b.y-w);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(b.x+x,b.y-w,b.x-x,b.y+w);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(b.x+x,b.y+w,b.x-x,b.y-w)}}if(!o)return null;for(var E=u.length===s.length,k=s.length,P=0;P<k;P++)o.addColorStop(E?u[P]:P/(k-1),"rgba("+s[P][0]+","+s[P][1]+","+s[P][2]+","+i+")");return o},gradientFillStyle:function(e,t,n,r){var i=this.createGradientStyleFor(e,"background",t,n,r);if(!i)return null;e.fillStyle=i},colorFillStyle:function(e,t,n,r,i){e.fillStyle="rgba("+t+","+n+","+r+","+i+")"},eleFillStyle:function(e,t,n){var r=t.pstyle("background-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientFillStyle(e,t,r,n);else{var i=t.pstyle("background-color").value;this.colorFillStyle(e,i[0],i[1],i[2],n)}},gradientStrokeStyle:function(e,t,n,r){var i=this.createGradientStyleFor(e,"line",t,n,r);if(!i)return null;e.strokeStyle=i},colorStrokeStyle:function(e,t,n,r,i){e.strokeStyle="rgba("+t+","+n+","+r+","+i+")"},eleStrokeStyle:function(e,t,n){var r=t.pstyle("line-fill").value;if("linear-gradient"===r||"radial-gradient"===r)this.gradientStrokeStyle(e,t,r,n);else{var i=t.pstyle("line-color").value;this.colorStrokeStyle(e,i[0],i[1],i[2],n)}},matchCanvasSize:function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),i=r[2],o=r[3],a=t.getPixelRatio();e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(a=t.motionBlurPxRatio);var s,u=i*a,l=o*a;if(u!==t.canvasWidth||l!==t.canvasHeight){t.fontCaches=null;var c=n.canvasContainer;c.style.width=i+"px",c.style.height=o+"px";for(var d=0;d<t.CANVAS_LAYERS;d++)(s=n.canvases[d]).width=u,s.height=l,s.style.width=i+"px",s.style.height=o+"px";for(d=0;d<t.BUFFER_COUNT;d++)(s=n.bufferCanvases[d]).width=u,s.height=l,s.style.width=i+"px",s.style.height=o+"px";t.textureMult=1,a<=1&&(s=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,s.width=u*t.textureMult,s.height=l*t.textureMult),t.canvasWidth=u,t.canvasHeight=l}},renderTo:function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},render:function(e){var t=(e=e||ye()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,i=e.forcedZoom,o=e.forcedPan,a=this,s=void 0===e.forcedPxRatio?this.getPixelRatio():e.forcedPxRatio,u=a.cy,l=a.data,c=l.canvasNeedsRedraw,d=a.textureOnViewport&&!t&&(a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming),h=void 0!==e.motionBlur?e.motionBlur:a.motionBlur,p=a.motionBlurPxRatio,f=u.hasCompoundNodes(),v=a.hoverData.draggingEles,g=h=h&&!t&&a.motionBlurEnabled&&!(a.hoverData.selecting||a.touchData.selecting);t||(a.prevPxRatio!==s&&(a.invalidateContainerClientCoordsCache(),a.matchCanvasSize(a.container),a.redrawHint("eles",!0),a.redrawHint("drag",!0)),a.prevPxRatio=s),!t&&a.motionBlurTimeout&&clearTimeout(a.motionBlurTimeout),h&&(null==a.mbFrames&&(a.mbFrames=0),a.mbFrames++,a.mbFrames<3&&(g=!1),a.mbFrames>a.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var y=u.style(),m=u.zoom(),b=void 0!==i?i:m,x=u.pan(),w={x:x.x,y:x.y},E={zoom:m,pan:{x:x.x,y:x.y}},k=a.prevViewport;void 0===k||E.zoom!==k.zoom||E.pan.x!==k.pan.x||E.pan.y!==k.pan.y||v&&!f||(a.motionBlurPxRatio=1),o&&(w=o),b*=s,w.x*=s,w.y*=s;var P=a.getCachedZSortedEles();function C(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function S(e,r){var s,u,c,d;a.clearingMotionBlur||e!==l.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==l.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=w,u=b,c=a.canvasWidth,d=a.canvasHeight):(s={x:x.x*p,y:x.y*p},u=m*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?C(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)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=u.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var _=a.data.bufferContexts[a.TEXTURE_BUFFER];_.setTransform(1,0,0,1,0,0),_.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:_,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(E=a.textureCache.viewport={zoom:u.zoom(),pan:u.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-E.pan.x)/E.zoom,y:(0-E.pan.y)/E.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var j=a.textureCache.texture;E=a.textureCache.viewport,(L=l.contexts[a.NODE]).setTransform(1,0,0,1,0,0),h?C(L,0,0,E.width,E.height):L.clearRect(0,0,E.width,E.height);var D=y.core("outside-texture-bg-color").value,T=y.core("outside-texture-bg-opacity").value;a.colorFillStyle(L,D[0],D[1],D[2],T),L.fillRect(0,0,E.width,E.height),m=u.zoom(),S(L,!1),L.clearRect(E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s),L.drawImage(j,E.mpan.x,E.mpan.y,E.width/E.zoom/s,E.height/E.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var B=u.extent(),O=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),M=a.hideEdgesOnViewport&&O,N=[];if(N[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,N[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),N[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,N[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||N[a.NODE]){var I=h&&!N[a.NODE]&&1!==p;S(L=t||(I?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:l.contexts[a.NODE]),h&&!I?"motionBlur":void 0),M?a.drawCachedNodes(L,P.nondrag,s,B):a.drawLayeredElements(L,P.nondrag,s,B),a.debug&&a.drawDebugPoints(L,P.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||N[a.DRAG])&&(I=h&&!N[a.DRAG]&&1!==p,S(L=t||(I?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:l.contexts[a.DRAG]),h&&!I?"motionBlur":void 0),M?a.drawCachedNodes(L,P.drag,s,B):a.drawCachedElements(L,P.drag,s,B),a.debug&&a.drawDebugPoints(L,P.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){var L;if(S(L=t||l.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){m=a.cy.zoom();var A=y.core("selection-box-border-width").value/m;L.lineWidth=A,L.fillStyle="rgba("+y.core("selection-box-color").value[0]+","+y.core("selection-box-color").value[1]+","+y.core("selection-box-color").value[2]+","+y.core("selection-box-opacity").value+")",L.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),A>0&&(L.strokeStyle="rgba("+y.core("selection-box-border-color").value[0]+","+y.core("selection-box-border-color").value[1]+","+y.core("selection-box-border-color").value[2]+","+y.core("selection-box-opacity").value+")",L.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(l.bgActivePosistion&&!a.hoverData.selecting){m=a.cy.zoom();var z=l.bgActivePosistion;L.fillStyle="rgba("+y.core("active-bg-color").value[0]+","+y.core("active-bg-color").value[1]+","+y.core("active-bg-color").value[2]+","+y.core("active-bg-opacity").value+")",L.beginPath(),L.arc(z.x,z.y,y.core("active-bg-size").pfValue/m,0,2*Math.PI),L.fill()}var R=a.lastRedrawTime;if(a.showFps&&R){R=Math.round(R);var F=Math.round(1e3/R);L.setTransform(1,0,0,1,0,0),L.fillStyle="rgba(255, 0, 0, 0.75)",L.strokeStyle="rgba(255, 0, 0, 0.75)",L.lineWidth=1,L.fillText("1 frame = "+R+" ms = "+F+" fps",0,20),L.strokeRect(0,30,250,20),L.fillRect(0,30,250*Math.min(F/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var V=l.contexts[a.DRAG],Z=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],Y=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!g?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):C(e,0,0,a.canvasWidth,a.canvasHeight),e.drawImage(t,0,0,a.canvasWidth*p,a.canvasHeight*p,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||N[a.NODE])&&(Y(l.contexts[a.NODE],a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],N[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||N[a.DRAG])&&(Y(V,Z,N[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=E,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||u.emit("render")}},ts={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var u=1;u<o.length/2;u++)e.lineTo(t+a*o[2*u],n+s*o[2*u+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2,u=_t(r,i);e.beginPath&&e.beginPath();for(var l=0;l<o.length/4;l++){var c,d;d=0===l?o.length-2:4*l-2,c=4*l+2;var h=t+a*o[4*l],p=n+s*o[4*l+1],f=u/Math.tan(Math.acos(-o[d]*o[c]-o[d+1]*o[c+1])/2),v=h-f*o[d],g=p-f*o[d+1],y=h+f*o[c],m=p+f*o[c+1];0===l?e.moveTo(v,g):e.lineTo(v,g),e.arcTo(h,p,y,m,u)}e.closePath()},drawRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=St(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.arcTo(t+o,n-a,t+o,n,s),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.arcTo(t-o,n-a,t,n-a,s),e.lineTo(t,n-a),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2,s=St(r,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-a),e.lineTo(t+o,n-a),e.lineTo(t+o,n),e.arcTo(t+o,n+a,t,n+a,s),e.arcTo(t-o,n+a,t-o,n,s),e.lineTo(t-o,n-a),e.lineTo(t,n-a),e.closePath()},drawCutRectanglePath:function(e,t,n,r,i){var o=r/2,a=i/2;e.beginPath&&e.beginPath(),e.moveTo(t-o+8,n-a),e.lineTo(t+o-8,n-a),e.lineTo(t+o,n-a+8),e.lineTo(t+o,n+a-8),e.lineTo(t+o-8,n+a),e.lineTo(t-o+8,n+a),e.lineTo(t-o,n+a-8),e.lineTo(t-o,n-a+8),e.closePath()},drawBarrelPath:function(e,t,n,r,i){var o=r/2,a=i/2,s=t-o,u=t+o,l=n-a,c=n+a,d=jt(r,i),h=d.widthOffset,p=d.heightOffset,f=d.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(s,l+p),e.lineTo(s,c-p),e.quadraticCurveTo(s+f,c,s+h,c),e.lineTo(u-h,c),e.quadraticCurveTo(u-f,c,u,c-p),e.lineTo(u,l+p),e.quadraticCurveTo(u-f,l,u-h,l),e.lineTo(s+h,l),e.quadraticCurveTo(s+f,l,s,l+p),e.closePath()}},ns=Math.sin(0),rs=Math.cos(0),is={},os={},as=Math.PI/40,ss=0*Math.PI;ss<2*Math.PI;ss+=as)is[ss]=Math.sin(ss),os[ss]=Math.cos(ss);ts.drawEllipsePath=function(e,t,n,r,i){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,i/2,0,0,2*Math.PI);else for(var o,a,s=r/2,u=i/2,l=0*Math.PI;l<2*Math.PI;l+=as)o=t-s*is[l]*ns+s*os[l]*rs,a=n+u*os[l]*ns+u*is[l]*rs,0===l?e.moveTo(o,a):e.lineTo(o,a);e.closePath()};var us={};function ls(e){var t=e.indexOf(",");return e.substr(t+1)}function cs(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new zn((function(r,i){try{t.toBlob((function(e){null!=e?r(e):i(new Error("`canvas.toBlob()` sent a null value in its callback"))}),n,e.quality)}catch(o){i(o)}}));case"blob":return function(e,t){for(var n=atob(e),r=new ArrayBuffer(n.length),i=new Uint8Array(r),o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return new Blob([r],{type:t})}(ls(r()),n);case"base64":return ls(r());default:return r()}}us.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},us.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),i=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],a=k(e.maxWidth)||k(e.maxHeight),s=this.getPixelRatio(),u=1;if(void 0!==e.scale)i*=e.scale,o*=e.scale,u=e.scale;else if(a){var l=1/0,c=1/0;k(e.maxWidth)&&(l=u*e.maxWidth/i),k(e.maxHeight)&&(c=u*e.maxHeight/o),i*=u=Math.min(l,c),o*=u}a||(i*=s,o*=s,u*=s);var d=document.createElement("canvas");d.width=i,d.height=o,d.style.width=i+"px",d.style.height=o+"px";var h=d.getContext("2d");if(i>0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*u,-n.y1*u),h.scale(u,u),this.drawElements(h,p),h.scale(1/u,1/u),h.translate(n.x1*u,n.y1*u);else{var f=t.pan(),v={x:f.x*u,y:f.y*u};u*=t.zoom(),h.translate(v.x,v.y),h.scale(u,u),this.drawElements(h,p),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,o),h.fill())}return d},us.png=function(e){return cs(e,this.bufferCanvasImage(e),"image/png")},us.jpg=function(e){return cs(e,this.bufferCanvasImage(e),"image/jpeg")};var ds=ps,hs=ps.prototype;function ps(e){var t=this;t.data={canvases:new Array(hs.CANVAS_LAYERS),contexts:new Array(hs.CANVAS_LAYERS),canvasNeedsRedraw:new Array(hs.CANVAS_LAYERS),bufferCanvases:new Array(hs.BUFFER_COUNT),bufferContexts:new Array(hs.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"};p&&p.userAgent.match(/msie|trident|edge/i)&&(i["-ms-touch-action"]="none",i["touch-action"]="none");for(var o=0;o<hs.CANVAS_LAYERS;o++){var a=t.data.canvases[o]=document.createElement("canvas");t.data.contexts[o]=a.getContext("2d"),Object.keys(i).forEach((function(e){a.style[e]=i[e]})),a.style.position="absolute",a.setAttribute("data-id","layer"+o),a.style.zIndex=String(hs.CANVAS_LAYERS-o),t.data.canvasContainer.appendChild(a),t.data.canvasNeedsRedraw[o]=!1}for(t.data.topCanvas=t.data.canvases[0],t.data.canvases[hs.NODE].setAttribute("data-id","layer"+hs.NODE+"-node"),t.data.canvases[hs.SELECT_BOX].setAttribute("data-id","layer"+hs.SELECT_BOX+"-selectbox"),t.data.canvases[hs.DRAG].setAttribute("data-id","layer"+hs.DRAG+"-drag"),o=0;o<hs.BUFFER_COUNT;o++)t.data.bufferCanvases[o]=document.createElement("canvas"),t.data.bufferContexts[o]=t.data.bufferCanvases[o].getContext("2d"),t.data.bufferCanvases[o].style.position="absolute",t.data.bufferCanvases[o].setAttribute("data-id","buffer"+o),t.data.bufferCanvases[o].style.zIndex=String(-o-1),t.data.bufferCanvases[o].style.visibility="hidden";t.pathsEnabled=!0;var s=et(),u=function(e){return{x:-e.w/2,y:-e.h/2}},l=function(e){return e.boundingBox(),e[0]._private.bodyBounds},c=function(e){return e.boundingBox(),e[0]._private.labelBounds.main||s},d=function(e){return e.boundingBox(),e[0]._private.labelBounds.source||s},h=function(e){return e.boundingBox(),e[0]._private.labelBounds.target||s},f=function(e,t){return t},v=function(e,t,n){var r=e?e+"-":"";return{x:t.x+n.pstyle(r+"text-margin-x").pfValue,y:t.y+n.pstyle(r+"text-margin-y").pfValue}},g=function(e,t,n){var r=e[0]._private.rscratch;return{x:r[t],y:r[n]}},y=t.data.eleTxrCache=new Da(t,{getKey:function(e){return e[0]._private.nodeKey},doesEleInvalidateKey:function(e){var t=e[0]._private;return!(t.oldBackgroundTimestamp===t.backgroundTimestamp)},drawElement:function(e,n,r,i,o){return t.drawElement(e,n,r,!1,!1,o)},getBoundingBox:l,getRotationPoint:function(e){return{x:((t=l(e)).x1+t.x2)/2,y:(t.y1+t.y2)/2};var t},getRotationOffset:function(e){return u(l(e))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),m=t.data.lblTxrCache=new Da(t,{getKey:function(e){return e[0]._private.labelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"main",o)},getBoundingBox:c,getRotationPoint:function(e){return v("",g(e,"labelX","labelY"),e)},getRotationOffset:function(e){var t=c(e),n=u(c(e));if(e.isNode()){switch(e.pstyle("text-halign").value){case"left":n.x=-t.w;break;case"right":n.x=0}switch(e.pstyle("text-valign").value){case"top":n.y=-t.h;break;case"bottom":n.y=0}}return n},isVisible:f}),b=t.data.slbTxrCache=new Da(t,{getKey:function(e){return e[0]._private.sourceLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"source",o)},getBoundingBox:d,getRotationPoint:function(e){return v("source",g(e,"sourceLabelX","sourceLabelY"),e)},getRotationOffset:function(e){return u(d(e))},isVisible:f}),x=t.data.tlbTxrCache=new Da(t,{getKey:function(e){return e[0]._private.targetLabelStyleKey},drawElement:function(e,n,r,i,o){return t.drawElementText(e,n,r,i,"target",o)},getBoundingBox:h,getRotationPoint:function(e){return v("target",g(e,"targetLabelX","targetLabelY"),e)},getRotationOffset:function(e){return u(h(e))},isVisible:f}),w=t.data.lyrTxrCache=new Ba(t);t.onUpdateEleCalcs((function(e,t){y.invalidateElements(t),m.invalidateElements(t),b.invalidateElements(t),x.invalidateElements(t),w.invalidateElements(t);for(var n=0;n<t.length;n++){var r=t[n]._private;r.oldBackgroundTimestamp=r.backgroundTimestamp}}));var E=function(e){for(var t=0;t<e.length;t++)w.enqueueElementRefinement(e[t].ele)};y.onDequeue(E),m.onDequeue(E),b.onDequeue(E),x.onDequeue(E)}hs.CANVAS_LAYERS=3,hs.SELECT_BOX=0,hs.DRAG=1,hs.NODE=2,hs.BUFFER_COUNT=3,hs.TEXTURE_BUFFER=0,hs.MOTIONBLUR_BUFFER_NODE=1,hs.MOTIONBLUR_BUFFER_DRAG=2,hs.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[hs.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[hs.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[hs.SELECT_BOX]=t}};var fs="undefined"!=typeof Path2D;hs.path2dEnabled=function(e){if(void 0===e)return this.pathsEnabled;this.pathsEnabled=!!e},hs.usePaths=function(){return fs&&this.pathsEnabled},hs.setImgSmoothing=function(e,t){null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},hs.getImgSmoothing=function(e){return null!=e.imageSmoothingEnabled?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},hs.makeOffscreenCanvas=function(e,t){var n;return"undefined"!==("undefined"==typeof OffscreenCanvas?"undefined":a(OffscreenCanvas))?n=new OffscreenCanvas(e,t):((n=document.createElement("canvas")).width=e,n.height=t),n},[La,Za,Ua,Ka,Qa,Ja,es,ts,us,{nodeShapeImpl:function(e,t,n,r,i,o,a){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,i,o);case"polygon":return this.drawPolygonPath(t,n,r,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,i,o,a);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,i,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,i,o);case"barrel":return this.drawBarrelPath(t,n,r,i,o)}}}].forEach((function(e){R(hs,e)}));var vs=[{type:"layout",extensions:ea},{type:"renderer",extensions:[{name:"null",impl:ta},{name:"base",impl:ka},{name:"canvas",impl:ds}]}],gs={},ys={};function ms(e,t,n){var r=n,i=function(n){de("Can not register `"+t+"` for `"+e+"` since `"+n+"` already exists in the prototype and can not be overridden")};if("core"===e){if(fo.prototype[t])return i(t);fo.prototype[t]=n}else if("collection"===e){if(Bi.prototype[t])return i(t);Bi.prototype[t]=n}else if("layout"===e){for(var o=function(e){this.options=e,n.call(this,e),E(this._private)||(this._private={}),this._private.cy=e.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(n.prototype),s=[],u=0;u<s.length;u++){var l=s[u];a[l]=a[l]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var c=n.prototype.stop;a.stop=function(){var e=this.options;if(e&&e.animate){var t=this.animations;if(t)for(var n=0;n<t.length;n++)t[n].stop()}return c?c.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(e){return e._private.cy},h={addEventFields:function(e,t){t.layout=e,t.cy=d(e),t.target=e},bubble:function(){return!0},parent:function(e){return d(e)}};R(a,{createEmitter:function(){return this._private.emitter=new $r(h,this),this},emitter:function(){return this._private.emitter},on:function(e,t){return this.emitter().on(e,t),this},one:function(e,t){return this.emitter().one(e,t),this},once:function(e,t){return this.emitter().one(e,t),this},removeListener:function(e,t){return this.emitter().removeListener(e,t),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(e,t){return this.emitter().emit(e,t),this}}),Vn.eventAliasesOn(a),r=o}else if("renderer"===e&&"null"!==t&&"base"!==t){var p=bs("renderer","base"),f=p.prototype,v=n,g=n.prototype,y=function(){p.apply(this,arguments),v.apply(this,arguments)},m=y.prototype;for(var b in f){var x=f[b];if(null!=g[b])return i(b);m[b]=x}for(var w in g)m[w]=g[w];f.clientFunctions.forEach((function(e){m[e]=m[e]||function(){de("Renderer does not implement `renderer."+e+"()` on its prototype")}})),r=y}return V({map:gs,keys:[e,t],value:r})}function bs(e,t){return Z({map:gs,keys:[e,t]})}function xs(e,t,n,r,i){return V({map:ys,keys:[e,t,n,r],value:i})}function ws(e,t,n,r){return Z({map:ys,keys:[e,t,n,r]})}var Es=function(){return 2===arguments.length?bs.apply(null,arguments):3===arguments.length?ms.apply(null,arguments):4===arguments.length?ws.apply(null,arguments):5===arguments.length?xs.apply(null,arguments):void de("Invalid extension access syntax")};fo.prototype.extension=Es,vs.forEach((function(e){e.extensions.forEach((function(t){ms(e.type,t.name,t.impl)}))}));var ks=function e(){if(!(this instanceof e))return new e;this.length=0},Ps=ks.prototype;Ps.instanceString=function(){return"stylesheet"},Ps.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},Ps.css=function(e,t){var n=this.length-1;if(b(e))this[n].properties.push({name:e,value:t});else if(E(e))for(var r=e,i=Object.keys(r),o=0;o<i.length;o++){var a=i[o],s=r[a];if(null!=s){var u=uo.properties[a]||uo.properties[N(a)];null!=u&&this[n].properties.push({name:u.name,value:s})}}return this},Ps.style=Ps.css,Ps.generateStyle=function(e){var t=new uo(e);return this.appendToStyle(t)},Ps.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.properties;e.selector(n.selector);for(var i=0;i<r.length;i++){var o=r[i];e.css(o.name,o.value)}}return e};var Cs=function(e){return void 0===e&&(e={}),E(e)?new fo(e):b(e)?Es.apply(Es,arguments):void 0};Cs.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(Cs),e.apply(null,t),this},Cs.warnings=function(e){return he(e)},Cs.version="3.18.2",Cs.stylesheet=Cs.Stylesheet=ks,e.exports=Cs},"4e6e":(e,t,n)=>{e.exports={graphlib:n("vC4J"),layout:n("Pivv"),debug:n("zmx7"),util:{time:n("xxjf").time,notime:n("xxjf").notime},version:n("VQMV")}},"1yUy":(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("fd5j");e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},"0gKz":(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n,r,o,a){var s=o[t][a-1],u=i.addDummyNode(e,"border",{width:0,height:0,rank:a,borderType:t},n);o[t][a]=u,e.setParent(u,r),s&&e.setEdge(s,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,u=a.maxRank+1;s<u;++s)o(e,"borderLeft","_bl",n,a,s),o(e,"borderRight","_br",n,a,s)}}))}},"+jFT":(e,t,n)=>{"use strict";var r=n("gjtd");function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},"ge/d":e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},zmx7:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf"),o=n("vC4J").Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){n.setNode("layer"+t,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},vC4J:(e,t,n)=>{var r;try{r=n("YlUH")}catch(i){}r||(r=window.graphlib),e.exports=r},fd5j:(e,t,n)=>{var r=n("gjtd"),i=n("vC4J").Graph,o=n("ge/d");e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e);n.setEdge(e.v,e.w,r+i),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var l=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){u(l,c,n.node(e))})),{graph:n,buckets:l,zeroIdx:c}}(e,t||a),l=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var u=t.length-2;u>0;--u)if(r=t[u].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(l,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=e.node(r.w);o.in-=i,u(t,n,o)})),e.removeNode(i.v),a}function u(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},Pivv:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("1yUy"),o=n("RmLA"),a=n("4DVH"),s=n("xxjf").normalizeRanks,u=n("JUZX"),l=n("xxjf").removeEmptyRanks,c=n("wHMW"),d=n("0gKz"),h=n("+jFT"),p=n("erCh"),f=n("Nebv"),v=n("xxjf"),g=n("vC4J").Graph;e.exports=function(e,t){var n=t&&t.debugTiming?v.time:v.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=S(e.graph());return t.setGraph(r.merge({},m,C(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=S(e.node(n));t.setNode(n,r.defaults(C(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=S(e.edge(n));t.setEdge(n,r.merge({},k,C(i,E),r.pick(i,P)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(v.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i=e.node(t.w);v.addDummyNode(e,"edge-proxy",{rank:(i.rank-r.rank)/2+r.rank,e:t},"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){l(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){u(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=v.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){v.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,u=a.marginy||0;function l(e){var r=e.x,a=e.y,s=e.width,u=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(e.nodes(),(function(t){l(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&l(n)})),t-=s,i-=u,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+u}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(v.intersectRect(o,n)),i.points.push(v.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},P=["labelpos"];function C(e,t){return r.mapValues(r.pick(e,t),Number)}function S(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},gjtd:(e,t,n)=>{var r;try{r={cloneDeep:n("c2re"),constant:n("eN33"),defaults:n("WHWN"),each:n("h4um"),filter:n("+DnP"),find:n("6R5o"),flatten:n("1xil"),forEach:n("9SCj"),forIn:n("ZVKf"),has:n("1mr4"),isUndefined:n("CZlo"),last:n("p1C/"),map:n("mbB6"),mapValues:n("y2Ah"),max:n("LPC+"),merge:n("H8sf"),min:n("Z3AG"),minBy:n("PKEM"),now:n("ENE1"),pick:n("//nZ"),range:n("Cmkl"),reduce:n("veKZ"),sortBy:n("u6DZ"),uniqueId:n("w0mW"),values:n("0iyY"),zipObject:n("OUo6")}}catch(i){}r||(r=window._),e.exports=r},wHMW:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};return r.forEach(e.children(),(function(n){!function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}(n,1)})),t}(e),o=r.max(r.values(n))-1,a=2*o+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=a}));var s=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(u){!function e(t,n,o,a,s,u,l){var c=t.children(l);if(c.length){var d=i.addBorderNode(t,"_bt"),h=i.addBorderNode(t,"_bb"),p=t.node(l);t.setParent(d,l),p.borderTop=d,t.setParent(h,l),p.borderBottom=h,r.forEach(c,(function(r){e(t,n,o,a,s,u,r);var i=t.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,v=c!==p?1:s-u[l]+1;t.setEdge(d,c,{weight:f,minlen:v,nestingEdge:!0}),t.setEdge(p,h,{weight:f,minlen:v,nestingEdge:!0})})),t.parent(l)||t.setEdge(n,d,{weight:0,minlen:s+u[l]})}else l!==n&&t.setEdge(n,l,{weight:0,minlen:o})}(e,t,a,s,o,n,u)})),e.graph().nodeRankFactor=a},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},RmLA:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("xxjf");e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,u=t.w,l=e.node(u).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(l!==s+1){for(e.removeEdge(t),o=0,++s;s<l;++o,++s)d.points=[],n=i.addDummyNode(e,"edge",r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},"_d"),s===h&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(a,n,{weight:d.weight},c),0===o&&e.graph().dummyChains.push(n),a=n;e.setEdge(a,u,{weight:d.weight},c)}}(e,t)}))},undo:function(e){r.forEach(e.graph().dummyChains,(function(t){var n,r=e.node(t),i=r.edgeLabel;for(e.setEdge(r.edgeObj,i);r.dummy;)n=e.successors(t)[0],e.removeNode(t),i.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height),r=e.node(t=n)}))}}},DzXQ:(e,t,n)=>{var r=n("gjtd");e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},gP9q:(e,t,n)=>{var r=n("gjtd");e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},D5rW:(e,t,n)=>{var r=n("gjtd"),i=n("vC4J").Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),u=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},YZb2:(e,t,n)=>{"use strict";var r=n("gjtd");function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a<n.length;)a<<=1;var s=2*a-1;a-=1;var u=r.map(new Array(s),(function(){return 0})),l=0;return r.forEach(o.forEach((function(e){var t=e.pos+a;u[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=u[t+1]),u[t=t-1>>1]+=e.weight;l+=e.weight*n}))),l}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}},erCh:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("NI55"),o=n("YZb2"),a=n("Qsja"),s=n("D5rW"),u=n("DzXQ"),l=n("vC4J").Graph,c=n("xxjf");function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new l;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),u(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var u,l=Number.POSITIVE_INFINITY,f=0,v=0;v<4;++f,++v){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var g=o(e,s);g<l&&(v=0,u=r.cloneDeep(s),l=g)}p(e,u)}},NI55:(e,t,n)=>{"use strict";var r=n("gjtd");e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},Hp3j:(e,t,n)=>{"use strict";var r=n("gjtd");e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),(i=t).weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},Qsja:(e,t,n)=>{var r=n("gjtd"),i=n("gP9q"),o=n("Hp3j"),a=n("zBPj");e.exports=function e(t,n,s,u){var l=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(l=r.filter(l,(function(e){return e!==d&&e!==h})));var f=i(t,l);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,u);p[n.v]=i,r.has(i,"barycenter")&&(a=i,r.isUndefined((o=n).barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var v=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(v,p);var g=a(v,u);if(d&&(g.vs=r.flatten([d,g.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+y.order+m.order)/(g.weight+2),g.weight+=2}return g}},zBPj:(e,t,n)=>{var r=n("gjtd"),i=n("xxjf");function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(e){return-e.i})),l=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(l,u,h),r.forEach(s,(function(e){h+=e.vs.length,l.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(l,u,h)}));var p={vs:r.flatten(l,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},JUZX:(e,t,n)=>{var r=n("gjtd");e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],u=Math.min(t[n].low,t[r].low),l=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>u||l>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,u=0,l=a[u],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(l=a[u])!==s&&e.node(l).maxRank<r.rank;)u++;l===s&&(c=!1)}if(!c){for(;u<a.length-1&&e.node(l=a[u+1]).minRank<=r.rank;)u++;l=a[u]}e.setParent(n,l),n=e.successors(n)[0]}}))}},xaOS:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph,o=n("xxjf");function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,l=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===l)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(a<o||h<a)||i.dummy&&e.node(t).dummy||u(n,r,t)}))})),a=c+1,o=h)})),i})),n}function s(e,t){var n={};function i(t,i,o,a,s){var l;r.forEach(r.range(i,o),(function(i){e.node(l=t[i]).dummy&&r.forEach(e.predecessors(l),(function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>s)&&u(n,t,l)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===e.node(r).dummy){var l=e.predecessors(r);l.length&&(o=e.node(l[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function u(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function l(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var u=i(e);if(u.length)for(var c=((u=r.sortBy(u,(function(e){return s[e]}))).length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=u[d];a[e]===e&&t<s[p]&&!l(n,e,p)&&(a[p]=e,a[e]=o[e]=o[p],t=s[p])}}))})),{root:o,align:a}}function d(e,t,n,o,a){var s={},u=function(e,t,n,o){var a=new i,s=e.graph(),u=function(e,t,n){return function(i,o,a){var s,u=i.node(o),l=i.node(a),c=0;if(c+=u.width/2,r.has(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":s=-u.width/2;break;case"r":s=u.width/2}if(s&&(c+=n?s:-s),s=0,c+=(u.dummy?t:e)/2,c+=(l.dummy?t:e)/2,c+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=l.width/2;break;case"r":s=-l.width/2}return s&&(c+=n?s:-s),s=0,c}}(s.nodesep,s.edgesep,o);return r.forEach(t,(function(t){var i;r.forEach(t,(function(t){var r=n[t];if(a.setNode(r),i){var o=n[i],s=a.edge(o,r);a.setEdge(o,r,Math.max(u(e,t,i),s||0))}i=t}))})),a}(e,t,n,a),l=a?"borderLeft":"borderRight";function c(e,t){for(var n=u.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return c((function(e){s[e]=u.inEdges(e).reduce((function(e,t){return Math.max(e,s[t.v]+u.edge(t))}),0)}),u.predecessors.bind(u)),c((function(t){var n=u.outEdges(t).reduce((function(e,t){return Math.min(e,s[t.w]-u.edge(t))}),Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==l&&(s[t]=Math.max(s[t],n))}),u.successors.bind(u)),r.forEach(o,(function(e){s[e]=s[n[e]]})),s}function h(e,t){return r.minBy(r.values(t),(function(t){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return r.forIn(t,(function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),i=Math.min(t-o,i)})),n-i}))}function p(e,t){var n=r.values(t),i=r.min(n),o=r.max(n);r.forEach(["u","d"],(function(n){r.forEach(["l","r"],(function(a){var s,u=n+a,l=e[u];if(l!==t){var c=r.values(l);(s="l"===a?i-r.min(c):o-r.max(c))&&(e[u]=r.mapValues(l,(function(e){return e+s})))}}))}))}function f(e,t){return r.mapValues(e.ul,(function(n,i){if(t)return e[t.toLowerCase()][i];var o=r.sortBy(r.map(e,i));return(o[1]+o[2])/2}))}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),i=r.merge(a(e,n),s(e,n)),u={};r.forEach(["u","d"],(function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],(function(n){"r"===n&&(t=r.map(t,(function(e){return r.values(e).reverse()})));var a=("u"===o?e.predecessors:e.successors).bind(e),s=c(0,t,i,a),l=d(e,t,s.root,s.align,"r"===n);"r"===n&&(l=r.mapValues(l,(function(e){return-e}))),u[o+n]=l}))}));var l=h(e,u);return p(u,l),f(u,e.graph().align)},findType1Conflicts:a,findType2Conflicts:s,addConflict:u,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:p,findSmallestWidthAlignment:h,balance:f}},Nebv:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("xxjf"),o=n("xaOS").positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},"58Ui":(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph,o=n("K8/D").slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function u(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),l=e.nodes()[0],c=e.nodeCount();for(r.setNode(l,{});a(r,e)<c;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),u(r,e,n);return r}},"4DVH":(e,t,n)=>{"use strict";var r=n("K8/D").longestPath,i=n("58Ui"),o=n("EMSI");e.exports=function(e){switch(e.graph().ranker){default:s(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r;function s(e){o(e)}},EMSI:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("58Ui"),o=n("K8/D").slack,a=n("K8/D").longestPath,s=n("vC4J").alg.preorder,u=n("vC4J").alg.postorder,l=n("xxjf").simplify;function c(e){e=l(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=v(n);)y(n,e,t,g(n,e,t))}function d(e,t){var n=u(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n);e.edge(n,r.parent).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a=r.v===n,u=a?r.w:r.v;if(u!==i){var l=a===o,c=t.edge(r).weight;if(s+=l?c:-c,e.hasEdge(n,u)){var d=e.edge(n,u).cutvalue;s+=l?-d:d}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function v(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function g(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),u=e.node(a),l=s,c=!1;s.lim>u.lim&&(l=u,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),l)&&c!==m(0,e.node(t.w),l)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){e.removeEdge(n.v,n.w),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=v,c.enterEdge=g,c.exchangeEdges=y},"K8/D":(e,t,n)=>{"use strict";var r=n("gjtd");e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},xxjf:(e,t,n)=>{"use strict";var r=n("gjtd"),i=n("vC4J").Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,u=e.width/2,l=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),n=l*a/s,r=l):(a<0&&(u=-u),n=u,r=u*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},VQMV:e=>{e.exports="0.8.5"},YlUH:(e,t,n)=>{var r=n("1qSF");e.exports={Graph:r.Graph,json:n("M2c1"),alg:n("ZCKZ"),version:r.version}},qC43:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},"5Ck4":(e,t,n)=>{var r=n("Jl0P");e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var i=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],a={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);!function e(t,n,i,o,a,s){r.has(o,n)||(o[n]=!0,i||s.push(n),r.each(a(n),(function(n){e(t,n,i,o,a,s)})),i&&s.push(n))}(e,t,"post"===n,a,i,o)})),o}},a271:(e,t,n)=>{var r=n("V9bN"),i=n("Jl0P");e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},V9bN:(e,t,n)=>{var r=n("Jl0P"),i=n("c9kG");e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},u=new i,l=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),l=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);l<r.distance&&(r.distance=l,r.predecessor=o,u.decrease(t,l))};for(e.nodes().forEach((function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},u.add(e,n)}));u.size()>0&&(o=u.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(l);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},W8B9:(e,t,n)=>{var r=n("Jl0P"),i=n("Pa7R");e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},hq5n:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=t[n],i=o[n],a=o[e].distance+r.distance;a<i.distance&&(i.distance=a,i.predecessor=r.predecessor)}))}))})),r}(e,t||i,n||function(t){return e.outEdges(t)})};var i=r.constant(1)},ZCKZ:(e,t,n)=>{e.exports={components:n("qC43"),dijkstra:n("V9bN"),dijkstraAll:n("a271"),findCycles:n("W8B9"),floydWarshall:n("hq5n"),isAcyclic:n("+WAL"),postorder:n("21zJ"),preorder:n("j+bJ"),prim:n("xGdc"),tarjan:n("Pa7R"),topsort:n("0Jj1")}},"+WAL":(e,t,n)=>{var r=n("0Jj1");e.exports=function(e){try{r(e)}catch(t){if(t instanceof r.CycleException)return!1;throw t}return!0}},"21zJ":(e,t,n)=>{var r=n("5Ck4");e.exports=function(e,t){return r(e,t,"post")}},"j+bJ":(e,t,n)=>{var r=n("5Ck4");e.exports=function(e,t){return r(e,t,"pre")}},xGdc:(e,t,n)=>{var r=n("Jl0P"),i=n("buMw"),o=n("c9kG");e.exports=function(e,t){var n,a=new i,s={},u=new o;function l(e){var r=e.v===n?e.w:e.v,i=u.priority(r);if(void 0!==i){var o=t(e);o<i&&(s[r]=n,u.decrease(r,o))}}if(0===e.nodeCount())return a;r.each(e.nodes(),(function(e){u.add(e,Number.POSITIVE_INFINITY),a.setNode(e)})),u.decrease(e.nodes()[0],0);for(var c=!1;u.size()>0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(l)}return a}},Pa7R:(e,t,n)=>{var r=n("Jl0P");e.exports=function(e){var t=0,n=[],i={},o=[];return e.nodes().forEach((function(a){r.has(i,a)||function a(s){var u=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(u.lowlink=Math.min(u.lowlink,i[e].index)):(a(e),u.lowlink=Math.min(u.lowlink,i[e].lowlink))})),u.lowlink===u.index){var l,c=[];do{l=n.pop(),i[l].onStack=!1,c.push(l)}while(s!==l);o.push(c)}}(a)})),o}},"0Jj1":(e,t,n)=>{var r=n("Jl0P");function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},c9kG:(e,t,n)=>{var r=n("Jl0P");function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))},i.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},i.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,i=n[e],o=n[t];n[e]=o,n[t]=i,r[o.key]=e,r[i.key]=t}},buMw:(e,t,n)=>{"use strict";var r=n("Jl0P");function i(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function o(e,t){e[t]?e[t]++:e[t]=1}function a(e,t){--e[t]||delete e[t]}function s(e,t,n,i){var o=""+t,a=""+n;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(r.isUndefined(i)?"\0":i)}function u(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function l(e,t){return s(e,t.v,t.w,t.name)}e.exports=i,i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(e){return this._label=e,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return r.keys(this._nodes)},i.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},i.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},i.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},i.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},i.prototype.node=function(e){return this._nodes[e]},i.prototype.hasNode=function(e){return r.has(this._nodes,e)},i.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},i.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t="\0";else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},i.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},i.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}},i.prototype.children=function(e){if(r.isUndefined(e)&&(e="\0"),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}},i.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},i.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},i.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},i.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},i.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,function e(r){var o=n.parent(r);return void 0===o||t.hasNode(o)?(i[r]=o,o):o in i?i[o]:e(o)}(e))})),t},i.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return r.values(this._edgeObjs)},i.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},i.prototype.setEdge=function(){var e,t,n,i,a=!1,l=arguments[0];"object"==typeof l&&null!==l&&"v"in l?(e=l.v,t=l.w,n=l.name,2===arguments.length&&(i=arguments[1],a=!0)):(e=l,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=s(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return a&&(this._edgeLabels[c]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=a?i:this._defaultEdgeLabelFn(e,t,n);var d=u(this._isDirected,e,t,n);return e=d.v,t=d.w,Object.freeze(d),this._edgeObjs[c]=d,o(this._preds[t],e),o(this._sucs[e],t),this._in[t][c]=d,this._out[e][c]=d,this._edgeCount++,this},i.prototype.edge=function(e,t,n){var r=1===arguments.length?l(this._isDirected,arguments[0]):s(this._isDirected,e,t,n);return this._edgeLabels[r]},i.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?l(this._isDirected,arguments[0]):s(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},i.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?l(this._isDirected,arguments[0]):s(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],a(this._preds[t],e),a(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},i.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},i.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},i.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},"1qSF":(e,t,n)=>{e.exports={Graph:n("buMw"),version:n("5AdH")}},M2c1:(e,t,n)=>{var r=n("Jl0P"),i=n("buMw");function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},Jl0P:(e,t,n)=>{var r;try{r={clone:n("zr3P"),constant:n("eN33"),each:n("h4um"),filter:n("+DnP"),has:n("1mr4"),isArray:n("wxYD"),isEmpty:n("MwrP"),isFunction:n("2q8g"),isUndefined:n("CZlo"),keys:n("BlJA"),map:n("mbB6"),reduce:n("veKZ"),size:n("7seP"),transform:n("cZX/"),union:n("aGtI"),values:n("0iyY")}}catch(i){}r||(r=window._),e.exports=r},"5AdH":e=>{e.exports="2.1.8"},"3Ssf":(e,t,n)=>{e.exports=n("pvAv")},pvAv:function(e,t){var n,r,i;(function(){var o,a,s,u,l,c,d,h,p,f,v,g,y,m,b;s=Math.floor,f=Math.min,a=function(e,t){return e<t?-1:e>t?1:0},p=function(e,t,n,r,i){var o;if(null==n&&(n=0),null==i&&(i=a),n<0)throw new Error("lo must be non-negative");for(null==r&&(r=e.length);n<r;)i(t,e[o=s((n+r)/2)])<0?r=o:n=o+1;return[].splice.apply(e,[n,n-n].concat(t)),t},c=function(e,t,n){return null==n&&(n=a),e.push(t),m(e,0,e.length-1,n)},l=function(e,t){var n,r;return null==t&&(t=a),n=e.pop(),e.length?(r=e[0],e[0]=n,b(e,0,t)):r=n,r},h=function(e,t,n){var r;return null==n&&(n=a),r=e[0],e[0]=t,b(e,0,n),r},d=function(e,t,n){var r;return null==n&&(n=a),e.length&&n(e[0],t)<0&&(t=(r=[e[0],t])[0],e[0]=r[1],b(e,0,n)),t},u=function(e,t){var n,r,i,o,u;for(null==t&&(t=a),o=[],n=0,r=(i=(function(){u=[];for(var t=0,n=s(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)u.push(t);return u}).apply(this).reverse()).length;n<r;n++)o.push(b(e,i[n],t));return o},y=function(e,t,n){var r;if(null==n&&(n=a),-1!==(r=e.indexOf(t)))return m(e,0,r,n),b(e,r,n)},v=function(e,t,n){var r,i,o,s;if(null==n&&(n=a),!(r=e.slice(0,t)).length)return r;for(u(r,n),i=0,o=(s=e.slice(t)).length;i<o;i++)d(r,s[i],n);return r.sort(n).reverse()},g=function(e,t,n){var r,i,o,s,c,d,h,v,g;if(null==n&&(n=a),10*t<=e.length){if(!(o=e.slice(0,t).sort(n)).length)return o;for(i=o[o.length-1],s=0,d=(h=e.slice(t)).length;s<d;s++)n(r=h[s],i)<0&&(p(o,r,0,null,n),o.pop(),i=o[o.length-1]);return o}for(u(e,n),g=[],c=0,v=f(t,e.length);0<=v?c<v:c>v;0<=v?++c:--c)g.push(l(e,n));return g},m=function(e,t,n,r){var i,o,s;for(null==r&&(r=a),i=e[n];n>t&&r(i,o=e[s=n-1>>1])<0;)e[n]=o,n=s;return e[n]=i},b=function(e,t,n){var r,i,o,s,u;for(null==n&&(n=a),i=e.length,u=t,o=e[t],r=2*t+1;r<i;)(s=r+1)<i&&!(n(e[r],e[s])<0)&&(r=s),e[t]=e[r],r=2*(t=r)+1;return e[t]=o,m(e,u,t,n)},o=function(){function e(e){this.cmp=null!=e?e:a,this.nodes=[]}return e.push=c,e.pop=l,e.replace=h,e.pushpop=d,e.heapify=u,e.updateItem=y,e.nlargest=v,e.nsmallest=g,e.prototype.push=function(e){return c(this.nodes,e,this.cmp)},e.prototype.pop=function(){return l(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return-1!==this.nodes.indexOf(e)},e.prototype.replace=function(e){return h(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return d(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return u(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return y(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return 0===this.nodes.length},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t;return(t=new e).nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),r=[],void 0===(i="function"==typeof(n=function(){return o})?n.apply(t,r):n)||(e.exports=i)}).call(this)},"E/ZA":e=>{var t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,u=a||s||Function("return this")(),l=Object.prototype.toString,c=Math.max,d=Math.min,h=function(){return u.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(p(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=p(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||i.test(e)?o(e.slice(2),s?2:8):n.test(e)?NaN:+e}e.exports=function(e,t,n){var r,i,o,a,s,u,l=0,v=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function b(e){return l=e,s=setTimeout(w,t),v?m(e):a}function x(e){var n=e-u;return void 0===u||n>=t||n<0||g&&e-l>=o}function w(){var e=h();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-u);return g?d(n,o-(e-l)):n}(e))}function E(e){return s=void 0,y&&r?m(e):(r=i=void 0,a)}function k(){var e=h(),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)),a}return t=f(t)||0,p(n)&&(v=!!n.leading,o=(g="maxWait"in n)?c(f(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),k.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=i=s=void 0},k.flush=function(){return void 0===s?a:E(h())},k}},QF3D:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"DataView");e.exports=r},Tv3l:(e,t,n)=>{var r=n("2Fbm"),i=n("VPai"),o=n("+fUG"),a=n("QMz8"),s=n("mUsV");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},"+ooz":(e,t,n)=>{var r=n("8Zrg"),i=n("kwr2"),o=n("5VYK"),a=n("Coc+"),s=n("LzM7");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},qeCs:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Map");e.exports=r},hyzI:(e,t,n)=>{var r=n("m5o6"),i=n("d0UJ"),o=n("eask"),a=n("9SKQ"),s=n("e63W");function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=a,u.prototype.set=s,e.exports=u},IS0S:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Promise");e.exports=r},OBn4:(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"Set");e.exports=r},"JBn+":(e,t,n)=>{var r=n("hyzI"),i=n("qjF7"),o=n("cEmw");function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}a.prototype.add=a.prototype.push=i,a.prototype.has=o,e.exports=a},HsnV:(e,t,n)=>{var r=n("+ooz"),i=n("RNlM"),o=n("E4ao"),a=n("BSqe"),s=n("L6um"),u=n("4/ik");function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=o,l.prototype.get=a,l.prototype.has=s,l.prototype.set=u,e.exports=l},Syyo:(e,t,n)=>{var r=n("IBsm");e.exports=r.Symbol},mGzy:(e,t,n)=>{var r=n("IBsm");e.exports=r.Uint8Array},"4+Vk":(e,t,n)=>{var r=n("vxC8")(n("IBsm"),"WeakMap");e.exports=r},zaNA:e=>{e.exports=function(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)}},LmOH:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},W0vE:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}},OfKG:(e,t,n)=>{var r=n("c7Qd");e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},"sCL+":e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}},rmhs:(e,t,n)=>{var r=n("2ZvR"),i=n("bvyN"),o=n("wxYD"),a=n("3ajY"),s=n("pnw1"),u=n("Qd2C"),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&u(e),p=n||c||d||h,f=p?r(e.length,String):[],v=f.length;for(var g in e)!t&&!l.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||h&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||f.push(g);return f}},H87J:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},"y/9h":e=>{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},cPMt:e=>{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}},myUI:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},"2wsP":(e,t,n)=>{var r=n("EI7Z")("length");e.exports=r},amiU:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx");e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},c72w:(e,t,n)=>{var r=n("wC3K"),i=n("pPzx"),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},"6QIk":(e,t,n)=>{var r=n("pPzx");e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},tPQG:(e,t,n)=>{var r=n("LtXa"),i=n("BlJA");e.exports=function(e,t){return e&&r(t,i(t),e)}},QrYh:(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e,t){return e&&r(t,i(t),e)}},wC3K:(e,t,n)=>{var r=n("Pz+s");e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},kn3Q:(e,t,n)=>{var r=n("HsnV"),i=n("LmOH"),o=n("c72w"),a=n("tPQG"),s=n("QrYh"),u=n("Grae"),l=n("QT01"),c=n("AjPR"),d=n("BjSP"),h=n("tlBq"),p=n("zF5n"),f=n("kkM+"),v=n("3Qlq"),g=n("7No3"),y=n("sD1O"),m=n("wxYD"),b=n("3ajY"),x=n("NbvU"),w=n("tQYX"),E=n("/iLo"),k=n("BlJA"),P=n("zH+d"),C={};C["[object Arguments]"]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C["[object Object]"]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C["[object Function]"]=C["[object WeakMap]"]=!1,e.exports=function e(t,n,S,_,j,D){var T,B=1&n,O=2&n,M=4&n;if(S&&(T=j?S(t,_,j,D):S(t)),void 0!==T)return T;if(!w(t))return t;var N=m(t);if(N){if(T=v(t),!B)return l(t,T)}else{var I=f(t),L="[object Function]"==I||"[object GeneratorFunction]"==I;if(b(t))return u(t,B);if("[object Object]"==I||"[object Arguments]"==I||L&&!j){if(T=O||L?{}:y(t),!B)return O?d(t,s(T,t)):c(t,a(T,t))}else{if(!C[I])return j?t:{};T=g(t,I,B)}}D||(D=new r);var A=D.get(t);if(A)return A;D.set(t,T),E(t)?t.forEach((function(r){T.add(e(r,n,S,r,t,D))})):x(t)&&t.forEach((function(r,i){T.set(i,e(r,n,S,i,t,D))}));var z=N?void 0:(M?O?p:h:O?P:k)(t);return i(z||t,(function(r,i){z&&(r=t[i=r]),o(T,i,e(r,n,S,i,t,D))})),T}},vGGS:(e,t,n)=>{var r=n("tQYX"),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},Q4oW:(e,t,n)=>{var r=n("zKkv"),i=n("bz5b")(r);e.exports=i},JElN:(e,t,n)=>{var r=n("a88S");e.exports=function(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(void 0===u?s==s&&!r(s):n(s,u)))var u=s,l=a}return l}},sjzV:(e,t,n)=>{var r=n("Q4oW");e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},DuXo:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},YpBQ:(e,t,n)=>{var r=n("y/9h"),i=n("oCTG");e.exports=function e(t,n,o,a,s){var u=-1,l=t.length;for(o||(o=i),s||(s=[]);++u<l;){var c=t[u];n>0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},UdtX:(e,t,n)=>{var r=n("RFxK")();e.exports=r},zKkv:(e,t,n)=>{var r=n("UdtX"),i=n("BlJA");e.exports=function(e,t){return e&&r(e,t,i)}},w2Tz:(e,t,n)=>{var r=n("xoyU"),i=n("Ypsa");e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},pIod:(e,t,n)=>{var r=n("y/9h"),i=n("wxYD");e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},Dhk8:(e,t,n)=>{var r=n("Syyo"),i=n("KCLV"),o=n("kHoZ"),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},FaiA:e=>{e.exports=function(e,t){return e>t}},SJov:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},JYmt:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},c7Qd:(e,t,n)=>{var r=n("DuXo"),i=n("z9Jh"),o=n("n1QJ");e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},"/30y":(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},NYSw:(e,t,n)=>{var r=n("BqUW"),i=n("tLQN");e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},BqUW:(e,t,n)=>{var r=n("HsnV"),i=n("ZZ+W"),o=n("R3gn"),a=n("yZHP"),s=n("kkM+"),u=n("wxYD"),l=n("3ajY"),c=n("Qd2C"),d="[object Object]",h=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,p,f,v){var g=u(e),y=u(t),m=g?"[object Array]":s(e),b=y?"[object Array]":s(t),x=(m="[object Arguments]"==m?d:m)==d,w=(b="[object Arguments]"==b?d:b)==d,E=m==b;if(E&&l(e)){if(!l(t))return!1;g=!0,x=!1}if(E&&!x)return v||(v=new r),g||c(e)?i(e,t,n,p,f,v):o(e,t,m,n,p,f,v);if(!(1&n)){var k=x&&h.call(e,"__wrapped__"),P=w&&h.call(t,"__wrapped__");if(k||P){var C=k?e.value():e,S=P?t.value():t;return v||(v=new r),f(C,S,n,p,v)}}return!!E&&(v||(v=new r),a(e,t,n,p,f,v))}},gEWz:(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},ZjRn:(e,t,n)=>{var r=n("HsnV"),i=n("NYSw");e.exports=function(e,t,n,o){var a=n.length,s=a,u=!o;if(null==e)return!s;for(e=Object(e);a--;){var l=n[a];if(u&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){var c=(l=n[a])[0],d=e[c],h=l[1];if(u&&l[2]){if(void 0===d&&!(c in e))return!1}else{var p=new r;if(o)var f=o(d,h,c,e,t,p);if(!(void 0===f?i(h,d,3,o,p):f))return!1}}return!0}},z9Jh:e=>{e.exports=function(e){return e!=e}},"5nKN":(e,t,n)=>{var r=n("2q8g"),i=n("9vbJ"),o=n("tQYX"),a=n("c18h"),s=/^\[object .+?Constructor\]$/,u=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?u:s).test(a(e))}},"6I2w":(e,t,n)=>{var r=n("kkM+"),i=n("tLQN");e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},"7/jS":(e,t,n)=>{var r=n("Dhk8"),i=n("t0L4"),o=n("tLQN"),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},S3pA:(e,t,n)=>{var r=n("7/we"),i=n("KAo/"),o=n("zWgn"),a=n("wxYD"),s=n("1EDM");e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},"4uJK":(e,t,n)=>{var r=n("CbIe"),i=n("OtNC"),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},p2lg:(e,t,n)=>{var r=n("tQYX"),i=n("CbIe"),o=n("/UTG"),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},"n+p3":e=>{e.exports=function(e,t){return e<t}},bFjY:(e,t,n)=>{var r=n("Q4oW"),i=n("9y2L");e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},"7/we":(e,t,n)=>{var r=n("ZjRn"),i=n("hMsr"),o=n("0Ss3");e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},"KAo/":(e,t,n)=>{var r=n("NYSw"),i=n("2srY"),o=n("NW/2"),a=n("i7nn"),s=n("+tCn"),u=n("0Ss3"),l=n("Ypsa");e.exports=function(e,t){return a(e)&&s(t)?u(l(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},MzY2:(e,t,n)=>{var r=n("HsnV"),i=n("amiU"),o=n("UdtX"),a=n("cb1R"),s=n("tQYX"),u=n("zH+d"),l=n("LL3N");e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,u){if(h||(h=new r),s(o))a(t,n,u,c,e,d,h);else{var p=d?d(l(t,u),o,u+"",t,n,h):void 0;void 0===p&&(p=o),i(t,u,p)}}),u)}},cb1R:(e,t,n)=>{var r=n("amiU"),i=n("Grae"),o=n("6Rtw"),a=n("QT01"),s=n("sD1O"),u=n("bvyN"),l=n("wxYD"),c=n("Ndl3"),d=n("3ajY"),h=n("2q8g"),p=n("tQYX"),f=n("Kkar"),v=n("Qd2C"),g=n("LL3N"),y=n("4ScB");e.exports=function(e,t,n,m,b,x,w){var E=g(e,n),k=g(t,n),P=w.get(k);if(P)r(e,n,P);else{var C=x?x(E,k,n+"",e,t,w):void 0,S=void 0===C;if(S){var _=l(k),j=!_&&d(k),D=!_&&!j&&v(k);C=k,_||j||D?l(E)?C=E:c(E)?C=a(E):j?(S=!1,C=i(k,!0)):D?(S=!1,C=o(k,!0)):C=[]:f(k)||u(k)?(C=E,u(E)?C=y(E):p(E)&&!h(E)||(C=s(k))):S=!1}S&&(w.set(k,C),b(C,k,m,x,w),w.delete(k)),r(e,n,C)}}},eHpp:(e,t,n)=>{var r=n("H87J"),i=n("w2Tz"),o=n("S3pA"),a=n("bFjY"),s=n("4jPf"),u=n("SU8Q"),l=n("5WP5"),c=n("zWgn"),d=n("wxYD");e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,u(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return l(e,t,n)}))}},QwI6:(e,t,n)=>{var r=n("O1Sc"),i=n("NW/2");e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},O1Sc:(e,t,n)=>{var r=n("w2Tz"),i=n("y4bl"),o=n("xoyU");e.exports=function(e,t,n){for(var a=-1,s=t.length,u={};++a<s;){var l=t[a],c=r(e,l);n(c,l)&&i(u,o(l,e),c)}return u}},EI7Z:e=>{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},CEyS:(e,t,n)=>{var r=n("w2Tz");e.exports=function(e){return function(t){return r(t,e)}}},"9au6":e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),u=Array(s);s--;)u[o?s:++a]=e,e+=i;return u}},"5q8j":e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},R3TX:(e,t,n)=>{var r=n("zWgn"),i=n("UAs9"),o=n("7Pat");e.exports=function(e,t){return o(i(e,t,r),e+"")}},y4bl:(e,t,n)=>{var r=n("c72w"),i=n("xoyU"),o=n("pnw1"),a=n("tQYX"),s=n("Ypsa");e.exports=function(e,t,n,u){if(!a(e))return e;for(var l=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++l<c;){var p=s(t[l]),f=n;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(l!=d){var v=h[p];void 0===(f=u?u(v,p,h):void 0)&&(f=a(v)?v:o(t[l+1])?[]:{})}r(h,p,f),h=h[p]}return e}},"+7q0":(e,t,n)=>{var r=n("eN33"),i=n("Pz+s"),o=n("zWgn");e.exports=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o},"4jPf":e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},"2ZvR":e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},JcJ6:(e,t,n)=>{var r=n("Syyo"),i=n("H87J"),o=n("wxYD"),a=n("a88S"),s=r?r.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},I1fX:(e,t,n)=>{var r=n("6XIJ"),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},SU8Q:e=>{e.exports=function(e){return function(t){return e(t)}}},"s+R0":(e,t,n)=>{var r=n("JBn+"),i=n("OfKG"),o=n("sCL+"),a=n("S0iI"),s=n("9TP6"),u=n("XlL0");e.exports=function(e,t,n){var l=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var v=t?null:s(e);if(v)return u(v);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++l<d;){var g=e[l],y=t?t(g):g;if(g=n||0!==g?g:0,h&&y==y){for(var m=f.length;m--;)if(f[m]===y)continue e;t&&f.push(y),p.push(g)}else c(f,y,n)||(f!==p&&f.push(y),p.push(g))}return p}},SJvO:(e,t,n)=>{var r=n("H87J");e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},WvmI:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;)n(a,e[r],r<o?t[r]:void 0);return a}},S0iI:e=>{e.exports=function(e,t){return e.has(t)}},D49j:(e,t,n)=>{var r=n("zWgn");e.exports=function(e){return"function"==typeof e?e:r}},xoyU:(e,t,n)=>{var r=n("wxYD"),i=n("i7nn"),o=n("SoOq"),a=n("dw5g");e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},EAGB:(e,t,n)=>{var r=n("mGzy");e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},Grae:(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},lN3w:(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},Bstx:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},bVbG:(e,t,n)=>{var r=n("Syyo"),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},"6Rtw":(e,t,n)=>{var r=n("EAGB");e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},"dnX/":(e,t,n)=>{var r=n("a88S");e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,u=null===t,l=t==t,c=r(t);if(!u&&!c&&!a&&e>t||a&&s&&l&&!u&&!c||i&&s&&l||!n&&l||!o)return 1;if(!i&&!a&&!c&&e<t||c&&n&&o&&!i&&!a||u&&n&&o||!s&&o||!l)return-1}return 0}},"5WP5":(e,t,n)=>{var r=n("dnX/");e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,u=n.length;++i<s;){var l=r(o[i],a[i]);if(l)return i>=u?l:l*("desc"==n[i]?-1:1)}return e.index-t.index}},QT01:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},LtXa:(e,t,n)=>{var r=n("c72w"),i=n("wC3K");e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,u=t.length;++s<u;){var l=t[s],c=o?o(n[l],e[l],l,n,e):void 0;void 0===c&&(c=e[l]),a?i(n,l,c):r(n,l,c)}return n}},AjPR:(e,t,n)=>{var r=n("LtXa"),i=n("70Le");e.exports=function(e,t){return r(e,i(e),t)}},BjSP:(e,t,n)=>{var r=n("LtXa"),i=n("Xidw");e.exports=function(e,t){return r(e,i(e),t)}},"3KBa":(e,t,n)=>{var r=n("IBsm");e.exports=r["__core-js_shared__"]},wpQC:(e,t,n)=>{var r=n("R3TX"),i=n("R5u7");e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r<o;){var u=n[r];u&&e(t,u,r,a)}return t}))}},bz5b:(e,t,n)=>{var r=n("9y2L");e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a<o)&&!1!==i(s[a],a,s););return n}}},RFxK:e=>{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}},"1aYn":(e,t,n)=>{var r=n("S3pA"),i=n("9y2L"),o=n("BlJA");e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var u=r(n,3);t=o(t),n=function(e){return u(s[e],e,s)}}var l=e(t,n,a);return l>-1?s[u?t[l]:l]:void 0}}},"2M3I":(e,t,n)=>{var r=n("9au6"),i=n("R5u7"),o=n("fWyh");e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t<n?1:-1:o(a),r(t,n,a,e)}}},"9TP6":(e,t,n)=>{var r=n("OBn4"),i=n("nnm9"),o=n("XlL0"),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},"Pz+s":(e,t,n)=>{var r=n("vxC8"),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();e.exports=i},"ZZ+W":(e,t,n)=>{var r=n("JBn+"),i=n("myUI"),o=n("S0iI");e.exports=function(e,t,n,a,s,u){var l=1&n,c=e.length,d=t.length;if(c!=d&&!(l&&d>c))return!1;var h=u.get(e),p=u.get(t);if(h&&p)return h==t&&p==e;var f=-1,v=!0,g=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++f<c;){var y=e[f],m=t[f];if(a)var b=l?a(m,y,f,t,e,u):a(y,m,f,e,t,u);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(y===e||s(y,e,n,a,u)))return g.push(t)}))){v=!1;break}}else if(y!==m&&!s(y,m,n,a,u)){v=!1;break}}return u.delete(e),u.delete(t),v}},R3gn:(e,t,n)=>{var r=n("Syyo"),i=n("mGzy"),o=n("pPzx"),a=n("ZZ+W"),s=n("aURW"),u=n("XlL0"),l=r?r.prototype:void 0,c=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":if(p||(p=u),e.size!=t.size&&!(1&r))return!1;var f=h.get(e);if(f)return f==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,l,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},yZHP:(e,t,n)=>{var r=n("tlBq"),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var u=1&n,l=r(e),c=l.length;if(c!=r(t).length&&!u)return!1;for(var d=c;d--;){var h=l[d];if(!(u?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var v=!0;s.set(e,t),s.set(t,e);for(var g=u;++d<c;){var y=e[h=l[d]],m=t[h];if(o)var b=u?o(m,y,h,t,e,s):o(y,m,h,e,t,s);if(!(void 0===b?y===m||a(y,m,n,o,s):b)){v=!1;break}g||(g="constructor"==h)}if(v&&!g){var x=e.constructor,w=t.constructor;x==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof x&&x instanceof x&&"function"==typeof w&&w instanceof w||(v=!1)}return s.delete(e),s.delete(t),v}},cH1A:(e,t,n)=>{var r=n("1xil"),i=n("UAs9"),o=n("7Pat");e.exports=function(e){return o(i(e,void 0,r),e+"")}},e93E:e=>{var t="object"==typeof global&&global&&global.Object===Object&&global;e.exports=t},tlBq:(e,t,n)=>{var r=n("pIod"),i=n("70Le"),o=n("BlJA");e.exports=function(e){return r(e,o,i)}},zF5n:(e,t,n)=>{var r=n("pIod"),i=n("Xidw"),o=n("zH+d");e.exports=function(e){return r(e,o,i)}},JNqh:(e,t,n)=>{var r=n("6UKJ");e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},hMsr:(e,t,n)=>{var r=n("+tCn"),i=n("BlJA");e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},vxC8:(e,t,n)=>{var r=n("5nKN"),i=n("4p/L");e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},"/wCD":(e,t,n)=>{var r=n("TAtK")(Object.getPrototypeOf,Object);e.exports=r},KCLV:(e,t,n)=>{var r=n("Syyo"),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(u){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},"70Le":(e,t,n)=>{var r=n("W0vE"),i=n("X4R2"),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;e.exports=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i},Xidw:(e,t,n)=>{var r=n("y/9h"),i=n("/wCD"),o=n("70Le"),a=n("X4R2");e.exports=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a},"kkM+":(e,t,n)=>{var r=n("QF3D"),i=n("qeCs"),o=n("IS0S"),a=n("OBn4"),s=n("4+Vk"),u=n("Dhk8"),l=n("c18h"),c=l(r),d=l(i),h=l(o),p=l(a),f=l(s),v=u;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||a&&"[object Set]"!=v(new a)||s&&"[object WeakMap]"!=v(new s))&&(v=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case c:return"[object DataView]";case d:return"[object Map]";case h:return"[object Promise]";case p:return"[object Set]";case f:return"[object WeakMap]"}return t}),e.exports=v},"4p/L":e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},"z+TE":(e,t,n)=>{var r=n("xoyU"),i=n("bvyN"),o=n("wxYD"),a=n("pnw1"),s=n("t0L4"),u=n("Ypsa");e.exports=function(e,t,n){for(var l=-1,c=(t=r(t,e)).length,d=!1;++l<c;){var h=u(t[l]);if(!(d=null!=e&&n(e,h)))break;e=e[h]}return d||++l!=c?d:!!(c=null==e?0:e.length)&&s(c)&&a(h,c)&&(o(e)||i(e))}},GZgP:e=>{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},"2Fbm":(e,t,n)=>{var r=n("5pfJ");e.exports=function(){this.__data__=r?r(null):{},this.size=0}},VPai:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},"+fUG":(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},QMz8:(e,t,n)=>{var r=n("5pfJ"),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},mUsV:(e,t,n)=>{var r=n("5pfJ");e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},"3Qlq":e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},"7No3":(e,t,n)=>{var r=n("EAGB"),i=n("lN3w"),o=n("Bstx"),a=n("bVbG"),s=n("6Rtw");e.exports=function(e,t,n){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},sD1O:(e,t,n)=>{var r=n("vGGS"),i=n("/wCD"),o=n("CbIe");e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},oCTG:(e,t,n)=>{var r=n("Syyo"),i=n("bvyN"),o=n("wxYD"),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},pnw1:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},R5u7:(e,t,n)=>{var r=n("pPzx"),i=n("9y2L"),o=n("pnw1"),a=n("tQYX");e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},i7nn:(e,t,n)=>{var r=n("wxYD"),i=n("a88S"),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},"6UKJ":e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},"9vbJ":(e,t,n)=>{var r,i=n("3KBa"),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},CbIe:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},"+tCn":(e,t,n)=>{var r=n("tQYX");e.exports=function(e){return e==e&&!r(e)}},"8Zrg":e=>{e.exports=function(){this.__data__=[],this.size=0}},kwr2:(e,t,n)=>{var r=n("6QIk"),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},"5VYK":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},"Coc+":(e,t,n)=>{var r=n("6QIk");e.exports=function(e){return r(this.__data__,e)>-1}},LzM7:(e,t,n)=>{var r=n("6QIk");e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},m5o6:(e,t,n)=>{var r=n("Tv3l"),i=n("+ooz"),o=n("qeCs");e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},d0UJ:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},eask:(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).get(e)}},"9SKQ":(e,t,n)=>{var r=n("JNqh");e.exports=function(e){return r(this,e).has(e)}},e63W:(e,t,n)=>{var r=n("JNqh");e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},aURW:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},"0Ss3":e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},"0+aC":(e,t,n)=>{var r=n("pFSi");e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},"5pfJ":(e,t,n)=>{var r=n("vxC8")(Object,"create");e.exports=r},OtNC:(e,t,n)=>{var r=n("TAtK")(Object.keys,Object);e.exports=r},"/UTG":e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},T6vp:(e,t,n)=>{e=n.nmd(e);var r=n("e93E"),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},kHoZ:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},TAtK:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},UAs9:(e,t,n)=>{var r=n("zaNA"),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),u=Array(s);++a<s;)u[a]=o[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=o[a];return l[t]=n(u),r(e,this,l)}}},IBsm:(e,t,n)=>{var r=n("e93E"),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},LL3N:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},qjF7:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},cEmw:e=>{e.exports=function(e){return this.__data__.has(e)}},XlL0:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},"7Pat":(e,t,n)=>{var r=n("+7q0"),i=n("kG2z")(r);e.exports=i},kG2z:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},RNlM:(e,t,n)=>{var r=n("+ooz");e.exports=function(){this.__data__=new r,this.size=0}},E4ao:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},BSqe:e=>{e.exports=function(e){return this.__data__.get(e)}},L6um:e=>{e.exports=function(e){return this.__data__.has(e)}},"4/ik":(e,t,n)=>{var r=n("+ooz"),i=n("qeCs"),o=n("hyzI");e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},n1QJ:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}},GVul:(e,t,n)=>{var r=n("2wsP"),i=n("GZgP"),o=n("QZ90");e.exports=function(e){return i(e)?o(e):r(e)}},SoOq:(e,t,n)=>{var r=n("0+aC"),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},Ypsa:(e,t,n)=>{var r=n("a88S");e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},c18h:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},"6XIJ":e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},QZ90:e=>{var t="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",n="\\ud83c[\\udffb-\\udfff]",r="[^\\ud800-\\udfff]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",o="[\\ud800-\\udbff][\\udc00-\\udfff]",a="(?:"+t+"|"+n+")?",s="[\\ufe0e\\ufe0f]?"+a+"(?:\\u200d(?:"+[r,i,o].join("|")+")[\\ufe0e\\ufe0f]?"+a+")*",u="(?:"+[r+t+"?",t,i,o,"[\\ud800-\\udfff]"].join("|")+")",l=RegExp(n+"(?="+n+")|"+u+s,"g");e.exports=function(e){for(var t=l.lastIndex=0;l.test(e);)++t;return t}},zr3P:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,4)}},c2re:(e,t,n)=>{var r=n("kn3Q");e.exports=function(e){return r(e,5)}},eN33:e=>{e.exports=function(e){return function(){return e}}},WHWN:(e,t,n)=>{var r=n("R3TX"),i=n("pPzx"),o=n("R5u7"),a=n("zH+d"),s=Object.prototype,u=s.hasOwnProperty,l=r((function(e,t){e=Object(e);var n=-1,r=t.length,l=r>2?t[2]:void 0;for(l&&o(t[0],t[1],l)&&(r=1);++n<r;)for(var c=t[n],d=a(c),h=-1,p=d.length;++h<p;){var f=d[h],v=e[f];(void 0===v||i(v,s[f])&&!u.call(e,f))&&(e[f]=c[f])}return e}));e.exports=l},h4um:(e,t,n)=>{e.exports=n("9SCj")},pPzx:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},"+DnP":(e,t,n)=>{var r=n("W0vE"),i=n("sjzV"),o=n("S3pA"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},"6R5o":(e,t,n)=>{var r=n("1aYn")(n("FllU"));e.exports=r},FllU:(e,t,n)=>{var r=n("DuXo"),i=n("S3pA"),o=n("m2YG"),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(e,i(t,3),u)}},"1xil":(e,t,n)=>{var r=n("YpBQ");e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},"9SCj":(e,t,n)=>{var r=n("LmOH"),i=n("Q4oW"),o=n("D49j"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},ZVKf:(e,t,n)=>{var r=n("UdtX"),i=n("D49j"),o=n("zH+d");e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},"2srY":(e,t,n)=>{var r=n("w2Tz");e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},"1mr4":(e,t,n)=>{var r=n("SJov"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},"NW/2":(e,t,n)=>{var r=n("JYmt"),i=n("z+TE");e.exports=function(e,t){return null!=e&&i(e,t,r)}},zWgn:e=>{e.exports=function(e){return e}},bvyN:(e,t,n)=>{var r=n("/30y"),i=n("tLQN"),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},wxYD:e=>{e.exports=Array.isArray},"9y2L":(e,t,n)=>{var r=n("2q8g"),i=n("t0L4");e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},Ndl3:(e,t,n)=>{var r=n("9y2L"),i=n("tLQN");e.exports=function(e){return i(e)&&r(e)}},"3ajY":(e,t,n)=>{e=n.nmd(e);var r=n("IBsm"),i=n("DjCF"),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0;e.exports=(s?s.isBuffer:void 0)||i},MwrP:(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),o=n("bvyN"),a=n("wxYD"),s=n("9y2L"),u=n("3ajY"),l=n("CbIe"),c=n("Qd2C"),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(l(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},"2q8g":(e,t,n)=>{var r=n("Dhk8"),i=n("tQYX");e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},t0L4:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},NbvU:(e,t,n)=>{var r=n("gEWz"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isMap,s=a?i(a):r;e.exports=s},tQYX:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},tLQN:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},Kkar:(e,t,n)=>{var r=n("Dhk8"),i=n("/wCD"),o=n("tLQN"),a=Function.prototype.toString,s=Object.prototype.hasOwnProperty,u=a.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==u}},"/iLo":(e,t,n)=>{var r=n("6I2w"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isSet,s=a?i(a):r;e.exports=s},nDih:(e,t,n)=>{var r=n("Dhk8"),i=n("wxYD"),o=n("tLQN");e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},a88S:(e,t,n)=>{var r=n("Dhk8"),i=n("tLQN");e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},Qd2C:(e,t,n)=>{var r=n("7/jS"),i=n("SU8Q"),o=n("T6vp"),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},CZlo:e=>{e.exports=function(e){return void 0===e}},BlJA:(e,t,n)=>{var r=n("rmhs"),i=n("4uJK"),o=n("9y2L");e.exports=function(e){return o(e)?r(e):i(e)}},"zH+d":(e,t,n)=>{var r=n("rmhs"),i=n("p2lg"),o=n("9y2L");e.exports=function(e){return o(e)?r(e,!0):i(e)}},"p1C/":e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},mbB6:(e,t,n)=>{var r=n("H87J"),i=n("S3pA"),o=n("bFjY"),a=n("wxYD");e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},y2Ah:(e,t,n)=>{var r=n("wC3K"),i=n("zKkv"),o=n("S3pA");e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},"LPC+":(e,t,n)=>{var r=n("JElN"),i=n("FaiA"),o=n("zWgn");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},pFSi:(e,t,n)=>{var r=n("hyzI");function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},H8sf:(e,t,n)=>{var r=n("MzY2"),i=n("wpQC")((function(e,t,n){r(e,t,n)}));e.exports=i},Z3AG:(e,t,n)=>{var r=n("JElN"),i=n("n+p3"),o=n("zWgn");e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},PKEM:(e,t,n)=>{var r=n("JElN"),i=n("S3pA"),o=n("n+p3");e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},nnm9:e=>{e.exports=function(){}},ENE1:(e,t,n)=>{var r=n("IBsm");e.exports=function(){return r.Date.now()}},"//nZ":(e,t,n)=>{var r=n("QwI6"),i=n("cH1A")((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},"1EDM":(e,t,n)=>{var r=n("EI7Z"),i=n("CEyS"),o=n("i7nn"),a=n("Ypsa");e.exports=function(e){return o(e)?r(a(e)):i(e)}},Cmkl:(e,t,n)=>{var r=n("2M3I")();e.exports=r},veKZ:(e,t,n)=>{var r=n("cPMt"),i=n("Q4oW"),o=n("S3pA"),a=n("5q8j"),s=n("wxYD");e.exports=function(e,t,n){var u=s(e)?r:a,l=arguments.length<3;return u(e,o(t,4),n,l,i)}},"7seP":(e,t,n)=>{var r=n("4uJK"),i=n("kkM+"),o=n("9y2L"),a=n("nDih"),s=n("GVul");e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},u6DZ:(e,t,n)=>{var r=n("YpBQ"),i=n("eHpp"),o=n("R3TX"),a=n("R5u7"),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},X4R2:e=>{e.exports=function(){return[]}},DjCF:e=>{e.exports=function(){return!1}},fWyh:(e,t,n)=>{var r=n("nvU9");e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},m2YG:(e,t,n)=>{var r=n("fWyh");e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},nvU9:(e,t,n)=>{var r=n("I1fX"),i=n("tQYX"),o=n("a88S"),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||u.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},"4ScB":(e,t,n)=>{var r=n("LtXa"),i=n("zH+d");e.exports=function(e){return r(e,i(e))}},dw5g:(e,t,n)=>{var r=n("JcJ6");e.exports=function(e){return null==e?"":r(e)}},"cZX/":(e,t,n)=>{var r=n("LmOH"),i=n("vGGS"),o=n("zKkv"),a=n("S3pA"),s=n("/wCD"),u=n("wxYD"),l=n("3ajY"),c=n("2q8g"),d=n("tQYX"),h=n("Qd2C");e.exports=function(e,t,n){var p=u(e),f=p||l(e)||h(e);if(t=a(t,4),null==n){var v=e&&e.constructor;n=f?p?new v:[]:d(e)&&c(v)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},aGtI:(e,t,n)=>{var r=n("YpBQ"),i=n("R3TX"),o=n("s+R0"),a=n("Ndl3"),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},w0mW:(e,t,n)=>{var r=n("dw5g"),i=0;e.exports=function(e){var t=++i;return r(e)+t}},"0iyY":(e,t,n)=>{var r=n("SJvO"),i=n("BlJA");e.exports=function(e){return null==e?[]:r(e,i(e))}},OUo6:(e,t,n)=>{var r=n("c72w"),i=n("WvmI");e.exports=function(e,t){return i(e||[],t||[],r)}}},e=>{e(e.s="MU0e")}]);