@marimo-team/frontend 0.14.11 → 0.14.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-B9BmPz9a.js → ConnectedDataExplorerComponent-CBKTnGIO.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-CNTqLdnf.js → ImageComparisonComponent-D_1rLFqD.js} +1 -1
- package/dist/assets/{VegaLite-DLKRDJvl.js → VegaLite-B_dlvmS8.js} +1 -1
- package/dist/assets/_baseEach-BRg52hSf.js +1 -0
- package/dist/assets/_baseMap-C8GGmDJG.js +1 -0
- package/dist/assets/_baseUniq-DNyfrpcN.js +1 -0
- package/dist/assets/{_createAggregator-C_WhAECr.js → _createAggregator-Baj-S-w2.js} +1 -1
- package/dist/assets/{any-language-editor-DrZjy7mH.js → any-language-editor-DpXFI5QG.js} +1 -1
- package/dist/assets/{architectureDiagram-NQ2NVSRB-DqJfNlvg.js → architectureDiagram-SUXI7LT5-B47ODzlu.js} +3 -3
- package/dist/assets/{blockDiagram-PHRCVELO-BMyZ52bP.js → blockDiagram-6J76NXCF-DAEJc3eE.js} +6 -6
- package/dist/assets/{c4Diagram-6F6E4RAY-DveKwcb7.js → c4Diagram-6F6E4RAY-ttnVRT3Y.js} +1 -1
- package/dist/assets/channel-ukMKC8Ba.js +1 -0
- package/dist/assets/{chunk-353BL4L5-DBdJb07A.js → chunk-353BL4L5-D2cH1aM-.js} +1 -1
- package/dist/assets/{chunk-67H74DCK-DG8iWVJ-.js → chunk-67H74DCK-BhK3V2TP.js} +1 -1
- package/dist/assets/{chunk-AACKK3MU-CDOdA9eC.js → chunk-AACKK3MU-BGsWBcze.js} +1 -1
- package/dist/assets/{chunk-BFAMUDN2-Cf6198RO.js → chunk-BFAMUDN2-DbnMfH-q.js} +1 -1
- package/dist/assets/{chunk-E2GYISFI-fSvIEcyU.js → chunk-E2GYISFI-2-NOnWc3.js} +1 -1
- package/dist/assets/{chunk-6OLS64BW-Dmt4rYEQ.js → chunk-OW32GOEJ-Bz6eMZz9.js} +1 -1
- package/dist/assets/{chunk-SKB7J2MH-B7Z1FsaJ.js → chunk-SKB7J2MH-C9m7rnpG.js} +1 -1
- package/dist/assets/{chunk-QEP2MXWD-D6FP1cQC.js → chunk-SZ463SBG-9jmdZ7UB.js} +1 -1
- package/dist/assets/{circle-play-CBftacWk.js → circle-play-DjJ5u-05.js} +1 -1
- package/dist/assets/classDiagram-M3E45YP4-X_c0WAZt.js +1 -0
- package/dist/assets/classDiagram-v2-YAWTLIQI-X_c0WAZt.js +1 -0
- package/dist/assets/clone-Bk2-uU7a.js +1 -0
- package/dist/assets/{compile-mbjlQ5nn.js → compile-C1fgVjKt.js} +8 -8
- package/dist/assets/cytoscape.esm-CzSnbbKZ.js +325 -0
- package/dist/assets/{dagre-FFZHY6LT-DX9cGWLP.js → dagre-JOIXM2OF-CcaBCP5W.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-C4fyHnn1.js → data-grid-overlay-editor-BZwv-WhT.js} +1 -1
- package/dist/assets/{diagram-5UYTHUR4-BgOShMim.js → diagram-5UYTHUR4-D9BnbEeD.js} +1 -1
- package/dist/assets/diagram-VMROVX33-C_v4sUOK.js +24 -0
- package/dist/assets/{diagram-ZTM2IBQH-m55tqkSF.js → diagram-ZTM2IBQH-DkfH8XUB.js} +1 -1
- package/dist/assets/edit-page-TN4XAy2z.js +147 -0
- package/dist/assets/{erDiagram-R3QVA2FD-B8SQvwhp.js → erDiagram-3M52JZNH-BF32hHK0.js} +1 -1
- package/dist/assets/{flowDiagram-PKI6S5ZS-BTbZVZp0.js → flowDiagram-KYDEHFYC-C55z-Ujy.js} +1 -1
- package/dist/assets/{ganttDiagram-EK5VF46D-Dkuqvb7b.js → ganttDiagram-EK5VF46D-CPBRY9C7.js} +3 -3
- package/dist/assets/{gitGraphDiagram-GW3U2K7C-BMQ8L_am.js → gitGraphDiagram-GW3U2K7C-DcxuZq_j.js} +1 -1
- package/dist/assets/{glide-data-editor-BKZWFNVv.js → glide-data-editor-DEySJ-Uv.js} +11 -11
- package/dist/assets/{graph-CFDemIXQ.js → graph-Wnsqj3W7.js} +1 -1
- package/dist/assets/{home-page-DUbYTF9g.js → home-page-DcMrkDPE.js} +3 -3
- package/dist/assets/{index-CH2sakSJ.js → index-4EoOw_ED.js} +1 -1
- package/dist/assets/{index-CRY746sV.js → index-B1o5PWgw.js} +1 -1
- package/dist/assets/{index-B0-K_sX8.js → index-B2587e_p.js} +1 -1
- package/dist/assets/{index-ChVO1Vdj.js → index-BamjPWEC.js} +1 -1
- package/dist/assets/index-BlYahtg3.js +1 -0
- package/dist/assets/index-C-IG5Jr8.js +1 -0
- package/dist/assets/index-C4BBG11u.js +1 -0
- package/dist/assets/index-CF_KIi0p.js +1 -0
- package/dist/assets/index-D98B-7XN.js +1 -0
- package/dist/assets/index-DGjhFk6m.js +1 -0
- package/dist/assets/index-DYmhnlX1.js +507 -0
- package/dist/assets/index-Db00Ydia.js +1 -0
- package/dist/assets/index-Dqf23Hvm.js +1 -0
- package/dist/assets/{index-MUMVp22V.js → index-QfsoKVOY.js} +1 -1
- package/dist/assets/index-RoS9j4wO.js +1 -0
- package/dist/assets/index-S3mjG3Uz.css +1 -0
- package/dist/assets/index-Z1jc58tW.js +1 -0
- package/dist/assets/index-a8t0EFic.js +1 -0
- package/dist/assets/{index-C_e9XjpS.js → index-kzqyjt1O.js} +1 -1
- package/dist/assets/{index-d0CXXxee.js → index-wRtWpsgQ.js} +2 -2
- package/dist/assets/{infoDiagram-RLU2ROGC-DAW5X38W.js → infoDiagram-LHK5PUON-DiXY5W-u.js} +1 -1
- package/dist/assets/{journeyDiagram-EWQZEKCU--6lJjuiM.js → journeyDiagram-EWQZEKCU-Nm6fcEAi.js} +1 -1
- package/dist/assets/{kanban-definition-ILFWEQ3N-CXNPWHB8.js → kanban-definition-ZSS6B67P-CGqK-B6v.js} +1 -1
- package/dist/assets/{layout-Jgv95YSr.js → layout-DdtO6MuW.js} +1 -1
- package/dist/assets/{linear-DtgEMbrz.js → linear-CCLVHXdb.js} +1 -1
- package/dist/assets/links-BOSKRjH_.js +17 -0
- package/dist/assets/loro_wasm_bg-C3hKWL9L.js +2 -0
- package/dist/assets/mermaid-DonGMagM.js +207 -0
- package/dist/assets/min-DCdo07Qe.js +1 -0
- package/dist/assets/mindmap-definition-6CBA2TL7-DV80ltbO.js +95 -0
- package/dist/assets/{number-overlay-editor-C3hemckO.js → number-overlay-editor-DPd2PkyH.js} +1 -1
- package/dist/assets/{pieDiagram-NIOCPIFQ-B-zGF99A.js → pieDiagram-NIOCPIFQ-CLg8zuiX.js} +3 -3
- package/dist/assets/{quadrantDiagram-2OG54O6I-2tF9b_2b.js → quadrantDiagram-2OG54O6I-Q-Nbai62.js} +1 -1
- package/dist/assets/{react-plotly-CdJaKwaj.js → react-plotly-BUhpkTZA.js} +200 -200
- package/dist/assets/{requirementDiagram-SO3GGRV7-DEa34SeY.js → requirementDiagram-QOLK2EJ7-B9SoIsLP.js} +1 -1
- package/dist/assets/run-page-c4k7pMUk.js +1 -0
- package/dist/assets/sankeyDiagram-4UZDY2LN-Bgg2hsKs.js +10 -0
- package/dist/assets/sequenceDiagram-SKLFT4DO-BzFcDEng.js +122 -0
- package/dist/assets/{slides-component-C2uc6kmf.js → slides-component-BhqZju_R.js} +1 -1
- package/dist/assets/{sortBy-Bob7dKSt.js → sortBy-C43Pp6GY.js} +1 -1
- package/dist/assets/{stateDiagram-XX37X6EN-DUi_goR8.js → stateDiagram-MI5ZYTHO-CSucWgeR.js} +1 -1
- package/dist/assets/stateDiagram-v2-5AN5P6BG-BT7qyLYw.js +1 -0
- package/dist/assets/storage-DZZHoZaf.js +25 -0
- package/dist/assets/{terminal-BkOhnp-S.js → terminal-CknBNEbl.js} +1 -1
- package/dist/assets/{time-BXb9z1yv.js → time-bZ-arUoy.js} +1 -1
- package/dist/assets/{timeline-definition-RI47OAVP-CTWn3WQu.js → timeline-definition-MYPXXCX6-MZqqJbkt.js} +3 -3
- package/dist/assets/tracing-D77Keje5.js +2 -0
- package/dist/assets/{trash-BWRVB_br.js → trash-BZiJbQ0d.js} +1 -1
- package/dist/assets/treemap-75Q7IDZK-BAq6XOUv.js +126 -0
- package/dist/assets/{vega-component-CX_u3Hhp.js → vega-component-oHitp1cz.js} +1 -1
- package/dist/assets/{worker-BYA2ASe8.js → worker-Bma4sWEs.js} +1 -1
- package/dist/assets/{xychartDiagram-H2YORKM3-D0JoLNE8.js → xychartDiagram-H2YORKM3-D5zeDIcK.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +9 -19
- package/dist/assets/_baseEach-BjDLzUwG.js +0 -1
- package/dist/assets/_baseMap-CuZ-LBtv.js +0 -1
- package/dist/assets/_baseUniq-DqHaT24V.js +0 -1
- package/dist/assets/channel-LYGgdr1R.js +0 -1
- package/dist/assets/classDiagram-BGRH5UQR-BQbZmSV-.js +0 -1
- package/dist/assets/classDiagram-v2-O24JOBDK-BQbZmSV-.js +0 -1
- package/dist/assets/clone-DD3sG0_1.js +0 -1
- package/dist/assets/cytoscape.esm-UYyVlru8.js +0 -10
- package/dist/assets/diagram-3EMPZRKU-BwXQu6c-.js +0 -24
- package/dist/assets/edit-page-BMW2Fhcz.js +0 -148
- package/dist/assets/index-1az6nvpO.js +0 -1
- package/dist/assets/index-B9WlbtVk.js +0 -1
- package/dist/assets/index-BWEPJWCF.js +0 -1
- package/dist/assets/index-CE3mbf8H.js +0 -1
- package/dist/assets/index-CaHkXpUp.js +0 -1
- package/dist/assets/index-CfvA7bvb.js +0 -1
- package/dist/assets/index-CsdFJkJw.css +0 -1
- package/dist/assets/index-CylrdBnG.js +0 -1
- package/dist/assets/index-D3Er-byj.js +0 -1
- package/dist/assets/index-D_Dmmo5g.js +0 -1
- package/dist/assets/index-Drq4Lpl3.js +0 -1
- package/dist/assets/index-NLK5-sPO.js +0 -1
- package/dist/assets/index-_lj65MZR.js +0 -507
- package/dist/assets/links-Bjf-1I2i.js +0 -17
- package/dist/assets/mermaid-DCMac0Ai.js +0 -152
- package/dist/assets/min-VDyC-auF.js +0 -1
- package/dist/assets/mindmap-definition-CZNETY7S-BEd6cR16.js +0 -95
- package/dist/assets/run-page-Bg1x8WTa.js +0 -1
- package/dist/assets/sankeyDiagram-4UZDY2LN-DUIUN-K8.js +0 -10
- package/dist/assets/sequenceDiagram-ZIKVLSP4-BZGddaB9.js +0 -122
- package/dist/assets/stateDiagram-v2-GD6S3NHB-CdRNmgeb.js +0 -1
- package/dist/assets/storage-CTvz5ejZ.js +0 -25
- package/dist/assets/tracing-Z4QREdu3.js +0 -2
- package/dist/assets/treemap-FKARHQ26-AlpUch0p.js +0 -126
@@ -1,10 +0,0 @@
|
|
1
|
-
function Ne(e){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ne(e)}function ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aa(e,t,n){return t&&function(r,a){for(var o=0;o<a.length;o++){var i=a[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ut(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var o,i,s=[],l=!0,u=!1;try{for(a=a.call(n);!(l=(o=a.next()).done)&&(s.push(o.value),!r||s.length!==r);l=!0);}catch(c){u=!0,i=c}finally{try{l||a.return==null||a.return()}finally{if(u)throw i}}return s}}(e,t)||fi(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function fi(e,t){if(e){if(typeof e=="string")return gi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gi(e,t):void 0}}function gi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vi(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=fi(e))||t){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return i=l.done,l},e:function(l){s=!0,o=l},f:function(){try{i||n.return==null||n.return()}finally{if(s)throw o}}}}var Ae=typeof window>"u"?null:window,yi=Ae?Ae.navigator:null;Ae&&Ae.document;var dl=Ne(""),mi=Ne({}),hl=Ne(function(){}),pl=typeof HTMLElement>"u"?"undefined":Ne(HTMLElement),An=function(e){return e&&e.instanceString&&Me(e.instanceString)?e.instanceString():null},ce=function(e){return e!=null&&Ne(e)==dl},Me=function(e){return e!=null&&Ne(e)===hl},ke=function(e){return!tt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},ve=function(e){return e!=null&&Ne(e)===mi&&!ke(e)&&e.constructor===Object},te=function(e){return e!=null&&Ne(e)===Ne(1)&&!isNaN(e)},ur=function(e){return pl==="undefined"?void 0:e!=null&&e instanceof HTMLElement},tt=function(e){return Ln(e)||bi(e)},Ln=function(e){return An(e)==="collection"&&e._private.single},bi=function(e){return An(e)==="collection"&&!e._private.single},ia=function(e){return An(e)==="core"},xi=function(e){return An(e)==="stylesheet"},Tt=function(e){return e==null||!(e!==""&&!e.match(/^\s+$/))},fl=function(e){return function(t){return t!=null&&Ne(t)===mi}(e)&&Me(e.then)},zn=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var r=[],a=0;a<arguments.length;a++)r.push(arguments[a]);return r.join("$")});var n=function r(){var a,o=arguments,i=t.apply(this,o),s=r.cache;return(a=s[i])||(a=s[i]=e.apply(this,o)),a};return n.cache={},n},oa=zn(function(e){return e.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}),cr=zn(function(e){return e.replace(/(-\w)/g,function(t){return t[1].toUpperCase()})}),wi=zn(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+"$"+t}),Ei=function(e){return Tt(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Le="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",gl="rgb[a]?\\(("+Le+"[%]?)\\s*,\\s*("+Le+"[%]?)\\s*,\\s*("+Le+"[%]?)(?:\\s*,\\s*("+Le+"))?\\)",vl="rgb[a]?\\((?:"+Le+"[%]?)\\s*,\\s*(?:"+Le+"[%]?)\\s*,\\s*(?:"+Le+"[%]?)(?:\\s*,\\s*(?:"+Le+"))?\\)",yl="hsl[a]?\\(("+Le+")\\s*,\\s*("+Le+"[%])\\s*,\\s*("+Le+"[%])(?:\\s*,\\s*("+Le+"))?\\)",ml="hsl[a]?\\((?:"+Le+")\\s*,\\s*(?:"+Le+"[%])\\s*,\\s*(?:"+Le+"[%])(?:\\s*,\\s*(?:"+Le+"))?\\)",ki=function(e,t){return e<t?-1:e>t?1:0},he=Object.assign!=null?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var a=Object.keys(r),o=0;o<a.length;o++){var i=a[o];e[i]=r[i]}}return e},bl=function(e){return(ke(e)?e:null)||function(t){return xl[t.toLowerCase()]}(e)||function(t){if((t.length===4||t.length===7)&&t[0]==="#"){var n,r,a,o=16;return t.length===4?(n=parseInt(t[1]+t[1],o),r=parseInt(t[2]+t[2],o),a=parseInt(t[3]+t[3],o)):(n=parseInt(t[1]+t[2],o),r=parseInt(t[3]+t[4],o),a=parseInt(t[5]+t[6],o)),[n,r,a]}}(e)||function(t){var n,r=new RegExp("^"+gl+"$").exec(t);if(r){n=[];for(var a=[],o=1;o<=3;o++){var i=r[o];if(i[i.length-1]==="%"&&(a[o]=!0),i=parseFloat(i),a[o]&&(i=i/100*255),i<0||i>255)return;n.push(Math.floor(i))}var s=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(s&&!l)return;var u=r[4];if(u!==void 0){if((u=parseFloat(u))<0||u>1)return;n.push(u)}}return n}(e)||function(t){var n,r,a,o,i,s,l,u;function c(p,v,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?p+6*(v-p)*b:b<.5?v:b<2/3?p+(v-p)*(2/3-b)*6:p}var d=new RegExp("^"+yl+"$").exec(t);if(d){if((r=parseInt(d[1]))<0?r=(360- -1*r%360)%360:r>360&&(r%=360),r/=360,(a=parseFloat(d[2]))<0||a>100||(a/=100,(o=parseFloat(d[3]))<0||o>100)||(o/=100,(i=d[4])!==void 0&&((i=parseFloat(i))<0||i>1)))return;if(a===0)s=l=u=Math.round(255*o);else{var h=o<.5?o*(1+a):o+a-o*a,g=2*o-h;s=Math.round(255*c(g,h,r+1/3)),l=Math.round(255*c(g,h,r)),u=Math.round(255*c(g,h,r-1/3))}n=[s,l,u,i]}return n}(e)},xl={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]},Ci=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var o=n[a];if(ve(o))throw Error("Tried to set map with object key");a<n.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},Si=function(e){for(var t=e.map,n=e.keys,r=n.length,a=0;a<r;a++){var o=n[a];if(ve(o))throw Error("Tried to get map with object key");if((t=t[o])==null)return t}return t},qt=function(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")},In=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},wl=typeof In=="object"&&In&&In.Object===Object&&In,El=typeof self=="object"&&self&&self.Object===Object&&self,dr=wl||El||Function("return this")(),sa=function(){return dr.Date.now()},kl=/\s/,Cl=function(e){for(var t=e.length;t--&&kl.test(e.charAt(t)););return t},Sl=/^\s+/,Pl=function(e){return e&&e.slice(0,Cl(e)+1).replace(Sl,"")},on=dr.Symbol,Pi=Object.prototype,Dl=Pi.hasOwnProperty,Tl=Pi.toString,Rn=on?on.toStringTag:void 0,Ml=function(e){var t=Dl.call(e,Rn),n=e[Rn];try{e[Rn]=void 0;var r=!0}catch{}var a=Tl.call(e);return r&&(t?e[Rn]=n:delete e[Rn]),a},Bl=Object.prototype.toString,_l=function(e){return Bl.call(e)},Di=on?on.toStringTag:void 0,Ti=function(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Di&&Di in Object(e)?Ml(e):_l(e)},Nl=function(e){return e!=null&&typeof e=="object"},On=function(e){return typeof e=="symbol"||Nl(e)&&Ti(e)=="[object Symbol]"},Al=/^[-+]0x[0-9a-f]+$/i,Ll=/^0b[01]+$/i,zl=/^0o[0-7]+$/i,Il=parseInt,Mi=function(e){if(typeof e=="number")return e;if(On(e))return NaN;if(qt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=qt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Pl(e);var n=Ll.test(e);return n||zl.test(e)?Il(e.slice(2),n?2:8):Al.test(e)?NaN:+e},Rl=Math.max,Ol=Math.min,hr=function(e,t,n){var r,a,o,i,s,l,u=0,c=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError("Expected a function");function g(y){var m=r,k=a;return r=a=void 0,u=y,i=e.apply(k,m)}function p(y){var m=y-l;return l===void 0||m>=t||m<0||d&&y-u>=o}function v(){var y=sa();if(p(y))return b(y);s=setTimeout(v,function(m){var k=t-(m-l);return d?Ol(k,o-(m-u)):k}(y))}function b(y){return s=void 0,h&&r?g(y):(r=a=void 0,i)}function f(){var y=sa(),m=p(y);if(r=arguments,a=this,l=y,m){if(s===void 0)return function(k){return u=k,s=setTimeout(v,t),c?g(k):i}(l);if(d)return clearTimeout(s),s=setTimeout(v,t),g(l)}return s===void 0&&(s=setTimeout(v,t)),i}return t=Mi(t)||0,qt(n)&&(c=!!n.leading,o=(d="maxWait"in n)?Rl(Mi(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),f.cancel=function(){s!==void 0&&clearTimeout(s),u=0,r=l=a=s=void 0},f.flush=function(){return s===void 0?i:b(sa())},f},la=Ae?Ae.performance:null,Bi=la&&la.now?function(){return la.now()}:function(){return Date.now()},Vl=function(){if(Ae){if(Ae.requestAnimationFrame)return function(e){Ae.requestAnimationFrame(e)};if(Ae.mozRequestAnimationFrame)return function(e){Ae.mozRequestAnimationFrame(e)};if(Ae.webkitRequestAnimationFrame)return function(e){Ae.webkitRequestAnimationFrame(e)};if(Ae.msRequestAnimationFrame)return function(e){Ae.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(Bi())},1e3/60)}}(),pr=function(e){return Vl(e)},wt=Bi,sn=9261,Vn=5381,_i=function(e){for(var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sn;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Fn=function(e){return 65599*(arguments.length>1&&arguments[1]!==void 0?arguments[1]:sn)+e|0},Xn=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vn;return(t<<5)+t+e|0},Mt=function(e){return 2097152*e[0]+e[1]},fr=function(e,t){return[Fn(e[0],t[0]),Xn(e[1],t[1])]},Yt=function(e,t){var n={value:0,done:!1},r=0,a=e.length;return _i({next:function(){return r<a?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},Ni=function(){return Fl(arguments)},Fl=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=n===0?Yt(r):Yt(r,t)}return t},Ai=!0,Xl=console.warn!=null,ql=console.trace!=null,ua=Number.MAX_SAFE_INTEGER||9007199254740991,Li=function(){return!0},gr=function(){return!1},zi=function(){return 0},ca=function(){},Be=function(e){throw new Error(e)},Ii=function(e){if(e===void 0)return Ai;Ai=!!e},we=function(e){Ii()&&(Xl?console.warn(e):(console.log(e),ql&&console.trace()))},vt=function(e){return e==null?e:ke(e)?e.slice():ve(e)?function(t){return he({},t)}(e):e},Ri=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},Yl={},Oi=function(){return Yl},Re=function(e){var t=Object.keys(e);return function(n){for(var r={},a=0;a<t.length;a++){var o=t[a],i=n==null?void 0:n[o];r[o]=i===void 0?e[o]:i}return r}},Bt=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},da=function(e){e.splice(0,e.length)},ct=function(e,t,n){return n&&(t=wi(n,t)),e[t]},_t=function(e,t,n,r){n&&(t=wi(n,t)),e[t]=r},yt=typeof Map<"u"?Map:function(){function e(){ra(this,e),this._obj={}}return aa(e,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}]),e}(),jl=function(){function e(t){if(ra(this,e),this._obj=Object.create(null),this.size=0,t!=null){var n;n=t.instanceString!=null&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r<n.length;r++)this.add(n[r])}}return aa(e,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}]),e}(),ln=(typeof Set>"u"?"undefined":Ne(Set))!=="undefined"?Set:jl,vr=function(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];if(e!==void 0&&t!==void 0&&ia(e)){var r=t.group;if(r==null&&(r=t.data&&t.data.source!=null&&t.data.target!=null?"edges":"nodes"),r==="nodes"||r==="edges"){this.length=1,this[0]=this;var a=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:t.selectable===void 0||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0||!!t.grabbable,pannable:t.pannable===void 0?r==="edges":!!t.pannable,active:!1,classes:new ln,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.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(a.position.x==null&&(a.position.x=0),a.position.y==null&&(a.position.y=0),t.renderedPosition){var o=t.renderedPosition,i=e.pan(),s=e.zoom();a.position={x:(o.x-i.x)/s,y:(o.y-i.y)/s}}var l=[];ke(t.classes)?l=t.classes:ce(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;u<c;u++){var d=l[u];d&&d!==""&&a.classes.add(d)}this.createEmitter();var h=t.style||t.css;h&&(we("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h)),(n===void 0||n)&&this.restore()}else Be("An element must be of type `nodes` or `edges`; you specified `"+r+"`")}else Be("An element must have a core reference and parameters set")},Vi=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var a;ve(t)&&!tt(t)&&(t=(a=t).roots||a.root,n=a.visit,r=a.directed),r=arguments.length!==2||Me(n)?r:n,n=Me(n)?n:function(){};for(var o,i=this._private.cy,s=t=ce(t)?this.filter(t):t,l=[],u=[],c={},d={},h={},g=0,p=this.byGroup(),v=p.nodes,b=p.edges,f=0;f<s.length;f++){var y=s[f],m=y.id();y.isNode()&&(l.unshift(y),e.bfs&&(h[m]=!0,u.push(y)),d[m]=0)}for(var k=function(){var P=e.bfs?l.shift():l.pop(),T=P.id();if(e.dfs){if(h[T])return"continue";h[T]=!0,u.push(P)}var B,M=d[T],z=c[T],R=z!=null?z.source():null,F=z!=null?z.target():null,N=z==null?void 0:P.same(R)?F[0]:R[0];if((B=n(P,z,N,g++,M))===!0)return o=P,"break";if(B===!1)return"break";for(var I=P.connectedEdges().filter(function(G){return(!r||G.source().same(P))&&b.has(G)}),X=0;X<I.length;X++){var O=I[X],Y=O.connectedNodes().filter(function(G){return!G.same(P)&&v.has(G)}),j=Y.id();Y.length===0||h[j]||(Y=Y[0],l.push(Y),e.bfs&&(h[j]=!0,u.push(Y)),c[j]=O,d[j]=d[T]+1)}};l.length!==0;){var x=k();if(x!=="continue"&&x==="break")break}for(var S=i.collection(),w=0;w<u.length;w++){var D=u[w],E=c[D.id()];E!=null&&S.push(E),S.push(D)}return{path:i.collection(S),found:i.collection(o)}}},qn={breadthFirstSearch:Vi({bfs:!0}),depthFirstSearch:Vi({dfs:!0})};qn.bfs=qn.breadthFirstSearch,qn.dfs=qn.depthFirstSearch;var Wl=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e,t){(function(){var n,r,a,o,i,s,l,u,c,d,h,g,p,v,b;a=Math.floor,d=Math.min,r=function(f,y){return f<y?-1:f>y?1:0},c=function(f,y,m,k,x){var S;if(m==null&&(m=0),x==null&&(x=r),m<0)throw new Error("lo must be non-negative");for(k==null&&(k=f.length);m<k;)x(y,f[S=a((m+k)/2)])<0?k=S:m=S+1;return[].splice.apply(f,[m,m-m].concat(y)),y},s=function(f,y,m){return m==null&&(m=r),f.push(y),v(f,0,f.length-1,m)},i=function(f,y){var m,k;return y==null&&(y=r),m=f.pop(),f.length?(k=f[0],f[0]=m,b(f,0,y)):k=m,k},u=function(f,y,m){var k;return m==null&&(m=r),k=f[0],f[0]=y,b(f,0,m),k},l=function(f,y,m){var k;return m==null&&(m=r),f.length&&m(f[0],y)<0&&(y=(k=[f[0],y])[0],f[0]=k[1],b(f,0,m)),y},o=function(f,y){var m,k,x,S,w,D;for(y==null&&(y=r),w=[],k=0,x=(S=(function(){D=[];for(var E=0,P=a(f.length/2);0<=P?E<P:E>P;0<=P?E++:E--)D.push(E);return D}).apply(this).reverse()).length;k<x;k++)m=S[k],w.push(b(f,m,y));return w},p=function(f,y,m){var k;if(m==null&&(m=r),(k=f.indexOf(y))!==-1)return v(f,0,k,m),b(f,k,m)},h=function(f,y,m){var k,x,S,w,D;if(m==null&&(m=r),!(x=f.slice(0,y)).length)return x;for(o(x,m),S=0,w=(D=f.slice(y)).length;S<w;S++)k=D[S],l(x,k,m);return x.sort(m).reverse()},g=function(f,y,m){var k,x,S,w,D,E,P,T,B;if(m==null&&(m=r),10*y<=f.length){if(!(S=f.slice(0,y).sort(m)).length)return S;for(x=S[S.length-1],w=0,E=(P=f.slice(y)).length;w<E;w++)m(k=P[w],x)<0&&(c(S,k,0,null,m),S.pop(),x=S[S.length-1]);return S}for(o(f,m),B=[],D=0,T=d(y,f.length);0<=T?D<T:D>T;0<=T?++D:--D)B.push(i(f,m));return B},v=function(f,y,m,k){var x,S,w;for(k==null&&(k=r),x=f[m];m>y&&k(x,S=f[w=m-1>>1])<0;)f[m]=S,m=w;return f[m]=x},b=function(f,y,m){var k,x,S,w,D;for(m==null&&(m=r),x=f.length,D=y,S=f[y],k=2*y+1;k<x;)(w=k+1)<x&&!(m(f[k],f[w])<0)&&(k=w),f[y]=f[k],k=2*(y=k)+1;return f[y]=S,v(f,D,y,m)},n=function(){function f(y){this.cmp=y??r,this.nodes=[]}return f.push=s,f.pop=i,f.replace=u,f.pushpop=l,f.heapify=o,f.updateItem=p,f.nlargest=h,f.nsmallest=g,f.prototype.push=function(y){return s(this.nodes,y,this.cmp)},f.prototype.pop=function(){return i(this.nodes,this.cmp)},f.prototype.peek=function(){return this.nodes[0]},f.prototype.contains=function(y){return this.nodes.indexOf(y)!==-1},f.prototype.replace=function(y){return u(this.nodes,y,this.cmp)},f.prototype.pushpop=function(y){return l(this.nodes,y,this.cmp)},f.prototype.heapify=function(){return o(this.nodes,this.cmp)},f.prototype.updateItem=function(y){return p(this.nodes,y,this.cmp)},f.prototype.clear=function(){return this.nodes=[]},f.prototype.empty=function(){return this.nodes.length===0},f.prototype.size=function(){return this.nodes.length},f.prototype.clone=function(){var y;return(y=new f).nodes=this.nodes.slice(0),y},f.prototype.toArray=function(){return this.nodes.slice(0)},f.prototype.insert=f.prototype.push,f.prototype.top=f.prototype.peek,f.prototype.front=f.prototype.peek,f.prototype.has=f.prototype.contains,f.prototype.copy=f.prototype.clone,f}(),e.exports=n}).call(In)}),Yn=Wl,Hl=Re({root:null,weight:function(e){return 1},directed:!1}),Kl={dijkstra:function(e){if(!ve(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Hl(e),r=n.root,a=n.weight,o=n.directed,i=this,s=a,l=ce(r)?this.filter(r)[0]:r[0],u={},c={},d={},h=this.byGroup(),g=h.nodes,p=h.edges;p.unmergeBy(function(z){return z.isLoop()});for(var v=function(z){return u[z.id()]},b=function(z,R){u[z.id()]=R,f.updateItem(z)},f=new Yn(function(z,R){return v(z)-v(R)}),y=0;y<g.length;y++){var m=g[y];u[m.id()]=m.same(l)?0:1/0,f.push(m)}for(var k=function(z,R){for(var F,N=(o?z.edgesTo(R):z.edgesWith(R)).intersect(p),I=1/0,X=0;X<N.length;X++){var O=N[X],Y=s(O);(Y<I||!F)&&(I=Y,F=O)}return{edge:F,dist:I}};f.size()>0;){var x=f.pop(),S=v(x),w=x.id();if(d[w]=S,S!==1/0)for(var D=x.neighborhood().intersect(g),E=0;E<D.length;E++){var P=D[E],T=P.id(),B=k(x,P),M=S+B.dist;M<v(P)&&(b(P,M),c[T]={node:x,edge:B.edge})}}return{distanceTo:function(z){var R=ce(z)?g.filter(z)[0]:z[0];return d[R.id()]},pathTo:function(z){var R=ce(z)?g.filter(z)[0]:z[0],F=[],N=R,I=N.id();if(R.length>0)for(F.unshift(R);c[I];){var X=c[I];F.unshift(X.edge),F.unshift(X.node),I=(N=X.node).id()}return i.spawn(F)}}}},Gl={kruskal:function(e){e=e||function(y){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,a=n.length,o=new Array(a),i=n,s=function(y){for(var m=0;m<o.length;m++)if(o[m].has(y))return m},l=0;l<a;l++)o[l]=this.spawn(n[l]);for(var u=r.sort(function(y,m){return e(y)-e(m)}),c=0;c<u.length;c++){var d=u[c],h=d.source()[0],g=d.target()[0],p=s(h),v=s(g),b=o[p],f=o[v];p!==v&&(i.merge(d),b.merge(f),o.splice(v,1))}return i}},Ul=Re({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Zl={aStar:function(e){var t=this.cy(),n=Ul(e),r=n.root,a=n.goal,o=n.heuristic,i=n.directed,s=n.weight;r=t.collection(r)[0],a=t.collection(a)[0];var l,u,c=r.id(),d=a.id(),h={},g={},p={},v=new Yn(function(X,O){return g[X.id()]-g[O.id()]}),b=new ln,f={},y={},m=function(X,O){v.push(X),b.add(O)},k=function(){l=v.pop(),u=l.id(),b.delete(u)},x=function(X){return b.has(X)};m(r,c),h[c]=0,g[c]=o(r);for(var S=0;v.size()>0;){if(k(),S++,u===d){for(var w=[],D=a,E=d,P=y[E];w.unshift(D),P!=null&&w.unshift(P),(D=f[E])!=null;)P=y[E=D.id()];return{found:!0,distance:h[u],path:this.spawn(w),steps:S}}p[u]=!0;for(var T=l._private.edges,B=0;B<T.length;B++){var M=T[B];if(this.hasElementWithId(M.id())&&(!i||M.data("source")===u)){var z=M.source(),R=M.target(),F=z.id()!==u?z:R,N=F.id();if(this.hasElementWithId(N)&&!p[N]){var I=h[u]+s(M);x(N)?I<h[N]&&(h[N]=I,g[N]=I+o(F),f[N]=l,y[N]=M):(h[N]=I,g[N]=I+o(F),m(F,N),f[N]=l,y[N]=M)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},$l=Re({weight:function(e){return 1},directed:!1}),Ql={floydWarshall:function(e){for(var t=this.cy(),n=$l(e),r=n.weight,a=n.directed,o=r,i=this.byGroup(),s=i.nodes,l=i.edges,u=s.length,c=u*u,d=function(O){return s.indexOf(O)},h=function(O){return s[O]},g=new Array(c),p=0;p<c;p++){var v=p%u,b=(p-v)/u;g[p]=b===v?0:1/0}for(var f=new Array(c),y=new Array(c),m=0;m<l.length;m++){var k=l[m],x=k.source()[0],S=k.target()[0];if(x!==S){var w=d(x),D=d(S),E=w*u+D,P=o(k);if(g[E]>P&&(g[E]=P,f[E]=D,y[E]=k),!a){var T=D*u+w;!a&&g[T]>P&&(g[T]=P,f[T]=w,y[T]=k)}}}for(var B=0;B<u;B++)for(var M=0;M<u;M++)for(var z=M*u+B,R=0;R<u;R++){var F=M*u+R,N=B*u+R;g[z]+g[N]<g[F]&&(g[F]=g[z]+g[N],f[F]=f[z])}var I=function(O){return d(function(Y){return(ce(Y)?t.filter(Y):Y)[0]}(O))},X={distance:function(O,Y){var j=I(O),G=I(Y);return g[j*u+G]},path:function(O,Y){var j=I(O),G=I(Y),W=h(j);if(j===G)return W.collection();if(f[j*u+G]==null)return t.collection();var q,K=t.collection(),U=j;for(K.merge(W);j!==G;)U=j,j=f[j*u+G],q=y[U*u+j],K.merge(q),K.merge(h(j));return K}};return X}},Jl=Re({weight:function(e){return 1},directed:!1,root:null}),eu={bellmanFord:function(e){var t=this,n=Jl(e),r=n.weight,a=n.directed,o=n.root,i=r,s=this,l=this.cy(),u=this.byGroup(),c=u.edges,d=u.nodes,h=d.length,g=new yt,p=!1,v=[];o=l.collection(o)[0],c.unmergeBy(function(ee){return ee.isLoop()});for(var b=c.length,f=function(ee){var C=g.get(ee.id());return C||(C={},g.set(ee.id(),C)),C},y=function(ee){return(ce(ee)?l.$(ee):ee)[0]},m=0;m<h;m++){var k=d[m],x=f(k);k.same(o)?x.dist=0:x.dist=1/0,x.pred=null,x.edge=null}for(var S=!1,w=function(ee,C,_,A,V,L){var Z=A.dist+L;Z<V.dist&&!_.same(A.edge)&&(V.dist=Z,V.pred=ee,V.edge=_,S=!0)},D=1;D<h;D++){S=!1;for(var E=0;E<b;E++){var P=c[E],T=P.source(),B=P.target(),M=i(P),z=f(T),R=f(B);w(T,0,P,z,R,M),a||w(B,0,P,R,z,M)}if(!S)break}if(S)for(var F=[],N=0;N<b;N++){var I=c[N],X=I.source(),O=I.target(),Y=i(I),j=f(X).dist,G=f(O).dist;if(j+Y<G||!a&&G+Y<j){if(p||(we("Graph contains a negative weight cycle for Bellman-Ford"),p=!0),e.findNegativeWeightCycles===!1)break;var W=[];j+Y<G&&W.push(X),!a&&G+Y<j&&W.push(O);for(var q=W.length,K=0;K<q;K++){var U=W[K],re=[U];re.push(f(U).edge);for(var ae=f(U).pred;re.indexOf(ae)===-1;)re.push(ae),re.push(f(ae).edge),ae=f(ae).pred;for(var de=(re=re.slice(re.indexOf(ae)))[0].id(),ue=0,Q=2;Q<re.length;Q+=2)re[Q].id()<de&&(de=re[Q].id(),ue=Q);(re=re.slice(ue).concat(re.slice(0,ue))).push(re[0]);var le=re.map(function(ee){return ee.id()}).join(",");F.indexOf(le)===-1&&(v.push(s.spawn(re)),F.push(le))}}}return{distanceTo:function(ee){return f(y(ee)).dist},pathTo:function(ee){for(var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,_=[],A=y(ee);;){if(A==null)return t.spawn();var V=f(A),L=V.edge,Z=V.pred;if(_.unshift(A[0]),A.same(C)&&_.length>0)break;L!=null&&_.unshift(L),A=Z}return s.spawn(_)},hasNegativeWeightCycle:p,negativeWeightCycles:v}}},tu=Math.sqrt(2),nu=function(e,t,n){n.length===0&&Be("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],a=r[1],o=r[2],i=t[a],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===i&&t[h]===s||t[d]===s&&t[h]===i)&&l.splice(u,1)}for(var g=0;g<l.length;g++){var p=l[g];p[1]===s?(l[g]=p.slice(),l[g][1]=i):p[2]===s&&(l[g]=p.slice(),l[g][2]=i)}for(var v=0;v<t.length;v++)t[v]===s&&(t[v]=i);return l},ha=function(e,t,n,r){for(;n>r;){var a=Math.floor(Math.random()*t.length);t=nu(a,e,t),n--}return t},ru={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(F){return F.isLoop()});var a=n.length,o=r.length,i=Math.ceil(Math.pow(Math.log(a)/Math.LN2,2)),s=Math.floor(a/tu);if(!(a<2)){for(var l=[],u=0;u<o;u++){var c=r[u];l.push([u,n.indexOf(c.source()),n.indexOf(c.target())])}for(var d=1/0,h=[],g=new Array(a),p=new Array(a),v=new Array(a),b=function(F,N){for(var I=0;I<a;I++)N[I]=F[I]},f=0;f<=i;f++){for(var y=0;y<a;y++)p[y]=y;var m=ha(p,l.slice(),a,s),k=m.slice();b(p,v);var x=ha(p,m,s,2),S=ha(v,k,s,2);x.length<=S.length&&x.length<d?(d=x.length,h=x,b(p,g)):S.length<=x.length&&S.length<d&&(d=S.length,h=S,b(v,g))}for(var w=this.spawn(h.map(function(F){return r[F[0]]})),D=this.spawn(),E=this.spawn(),P=g[0],T=0;T<g.length;T++){var B=g[T],M=n[T];B===P?D.merge(M):E.merge(M)}var z=function(F){var N=e.spawn();return F.forEach(function(I){N.merge(I),I.connectedEdges().forEach(function(X){e.contains(X)&&!w.contains(X)&&N.merge(X)})}),N},R=[z(D),z(E)];return{cut:w,components:R,partition1:D,partition2:E}}Be("At least 2 nodes are required for Karger-Stein algorithm")}},yr=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Fi=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},un=function(e){return{x:e[0],y:e[1]}},mr=function(e,t){return Math.atan2(t,e)-Math.PI/2},pa=Math.log2||function(e){return Math.log(e)/Math.log(2)},Xi=function(e){return e>0?1:e<0?-1:0},jt=function(e,t){return Math.sqrt(Wt(e,t))},Wt=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},au=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var a=0;a<t;a++)e[a]=e[a]/n;return e},Ie=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},cn=function(e,t,n,r){return{x:Ie(e.x,t.x,n.x,r),y:Ie(e.y,t.y,n.y,r)}},jn=function(e,t,n){return Math.max(e,Math.min(n,t))},Je=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&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(e.w!=null&&e.h!=null&&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}}},qi=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},iu=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},br=function(e){var t=arguments.length>1&&arguments[1]!==void 0?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},xr=function(e){var t,n,r,a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0];if(o.length===1)t=n=r=a=o[0];else if(o.length===2)t=r=o[0],a=n=o[1];else if(o.length===4){var i=ut(o,4);t=i[0],n=i[1],r=i[2],a=i[3]}return e.x1-=a,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Yi=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},fa=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)},dn=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},ou=function(e,t){return dn(e,t.x,t.y)},ji=function(e,t){return dn(e,t.x1,t.y1)&&dn(e,t.x2,t.y2)},Wi=function(e,t,n,r,a,o,i){var s,l,u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",c=u==="auto"?Kt(a,o):u,d=a/2,h=o/2,g=(c=Math.min(c,d,h))!==d,p=c!==h;if(g){var v=r-h-i;if((s=Nt(e,t,n,r,n-d+c-i,v,n+d-c+i,v,!1)).length>0)return s}if(p){var b=n+d+i;if((s=Nt(e,t,n,r,b,r-h+c-i,b,r+h-c+i,!1)).length>0)return s}if(g){var f=r+h+i;if((s=Nt(e,t,n,r,n-d+c-i,f,n+d-c+i,f,!1)).length>0)return s}if(p){var y=n-d-i;if((s=Nt(e,t,n,r,y,r-h+c-i,y,r+h-c+i,!1)).length>0)return s}var m=n-d+c,k=r-h+c;if((l=Wn(e,t,n,r,m,k,c+i)).length>0&&l[0]<=m&&l[1]<=k)return[l[0],l[1]];var x=n+d-c,S=r-h+c;if((l=Wn(e,t,n,r,x,S,c+i)).length>0&&l[0]>=x&&l[1]<=S)return[l[0],l[1]];var w=n+d-c,D=r+h-c;if((l=Wn(e,t,n,r,w,D,c+i)).length>0&&l[0]>=w&&l[1]>=D)return[l[0],l[1]];var E=n-d+c,P=r+h-c;return(l=Wn(e,t,n,r,E,P,c+i)).length>0&&l[0]<=E&&l[1]>=P?[l[0],l[1]]:[]},su=function(e,t,n,r,a,o,i){var s=i,l=Math.min(n,a),u=Math.max(n,a),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},lu=function(e,t,n,r,a,o,i,s,l){var u=Math.min(n,i,a)-l,c=Math.max(n,i,a)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(e<u||e>c||t<d||t>h)},uu=function(e,t,n,r,a,o,i,s){var l=[];(function(b,f,y,m,k){var x,S,w,D,E,P,T,B;b===0&&(b=1e-5),w=-27*(m/=b)+(f/=b)*(9*(y/=b)-f*f*2),x=(S=(3*y-f*f)/9)*S*S+(w/=54)*w,k[1]=0,T=f/3,x>0?(E=(E=w+Math.sqrt(x))<0?-Math.pow(-E,1/3):Math.pow(E,1/3),P=(P=w-Math.sqrt(x))<0?-Math.pow(-P,1/3):Math.pow(P,1/3),k[0]=-T+E+P,T+=(E+P)/2,k[4]=k[2]=-T,T=Math.sqrt(3)*(-P+E)/2,k[3]=T,k[5]=-T):(k[5]=k[3]=0,x===0?(B=w<0?-Math.pow(-w,1/3):Math.pow(w,1/3),k[0]=2*B-T,k[4]=k[2]=-(B+T)):(D=(S=-S)*S*S,D=Math.acos(w/Math.sqrt(D)),B=2*Math.sqrt(S),k[0]=-T+B*Math.cos(D/3),k[2]=-T+B*Math.cos((D+2*Math.PI)/3),k[4]=-T+B*Math.cos((D+4*Math.PI)/3)))})(1*n*n-4*n*a+2*n*i+4*a*a-4*a*i+i*i+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s,9*n*a-3*n*n-3*n*i-6*a*a+3*a*i+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,3*n*n-6*n*a+n*i-n*e+2*a*a+2*a*e-i*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,1*n*a-n*n+n*e-a*e+r*o-r*r+r*t-o*t,l);for(var u=[],c=0;c<6;c+=2)Math.abs(l[c+1])<1e-7&&l[c]>=0&&l[c]<=1&&u.push(l[c]);u.push(1),u.push(0);for(var d,h,g,p=-1,v=0;v<u.length;v++)d=Math.pow(1-u[v],2)*n+2*(1-u[v])*u[v]*a+u[v]*u[v]*i,h=Math.pow(1-u[v],2)*r+2*(1-u[v])*u[v]*o+u[v]*u[v]*s,g=Math.pow(d-e,2)+Math.pow(h-t,2),p>=0?g<p&&(p=g):p=g;return p},cu=function(e,t,n,r,a,o){var i=[e-n,t-r],s=[a-n,o-r],l=s[0]*s[0]+s[1]*s[1],u=i[0]*i[0]+i[1]*i[1],c=i[0]*s[0]+i[1]*s[1],d=c*c/l;return c<0?u:d>l?(e-a)*(e-a)+(t-o)*(t-o):u-d},et=function(e,t,n){for(var r,a,o,i,s=0,l=0;l<n.length/2;l++)if(r=n[2*l],a=n[2*l+1],l+1<n.length/2?(o=n[2*(l+1)],i=n[2*(l+1)+1]):(o=n[2*(l+1-n.length/2)],i=n[2*(l+1-n.length/2)+1]),!(r==e&&o==e)){if(!(r>=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(i-a)+a>t&&s++}return s%2!=0},Et=function(e,t,n,r,a,o,i,s,l){var u,c=new Array(n.length);s[0]!=null?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),g=Math.sin(-u),p=0;p<c.length/2;p++)c[2*p]=o/2*(n[2*p]*h-n[2*p+1]*g),c[2*p+1]=i/2*(n[2*p+1]*h+n[2*p]*g),c[2*p]+=r,c[2*p+1]+=a;if(l>0){var v=Er(c,-l);d=wr(v)}else d=c;return et(e,t,d)},wr=function(e){for(var t,n,r,a,o,i,s,l,u=new Array(e.length/2),c=0;c<e.length/4;c++){t=e[4*c],n=e[4*c+1],r=e[4*c+2],a=e[4*c+3],c<e.length/4-1?(o=e[4*(c+1)],i=e[4*(c+1)+1],s=e[4*(c+1)+2],l=e[4*(c+1)+3]):(o=e[0],i=e[1],s=e[2],l=e[3]);var d=Nt(t,n,r,a,o,i,s,l,!0);u[2*c]=d[0],u[2*c+1]=d[1]}return u},Er=function(e,t){for(var n,r,a,o,i=new Array(2*e.length),s=0;s<e.length/2;s++){n=e[2*s],r=e[2*s+1],s<e.length/2-1?(a=e[2*(s+1)],o=e[2*(s+1)+1]):(a=e[0],o=e[1]);var l=o-r,u=-(a-n),c=Math.sqrt(l*l+u*u),d=l/c,h=u/c;i[4*s]=n+d*t,i[4*s+1]=r+h*t,i[4*s+2]=a+d*t,i[4*s+3]=o+h*t}return i},Ht=function(e,t,n,r,a,o,i){return e-=a,t-=o,(e/=n/2+i)*e+(t/=r/2+i)*t<=1},Wn=function(e,t,n,r,a,o,i){var s=[n-e,r-t],l=[e-a,t-o],u=s[0]*s[0]+s[1]*s[1],c=2*(l[0]*s[0]+l[1]*s[1]),d=c*c-4*u*(l[0]*l[0]+l[1]*l[1]-i*i);if(d<0)return[];var h=(-c+Math.sqrt(d))/(2*u),g=(-c-Math.sqrt(d))/(2*u),p=Math.min(h,g),v=Math.max(h,g),b=[];if(p>=0&&p<=1&&b.push(p),v>=0&&v<=1&&b.push(v),b.length===0)return[];var f=b[0]*s[0]+e,y=b[0]*s[1]+t;return b.length>1?b[0]==b[1]?[f,y]:[f,y,b[1]*s[0]+e,b[1]*s[1]+t]:[f,y]},ga=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Nt=function(e,t,n,r,a,o,i,s,l){var u=e-a,c=n-e,d=i-a,h=t-o,g=r-t,p=s-o,v=d*h-p*u,b=c*h-g*u,f=p*c-d*g;if(f!==0){var y=v/f,m=b/f,k=-.001;return k<=y&&y<=1.001&&k<=m&&m<=1.001||l?[e+y*c,t+y*g]:[]}return v===0||b===0?ga(e,n,i)===i?[i,s]:ga(e,n,a)===a?[a,o]:ga(a,i,n)===n?[n,r]:[]:[]},Hn=function(e,t,n,r,a,o,i,s){var l,u,c,d,h,g,p=[],v=new Array(n.length),b=!0;if(o==null&&(b=!1),b){for(var f=0;f<v.length/2;f++)v[2*f]=n[2*f]*o+r,v[2*f+1]=n[2*f+1]*i+a;if(s>0){var y=Er(v,-s);u=wr(y)}else u=v}else u=n;for(var m=0;m<u.length/2;m++)c=u[2*m],d=u[2*m+1],m<u.length/2-1?(h=u[2*(m+1)],g=u[2*(m+1)+1]):(h=u[0],g=u[1]),(l=Nt(e,t,r,a,c,d,h,g)).length!==0&&p.push(l[0],l[1]);return p},kr=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],a=Math.sqrt(r[0]*r[0]+r[1]*r[1]),o=(a-n)/a;return o<0&&(o=1e-5),[t[0]+o*r[0],t[1]+o*r[1]]},Ge=function(e,t){var n=va(e,t);return n=Hi(n)},Hi=function(e){for(var t,n,r=e.length/2,a=1/0,o=1/0,i=-1/0,s=-1/0,l=0;l<r;l++)t=e[2*l],n=e[2*l+1],a=Math.min(a,t),i=Math.max(i,t),o=Math.min(o,n),s=Math.max(s,n);for(var u=2/(i-a),c=2/(s-o),d=0;d<r;d++)t=e[2*d]=e[2*d]*u,n=e[2*d+1]=e[2*d+1]*c,a=Math.min(a,t),i=Math.max(i,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},va=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 a,o=new Array(2*e),i=0;i<e;i++)a=i*n+r,o[2*i]=Math.cos(a),o[2*i+1]=Math.sin(-a);return o},Kt=function(e,t){return Math.min(e/4,t/4,8)},Ki=function(e,t){return Math.min(e/10,t/10,8)},ya=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},du=Re({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),hu={pageRank:function(e){for(var t=du(e),n=t.dampingFactor,r=t.precision,a=t.iterations,o=t.weight,i=this._private.cy,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=u.length,g=new Array(d),p=new Array(c),v=(1-n)/c,b=0;b<c;b++){for(var f=0;f<c;f++)g[b*c+f]=0;p[b]=0}for(var y=0;y<h;y++){var m=u[y],k=m.data("source"),x=m.data("target");if(k!==x){var S=l.indexOfId(k),w=l.indexOfId(x),D=o(m);g[w*c+S]+=D,p[S]+=D}}for(var E=1/c+v,P=0;P<c;P++)if(p[P]===0)for(var T=0;T<c;T++)g[T*c+P]=E;else for(var B=0;B<c;B++){var M=B*c+P;g[M]=g[M]/p[P]+v}for(var z,R=new Array(c),F=new Array(c),N=0;N<c;N++)R[N]=1;for(var I=0;I<a;I++){for(var X=0;X<c;X++)F[X]=0;for(var O=0;O<c;O++)for(var Y=0;Y<c;Y++){var j=O*c+Y;F[O]+=g[j]*R[Y]}au(F),z=R,R=F,F=z;for(var G=0,W=0;W<c;W++){var q=z[W]-R[W];G+=q*q}if(G<r)break}return{rank:function(K){return K=i.collection(K)[0],R[l.indexOf(K)]}}}},Gi=Re({root:null,weight:function(e){return 1},directed:!1,alpha:0}),hn={degreeCentralityNormalized:function(e){e=Gi(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var a={},o={},i=0,s=0,l=0;l<r;l++){var u=n[l],c=u.id();e.root=u;var d=this.degreeCentrality(e);i<d.indegree&&(i=d.indegree),s<d.outdegree&&(s=d.outdegree),a[c]=d.indegree,o[c]=d.outdegree}return{indegree:function(f){return i==0?0:(ce(f)&&(f=t.filter(f)),a[f.id()]/i)},outdegree:function(f){return s===0?0:(ce(f)&&(f=t.filter(f)),o[f.id()]/s)}}}for(var h={},g=0,p=0;p<r;p++){var v=n[p];e.root=v;var b=this.degreeCentrality(e);g<b.degree&&(g=b.degree),h[v.id()]=b.degree}return{degree:function(f){return g===0?0:(ce(f)&&(f=t.filter(f)),h[f.id()]/g)}}},degreeCentrality:function(e){e=Gi(e);var t=this.cy(),n=this,r=e,a=r.root,o=r.weight,i=r.directed,s=r.alpha;if(a=t.collection(a)[0],i){for(var l=a.connectedEdges(),u=l.filter(function(x){return x.target().same(a)&&n.has(x)}),c=l.filter(function(x){return x.source().same(a)&&n.has(x)}),d=u.length,h=c.length,g=0,p=0,v=0;v<u.length;v++)g+=o(u[v]);for(var b=0;b<c.length;b++)p+=o(c[b]);return{indegree:Math.pow(d,1-s)*Math.pow(g,s),outdegree:Math.pow(h,1-s)*Math.pow(p,s)}}for(var f=a.connectedEdges().intersection(n),y=f.length,m=0,k=0;k<f.length;k++)m+=o(f[k]);return{degree:Math.pow(y,1-s)*Math.pow(m,s)}}};hn.dc=hn.degreeCentrality,hn.dcn=hn.degreeCentralityNormalised=hn.degreeCentralityNormalized;var Ui=Re({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),pn={closenessCentralityNormalized:function(e){for(var t=Ui(e),n=t.harmonic,r=t.weight,a=t.directed,o=this.cy(),i={},s=0,l=this.nodes(),u=this.floydWarshall({weight:r,directed:a}),c=0;c<l.length;c++){for(var d=0,h=l[c],g=0;g<l.length;g++)if(c!==g){var p=u.distance(h,l[g]);d+=n?1/p:p}n||(d=1/d),s<d&&(s=d),i[h.id()]=d}return{closeness:function(v){return s==0?0:(v=ce(v)?o.filter(v)[0].id():v.id(),i[v]/s)}}},closenessCentrality:function(e){var t=Ui(e),n=t.root,r=t.weight,a=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var i=this.dijkstra({root:n,weight:r,directed:a}),s=0,l=this.nodes(),u=0;u<l.length;u++){var c=l[u];if(!c.same(n)){var d=i.distanceTo(c);s+=o?1/d:d}}return o?s:1/s}};pn.cc=pn.closenessCentrality,pn.ccn=pn.closenessCentralityNormalised=pn.closenessCentralityNormalized;var pu=Re({weight:null,directed:!1}),ma={betweennessCentrality:function(e){for(var t=pu(e),n=t.directed,r=t.weight,a=r!=null,o=this.cy(),i=this.nodes(),s={},l={},u=0,c=function(y,m){l[y]=m,m>u&&(u=m)},d=function(y){return l[y]},h=0;h<i.length;h++){var g=i[h],p=g.id();s[p]=n?g.outgoers().nodes():g.openNeighborhood().nodes(),c(p,0)}for(var v=function(y){for(var m=i[y].id(),k=[],x={},S={},w={},D=new Yn(function(W,q){return w[W]-w[q]}),E=0;E<i.length;E++){var P=i[E].id();x[P]=[],S[P]=0,w[P]=1/0}for(S[m]=1,w[m]=0,D.push(m);!D.empty();){var T=D.pop();if(k.push(T),a)for(var B=0;B<s[T].length;B++){var M=s[T][B],z=o.getElementById(T),R=void 0;R=z.edgesTo(M).length>0?z.edgesTo(M)[0]:M.edgesTo(z)[0];var F=r(R);M=M.id(),w[M]>w[T]+F&&(w[M]=w[T]+F,D.nodes.indexOf(M)<0?D.push(M):D.updateItem(M),S[M]=0,x[M]=[]),w[M]==w[T]+F&&(S[M]=S[M]+S[T],x[M].push(T))}else for(var N=0;N<s[T].length;N++){var I=s[T][N].id();w[I]==1/0&&(D.push(I),w[I]=w[T]+1),w[I]==w[T]+1&&(S[I]=S[I]+S[T],x[I].push(T))}}for(var X={},O=0;O<i.length;O++)X[i[O].id()]=0;for(;k.length>0;){for(var Y=k.pop(),j=0;j<x[Y].length;j++){var G=x[Y][j];X[G]=X[G]+S[G]/S[Y]*(1+X[Y])}Y!=i[y].id()&&c(Y,d(Y)+X[Y])}},b=0;b<i.length;b++)v(b);var f={betweenness:function(y){var m=o.collection(y).id();return d(m)},betweennessNormalized:function(y){if(u==0)return 0;var m=o.collection(y).id();return d(m)/u}};return f.betweennessNormalised=f.betweennessNormalized,f}};ma.bc=ma.betweennessCentrality;var fu=Re({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),gu=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},Zi=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var a=0;a<t;a++)n+=e[a*t+r];for(var o=0;o<t;o++)e[o*t+r]=e[o*t+r]/n}},vu=function(e,t,n){for(var r=new Array(n*n),a=0;a<n;a++){for(var o=0;o<n;o++)r[a*n+o]=0;for(var i=0;i<n;i++)for(var s=0;s<n;s++)r[a*n+s]+=e[a*n+i]*t[i*n+s]}return r},yu=function(e,t,n){for(var r=e.slice(0),a=1;a<n;a++)e=vu(e,r,t);return e},mu=function(e,t,n){for(var r=new Array(t*t),a=0;a<t*t;a++)r[a]=Math.pow(e[a],n);return Zi(r,t),r},bu=function(e,t,n,r){for(var a=0;a<n;a++)if(Math.round(e[a]*Math.pow(10,r))/Math.pow(10,r)!==Math.round(t[a]*Math.pow(10,r))/Math.pow(10,r))return!1;return!0},xu=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},$i=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),a=function(k){return fu(k)}(e),o={},i=0;i<t.length;i++)o[t[i].id()]=i;for(var s,l=t.length,u=l*l,c=new Array(u),d=0;d<u;d++)c[d]=0;for(var h=0;h<n.length;h++){var g=n[h],p=o[g.source().id()],v=o[g.target().id()],b=gu(g,a.attributes);c[p*l+v]+=b,c[v*l+p]+=b}(function(k,x,S){for(var w=0;w<x;w++)k[w*x+w]=S})(c,l,a.multFactor),Zi(c,l);for(var f=!0,y=0;f&&y<a.maxIterations;)f=!1,s=yu(c,l,a.expandFactor),c=mu(s,l,a.inflateFactor),bu(c,s,u,4)||(f=!0),y++;var m=function(k,x,S,w){for(var D=[],E=0;E<x;E++){for(var P=[],T=0;T<x;T++)Math.round(1e3*k[E*x+T])/1e3>0&&P.push(S[T]);P.length!==0&&D.push(w.collection(P))}return D}(c,l,t,r);return m=function(k){for(var x=0;x<k.length;x++)for(var S=0;S<k.length;S++)x!=S&&xu(k[x],k[S])&&k.splice(S,1);return k}(m),m},wu={markovClustering:$i,mcl:$i},Eu=function(e){return e},Qi=function(e,t){return Math.abs(t-e)},Ji=function(e,t,n){return e+Qi(t,n)},eo=function(e,t,n){return e+Math.pow(n-t,2)},ku=function(e){return Math.sqrt(e)},Cu=function(e,t,n){return Math.max(e,Qi(t,n))},Kn=function(e,t,n,r,a){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Eu,i=r,s=0;s<e;s++)i=a(i,t(s),n(s));return o(i)},fn={euclidean:function(e,t,n){return e>=2?Kn(e,t,n,0,eo,ku):Kn(e,t,n,0,Ji)},squaredEuclidean:function(e,t,n){return Kn(e,t,n,0,eo)},manhattan:function(e,t,n){return Kn(e,t,n,0,Ji)},max:function(e,t,n){return Kn(e,t,n,-1/0,Cu)}};function Cr(e,t,n,r,a,o){var i;return i=Me(e)?e:fn[e]||fn.euclidean,t===0&&Me(e)?i(a,o):i(t,n,r,a,o)}fn["squared-euclidean"]=fn.squaredEuclidean,fn.squaredeuclidean=fn.squaredEuclidean;var Su=Re({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),ba=function(e){return Su(e)},Sr=function(e,t,n,r,a){var o=a!=="kMedoids"?function(l){return n[l]}:function(l){return r[l](n)},i=n,s=t;return Cr(e,r.length,o,function(l){return r[l](t)},i,s)},xa=function(e,t,n){for(var r=n.length,a=new Array(r),o=new Array(r),i=new Array(t),s=null,l=0;l<r;l++)a[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var u=0;u<t;u++){s=[];for(var c=0;c<r;c++)s[c]=Math.random()*(o[c]-a[c])+a[c];i[u]=s}return i},to=function(e,t,n,r,a){for(var o=1/0,i=0,s=0;s<t.length;s++){var l=Sr(n,e,t[s],r,a);l<o&&(o=l,i=s)}return i},no=function(e,t,n){for(var r=[],a=null,o=0;o<t.length;o++)n[(a=t[o]).id()]===e&&r.push(a);return r},Pu=function(e,t,n){return Math.abs(t-e)<=n},Du=function(e,t,n){for(var r=0;r<e.length;r++)for(var a=0;a<e[r].length;a++)if(Math.abs(e[r][a]-t[r][a])>n)return!1;return!0},Tu=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},ro=function(e,t){var n=new Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var a=e[Math.floor(Math.random()*e.length)];Tu(a,n,r);)a=e[Math.floor(Math.random()*e.length)];n[r]=a}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},ao=function(e,t,n){for(var r=0,a=0;a<t.length;a++)r+=Sr("manhattan",t[a],e,n,"kMedoids");return r},Mu=function(e,t,n,r,a){for(var o,i,s=0;s<t.length;s++)for(var l=0;l<e.length;l++)r[s][l]=Math.pow(n[s][l],a.m);for(var u=0;u<e.length;u++)for(var c=0;c<a.attributes.length;c++){o=0,i=0;for(var d=0;d<t.length;d++)o+=r[d][u]*a.attributes[c](t[d]),i+=r[d][u];e[u][c]=o/i}},Bu=function(e,t,n,r,a){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var i,s,l,u=2/(a.m-1),c=0;c<n.length;c++)for(var d=0;d<r.length;d++){i=0;for(var h=0;h<n.length;h++)s=Sr(a.distance,r[d],n[c],a.attributes,"cmeans"),l=Sr(a.distance,r[d],n[h],a.attributes,"cmeans"),i+=Math.pow(s/l,u);e[d][c]=1/i}},io=function(e){var t,n,r,a,o,i=this.cy(),s=this.nodes(),l=ba(e);a=new Array(s.length);for(var u=0;u<s.length;u++)a[u]=new Array(l.k);r=new Array(s.length);for(var c=0;c<s.length;c++)r[c]=new Array(l.k);for(var d=0;d<s.length;d++){for(var h=0,g=0;g<l.k;g++)r[d][g]=Math.random(),h+=r[d][g];for(var p=0;p<l.k;p++)r[d][p]=r[d][p]/h}n=new Array(l.k);for(var v=0;v<l.k;v++)n[v]=new Array(l.attributes.length);o=new Array(s.length);for(var b=0;b<s.length;b++)o[b]=new Array(l.k);for(var f=!0,y=0;f&&y<l.maxIterations;)f=!1,Mu(n,s,r,o,l),Bu(r,a,n,s,l),Du(r,a,l.sensitivityThreshold)||(f=!0),y++;return t=function(m,k,x,S){for(var w,D,E=new Array(x.k),P=0;P<E.length;P++)E[P]=[];for(var T=0;T<k.length;T++){w=-1/0,D=-1;for(var B=0;B<k[0].length;B++)k[T][B]>w&&(w=k[T][B],D=B);E[D].push(m[T])}for(var M=0;M<E.length;M++)E[M]=S.collection(E[M]);return E}(s,r,l,i),{clusters:t,degreeOfMembership:r}},_u={kMeans:function(e){var t,n=this.cy(),r=this.nodes(),a=null,o=ba(e),i=new Array(o.k),s={};o.testMode?typeof o.testCentroids=="number"?(o.testCentroids,t=xa(r,o.k,o.attributes)):t=Ne(o.testCentroids)==="object"?o.testCentroids:xa(r,o.k,o.attributes):t=xa(r,o.k,o.attributes);for(var l=!0,u=0;l&&u<o.maxIterations;){for(var c=0;c<r.length;c++)s[(a=r[c]).id()]=to(a,t,o.distance,o.attributes,"kMeans");l=!1;for(var d=0;d<o.k;d++){var h=no(d,r,s);if(h.length!==0){for(var g=o.attributes.length,p=t[d],v=new Array(g),b=new Array(g),f=0;f<g;f++){b[f]=0;for(var y=0;y<h.length;y++)a=h[y],b[f]+=o.attributes[f](a);v[f]=b[f]/h.length,Pu(v[f],p[f],o.sensitivityThreshold)||(l=!0)}t[d]=v,i[d]=n.collection(h)}}u++}return i},kMedoids:function(e){var t,n,r=this.cy(),a=this.nodes(),o=null,i=ba(e),s=new Array(i.k),l={},u=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(t=Ne(i.testCentroids)==="object"?i.testCentroids:ro(a,i.k)):t=ro(a,i.k);for(var c=!0,d=0;c&&d<i.maxIterations;){for(var h=0;h<a.length;h++)l[(o=a[h]).id()]=to(o,t,i.distance,i.attributes,"kMedoids");c=!1;for(var g=0;g<t.length;g++){var p=no(g,a,l);if(p.length!==0){u[g]=ao(t[g],p,i.attributes);for(var v=0;v<p.length;v++)(n=ao(p[v],p,i.attributes))<u[g]&&(u[g]=n,t[g]=p[v],c=!0);s[g]=r.collection(p)}}d++}return s},fuzzyCMeans:io,fcm:io},Nu=Re({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Au={single:"min",complete:"max"},oo=function(e,t,n,r,a){for(var o,i=0,s=1/0,l=a.attributes,u=function(w,D){return Cr(a.distance,l.length,function(E){return l[E](w)},function(E){return l[E](D)},w,D)},c=0;c<e.length;c++){var d=e[c].key,h=n[d][r[d]];h<s&&(i=d,s=h)}if(a.mode==="threshold"&&s>=a.threshold||a.mode==="dendrogram"&&e.length===1)return!1;var g,p=t[i],v=t[r[i]];g=a.mode==="dendrogram"?{left:p,right:v,key:p.key}:{value:p.value.concat(v.value),key:p.key},e[p.index]=g,e.splice(v.index,1),t[p.key]=g;for(var b=0;b<e.length;b++){var f=e[b];p.key===f.key?o=1/0:a.linkage==="min"?(o=n[p.key][f.key],n[p.key][f.key]>n[v.key][f.key]&&(o=n[v.key][f.key])):a.linkage==="max"?(o=n[p.key][f.key],n[p.key][f.key]<n[v.key][f.key]&&(o=n[v.key][f.key])):o=a.linkage==="mean"?(n[p.key][f.key]*p.size+n[v.key][f.key]*v.size)/(p.size+v.size):a.mode==="dendrogram"?u(f.value,p.value):u(f.value[0],p.value[0]),n[p.key][f.key]=n[f.key][p.key]=o}for(var y=0;y<e.length;y++){var m=e[y].key;if(r[m]===p.key||r[m]===v.key){for(var k=m,x=0;x<e.length;x++){var S=e[x].key;n[m][S]<n[m][k]&&(k=S)}r[m]=k}e[y].index=y}return p.key=v.key=p.index=v.index=null,!0},Pr=function e(t,n,r){t&&(t.value?n.push(t.value):(t.left&&e(t.left,n),t.right&&e(t.right,n)))},Lu=function e(t,n){if(!t)return"";if(t.left&&t.right){var r=e(t.left,n),a=e(t.right,n),o=n.add({group:"nodes",data:{id:r+","+a}});return n.add({group:"edges",data:{source:r,target:o.id()}}),n.add({group:"edges",data:{source:a,target:o.id()}}),o.id()}return t.value?t.value.id():void 0},zu=function e(t,n,r){if(!t)return[];var a=[],o=[],i=[];return n===0?(t.left&&Pr(t.left,a),t.right&&Pr(t.right,o),i=a.concat(o),[r.collection(i)]):n===1?t.value?[r.collection(t.value)]:(t.left&&Pr(t.left,a),t.right&&Pr(t.right,o),[r.collection(a),r.collection(o)]):t.value?[r.collection(t.value)]:(t.left&&(a=e(t.left,n-1,r)),t.right&&(o=e(t.right,n-1,r)),a.concat(o))},so=function(e){for(var t=this.cy(),n=this.nodes(),r=function(f){var y=Nu(f),m=Au[y.linkage];return m!=null&&(y.linkage=m),y}(e),a=r.attributes,o=function(f,y){return Cr(r.distance,a.length,function(m){return a[m](f)},function(m){return a[m](y)},f,y)},i=[],s=[],l=[],u=[],c=0;c<n.length;c++){var d={value:r.mode==="dendrogram"?n[c]:[n[c]],key:c,index:c};i[c]=d,u[c]=d,s[c]=[],l[c]=0}for(var h=0;h<i.length;h++)for(var g=0;g<=h;g++){var p=void 0;p=r.mode==="dendrogram"?h===g?1/0:o(i[h].value,i[g].value):h===g?1/0:o(i[h].value[0],i[g].value[0]),s[h][g]=p,s[g][h]=p,p<s[h][l[h]]&&(l[h]=g)}for(var v,b=oo(i,u,s,l,r);b;)b=oo(i,u,s,l,r);return r.mode==="dendrogram"?(v=zu(i[0],r.dendrogramDepth,t),r.addDendrogram&&Lu(i[0],t)):(v=new Array(i.length),i.forEach(function(f,y){f.key=f.index=null,v[y]=t.collection(f.value)})),v},Iu={hierarchicalClustering:so,hca:so},Ru=Re({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Ou=function(e,t,n,r){var a=function(o,i){return r[i](o)};return-Cr(e,r.length,function(o){return a(t,o)},function(o){return a(n,o)},t,n)},Vu=function(e,t){var n=null;return n=t==="median"?function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.length,i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],s=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5];arguments.length>3&&arguments[3]!==void 0&&!arguments[3]?(o<r.length&&r.splice(o,r.length-o),a>0&&r.splice(0,a)):r=r.slice(a,o);for(var l=0,u=r.length-1;u>=0;u--){var c=r[u];s?isFinite(c)||(r[u]=-1/0,l++):r.splice(u,1)}i&&r.sort(function(g,p){return g-p});var d=r.length,h=Math.floor(d/2);return d%2!=0?r[h+1+l]:(r[h-1+l]+r[h+l])/2}(e):t==="mean"?function(r){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.length,i=0,s=0,l=a;l<o;l++){var u=r[l];isFinite(u)&&(i+=u,s++)}return i/s}(e):t==="min"?function(r){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.length,i=1/0,s=a;s<o;s++){var l=r[s];isFinite(l)&&(i=Math.min(l,i))}return i}(e):t==="max"?function(r){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.length,i=-1/0,s=a;s<o;s++){var l=r[s];isFinite(l)&&(i=Math.max(l,i))}return i}(e):t,n},lo=function(e,t,n){for(var r=[],a=0;a<e;a++){for(var o=-1,i=-1/0,s=0;s<n.length;s++){var l=n[s];t[a*e+l]>i&&(o=l,i=t[a*e+l])}o>0&&r.push(o)}for(var u=0;u<n.length;u++)r[n[u]]=n[u];return r},uo=function(e){for(var t,n,r,a,o,i,s=this.cy(),l=this.nodes(),u=function(ee){var C=ee.damping,_=ee.preference;.5<=C&&C<1||Be("Damping must range on [0.5, 1). Got: ".concat(C));var A=["median","mean","min","max"];return A.some(function(V){return V===_})||te(_)||Be("Preference must be one of [".concat(A.map(function(V){return"'".concat(V,"'")}).join(", "),"] or a number. Got: ").concat(_)),Ru(ee)}(e),c={},d=0;d<l.length;d++)c[l[d].id()]=d;n=(t=l.length)*t,r=new Array(n);for(var h=0;h<n;h++)r[h]=-1/0;for(var g=0;g<t;g++)for(var p=0;p<t;p++)g!==p&&(r[g*t+p]=Ou(u.distance,l[g],l[p],u.attributes));a=Vu(r,u.preference);for(var v=0;v<t;v++)r[v*t+v]=a;o=new Array(n);for(var b=0;b<n;b++)o[b]=0;i=new Array(n);for(var f=0;f<n;f++)i[f]=0;for(var y=new Array(t),m=new Array(t),k=new Array(t),x=0;x<t;x++)y[x]=0,m[x]=0,k[x]=0;for(var S,w=new Array(t*u.minIterations),D=0;D<w.length;D++)w[D]=0;for(S=0;S<u.maxIterations;S++){for(var E=0;E<t;E++){for(var P=-1/0,T=-1/0,B=-1,M=0,z=0;z<t;z++)y[z]=o[E*t+z],(M=i[E*t+z]+r[E*t+z])>=P?(T=P,P=M,B=z):M>T&&(T=M);for(var R=0;R<t;R++)o[E*t+R]=(1-u.damping)*(r[E*t+R]-P)+u.damping*y[R];o[E*t+B]=(1-u.damping)*(r[E*t+B]-T)+u.damping*y[B]}for(var F=0;F<t;F++){for(var N=0,I=0;I<t;I++)y[I]=i[I*t+F],m[I]=Math.max(0,o[I*t+F]),N+=m[I];N-=m[F],m[F]=o[F*t+F],N+=m[F];for(var X=0;X<t;X++)i[X*t+F]=(1-u.damping)*Math.min(0,N-m[X])+u.damping*y[X];i[F*t+F]=(1-u.damping)*(N-m[F])+u.damping*y[F]}for(var O=0,Y=0;Y<t;Y++){var j=i[Y*t+Y]+o[Y*t+Y]>0?1:0;w[S%u.minIterations*t+Y]=j,O+=j}if(O>0&&(S>=u.minIterations-1||S==u.maxIterations-1)){for(var G=0,W=0;W<t;W++){k[W]=0;for(var q=0;q<u.minIterations;q++)k[W]+=w[q*t+W];k[W]!==0&&k[W]!==u.minIterations||G++}if(G===t)break}}for(var K=function(ee,C,_){for(var A=[],V=0;V<ee;V++)C[V*ee+V]+_[V*ee+V]>0&&A.push(V);return A}(t,o,i),U=function(ee,C,_){for(var A=lo(ee,C,_),V=0;V<_.length;V++){for(var L=[],Z=0;Z<A.length;Z++)A[Z]===_[V]&&L.push(Z);for(var H=-1,ne=-1/0,$=0;$<L.length;$++){for(var J=0,oe=0;oe<L.length;oe++)J+=C[L[oe]*ee+L[$]];J>ne&&(H=$,ne=J)}_[V]=L[H]}return lo(ee,C,_)}(t,r,K),re={},ae=0;ae<K.length;ae++)re[K[ae]]=[];for(var de=0;de<l.length;de++){var ue=U[c[l[de].id()]];ue!=null&&re[ue].push(l[de])}for(var Q=new Array(K.length),le=0;le<K.length;le++)Q[le]=s.collection(re[K[le]]);return Q},Fu={affinityPropagation:uo,ap:uo},Xu=Re({root:void 0,directed:!1}),qu={hierholzer:function(e){if(!ve(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,a,o=Xu(e),i=o.root,s=o.directed,l=this,u=!1;i&&(a=ce(i)?this.filter(i)[0].id():i[0].id());var c={},d={};s?l.forEach(function(f){var y=f.id();if(f.isNode()){var m=f.indegree(!0),k=f.outdegree(!0),x=m-k,S=k-m;x==1?n?u=!0:n=y:S==1?r?u=!0:r=y:(S>1||x>1)&&(u=!0),c[y]=[],f.outgoers().forEach(function(w){w.isEdge()&&c[y].push(w.id())})}else d[y]=[void 0,f.target().id()]}):l.forEach(function(f){var y=f.id();f.isNode()?(f.degree(!0)%2&&(n?r?u=!0:r=y:n=y),c[y]=[],f.connectedEdges().forEach(function(m){return c[y].push(m.id())})):d[y]=[f.source().id(),f.target().id()]});var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(a&&r!=a)return h;a=r}else{if(a&&r!=a&&n!=a)return h;a||(a=r)}else a||(a=l[0].id());var g=function(f){for(var y,m,k,x=f,S=[f];c[x].length;)y=c[x].shift(),m=d[y][0],x!=(k=d[y][1])?(c[k]=c[k].filter(function(w){return w!=y}),x=k):s||x==m||(c[m]=c[m].filter(function(w){return w!=y}),x=m),S.unshift(y),S.unshift(x);return S},p=[],v=[];for(v=g(a);v.length!=1;)c[v[0]].length==0?(p.unshift(l.getElementById(v.shift())),p.unshift(l.getElementById(v.shift()))):v=g(v.shift()).concat(v);for(var b in p.unshift(l.getElementById(v.shift())),c)if(c[b].length)return h;return h.found=!0,h.trail=this.spawn(p,!0),h}},Dr=function(){var e=this,t={},n=0,r=0,a=[],o=[],i={},s=function u(c,d,h){c===h&&(r+=1),t[d]={id:n,low:n++,cutVertex:!1};var g,p,v,b,f=e.getElementById(d).connectedEdges().intersection(e);f.size()===0?a.push(e.spawn(e.getElementById(d))):f.forEach(function(y){g=y.source().id(),p=y.target().id(),(v=g===d?p:g)!==h&&(b=y.id(),i[b]||(i[b]=!0,o.push({x:d,y:v,edge:y})),v in t?t[d].low=Math.min(t[d].low,t[v].id):(u(c,v,d),t[d].low=Math.min(t[d].low,t[v].low),t[d].id<=t[v].low&&(t[d].cutVertex=!0,function(m,k){for(var x=o.length-1,S=[],w=e.spawn();o[x].x!=m||o[x].y!=k;)S.push(o.pop().edge),x--;S.push(o.pop().edge),S.forEach(function(D){var E=D.connectedNodes().intersection(e);w.merge(D),E.forEach(function(P){var T=P.id(),B=P.connectedEdges().intersection(e);w.merge(P),t[T].cutVertex?w.merge(B.filter(function(M){return M.isLoop()})):w.merge(B)})}),a.push(w)}(d,v))))})};e.forEach(function(u){if(u.isNode()){var c=u.id();c in t||(r=0,s(c,c),t[c].cutVertex=r>1)}});var l=Object.keys(t).filter(function(u){return t[u].cutVertex}).map(function(u){return e.getElementById(u)});return{cut:e.spawn(l),components:a}},Tr=function(){var e=this,t={},n=0,r=[],a=[],o=e.spawn(e),i=function s(l){if(a.push(l),t[l]={index:n,low:n++,explored:!1},e.getElementById(l).connectedEdges().intersection(e).forEach(function(g){var p=g.target().id();p!==l&&(p in t||s(p),t[p].explored||(t[l].low=Math.min(t[l].low,t[p].low)))}),t[l].index===t[l].low){for(var u=e.spawn();;){var c=a.pop();if(u.merge(e.getElementById(c)),t[c].low=t[l].index,t[c].explored=!0,c===l)break}var d=u.edgesWith(u),h=u.merge(d);r.push(h),o=o.difference(h)}};return e.forEach(function(s){if(s.isNode()){var l=s.id();l in t||i(l)}}),{cut:o,components:r}},co={};[qn,Kl,Gl,Zl,Ql,eu,ru,hu,hn,pn,ma,wu,_u,Iu,Fu,qu,{hopcroftTarjanBiconnected:Dr,htbc:Dr,htb:Dr,hopcroftTarjanBiconnectedComponents:Dr},{tarjanStronglyConnected:Tr,tsc:Tr,tscc:Tr,tarjanStronglyConnectedComponents:Tr}].forEach(function(e){he(co,e)});/*!
|
4
|
-
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
5
|
-
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
6
|
-
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
7
|
-
*/var kt=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)},typeof t=="function"&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};kt.prototype={fulfill:function(e){return ho(this,1,"fulfillValue",e)},reject:function(e){return ho(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new kt;return n.onFulfilled.push(go(e,r,"fulfill")),n.onRejected.push(go(t,r,"reject")),po(n),r.proxy}};var ho=function(e,t,n,r){return e.state===0&&(e.state=t,e[n]=r,po(e)),e},po=function(e){e.state===1?fo(e,"onFulfilled",e.fulfillValue):e.state===2&&fo(e,"onRejected",e.rejectReason)},fo=function(e,t,n){if(e[t].length!==0){var r=e[t];e[t]=[];var a=function(){for(var o=0;o<r.length;o++)r[o](n)};typeof setImmediate=="function"?setImmediate(a):setTimeout(a,0)}},go=function(e,t,n){return function(r){if(typeof e!="function")t[n].call(t,r);else{var a;try{a=e(r)}catch(o){return void t.reject(o)}Yu(t,a)}}},Yu=function e(t,n){if(t!==n&&t.proxy!==n){var r;if(Ne(n)==="object"&&n!==null||typeof n=="function")try{r=n.then}catch(o){return void t.reject(o)}if(typeof r!="function")t.fulfill(n);else{var a=!1;try{r.call(n,function(o){a||(a=!0,o===n?t.reject(new TypeError("circular thenable chain")):e(t,o))},function(o){a||(a=!0,t.reject(o))})}catch(o){a||t.reject(o)}}}else t.reject(new TypeError("cannot resolve promise with itself"))};kt.all=function(e){return new kt(function(t,n){for(var r=new Array(e.length),a=0,o=function(s,l){r[s]=l,++a===e.length&&t(r)},i=0;i<e.length;i++)(function(s){var l=e[s];l!=null&&l.then!=null?l.then(function(u){o(s,u)},function(u){n(u)}):o(s,l)})(i)})},kt.resolve=function(e){return new kt(function(t,n){t(e)})},kt.reject=function(e){return new kt(function(t,n){n(e)})};var gn=typeof Promise<"u"?Promise:kt,wa=function(e,t,n){var r=ia(e),a=!r,o=this._private=he({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&&Me(o.complete)&&o.completes.push(o.complete),a){var i=e.position();o.startPosition=o.startPosition||{x:i.x,y:i.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},Gt=wa.prototype;he(Gt,{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),tt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(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 e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(s,l){var u=e[s];u!=null&&(e[s]=e[l],e[l]=u)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var r=0;r<e.style.length;r++){var a=e.style[r],o=a.name,i=e.startStyle[o];e.startStyle[o]=a,e.style[r]=i}return t&&this.play(),this},promise:function(e){var t,n=this._private;return e==="frame"?t=n.frames:t=n.completes,new gn(function(r,a){t.push(function(){r()})})}}),Gt.complete=Gt.completed,Gt.run=Gt.play,Gt.running=Gt.playing;var ju={animated:function(){return function(){var e=this,t=e.length!==void 0?e:[e];if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];return n?n._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var e=this,t=e.length!==void 0?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++)t[n]._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=this,r=n.length!==void 0,a=r?n:[n],o=this._private.cy||this,i=!r,s=!i;if(!o.styleEnabled())return this;var l=o.style();if(e=he({},e,t),Object.keys(e).length===0)return new wa(a[0],e);switch(e.duration===void 0&&(e.duration=400),e.duration){case"slow":e.duration=600;break;case"fast":e.duration=200}if(s&&(e.style=l.getPropsList(e.style||e.css),e.css=void 0),s&&e.renderedPosition!=null){var u=e.renderedPosition,c=o.pan(),d=o.zoom();e.position=Fi(u,d,c)}if(i&&e.panBy!=null){var h=e.panBy,g=o.pan();e.pan={x:g.x+h.x,y:g.y+h.y}}var p=e.center||e.centre;if(i&&p!=null){var v=o.getCenterPan(p.eles,e.zoom);v!=null&&(e.pan=v)}if(i&&e.fit!=null){var b=e.fit,f=o.getFitViewport(b.eles||b.boundingBox,b.padding);f!=null&&(e.pan=f.pan,e.zoom=f.zoom)}if(i&&ve(e.zoom)){var y=o.getZoomedViewport(e.zoom);y!=null?(y.zoomed&&(e.zoom=y.zoom),y.panned&&(e.pan=y.pan)):e.zoom=null}return new wa(a[0],e)}},animate:function(){return function(e,t){var n=this,r=n.length!==void 0?n:[n];if(!(this._private.cy||this).styleEnabled())return this;t&&(e=he({},e,t));for(var a=0;a<r.length;a++){var o=r[a],i=o.animated()&&(e.queue===void 0||e.queue);o.animation(e,i?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=n.length!==void 0?n:[n],a=this._private.cy||this;if(!a.styleEnabled())return this;for(var o=0;o<r.length;o++){for(var i=r[o]._private,s=i.animation.current,l=0;l<s.length;l++){var u=s[l]._private;t&&(u.duration=0)}e&&(i.animation.queue=[]),t||(i.animation.current=[])}return a.notify("draw"),this}}},Mr=Array.isArray,Wu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hu=/^\w*$/,Ku=function(e,t){if(Mr(e))return!1;var n=typeof e;return!(n!="number"&&n!="symbol"&&n!="boolean"&&e!=null&&!On(e))||Hu.test(e)||!Wu.test(e)||t!=null&&e in Object(t)},vo,Gu=function(e){if(!qt(e))return!1;var t=Ti(e);return t=="[object Function]"||t=="[object GeneratorFunction]"||t=="[object AsyncFunction]"||t=="[object Proxy]"},Ea=dr["__core-js_shared__"],yo=(vo=/[^.]+$/.exec(Ea&&Ea.keys&&Ea.keys.IE_PROTO||""))?"Symbol(src)_1."+vo:"",Uu=function(e){return!!yo&&yo in e},Zu=Function.prototype.toString,$u=function(e){if(e!=null){try{return Zu.call(e)}catch{}try{return e+""}catch{}}return""},Qu=/^\[object .+?Constructor\]$/,Ju=Function.prototype,ec=Object.prototype,tc=Ju.toString,nc=ec.hasOwnProperty,rc=RegExp("^"+tc.call(nc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ac=function(e){return!(!qt(e)||Uu(e))&&(Gu(e)?rc:Qu).test($u(e))},ic=function(e,t){return e==null?void 0:e[t]},ka=function(e,t){var n=ic(e,t);return ac(n)?n:void 0},Gn=ka(Object,"create"),oc=function(){this.__data__=Gn?Gn(null):{},this.size=0},sc=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},lc=Object.prototype.hasOwnProperty,uc=function(e){var t=this.__data__;if(Gn){var n=t[e];return n==="__lodash_hash_undefined__"?void 0:n}return lc.call(t,e)?t[e]:void 0},cc=Object.prototype.hasOwnProperty,dc=function(e){var t=this.__data__;return Gn?t[e]!==void 0:cc.call(t,e)},hc=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Gn&&t===void 0?"__lodash_hash_undefined__":t,this};function vn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vn.prototype.clear=oc,vn.prototype.delete=sc,vn.prototype.get=uc,vn.prototype.has=dc,vn.prototype.set=hc;var mo=vn,pc=function(){this.__data__=[],this.size=0},bo=function(e,t){return e===t||e!=e&&t!=t},Br=function(e,t){for(var n=e.length;n--;)if(bo(e[n][0],t))return n;return-1},fc=Array.prototype.splice,gc=function(e){var t=this.__data__,n=Br(t,e);return!(n<0)&&(n==t.length-1?t.pop():fc.call(t,n,1),--this.size,!0)},vc=function(e){var t=this.__data__,n=Br(t,e);return n<0?void 0:t[n][1]},yc=function(e){return Br(this.__data__,e)>-1},mc=function(e,t){var n=this.__data__,r=Br(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function yn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yn.prototype.clear=pc,yn.prototype.delete=gc,yn.prototype.get=vc,yn.prototype.has=yc,yn.prototype.set=mc;var bc=yn,xc=ka(dr,"Map"),wc=function(){this.size=0,this.__data__={hash:new mo,map:new(xc||bc),string:new mo}},Ec=function(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null},_r=function(e,t){var n=e.__data__;return Ec(t)?n[typeof t=="string"?"string":"hash"]:n.map},kc=function(e){var t=_r(this,e).delete(e);return this.size-=t?1:0,t},Cc=function(e){return _r(this,e).get(e)},Sc=function(e){return _r(this,e).has(e)},Pc=function(e,t){var n=_r(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function mn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mn.prototype.clear=wc,mn.prototype.delete=kc,mn.prototype.get=Cc,mn.prototype.has=Sc,mn.prototype.set=Pc;var xo=mn;function Ca(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i)||o,i};return n.cache=new(Ca.Cache||xo),n}Ca.Cache=xo;var Dc=Ca,Tc=function(e){var t=Dc(e,function(r){return n.size===500&&n.clear(),r}),n=t.cache;return t},Mc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bc=/\\(\\)?/g,_c=Tc(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Mc,function(n,r,a,o){t.push(a?o.replace(Bc,"$1"):r||n)}),t}),wo=_c,Eo=function(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a},ko=on?on.prototype:void 0,Co=ko?ko.toString:void 0,Nc=function e(t){if(typeof t=="string")return t;if(Mr(t))return Eo(t,e)+"";if(On(t))return Co?Co.call(t):"";var n=t+"";return n=="0"&&1/t==-1/0?"-0":n},So=function(e){return e==null?"":Nc(e)},Po=function(e,t){return Mr(e)?e:Ku(e,t)?[e]:wo(So(e))},Sa=function(e){if(typeof e=="string"||On(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t},Ac=function(e,t){for(var n=0,r=(t=Po(t,e)).length;e!=null&&n<r;)e=e[Sa(t[n++])];return n&&n==r?e:void 0},Lc=function(e,t,n){var r=e==null?void 0:Ac(e,t);return r===void 0?n:r},Do=function(){try{var e=ka(Object,"defineProperty");return e({},"",{}),e}catch{}}(),zc=function(e,t,n){t=="__proto__"&&Do?Do(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},Ic=Object.prototype.hasOwnProperty,Rc=function(e,t,n){var r=e[t];Ic.call(e,t)&&bo(r,n)&&(n!==void 0||t in e)||zc(e,t,n)},Oc=/^(?:0|[1-9]\d*)$/,Vc=function(e,t){var n=typeof e;return!!(t=t??9007199254740991)&&(n=="number"||n!="symbol"&&Oc.test(e))&&e>-1&&e%1==0&&e<t},Fc=function(e,t,n,r){if(!qt(e))return e;for(var a=-1,o=(t=Po(t,e)).length,i=o-1,s=e;s!=null&&++a<o;){var l=Sa(t[a]),u=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(a!=i){var c=s[l];(u=r?r(c,l,s):void 0)===void 0&&(u=qt(c)?c:Vc(t[a+1])?[]:{})}Rc(s,l,u),s=s[l]}return e},Xc=function(e,t,n){return e==null?e:Fc(e,t,n)},qc=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},Yc=function(e){return Mr(e)?Eo(e,Sa):On(e)?[e]:qc(wo(So(e)))},jc={data:function(e){return e=he({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(t){},beforeSet:function(t,n){},onSet:function(t){},canSet:function(t){return!0}},e),function(t,n){var r=e,a=this,o=a.length!==void 0,i=o?a:[a],s=o?a[0]:a;if(ce(t)){var l,u=t.indexOf(".")!==-1&&Yc(t);if(r.allowGetting&&n===void 0)return s&&(r.beforeGet(s),l=u&&s._private[r.field][t]===void 0?Lc(s._private[r.field],u):s._private[r.field][t]),l;if(r.allowSetting&&n!==void 0&&!r.immutableKeys[t]){var c=pi({},t,n);r.beforeSet(a,c);for(var d=0,h=i.length;d<h;d++){var g=i[d];r.canSet(g)&&(u&&s._private[r.field][t]===void 0?Xc(g._private[r.field],u,n):g._private[r.field][t]=n)}r.updateStyle&&a.updateStyle(),r.onSet(a),r.settingTriggersEvent&&a[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&ve(t)){var p,v,b=t,f=Object.keys(b);r.beforeSet(a,b);for(var y=0;y<f.length;y++)if(v=b[p=f[y]],!r.immutableKeys[p])for(var m=0;m<i.length;m++){var k=i[m];r.canSet(k)&&(k._private[r.field][p]=v)}r.updateStyle&&a.updateStyle(),r.onSet(a),r.settingTriggersEvent&&a[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&Me(t)){var x=t;a.on(r.bindingEvent,x)}else if(r.allowGetting&&t===void 0){var S;return s&&(r.beforeGet(s),S=s._private[r.field]),S}return a}},removeData:function(e){return e=he({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,a=r.length!==void 0?r:[r];if(ce(t)){for(var o=t.split(/\s+/),i=o.length,s=0;s<i;s++){var l=o[s];if(!Tt(l)&&!n.immutableKeys[l])for(var u=0,c=a.length;u<c;u++)a[u]._private[n.field][l]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(t===void 0){for(var d=0,h=a.length;d<h;d++)for(var g=a[d]._private[n.field],p=Object.keys(g),v=0;v<p.length;v++){var b=p[v];!n.immutableKeys[b]&&(g[b]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},Wc={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(n,r){var a=this,o=Array.prototype.slice.call(arguments,0);return new gn(function(i,s){var l=o.concat([function(c){a.off.apply(a,u),i(c)}]),u=l.concat([]);a.on.apply(a,l)})}}},Ee={};[ju,jc,Wc].forEach(function(e){he(Ee,e)});var Hc={animate:Ee.animate(),animation:Ee.animation(),animated:Ee.animated(),clearQueue:Ee.clearQueue(),delay:Ee.delay(),delayAnimation:Ee.delayAnimation(),stop:Ee.stop()},Nr={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(h){return n.push(h)}),n}ke(e)||(e=(e||"").match(/\S+/g)||[]);for(var r=[],a=new ln(e),o=0;o<t.length;o++){for(var i=t[o],s=i._private,l=s.classes,u=!1,c=0;c<e.length;c++){var d=e[c];if(!l.has(d)){u=!0;break}}u||(u=l.size!==e.length),u&&(s.classes=a,r.push(i))}return r.length>0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){ke(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=t===void 0,a=[],o=0,i=n.length;o<i;o++)for(var s=n[o],l=s._private.classes,u=!1,c=0;c<e.length;c++){var d=e[c],h=l.has(d),g=!1;t||r&&!h?(l.add(d),g=!0):(!t||r&&h)&&(l.delete(d),g=!0),!u&&g&&(a.push(s),u=!0)}return a.length>0&&this.spawn(a).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};Nr.className=Nr.classNames=Nr.classes;var ye={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Le,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};ye.variable="(?:[\\w-.]|(?:\\\\"+ye.metaChar+"))+",ye.className="(?:[\\w-]|(?:\\\\"+ye.metaChar+"))+",ye.value=ye.string+"|"+ye.number,ye.id=ye.variable,function(){var e,t,n;for(e=ye.comparatorOp.split("|"),n=0;n<e.length;n++)t=e[n],ye.comparatorOp+="|@"+t;for(e=ye.comparatorOp.split("|"),n=0;n<e.length;n++)(t=e[n]).indexOf("!")>=0||t!=="="&&(ye.comparatorOp+="|\\!"+t)}();var Pa=0,To=1,Mo=2,Da=3,Ta=4,Ma=5,Ba=6,_a=7,Ar=8,Na=9,Aa=10,La=11,Bo=12,_o=13,za=14,Ia=15,Ra=16,Lr=17,zr=18,Ir=19,bn=20,Oa=[{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(n,r){return-1*ki(n,r)}(e.selector,t.selector)}),Kc=function(){for(var e,t={},n=0;n<Oa.length;n++)t[(e=Oa[n]).selector]=e.matches;return t}(),Gc="("+Oa.map(function(e){return e.selector}).join("|")+")",xn=function(e){return e.replace(new RegExp("\\\\("+ye.metaChar+")","g"),function(t,n){return n})},At=function(e,t,n){e[e.length-1]=n},Va=[{name:"group",query:!0,regex:"("+ye.group+")",populate:function(e,t,n){var r=ut(n,1)[0];t.checks.push({type:Pa,value:r==="*"?r:r+"s"})}},{name:"state",query:!0,regex:Gc,populate:function(e,t,n){var r=ut(n,1)[0];t.checks.push({type:_a,value:r})}},{name:"id",query:!0,regex:"\\#("+ye.id+")",populate:function(e,t,n){var r=ut(n,1)[0];t.checks.push({type:Ar,value:xn(r)})}},{name:"className",query:!0,regex:"\\.("+ye.className+")",populate:function(e,t,n){var r=ut(n,1)[0];t.checks.push({type:Na,value:xn(r)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+ye.variable+")\\s*\\]",populate:function(e,t,n){var r=ut(n,1)[0];t.checks.push({type:Ta,field:xn(r)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+ye.variable+")\\s*("+ye.comparatorOp+")\\s*("+ye.value+")\\s*\\]",populate:function(e,t,n){var r=ut(n,3),a=r[0],o=r[1],i=r[2];i=new RegExp("^"+ye.string+"$").exec(i)!=null?i.substring(1,i.length-1):parseFloat(i),t.checks.push({type:Da,field:xn(a),operator:o,value:i})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+ye.boolOp+")\\s*("+ye.variable+")\\s*\\]",populate:function(e,t,n){var r=ut(n,2),a=r[0],o=r[1];t.checks.push({type:Ma,field:xn(o),operator:a})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+ye.meta+")\\s*("+ye.comparatorOp+")\\s*("+ye.number+")\\s*\\]\\]",populate:function(e,t,n){var r=ut(n,3),a=r[0],o=r[1],i=r[2];t.checks.push({type:Ba,field:xn(a),operator:o,value:parseFloat(i)})}},{name:"nextQuery",separator:!0,regex:ye.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,a=e.compoundCount,o=e[e.length-1];return n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=r,o.compoundCount=a,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:ye.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n={checks:[]},r=t,a={checks:[]};return n.checks.push({type:La,source:r,target:a}),At(e,0,n),e.edgeCount++,a}var o={checks:[]},i=t,s={checks:[]};return o.checks.push({type:Bo,source:i,target:s}),At(e,0,o),e.edgeCount++,s}},{name:"undirectedEdge",separator:!0,regex:ye.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n={checks:[]},r=t,a={checks:[]};return n.checks.push({type:Aa,nodes:[r,a]}),At(e,0,n),e.edgeCount++,a}var o={checks:[]},i=t,s={checks:[]};return o.checks.push({type:za,node:i,neighbor:s}),At(e,0,o),s}},{name:"child",separator:!0,regex:ye.child,populate:function(e,t){if(e.currentSubject==null){var n={checks:[]},r={checks:[]},a=e[e.length-1];return n.checks.push({type:Ia,parent:a,child:r}),At(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},i=e[e.length-1],s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]};return o.checks.push({type:Ir,left:i,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:bn}],c.checks.push({type:bn}),s.checks.push({type:Lr,parent:c,child:u}),At(e,0,o),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},h={checks:[]},g=[{type:Lr,parent:d,child:h}];return d.checks=t.checks,t.checks=g,e.compoundCount++,h}},{name:"descendant",separator:!0,regex:ye.descendant,populate:function(e,t){if(e.currentSubject==null){var n={checks:[]},r={checks:[]},a=e[e.length-1];return n.checks.push({type:Ra,ancestor:a,descendant:r}),At(e,0,n),e.compoundCount++,r}if(e.currentSubject===t){var o={checks:[]},i=e[e.length-1],s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]};return o.checks.push({type:Ir,left:i,right:s,subject:l}),l.checks=t.checks,t.checks=[{type:bn}],c.checks.push({type:bn}),s.checks.push({type:zr,ancestor:c,descendant:u}),At(e,0,o),e.currentSubject=l,e.compoundCount++,u}var d={checks:[]},h={checks:[]},g=[{type:zr,ancestor:d,descendant:h}];return d.checks=t.checks,t.checks=g,e.compoundCount++,h}},{name:"subject",modifier:!0,regex:ye.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return we("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=n==null?null:n.type;r===La?n.type=_o:r===Aa&&(n.type=za,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];Va.forEach(function(e){return e.regexObj=new RegExp("^"+e.regex)});var Uc=function(e){for(var t,n,r,a=0;a<Va.length;a++){var o=Va[a],i=o.name,s=e.match(o.regexObj);if(s!=null){n=s,t=o,r=i;var l=s[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:r,remaining:e}},Zc={parse:function(e){var t=this,n=t.inputText=e,r=t[0]={checks:[]};for(t.length=1,n=function(c){var d=c.match(/^\s+/);if(d){var h=d[0];c=c.substring(h.length)}return c}(n);;){var a=Uc(n);if(a.expr==null)return we("The selector `"+e+"`is invalid"),!1;var o=a.match.slice(1),i=a.expr.populate(t,r,o);if(i===!1)return!1;if(i!=null&&(r=i),(n=a.remaining).match(/^\s*$/))break}var s=t[t.length-1];t.currentSubject!=null&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var u=t[l];if(u.compoundCount>0&&u.edgeCount>0)return we("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return we("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;u.edgeCount===1&&we("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(this.toStringCache!=null)return this.toStringCache;for(var e=function(l){return l??""},t=function(l){return ce(l)?'"'+l+'"':e(l)},n=function(l){return" "+l+" "},r=function(l,u){var c=l.type,d=l.value;switch(c){case Pa:var h=e(d);return h.substring(0,h.length-1);case Da:var g=l.field,p=l.operator;return"["+g+n(e(p))+t(d)+"]";case Ma:var v=l.operator,b=l.field;return"["+e(v)+b+"]";case Ta:return"["+l.field+"]";case Ba:var f=l.operator;return"[["+l.field+n(e(f))+t(d)+"]]";case _a:return d;case Ar:return"#"+d;case Na:return"."+d;case Lr:case Ia:return a(l.parent,u)+n(">")+a(l.child,u);case zr:case Ra:return a(l.ancestor,u)+" "+a(l.descendant,u);case Ir:var y=a(l.left,u),m=a(l.subject,u),k=a(l.right,u);return y+(y.length>0?" ":"")+m+k;case bn:return""}},a=function(l,u){return l.checks.reduce(function(c,d,h){return c+(u===l&&h===0?"$":"")+r(d,u)},"")},o="",i=0;i<this.length;i++){var s=this[i];o+=a(s,s.subject),this.length>1&&i<this.length-1&&(o+=", ")}return this.toStringCache=o,o}},No=function(e,t,n){var r,a,o,i=ce(e),s=te(e),l=ce(n),u=!1,c=!1,d=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(i||l||u)&&(a=i||s?""+e:"",o=""+n),u&&(e=a=a.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=a.indexOf(o)>=0;break;case"$=":r=a.indexOf(o,a.length-o.length)>=0;break;case"^=":r=a.indexOf(o)===0;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||e==null&&d||(r=!r),r},Fa=function(e,t){return e.data(t)},_e=[],Pe=function(e,t){return e.checks.every(function(n){return _e[n.type](n,t)})};_e[Pa]=function(e,t){var n=e.value;return n==="*"||n===t.group()},_e[_a]=function(e,t){return function(n,r){return Kc[n](r)}(e.value,t)},_e[Ar]=function(e,t){var n=e.value;return t.id()===n},_e[Na]=function(e,t){var n=e.value;return t.hasClass(n)},_e[Ba]=function(e,t){var n=e.field,r=e.operator,a=e.value;return No(function(o,i){return o[i]()}(t,n),r,a)},_e[Da]=function(e,t){var n=e.field,r=e.operator,a=e.value;return No(Fa(t,n),r,a)},_e[Ma]=function(e,t){var n=e.field,r=e.operator;return function(a,o){switch(o){case"?":return!!a;case"!":return!a;case"^":return a===void 0}}(Fa(t,n),r)},_e[Ta]=function(e,t){var n=e.field;return e.operator,Fa(t,n)!==void 0},_e[Aa]=function(e,t){var n=e.nodes[0],r=e.nodes[1],a=t.source(),o=t.target();return Pe(n,a)&&Pe(r,o)||Pe(r,a)&&Pe(n,o)},_e[za]=function(e,t){return Pe(e.node,t)&&t.neighborhood().some(function(n){return n.isNode()&&Pe(e.neighbor,n)})},_e[La]=function(e,t){return Pe(e.source,t.source())&&Pe(e.target,t.target())},_e[Bo]=function(e,t){return Pe(e.source,t)&&t.outgoers().some(function(n){return n.isNode()&&Pe(e.target,n)})},_e[_o]=function(e,t){return Pe(e.target,t)&&t.incomers().some(function(n){return n.isNode()&&Pe(e.source,n)})},_e[Ia]=function(e,t){return Pe(e.child,t)&&Pe(e.parent,t.parent())},_e[Lr]=function(e,t){return Pe(e.parent,t)&&t.children().some(function(n){return Pe(e.child,n)})},_e[Ra]=function(e,t){return Pe(e.descendant,t)&&t.ancestors().some(function(n){return Pe(e.ancestor,n)})},_e[zr]=function(e,t){return Pe(e.ancestor,t)&&t.descendants().some(function(n){return Pe(e.descendant,n)})},_e[Ir]=function(e,t){return Pe(e.subject,t)&&Pe(e.left,t)&&Pe(e.right,t)},_e[bn]=function(){return!0},_e[To]=function(e,t){return e.value.has(t)},_e[Mo]=function(e,t){return(0,e.value)(t)};var $c={matches:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(Pe(n,e))return!0}return!1},filter:function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===Ar)return e.getElementById(t[0].checks[0].value).collection();var n=function(r){for(var a=0;a<t.length;a++){var o=t[a];if(Pe(o,r))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)}},Lt=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||ce(e)&&e.match(/^\s*$/)||(tt(e)?this.addQuery({checks:[{type:To,value:e.collection()}]}):Me(e)?this.addQuery({checks:[{type:Mo,value:e}]}):ce(e)?this.parse(e)||(this.invalid=!0):Be("A selector must be created from a string; found "))},zt=Lt.prototype;[Zc,$c].forEach(function(e){return he(zt,e)}),zt.text=function(){return this.inputText},zt.size=function(){return this.length},zt.eq=function(e){return this[e]},zt.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},zt.addQuery=function(e){this[this.length++]=e},zt.selector=zt.toString;var It={allAre:function(e){var t=new Lt(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new Lt(e);return this.some(function(n){return t.matches(n)})},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&&(t===1?this[0]===e[0]:this.every(function(n){return e.hasElementWithId(n.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(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};It.allAreNeighbours=It.allAreNeighbors,It.has=It.contains,It.equal=It.equals=It.same;var Rr,Ao,rt=function(e,t){return function(n,r,a,o){var i,s=n,l=this;if(s==null?i="":tt(s)&&s.length===1&&(i=s.id()),l.length===1&&i){var u=l[0]._private,c=u.traversalCache=u.traversalCache||{},d=c[t]=c[t]||[],h=Yt(i),g=d[h];return g||(d[h]=e.call(l,n,r,a,o))}return e.call(l,n,r,a,o)}},wn={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var a=this[r]._private.parent;a&&t.push(a)}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++){var a=n[r];t.push(a)}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(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:rt(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,a=0;a<r.length;a++)t.push(r[a]);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()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];return function n(r){for(var a=0;a<r.length;a++){var o=r[a];t.push(o),o.children().nonempty()&&n(o.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Xa(e,t,n,r){for(var a=[],o=new ln,i=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var l=e[s];n?a.push(l):i&&r(a,o,l)}for(;a.length>0;){var u=a.shift();t(u),o.add(u.id()),i&&r(a,o,u)}return e}function Lo(e,t,n){if(n.isParent())for(var r=n._private.children,a=0;a<r.length;a++){var o=r[a];t.has(o.id())||e.push(o)}}function zo(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}function Qc(e,t,n){zo(e,t,n),Lo(e,t,n)}wn.forEachDown=function(e){return Xa(this,e,!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],Lo)},wn.forEachUp=function(e){return Xa(this,e,!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],zo)},wn.forEachUpAndDown=function(e){return Xa(this,e,!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],Qc)},wn.ancestors=wn.parents,(Rr=Ao={data:Ee.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:Ee.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ee.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ee.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ee.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ee.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Rr.data,Rr.removeAttr=Rr.removeData;var dt,Io,Jc=Ao,Or={};function qa(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0&&n.isNode()&&!n.removed()){for(var r=0,a=n[0],o=a._private.edges,i=0;i<o.length;i++){var s=o[i];!t&&s.isLoop()||(r+=e(a,s))}return r}}}function En(e,t){return function(n){for(var r,a=this.nodes(),o=0;o<a.length;o++){var i=a[o][e](n);i===void 0||r!==void 0&&!t(i,r)||(r=i)}return r}}he(Or,{degree:qa(function(e,t){return t.source().same(t.target())?2:1}),indegree:qa(function(e,t){return t.target().same(e)?1:0}),outdegree:qa(function(e,t){return t.source().same(e)?1:0})}),he(Or,{minDegree:En("degree",function(e,t){return e<t}),maxDegree:En("degree",function(e,t){return e>t}),minIndegree:En("indegree",function(e,t){return e<t}),maxIndegree:En("indegree",function(e,t){return e>t}),minOutdegree:En("outdegree",function(e,t){return e<t}),maxOutdegree:En("outdegree",function(e,t){return e>t})}),he(Or,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var Ro=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r];if(!a.locked()){var o=a._private.position,i={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};!a.isParent()||i.x===0&&i.y===0||a.children().shift(i,n),a.dirtyBoundingBoxCache()}}},Oo={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){Ro(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};dt=Io={position:Ee.data(Oo),silentPosition:Ee.data(he({},Oo,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Ro(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(ve(e))t?this.silentPosition(e):this.position(e);else if(Me(e)){var n=e,r=this.cy();r.startBatch();for(var a=0;a<this.length;a++){var o,i=this[a];(o=n(i,a))&&(t?i.silentPosition(o):i.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(ve(e)?(r={x:te(e.x)?e.x:0,y:te(e.y)?e.y:0},n=t):ce(e)&&te(t)&&((r={x:0,y:0})[e]=t),r!=null){var a=this.cy();a.startBatch();for(var o=0;o<this.length;o++){var i=this[o];if(!(a.hasCompoundNodes()&&i.isChild()&&i.ancestors().anySame(this))){var s=i.position(),l={x:s.x+r.x,y:s.y+r.y};n?i.silentPosition(l):i.position(l)}}a.endBatch()}return this},silentShift:function(e,t){return ve(e)?this.shift(e,!0):ce(e)&&te(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),a=r.zoom(),o=r.pan(),i=ve(e)?e:void 0,s=i!==void 0||t!==void 0&&ce(e);if(n&&n.isNode()){if(!s){var l=n.position();return i=yr(l,a,o),e===void 0?i:i[e]}for(var u=0;u<this.length;u++){var c=this[u];t!==void 0?c.position(e,(t-o[e])/a):i!==void 0&&c.position(Fi(i,a,o))}}else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),a=ve(e)?e:void 0,o=a!==void 0||t!==void 0&&ce(e),i=r.hasCompoundNodes();if(n&&n.isNode()){if(!o){var s=n.position(),l=i?n.parent():null,u=l&&l.length>0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return a={x:s.x-d.x,y:s.y-d.y},e===void 0?a:a[e]}for(var h=0;h<this.length;h++){var g=this[h],p=i?g.parent():null,v=p&&p.length>0,b=v;v&&(p=p[0]);var f=b?p.position():{x:0,y:0};t!==void 0?g.position(e,t+f[e]):a!==void 0&&g.position({x:a.x+f.x,y:a.y+f.y})}}else if(!o)return;return this}},dt.modelPosition=dt.point=dt.position,dt.modelPositions=dt.points=dt.positions,dt.renderedPoint=dt.renderedPosition,dt.relativePoint=dt.relativePosition;var kn,Rt,ed=Io;kn=Rt={},Rt.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),a=n.pan(),o=t.x1*r+a.x,i=t.x2*r+a.x,s=t.y1*r+a.y,l=t.y2*r+a.y;return{x1:o,x2:i,y1:s,y2:l,w:i-o,h:l-s}},Rt.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp(function(n){if(n.isParent()){var r=n._private;r.compoundBoundsClean=!1,r.bbCache=null,e||n.emitAndNotify("bounds")}}),this):this},Rt.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(i){if(i.isParent()){var s=i._private,l=i.children(),u=i.pstyle("compound-sizing-wrt-labels").value==="include",c={width:{val:i.pstyle("min-width").pfValue,left:i.pstyle("min-width-bias-left"),right:i.pstyle("min-width-bias-right")},height:{val:i.pstyle("min-height").pfValue,top:i.pstyle("min-height-bias-top"),bottom:i.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=s.position;d.w!==0&&d.h!==0||((d={w:i.pstyle("width").pfValue,h:i.pstyle("height").pfValue}).x1=h.x-d.w/2,d.x2=h.x+d.w/2,d.y1=h.y-d.h/2,d.y2=h.y+d.h/2);var g=c.width.left.value;c.width.left.units==="px"&&c.width.val>0&&(g=100*g/c.width.val);var p=c.width.right.value;c.width.right.units==="px"&&c.width.val>0&&(p=100*p/c.width.val);var v=c.height.top.value;c.height.top.units==="px"&&c.height.val>0&&(v=100*v/c.height.val);var b=c.height.bottom.value;c.height.bottom.units==="px"&&c.height.val>0&&(b=100*b/c.height.val);var f=w(c.width.val-d.w,g,p),y=f.biasDiff,m=f.biasComplementDiff,k=w(c.height.val-d.h,v,b),x=k.biasDiff,S=k.biasComplementDiff;s.autoPadding=function(D,E,P,T){if(P.units!=="%")return P.units==="px"?P.pfValue:0;switch(T){case"width":return D>0?P.pfValue*D:0;case"height":return E>0?P.pfValue*E:0;case"average":return D>0&&E>0?P.pfValue*(D+E)/2:0;case"min":return D>0&&E>0?D>E?P.pfValue*E:P.pfValue*D:0;case"max":return D>0&&E>0?D>E?P.pfValue*D:P.pfValue*E:0;default:return 0}}(d.w,d.h,i.pstyle("padding"),i.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,c.width.val),h.x=(-y+d.x1+d.x2+m)/2,s.autoHeight=Math.max(d.h,c.height.val),h.y=(-x+d.y1+d.y2+S)/2}function w(D,E,P){var T=0,B=0,M=E+P;return D>0&&M>0&&(T=E/M*D,B=P/M*D),{biasDiff:T,biasComplementDiff:B}}}for(var r=0;r<this.length;r++){var a=this[r],o=a._private;o.compoundBoundsClean&&!e||(n(a),t.batching()||(o.compoundBoundsClean=!0))}return this};var at=function(e){return e===1/0||e===-1/0?0:e},ht=function(e,t,n,r,a){r-t!==0&&a-n!==0&&t!=null&&n!=null&&r!=null&&a!=null&&(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=a>e.y2?a:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Ut=function(e,t){return t==null?e:ht(e,t.x1,t.y1,t.x2,t.y2)},Un=function(e,t,n){return ct(e,t,n)},Vr=function(e,t,n){if(!t.cy().headless()){var r,a,o=t._private,i=o.rstyle,s=i.arrowWidth/2;if(t.pstyle(n+"-arrow-shape").value!=="none"){n==="source"?(r=i.srcX,a=i.srcY):n==="target"?(r=i.tgtX,a=i.tgtY):(r=i.midX,a=i.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=a-s,u.x2=r+s,u.y2=a+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,br(u,1),ht(e,u.x1,u.y1,u.x2,u.y2)}}},Ya=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var a=t._private,o=a.rstyle;if(t.pstyle(r+"label").strValue){var i,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=Un(o,"labelWidth",n),g=Un(o,"labelHeight",n),p=Un(o,"labelX",n),v=Un(o,"labelY",n),b=t.pstyle(r+"text-margin-x").pfValue,f=t.pstyle(r+"text-margin-y").pfValue,y=t.isEdge(),m=t.pstyle(r+"text-rotation"),k=t.pstyle("text-outline-width").pfValue,x=t.pstyle("text-border-width").pfValue/2,S=t.pstyle("text-background-padding").pfValue,w=g,D=h,E=D/2,P=w/2;if(y)i=p-E,s=p+E,l=v-P,u=v+P;else{switch(c.value){case"left":i=p-D,s=p;break;case"center":i=p-E,s=p+E;break;case"right":i=p,s=p+D}switch(d.value){case"top":l=v-w,u=v;break;case"center":l=v-P,u=v+P;break;case"bottom":l=v,u=v+w}}i+=b-Math.max(k,x)-S-2,s+=b+Math.max(k,x)+S+2,l+=f-Math.max(k,x)-S-2,u+=f+Math.max(k,x)+S+2;var T=n||"main",B=a.labelBounds,M=B[T]=B[T]||{};M.x1=i,M.y1=l,M.x2=s,M.y2=u,M.w=s-i,M.h=u-l;var z=y&&m.strValue==="autorotate",R=m.pfValue!=null&&m.pfValue!==0;if(z||R){var F=z?Un(a.rstyle,"labelAngle",n):m.pfValue,N=Math.cos(F),I=Math.sin(F),X=(i+s)/2,O=(l+u)/2;if(!y){switch(c.value){case"left":X=s;break;case"right":X=i}switch(d.value){case"top":O=u;break;case"bottom":O=l}}var Y=function(re,ae){return{x:(re-=X)*N-(ae-=O)*I+X,y:re*I+ae*N+O}},j=Y(i,l),G=Y(i,u),W=Y(s,l),q=Y(s,u);i=Math.min(j.x,G.x,W.x,q.x),s=Math.max(j.x,G.x,W.x,q.x),l=Math.min(j.y,G.y,W.y,q.y),u=Math.max(j.y,G.y,W.y,q.y)}var K=T+"Rot",U=B[K]=B[K]||{};U.x1=i,U.y1=l,U.x2=s,U.y2=u,U.w=s-i,U.h=u-l,ht(e,i,l,s,u),ht(a.labelBounds.all,i,l,s,u)}return e}},td=function(e,t){var n,r,a,o,i,s,l,u=e._private.cy,c=u.styleEnabled(),d=u.headless(),h=Je(),g=e._private,p=e.isNode(),v=e.isEdge(),b=g.rstyle,f=p&&c?e.pstyle("bounds-expansion").pfValue:[0],y=function(U){return U.pstyle("display").value!=="none"},m=!c||y(e)&&(!v||y(e.source())&&y(e.target()));if(m){var k=0;c&&t.includeOverlays&&e.pstyle("overlay-opacity").value!==0&&(k=e.pstyle("overlay-padding").value);var x=0;c&&t.includeUnderlays&&e.pstyle("underlay-opacity").value!==0&&(x=e.pstyle("underlay-padding").value);var S=Math.max(k,x),w=0;if(c&&(w=e.pstyle("width").pfValue/2),p&&t.includeNodes){var D=e.position();i=D.x,s=D.y;var E=e.outerWidth()/2,P=e.outerHeight()/2;ht(h,n=i-E,a=s-P,r=i+E,o=s+P),c&&t.includeOutlines&&function(U,re){if(!re.cy().headless()){var ae,de,ue,Q=re.pstyle("outline-opacity").value,le=re.pstyle("outline-width").value;if(Q>0&&le>0){var ee=re.pstyle("outline-offset").value,C=re.pstyle("shape").value,_=le+ee,A=(U.w+2*_)/U.w,V=(U.h+2*_)/U.h,L=0;["diamond","pentagon","round-triangle"].includes(C)?(A=(U.w+2.4*_)/U.w,L=-_/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(C)?A=(U.w+2.4*_)/U.w:C==="star"?(A=(U.w+2.8*_)/U.w,V=(U.h+2.6*_)/U.h,L=-_/3.8):C==="triangle"?(A=(U.w+2.8*_)/U.w,V=(U.h+2.4*_)/U.h,L=-_/1.4):C==="vee"&&(A=(U.w+4.4*_)/U.w,V=(U.h+3.8*_)/U.h,L=.5*-_);var Z=U.h*V-U.h,H=U.w*A-U.w;if(xr(U,[Math.ceil(Z/2),Math.ceil(H/2)]),L!==0){var ne=(de=0,ue=L,{x1:(ae=U).x1+de,x2:ae.x2+de,y1:ae.y1+ue,y2:ae.y2+ue,w:ae.w,h:ae.h});qi(U,ne)}}}}(h,e)}else if(v&&t.includeEdges)if(c&&!d){var T=e.pstyle("curve-style").strValue;if(n=Math.min(b.srcX,b.midX,b.tgtX),r=Math.max(b.srcX,b.midX,b.tgtX),a=Math.min(b.srcY,b.midY,b.tgtY),o=Math.max(b.srcY,b.midY,b.tgtY),ht(h,n-=w,a-=w,r+=w,o+=w),T==="haystack"){var B=b.haystackPts;if(B&&B.length===2){if(n=B[0].x,a=B[0].y,n>(r=B[1].x)){var M=n;n=r,r=M}if(a>(o=B[1].y)){var z=a;a=o,o=z}ht(h,n-w,a-w,r+w,o+w)}}else if(T==="bezier"||T==="unbundled-bezier"||T.endsWith("segments")||T.endsWith("taxi")){var R;switch(T){case"bezier":case"unbundled-bezier":R=b.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":R=b.linePts}if(R!=null)for(var F=0;F<R.length;F++){var N=R[F];n=N.x-w,r=N.x+w,a=N.y-w,o=N.y+w,ht(h,n,a,r,o)}}}else{var I=e.source().position(),X=e.target().position();if((n=I.x)>(r=X.x)){var O=n;n=r,r=O}if((a=I.y)>(o=X.y)){var Y=a;a=o,o=Y}ht(h,n-=w,a-=w,r+=w,o+=w)}if(c&&t.includeEdges&&v&&(Vr(h,e,"mid-source"),Vr(h,e,"mid-target"),Vr(h,e,"source"),Vr(h,e,"target")),c&&e.pstyle("ghost").value==="yes"){var j=e.pstyle("ghost-offset-x").pfValue,G=e.pstyle("ghost-offset-y").pfValue;ht(h,h.x1+j,h.y1+G,h.x2+j,h.y2+G)}var W=g.bodyBounds=g.bodyBounds||{};Yi(W,h),xr(W,f),br(W,1),c&&(n=h.x1,r=h.x2,a=h.y1,o=h.y2,ht(h,n-S,a-S,r+S,o+S));var q=g.overlayBounds=g.overlayBounds||{};Yi(q,h),xr(q,f),br(q,1);var K=g.labelBounds=g.labelBounds||{};K.all!=null?((l=K.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):K.all=Je(),c&&t.includeLabels&&(t.includeMainLabels&&Ya(h,e,null),v&&(t.includeSourceLabels&&Ya(h,e,"source"),t.includeTargetLabels&&Ya(h,e,"target")))}return h.x1=at(h.x1),h.y1=at(h.y1),h.x2=at(h.x2),h.y2=at(h.y2),h.w=at(h.x2-h.x1),h.h=at(h.y2-h.y1),h.w>0&&h.h>0&&m&&(xr(h,f),br(h,1)),h},Vo=function(e){var t=0,n=function(a){return(a?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),r+=n(e.includeOverlays),r+=n(e.includeOutlines)},Fo=function(e){if(e.isEdge()){var t=e.source().position(),n=e.target().position(),r=function(a){return Math.round(a)};return function(a,o){var i={value:0,done:!1},s=0,l=a.length;return _i({next:function(){return s<l?i.value=a[s++]:i.done=!0,i}},o)}([r(t.x),r(t.y),r(n.x),r(n.y)])}return 0},Xo=function(e,t){var n,r=e._private,a=e.isEdge(),o=(t==null?qo:Vo(t))===qo,i=Fo(e),s=r.bbCachePosKey===i,l=t.useCache&&s,u=function(d){return d._private.bbCache==null||d._private.styleDirty};if(!l||u(e)||a&&u(e.source())||u(e.target())?(s||e.recalculateRenderedStyle(l),n=td(e,Zn),r.bbCache=n,r.bbCachePosKey=i):n=r.bbCache,!o){var c=e.isNode();n=Je(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?Ut(n,r.overlayBounds):Ut(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!a||t.includeSourceLabels&&t.includeTargetLabels)?Ut(n,r.labelBounds.all):(t.includeMainLabels&&Ut(n,r.labelBounds.mainRot),t.includeSourceLabels&&Ut(n,r.labelBounds.sourceRot),t.includeTargetLabels&&Ut(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},Zn={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},qo=Vo(Zn),Yo=Re(Zn);Rt.boundingBox=function(e){var t;if(this.length!==1||this[0]._private.bbCache==null||this[0]._private.styleDirty||e!==void 0&&e.useCache!==void 0&&e.useCache!==!0){t=Je();var n=Yo(e=e||Zn),r=this;if(r.cy().styleEnabled())for(var a=0;a<r.length;a++){var o=r[a],i=o._private,s=Fo(o),l=i.bbCachePosKey===s,u=n.useCache&&l&&!i.styleDirty;o.recalculateRenderedStyle(u)}this.updateCompoundBounds(!e.useCache);for(var c=0;c<r.length;c++){var d=r[c];Ut(t,Xo(d,n))}}else e=e===void 0?Zn:Yo(e),t=Xo(this[0],e);return t.x1=at(t.x1),t.y1=at(t.y1),t.x2=at(t.x2),t.y2=at(t.y2),t.w=at(t.x2-t.x1),t.h=at(t.y2-t.y1),t},Rt.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},Rt.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),a=n.collection();if(r&&(a=t.filter(function(s){return s.isParent()}),t=t.not(a)),ve(e)){var o=e;e=function(){return o}}n.startBatch(),t.forEach(function(s,l){return s._private.bbAtOldPos=e(s,l)}).silentPositions(e),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var i=function(s){return{x1:s.x1,x2:s.x2,w:s.w,y1:s.y1,y2:s.y2,h:s.h}}(this.boundingBox({useCache:!1}));return t.silentPositions(function(s){return s._private.bbAtOldPos}),r&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),n.endBatch(),i},kn.boundingbox=kn.bb=kn.boundingBox,kn.renderedBoundingbox=kn.renderedBoundingBox;var $n,Qn,nd=Rt;$n=Qn={};var jo=function(e){e.uppercaseName=Ei(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Ei(e.outerName),$n[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t){if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var a=t.pstyle(e.name);return a.strValue==="label"?(t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0):a.pfValue}return 1}},$n["outer"+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)return n?t[e.name]()+t.pstyle("border-width").pfValue+2*t.padding():1},$n["rendered"+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},$n["rendered"+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};jo({name:"width"}),jo({name:"height"}),Qn.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding!==void 0?t.autoPadding:e.pstyle("padding").pfValue):e.pstyle("padding").pfValue},Qn.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},Qn.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var rd=Qn,Wo={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)}}},ad=Object.keys(Wo).reduce(function(e,t){var n=Wo[t],r=function(a){return"rendered"+a[0].toUpperCase()+a.substr(1)}(t);return e[t]=function(){return function(a,o){if(a.isEdge())return o(a)}(this,n.get)},n.mult?e[r]=function(){return function(a,o){if(a.isEdge()){var i=a.cy(),s=i.pan(),l=i.zoom();return o(a).map(function(u){return yr(u,l,s)})}}(this,n.get)}:e[r]=function(){return function(a,o){if(a.isEdge()){var i=a.cy();return yr(o(a),i.zoom(),i.pan())}}(this,n.get)},e},{}),id=he({},ed,nd,rd,ad),Ho=function(e,t){this.recycle(e,t)};function Jn(){return!1}function Fr(){return!0}Ho.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Jn,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Fr:Jn):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?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),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,r=this.cy.zoom(),a=this.cy.pan();this.renderedPosition={x:n.x*r+a.x,y:n.y*r+a.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Fr;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Fr;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Fr,this.stopPropagation()},isDefaultPrevented:Jn,isPropagationStopped:Jn,isImmediatePropagationStopped:Jn};var Ko=/^([^.]+)(\.(?:[^.]+))?$/,Go={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},Uo=Object.keys(Go),od={};function Xr(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:od,t=arguments.length>1?arguments[1]:void 0,n=0;n<Uo.length;n++){var r=Uo[n];this[r]=e[r]||Go[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var Ot=Xr.prototype,Zo=function(e,t,n,r,a,o,i){Me(r)&&(a=r,r=null),i&&(o=o==null?i:he({},o,i));for(var s=ke(n)?n:n.split(/\s+/),l=0;l<s.length;l++){var u=s[l];if(!Tt(u)){var c=u.match(Ko);if(c&&t(e,u,c[1],c[2]?c[2]:null,r,a,o)===!1)break}}},$o=function(e,t){return e.addEventFields(e.context,t),new Ho(t.type,t)},sd=function(e,t,n){if(An(n)!=="event")if(ve(n))t(e,$o(e,n));else for(var r=ke(n)?n:n.split(/\s+/),a=0;a<r.length;a++){var o=r[a];if(!Tt(o)){var i=o.match(Ko);if(i){var s=i[1],l=i[2]?i[2]:null;t(e,$o(e,{type:s,namespace:l,target:e.context}))}}}else t(e,n)};Ot.on=Ot.addListener=function(e,t,n,r,a){return Zo(this,function(o,i,s,l,u,c,d){Me(c)&&o.listeners.push({event:i,callback:c,type:s,namespace:l,qualifier:u,conf:d})},e,t,n,r,a),this},Ot.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},Ot.removeListener=Ot.off=function(e,t,n,r){var a=this;this.emitting!==0&&(this.listeners=this.listeners.slice());for(var o=this.listeners,i=function(l){var u=o[l];Zo(a,function(c,d,h,g,p,v){if((u.type===h||e==="*")&&(!g&&u.namespace!==".*"||u.namespace===g)&&(!p||c.qualifierCompare(u.qualifier,p))&&(!v||u.callback===v))return o.splice(l,1),!1},e,t,n,r)},s=o.length-1;s>=0;s--)i(s);return this},Ot.removeAllListeners=function(){return this.removeListener("*")},Ot.emit=Ot.trigger=function(e,t,n){var r=this.listeners,a=r.length;return this.emitting++,ke(t)||(t=[t]),sd(this,function(o,i){n!=null&&(r=[{event:i.event,type:i.type,namespace:i.namespace,callback:n}],a=r.length);for(var s=function(u){var c=r[u];if(c.type===i.type&&(!c.namespace||c.namespace===i.namespace||c.namespace===".*")&&o.eventMatches(o.context,c,i)){var d=[i];t!=null&&function(p,v){for(var b=0;b<v.length;b++){var f=v[b];p.push(f)}}(d,t),o.beforeEmit(o.context,c,i),c.conf&&c.conf.one&&(o.listeners=o.listeners.filter(function(p){return p!==c}));var h=o.callbackContext(o.context,c,i),g=c.callback.apply(h,d);o.afterEmit(o.context,c,i),g===!1&&(i.stopPropagation(),i.preventDefault())}},l=0;l<a;l++)s(l);o.bubble(o.context)&&!i.isPropagationStopped()&&o.parent(o.context).emit(i,t)},e),this.emitting--,this};var ld={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null||e!==n.target&&Ln(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?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()}},qr=function(e){return ce(e)?new Lt(e):e},Qo={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Xr(ld,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=qr(t),a=0;a<this.length;a++)this[a].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=qr(t),a=0;a<this.length;a++)this[a].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=qr(t),a=0;a<this.length;a++)this[a].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=qr(t),a=0;a<this.length;a++)this[a].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(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};Ee.eventAliasesOn(Qo);var Jo={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.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(e===void 0)return this;if(ce(e)||tt(e))return new Lt(e).filter(this);if(Me(e)){for(var n=this.spawn(),r=this,a=0;a<r.length;a++){var o=r[a];(t?e.apply(t,[o,a,r]):e(o,a,r))&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){ce(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(ce(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=e,a=this.length<e.length,o=a?this:r,i=a?r:this,s=0;s<o.length;s++){var l=o[s];i.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;ce(e)&&(e=t.$(e));var n=this.spawn(),r=e,a=function(o,i){for(var s=0;s<o.length;s++){var l=o[s],u=l._private.data.id;i.hasElementWithId(u)||n.push(l)}};return a(this,r),a(r,this),n},diff:function(e){var t=this._private.cy;ce(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),a=this.spawn(),o=e,i=function(s,l,u){for(var c=0;c<s.length;c++){var d=s[c],h=d._private.data.id;l.hasElementWithId(h)?a.merge(d):u.push(d)}};return i(this,o,n),i(o,this,r),{left:n,right:r,both:a}},add:function(e){var t=this._private.cy;if(!e)return this;if(ce(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),a=0;a<e.length;a++){var o=e[a],i=!this.has(o);i&&r.push(o)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&ce(e)){var r=e;e=n.mutableElements().filter(r)}for(var a=t.map,o=0;o<e.length;o++){var i=e[o],s=i._private.data.id;if(!a.has(s)){var l=this.length++;this[l]=i,a.set(s,{ele:i,index:l})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var a=this.length-1,o=this[a],i=o._private.data.id;this[a]=void 0,this[e]=o,n.set(i,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var a=r.index;return this.unmergeAt(a),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&ce(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=this,a=0;a<r.length;a++){var o=r[a],i=t?e.apply(t,[o,a,r]):e(o,a,r);n.push(i)}return n},reduce:function(e,t){for(var n=t,r=this,a=0;a<r.length;a++)n=e(n,r[a],a,r);return n},max:function(e,t){for(var n,r=-1/0,a=this,o=0;o<a.length;o++){var i=a[o],s=t?e.apply(t,[i,o,a]):e(i,o,a);s>r&&(r=s,n=i)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,a=this,o=0;o<a.length;o++){var i=a[o],s=t?e.apply(t,[i,o,a]):e(i,o,a);s<r&&(r=s,n=i)}return{value:r,ele:n}}},me=Jo;me.u=me["|"]=me["+"]=me.union=me.or=me.add,me["\\"]=me["!"]=me["-"]=me.difference=me.relativeComplement=me.subtract=me.not,me.n=me["&"]=me["."]=me.and=me.intersection=me.intersect,me["^"]=me["(+)"]=me["(-)"]=me.symmetricDifference=me.symdiff=me.xor,me.fnFilter=me.filterFn=me.stdFilter=me.filter,me.complement=me.abscomp=me.absoluteComplement;var es=function(e,t){var n=e.cy().hasCompoundNodes();function r(l){var u=l.pstyle("z-compound-depth");return u.value==="auto"?n?l.zDepth():0:u.value==="bottom"?-1:u.value==="top"?ua:0}var a=r(e)-r(t);if(a!==0)return a;function o(l){return l.pstyle("z-index-compare").value==="auto"&&l.isNode()?1:0}var i=o(e)-o(t);if(i!==0)return i;var s=e.pstyle("z-index").value-t.pstyle("z-index").value;return s!==0?s:e.poolIndex()-t.poolIndex()},Yr={forEach:function(e,t){if(Me(e))for(var n=this.length,r=0;r<n;r++){var a=this[r];if((t?e.apply(t,[a,r,this]):e(a,r,this))===!1)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;t==null&&(t=r),e==null&&(e=0),e<0&&(e=r+e),t<0&&(t=r+t);for(var a=e;a>=0&&a<t&&a<r;a++)n.push(this[a]);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 this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Me(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(es)},zDepth:function(){var e=this[0];if(e){var t=e._private;if(t.group==="nodes"){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:ua-1}var r=t.source,a=t.target,o=r.zDepth(),i=a.zDepth();return Math.max(o,i,0)}}};Yr.each=Yr.forEach;var ja;ja="undefined",(typeof Symbol>"u"?"undefined":Ne(Symbol))!=ja&&Ne(Symbol.iterator)!=ja&&(Yr[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return pi({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,function(){return this})});var ud=Re({nodeDimensionsIncludeLabels:!1}),jr={layoutDimensions:function(e){var t;if(e=ud(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 t.w!==0&&t.h!==0||(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter(function(f){return!f.isParent()}),a=this.cy(),o=t.eles,i=function(f){return f.id()},s=zn(n,i);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=t.spacingFactor&&t.spacingFactor!==1,u=function(){if(!l)return null;for(var f=Je(),y=0;y<r.length;y++){var m=r[y],k=s(m,y);iu(f,k.x,k.y)}return f}(),c=zn(function(f,y){var m=s(f,y);return l&&(m=function(k,x,S){var w=x.x1+x.w/2,D=x.y1+x.h/2;return{x:w+(S.x-w)*k,y:D+(S.y-D)*k}}(Math.abs(t.spacingFactor),u,m)),t.transform!=null&&(m=t.transform(f,m)),m},i);if(t.animate){for(var d=0;d<r.length;d++){var h=r[d],g=c(h,d);if(t.animateFilter==null||t.animateFilter(h,d)){var p=h.animation({position:g,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(p)}else h.position(g)}if(t.fit){var v=a.animation({fit:{boundingBox:o.boundingBoxAt(c),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(v)}else if(t.zoom!==void 0&&t.pan!==void 0){var b=a.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}e.animations.forEach(function(f){return f.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),gn.all(e.animations.map(function(f){return f.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else r.positions(c),t.fit&&a.fit(t.eles,t.padding),t.zoom!=null&&a.zoom(t.zoom),t.pan&&a.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(he({},e,{eles:this}))}};function ts(e,t,n){var r,a=n._private,o=a.styleCache=a.styleCache||[];return(r=o[e])!=null?r:r=o[e]=t(n)}function Wr(e,t){return e=Yt(e),function(n){return ts(e,t,n)}}function Hr(e,t){e=Yt(e);var n=function(r){return t.call(r)};return function(){var r=this[0];if(r)return ts(e,n,r)}}jr.createLayout=jr.makeLayout=jr.layout;var Oe={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(r){return r._private.styleCache=null};return t.hasCompoundNodes()?((e=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(e.connectedEdges()),e.forEach(n)):this.forEach(function(r){n(r),r.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&&e!==void 0),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(a){return a._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&&arguments[1]!==void 0)||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var a=n._private.style[e];return a??(t?r.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?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=!1,a=n.style();if(ve(e)){var o=e;a.applyBypass(this,o,r),this.emitAndNotify("style")}else if(ce(e)){if(t===void 0){var i=this[0];return i?a.getStylePropertyValue(i,e):void 0}a.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(e===void 0){var s=this[0];return s?a.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),a=this;if(e===void 0)for(var o=0;o<a.length;o++){var i=a[o];r.removeAllBypasses(i,n)}else{e=e.split(/\s+/);for(var s=0;s<a.length;s++){var l=a[s];r.removeBypasses(l,e,n)}}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,a=n.pstyle("opacity").value;if(!t)return a;var o=r.data.parent?n.parents():null;if(o)for(var i=0;i<o.length;i++)a*=o[i].pstyle("opacity").value;return a}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();return e?t?e.effectiveOpacity()===0:e.pstyle("opacity").value===0:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function Wa(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 Ha(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var o=this[0],i=a.hasCompoundNodes();if(o){var s=o._private;if(!t(o))return!1;if(o.isNode())return!i||Wa(o,r);var l=s.source,u=s.target;return n(l)&&(!i||Wa(l,n))&&(l===u||n(u)&&(!i||Wa(u,n)))}}}var Cn=Wr("eleTakesUpSpace",function(e){return e.pstyle("display").value==="element"&&e.width()!==0&&(!e.isNode()||e.height()!==0)});Oe.takesUpSpace=Hr("takesUpSpace",Ha({ok:Cn}));var cd=Wr("eleInteractive",function(e){return e.pstyle("events").value==="yes"&&e.pstyle("visibility").value==="visible"&&Cn(e)}),dd=Wr("parentInteractive",function(e){return e.pstyle("visibility").value==="visible"&&Cn(e)});Oe.interactive=Hr("interactive",Ha({ok:cd,parentOk:dd,edgeOkViaNode:Cn})),Oe.noninteractive=function(){var e=this[0];if(e)return!e.interactive()};var hd=Wr("eleVisible",function(e){return e.pstyle("visibility").value==="visible"&&e.pstyle("opacity").pfValue!==0&&Cn(e)}),pd=Cn;Oe.visible=Hr("visible",Ha({ok:hd,edgeOkViaNode:pd})),Oe.hidden=function(){var e=this[0];if(e)return!e.visible()},Oe.isBundledBezier=Hr("isBundledBezier",function(){return!!this.cy().styleEnabled()&&!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace()}),Oe.bypass=Oe.css=Oe.style,Oe.renderedCss=Oe.renderedStyle,Oe.removeBypass=Oe.removeCss=Oe.removeStyle,Oe.pstyle=Oe.parsedStyle;var Vt={};function ns(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],a=t[1];this.on(e.event,r,a)}else if(t.length===1&&Me(t[0])){var o=t[0];this.on(e.event,o)}else if(t.length===0||t.length===1&&ke(t[0])){for(var i=t.length===1?t[0]:null,s=0;s<this.length;s++){var l=this[s],u=!e.ableField||l._private[e.ableField],c=l._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[e.field]=e.value,c&&n.push(l))}var h=this.spawn(n);h.updateStyle(),h.emit(e.event),i&&h.emit(i)}return this}}function Sn(e){Vt[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},Vt[e.on]=ns({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),Vt[e.off]=ns({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}Sn({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),Sn({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),Sn({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),Sn({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),Vt.deselect=Vt.unselect,Vt.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},Sn({field:"active",on:"activate",off:"unactivate"}),Sn({field:"pannable",on:"panify",off:"unpanify"}),Vt.inactive=function(){var e=this[0];if(e)return!e._private.active};var qe={},rs=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var a=this[r];if(a.isNode()){for(var o=!1,i=a.connectedEdges(),s=0;s<i.length;s++){var l=i[s],u=l.source(),c=l.target();if(e.noIncomingEdges&&c===a&&u!==a||e.noOutgoingEdges&&u===a&&c!==a){o=!0;break}}o||n.push(a)}}return this.spawn(n,!0).filter(t)}},as=function(e){return function(t){for(var n=[],r=0;r<this.length;r++){var a=this[r];if(a.isNode())for(var o=a.connectedEdges(),i=0;i<o.length;i++){var s=o[i],l=s.source(),u=s.target();e.outgoing&&l===a?(n.push(s),n.push(u)):e.incoming&&u===a&&(n.push(s),n.push(l))}}return this.spawn(n,!0).filter(t)}},is=function(e){return function(t){for(var n=this,r=[],a={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var i=!1,s=0;s<o.length;s++){var l=o[s],u=l.id();a[u]||(a[u]=!0,r.push(l),i=!0)}if(!i)break;n=o}return this.spawn(r,!0).filter(t)}};function os(e){return function(t){for(var n=[],r=0;r<this.length;r++){var a=this[r]._private[e.attr];a&&n.push(a)}return this.spawn(n,!0).filter(t)}}function ss(e){return function(t){var n=[],r=this._private.cy,a=e||{};ce(t)&&(t=r.$(t));for(var o=0;o<t.length;o++)for(var i=t[o]._private.edges,s=0;s<i.length;s++){var l=i[s],u=l._private.data,c=this.hasElementWithId(u.source)&&t.hasElementWithId(u.target),d=t.hasElementWithId(u.source)&&this.hasElementWithId(u.target);if(c||d){if((a.thisIsSrc||a.thisIsTgt)&&(a.thisIsSrc&&!c||a.thisIsTgt&&!d))continue;n.push(l)}}return this.spawn(n,!0)}}function ls(e){return e=he({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),a=e,o=0;o<r.length;o++)for(var i=r[o]._private,s=i.source,l=s._private.data.id,u=i.data.target,c=s._private.edges,d=0;d<c.length;d++){var h=c[d],g=h._private.data,p=g.target,v=g.source,b=p===u&&v===l,f=l===p&&u===v;(a.codirected&&b||!a.codirected&&(b||f))&&n.push(h)}return this.spawn(n,!0).filter(t)}}qe.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},he(qe,{roots:rs({noIncomingEdges:!0}),leaves:rs({noOutgoingEdges:!0}),outgoers:rt(as({outgoing:!0}),"outgoers"),successors:is({outgoing:!0}),incomers:rt(as({incoming:!0}),"incomers"),predecessors:is({})}),he(qe,{neighborhood:rt(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var a=n[r],o=a.connectedEdges(),i=0;i<o.length;i++){var s=o[i],l=s.source(),u=s.target(),c=a===l?u:l;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)}}),qe.neighbourhood=qe.neighborhood,qe.closedNeighbourhood=qe.closedNeighborhood,qe.openNeighbourhood=qe.openNeighborhood,he(qe,{source:rt(function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t},"source"),target:rt(function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t},"target"),sources:os({attr:"source"}),targets:os({attr:"target"})}),he(qe,{edgesWith:rt(ss(),"edgesWith"),edgesTo:rt(ss({thisIsSrc:!0}),"edgesTo")}),he(qe,{connectedEdges:rt(function(e){for(var t=[],n=0;n<this.length;n++){var r=this[n];if(r.isNode())for(var a=r._private.edges,o=0;o<a.length;o++){var i=a[o];t.push(i)}}return this.spawn(t,!0).filter(e)},"connectedEdges"),connectedNodes:rt(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:rt(ls(),"parallelEdges"),codirectedEdges:rt(ls({codirected:!0}),"codirectedEdges")}),he(qe,{components:function(e){var t=this,n=t.cy(),r=n.collection(),a=e==null?t.nodes():e.nodes(),o=[];e!=null&&a.empty()&&(a=e.sources());var i=function(l,u){r.merge(l),a.unmerge(l),u.merge(l)};if(a.empty())return t.spawn();var s=function(){var l=n.collection();o.push(l);var u=a[0];i(u,l),t.bfs({directed:!1,roots:u,visit:function(c){return i(c,l)}}),l.forEach(function(c){c.connectedEdges().forEach(function(d){t.has(d)&&l.has(d.source())&&l.has(d.target())&&l.merge(d)})})};do s();while(a.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),qe.componentsOf=qe.components;var Ve=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(e!==void 0){var a=new yt,o=!1;if(t){if(t.length>0&&ve(t[0])&&!Ln(t[0])){o=!0;for(var i=[],s=new ln,l=0,u=t.length;l<u;l++){var c=t[l];c.data==null&&(c.data={});var d=c.data;if(d.id==null)d.id=Ri();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var h=new vr(e,c,!1);i.push(h),s.add(d.id)}t=i}}else t=[];this.length=0;for(var g=0,p=t.length;g<p;g++){var v=t[g][0];if(v!=null){var b=v._private.data.id;n&&a.has(b)||(n&&a.set(b,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(f){this.lazyMap=f},rebuildMap:function(){for(var f=this.lazyMap=new yt,y=this.eles,m=0;m<y.length;m++){var k=y[m];f.set(k.id(),{index:m,ele:k})}}},n&&(this._private.map=a),o&&!r&&this.restore()}else Be("A collection must have a reference to the core")},Ce=vr.prototype=Ve.prototype=Object.create(Array.prototype);Ce.instanceString=function(){return"collection"},Ce.spawn=function(e,t){return new Ve(this.cy(),e,t)},Ce.spawnSelf=function(){return this.spawn(this)},Ce.cy=function(){return this._private.cy},Ce.renderer=function(){return this._private.cy.renderer()},Ce.element=function(){return this[0]},Ce.collection=function(){return bi(this)?this:new Ve(this._private.cy,[this])},Ce.unique=function(){return new Ve(this._private.cy,this,!0)},Ce.hasElementWithId=function(e){return e=""+e,this._private.map.has(e)},Ce.getElementById=function(e){e=""+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new Ve(t)},Ce.$id=Ce.getElementById,Ce.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},Ce.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},Ce.indexOfId=function(e){return e=""+e,this._private.map.get(e).index},Ce.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(ve(e)){if(n.startBatch(),e.data){t.data(e.data);var a=r.data;if(t.isEdge()){var o=!1,i={},s=e.data.source,l=e.data.target;s!=null&&s!=a.source&&(i.source=""+s,o=!0),l!=null&&l!=a.target&&(i.target=""+l,o=!0),o&&(t=t.move(i))}else{var u="parent"in e.data,c=e.data.parent;!u||c==null&&a.parent==null||c==a.parent||(c===void 0&&(c=null),c!=null&&(c=""+c),t=t.move({parent:c}))}}e.position&&t.position(e.position);var d=function(p,v,b){var f=e[p];f!=null&&f!==r[p]&&(f?t[v]():t[b]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}if(e===void 0){var h={data:vt(r.data),position:vt(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.classes="";var g=0;return r.classes.forEach(function(p){return h.classes+=g++===0?p:" "+p}),h}}},Ce.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},Ce.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=this[n].json(),a=new vr(e,r,!1);t.push(a)}return new Ve(e,t)},Ce.copy=Ce.clone,Ce.restore=function(){for(var e,t,n=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],a=this,o=a.cy(),i=o._private,s=[],l=[],u=0,c=a.length;u<c;u++){var d=a[u];r&&!d.removed()||(d.isNode()?s.push(d):l.push(d))}e=s.concat(l);var h=function(){e.splice(t,1),t--};for(t=0;t<e.length;t++){var g=e[t],p=g._private,v=p.data;if(g.clearTraversalCache(),r||p.removed)if(v.id===void 0)v.id=Ri();else if(te(v.id))v.id=""+v.id;else{if(Tt(v.id)||!ce(v.id)){Be("Can not create element with invalid string ID `"+v.id+"`"),h();continue}if(o.hasElementWithId(v.id)){Be("Can not create second element with ID `"+v.id+"`"),h();continue}}var b=v.id;if(g.isNode()){var f=p.position;f.x==null&&(f.x=0),f.y==null&&(f.y=0)}if(g.isEdge()){for(var y=g,m=["source","target"],k=m.length,x=!1,S=0;S<k;S++){var w=m[S],D=v[w];te(D)&&(D=v[w]=""+v[w]),D==null||D===""?(Be("Can not create edge `"+b+"` with unspecified "+w),x=!0):o.hasElementWithId(D)||(Be("Can not create edge `"+b+"` with nonexistant "+w+" `"+D+"`"),x=!0)}if(x){h();continue}var E=o.getElementById(v.source),P=o.getElementById(v.target);E.same(P)?E._private.edges.push(y):(E._private.edges.push(y),P._private.edges.push(y)),y._private.source=E,y._private.target=P}p.map=new yt,p.map.set(b,{ele:g,index:0}),p.removed=!1,r&&o.addToPool(g)}for(var T=0;T<s.length;T++){var B=s[T],M=B._private.data;te(M.parent)&&(M.parent=""+M.parent);var z=M.parent;if(z!=null||B._private.parent){var R=B._private.parent?o.collection().merge(B._private.parent):o.getElementById(z);if(R.empty())M.parent=void 0;else if(R[0].removed())we("Node added with missing parent, reference to parent removed"),M.parent=void 0,B._private.parent=null;else{for(var F=!1,N=R;!N.empty();){if(B.same(N)){F=!0,M.parent=void 0;break}N=N.parent()}F||(R[0]._private.children.push(B),B._private.parent=R[0],i.hasCompoundNodes=!0)}}}if(e.length>0){for(var I=e.length===a.length?a:new Ve(o,e),X=0;X<I.length;X++){var O=I[X];O.isNode()||(O.parallelEdges().clearTraversalCache(),O.source().clearTraversalCache(),O.target().clearTraversalCache())}(i.hasCompoundNodes?o.collection().merge(I).merge(I.connectedNodes()).merge(I.parent()):I).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(n),n?I.emitAndNotify("add"):r&&I.emit("add")}return a},Ce.removed=function(){var e=this[0];return e&&e._private.removed},Ce.inside=function(){var e=this[0];return e&&!e._private.removed},Ce.remove=function(){var e=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0],t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this,r=[],a={},o=n._private.cy;function i(P){var T=a[P.id()];t&&P.removed()||T||(a[P.id()]=!0,P.isNode()?(r.push(P),function(B){for(var M=B._private.edges,z=0;z<M.length;z++)i(M[z])}(P),function(B){for(var M=B._private.children,z=0;z<M.length;z++)i(M[z])}(P)):r.unshift(P))}for(var s=0,l=n.length;s<l;s++)i(n[s]);function u(P,T){var B=P._private.edges;Bt(B,T),P.clearTraversalCache()}function c(P){P.clearTraversalCache()}var d=[];function h(P,T){T=T[0];var B=(P=P[0])._private.children,M=P.id();Bt(B,T),T._private.parent=null,d.ids[M]||(d.ids[M]=!0,d.push(P))}d.ids={},n.dirtyCompoundBoundsCache(),t&&o.removeFromPool(r);for(var g=0;g<r.length;g++){var p=r[g];if(p.isEdge()){var v=p.source()[0],b=p.target()[0];u(v,p),u(b,p);for(var f=p.parallelEdges(),y=0;y<f.length;y++){var m=f[y];c(m),m.isBundledBezier()&&m.dirtyBoundingBoxCache()}}else{var k=p.parent();k.length!==0&&h(k,p)}t&&(p._private.removed=!0)}var x=o._private.elements;o._private.hasCompoundNodes=!1;for(var S=0;S<x.length;S++)if(x[S].isParent()){o._private.hasCompoundNodes=!0;break}var w=new Ve(this.cy(),r);w.size()>0&&(e?w.emitAndNotify("remove"):t&&w.emit("remove"));for(var D=0;D<d.length;D++){var E=d[D];t&&E.removed()||E.updateStyle()}return w},Ce.move=function(e){var t=this._private.cy,n=this,r=!1,a=!1,o=function(h){return h==null?h:""+h};if(e.source!==void 0||e.target!==void 0){var i=o(e.source),s=o(e.target),l=i!=null&&t.hasElementWithId(i),u=s!=null&&t.hasElementWithId(s);(l||u)&&(t.batch(function(){n.remove(r,a),n.emitAndNotify("moveout");for(var h=0;h<n.length;h++){var g=n[h],p=g._private.data;g.isEdge()&&(l&&(p.source=i),u&&(p.target=s))}n.restore(r,a)}),n.emitAndNotify("move"))}else if(e.parent!==void 0){var c=o(e.parent);if(c===null||t.hasElementWithId(c)){var d=c===null?void 0:c;t.batch(function(){var h=n.remove(r,a);h.emitAndNotify("moveout");for(var g=0;g<n.length;g++){var p=n[g],v=p._private.data;p.isNode()&&(v.parent=d)}h.restore(r,a)}),n.emitAndNotify("move")}}return this},[co,Hc,Nr,It,wn,Jc,Or,id,Qo,Jo,{isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},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}},Yr,jr,Oe,Vt,qe].forEach(function(e){he(Ce,e)});var fd={add:function(e){var t,n=this;if(tt(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var a=[],o=0;o<r.length;o++){var i=r[o];a.push(i.json())}t=new Ve(n,a)}}else if(ke(e))t=new Ve(n,e);else if(ve(e)&&(ke(e.nodes)||ke(e.edges))){for(var s=e,l=[],u=["nodes","edges"],c=0,d=u.length;c<d;c++){var h=u[c],g=s[h];if(ke(g))for(var p=0,v=g.length;p<v;p++){var b=he({group:h},g[p]);l.push(b)}}t=new Ve(n,l)}else t=new vr(n,e).collection();return t},remove:function(e){if(!tt(e)){if(ce(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function gd(e,t,n,r){var a=.1,o=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var i=0;i<4;++i)if(typeof arguments[i]!="number"||isNaN(arguments[i])||!isFinite(arguments[i]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var s=o?new Float32Array(11):new Array(11);function l(y,m){return 1-3*m+3*y}function u(y,m){return 3*m-6*y}function c(y){return 3*y}function d(y,m,k){return((l(m,k)*y+u(m,k))*y+c(m))*y}function h(y,m,k){return 3*l(m,k)*y*y+2*u(m,k)*y+c(m)}function g(y){for(var m=0,k=1;k!==10&&s[k]<=y;++k)m+=a;--k;var x=m+(y-s[k])/(s[k+1]-s[k])*a,S=h(x,e,n);return S>=.001?function(w,D){for(var E=0;E<4;++E){var P=h(D,e,n);if(P===0)return D;D-=(d(D,e,n)-w)/P}return D}(y,x):S===0?x:function(w,D,E){var P,T,B=0;do(P=d(T=D+(E-D)/2,e,n)-w)>0?E=T:D=T;while(Math.abs(P)>1e-7&&++B<10);return T}(y,m,m+a)}var p=!1;function v(){p=!0,e===t&&n===r||function(){for(var y=0;y<11;++y)s[y]=d(y*a,e,n)}()}var b=function(y){return p||v(),e===t&&n===r?y:y===0?0:y===1?1:d(g(y),t,r)};b.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var f="generateBezier("+[e,t,n,r]+")";return b.toString=function(){return f},b}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var vd=function(){function e(r){return-r.tension*r.x-r.friction*r.v}function t(r,a,o){var i={x:r.x+o.dx*a,v:r.v+o.dv*a,tension:r.tension,friction:r.friction};return{dx:i.v,dv:e(i)}}function n(r,a){var o={dx:r.v,dv:e(r)},i=t(r,.5*a,o),s=t(r,.5*a,i),l=t(r,a,s),u=1/6*(o.dx+2*(i.dx+s.dx)+l.dx),c=1/6*(o.dv+2*(i.dv+s.dv)+l.dv);return r.x=r.x+u*a,r.v=r.v+c*a,r}return function r(a,o,i){var s,l,u,c={x:-1,v:0,tension:null,friction:null},d=[0],h=0,g=1e-4;for(a=parseFloat(a)||500,o=parseFloat(o)||20,i=i||null,c.tension=a,c.friction=o,l=(s=i!==null)?(h=r(a,o))/i*.016:.016;u=n(u||c,l),d.push(1+u.x),h+=16,Math.abs(u.x)>g&&Math.abs(u.v)>g;);return s?function(p){return d[p*(d.length-1)|0]}:h}}(),Se=function(e,t,n,r){var a=gd(e,t,n,r);return function(o,i,s){return o+(i-o)*a(s)}},Kr={linear:function(e,t,n){return e+(t-e)*n},ease:Se(.25,.1,.25,1),"ease-in":Se(.42,0,1,1),"ease-out":Se(0,0,.58,1),"ease-in-out":Se(.42,0,.58,1),"ease-in-sine":Se(.47,0,.745,.715),"ease-out-sine":Se(.39,.575,.565,1),"ease-in-out-sine":Se(.445,.05,.55,.95),"ease-in-quad":Se(.55,.085,.68,.53),"ease-out-quad":Se(.25,.46,.45,.94),"ease-in-out-quad":Se(.455,.03,.515,.955),"ease-in-cubic":Se(.55,.055,.675,.19),"ease-out-cubic":Se(.215,.61,.355,1),"ease-in-out-cubic":Se(.645,.045,.355,1),"ease-in-quart":Se(.895,.03,.685,.22),"ease-out-quart":Se(.165,.84,.44,1),"ease-in-out-quart":Se(.77,0,.175,1),"ease-in-quint":Se(.755,.05,.855,.06),"ease-out-quint":Se(.23,1,.32,1),"ease-in-out-quint":Se(.86,0,.07,1),"ease-in-expo":Se(.95,.05,.795,.035),"ease-out-expo":Se(.19,1,.22,1),"ease-in-out-expo":Se(1,0,0,1),"ease-in-circ":Se(.6,.04,.98,.335),"ease-out-circ":Se(.075,.82,.165,1),"ease-in-out-circ":Se(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return Kr.linear;var r=vd(e,t,n);return function(a,o,i){return a+(o-a)*r(i)}},"cubic-bezier":Se};function us(e,t,n,r,a){if(r===1||t===n)return n;var o=a(t,n,r);return e==null||((e.roundValue||e.color)&&(o=Math.round(o)),e.min!==void 0&&(o=Math.max(o,e.min)),e.max!==void 0&&(o=Math.min(o,e.max))),o}function cs(e,t){return e.pfValue!=null||e.value!=null?e.pfValue==null||t!=null&&t.type.units==="%"?e.value:e.pfValue:e}function Pn(e,t,n,r,a){var o=a!=null?a.type:null;n<0?n=0:n>1&&(n=1);var i=cs(e,a),s=cs(t,a);if(te(i)&&te(s))return us(o,i,s,n,r);if(ke(i)&&ke(s)){for(var l=[],u=0;u<s.length;u++){var c=i[u],d=s[u];if(c!=null&&d!=null){var h=us(o,c,d,n,r);l.push(h)}else l.push(d)}return l}}function yd(e,t,n,r){var a=!r,o=e._private,i=t._private,s=i.easing,l=i.startTime,u=(r?e:e.cy()).style();if(!i.easingImpl)if(s==null)i.easingImpl=Kr.linear;else{var c,d,h;ce(s)?c=u.parse("transition-timing-function",s).value:c=s,ce(c)?(d=c,h=[]):(d=c[1],h=c.slice(2).map(function(F){return+F})),h.length>0?(d==="spring"&&h.push(i.duration),i.easingImpl=Kr[d].apply(null,h)):i.easingImpl=Kr[d]}var g,p=i.easingImpl;if(g=i.duration===0?1:(n-l)/i.duration,i.applying&&(g=i.progress),g<0?g=0:g>1&&(g=1),i.delay==null){var v=i.startPosition,b=i.position;if(b&&a&&!e.locked()){var f={};er(v.x,b.x)&&(f.x=Pn(v.x,b.x,g,p)),er(v.y,b.y)&&(f.y=Pn(v.y,b.y,g,p)),e.position(f)}var y=i.startPan,m=i.pan,k=o.pan,x=m!=null&&r;x&&(er(y.x,m.x)&&(k.x=Pn(y.x,m.x,g,p)),er(y.y,m.y)&&(k.y=Pn(y.y,m.y,g,p)),e.emit("pan"));var S=i.startZoom,w=i.zoom,D=w!=null&&r;D&&(er(S,w)&&(o.zoom=jn(o.minZoom,Pn(S,w,g,p),o.maxZoom)),e.emit("zoom")),(x||D)&&e.emit("viewport");var E=i.style;if(E&&E.length>0&&a){for(var P=0;P<E.length;P++){var T=E[P],B=T.name,M=T,z=i.startStyle[B],R=Pn(z,M,g,p,u.properties[z.name]);u.overrideBypass(e,B,R)}e.emit("style")}}return i.progress=g,g}function er(e,t){return e!=null&&t!=null&&(!(!te(e)||!te(t))||!(!e||!t))}function md(e,t,n,r){var a=t._private;a.started=!0,a.startTime=n-a.progress*a.duration}function ds(e,t){var n=t._private.aniEles,r=[];function a(u,c){var d=u._private,h=d.animation.current,g=d.animation.queue,p=!1;if(h.length===0){var v=g.shift();v&&h.push(v)}for(var b=function(k){for(var x=k.length-1;x>=0;x--)(0,k[x])();k.splice(0,k.length)},f=h.length-1;f>=0;f--){var y=h[f],m=y._private;m.stopped?(h.splice(f,1),m.hooked=!1,m.playing=!1,m.started=!1,b(m.frames)):(m.playing||m.applying)&&(m.playing&&m.applying&&(m.applying=!1),m.started||md(0,y,e),yd(u,y,e,c),m.applying&&(m.applying=!1),b(m.frames),m.step!=null&&m.step(e),y.completed()&&(h.splice(f,1),m.hooked=!1,m.playing=!1,m.started=!1,b(m.completes)),p=!0)}return c||h.length!==0||g.length!==0||r.push(u),p}for(var o=!1,i=0;i<n.length;i++){var s=a(n[i]);o=o||s}var l=a(t,!0);(o||l)&&(n.length>0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var bd={animate:Ee.animate(),animation:Ee.animation(),animated:Ee.animated(),clearQueue:Ee.clearQueue(),delay:Ee.delay(),delayAnimation:Ee.delayAnimation(),stop:Ee.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(n,r){ds(r,e)},t.beforeRenderPriorities.animations):function n(){e._private.animationsRunning&&pr(function(r){ds(r,e),n()})}()}}},xd={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null||e!==n.target&&Ln(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},Gr=function(e){return ce(e)?new Lt(e):e},hs={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Xr(xd,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Gr(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Gr(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Gr(t),n),this},once:function(e,t,n){return this.emitter().one(e,Gr(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}};Ee.eventAliasesOn(hs);var Ka={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ka.jpeg=Ka.jpg;var Ur={layout:function(e){var t=this;if(e!=null)if(e.name!=null){var n=e.name,r=t.extension("layout",n);if(r!=null){var a;a=ce(e.eles)?t.$(e.eles):e.eles!=null?e.eles:t.$();var o=new r(he({},e,{cy:t,eles:a}));return o}Be("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Be("A `name` must be specified to make a layout");else Be("Layout options must be specified to make a layout")}};Ur.createLayout=Ur.makeLayout=Ur.layout;var wd={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();t!=null&&r.merge(t)}else if(n.notificationsEnabled){var a=this.renderer();!this.destroyed()&&a&&a.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?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 e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){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 a=n[r],o=e[a];t.getElementById(a).data(o)}})}},Ed=Re({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1}),Ga={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,n=t.extension("renderer",e.name);if(n!=null){e.wheelSensitivity!==void 0&&we("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 r=Ed(e);r.cy=t,t._private.renderer=new n(r),this.notify("init")}else Be("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var r=n._private;r.rscratch={},r.rstyle={},r.animation.current=[],r.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Ga.invalidateDimensions=Ga.resize;var Zr={collection:function(e,t){return ce(e)?this.$(e):tt(e)?e.collection():ke(e)?(t||(t={}),new Ve(this,e,t.unique,t.removed)):new Ve(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.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}};Zr.elements=Zr.filter=Zr.$;var Ye={},tr="t";Ye.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var a=e[r],o=t.getContextMeta(a);if(!o.empty){var i=t.getContextStyle(o),s=t.applyContextStyle(o,i,a);a._private.appliedInitStyle?t.updateTransitions(a,s.diffProps):a._private.appliedInitStyle=!0,t.updateStyleHints(a)&&n.push(a)}}return n},Ye.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},a=e+"-"+t,o=r[a];if(o)return o;for(var i=[],s={},l=0;l<n.length;l++){var u=n[l],c=e[l]===tr,d=t[l]===tr,h=c!==d,g=u.mappedProperties.length>0;if(h||d&&g){var p=void 0;h&&g||h?p=u.properties:g&&(p=u.mappedProperties);for(var v=0;v<p.length;v++){for(var b=p[v],f=b.name,y=!1,m=l+1;m<n.length;m++){var k=n[m];if(t[m]===tr&&(y=k.properties[b.name]!=null))break}s[f]||y||(s[f]=!0,i.push(f))}}}return r[a]=i,i},Ye.getContextMeta=function(e){for(var t,n=this,r="",a=e._private.styleCxtKey||"",o=0;o<n.length;o++){var i=n[o];r+=i.selector&&i.selector.matches(e)?tr:"f"}return t=n.getPropertiesDiff(a,r),e._private.styleCxtKey=r,{key:r,diffPropNames:t,empty:t.length===0}},Ye.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}},a=0;a<this.length;a++){var o=this[a];if(t[a]===tr)for(var i=0;i<o.properties.length;i++){var s=o.properties[i];r[s.name]=s}}return n[t]=r,r},Ye.applyContextStyle=function(e,t,n){for(var r=e.diffPropNames,a={},o=this.types,i=0;i<r.length;i++){var s=r[i],l=t[s],u=n.pstyle(s);if(!l){if(!u)continue;l=u.bypass?{name:s,deleteBypassed:!0}:{name:s,delete:!0}}if(u!==l){if(l.mapped===o.fn&&u!=null&&u.mapping!=null&&u.mapping.value===l.value){var c=u.mapping;if((c.fnValue=l.value(n))===c.prevFnValue)continue}var d=a[s]={prev:u};this.applyParsedProperty(n,l),d.next=n.pstyle(s),d.next&&d.next.bypass&&(d.next=d.next.bypassed)}}return{diffProps:a}},Ye.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,a=n.propertyGroupKeys,o=function(ae,de,ue){return n.getPropertiesHash(ae,de,ue)},i=t.styleKey;if(e.removed())return!1;var s=t.group==="nodes",l=e._private.style;r=Object.keys(l);for(var u=0;u<a.length;u++){var c=a[u];t.styleKeys[c]=[sn,Vn]}for(var d=function(ae,de){return t.styleKeys[de][0]=Fn(ae,t.styleKeys[de][0])},h=function(ae,de){return t.styleKeys[de][1]=Xn(ae,t.styleKeys[de][1])},g=function(ae,de){d(ae,de),h(ae,de)},p=function(ae,de){for(var ue=0;ue<ae.length;ue++){var Q=ae.charCodeAt(ue);d(Q,de),h(Q,de)}},v=function(ae){return-128<ae&&ae<128&&Math.floor(ae)!==ae?2e9-(1024*ae|0):ae},b=0;b<r.length;b++){var f=r[b],y=l[f];if(y!=null){var m=this.properties[f],k=m.type,x=m.groupKey,S=void 0;m.hashOverride!=null?S=m.hashOverride(e,y):y.pfValue!=null&&(S=y.pfValue);var w=m.enums==null?y.value:null,D=S!=null,E=D||w!=null,P=y.units;k.number&&E&&!k.multiple?(g(v(D?S:w),x),D||P==null||p(P,x)):p(y.strValue,x)}}for(var T,B,M=[sn,Vn],z=0;z<a.length;z++){var R=a[z],F=t.styleKeys[R];M[0]=Fn(F[0],M[0]),M[1]=Xn(F[1],M[1])}t.styleKey=(T=M[0],B=M[1],2097152*T+B);var N=t.styleKeys;t.labelDimsKey=Mt(N.labelDimensions);var I=o(e,["label"],N.labelDimensions);if(t.labelKey=Mt(I),t.labelStyleKey=Mt(fr(N.commonLabel,I)),!s){var X=o(e,["source-label"],N.labelDimensions);t.sourceLabelKey=Mt(X),t.sourceLabelStyleKey=Mt(fr(N.commonLabel,X));var O=o(e,["target-label"],N.labelDimensions);t.targetLabelKey=Mt(O),t.targetLabelStyleKey=Mt(fr(N.commonLabel,O))}if(s){var Y=t.styleKeys,j=Y.nodeBody,G=Y.nodeBorder,W=Y.nodeOutline,q=Y.backgroundImage,K=Y.compound,U=Y.pie,re=[j,G,W,q,K,U].filter(function(ae){return ae!=null}).reduce(fr,[sn,Vn]);t.nodeKey=Mt(re),t.hasPie=U!=null&&U[0]!==sn&&U[1]!==Vn}return i!==t.styleKey},Ye.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},Ye.applyParsedProperty=function(e,t){var n,r=this,a=t,o=e._private.style,i=r.types,s=r.properties[a.name].type,l=a.bypass,u=o[a.name],c=u&&u.bypass,d=e._private,h="mapping",g=function(O){return O==null?null:O.pfValue!=null?O.pfValue:O.value},p=function(){var O=g(u),Y=g(a);r.checkTriggers(e,a.name,O,Y)};if(t.name==="curve-style"&&e.isEdge()&&(t.value!=="bezier"&&e.isLoop()||t.value==="haystack"&&(e.source().isParent()||e.target().isParent()))&&(a=t=this.parse(t.name,"bezier",l)),a.delete)return o[a.name]=void 0,p(),!0;if(a.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,p(),!0):(p(),!0);if(a.deleteBypass)return u?!!u.bypass&&(o[a.name]=u.bypassed,p(),!0):(p(),!0);var v=function(){we("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+a.name+"` with data field `"+a.field+"`); try a `["+a.field+"]` selector to limit scope to elements with `"+a.field+"` defined")};switch(a.mapped){case i.mapData:for(var b,f=a.field.split("."),y=d.data,m=0;m<f.length&&y;m++)y=y[f[m]];if(y==null)return v(),!1;if(!te(y))return we("Do not use continuous mappers without specifying numeric data (i.e. `"+a.field+": "+y+"` for `"+e.id()+"` is non-numeric)"),!1;var k=a.fieldMax-a.fieldMin;if((b=k===0?0:(y-a.fieldMin)/k)<0?b=0:b>1&&(b=1),s.color){var x=a.valueMin[0],S=a.valueMax[0],w=a.valueMin[1],D=a.valueMax[1],E=a.valueMin[2],P=a.valueMax[2],T=a.valueMin[3]==null?1:a.valueMin[3],B=a.valueMax[3]==null?1:a.valueMax[3],M=[Math.round(x+(S-x)*b),Math.round(w+(D-w)*b),Math.round(E+(P-E)*b),Math.round(T+(B-T)*b)];n={bypass:a.bypass,name:a.name,value:M,strValue:"rgb("+M[0]+", "+M[1]+", "+M[2]+")"}}else{if(!s.number)return!1;var z=a.valueMin+(a.valueMax-a.valueMin)*b;n=this.parse(a.name,z,a.bypass,h)}if(!n)return v(),!1;n.mapping=a,a=n;break;case i.data:for(var R=a.field.split("."),F=d.data,N=0;N<R.length&&F;N++)F=F[R[N]];if(F!=null&&(n=this.parse(a.name,F,a.bypass,h)),!n)return v(),!1;n.mapping=a,a=n;break;case i.fn:var I=a.value,X=a.fnValue!=null?a.fnValue:I(e);if(a.prevFnValue=X,X==null)return we("Custom function mappers may not return null (i.e. `"+a.name+"` for ele `"+e.id()+"` is null)"),!1;if(!(n=this.parse(a.name,X,a.bypass,h)))return we("Custom function mappers may not return invalid values for the property type (i.e. `"+a.name+"` for ele `"+e.id()+"` is invalid)"),!1;n.mapping=vt(a),a=n;break;case void 0:break;default:return!1}return l?(a.bypassed=c?u.bypassed:u,o[a.name]=a):c?u.bypassed=a:o[a.name]=a,p(),!0},Ye.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 a=r._private.style,o=Object.keys(a),i=0;i<o.length;i++){var s=o[i],l=a[s];l!=null&&(l.bypass?l.bypassed=null:a[s]=null)}else r._private.style={}}},Ye.update=function(){this._private.cy.mutableElements().updateStyle()},Ye.updateTransitions=function(e,t){var n=this,r=e._private,a=e.pstyle("transition-property").value,o=e.pstyle("transition-duration").pfValue,i=e.pstyle("transition-delay").pfValue;if(a.length>0&&o>0){for(var s={},l=!1,u=0;u<a.length;u++){var c=a[u],d=e.pstyle(c),h=t[c];if(h){var g=h.prev,p=h.next!=null?h.next:d,v=!1,b=void 0,f=1e-6;g&&(te(g.pfValue)&&te(p.pfValue)?(v=p.pfValue-g.pfValue,b=g.pfValue+f*v):te(g.value)&&te(p.value)?(v=p.value-g.value,b=g.value+f*v):ke(g.value)&&ke(p.value)&&(v=g.value[0]!==p.value[0]||g.value[1]!==p.value[1]||g.value[2]!==p.value[2],b=g.strValue),v&&(s[c]=p.strValue,this.applyBypass(e,c,b),l=!0))}}if(!l)return;r.transitioning=!0,new gn(function(y){i>0?e.delayAnimation(i).play().promise().then(y):y()}).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,a),e.emitAndNotify("style"),r.transitioning=!1})}else r.transitioning&&(this.removeBypasses(e,a),e.emitAndNotify("style"),r.transitioning=!1)},Ye.checkTrigger=function(e,t,n,r,a,o){var i=this.properties[t],s=a(i);s!=null&&s(n,r)&&o(i)},Ye.checkZOrderTrigger=function(e,t,n,r){var a=this;this.checkTrigger(e,t,n,r,function(o){return o.triggersZOrder},function(){a._private.cy.notify("zorder",e)})},Ye.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(a){return a.triggersBounds},function(a){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!a.triggersBoundsOfParallelBeziers||t!=="curve-style"||n!=="bezier"&&r!=="bezier"||e.parallelEdges().forEach(function(o){o.isBundledBezier()&&o.dirtyBoundingBoxCache()}),!a.triggersBoundsOfConnectedEdges||t!=="display"||n!=="none"&&r!=="none"||e.connectedEdges().forEach(function(o){o.dirtyBoundingBoxCache()})})},Ye.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var kd={applyBypass:function(e,t,n,r){var a=[];if(t==="*"||t==="**"){if(n!==void 0)for(var o=0;o<this.properties.length;o++){var i=this.properties[o].name,s=this.parse(i,n,!0);s&&a.push(s)}}else if(ce(t)){var l=this.parse(t,n,!0);l&&a.push(l)}else{if(!ve(t))return!1;var u=t;r=n;for(var c=Object.keys(u),d=0;d<c.length;d++){var h=c[d],g=u[h];if(g===void 0&&(g=u[cr(h)]),g!==void 0){var p=this.parse(h,g,!0);p&&a.push(p)}}}if(a.length===0)return!1;for(var v=!1,b=0;b<e.length;b++){for(var f=e[b],y={},m=void 0,k=0;k<a.length;k++){var x=a[k];if(r){var S=f.pstyle(x.name);m=y[x.name]={prev:S}}v=this.applyParsedProperty(f,vt(x))||v,r&&(m.next=f.pstyle(x.name))}v&&this.updateStyleHints(f),r&&this.updateTransitions(f,y,!0)}return v},overrideBypass:function(e,t,n){t=oa(t);for(var r=0;r<e.length;r++){var a=e[r],o=a._private.style[t],i=this.properties[t].type,s=i.color,l=i.mutiple,u=o?o.pfValue!=null?o.pfValue:o.value:null;o&&o.bypass?(o.value=n,o.pfValue!=null&&(o.pfValue=n),o.strValue=s?"rgb("+n.join(",")+")":l?n.join(" "):""+n,this.updateStyleHints(a)):this.applyBypass(a,t,n),this.checkTriggers(a,t,u,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 a=e[r],o={},i=0;i<t.length;i++){var s=t[i],l=this.properties[s],u=a.pstyle(l.name);if(u&&u.bypass){var c=this.parse(s,"",!0),d=o[l.name]={prev:u};this.applyParsedProperty(a,c),d.next=a.pstyle(l.name)}}this.updateStyleHints(a),n&&this.updateTransitions(a,o,!0)}}},Cd={getEmSizeInPixels:function(){var e=this.containerCss("font-size");return e!=null?parseFloat(e):1},containerCss:function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)}},Ua={getRenderedStyle:function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},getRawStyle:function(e,t){var n=this;if(e=e[0]){for(var r={},a=0;a<n.properties.length;a++){var o=n.properties[a],i=n.getStylePropertyValue(e,o.name,t);i!=null&&(r[o.name]=i,r[cr(o.name)]=i)}return r}},getIndexedStyle:function(e,t,n,r){var a=e.pstyle(t)[n][r];return a??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 a=r.type,o=e.pstyle(r.name);if(o){var i=o.value,s=o.units,l=o.strValue;if(n&&a.number&&i!=null&&te(i)){var u=e.cy().zoom(),c=function(g){return g*u},d=function(g,p){return c(g)+p},h=ke(i);return(h?s.every(function(g){return g!=null}):s!=null)?h?i.map(function(g,p){return d(g,s[p])}).join(" "):d(i,s):h?i.map(function(g){return ce(g)?g:""+c(g)}).join(" "):""+c(i)}if(l!=null)return l}return null}},getAnimationStartStyle:function(e,t){for(var n={},r=0;r<t.length;r++){var a=t[r].name,o=e.pstyle(a);o!==void 0&&(o=ve(o)?this.parse(a,o.strValue):this.parse(a,o)),o&&(n[a]=o)}return n},getPropsList:function(e){var t=[],n=e,r=this.properties;if(n)for(var a=Object.keys(n),o=0;o<a.length;o++){var i=a[o],s=n[i],l=r[i]||r[oa(i)],u=this.parse(l.name,s);u&&t.push(u)}return t},getNonDefaultPropertiesHash:function(e,t,n){var r,a,o,i,s,l,u=n.slice();for(s=0;s<t.length;s++)if(r=t[s],(a=e.pstyle(r,!1))!=null)if(a.pfValue!=null)u[0]=Fn(i,u[0]),u[1]=Xn(i,u[1]);else for(o=a.strValue,l=0;l<o.length;l++)i=o.charCodeAt(l),u[0]=Fn(i,u[0]),u[1]=Xn(i,u[1]);return u}};Ua.getPropertiesHash=Ua.getNonDefaultPropertiesHash;var Sd={appendFromJson:function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],a=r.selector,o=r.style||r.css,i=Object.keys(o);t.selector(a);for(var s=0;s<i.length;s++){var l=i[s],u=o[l];t.css(l,u)}}return t},fromJson:function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},json:function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,a=n.properties,o={},i=0;i<a.length;i++){var s=a[i];o[s.name]=s.strValue}e.push({selector:r?r.toString():"core",style:o})}return e}},Pd={appendFromString:function(e){var t,n,r,a=this,o=""+e;function i(){o=o.length>t.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){we("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if(u!=="core"&&new Lt(u).invalid){we("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),i();continue}var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var g=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){we("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=g[0];var p=g[1],v=g[2];this.properties[p]?a.parse(p,v)?(h.push({name:p,val:v}),s()):(we("Skipping property: Invalid property definition in: "+r),s()):(we("Skipping property: Invalid property name in: "+r),s())}if(d){i();break}a.selector(u);for(var b=0;b<h.length;b++){var f=h[b];a.css(f.name,f.val)}i()}return a},fromString:function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t}},Fe={};(function(){var e=Le,t=vl,n=ml,r=function(q){return"^"+q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},a=function(q){var K=e+"|\\w+|"+t+"|"+n+"|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+e+")\\s*\\,\\s*("+e+")\\s*,\\s*("+K+")\\s*\\,\\s*("+K+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Fe.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},nonNegativeNumber:{number:!0,min: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","null"],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"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},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","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},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"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},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:r("data")},layoutData:{mapping:!0,regex:r("layoutData")},scratch:{mapping:!0,regex:r("scratch")},mapData:{mapping:!0,regex:a("mapData")},mapLayoutData:{mapping:!0,regex:a("mapLayoutData")},mapScratch:{mapping:!0,regex:a("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:o,singleRegexMatchValue:!0},urls:{regexes:o,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","endpoints"]},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(q,K){switch(q.length){case 2:return K[0]!=="deg"&&K[0]!=="rad"&&K[1]!=="deg"&&K[1]!=="rad";case 1:return ce(q[0])||K[0]==="deg"||K[0]==="rad";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(q){var K=q.length;return K===1||K===2||K===4}}};var i={zeroNonZero:function(q,K){return(q==null||K==null)&&q!==K||q==0&&K!=0||q!=0&&K==0},any:function(q,K){return q!=K},emptyNonEmpty:function(q,K){var U=Tt(q),re=Tt(K);return U&&!re||!U&&re}},s=Fe.types,l=[{name:"label",type:s.text,triggersBounds:i.any,triggersZOrder:i.emptyNonEmpty},{name:"text-rotation",type:s.textRotation,triggersBounds:i.any},{name:"text-margin-x",type:s.bidirectionalSize,triggersBounds:i.any},{name:"text-margin-y",type:s.bidirectionalSize,triggersBounds:i.any}],u=[{name:"source-label",type:s.text,triggersBounds:i.any},{name:"source-text-rotation",type:s.textRotation,triggersBounds:i.any},{name:"source-text-margin-x",type:s.bidirectionalSize,triggersBounds:i.any},{name:"source-text-margin-y",type:s.bidirectionalSize,triggersBounds:i.any},{name:"source-text-offset",type:s.size,triggersBounds:i.any}],c=[{name:"target-label",type:s.text,triggersBounds:i.any},{name:"target-text-rotation",type:s.textRotation,triggersBounds:i.any},{name:"target-text-margin-x",type:s.bidirectionalSize,triggersBounds:i.any},{name:"target-text-margin-y",type:s.bidirectionalSize,triggersBounds:i.any},{name:"target-text-offset",type:s.size,triggersBounds:i.any}],d=[{name:"font-family",type:s.fontFamily,triggersBounds:i.any},{name:"font-style",type:s.fontStyle,triggersBounds:i.any},{name:"font-weight",type:s.fontWeight,triggersBounds:i.any},{name:"font-size",type:s.size,triggersBounds:i.any},{name:"text-transform",type:s.textTransform,triggersBounds:i.any},{name:"text-wrap",type:s.textWrap,triggersBounds:i.any},{name:"text-overflow-wrap",type:s.textOverflowWrap,triggersBounds:i.any},{name:"text-max-width",type:s.size,triggersBounds:i.any},{name:"text-outline-width",type:s.size,triggersBounds:i.any},{name:"line-height",type:s.positiveNumber,triggersBounds:i.any}],h=[{name:"text-valign",type:s.valign,triggersBounds:i.any},{name:"text-halign",type:s.halign,triggersBounds:i.any},{name:"color",type:s.color},{name:"text-outline-color",type:s.color},{name:"text-outline-opacity",type:s.zeroOneNumber},{name:"text-background-color",type:s.color},{name:"text-background-opacity",type:s.zeroOneNumber},{name:"text-background-padding",type:s.size,triggersBounds:i.any},{name:"text-border-opacity",type:s.zeroOneNumber},{name:"text-border-color",type:s.color},{name:"text-border-width",type:s.size,triggersBounds:i.any},{name:"text-border-style",type:s.borderStyle,triggersBounds:i.any},{name:"text-background-shape",type:s.textBackgroundShape,triggersBounds:i.any},{name:"text-justification",type:s.justification}],g=[{name:"events",type:s.bool,triggersZOrder:i.any},{name:"text-events",type:s.bool,triggersZOrder:i.any}],p=[{name:"display",type:s.display,triggersZOrder:i.any,triggersBounds:i.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:s.visibility,triggersZOrder:i.any},{name:"opacity",type:s.zeroOneNumber,triggersZOrder:i.zeroNonZero},{name:"text-opacity",type:s.zeroOneNumber},{name:"min-zoomed-font-size",type:s.size},{name:"z-compound-depth",type:s.zCompoundDepth,triggersZOrder:i.any},{name:"z-index-compare",type:s.zIndexCompare,triggersZOrder:i.any},{name:"z-index",type:s.number,triggersZOrder:i.any}],v=[{name:"overlay-padding",type:s.size,triggersBounds:i.any},{name:"overlay-color",type:s.color},{name:"overlay-opacity",type:s.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"overlay-shape",type:s.overlayShape,triggersBounds:i.any},{name:"overlay-corner-radius",type:s.cornerRadius}],b=[{name:"underlay-padding",type:s.size,triggersBounds:i.any},{name:"underlay-color",type:s.color},{name:"underlay-opacity",type:s.zeroOneNumber,triggersBounds:i.zeroNonZero},{name:"underlay-shape",type:s.overlayShape,triggersBounds:i.any},{name:"underlay-corner-radius",type:s.cornerRadius}],f=[{name:"transition-property",type:s.propList},{name:"transition-duration",type:s.time},{name:"transition-delay",type:s.time},{name:"transition-timing-function",type:s.easing}],y=function(q,K){return K.value==="label"?-q.poolIndex():K.pfValue},m=[{name:"height",type:s.nodeSize,triggersBounds:i.any,hashOverride:y},{name:"width",type:s.nodeSize,triggersBounds:i.any,hashOverride:y},{name:"shape",type:s.nodeShape,triggersBounds:i.any},{name:"shape-polygon-points",type:s.polygonPointList,triggersBounds:i.any},{name:"corner-radius",type:s.cornerRadius},{name:"background-color",type:s.color},{name:"background-fill",type:s.fill},{name:"background-opacity",type:s.zeroOneNumber},{name:"background-blacken",type:s.nOneOneNumber},{name:"background-gradient-stop-colors",type:s.colors},{name:"background-gradient-stop-positions",type:s.percentages},{name:"background-gradient-direction",type:s.gradientDirection},{name:"padding",type:s.sizeMaybePercent,triggersBounds:i.any},{name:"padding-relative-to",type:s.paddingRelativeTo,triggersBounds:i.any},{name:"bounds-expansion",type:s.boundsExpansion,triggersBounds:i.any}],k=[{name:"border-color",type:s.color},{name:"border-opacity",type:s.zeroOneNumber},{name:"border-width",type:s.size,triggersBounds:i.any},{name:"border-style",type:s.borderStyle},{name:"border-cap",type:s.lineCap},{name:"border-join",type:s.lineJoin},{name:"border-dash-pattern",type:s.numbers},{name:"border-dash-offset",type:s.number},{name:"border-position",type:s.linePosition}],x=[{name:"outline-color",type:s.color},{name:"outline-opacity",type:s.zeroOneNumber},{name:"outline-width",type:s.size,triggersBounds:i.any},{name:"outline-style",type:s.borderStyle},{name:"outline-offset",type:s.size,triggersBounds:i.any}],S=[{name:"background-image",type:s.urls},{name:"background-image-crossorigin",type:s.bgCrossOrigin},{name:"background-image-opacity",type:s.zeroOneNumbers},{name:"background-image-containment",type:s.bgContainment},{name:"background-image-smoothing",type:s.bools},{name:"background-position-x",type:s.bgPos},{name:"background-position-y",type:s.bgPos},{name:"background-width-relative-to",type:s.bgRelativeTo},{name:"background-height-relative-to",type:s.bgRelativeTo},{name:"background-repeat",type:s.bgRepeat},{name:"background-fit",type:s.bgFit},{name:"background-clip",type:s.bgClip},{name:"background-width",type:s.bgWH},{name:"background-height",type:s.bgWH},{name:"background-offset-x",type:s.bgPos},{name:"background-offset-y",type:s.bgPos}],w=[{name:"position",type:s.position,triggersBounds:i.any},{name:"compound-sizing-wrt-labels",type:s.compoundIncludeLabels,triggersBounds:i.any},{name:"min-width",type:s.size,triggersBounds:i.any},{name:"min-width-bias-left",type:s.sizeMaybePercent,triggersBounds:i.any},{name:"min-width-bias-right",type:s.sizeMaybePercent,triggersBounds:i.any},{name:"min-height",type:s.size,triggersBounds:i.any},{name:"min-height-bias-top",type:s.sizeMaybePercent,triggersBounds:i.any},{name:"min-height-bias-bottom",type:s.sizeMaybePercent,triggersBounds:i.any}],D=[{name:"line-style",type:s.lineStyle},{name:"line-color",type:s.color},{name:"line-fill",type:s.fill},{name:"line-cap",type:s.lineCap},{name:"line-opacity",type:s.zeroOneNumber},{name:"line-dash-pattern",type:s.numbers},{name:"line-dash-offset",type:s.number},{name:"line-outline-width",type:s.size},{name:"line-outline-color",type:s.color},{name:"line-gradient-stop-colors",type:s.colors},{name:"line-gradient-stop-positions",type:s.percentages},{name:"curve-style",type:s.curveStyle,triggersBounds:i.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:s.zeroOneNumber,triggersBounds:i.any},{name:"source-endpoint",type:s.edgeEndpoint,triggersBounds:i.any},{name:"target-endpoint",type:s.edgeEndpoint,triggersBounds:i.any},{name:"control-point-step-size",type:s.size,triggersBounds:i.any},{name:"control-point-distances",type:s.bidirectionalSizes,triggersBounds:i.any},{name:"control-point-weights",type:s.numbers,triggersBounds:i.any},{name:"segment-distances",type:s.bidirectionalSizes,triggersBounds:i.any},{name:"segment-weights",type:s.numbers,triggersBounds:i.any},{name:"segment-radii",type:s.numbers,triggersBounds:i.any},{name:"radius-type",type:s.radiusType,triggersBounds:i.any},{name:"taxi-turn",type:s.bidirectionalSizeMaybePercent,triggersBounds:i.any},{name:"taxi-turn-min-distance",type:s.size,triggersBounds:i.any},{name:"taxi-direction",type:s.axisDirection,triggersBounds:i.any},{name:"taxi-radius",type:s.number,triggersBounds:i.any},{name:"edge-distances",type:s.edgeDistances,triggersBounds:i.any},{name:"arrow-scale",type:s.positiveNumber,triggersBounds:i.any},{name:"loop-direction",type:s.angle,triggersBounds:i.any},{name:"loop-sweep",type:s.angle,triggersBounds:i.any},{name:"source-distance-from-node",type:s.size,triggersBounds:i.any},{name:"target-distance-from-node",type:s.size,triggersBounds:i.any}],E=[{name:"ghost",type:s.bool,triggersBounds:i.any},{name:"ghost-offset-x",type:s.bidirectionalSize,triggersBounds:i.any},{name:"ghost-offset-y",type:s.bidirectionalSize,triggersBounds:i.any},{name:"ghost-opacity",type:s.zeroOneNumber}],P=[{name:"selection-box-color",type:s.color},{name:"selection-box-opacity",type:s.zeroOneNumber},{name:"selection-box-border-color",type:s.color},{name:"selection-box-border-width",type:s.size},{name:"active-bg-color",type:s.color},{name:"active-bg-opacity",type:s.zeroOneNumber},{name:"active-bg-size",type:s.size},{name:"outside-texture-bg-color",type:s.color},{name:"outside-texture-bg-opacity",type:s.zeroOneNumber}],T=[];Fe.pieBackgroundN=16,T.push({name:"pie-size",type:s.sizeMaybePercent});for(var B=1;B<=Fe.pieBackgroundN;B++)T.push({name:"pie-"+B+"-background-color",type:s.color}),T.push({name:"pie-"+B+"-background-size",type:s.percent}),T.push({name:"pie-"+B+"-background-opacity",type:s.zeroOneNumber});var M=[],z=Fe.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:s.arrowShape,triggersBounds:i.any},{name:"arrow-color",type:s.color},{name:"arrow-fill",type:s.arrowFill},{name:"arrow-width",type:s.arrowWidth}].forEach(function(q){z.forEach(function(K){var U=K+"-"+q.name,re=q.type,ae=q.triggersBounds;M.push({name:U,type:re,triggersBounds:ae})})},{});var R=Fe.properties=[].concat(g,f,p,v,b,E,h,d,l,u,c,m,k,x,S,T,w,D,M,P),F=Fe.propertyGroups={behavior:g,transition:f,visibility:p,overlay:v,underlay:b,ghost:E,commonLabel:h,labelDimensions:d,mainLabel:l,sourceLabel:u,targetLabel:c,nodeBody:m,nodeBorder:k,nodeOutline:x,backgroundImage:S,pie:T,compound:w,edgeLine:D,edgeArrow:M,core:P},N=Fe.propertyGroupNames={};(Fe.propertyGroupKeys=Object.keys(F)).forEach(function(q){N[q]=F[q].map(function(K){return K.name}),F[q].forEach(function(K){return K.groupKey=q})});var I=Fe.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{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"}];Fe.propertyNames=R.map(function(q){return q.name});for(var X=0;X<R.length;X++){var O=R[X];R[O.name]=O}for(var Y=0;Y<I.length;Y++){var j=I[Y],G=R[j.pointsTo],W={name:j.name,alias:!0,pointsTo:G};R.push(W),R[j.name]=W}})(),Fe.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},Fe.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=he({"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,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","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","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","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(l,u){for(var c=1;c<=Fe.pieBackgroundN;c++){var d=u.name.replace("{{i}}",c),h=u.value;l[d]=h}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","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,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"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"},{name:"arrow-width",value:1}].reduce(function(l,u){return Fe.arrowPrefixes.forEach(function(c){var d=c+"-"+u.name,h=u.value;l[d]=h}),l},{})),n={},r=0;r<this.properties.length;r++){var a=this.properties[r];if(!a.pointsTo){var o=a.name,i=t[o],s=this.parse(o,i);n[o]=s}}return e.defaultProperties=n,e.defaultProperties},Fe.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 ps={parse:function(e,t,n,r){var a=this;if(Me(t))return a.parseImplWarn(e,t,n,r);var o,i=Ni(e,""+t,n?"t":"f",r==="mapping"||r===!0||r===!1||r==null?"dontcare":r),s=a.propCache=a.propCache||[];return(o=s[i])||(o=s[i]=a.parseImplWarn(e,t,n,r)),(n||r==="mapping")&&(o=vt(o))&&(o.value=vt(o.value)),o},parseImplWarn:function(e,t,n,r){var a=this.parseImpl(e,t,n,r);return a||t==null||we("The style property `".concat(e,": ").concat(t,"` is invalid")),!a||a.name!=="width"&&a.name!=="height"||t!=="label"||we("The style value of `label` is deprecated for `"+a.name+"`"),a}};ps.parseImpl=function(e,t,n,r){var a=this;e=oa(e);var o=a.properties[e],i=t,s=a.types;if(!o||t===void 0)return null;o.alias&&(o=o.pointsTo,e=o.name);var l=ce(t);l&&(t=t.trim());var u,c,d=o.type;if(!d)return null;if(n&&(t===""||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(Me(t))return{name:e,value:t,strValue:"fn",mapped:s.fn,bypass:n};if(!(!l||r||t.length<7||t[1]!=="a")){if(t.length>=7&&t[0]==="d"&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&t[0]==="m"&&(c=new RegExp(s.mapData.regex).exec(t))){if(n||d.multiple)return!1;var g=s.mapData;if(!d.color&&!d.number)return!1;var p=this.parse(e,c[4]);if(!p||p.mapped)return!1;var v=this.parse(e,c[5]);if(!v||v.mapped)return!1;if(p.pfValue===v.pfValue||p.strValue===v.strValue)return we("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+p.strValue+"`"),this.parse(e,p.strValue);if(d.color){var b=p.value,f=v.value;if(!(b[0]!==f[0]||b[1]!==f[1]||b[2]!==f[2]||b[3]!==f[3]&&(b[3]!=null&&b[3]!==1||f[3]!=null&&f[3]!==1)))return!1}return{name:e,value:c,strValue:""+t,mapped:g,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:p.value,valueMax:v.value,bypass:n}}}if(d.multiple&&r!=="multiple"){var y;if(y=l?t.split(/\s+/):ke(t)?t:[t],d.evenMultiple&&y.length%2!=0)return null;for(var m=[],k=[],x=[],S="",w=!1,D=0;D<y.length;D++){var E=a.parse(e,y[D],n,"multiple");w=w||ce(E.value),m.push(E.value),x.push(E.pfValue!=null?E.pfValue:E.value),k.push(E.units),S+=(D>0?" ":"")+E.strValue}return d.validate&&!d.validate(m,k)?null:d.singleEnum&&w?m.length===1&&ce(m[0])?{name:e,value:m[0],strValue:m[0],bypass:n}:null:{name:e,value:m,pfValue:x,strValue:S,bypass:n,units:k}}var P,T,B=function(){for(var re=0;re<d.enums.length;re++)if(d.enums[re]===t)return{name:e,value:t,strValue:""+t,bypass:n};return null};if(d.number){var M,z="px";if(d.units&&(M=d.units),d.implicitUnits&&(z=d.implicitUnits),!d.unitless)if(l){var R="px|em"+(d.allowPercent?"|\\%":"");M&&(R=M);var F=t.match("^("+Le+")("+R+")?$");F&&(t=F[1],M=F[2]||z)}else M&&!d.implicitUnits||(M=z);if(t=parseFloat(t),isNaN(t)&&d.enums===void 0)return null;if(isNaN(t)&&d.enums!==void 0)return t=i,B();if(d.integer&&(!te(T=t)||Math.floor(T)!==T)||d.min!==void 0&&(t<d.min||d.strictMin&&t===d.min)||d.max!==void 0&&(t>d.max||d.strictMax&&t===d.max))return null;var N={name:e,value:t,strValue:""+t+(M||""),units:M,bypass:n};return d.unitless||M!=="px"&&M!=="em"?N.pfValue=t:N.pfValue=M!=="px"&&M?this.getEmSizeInPixels()*t:t,M!=="ms"&&M!=="s"||(N.pfValue=M==="ms"?t:1e3*t),M!=="deg"&&M!=="rad"||(N.pfValue=M==="rad"?t:(P=t,Math.PI*P/180)),M==="%"&&(N.pfValue=t/100),N}if(d.propList){var I=[],X=""+t;if(X!=="none"){for(var O=X.split(/\s*,\s*|\s+/),Y=0;Y<O.length;Y++){var j=O[Y].trim();a.properties[j]?I.push(j):we("`"+j+"` is not a valid property name")}if(I.length===0)return null}return{name:e,value:I,strValue:I.length===0?"none":I.join(" "),bypass:n}}if(d.color){var G=bl(t);return G?{name:e,value:G,pfValue:G,strValue:"rgb("+G[0]+","+G[1]+","+G[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var W=B();if(W)return W}for(var q=d.regexes?d.regexes:[d.regex],K=0;K<q.length;K++){var U=new RegExp(q[K]).exec(t);if(U)return{name:e,value:d.singleRegexMatchValue?U[1]:U,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?B():null};var je=function e(t){if(!(this instanceof e))return new e(t);ia(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Be("A style must have a core reference")},We=je.prototype;We.instanceString=function(){return"style"},We.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(r){var a=r[0]._private;a.styleDirty=!0,a.appliedInitStyle=!1}),this},We.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},We.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},We.selector=function(e){var t=e==="core"?null:new Lt(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},We.css=function(){var e=arguments;if(e.length===1)for(var t=e[0],n=0;n<this.properties.length;n++){var r=this.properties[n],a=t[r.name];a===void 0&&(a=t[cr(r.name)]),a!==void 0&&this.cssRule(r.name,a)}else e.length===2&&this.cssRule(e[0],e[1]);return this},We.style=We.css,We.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},We.append=function(e){return xi(e)?e.appendToStyle(this):ke(e)?this.appendFromJson(e):ce(e)&&this.appendFromString(e),this},je.fromJson=function(e,t){var n=new je(e);return n.fromJson(t),n},je.fromString=function(e,t){return new je(e).fromString(t)},[Ye,kd,Cd,Ua,Sd,Pd,Fe,ps].forEach(function(e){he(We,e)}),je.types=We.types,je.properties=We.properties,je.propertyGroups=We.propertyGroups,je.propertyGroupNames=We.propertyGroupNames,je.propertyGroupKeys=We.propertyGroupKeys;var Dd={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return xi(e)?t.style=e.generateStyle(this):ke(e)?t.style=je.fromJson(this,e):ce(e)?t.style=je.fromString(this,e):t.style=je(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Zt={autolock:function(e){return e===void 0?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return e===void 0?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return e===void 0?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return t.selectionType==null&&(t.selectionType="single"),e===void 0?t.selectionType:(e!=="additive"&&e!=="single"||(t.selectionType=e),this)},panningEnabled:function(e){return e===void 0?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return e===void 0?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return e===void 0?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return e===void 0?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return e===void 0?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var e,t,n,r,a,o=arguments,i=this._private.pan;switch(o.length){case 0:return i;case 1:if(ce(o[0]))return i[e=o[0]];if(ve(o[0])){if(!this._private.panningEnabled)return this;r=(n=o[0]).x,a=n.y,te(r)&&(i.x=r),te(a)&&(i.y=a),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;t=o[1],(e=o[0])!=="x"&&e!=="y"||!te(t)||(i[e]=t),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var n,r,a,o,i,s=arguments,l=this._private.pan;if(!this._private.panningEnabled)return this;switch(s.length){case 1:ve(e)&&(o=(a=s[0]).x,i=a.y,te(o)&&(l.x+=o),te(i)&&(l.y+=i),this.emit("pan viewport"));break;case 2:r=t,(n=e)!=="x"&&n!=="y"||!te(r)||(l[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){if(te(e)&&t===void 0&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled){var n,r;if(ce(e)){var a=e;e=this.$(a)}else if(ve(r=e)&&te(r.x1)&&te(r.x2)&&te(r.y1)&&te(r.y2)){var o=e;(n={x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1}else tt(e)||(e=this.mutableElements());if(!tt(e)||!e.empty()){n=n||e.boundingBox();var i,s=this.width(),l=this.height();if(t=te(t)?t:0,!isNaN(s)&&!isNaN(l)&&s>0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:i=(i=(i=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:i)<this._private.minZoom?this._private.minZoom:i,pan:{x:(s-i*(n.x1+n.x2))/2,y:(l-i*(n.y1+n.y2))/2}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var r=e;e=r.min,t=r.max}return te(e)&&te(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):te(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:te(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,a=r.pan,o=r.zoom,i=!1;if(r.zoomingEnabled||(i=!0),te(e)?n=e:ve(e)&&(n=e.level,e.position!=null?t=yr(e.position,o,a):e.renderedPosition!=null&&(t=e.renderedPosition),t==null||r.panningEnabled||(i=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)<r.minZoom?r.minZoom:n,i||!te(n)||n===o||t!=null&&(!te(t.x)||!te(t.y)))return null;if(t!=null){var s=a,l=o,u=n;return{zoomed:!0,panned:!0,zoom:u,pan:{x:-u/l*(t.x-s.x)+t.x,y:-u/l*(t.y-s.y)+t.y}}}return{zoomed:!0,panned:!1,zoom:n,pan:a}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t!=null&&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,a=[],o=!1,i=!1;if(!e)return this;if(te(e.zoom)||(n=!1),ve(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,a.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;te(l.x)&&(t.pan.x=l.x,i=!1),te(l.y)&&(t.pan.y=l.y,i=!1),i||a.push("pan")}return a.length>0&&(a.push("viewport"),this.emit(a.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(ce(e)){var n=e;e=this.mutableElements().filter(n)}else tt(e)||(e=this.mutableElements());if(e.length!==0){var r=e.boundingBox(),a=this.width(),o=this.height();return{x:(a-(t=t===void 0?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,a=this;return n.sizeCache=n.sizeCache||(r?(e=a.window().getComputedStyle(r),t=function(o){return parseFloat(e.getPropertyValue(o))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};Zt.centre=Zt.center,Zt.autolockNodes=Zt.autolock,Zt.autoungrabifyNodes=Zt.autoungrabify;var nr={data:Ee.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ee.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ee.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ee.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};nr.attr=nr.data,nr.removeAttr=nr.removeData;var rr=function(e){var t=this,n=(e=he({},e)).container;n&&!ur(n)&&ur(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var a=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=Ae!==void 0&&n!==void 0&&!e.headless,i=e;i.layout=he({name:o?"grid":"null"},i.layout),i.renderer=he({name:o?"canvas":"null"},i.renderer);var s=function(c,d,h){return d!==void 0?d:h!==void 0?h:c},l=this._private={container:n,ready:!1,options:i,elements:new Ve(this),listeners:[],aniEles:new Ve(this),data:i.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,i.zoomingEnabled),userZoomingEnabled:s(!0,i.userZoomingEnabled),panningEnabled:s(!0,i.panningEnabled),userPanningEnabled:s(!0,i.userPanningEnabled),boxSelectionEnabled:s(!0,i.boxSelectionEnabled),autolock:s(!1,i.autolock,i.autolockNodes),autoungrabify:s(!1,i.autoungrabify,i.autoungrabifyNodes),autounselectify:s(!1,i.autounselectify),styleEnabled:i.styleEnabled===void 0?o:i.styleEnabled,zoom:te(i.zoom)?i.zoom:1,pan:{x:ve(i.pan)&&te(i.pan.x)?i.pan.x:0,y:ve(i.pan)&&te(i.pan.y)?i.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,i.multiClickDebounceTime)};this.createEmitter(),this.selectionType(i.selectionType),this.zoomRange({min:i.minZoom,max:i.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=he({},i,i.renderer);t.initRenderer(u),function(c,d){if(c.some(fl))return gn.all(c).then(d);d(c)}([i.style,i.elements],function(c){var d=c[0],h=c[1];l.styleEnabled&&t.style().append(d),function(g,p,v){t.notifications(!1);var b=t.mutableElements();b.length>0&&b.remove(),g!=null&&(ve(g)||ke(g))&&t.add(g),t.one("layoutready",function(y){t.notifications(!0),t.emit(y),t.one("load",p),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",v),t.emit("done")});var f=he({},t._private.options.layout);f.eles=t.elements(),t.layout(f).run()}(h,function(){t.startAnimationLoop(),l.ready=!0,Me(i.ready)&&t.on("ready",i.ready);for(var g=0;g<a.length;g++){var p=a[g];t.on("ready",p)}r&&(r.readies=[]),t.emit("ready")},i.done)})},$r=rr.prototype;he($r,{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},window:function(){if(this._private.container==null)return Ae;var e=this._private.container.ownerDocument;return e===void 0||e==null?Ae:e.defaultView||Ae},mount:function(e){if(e!=null){var t=this,n=t._private,r=n.options;return!ur(e)&&ur(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(he({},r,r.renderer,{name:r.renderer.name==="null"?"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 vt(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements();if(ve(e)){if(t.startBatch(),e.elements){var a={},o=function(b,f){for(var y=[],m=[],k=0;k<b.length;k++){var x=b[k];if(x.data.id){var S=""+x.data.id,w=t.getElementById(S);a[S]=!0,w.length!==0?m.push({ele:w,json:x}):(f&&(x.group=f),y.push(x))}else we("cy.json() cannot handle elements without an ID attribute")}t.add(y);for(var D=0;D<m.length;D++){var E=m[D],P=E.ele,T=E.json;P.json(T)}};if(ke(e.elements))o(e.elements);else for(var i=["nodes","edges"],s=0;s<i.length;s++){var l=i[s],u=e.elements[l];ke(u)&&o(u,l)}var c=t.collection();r.filter(function(b){return!a[b.id()]}).forEach(function(b){b.isParent()?c.merge(b):b.remove()}),c.forEach(function(b){return b.children().move({parent:null})}),c.forEach(function(b){return function(f){return t.getElementById(f.id())}(b).remove()})}e.style&&t.style(e.style),e.zoom!=null&&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","multiClickDebounceTime"],h=0;h<d.length;h++){var g=d[h];e[g]!=null&&t[g](e[g])}return t.endBatch(),this}var p={};e?p.elements=this.elements().map(function(b){return b.json()}):(p.elements={},r.forEach(function(b){var f=b.group();p.elements[f]||(p.elements[f]=[]),p.elements[f].push(b.json())})),this._private.styleEnabled&&(p.style=t.style().json()),p.data=vt(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=vt(n.pan),p.boxSelectionEnabled=n.boxSelectionEnabled,p.renderer=vt(v.renderer),p.hideEdgesOnViewport=v.hideEdgesOnViewport,p.textureOnViewport=v.textureOnViewport,p.wheelSensitivity=v.wheelSensitivity,p.motionBlur=v.motionBlur,p.multiClickDebounceTime=v.multiClickDebounceTime,p}}),$r.$id=$r.getElementById,[fd,bd,hs,Ka,Ur,wd,Ga,Zr,Dd,Zt,nr].forEach(function(e){he($r,e)});var Td={fit:!0,directed:!1,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort: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}},Md={maximal:!1,acyclic:!1},Dn=function(e){return e.scratch("breadthfirst")},fs=function(e,t){return e.scratch("breadthfirst",t)};function gs(e){this.options=he({},Td,Md,e)}gs.prototype.run=function(){var e,t=this.options,n=t,r=t.cy,a=n.eles,o=a.nodes().filter(function(Q){return!Q.isParent()}),i=a,s=n.directed,l=n.acyclic||n.maximal||n.maximalAdjustments>0,u=Je(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(tt(n.roots))e=n.roots;else if(ke(n.roots)){for(var c=[],d=0;d<n.roots.length;d++){var h=n.roots[d],g=r.getElementById(h);c.push(g)}e=r.collection(c)}else if(ce(n.roots))e=r.$(n.roots);else if(s)e=o.roots();else{var p=a.components();e=r.collection();for(var v=function(Q){var le=p[Q],ee=le.maxDegree(!1),C=le.filter(function(_){return _.degree(!1)===ee});e=e.add(C)},b=0;b<p.length;b++)v(b)}var f=[],y={},m=function(Q,le){f[le]==null&&(f[le]=[]);var ee=f[le].length;f[le].push(Q),fs(Q,{index:ee,depth:le})};i.bfs({roots:e,directed:n.directed,visit:function(Q,le,ee,C,_){var A=Q[0],V=A.id();m(A,_),y[V]=!0}});for(var k=[],x=0;x<o.length;x++){var S=o[x];y[S.id()]||k.push(S)}var w=function(Q){for(var le=f[Q],ee=0;ee<le.length;ee++){var C=le[ee];C!=null?fs(C,{depth:Q,index:ee}):(le.splice(ee,1),ee--)}},D=function(){for(var Q=0;Q<f.length;Q++)w(Q)},E=function(Q,le){for(var ee=Dn(Q),C=Q.incomers().filter(function(ne){return ne.isNode()&&a.has(ne)}),_=-1,A=Q.id(),V=0;V<C.length;V++){var L=C[V],Z=Dn(L);_=Math.max(_,Z.depth)}if(ee.depth<=_){if(!n.acyclic&&le[A])return null;var H=_+1;return function(ne,$){var J=Dn(ne),oe=J.depth,ie=J.index;f[oe][ie]=null,m(ne,$)}(Q,H),le[A]=H,!0}return!1};if(s&&l){var P=[],T={},B=function(Q){return P.push(Q)},M=function(){return P.shift()};for(o.forEach(function(Q){return P.push(Q)});P.length>0;){var z=M(),R=E(z,T);if(R)z.outgoers().filter(function(Q){return Q.isNode()&&a.has(Q)}).forEach(B);else if(R===null){we("Detected double maximal shift for node `"+z.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}D();var F=0;if(n.avoidOverlap)for(var N=0;N<o.length;N++){var I=o[N].layoutDimensions(n),X=I.w,O=I.h;F=Math.max(F,X,O)}var Y={},j=function(Q){if(Y[Q.id()])return Y[Q.id()];for(var le=Dn(Q).depth,ee=Q.neighborhood(),C=0,_=0,A=0;A<ee.length;A++){var V=ee[A];if(!V.isEdge()&&!V.isParent()&&o.has(V)){var L=Dn(V);if(L!=null){var Z=L.index,H=L.depth;if(Z!=null&&H!=null){var ne=f[H].length;H<le&&(C+=Z/ne,_++)}}}}return C/=_=Math.max(1,_),_===0&&(C=0),Y[Q.id()]=C,C},G=function(Q,le){var ee=j(Q)-j(le);return ee===0?ki(Q.id(),le.id()):ee};n.depthSort!==void 0&&(G=n.depthSort);for(var W=0;W<f.length;W++)f[W].sort(G),w(W);for(var q=[],K=0;K<k.length;K++)q.push(k[K]);f.unshift(q),D();for(var U=0,re=0;re<f.length;re++)U=Math.max(f[re].length,U);var ae=u.x1+u.w/2,de=u.x1+u.h/2,ue=f.reduce(function(Q,le){return Math.max(Q,le.length)},0);return a.nodes().layoutPositions(this,n,function(Q){var le=Dn(Q),ee=le.depth,C=le.index,_=f[ee].length,A=Math.max(u.w/((n.grid?ue:_)+1),F),V=Math.max(u.h/(f.length+1),F),L=Math.min(u.w/2/f.length,u.h/2/f.length);if(L=Math.max(L,F),n.circle){var Z=L*ee+L-(f.length>0&&f[0].length<=3?L/2:0),H=2*Math.PI/f[ee].length*C;return ee===0&&f[0].length===1&&(Z=1),{x:ae+Z*Math.cos(H),y:de+Z*Math.sin(H)}}return{x:ae+(C+1-(_+1)/2)*A,y:(ee+1)*V}}),this};var Bd={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 vs(e){this.options=he({},Bd,e)}vs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var i,s=Je(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(t.sweep===void 0?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 g=o[h].layoutDimensions(t),p=g.w,v=g.h;d=Math.max(d,p,v)}if(i=te(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 b=Math.cos(c)-Math.cos(0),f=Math.sin(c)-Math.sin(0),y=Math.sqrt(d*d/(b*b+f*f));i=Math.max(y,i)}return r.nodes().layoutPositions(this,t,function(m,k){var x=t.startAngle+k*c*(a?1:-1),S=i*Math.cos(x),w=i*Math.sin(x);return{x:l+S,y:u+w}}),this};var ys,_d={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 ms(e){this.options=he({},_d,e)}ms.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise!==void 0?!t.counterclockwise:t.clockwise,r=e.cy,a=t.eles,o=a.nodes().not(":parent"),i=Je(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=i.x1+i.w/2,l=i.y1+i.h/2,u=[],c=0,d=0;d<o.length;d++){var h,g=o[d];h=t.concentric(g),u.push({value:h,node:g}),g._private.scratch.concentric=h}o.updateStyle();for(var p=0;p<o.length;p++){var v=o[p].layoutDimensions(t);c=Math.max(c,v.w,v.h)}u.sort(function(ue,Q){return Q.value-ue.value});for(var b=t.levelWidth(o),f=[[]],y=f[0],m=0;m<u.length;m++){var k=u[m];y.length>0&&Math.abs(y[0].value-k.value)>=b&&(y=[],f.push(y)),y.push(k)}var x=c+t.minNodeSpacing;if(!t.avoidOverlap){var S=f.length>0&&f[0].length>1,w=(Math.min(i.w,i.h)/2-x)/(f.length+S?1:0);x=Math.min(x,w)}for(var D=0,E=0;E<f.length;E++){var P=f[E],T=t.sweep===void 0?2*Math.PI-2*Math.PI/P.length:t.sweep,B=P.dTheta=T/Math.max(1,P.length-1);if(P.length>1&&t.avoidOverlap){var M=Math.cos(B)-Math.cos(0),z=Math.sin(B)-Math.sin(0),R=Math.sqrt(x*x/(M*M+z*z));D=Math.max(R,D)}P.r=D,D+=x}if(t.equidistant){for(var F=0,N=0,I=0;I<f.length;I++){var X=f[I].r-N;F=Math.max(F,X)}N=0;for(var O=0;O<f.length;O++){var Y=f[O];O===0&&(N=Y.r),Y.r=N,N+=F}}for(var j={},G=0;G<f.length;G++)for(var W=f[G],q=W.dTheta,K=W.r,U=0;U<W.length;U++){var re=W[U],ae=t.startAngle+(n?1:-1)*q*U,de={x:s+K*Math.cos(ae),y:l+K*Math.sin(ae)};j[re.node.id()]=de}return a.nodes().layoutPositions(this,t,function(ue){var Q=ue.id();return j[Q]}),this};var Nd={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 Qr(e){this.options=he({},Nd,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(r){var a=r.source().data("id"),o=r.target().data("id"),i=t.some(function(l){return l.data("id")===a}),s=t.some(function(l){return l.data("id")===o});return!i||!s});this.options.eles=this.options.eles.not(n)}Qr.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,e.animate!==!0&&e.animate!==!1||n.emit({type:"layoutstart",layout:n}),ys=e.debug===!0;var r=Ad(t,n,e);ys&&(void 0)(r),e.randomize&&Id(r);var a=wt(),o=function(){Rd(r,t,e),e.fit===!0&&t.fit(e.padding)},i=function(c){return!(n.stopped||c>=e.numIter)&&(Od(r,e),r.temperature=r.temperature*e.coolingFactor,!(r.temperature<e.minTemp))},s=function(){if(e.animate===!0||e.animate===!1)o(),n.one("layoutstop",e.stop),n.emit({type:"layoutstop",layout:n});else{var c=e.eles.nodes(),d=bs(r,e,c);c.layoutPositions(n,e,d)}},l=0,u=!0;if(e.animate===!0)(function c(){for(var d=0;u&&d<e.refresh;)u=i(l),l++,d++;u?(wt()-a>=e.animationThreshold&&o(),pr(c)):(ws(r,e),s())})();else{for(;u;)u=i(l),l++;ws(r,e),s()}return this},Qr.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Qr.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Ad=function(e,t,n){for(var r=n.eles.edges(),a=n.eles.nodes(),o=Je(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),i={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:a.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u<s.length;u++)for(var c=s[u],d=0;d<c.length;d++)l[c[d].id()]=u;for(u=0;u<i.nodeSize;u++){var h=(f=a[u]).layoutDimensions(n);(N={}).isLocked=f.locked(),N.id=f.data("id"),N.parentId=f.data("parent"),N.cmptId=l[f.id()],N.children=[],N.positionX=f.position("x"),N.positionY=f.position("y"),N.offsetX=0,N.offsetY=0,N.height=h.w,N.width=h.h,N.maxX=N.positionX+N.width/2,N.minX=N.positionX-N.width/2,N.maxY=N.positionY+N.height/2,N.minY=N.positionY-N.height/2,N.padLeft=parseFloat(f.style("padding")),N.padRight=parseFloat(f.style("padding")),N.padTop=parseFloat(f.style("padding")),N.padBottom=parseFloat(f.style("padding")),N.nodeRepulsion=Me(n.nodeRepulsion)?n.nodeRepulsion(f):n.nodeRepulsion,i.layoutNodes.push(N),i.idToIndex[N.id]=u}var g=[],p=0,v=-1,b=[];for(u=0;u<i.nodeSize;u++){var f,y=(f=i.layoutNodes[u]).parentId;y!=null?i.layoutNodes[i.idToIndex[y]].children.push(f.id):(g[++v]=f.id,b.push(f.id))}for(i.graphSet.push(b);p<=v;){var m=g[p++],k=i.idToIndex[m],x=i.layoutNodes[k].children;if(x.length>0)for(i.graphSet.push(x),u=0;u<x.length;u++)g[++v]=x[u]}for(u=0;u<i.graphSet.length;u++){var S=i.graphSet[u];for(d=0;d<S.length;d++){var w=i.idToIndex[S[d]];i.indexToGraph[w]=u}}for(u=0;u<i.edgeSize;u++){var D=r[u],E={};E.id=D.data("id"),E.sourceId=D.data("source"),E.targetId=D.data("target");var P=Me(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,T=Me(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,B=i.idToIndex[E.sourceId],M=i.idToIndex[E.targetId];if(i.indexToGraph[B]!=i.indexToGraph[M]){for(var z=Ld(E.sourceId,E.targetId,i),R=i.graphSet[z],F=0,N=i.layoutNodes[B];R.indexOf(N.id)===-1;)N=i.layoutNodes[i.idToIndex[N.parentId]],F++;for(N=i.layoutNodes[M];R.indexOf(N.id)===-1;)N=i.layoutNodes[i.idToIndex[N.parentId]],F++;P*=F*n.nestingFactor}E.idealLength=P,E.elasticity=T,i.layoutEdges.push(E)}return i},Ld=function(e,t,n){var r=zd(e,t,0,n);return 2>r.count?0:r.graph},zd=function e(t,n,r,a){var o=a.graphSet[r];if(-1<o.indexOf(t)&&-1<o.indexOf(n))return{count:2,graph:r};for(var i=0,s=0;s<o.length;s++){var l=o[s],u=a.idToIndex[l],c=a.layoutNodes[u].children;if(c.length!==0){var d=e(t,n,a.indexToGraph[a.idToIndex[c[0]]],a);if(d.count!==0){if(d.count!==1)return d;if(++i===2)break}}}return{count:i,graph:r}},Id=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,a=0;a<e.nodeSize;a++){var o=e.layoutNodes[a];o.children.length!==0||o.isLocked||(o.positionX=Math.random()*n,o.positionY=Math.random()*r)}},bs=function(e,t,n){var r=e.boundingBox,a={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(o){var i=e.layoutNodes[e.idToIndex[o.data("id")]];a.x1=Math.min(a.x1,i.positionX),a.x2=Math.max(a.x2,i.positionX),a.y1=Math.min(a.y1,i.positionY),a.y2=Math.max(a.y2,i.positionY)}),a.w=a.x2-a.x1,a.h=a.y2-a.y1),function(o,i){var s=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var l=(s.positionX-a.x1)/a.w,u=(s.positionY-a.y1)/a.h;return{x:r.x1+l*r.w,y:r.y1+u*r.h}}return{x:s.positionX,y:s.positionY}}},Rd=function(e,t,n){var r=n.layout,a=n.eles.nodes(),o=bs(e,n,a);a.positions(o),e.ready!==!0&&(e.ready=!0,r.one("layoutready",n.ready),r.emit({type:"layoutready",layout:this}))},Od=function(e,t,n){Vd(e,t),qd(e),Yd(e,t),jd(e),Wd(e)},Vd=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],a=r.length,o=0;o<a;o++)for(var i=e.layoutNodes[e.idToIndex[r[o]]],s=o+1;s<a;s++){var l=e.layoutNodes[e.idToIndex[r[s]]];Fd(i,l,e,t)}},xs=function(e){return 2*e*Math.random()-1},Fd=function(e,t,n,r){if(e.cmptId===t.cmptId||n.isCompound){var a=t.positionX-e.positionX,o=t.positionY-e.positionY;a===0&&o===0&&(a=xs(1),o=xs(1));var i=Xd(e,t,a,o);if(i>0)var s=(u=r.nodeOverlap*i)*a/(v=Math.sqrt(a*a+o*o)),l=u*o/v;else{var u,c=Jr(e,a,o),d=Jr(t,-1*a,-1*o),h=d.x-c.x,g=d.y-c.y,p=h*h+g*g,v=Math.sqrt(p);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/p)*h/v,l=u*g/v}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Xd=function(e,t,n,r){if(n>0)var a=e.maxX-t.minX;else a=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return a>=0&&o>=0?Math.sqrt(a*a+o*o):0},Jr=function(e,t,n){var r=e.positionX,a=e.positionY,o=e.height||1,i=e.width||1,s=n/t,l=o/i,u={};return t===0&&0<n||t===0&&0>n?(u.x=r,u.y=a+o/2,u):0<t&&-1*l<=s&&s<=l?(u.x=r+i/2,u.y=a+i*n/2/t,u):0>t&&-1*l<=s&&s<=l?(u.x=r-i/2,u.y=a-i*n/2/t,u):0<n&&(s<=-1*l||s>=l)?(u.x=r+o*t/2/n,u.y=a+o/2,u):(0>n&&(s<=-1*l||s>=l)&&(u.x=r-o*t/2/n,u.y=a-o/2),u)},qd=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],a=e.idToIndex[r.sourceId],o=e.layoutNodes[a],i=e.idToIndex[r.targetId],s=e.layoutNodes[i],l=s.positionX-o.positionX,u=s.positionY-o.positionY;if(l!==0||u!==0){var c=Jr(o,l,u),d=Jr(s,-1*l,-1*u),h=d.x-c.x,g=d.y-c.y,p=Math.sqrt(h*h+g*g),v=Math.pow(r.idealLength-p,2)/r.elasticity;if(p!==0)var b=v*h/p,f=v*g/p;else b=0,f=0;o.isLocked||(o.offsetX+=b,o.offsetY+=f),s.isLocked||(s.offsetX-=b,s.offsetY-=f)}}},Yd=function(e,t){if(t.gravity!==0)for(var n=0;n<e.graphSet.length;n++){var r=e.graphSet[n],a=r.length;if(n===0)var o=e.clientHeight/2,i=e.clientWidth/2;else{var s=e.layoutNodes[e.idToIndex[r[0]]],l=e.layoutNodes[e.idToIndex[s.parentId]];o=l.positionX,i=l.positionY}for(var u=0;u<a;u++){var c=e.layoutNodes[e.idToIndex[r[u]]];if(!c.isLocked){var d=o-c.positionX,h=i-c.positionY,g=Math.sqrt(d*d+h*h);if(g>1){var p=t.gravity*d/g,v=t.gravity*h/g;c.offsetX+=p,c.offsetY+=v}}}}},jd=function(e,t){var n=[],r=0,a=-1;for(n.push.apply(n,e.graphSet[0]),a+=e.graphSet[0].length;r<=a;){var o=n[r++],i=e.idToIndex[o],s=e.layoutNodes[i],l=s.children;if(0<l.length&&!s.isLocked){for(var u=s.offsetX,c=s.offsetY,d=0;d<l.length;d++){var h=e.layoutNodes[e.idToIndex[l[d]]];h.offsetX+=u,h.offsetY+=c,n[++a]=l[d]}s.offsetX=0,s.offsetY=0}}},Wd=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(a=e.layoutNodes[n]).children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(a=e.layoutNodes[n]).children.length||a.isLocked)){var r=Hd(a.offsetX,a.offsetY,e.temperature);a.positionX+=r.x,a.positionY+=r.y,a.offsetX=0,a.offsetY=0,a.minX=a.positionX-a.width,a.maxX=a.positionX+a.width,a.minY=a.positionY-a.height,a.maxY=a.positionY+a.height,Kd(a,e)}for(n=0;n<e.nodeSize;n++){var a;0<(a=e.layoutNodes[n]).children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},Hd=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var a={x:n*e/r,y:n*t/r};else a={x:e,y:t};return a},Kd=function e(t,n){var r=t.parentId;if(r!=null){var a=n.layoutNodes[n.idToIndex[r]],o=!1;return(a.maxX==null||t.maxX+a.padRight>a.maxX)&&(a.maxX=t.maxX+a.padRight,o=!0),(a.minX==null||t.minX-a.padLeft<a.minX)&&(a.minX=t.minX-a.padLeft,o=!0),(a.maxY==null||t.maxY+a.padBottom>a.maxY)&&(a.maxY=t.maxY+a.padBottom,o=!0),(a.minY==null||t.minY-a.padTop<a.minY)&&(a.minY=t.minY-a.padTop,o=!0),o?e(a,n):void 0}},ws=function(e,t){for(var n=e.layoutNodes,r=[],a=0;a<n.length;a++){var o=n[a],i=o.cmptId;(r[i]=r[i]||[]).push(o)}var s=0;for(a=0;a<r.length;a++)if(v=r[a]){v.x1=1/0,v.x2=-1/0,v.y1=1/0,v.y2=-1/0;for(var l=0;l<v.length;l++){var u=v[l];v.x1=Math.min(v.x1,u.positionX-u.width/2),v.x2=Math.max(v.x2,u.positionX+u.width/2),v.y1=Math.min(v.y1,u.positionY-u.height/2),v.y2=Math.max(v.y2,u.positionY+u.height/2)}v.w=v.x2-v.x1,v.h=v.y2-v.y1,s+=v.w*v.h}r.sort(function(b,f){return f.w*f.h-b.w*b.h});var c=0,d=0,h=0,g=0,p=Math.sqrt(s)*e.clientWidth/e.clientHeight;for(a=0;a<r.length;a++){var v;if(v=r[a]){for(l=0;l<v.length;l++)(u=v[l]).isLocked||(u.positionX+=c-v.x1,u.positionY+=d-v.y1);c+=v.w+t.componentSpacing,h+=v.w+t.componentSpacing,g=Math.max(g,v.h),h>p&&(d+=g+t.componentSpacing,c=0,h=0,g=0)}}},Gd={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 Es(e){this.options=he({},Gd,e)}Es.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,a=r.nodes().not(":parent");t.sort&&(a=a.sort(t.sort));var o=Je(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(o.h===0||o.w===0)r.nodes().layoutPositions(this,t,function(j){return{x:o.x1,y:o.y1}});else{var i=a.size(),s=Math.sqrt(i*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(j){if(j==null)return Math.min(l,u);Math.min(l,u)==l?l=j:u=j},d=function(j){if(j==null)return Math.max(l,u);Math.max(l,u)==l?l=j:u=j},h=t.rows,g=t.cols!=null?t.cols:t.columns;if(h!=null&&g!=null)l=h,u=g;else if(h!=null&&g==null)l=h,u=Math.ceil(i/l);else if(h==null&&g!=null)u=g,l=Math.ceil(i/u);else if(u*l>i){var p=c(),v=d();(p-1)*v>=i?c(p-1):(v-1)*p>=i&&d(v-1)}else for(;u*l<i;){var b=c(),f=d();(f+1)*b>=i?d(f+1):c(b+1)}var y=o.w/u,m=o.h/l;if(t.condense&&(y=0,m=0),t.avoidOverlap)for(var k=0;k<a.length;k++){var x=a[k],S=x._private.position;S.x!=null&&S.y!=null||(S.x=0,S.y=0);var w=x.layoutDimensions(t),D=t.avoidOverlapPadding,E=w.w+D,P=w.h+D;y=Math.max(y,E),m=Math.max(m,P)}for(var T={},B=function(j,G){return!!T["c-"+j+"-"+G]},M=function(j,G){T["c-"+j+"-"+G]=!0},z=0,R=0,F=function(){++R>=u&&(R=0,z++)},N={},I=0;I<a.length;I++){var X=a[I],O=t.position(X);if(O&&(O.row!==void 0||O.col!==void 0)){var Y={row:O.row,col:O.col};if(Y.col===void 0)for(Y.col=0;B(Y.row,Y.col);)Y.col++;else if(Y.row===void 0)for(Y.row=0;B(Y.row,Y.col);)Y.row++;N[X.id()]=Y,M(Y.row,Y.col)}}a.layoutPositions(this,t,function(j,G){var W,q;if(j.locked()||j.isParent())return!1;var K=N[j.id()];if(K)W=K.col*y+y/2+o.x1,q=K.row*m+m/2+o.y1;else{for(;B(z,R);)F();W=R*y+y/2+o.x1,q=z*m+m/2+o.y1,M(z,R),F()}return{x:W,y:q}})}return this};var Ud={ready:function(){},stop:function(){}};function Za(e){this.options=he({},Ud,e)}Za.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit("layoutstart"),t.nodes().positions(function(){return{x:0,y:0}}),n.one("layoutready",e.ready),n.emit("layoutready"),n.one("layoutstop",e.stop),n.emit("layoutstop"),this},Za.prototype.stop=function(){return this};var Zd={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor: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 ks(e){this.options=he({},Zd,e)}ks.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=Me(e.positions);return t.layoutPositions(this,e,function(r,a){var o=function(i){if(e.positions==null)return function(l){return{x:l.x,y:l.y}}(i.position());if(n)return e.positions(i);var s=e.positions[i._private.data.id];return s??null}(r);return!r.locked()&&o!=null&&o}),this};var $d={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 Cs(e){this.options=he({},$d,e)}Cs.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=Je(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,function(a,o){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}}),this};var Qd=[{name:"breadthfirst",impl:gs},{name:"circle",impl:vs},{name:"concentric",impl:ms},{name:"cose",impl:Qr},{name:"grid",impl:Es},{name:"null",impl:Za},{name:"preset",impl:ks},{name:"random",impl:Cs}];function Ss(e){this.options=e,this.notifications=0}var Ps=function(){},Ds=function(){throw new Error("A headless instance can not render images")};Ss.prototype={recalculateRenderedStyle:Ps,notify:function(){this.notifications++},init:Ps,isHeadless:function(){return!0},png:Ds,jpg:Ds};var Jd={arrowShapeWidth:.3,registerArrowShapes:function(){var e=this.arrowShapes={},t=this,n=function(l,u,c,d,h,g,p){var v=h.x-c/2-p,b=h.x+c/2+p,f=h.y-c/2-p,y=h.y+c/2+p;return v<=l&&l<=b&&f<=u&&u<=y},r=function(l,u,c,d,h){var g=l*Math.cos(d)-u*Math.sin(d),p=(l*Math.sin(d)+u*Math.cos(d))*c;return{x:g*c+h.x,y:p+h.y}},a=function(l,u,c,d){for(var h=[],g=0;g<l.length;g+=2){var p=l[g],v=l[g+1];h.push(r(p,v,u,c,d))}return h},o=function(l){for(var u=[],c=0;c<l.length;c++){var d=l[c];u.push(d.x,d.y)}return u},i=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,u){ce(u)&&(u=e[u]),e[l]=he({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(c,d,h,g,p,v){var b=o(a(this.points,h+2*v,g,p));return et(c,d,b)},roughCollide:n,draw:function(c,d,h,g){var p=a(this.points,d,h,g);t.arrowShapeImpl("polygon")(c,p)},spacing:function(c){return 0},gap:i},u)};s("none",{collide:gr,roughCollide:gr,draw:ca,spacing:zi,gap:zi}),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(l,u,c,d,h){var g=a(this.points,u,c,d),p=this.controlPoint,v=r(p[0],p[1],u,c,d);t.arrowShapeImpl(this.name)(l,g,v)},gap:function(l){return .8*i(l)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,u,c,d,h,g,p){var v=o(a(this.points,c+2*p,d,h)),b=o(a(this.pointsTee,c+2*p,d,h));return et(l,u,v)||et(l,u,b)},draw:function(l,u,c,d,h){var g=a(this.points,u,c,d),p=a(this.pointsTee,u,c,d);t.arrowShapeImpl(this.name)(l,g,p)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,u,c,d,h,g,p){var v=h,b=Math.pow(v.x-l,2)+Math.pow(v.y-u,2)<=Math.pow((c+2*p)*this.radius,2),f=o(a(this.points,c+2*p,d,h));return et(l,u,f)||b},draw:function(l,u,c,d,h){var g=a(this.pointsTr,u,c,d);t.arrowShapeImpl(this.name)(l,g,d.x,d.y,this.radius*u)},spacing:function(l){return t.getArrowWidth(l.pstyle("width").pfValue,l.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(l,u){var c=this.baseCrossLinePts.slice(),d=u/l;return c[3]=c[3]-d,c[5]=c[5]-d,c},collide:function(l,u,c,d,h,g,p){var v=o(a(this.points,c+2*p,d,h)),b=o(a(this.crossLinePts(c,g),c+2*p,d,h));return et(l,u,v)||et(l,u,b)},draw:function(l,u,c,d,h){var g=a(this.points,u,c,d),p=a(this.crossLinePts(u,h),u,c,d);t.arrowShapeImpl(this.name)(l,g,p)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return .525*i(l)}}),s("circle",{radius:.15,collide:function(l,u,c,d,h,g,p){var v=h;return Math.pow(v.x-l,2)+Math.pow(v.y-u,2)<=Math.pow((c+2*p)*this.radius,2)},draw:function(l,u,c,d,h){t.arrowShapeImpl(this.name)(l,d.x,d.y,this.radius*u)},spacing:function(l){return t.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){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(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})}},eh={projectIntoViewport:function(e,t){var n=this.cy,r=this.findContainerClientCoords(),a=r[0],o=r[1],i=r[4],s=n.pan(),l=n.zoom();return[((e-a)/i-s.x)/l,((t-o)/i-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(x){return parseFloat(n.getPropertyValue(x))},a=r("padding-left"),o=r("padding-right"),i=r("padding-top"),s=r("padding-bottom"),l=r("border-left-width"),u=r("border-right-width"),c=r("border-top-width"),d=(r("border-bottom-width"),e.clientWidth),h=e.clientHeight,g=a+o,p=i+s,v=l+u,b=t.width/(d+v),f=d-g,y=h-p,m=t.left+a+l,k=t.top+i+c;return this.containerBB=[m,k,f,y,b]},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 a,o,i=this,s=this,l=s.getCachedZSortedEles(),u=[],c=s.cy.zoom(),d=s.cy.hasCompoundNodes(),h=(r?24:8)/c,g=(r?8:2)/c,p=(r?8:2)/c,v=1/0;function b(w,D){if(w.isNode()){if(o)return;o=w,u.push(w)}if(w.isEdge()&&(D==null||D<v))if(a){if(a.pstyle("z-compound-depth").value===w.pstyle("z-compound-depth").value&&a.pstyle("z-compound-depth").value===w.pstyle("z-compound-depth").value){for(var E=0;E<u.length;E++)if(u[E].isEdge()){u[E]=w,a=w,v=D??v;break}}}else u.push(w),a=w,v=D??v}function f(w){var D=w.outerWidth()+2*g,E=w.outerHeight()+2*g,P=D/2,T=E/2,B=w.position(),M=w.pstyle("corner-radius").value==="auto"?"auto":w.pstyle("corner-radius").pfValue,z=w._private.rscratch;if(B.x-P<=e&&e<=B.x+P&&B.y-T<=t&&t<=B.y+T&&s.nodeShapes[i.getNodeShape(w)].checkPoint(e,t,0,D,E,B.x,B.y,M,z))return b(w,0),!0}function y(w){var D,E=w._private,P=E.rscratch,T=w.pstyle("width").pfValue,B=w.pstyle("arrow-scale").value,M=T/2+h,z=M*M,R=2*M,F=E.source,N=E.target;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var I=P.allpts,X=0;X+3<I.length;X+=2)if(su(e,t,I[X],I[X+1],I[X+2],I[X+3],R)&&z>(D=cu(e,t,I[X],I[X+1],I[X+2],I[X+3])))return b(w,D),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(I=P.allpts,X=0;X+5<P.allpts.length;X+=4)if(lu(e,t,I[X],I[X+1],I[X+2],I[X+3],I[X+4],I[X+5],R)&&z>(D=uu(e,t,I[X],I[X+1],I[X+2],I[X+3],I[X+4],I[X+5])))return b(w,D),!0}F=F||E.source,N=N||E.target;var O=i.getArrowWidth(T,B),Y=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}];for(X=0;X<Y.length;X++){var j=Y[X],G=s.arrowShapes[w.pstyle(j.name+"-arrow-shape").value],W=w.pstyle("width").pfValue;if(G.roughCollide(e,t,O,j.angle,{x:j.x,y:j.y},W,h)&&G.collide(e,t,O,j.angle,{x:j.x,y:j.y},W,h))return b(w),!0}d&&u.length>0&&(f(F),f(N))}function m(w,D,E){return ct(w,D,E)}function k(w,D){var E,P=w._private,T=p;E=D?D+"-":"",w.boundingBox();var B=P.labelBounds[D||"main"],M=w.pstyle(E+"label").value;if(w.pstyle("text-events").strValue==="yes"&&M){var z=m(P.rscratch,"labelX",D),R=m(P.rscratch,"labelY",D),F=m(P.rscratch,"labelAngle",D),N=w.pstyle(E+"text-margin-x").pfValue,I=w.pstyle(E+"text-margin-y").pfValue,X=B.x1-T-N,O=B.x2+T-N,Y=B.y1-T-I,j=B.y2+T-I;if(F){var G=Math.cos(F),W=Math.sin(F),q=function(ue,Q){return{x:(ue-=z)*G-(Q-=R)*W+z,y:ue*W+Q*G+R}},K=q(X,Y),U=q(X,j),re=q(O,Y),ae=q(O,j),de=[K.x+N,K.y+I,re.x+N,re.y+I,ae.x+N,ae.y+I,U.x+N,U.y+I];if(et(e,t,de))return b(w),!0}else if(dn(B,e,t))return b(w),!0}}n&&(l=l.interactive);for(var x=l.length-1;x>=0;x--){var S=l[x];S.isNode()?f(S)||k(S):y(S)||k(S)||k(S,"source")||k(S,"target")}return u},getAllInBox:function(e,t,n,r){for(var a=this.getCachedZSortedEles().interactive,o=[],i=Math.min(e,n),s=Math.max(e,n),l=Math.min(t,r),u=Math.max(t,r),c=Je({x1:e=i,y1:t=l,x2:n=s,y2:r=u}),d=0;d<a.length;d++){var h=a[d];if(h.isNode()){var g=h,p=g.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});fa(c,p)&&!ji(p,c)&&o.push(g)}else{var v=h,b=v._private,f=b.rscratch;if(f.startX!=null&&f.startY!=null&&!dn(c,f.startX,f.startY)||f.endX!=null&&f.endY!=null&&!dn(c,f.endX,f.endY))continue;if(f.edgeType==="bezier"||f.edgeType==="multibezier"||f.edgeType==="self"||f.edgeType==="compound"||f.edgeType==="segments"||f.edgeType==="haystack"){for(var y=b.rstyle.bezierPts||b.rstyle.linePts||b.rstyle.haystackPts,m=!0,k=0;k<y.length;k++)if(!ou(c,y[k])){m=!1;break}m&&o.push(v)}else f.edgeType!=="haystack"&&f.edgeType!=="straight"||o.push(v)}}return o}},$a={calculateArrowAngles:function(e){var t,n,r,a,o,i,s=e._private.rscratch,l=s.edgeType==="haystack",u=s.edgeType==="bezier",c=s.edgeType==="multibezier",d=s.edgeType==="segments",h=s.edgeType==="compound",g=s.edgeType==="self";if(l?(r=s.haystackPts[0],a=s.haystackPts[1],o=s.haystackPts[2],i=s.haystackPts[3]):(r=s.arrowStartX,a=s.arrowStartY,o=s.arrowEndX,i=s.arrowEndY),v=s.midX,b=s.midY,d)t=r-s.segpts[0],n=a-s.segpts[1];else if(c||h||g||u){var p=s.allpts;t=r-Ie(p[0],p[2],p[4],.1),n=a-Ie(p[1],p[3],p[5],.1)}else t=r-v,n=a-b;s.srcArrowAngle=mr(t,n);var v=s.midX,b=s.midY;if(l&&(v=(r+o)/2,b=(a+i)/2),t=o-r,n=i-a,d)if((p=s.allpts).length/2%2==0){var f=(E=p.length/2)-2;t=p[E]-p[f],n=p[E+1]-p[f+1]}else s.isRound?(t=s.midVector[1],n=-s.midVector[0]):(f=(E=p.length/2-1)-2,t=p[E]-p[f],n=p[E+1]-p[f+1]);else if(c||h||g){var y,m,k,x,p=s.allpts;if(s.ctrlpts.length/2%2==0){var S=(w=(D=p.length/2-1)+2)+2;y=Ie(p[D],p[w],p[S],0),m=Ie(p[D+1],p[w+1],p[S+1],0),k=Ie(p[D],p[w],p[S],1e-4),x=Ie(p[D+1],p[w+1],p[S+1],1e-4)}else{var w,D;S=(w=p.length/2-1)+2,y=Ie(p[D=w-2],p[w],p[S],.4999),m=Ie(p[D+1],p[w+1],p[S+1],.4999),k=Ie(p[D],p[w],p[S],.5),x=Ie(p[D+1],p[w+1],p[S+1],.5)}t=k-y,n=x-m}if(s.midtgtArrowAngle=mr(t,n),s.midDispX=t,s.midDispY=n,t*=-1,n*=-1,d&&(p=s.allpts).length/2%2!=0){if(!s.isRound){var E,P=(E=p.length/2-1)+2;t=-(p[P]-p[E]),n=-(p[P+1]-p[E+1])}}if(s.midsrcArrowAngle=mr(t,n),d)t=o-s.segpts[s.segpts.length-2],n=i-s.segpts[s.segpts.length-1];else if(c||h||g||u){var T=(p=s.allpts).length;t=o-Ie(p[T-6],p[T-4],p[T-2],.9),n=i-Ie(p[T-5],p[T-3],p[T-1],.9)}else t=o-v,n=i-b;s.tgtArrowAngle=mr(t,n)}};$a.getArrowWidth=$a.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 Qa,Ja,Ts,Ms,$t,ea,Ct,Qt,Jt,St,ar,ta,Bs,_s,ei,ti,Ns,mt={},it={},As=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},th=function(e,t,n,r,a){var o,i;if(e!==Ns?As(t,e,mt):((i=mt).x=-1*(o=it).x,i.y=-1*o.y,i.nx=-1*o.nx,i.ny=-1*o.ny,i.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),As(t,n,it),Ts=mt.nx*it.ny-mt.ny*it.nx,Ms=mt.nx*it.nx-mt.ny*-it.ny,Ct=Math.asin(Math.max(-1,Math.min(1,Ts))),Math.abs(Ct)<1e-6)return Qa=t.x,Ja=t.y,void(Jt=ar=0);$t=1,ea=!1,Ms<0?Ct<0?Ct=Math.PI+Ct:(Ct=Math.PI-Ct,$t=-1,ea=!0):Ct>0&&($t=-1,ea=!0),ar=t.radius!==void 0?t.radius:r,Qt=Ct/2,ta=Math.min(mt.len/2,it.len/2),a?(St=Math.abs(Math.cos(Qt)*ar/Math.sin(Qt)))>ta?(St=ta,Jt=Math.abs(St*Math.sin(Qt)/Math.cos(Qt))):Jt=ar:(St=Math.min(ta,ar),Jt=Math.abs(St*Math.sin(Qt)/Math.cos(Qt))),ei=t.x+it.nx*St,ti=t.y+it.ny*St,Qa=ei-it.ny*Jt*$t,Ja=ti+it.nx*Jt*$t,Bs=t.x+mt.nx*St,_s=t.y+mt.ny*St,Ns=t};function Ls(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function ni(e,t,n,r){var a=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4];return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(th(e,t,n,r,a),{cx:Qa,cy:Ja,radius:Jt,startX:Bs,startY:_s,stopX:ei,stopY:ti,startAngle:mt.ang+Math.PI/2*$t,endAngle:it.ang-Math.PI/2*$t,counterClockwise:ea})}var He={};function zs(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],a=e[n+1];t.push({x:r,y:a})}return t}}He.findMidptPtsEtc=function(e,t){var n,r=t.posPts,a=t.intersectionPts,o=t.vectorNormInverse,i=e.pstyle("source-endpoint"),s=e.pstyle("target-endpoint"),l=i.units!=null&&s.units!=null;switch(e.pstyle("edge-distances").value){case"node-position":n=r;break;case"intersection":n=a;break;case"endpoints":if(l){var u=ut(this.manualEndptToPx(e.source()[0],i),2),c=u[0],d=u[1],h=ut(this.manualEndptToPx(e.target()[0],s),2),g=h[0],p=h[1],v={x1:c,y1:d,x2:g,y2:p};o=function(b,f,y,m){var k=m-f,x=y-b,S=Math.sqrt(x*x+k*k);return{x:-k/S,y:x/S}}(c,d,g,p),n=v}else we("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),n=a}return{midptPts:n,vectorNormInverse:o}},He.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,a=r.rscratch;if(!a.haystack){var o=2*Math.random()*Math.PI;a.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,a.target={x:Math.cos(o),y:Math.sin(o)}}var i=r.source,s=r.target,l=i.position(),u=s.position(),c=i.width(),d=s.width(),h=i.height(),g=s.height(),p=n.pstyle("haystack-radius").value/2;a.haystackPts=a.allpts=[a.source.x*c*p+l.x,a.source.y*h*p+l.y,a.target.x*d*p+u.x,a.target.y*g*p+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},He.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle("segment-weights"),a=e.pstyle("segment-distances"),o=e.pstyle("segment-radii"),i=e.pstyle("radius-type"),s=Math.min(r.pfValue.length,a.pfValue.length),l=o.pfValue[o.pfValue.length-1],u=i.pfValue[i.pfValue.length-1];n.edgeType="segments",n.segpts=[],n.radii=[],n.isArcRadius=[];for(var c=0;c<s;c++){var d=r.pfValue[c],h=a.pfValue[c],g=1-d,p=d,v=this.findMidptPtsEtc(e,t),b=v.midptPts,f=v.vectorNormInverse,y={x:b.x1*g+b.x2*p,y:b.y1*g+b.y2*p};n.segpts.push(y.x+f.x*h,y.y+f.y*h),n.radii.push(o.pfValue[c]!==void 0?o.pfValue[c]:l),n.isArcRadius.push((i.pfValue[c]!==void 0?i.pfValue[c]:u)==="arc-radius")}},He.findLoopPoints=function(e,t,n,r){var a=e._private.rscratch,o=t.dirCounts,i=t.srcPos,s=e.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=e.pstyle("loop-direction").pfValue,c=e.pstyle("loop-sweep").pfValue,d=e.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=n,g=d;r&&(h=0,g=l);var p=u-Math.PI/2,v=p-c/2,b=p+c/2,f=u+"_"+c;h=o[f]===void 0?o[f]=0:++o[f],a.ctrlpts=[i.x+1.4*Math.cos(v)*g*(h/3+1),i.y+1.4*Math.sin(v)*g*(h/3+1),i.x+1.4*Math.cos(b)*g*(h/3+1),i.y+1.4*Math.sin(b)*g*(h/3+1)]},He.findCompoundLoopPoints=function(e,t,n,r){var a=e._private.rscratch;a.edgeType="compound";var o=t.srcPos,i=t.tgtPos,s=t.srcW,l=t.srcH,u=t.tgtW,c=t.tgtH,d=e.pstyle("control-point-step-size").pfValue,h=e.pstyle("control-point-distances"),g=h?h.pfValue[0]:void 0,p=n,v=d;r&&(p=0,v=g);var b={x:o.x-s/2,y:o.y-l/2},f={x:i.x-u/2,y:i.y-c/2},y={x:Math.min(b.x,f.x),y:Math.min(b.y,f.y)},m=Math.max(.5,Math.log(.01*s)),k=Math.max(.5,Math.log(.01*u));a.ctrlpts=[y.x,y.y-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*m,y.x-(1+Math.pow(50,1.12)/100)*v*(p/3+1)*k,y.y]},He.findStraightEdgePoints=function(e){e._private.rscratch.edgeType="straight"},He.findBezierPoints=function(e,t,n,r,a){var o=e._private.rscratch,i=e.pstyle("control-point-step-size").pfValue,s=e.pstyle("control-point-distances"),l=e.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,c=s?s.pfValue[0]:void 0,d=l.value[0],h=r;o.edgeType=h?"multibezier":"bezier",o.ctrlpts=[];for(var g=0;g<u;g++){var p=(.5-t.eles.length/2+n)*i*(a?-1:1),v=void 0,b=Xi(p);h&&(c=s?s.pfValue[g]:i,d=l.value[g]);var f=(v=r?c:c!==void 0?b*c:void 0)!==void 0?v:p,y=1-d,m=d,k=this.findMidptPtsEtc(e,t),x=k.midptPts,S=k.vectorNormInverse,w={x:x.x1*y+x.x2*m,y:x.y1*y+x.y2*m};o.ctrlpts.push(w.x+S.x*f,w.y+S.y*f)}},He.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType="segments";var r="vertical",a="horizontal",o="leftward",i="rightward",s="downward",l="upward",u=t.posPts,c=t.srcW,d=t.srcH,h=t.tgtW,g=t.tgtH,p=e.pstyle("edge-distances").value!=="node-position",v=e.pstyle("taxi-direction").value,b=v,f=e.pstyle("taxi-turn"),y=f.units==="%",m=f.pfValue,k=m<0,x=e.pstyle("taxi-turn-min-distance").pfValue,S=p?(c+h)/2:0,w=p?(d+g)/2:0,D=u.x2-u.x1,E=u.y2-u.y1,P=function(se,pe){return se>0?Math.max(se-pe,0):Math.min(se+pe,0)},T=P(D,S),B=P(E,w),M=!1;b==="auto"?v=Math.abs(T)>Math.abs(B)?a:r:b===l||b===s?(v=r,M=!0):b!==o&&b!==i||(v=a,M=!0);var z,R=v===r,F=R?B:T,N=R?E:D,I=Xi(N),X=!1;M&&(y||k)||!(b===s&&N<0||b===l&&N>0||b===o&&N>0||b===i&&N<0)||(F=(I*=-1)*Math.abs(F),X=!0),y?z=(m<0?1+m:m)*F:z=(m<0?F:0)+m*I;var O=function(se){return Math.abs(se)<x||Math.abs(se)>=Math.abs(F)},Y=O(z),j=O(Math.abs(F)-Math.abs(z));if((Y||j)&&!X)if(R){var G=Math.abs(N)<=d/2,W=Math.abs(D)<=h/2;if(G){var q=(u.x1+u.x2)/2,K=u.y1,U=u.y2;n.segpts=[q,K,q,U]}else if(W){var re=(u.y1+u.y2)/2,ae=u.x1,de=u.x2;n.segpts=[ae,re,de,re]}else n.segpts=[u.x1,u.y2]}else{var ue=Math.abs(N)<=c/2,Q=Math.abs(E)<=g/2;if(ue){var le=(u.y1+u.y2)/2,ee=u.x1,C=u.x2;n.segpts=[ee,le,C,le]}else if(Q){var _=(u.x1+u.x2)/2,A=u.y1,V=u.y2;n.segpts=[_,A,_,V]}else n.segpts=[u.x2,u.y1]}else if(R){var L=u.y1+z+(p?d/2*I:0),Z=u.x1,H=u.x2;n.segpts=[Z,L,H,L]}else{var ne=u.x1+z+(p?c/2*I:0),$=u.y1,J=u.y2;n.segpts=[ne,$,ne,J]}if(n.isRound){var oe=e.pstyle("taxi-radius").value,ie=e.pstyle("radius-type").value[0]==="arc-radius";n.radii=new Array(n.segpts.length/2).fill(oe),n.isArcRadius=new Array(n.segpts.length/2).fill(ie)}},He.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType==="bezier"){var r=t.srcPos,a=t.tgtPos,o=t.srcW,i=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,g=t.srcRs,p=t.tgtRs,v=!te(n.startX)||!te(n.startY),b=!te(n.arrowStartX)||!te(n.arrowStartY),f=!te(n.endX)||!te(n.endY),y=!te(n.arrowEndX)||!te(n.arrowEndY),m=3*(this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth),k=jt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=k<m,S=jt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),w=S<m,D=!1;if(v||b||x){D=!0;var E={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},P=Math.sqrt(E.x*E.x+E.y*E.y),T={x:E.x/P,y:E.y/P},B=Math.max(o,i),M={x:n.ctrlpts[0]+2*T.x*B,y:n.ctrlpts[1]+2*T.y*B},z=u.intersectLine(r.x,r.y,o,i,M.x,M.y,0,d,g);x?(n.ctrlpts[0]=n.ctrlpts[0]+T.x*(m-k),n.ctrlpts[1]=n.ctrlpts[1]+T.y*(m-k)):(n.ctrlpts[0]=z[0]+T.x*m,n.ctrlpts[1]=z[1]+T.y*m)}if(f||y||w){D=!0;var R={x:n.ctrlpts[0]-a.x,y:n.ctrlpts[1]-a.y},F=Math.sqrt(R.x*R.x+R.y*R.y),N={x:R.x/F,y:R.y/F},I=Math.max(o,i),X={x:n.ctrlpts[0]+2*N.x*I,y:n.ctrlpts[1]+2*N.y*I},O=c.intersectLine(a.x,a.y,s,l,X.x,X.y,0,h,p);w?(n.ctrlpts[0]=n.ctrlpts[0]+N.x*(m-S),n.ctrlpts[1]=n.ctrlpts[1]+N.y*(m-S)):(n.ctrlpts[0]=O[0]+N.x*m,n.ctrlpts[1]=O[1]+N.y*m)}D&&this.findEndpoints(e)}},He.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType==="multibezier"||t.edgeType==="bezier"||t.edgeType==="self"||t.edgeType==="compound"){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?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,t.midX=Ie(t.allpts[r],t.allpts[r+2],t.allpts[r+4],.5),t.midY=Ie(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],.5))}else if(t.edgeType==="straight")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(t.edgeType==="segments"){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.isRound){t.roundCorners=[];for(var a=2;a+3<t.allpts.length;a+=2){var o=t.radii[a/2-1],i=t.isArcRadius[a/2-1];t.roundCorners.push(ni({x:t.allpts[a-2],y:t.allpts[a-1]},{x:t.allpts[a],y:t.allpts[a+1],radius:o},{x:t.allpts[a+2],y:t.allpts[a+3]},o,i))}}if(t.segpts.length%4==0){var s=t.segpts.length/2,l=s-2;t.midX=(t.segpts[l]+t.segpts[s])/2,t.midY=(t.segpts[l+1]+t.segpts[s+1])/2}else{var u=t.segpts.length/2-1;if(t.isRound){var c={x:t.segpts[u],y:t.segpts[u+1]},d=t.roundCorners[u/2],h=[c.x-d.cx,c.y-d.cy],g=d.radius/Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2));h=h.map(function(p){return p*g}),t.midX=d.cx+h[0],t.midY=d.cy+h[1],t.midVector=h}else t.midX=t.segpts[u],t.midY=t.segpts[u+1]}}},He.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||te(t.startX)&&te(t.startY)&&te(t.endX)&&te(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,we("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."))},He.findEdgeControlPoints=function(e){var t=this;if(e&&e.length!==0){for(var n=this,r=n.cy.hasCompoundNodes(),a={map:new yt,get:function(m){var k=this.map.get(m[0]);return k!=null?k.get(m[1]):null},set:function(m,k){var x=this.map.get(m[0]);x==null&&(x=new yt,this.map.set(m[0],x)),x.set(m[1],k)}},o=[],i=[],s=0;s<e.length;s++){var l=e[s],u=l._private,c=l.pstyle("curve-style").value;if(!l.removed()&&l.takesUpSpace())if(c!=="haystack"){var d=c==="unbundled-bezier"||c.endsWith("segments")||c==="straight"||c==="straight-triangle"||c.endsWith("taxi"),h=c==="unbundled-bezier"||c==="bezier",g=u.source,p=u.target,v=[g.poolIndex(),p.poolIndex()].sort(),b=a.get(v);b==null&&(b={eles:[]},a.set(v,b),o.push(v)),b.eles.push(l),d&&(b.hasUnbundled=!0),h&&(b.hasBezier=!0)}else i.push(l)}for(var f=function(m){var k=o[m],x=a.get(k),S=void 0;if(!x.hasUnbundled){var w=x.eles[0].parallelEdges().filter(function($){return $.isBundledBezier()});da(x.eles),w.forEach(function($){return x.eles.push($)}),x.eles.sort(function($,J){return $.poolIndex()-J.poolIndex()})}var D=x.eles[0],E=D.source(),P=D.target();if(E.poolIndex()>P.poolIndex()){var T=E;E=P,P=T}var B=x.srcPos=E.position(),M=x.tgtPos=P.position(),z=x.srcW=E.outerWidth(),R=x.srcH=E.outerHeight(),F=x.tgtW=P.outerWidth(),N=x.tgtH=P.outerHeight(),I=x.srcShape=n.nodeShapes[t.getNodeShape(E)],X=x.tgtShape=n.nodeShapes[t.getNodeShape(P)],O=x.srcCornerRadius=E.pstyle("corner-radius").value==="auto"?"auto":E.pstyle("corner-radius").pfValue,Y=x.tgtCornerRadius=P.pstyle("corner-radius").value==="auto"?"auto":P.pstyle("corner-radius").pfValue,j=x.tgtRs=P._private.rscratch,G=x.srcRs=E._private.rscratch;x.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var W=0;W<x.eles.length;W++){var q=x.eles[W],K=q[0]._private.rscratch,U=q.pstyle("curve-style").value,re=U==="unbundled-bezier"||U.endsWith("segments")||U.endsWith("taxi"),ae=!E.same(q.source());if(!x.calculatedIntersection&&E!==P&&(x.hasBezier||x.hasUnbundled)){x.calculatedIntersection=!0;var de=I.intersectLine(B.x,B.y,z,R,M.x,M.y,0,O,G),ue=x.srcIntn=de,Q=X.intersectLine(M.x,M.y,F,N,B.x,B.y,0,Y,j),le=x.tgtIntn=Q,ee=x.intersectionPts={x1:de[0],x2:Q[0],y1:de[1],y2:Q[1]},C=x.posPts={x1:B.x,x2:M.x,y1:B.y,y2:M.y},_=Q[1]-de[1],A=Q[0]-de[0],V=Math.sqrt(A*A+_*_),L=x.vector={x:A,y:_},Z=x.vectorNorm={x:L.x/V,y:L.y/V},H={x:-Z.y,y:Z.x};x.nodesOverlap=!te(V)||X.checkPoint(de[0],de[1],0,F,N,M.x,M.y,Y,j)||I.checkPoint(Q[0],Q[1],0,z,R,B.x,B.y,O,G),x.vectorNormInverse=H,S={nodesOverlap:x.nodesOverlap,dirCounts:x.dirCounts,calculatedIntersection:!0,hasBezier:x.hasBezier,hasUnbundled:x.hasUnbundled,eles:x.eles,srcPos:M,tgtPos:B,srcW:F,srcH:N,tgtW:z,tgtH:R,srcIntn:le,tgtIntn:ue,srcShape:X,tgtShape:I,posPts:{x1:C.x2,y1:C.y2,x2:C.x1,y2:C.y1},intersectionPts:{x1:ee.x2,y1:ee.y2,x2:ee.x1,y2:ee.y1},vector:{x:-L.x,y:-L.y},vectorNorm:{x:-Z.x,y:-Z.y},vectorNormInverse:{x:-H.x,y:-H.y}}}var ne=ae?S:x;K.nodesOverlap=ne.nodesOverlap,K.srcIntn=ne.srcIntn,K.tgtIntn=ne.tgtIntn,K.isRound=U.startsWith("round"),r&&(E.isParent()||E.isChild()||P.isParent()||P.isChild())&&(E.parents().anySame(P)||P.parents().anySame(E)||E.same(P)&&E.isParent())?t.findCompoundLoopPoints(q,ne,W,re):E===P?t.findLoopPoints(q,ne,W,re):U.endsWith("segments")?t.findSegmentsPoints(q,ne):U.endsWith("taxi")?t.findTaxiPoints(q,ne):U==="straight"||!re&&x.eles.length%2==1&&W===Math.floor(x.eles.length/2)?t.findStraightEdgePoints(q):t.findBezierPoints(q,ne,W,re,ae),t.findEndpoints(q),t.tryToCorrectInvalidPoints(q,ne),t.checkForInvalidEdgeWarning(q),t.storeAllpts(q),t.storeEdgeProjections(q),t.calculateArrowAngles(q),t.recalculateEdgeLabelProjections(q),t.calculateLabelAngles(q)}},y=0;y<o.length;y++)f(y);this.findHaystackPoints(i)}},He.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if(t.edgeType==="segments")return this.recalculateRenderedStyle(e),zs(t.segpts)},He.getControlPoints=function(e){var t=e[0]._private.rscratch,n=t.edgeType;if(n==="bezier"||n==="multibezier"||n==="self"||n==="compound")return this.recalculateRenderedStyle(e),zs(t.ctrlpts)},He.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var nh={manualEndptToPx:function(e,t){var n=e.position(),r=e.outerWidth(),a=e.outerHeight(),o=e._private.rscratch;if(t.value.length===2){var i=[t.pfValue[0],t.pfValue[1]];return t.units[0]==="%"&&(i[0]=i[0]*r),t.units[1]==="%"&&(i[1]=i[1]*a),i[0]+=n.x,i[1]+=n.y,i}var s=t.pfValue[0];s=-Math.PI/2+s;var l=2*Math.max(r,a),u=[n.x+Math.cos(s)*l,n.y+Math.sin(s)*l];return this.nodeShapes[this.getNodeShape(e)].intersectLine(n.x,n.y,r,a,u[0],u[1],0,e.pstyle("corner-radius").value==="auto"?"auto":e.pstyle("corner-radius").pfValue,o)},findEndpoints:function(e){var t,n,r,a,o,i=this,s=e.source()[0],l=e.target()[0],u=s.position(),c=l.position(),d=e.pstyle("target-arrow-shape").value,h=e.pstyle("source-arrow-shape").value,g=e.pstyle("target-distance-from-node").pfValue,p=e.pstyle("source-distance-from-node").pfValue,v=s._private.rscratch,b=l._private.rscratch,f=e.pstyle("curve-style").value,y=e._private.rscratch,m=y.edgeType,k=m==="self"||m==="compound",x=m==="bezier"||m==="multibezier"||k,S=m!=="bezier",w=m==="straight"||m==="segments",D=m==="segments",E=x||S||w,P=k||f==="taxi",T=e.pstyle("source-endpoint"),B=P?"outside-to-node":T.value,M=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,z=e.pstyle("target-endpoint"),R=P?"outside-to-node":z.value,F=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;if(y.srcManEndpt=T,y.tgtManEndpt=z,x){var N=[y.ctrlpts[0],y.ctrlpts[1]];n=S?[y.ctrlpts[y.ctrlpts.length-2],y.ctrlpts[y.ctrlpts.length-1]]:N,r=N}else if(w){var I=D?y.segpts.slice(0,2):[c.x,c.y];n=D?y.segpts.slice(y.segpts.length-2):[u.x,u.y],r=I}if(R==="inside-to-node")t=[c.x,c.y];else if(z.units)t=this.manualEndptToPx(l,z);else if(R==="outside-to-line")t=y.tgtIntn;else if(R==="outside-to-node"||R==="outside-to-node-or-label"?a=n:R!=="outside-to-line"&&R!=="outside-to-line-or-label"||(a=[u.x,u.y]),t=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),a[0],a[1],0,F,b),R==="outside-to-node-or-label"||R==="outside-to-line-or-label"){var X=l._private.rscratch,O=X.labelWidth,Y=X.labelHeight,j=X.labelX,G=X.labelY,W=O/2,q=Y/2,K=l.pstyle("text-valign").value;K==="top"?G-=q:K==="bottom"&&(G+=q);var U=l.pstyle("text-halign").value;U==="left"?j-=W:U==="right"&&(j+=W);var re=Hn(a[0],a[1],[j-W,G-q,j+W,G-q,j+W,G+q,j-W,G+q],c.x,c.y);if(re.length>0){var ae=u,de=Wt(ae,un(t)),ue=Wt(ae,un(re)),Q=de;ue<de&&(t=re,Q=ue),re.length>2&&Wt(ae,{x:re[2],y:re[3]})<Q&&(t=[re[2],re[3]])}}var le=kr(t,n,i.arrowShapes[d].spacing(e)+g),ee=kr(t,n,i.arrowShapes[d].gap(e)+g);if(y.endX=ee[0],y.endY=ee[1],y.arrowEndX=le[0],y.arrowEndY=le[1],B==="inside-to-node")t=[u.x,u.y];else if(T.units)t=this.manualEndptToPx(s,T);else if(B==="outside-to-line")t=y.srcIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?o=r:B!=="outside-to-line"&&B!=="outside-to-line-or-label"||(o=[c.x,c.y]),t=i.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),o[0],o[1],0,M,v),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var C=s._private.rscratch,_=C.labelWidth,A=C.labelHeight,V=C.labelX,L=C.labelY,Z=_/2,H=A/2,ne=s.pstyle("text-valign").value;ne==="top"?L-=H:ne==="bottom"&&(L+=H);var $=s.pstyle("text-halign").value;$==="left"?V-=Z:$==="right"&&(V+=Z);var J=Hn(o[0],o[1],[V-Z,L-H,V+Z,L-H,V+Z,L+H,V-Z,L+H],u.x,u.y);if(J.length>0){var oe=c,ie=Wt(oe,un(t)),se=Wt(oe,un(J)),pe=ie;se<ie&&(t=[J[0],J[1]],pe=se),J.length>2&&Wt(oe,{x:J[2],y:J[3]})<pe&&(t=[J[2],J[3]])}}var fe=kr(t,r,i.arrowShapes[h].spacing(e)+p),xe=kr(t,r,i.arrowShapes[h].gap(e)+p);y.startX=xe[0],y.startY=xe[1],y.arrowStartX=fe[0],y.arrowStartY=fe[1],E&&(te(y.startX)&&te(y.startY)&&te(y.endX)&&te(y.endY)?y.badLine=!1:y.badLine=!0)},getSourceEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),t.edgeType==="haystack"?{x:t.haystackPts[0],y:t.haystackPts[1]}:{x:t.arrowStartX,y:t.arrowStartY}},getTargetEndpoint:function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),t.edgeType==="haystack"?{x:t.haystackPts[2],y:t.haystackPts[3]}:{x:t.arrowEndX,y:t.arrowEndY}}},ri={};function rh(e,t,n){for(var r=function(s,l,u,c){return Ie(s,l,u,c)},a=t._private.rstyle.bezierPts,o=0;o<e.bezierProjPcts.length;o++){var i=e.bezierProjPcts[o];a.push({x:r(n[0],n[2],n[4],i),y:r(n[1],n[3],n[5],i)})}}ri.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,r==="multibezier"||r==="bezier"||r==="self"||r==="compound"){t.rstyle.bezierPts=[];for(var a=0;a+5<n.allpts.length;a+=4)rh(this,e,n.allpts.slice(a,a+6))}else if(r==="segments"){var o=t.rstyle.linePts=[];for(a=0;a+1<n.allpts.length;a+=2)o.push({x:n.allpts[a],y:n.allpts[a+1]})}else if(r==="haystack"){var i=n.haystackPts;t.rstyle.haystackPts=[{x:i[0],y:i[1]},{x:i[2],y:i[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth},ri.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Pt={recalculateNodeLabelProjection:function(e){var t=e.pstyle("label").strValue;if(!Tt(t)){var n,r,a=e._private,o=e.width(),i=e.height(),s=e.padding(),l=e.position(),u=e.pstyle("text-halign").strValue,c=e.pstyle("text-valign").strValue,d=a.rscratch,h=a.rstyle;switch(u){case"left":n=l.x-o/2-s;break;case"right":n=l.x+o/2+s;break;default:n=l.x}switch(c){case"top":r=l.y-i/2-s;break;case"bottom":r=l.y+i/2+s;break;default:r=l.y}d.labelX=n,d.labelY=r,h.labelX=n,h.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}}},Is=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n*=-1),n},Rs=function(e,t){var n=t.x-e.x,r=t.y-e.y;return Is(n,r)};Pt.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,a=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){t={x:r.midX,y:r.midY};var i=function(c,d,h){_t(n.rscratch,c,d,h),_t(n.rstyle,c,d,h)};i("labelX",null,t.x),i("labelY",null,t.y);var s=Is(r.midDispX,r.midDispY);i("labelAutoAngle",null,s);var l=function c(){if(c.cache)return c.cache;for(var d=[],h=0;h+5<r.allpts.length;h+=4){var g={x:r.allpts[h],y:r.allpts[h+1]},p={x:r.allpts[h+2],y:r.allpts[h+3]},v={x:r.allpts[h+4],y:r.allpts[h+5]};d.push({p0:g,p1:p,p2:v,startDist:0,length:0,segments:[]})}var b=n.rstyle.bezierPts,f=a.bezierProjPcts.length;function y(w,D,E,P,T){var B=jt(D,E),M=w.segments[w.segments.length-1],z={p0:D,p1:E,t0:P,t1:T,startDist:M?M.startDist+M.length:0,length:B};w.segments.push(z),w.length+=B}for(var m=0;m<d.length;m++){var k=d[m],x=d[m-1];x&&(k.startDist=x.startDist+x.length),y(k,k.p0,b[m*f],0,a.bezierProjPcts[0]);for(var S=0;S<f-1;S++)y(k,b[m*f+S],b[m*f+S+1],a.bezierProjPcts[S],a.bezierProjPcts[S+1]);y(k,b[m*f+f-1],k.p2,a.bezierProjPcts[f-1],1)}return c.cache=d},u=function(c){var d,h=c==="source";if(o[c]){var g=e.pstyle(c+"-text-offset").pfValue;switch(r.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var p,v=l(),b=0,f=0,y=0;y<v.length;y++){for(var m=v[h?y:v.length-1-y],k=0;k<m.segments.length;k++){var x=m.segments[h?k:m.segments.length-1-k],S=y===v.length-1&&k===m.segments.length-1;if(b=f,(f+=x.length)>=g||S){p={cp:m,segment:x};break}}if(p)break}var w=p.cp,D=p.segment,E=(g-b)/D.length,P=D.t1-D.t0,T=h?D.t0+P*E:D.t1-P*E;T=jn(0,T,1),t=cn(w.p0,w.p1,w.p2,T),d=function(O,Y,j,G){var W=jn(0,G-.001,1),q=jn(0,G+.001,1),K=cn(O,Y,j,W),U=cn(O,Y,j,q);return Rs(K,U)}(w.p0,w.p1,w.p2,T);break;case"straight":case"segments":case"haystack":for(var B,M,z,R,F=0,N=r.allpts.length,I=0;I+3<N&&(h?(z={x:r.allpts[I],y:r.allpts[I+1]},R={x:r.allpts[I+2],y:r.allpts[I+3]}):(z={x:r.allpts[N-2-I],y:r.allpts[N-1-I]},R={x:r.allpts[N-4-I],y:r.allpts[N-3-I]}),M=F,!((F+=B=jt(z,R))>=g));I+=2);var X=(g-M)/B;X=jn(0,X,1),t=function(O,Y,j,G){var W=Y.x-O.x,q=Y.y-O.y,K=jt(O,Y),U=W/K,re=q/K;return j=j??0,G=G??j*K,{x:O.x+U*G,y:O.y+re*G}}(z,R,X),d=Rs(z,R)}i("labelX",c,t.x),i("labelY",c,t.y),i("labelAutoAngle",c,d)}};u("source"),u("target"),this.applyLabelDimensions(e)}},Pt.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},Pt.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),a=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,i=e.pstyle("text-wrap").strValue,s=ct(n.rscratch,"labelWrapCachedLines",t)||[],l=i!=="wrap"?1:Math.max(s.length,1),u=a.height/l,c=u*o,d=a.width,h=a.height+(l-1)*(o-1)*u;_t(n.rstyle,"labelWidth",t,d),_t(n.rscratch,"labelWidth",t,d),_t(n.rstyle,"labelHeight",t,h),_t(n.rscratch,"labelHeight",t,h),_t(n.rscratch,"labelLineHeight",t,c)},Pt.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",a=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,i=function(z,R){return R?(_t(n.rscratch,z,t,R),R):ct(n.rscratch,z,t)};if(!a)return"";o=="none"||(o=="uppercase"?a=a.toUpperCase():o=="lowercase"&&(a=a.toLowerCase()));var s=e.pstyle("text-wrap").value;if(s==="wrap"){var l=i("labelKey");if(l!=null&&i("labelWrapKey")===l)return i("labelWrapCachedText");for(var u=a.split(`
|
8
|
-
`),c=e.pstyle("text-max-width").pfValue,d=e.pstyle("text-overflow-wrap").value==="anywhere",h=[],g=/[\s\u200b]+|$/g,p=0;p<u.length;p++){var v=u[p],b=this.calculateLabelDimensions(e,v).width;if(d){var f=v.split("").join("\u200B");v=f}if(b>c){var y,m="",k=0,x=vi(v.matchAll(g));try{for(x.s();!(y=x.n()).done;){var S=y.value,w=S[0],D=v.substring(k,S.index);k=S.index+w.length;var E=m.length===0?D:m+D+w;this.calculateLabelDimensions(e,E).width<=c?m+=D+w:(m&&h.push(m),m=D+w)}}catch(z){x.e(z)}finally{x.f()}m.match(/^[\s\u200b]+$/)||h.push(m)}else h.push(v)}i("labelWrapCachedLines",h),a=i("labelWrapCachedText",h.join(`
|
9
|
-
`)),i("labelWrapKey",l)}else if(s==="ellipsis"){var P=e.pstyle("text-max-width").pfValue,T="",B=!1;if(this.calculateLabelDimensions(e,a).width<P)return a;for(var M=0;M<a.length&&!(this.calculateLabelDimensions(e,T+a[M]+"\u2026").width>P);M++)T+=a[M],M===a.length-1&&(B=!0);return B||(T+="\u2026"),T}return a},Pt.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if(t!=="auto")return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},Pt.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,a=Yt(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),i=o[a];if(i!=null)return i;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var g=d.style;g.position="absolute",g.left="-9999px",g.top="-9999px",g.zIndex="-1",g.visibility="hidden",g.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var p=0,v=0,b=t.split(`
|
10
|
-
`),f=0;f<b.length;f++){var y=b[f],m=h.measureText(y),k=Math.ceil(m.width),x=l;p=Math.max(k,p),v+=x}return p+=0,v+=0,o[a]={width:p,height:v}},Pt.calculateLabelAngle=function(e,t){var n=e._private.rscratch,r=e.isEdge(),a=t?t+"-":"",o=e.pstyle(a+"text-rotation"),i=o.strValue;return i==="none"?0:r&&i==="autorotate"?n.labelAutoAngle:i==="autorotate"?0:o.pfValue},Pt.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 Os={},Vs=!1;Os.getNodeShape=function(e){var t=e.pstyle("shape").value;if(t==="cutrectangle"&&(e.width()<28||e.height()<28))return Vs||(we("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Vs=!0),"rectangle";if(e.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var n=e.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var ah={registerCalculationListeners:function(){var e=this.cy,t=e.collection(),n=this,r=function(o){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];if(t.merge(o),i)for(var s=0;s<o.length;s++){var l=o[s]._private.rstyle;l.clean=!1,l.cleanConnected=!1}};n.binder(e).on("bounds.* dirty.*",function(o){var i=o.target;r(i)}).on("style.* background.*",function(o){var i=o.target;r(i,!1)});var a=function(o){if(o){var i=n.onUpdateEleCalcsFns;t.cleanStyle();for(var s=0;s<t.length;s++){var l=t[s],u=l._private.rstyle;l.isNode()&&!u.cleanConnected&&(r(l.connectedEdges()),u.cleanConnected=!0)}if(i)for(var c=0;c<i.length;c++)(0,i[c])(o,t);n.recalculateRenderedStyle(t),t=e.collection()}};n.flushRenderedStyleQueue=function(){a(!0)},n.beforeRender(a,n.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(e){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(e)},recalculateRenderedStyle:function(e,t){var n=function(f){return f._private.rstyle.cleanConnected},r=[],a=[];if(!this.destroyed){t===void 0&&(t=!0);for(var o=0;o<e.length;o++){var i=e[o],s=i._private,l=s.rstyle;!i.isEdge()||n(i.source())&&n(i.target())||(l.clean=!1),t&&l.clean||i.removed()||i.pstyle("display").value!=="none"&&(s.group==="nodes"?a.push(i):r.push(i),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],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 g=0;g<r.length;g++){var p=r[g]._private,v=p.rstyle,b=p.rscratch;v.srcX=b.arrowStartX,v.srcY=b.arrowStartY,v.tgtX=b.arrowEndX,v.tgtY=b.arrowEndY,v.midX=b.midX,v.midY=b.midY,v.labelAngle=b.labelAngle,v.sourceLabelAngle=b.sourceLabelAngle,v.targetLabelAngle=b.targetLabelAngle}}}},ih={updateCachedGrabbedEles:function(){var e=this.cachedZSortedEles;if(e){e.drag=[],e.nondrag=[];for(var t=[],n=0;n<e.length;n++){var r=(a=e[n])._private.rscratch;a.grabbed()&&!a.isParent()?t.push(a):r.inDragLayer?e.drag.push(a):e.nondrag.push(a)}for(n=0;n<t.length;n++){var a=t[n];e.drag.push(a)}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(e){if(e||!this.cachedZSortedEles){var t=this.cy.mutableElements().toArray();t.sort(es),t.interactive=t.filter(function(n){return n.interactive()}),this.cachedZSortedEles=t,this.updateCachedGrabbedEles()}else t=this.cachedZSortedEles;return t}},Fs={};[eh,$a,He,nh,ri,Pt,Os,ah,ih].forEach(function(e){he(Fs,e)});var oh={getCachedImage:function(e,t,n){var r=this.imageCache=this.imageCache||{},a=r[e];if(a)return a.image.complete||a.image.addEventListener("load",n),a.image;var o=(a=r[e]=r[e]||{}).image=new Image;o.addEventListener("load",n),o.addEventListener("error",function(){o.error=!0});var i="data:";return e.substring(0,5).toLowerCase()===i||(t=t==="null"?null:t,o.crossOrigin=t),o.src=e,o}},ir={registerBinding:function(e,t,n,r){var a=Array.prototype.slice.apply(arguments,[1]),o=this.binder(e);return o.on.apply(o,a)}};ir.binder=function(e){var t,n=this,r=n.cy.window(),a=e===r||e===r.document||e===r.document.body||(t=e,typeof HTMLElement<"u"&&t instanceof HTMLElement);if(n.supportsPassiveEvents==null){var o=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return o=!0,!0}});r.addEventListener("test",null,i)}catch{}n.supportsPassiveEvents=o}var s=function(l,u,c){var d=Array.prototype.slice.call(arguments);return a&&n.supportsPassiveEvents&&(d[2]={capture:c!=null&&c,passive:!1,once:!1}),n.bindings.push({target:e,args:d}),(e.addEventListener||e.on).apply(e,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}},ir.nodeIsDraggable=function(e){return e&&e.isNode()&&!e.locked()&&e.grabbable()},ir.nodeIsGrabbable=function(e){return this.nodeIsDraggable(e)&&e.interactive()},ir.load=function(){var e=this,t=e.cy.window(),n=function(C){return C.selected()},r=function(C,_,A,V){C==null&&(C=e.cy);for(var L=0;L<_.length;L++){var Z=_[L];C.emit({originalEvent:A,type:Z,position:V})}},a=function(C){return C.shiftKey||C.metaKey||C.ctrlKey},o=function(C,_){var A=!0;if(e.cy.hasCompoundNodes()&&C&&C.pannable()){for(var V=0;_&&V<_.length;V++)if((C=_[V]).isNode()&&C.isParent()&&!C.pannable()){A=!1;break}}else A=!0;return A},i=function(C){C[0]._private.rscratch.inDragLayer=!0},s=function(C){C[0]._private.rscratch.isGrabTarget=!0},l=function(C,_){var A=_.addToList;A.has(C)||!C.grabbable()||C.locked()||(A.merge(C),function(V){V[0]._private.grabbed=!0}(C))},u=function(C,_){_=_||{};var A=C.cy().hasCompoundNodes();_.inDragLayer&&(C.forEach(i),C.neighborhood().stdFilter(function(V){return!A||V.isEdge()}).forEach(i)),_.addToList&&C.forEach(function(V){l(V,_)}),function(V,L){if(V.cy().hasCompoundNodes()&&(L.inDragLayer!=null||L.addToList!=null)){var Z=V.descendants();L.inDragLayer&&(Z.forEach(i),Z.connectedEdges().forEach(i)),L.addToList&&l(Z,L)}}(C,_),h(C,{inDragLayer:_.inDragLayer}),e.updateCachedGrabbedEles()},c=u,d=function(C){C&&(e.getCachedZSortedEles().forEach(function(_){(function(A){A[0]._private.grabbed=!1})(_),function(A){A[0]._private.rscratch.inDragLayer=!1}(_),function(A){A[0]._private.rscratch.isGrabTarget=!1}(_)}),e.updateCachedGrabbedEles())},h=function(C,_){if((_.inDragLayer!=null||_.addToList!=null)&&C.cy().hasCompoundNodes()){var A=C.ancestors().orphans();if(!A.same(C)){var V=A.descendants().spawnSelf().merge(A).unmerge(C).unmerge(C.descendants()),L=V.connectedEdges();_.inDragLayer&&(L.forEach(i),V.forEach(i)),_.addToList&&V.forEach(function(Z){l(Z,_)})}}},g=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},p=typeof MutationObserver<"u",v=typeof ResizeObserver<"u";p?(e.removeObserver=new MutationObserver(function(C){for(var _=0;_<C.length;_++){var A=C[_].removedNodes;if(A){for(var V=0;V<A.length;V++)if(A[V]===e.container){e.destroy();break}}}}),e.container.parentNode&&e.removeObserver.observe(e.container.parentNode,{childList:!0})):e.registerBinding(e.container,"DOMNodeRemoved",function(C){e.destroy()});var b=hr(function(){e.cy.resize()},100);p&&(e.styleObserver=new MutationObserver(b),e.styleObserver.observe(e.container,{attributes:!0})),e.registerBinding(t,"resize",b),v&&(e.resizeObserver=new ResizeObserver(b),e.resizeObserver.observe(e.container));var f=function(){e.invalidateContainerClientCoordsCache()};(function(C,_){for(;C!=null;)_(C),C=C.parentNode})(e.container,function(C){e.registerBinding(C,"transitionend",f),e.registerBinding(C,"animationend",f),e.registerBinding(C,"scroll",f)}),e.registerBinding(e.container,"contextmenu",function(C){C.preventDefault()});var y,m,k,x=function(C){for(var _=e.findContainerClientCoords(),A=_[0],V=_[1],L=_[2],Z=_[3],H=C.touches?C.touches:[C],ne=!1,$=0;$<H.length;$++){var J=H[$];if(A<=J.clientX&&J.clientX<=A+L&&V<=J.clientY&&J.clientY<=V+Z){ne=!0;break}}if(!ne)return!1;for(var oe=e.container,ie=C.target.parentNode,se=!1;ie;){if(ie===oe){se=!0;break}ie=ie.parentNode}return!!se};e.registerBinding(e.container,"mousedown",function(C){if(x(C)&&(e.hoverData.which!==1||C.which===1)){C.preventDefault(),g(),e.hoverData.capture=!0,e.hoverData.which=C.which;var _=e.cy,A=[C.clientX,C.clientY],V=e.projectIntoViewport(A[0],A[1]),L=e.selection,Z=e.findNearestElements(V[0],V[1],!0,!1),H=Z[0],ne=e.dragData.possibleDragElements;if(e.hoverData.mdownPos=V,e.hoverData.mdownGPos=A,C.which==3){e.hoverData.cxtStarted=!0;var $={originalEvent:C,type:"cxttapstart",position:{x:V[0],y:V[1]}};H?(H.activate(),H.emit($),e.hoverData.down=H):_.emit($),e.hoverData.downTime=new Date().getTime(),e.hoverData.cxtDragged=!1}else if(C.which==1){if(H&&H.activate(),H!=null&&e.nodeIsGrabbable(H)){var J=function(ie){return{originalEvent:C,type:ie,position:{x:V[0],y:V[1]}}};if(s(H),H.selected()){ne=e.dragData.possibleDragElements=_.collection();var oe=_.$(function(ie){return ie.isNode()&&ie.selected()&&e.nodeIsGrabbable(ie)});u(oe,{addToList:ne}),H.emit(J("grabon")),oe.forEach(function(ie){ie.emit(J("grab"))})}else ne=e.dragData.possibleDragElements=_.collection(),c(H,{addToList:ne}),H.emit(J("grabon")).emit(J("grab"));e.redrawHint("eles",!0),e.redrawHint("drag",!0)}e.hoverData.down=H,e.hoverData.downs=Z,e.hoverData.downTime=new Date().getTime(),r(H,["mousedown","tapstart","vmousedown"],C,{x:V[0],y:V[1]}),H==null?(L[4]=1,e.data.bgActivePosistion={x:V[0],y:V[1]},e.redrawHint("select",!0),e.redraw()):H.pannable()&&(L[4]=1),e.hoverData.tapholdCancelled=!1,clearTimeout(e.hoverData.tapholdTimeout),e.hoverData.tapholdTimeout=setTimeout(function(){if(!e.hoverData.tapholdCancelled){var ie=e.hoverData.down;ie?ie.emit({originalEvent:C,type:"taphold",position:{x:V[0],y:V[1]}}):_.emit({originalEvent:C,type:"taphold",position:{x:V[0],y:V[1]}})}},e.tapholdDuration)}L[0]=L[2]=V[0],L[1]=L[3]=V[1]}},!1),e.registerBinding(t,"mousemove",function(C){if(e.hoverData.capture||x(C)){var _=!1,A=e.cy,V=A.zoom(),L=[C.clientX,C.clientY],Z=e.projectIntoViewport(L[0],L[1]),H=e.hoverData.mdownPos,ne=e.hoverData.mdownGPos,$=e.selection,J=null;e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.selecting||(J=e.findNearestElement(Z[0],Z[1],!0,!1));var oe,ie=e.hoverData.last,se=e.hoverData.down,pe=[Z[0]-$[2],Z[1]-$[3]],fe=e.dragData.possibleDragElements;if(ne){var xe=L[0]-ne[0],ge=xe*xe,De=L[1]-ne[1],Te=ge+De*De;e.hoverData.isOverThresholdDrag=oe=Te>=e.desktopTapThreshold2}var Ue=a(C);oe&&(e.hoverData.tapholdCancelled=!0),_=!0,r(J,["mousemove","vmousemove","tapdrag"],C,{x:Z[0],y:Z[1]});var pt=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||A.emit({originalEvent:C,type:"boxstart",position:{x:Z[0],y:Z[1]}}),$[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(e.hoverData.which===3){if(oe){var Ke={originalEvent:C,type:"cxtdrag",position:{x:Z[0],y:Z[1]}};se?se.emit(Ke):A.emit(Ke),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&J===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:C,type:"cxtdragout",position:{x:Z[0],y:Z[1]}}),e.hoverData.cxtOver=J,J&&J.emit({originalEvent:C,type:"cxtdragover",position:{x:Z[0],y:Z[1]}}))}}else if(e.hoverData.dragging){if(_=!0,A.panningEnabled()&&A.userPanningEnabled()){var Ze;if(e.hoverData.justStartedPan){var ot=e.hoverData.mdownPos;Ze={x:(Z[0]-ot[0])*V,y:(Z[1]-ot[1])*V},e.hoverData.justStartedPan=!1}else Ze={x:pe[0]*V,y:pe[1]*V};A.panBy(Ze),A.emit("dragpan"),e.hoverData.dragged=!0}Z=e.projectIntoViewport(C.clientX,C.clientY)}else if($[4]!=1||se!=null&&!se.pannable()){if(se&&se.pannable()&&se.active()&&se.unactivate(),se&&se.grabbed()||J==ie||(ie&&r(ie,["mouseout","tapdragout"],C,{x:Z[0],y:Z[1]}),J&&r(J,["mouseover","tapdragover"],C,{x:Z[0],y:Z[1]}),e.hoverData.last=J),se)if(oe){if(A.boxSelectionEnabled()&&Ue)se&&se.grabbed()&&(d(fe),se.emit("freeon"),fe.emit("free"),e.dragData.didDrag&&(se.emit("dragfreeon"),fe.emit("dragfree"))),pt();else if(se&&se.grabbed()&&e.nodeIsDraggable(se)){var ft=!e.dragData.didDrag;ft&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(fe,{inDragLayer:!0});var $e={x:0,y:0};if(te(pe[0])&&te(pe[1])&&($e.x+=pe[0],$e.y+=pe[1],ft)){var Qe=e.hoverData.dragDelta;Qe&&te(Qe[0])&&te(Qe[1])&&($e.x+=Qe[0],$e.y+=Qe[1])}e.hoverData.draggingEles=!0,fe.silentShift($e).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else(function(){var st=e.hoverData.dragDelta=e.hoverData.dragDelta||[];st.length===0?(st.push(pe[0]),st.push(pe[1])):(st[0]+=pe[0],st[1]+=pe[1])})();_=!0}else oe&&(e.hoverData.dragging||!A.boxSelectionEnabled()||!Ue&&A.panningEnabled()&&A.userPanningEnabled()?!e.hoverData.selecting&&A.panningEnabled()&&A.userPanningEnabled()&&o(se,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,$[4]=0,e.data.bgActivePosistion=un(H),e.redrawHint("select",!0),e.redraw()):pt(),se&&se.pannable()&&se.active()&&se.unactivate());return $[2]=Z[0],$[3]=Z[1],_?(C.stopPropagation&&C.stopPropagation(),C.preventDefault&&C.preventDefault(),!1):void 0}},!1),e.registerBinding(t,"mouseup",function(C){if((e.hoverData.which!==1||C.which===1||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var _=e.cy,A=e.projectIntoViewport(C.clientX,C.clientY),V=e.selection,L=e.findNearestElement(A[0],A[1],!0,!1),Z=e.dragData.possibleDragElements,H=e.hoverData.down,ne=a(C);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,H&&H.unactivate(),e.hoverData.which===3){var $={originalEvent:C,type:"cxttapend",position:{x:A[0],y:A[1]}};if(H?H.emit($):_.emit($),!e.hoverData.cxtDragged){var J={originalEvent:C,type:"cxttap",position:{x:A[0],y:A[1]}};H?H.emit(J):_.emit(J)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(e.hoverData.which===1){if(r(L,["mouseup","tapend","vmouseup"],C,{x:A[0],y:A[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(H,["click","tap","vclick"],C,{x:A[0],y:A[1]}),m=!1,C.timeStamp-k<=_.multiClickDebounceTime()?(y&&clearTimeout(y),m=!0,k=null,r(H,["dblclick","dbltap","vdblclick"],C,{x:A[0],y:A[1]})):(y=setTimeout(function(){m||r(H,["oneclick","onetap","voneclick"],C,{x:A[0],y:A[1]})},_.multiClickDebounceTime()),k=C.timeStamp)),H!=null||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||a(C)||(_.$(n).unselect(["tapunselect"]),Z.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=Z=_.collection()),L!=H||e.dragData.didDrag||e.hoverData.selecting||L!=null&&L._private.selectable&&(e.hoverData.dragging||(_.selectionType()==="additive"||ne?L.selected()?L.unselect(["tapunselect"]):L.select(["tapselect"]):ne||(_.$(n).unmerge(L).unselect(["tapunselect"]),L.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var oe=_.collection(e.getAllInBox(V[0],V[1],V[2],V[3]));e.redrawHint("select",!0),oe.length>0&&e.redrawHint("eles",!0),_.emit({type:"boxend",originalEvent:C,position:{x:A[0],y:A[1]}});var ie=function(pe){return pe.selectable()&&!pe.selected()};_.selectionType()==="additive"||ne||_.$(n).unmerge(oe).unselect(),oe.emit("box").stdFilter(ie).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!V[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var se=H&&H.grabbed();d(Z),se&&(H.emit("freeon"),Z.emit("free"),e.dragData.didDrag&&(H.emit("dragfreeon"),Z.emit("dragfree")))}}V[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,e.hoverData.which=null}},!1);var S,w,D,E,P,T,B,M,z,R,F,N,I,X=function(C){if(!e.scrollingPage){var _=e.cy,A=_.zoom(),V=_.pan(),L=e.projectIntoViewport(C.clientX,C.clientY),Z=[L[0]*A+V.x,L[1]*A+V.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||e.selection[4]!==0)C.preventDefault();else if(_.panningEnabled()&&_.userPanningEnabled()&&_.zoomingEnabled()&&_.userZoomingEnabled()){var H;C.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),H=C.deltaY!=null?C.deltaY/-250:C.wheelDeltaY!=null?C.wheelDeltaY/1e3:C.wheelDelta/1e3,H*=e.wheelSensitivity,C.deltaMode===1&&(H*=33);var ne=_.zoom()*Math.pow(10,H);C.type==="gesturechange"&&(ne=e.gestureStartZoom*C.scale),_.zoom({level:ne,renderedPosition:{x:Z[0],y:Z[1]}}),_.emit(C.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",X,!0),e.registerBinding(t,"scroll",function(C){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout(function(){e.scrollingPage=!1},250)},!0),e.registerBinding(e.container,"gesturestart",function(C){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||C.preventDefault()},!0),e.registerBinding(e.container,"gesturechange",function(C){e.hasTouchStarted||X(C)},!0),e.registerBinding(e.container,"mouseout",function(C){var _=e.projectIntoViewport(C.clientX,C.clientY);e.cy.emit({originalEvent:C,type:"mouseout",position:{x:_[0],y:_[1]}})},!1),e.registerBinding(e.container,"mouseover",function(C){var _=e.projectIntoViewport(C.clientX,C.clientY);e.cy.emit({originalEvent:C,type:"mouseover",position:{x:_[0],y:_[1]}})},!1);var O,Y,j,G,W,q,K,U=function(C,_,A,V){return Math.sqrt((A-C)*(A-C)+(V-_)*(V-_))},re=function(C,_,A,V){return(A-C)*(A-C)+(V-_)*(V-_)};if(e.registerBinding(e.container,"touchstart",O=function(C){if(e.hasTouchStarted=!0,x(C)){g(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var _=e.cy,A=e.touchData.now,V=e.touchData.earlier;if(C.touches[0]){var L=e.projectIntoViewport(C.touches[0].clientX,C.touches[0].clientY);A[0]=L[0],A[1]=L[1]}if(C.touches[1]&&(L=e.projectIntoViewport(C.touches[1].clientX,C.touches[1].clientY),A[2]=L[0],A[3]=L[1]),C.touches[2]&&(L=e.projectIntoViewport(C.touches[2].clientX,C.touches[2].clientY),A[4]=L[0],A[5]=L[1]),C.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var Z=e.findContainerClientCoords();z=Z[0],R=Z[1],F=Z[2],N=Z[3],S=C.touches[0].clientX-z,w=C.touches[0].clientY-R,D=C.touches[1].clientX-z,E=C.touches[1].clientY-R,I=0<=S&&S<=F&&0<=D&&D<=F&&0<=w&&w<=N&&0<=E&&E<=N;var H=_.pan(),ne=_.zoom();if(P=U(S,w,D,E),T=re(S,w,D,E),M=[((B=[(S+D)/2,(w+E)/2])[0]-H.x)/ne,(B[1]-H.y)/ne],T<4e4&&!C.touches[2]){var $=e.findNearestElement(A[0],A[1],!0,!0),J=e.findNearestElement(A[2],A[3],!0,!0);return $&&$.isNode()?($.activate().emit({originalEvent:C,type:"cxttapstart",position:{x:A[0],y:A[1]}}),e.touchData.start=$):J&&J.isNode()?(J.activate().emit({originalEvent:C,type:"cxttapstart",position:{x:A[0],y:A[1]}}),e.touchData.start=J):_.emit({originalEvent:C,type:"cxttapstart",position:{x:A[0],y:A[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(C.touches[2])_.boxSelectionEnabled()&&C.preventDefault();else if(!C.touches[1]){if(C.touches[0]){var oe=e.findNearestElements(A[0],A[1],!0,!0),ie=oe[0];if(ie!=null&&(ie.activate(),e.touchData.start=ie,e.touchData.starts=oe,e.nodeIsGrabbable(ie))){var se=e.dragData.touchDragEles=_.collection(),pe=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),ie.selected()?(pe=_.$(function(Te){return Te.selected()&&e.nodeIsGrabbable(Te)}),u(pe,{addToList:se})):c(ie,{addToList:se}),s(ie);var fe=function(Te){return{originalEvent:C,type:Te,position:{x:A[0],y:A[1]}}};ie.emit(fe("grabon")),pe?pe.forEach(function(Te){Te.emit(fe("grab"))}):ie.emit(fe("grab"))}r(ie,["touchstart","tapstart","vmousedown"],C,{x:A[0],y:A[1]}),ie==null&&(e.data.bgActivePosistion={x:L[0],y:L[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(){e.touchData.singleTouchMoved!==!1||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],C,{x:A[0],y:A[1]})},e.tapholdDuration)}}if(C.touches.length>=1){for(var xe=e.touchData.startPosition=[null,null,null,null,null,null],ge=0;ge<A.length;ge++)xe[ge]=V[ge]=A[ge];var De=C.touches[0];e.touchData.startGPosition=[De.clientX,De.clientY]}}},!1),e.registerBinding(t,"touchmove",Y=function(C){var _=e.touchData.capture;if(_||x(C)){var A=e.selection,V=e.cy,L=e.touchData.now,Z=e.touchData.earlier,H=V.zoom();if(C.touches[0]){var ne=e.projectIntoViewport(C.touches[0].clientX,C.touches[0].clientY);L[0]=ne[0],L[1]=ne[1]}C.touches[1]&&(ne=e.projectIntoViewport(C.touches[1].clientX,C.touches[1].clientY),L[2]=ne[0],L[3]=ne[1]),C.touches[2]&&(ne=e.projectIntoViewport(C.touches[2].clientX,C.touches[2].clientY),L[4]=ne[0],L[5]=ne[1]);var $,J=e.touchData.startGPosition;if(_&&C.touches[0]&&J){for(var oe=[],ie=0;ie<L.length;ie++)oe[ie]=L[ie]-Z[ie];var se=C.touches[0].clientX-J[0],pe=se*se,fe=C.touches[0].clientY-J[1];$=pe+fe*fe>=e.touchTapThreshold2}if(_&&e.touchData.cxt){C.preventDefault();var xe=C.touches[0].clientX-z,ge=C.touches[0].clientY-R,De=C.touches[1].clientX-z,Te=C.touches[1].clientY-R,Ue=re(xe,ge,De,Te);if(Ue/T>=2.25||Ue>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var pt={originalEvent:C,type:"cxttapend",position:{x:L[0],y:L[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(pt),e.touchData.start=null):V.emit(pt)}}if(_&&e.touchData.cxt){pt={originalEvent:C,type:"cxtdrag",position:{x:L[0],y:L[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(pt):V.emit(pt),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var Ke=e.findNearestElement(L[0],L[1],!0,!0);e.touchData.cxtOver&&Ke===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:C,type:"cxtdragout",position:{x:L[0],y:L[1]}}),e.touchData.cxtOver=Ke,Ke&&Ke.emit({originalEvent:C,type:"cxtdragover",position:{x:L[0],y:L[1]}}))}else if(_&&C.touches[2]&&V.boxSelectionEnabled())C.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||V.emit({originalEvent:C,type:"boxstart",position:{x:L[0],y:L[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,A[4]=1,A&&A.length!==0&&A[0]!==void 0?(A[2]=(L[0]+L[2]+L[4])/3,A[3]=(L[1]+L[3]+L[5])/3):(A[0]=(L[0]+L[2]+L[4])/3,A[1]=(L[1]+L[3]+L[5])/3,A[2]=(L[0]+L[2]+L[4])/3+1,A[3]=(L[1]+L[3]+L[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(_&&C.touches[1]&&!e.touchData.didSelect&&V.zoomingEnabled()&&V.panningEnabled()&&V.userZoomingEnabled()&&V.userPanningEnabled()){if(C.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),xt=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var Ze=0;Ze<xt.length;Ze++){var ot=xt[Ze]._private;ot.grabbed=!1,ot.rscratch.inDragLayer=!1}}var ft=e.touchData.start,$e=(xe=C.touches[0].clientX-z,ge=C.touches[0].clientY-R,De=C.touches[1].clientX-z,Te=C.touches[1].clientY-R,U(xe,ge,De,Te)),Qe=$e/P;if(I){var st=(xe-S+(De-D))/2,rn=(ge-w+(Te-E))/2,bt=V.zoom(),Dt=bt*Qe,an=V.pan(),ci=M[0]*bt+an.x,di=M[1]*bt+an.y,cl={x:-Dt/bt*(ci-an.x-st)+ci,y:-Dt/bt*(di-an.y-rn)+di};if(ft&&ft.active()){var xt=e.dragData.touchDragEles;d(xt),e.redrawHint("drag",!0),e.redrawHint("eles",!0),ft.unactivate().emit("freeon"),xt.emit("free"),e.dragData.didDrag&&(ft.emit("dragfreeon"),xt.emit("dragfree"))}V.viewport({zoom:Dt,pan:cl,cancelOnFailedZoom:!0}),V.emit("pinchzoom"),P=$e,S=xe,w=ge,D=De,E=Te,e.pinching=!0}C.touches[0]&&(ne=e.projectIntoViewport(C.touches[0].clientX,C.touches[0].clientY),L[0]=ne[0],L[1]=ne[1]),C.touches[1]&&(ne=e.projectIntoViewport(C.touches[1].clientX,C.touches[1].clientY),L[2]=ne[0],L[3]=ne[1]),C.touches[2]&&(ne=e.projectIntoViewport(C.touches[2].clientX,C.touches[2].clientY),L[4]=ne[0],L[5]=ne[1])}else if(C.touches[0]&&!e.touchData.didSelect){var lt=e.touchData.start,na=e.touchData.last;if(e.hoverData.draggingEles||e.swipePanning||(Ke=e.findNearestElement(L[0],L[1],!0,!0)),_&<!=null&&C.preventDefault(),_&<!=null&&e.nodeIsDraggable(lt))if($){xt=e.dragData.touchDragEles;var hi=!e.dragData.didDrag;hi&&u(xt,{inDragLayer:!0}),e.dragData.didDrag=!0;var Nn={x:0,y:0};te(oe[0])&&te(oe[1])&&(Nn.x+=oe[0],Nn.y+=oe[1],hi&&(e.redrawHint("eles",!0),(gt=e.touchData.dragDelta)&&te(gt[0])&&te(gt[1])&&(Nn.x+=gt[0],Nn.y+=gt[1]))),e.hoverData.draggingEles=!0,xt.silentShift(Nn).emit("position drag"),e.redrawHint("drag",!0),e.touchData.startPosition[0]==Z[0]&&e.touchData.startPosition[1]==Z[1]&&e.redrawHint("eles",!0),e.redraw()}else{var gt;(gt=e.touchData.dragDelta=e.touchData.dragDelta||[]).length===0?(gt.push(oe[0]),gt.push(oe[1])):(gt[0]+=oe[0],gt[1]+=oe[1])}if(r(lt||Ke,["touchmove","tapdrag","vmousemove"],C,{x:L[0],y:L[1]}),lt&<.grabbed()||Ke==na||(na&&na.emit({originalEvent:C,type:"tapdragout",position:{x:L[0],y:L[1]}}),Ke&&Ke.emit({originalEvent:C,type:"tapdragover",position:{x:L[0],y:L[1]}})),e.touchData.last=Ke,_)for(Ze=0;Ze<L.length;Ze++)L[Ze]&&e.touchData.startPosition[Ze]&&$&&(e.touchData.singleTouchMoved=!0);_&&(lt==null||lt.pannable())&&V.panningEnabled()&&V.userPanningEnabled()&&(o(lt,e.touchData.starts)&&(C.preventDefault(),e.data.bgActivePosistion||(e.data.bgActivePosistion=un(e.touchData.startPosition)),e.swipePanning?(V.panBy({x:oe[0]*H,y:oe[1]*H}),V.emit("dragpan")):$&&(e.swipePanning=!0,V.panBy({x:se*H,y:fe*H}),V.emit("dragpan"),lt&&(lt.unactivate(),e.redrawHint("select",!0),e.touchData.start=null))),ne=e.projectIntoViewport(C.touches[0].clientX,C.touches[0].clientY),L[0]=ne[0],L[1]=ne[1])}for(ie=0;ie<L.length;ie++)Z[ie]=L[ie];_&&C.touches.length>0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(C){var _=e.touchData.start;e.touchData.capture=!1,_&&_.unactivate()}),e.registerBinding(t,"touchend",G=function(C){var _=e.touchData.start;if(e.touchData.capture){C.touches.length===0&&(e.touchData.capture=!1),C.preventDefault();var A=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var V,L=e.cy,Z=L.zoom(),H=e.touchData.now,ne=e.touchData.earlier;if(C.touches[0]){var $=e.projectIntoViewport(C.touches[0].clientX,C.touches[0].clientY);H[0]=$[0],H[1]=$[1]}if(C.touches[1]&&($=e.projectIntoViewport(C.touches[1].clientX,C.touches[1].clientY),H[2]=$[0],H[3]=$[1]),C.touches[2]&&($=e.projectIntoViewport(C.touches[2].clientX,C.touches[2].clientY),H[4]=$[0],H[5]=$[1]),_&&_.unactivate(),e.touchData.cxt){if(V={originalEvent:C,type:"cxttapend",position:{x:H[0],y:H[1]}},_?_.emit(V):L.emit(V),!e.touchData.cxtDragged){var J={originalEvent:C,type:"cxttap",position:{x:H[0],y:H[1]}};_?_.emit(J):L.emit(J)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!C.touches[2]&&L.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var oe=L.collection(e.getAllInBox(A[0],A[1],A[2],A[3]));A[0]=void 0,A[1]=void 0,A[2]=void 0,A[3]=void 0,A[4]=0,e.redrawHint("select",!0),L.emit({type:"boxend",originalEvent:C,position:{x:H[0],y:H[1]}}),oe.emit("box").stdFilter(function(Ue){return Ue.selectable()&&!Ue.selected()}).select().emit("boxselect"),oe.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(_!=null&&_.unactivate(),C.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(!C.touches[1]){if(!C.touches[0]){if(!C.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var ie=e.dragData.touchDragEles;if(_!=null){var se=_._private.grabbed;d(ie),e.redrawHint("drag",!0),e.redrawHint("eles",!0),se&&(_.emit("freeon"),ie.emit("free"),e.dragData.didDrag&&(_.emit("dragfreeon"),ie.emit("dragfree"))),r(_,["touchend","tapend","vmouseup","tapdragout"],C,{x:H[0],y:H[1]}),_.unactivate(),e.touchData.start=null}else{var pe=e.findNearestElement(H[0],H[1],!0,!0);r(pe,["touchend","tapend","vmouseup","tapdragout"],C,{x:H[0],y:H[1]})}var fe=e.touchData.startPosition[0]-H[0],xe=fe*fe,ge=e.touchData.startPosition[1]-H[1],De=(xe+ge*ge)*Z*Z;e.touchData.singleTouchMoved||(_||L.$(":selected").unselect(["tapunselect"]),r(_,["tap","vclick"],C,{x:H[0],y:H[1]}),W=!1,C.timeStamp-K<=L.multiClickDebounceTime()?(q&&clearTimeout(q),W=!0,K=null,r(_,["dbltap","vdblclick"],C,{x:H[0],y:H[1]})):(q=setTimeout(function(){W||r(_,["onetap","voneclick"],C,{x:H[0],y:H[1]})},L.multiClickDebounceTime()),K=C.timeStamp)),_!=null&&!e.dragData.didDrag&&_._private.selectable&&De<e.touchTapThreshold2&&!e.pinching&&(L.selectionType()==="single"?(L.$(n).unmerge(_).unselect(["tapunselect"]),_.select(["tapselect"])):_.selected()?_.unselect(["tapunselect"]):_.select(["tapselect"]),e.redrawHint("eles",!0)),e.touchData.singleTouchMoved=!0}}}for(var Te=0;Te<H.length;Te++)ne[Te]=H[Te];e.dragData.didDrag=!1,C.touches.length===0&&(e.touchData.dragDelta=[],e.touchData.startPosition=[null,null,null,null,null,null],e.touchData.startGPosition=null,e.touchData.didSelect=!1),C.touches.length<2&&(C.touches.length===1&&(e.touchData.startGPosition=[C.touches[0].clientX,C.touches[0].clientY]),e.pinching=!1,e.redrawHint("eles",!0),e.redraw())}},!1),typeof TouchEvent>"u"){var ae=[],de=function(C){return{clientX:C.clientX,clientY:C.clientY,force:1,identifier:C.pointerId,pageX:C.pageX,pageY:C.pageY,radiusX:C.width/2,radiusY:C.height/2,screenX:C.screenX,screenY:C.screenY,target:C.target}},ue=function(C){ae.push(function(_){return{event:_,touch:de(_)}}(C))},Q=function(C){for(var _=0;_<ae.length;_++)if(ae[_].event.pointerId===C.pointerId)return void ae.splice(_,1)},le=function(C){C.touches=ae.map(function(_){return _.touch})},ee=function(C){return C.pointerType==="mouse"||C.pointerType===4};e.registerBinding(e.container,"pointerdown",function(C){ee(C)||(C.preventDefault(),ue(C),le(C),O(C))}),e.registerBinding(e.container,"pointerup",function(C){ee(C)||(Q(C),le(C),G(C))}),e.registerBinding(e.container,"pointercancel",function(C){ee(C)||(Q(C),le(C),j())}),e.registerBinding(e.container,"pointermove",function(C){ee(C)||(C.preventDefault(),function(_){var A=ae.filter(function(V){return V.event.pointerId===_.pointerId})[0];A.event=_,A.touch=de(_)}(C),le(C),Y(C))})}};var Ft={generatePolygon:function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,draw:function(n,r,a,o,i,s){this.renderer.nodeShapeImpl("polygon",n,r,a,o,i,this.points)},intersectLine:function(n,r,a,o,i,s,l,u){return Hn(i,s,this.points,n,r,a/2,o/2,l)},checkPoint:function(n,r,a,o,i,s,l,u){return Et(n,r,this.points,s,l,o,i,[0,-1],a)}}}};Ft.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,r,a,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a)},intersectLine:function(e,t,n,r,a,o,i,s){return function(l,u,c,d,h,g){var p=c-l,v=d-u;p/=h,v/=g;var b=Math.sqrt(p*p+v*v),f=b-1;if(f<0)return[];var y=f/b;return[(c-l)*y+l,(d-u)*y+u]}(a,o,e,t,n/2+i,r/2+i)},checkPoint:function(e,t,n,r,a,o,i,s){return Ht(e,t,r,a,o,i,n)}}},Ft.generateRoundPolygon=function(e,t){return this.nodeShapes[e]={renderer:this,name:e,points:t,getOrCreateCorners:function(n,r,a,o,i,s,l){if(s[l]!==void 0&&s[l+"-cx"]===n&&s[l+"-cy"]===r)return s[l];s[l]=new Array(t.length/2),s[l+"-cx"]=n,s[l+"-cy"]=r;var u=a/2,c=o/2;i=i==="auto"?Ki(a,o):i;for(var d=new Array(t.length/2),h=0;h<t.length/2;h++)d[h]={x:n+u*t[2*h],y:r+c*t[2*h+1]};var g,p,v,b,f=d.length;for(p=d[f-1],g=0;g<f;g++)v=d[g%f],b=d[(g+1)%f],s[l][g]=ni(p,v,b,i),p=v,v=b;return s[l]},draw:function(n,r,a,o,i,s,l){this.renderer.nodeShapeImpl("round-polygon",n,r,a,o,i,this.points,this.getOrCreateCorners(r,a,o,i,s,l,"drawCorners"))},intersectLine:function(n,r,a,o,i,s,l,u,c){return function(d,h,g,p,v,b,f,y,m){var k,x=[],S=new Array(2*g.length);m.forEach(function(B,M){M===0?(S[S.length-2]=B.startX,S[S.length-1]=B.startY):(S[4*M-2]=B.startX,S[4*M-1]=B.startY),S[4*M]=B.stopX,S[4*M+1]=B.stopY,(k=Wn(d,h,p,v,B.cx,B.cy,B.radius)).length!==0&&x.push(k[0],k[1])});for(var w=0;w<S.length/4;w++)(k=Nt(d,h,p,v,S[4*w],S[4*w+1],S[4*w+2],S[4*w+3],!1)).length!==0&&x.push(k[0],k[1]);if(x.length>2){for(var D=[x[0],x[1]],E=Math.pow(D[0]-d,2)+Math.pow(D[1]-h,2),P=1;P<x.length/2;P++){var T=Math.pow(x[2*P]-d,2)+Math.pow(x[2*P+1]-h,2);T<=E&&(D[0]=x[2*P],D[1]=x[2*P+1],E=T)}return D}return x}(i,s,this.points,n,r,0,0,0,this.getOrCreateCorners(n,r,a,o,u,c,"corners"))},checkPoint:function(n,r,a,o,i,s,l,u,c){return function(d,h,g,p,v,b,f,y){for(var m=new Array(2*g.length),k=0;k<y.length;k++){var x=y[k];if(m[4*k+0]=x.startX,m[4*k+1]=x.startY,m[4*k+2]=x.stopX,m[4*k+3]=x.stopY,Math.pow(x.cx-d,2)+Math.pow(x.cy-h,2)<=Math.pow(x.radius,2))return!0}return et(d,h,m)}(n,r,this.points,0,0,0,0,this.getOrCreateCorners(s,l,o,i,u,c,"corners"))}}},Ft.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Ge(4,0),draw:function(e,t,n,r,a,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a,this.points,o)},intersectLine:function(e,t,n,r,a,o,i,s){return Wi(a,o,e,t,n,r,i,s)},checkPoint:function(e,t,n,r,a,o,i,s){var l=r/2,u=a/2;s=s==="auto"?Kt(r,a):s;var c=2*(s=Math.min(l,u,s));return!!Et(e,t,this.points,o,i,r,a-c,[0,-1],n)||!!Et(e,t,this.points,o,i,r-c,a,[0,-1],n)||!!Ht(e,t,c,c,o-l+s,i-u+s,n)||!!Ht(e,t,c,c,o+l-s,i-u+s,n)||!!Ht(e,t,c,c,o+l-s,i+u-s,n)||!!Ht(e,t,c,c,o-l+s,i+u-s,n)}}},Ft.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:Ge(4,0),draw:function(e,t,n,r,a,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a,null,o)},generateCutTrianglePts:function(e,t,n,r,a){var o=a==="auto"?this.cornerLength:a,i=t/2,s=e/2,l=n-s,u=n+s,c=r-i,d=r+i;return{topLeft:[l,c+o,l+o,c,l+o,c+o],topRight:[u-o,c,u,c+o,u-o,c+o],bottomRight:[u,d-o,u-o,d,u-o,d-o],bottomLeft:[l+o,d,l,d-o,l+o,d-o]}},intersectLine:function(e,t,n,r,a,o,i,s){var l=this.generateCutTrianglePts(n+2*i,r+2*i,e,t,s),u=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return Hn(a,o,u,e,t)},checkPoint:function(e,t,n,r,a,o,i,s){var l=s==="auto"?this.cornerLength:s;if(Et(e,t,this.points,o,i,r,a-2*l,[0,-1],n)||Et(e,t,this.points,o,i,r-2*l,a,[0,-1],n))return!0;var u=this.generateCutTrianglePts(r,a,o,i);return et(e,t,u.topLeft)||et(e,t,u.topRight)||et(e,t,u.bottomRight)||et(e,t,u.bottomLeft)}}},Ft.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Ge(4,0),draw:function(e,t,n,r,a,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a)},intersectLine:function(e,t,n,r,a,o,i,s){var l=this.generateBarrelBezierPts(n+2*i,r+2*i,e,t),u=function(d){var h=cn({x:d[0],y:d[1]},{x:d[2],y:d[3]},{x:d[4],y:d[5]},.15),g=cn({x:d[0],y:d[1]},{x:d[2],y:d[3]},{x:d[4],y:d[5]},.5),p=cn({x:d[0],y:d[1]},{x:d[2],y:d[3]},{x:d[4],y:d[5]},.85);return[d[0],d[1],h.x,h.y,g.x,g.y,p.x,p.y,d[4],d[5]]},c=[].concat(u(l.topLeft),u(l.topRight),u(l.bottomRight),u(l.bottomLeft));return Hn(a,o,c,e,t)},generateBarrelBezierPts:function(e,t,n,r){var a=t/2,o=e/2,i=n-o,s=n+o,l=r-a,u=r+a,c=ya(e,t),d=c.heightOffset,h=c.widthOffset,g=c.ctrlPtOffsetPct*e,p={topLeft:[i,l+d,i+g,l,i+h,l],topRight:[s-h,l,s-g,l,s,l+d],bottomRight:[s,u-d,s-g,u,s-h,u],bottomLeft:[i+h,u,i+g,u,i,u-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,a,o,i,s){var l=ya(r,a),u=l.heightOffset,c=l.widthOffset;if(Et(e,t,this.points,o,i,r,a-2*u,[0,-1],n)||Et(e,t,this.points,o,i,r-2*c,a,[0,-1],n))return!0;for(var d=this.generateBarrelBezierPts(r,a,o,i),h=function(x,S,w){var D,E,P=w[4],T=w[2],B=w[0],M=w[5],z=w[1],R=Math.min(P,B),F=Math.max(P,B),N=Math.min(M,z),I=Math.max(M,z);if(R<=x&&x<=F&&N<=S&&S<=I){var X=[(D=P)-2*(E=T)+B,2*(E-D),D],O=function(Y,j,G,W){var q=j*j-4*Y*(G-=W);if(q<0)return[];var K=Math.sqrt(q),U=2*Y;return[(-j+K)/U,(-j-K)/U]}(X[0],X[1],X[2],x).filter(function(Y){return 0<=Y&&Y<=1});if(O.length>0)return O[0]}return null},g=Object.keys(d),p=0;p<g.length;p++){var v=d[g[p]],b=h(e,t,v);if(b!=null){var f=v[5],y=v[3],m=v[1],k=Ie(f,y,m,b);if(v.isTop&&k<=t||v.isBottom&&t<=k)return!0}}return!1}}},Ft.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Ge(4,0),draw:function(e,t,n,r,a,o){this.renderer.nodeShapeImpl(this.name,e,t,n,r,a,this.points,o)},intersectLine:function(e,t,n,r,a,o,i,s){var l=t-(r/2+i),u=Nt(a,o,e,t,e-(n/2+i),l,e+(n/2+i),l,!1);return u.length>0?u:Wi(a,o,e,t,n,r,i,s)},checkPoint:function(e,t,n,r,a,o,i,s){var l=2*(s=s==="auto"?Kt(r,a):s);if(Et(e,t,this.points,o,i,r,a-l,[0,-1],n)||Et(e,t,this.points,o,i,r-l,a,[0,-1],n))return!0;var u=r/2+2*n,c=a/2+2*n;return!!et(e,t,[o-u,i-c,o-u,i,o+u,i,o+u,i-c])||!!Ht(e,t,l,l,o+r/2-s,i+a/2-s,n)||!!Ht(e,t,l,l,o-r/2+s,i+a/2-s,n)}}},Ft.registerNodeShapes=function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",Ge(3,0)),this.generateRoundPolygon("round-triangle",Ge(3,0)),this.generatePolygon("rectangle",Ge(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",Ge(5,0)),this.generateRoundPolygon("round-pentagon",Ge(5,0)),this.generatePolygon("hexagon",Ge(6,0)),this.generateRoundPolygon("round-hexagon",Ge(6,0)),this.generatePolygon("heptagon",Ge(7,0)),this.generateRoundPolygon("round-heptagon",Ge(7,0)),this.generatePolygon("octagon",Ge(8,0)),this.generateRoundPolygon("round-octagon",Ge(8,0));var r=new Array(20),a=va(5,0),o=va(5,Math.PI/5),i=.5*(3-Math.sqrt(5));i*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=i,o[2*s+1]*=i;for(s=0;s<5;s++)r[4*s]=a[2*s],r[4*s+1]=a[2*s+1],r[4*s+2]=o[2*s],r[4*s+3]=o[2*s+1];r=Hi(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.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),e.makePolygon=function(u){var c,d="polygon-"+u.join("$");return(c=this[d])?c:t.generatePolygon(d,u)}};var Xs={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(e){e=e||Oi();var t=this;t.averageRedrawTime===void 0&&(t.averageRedrawTime=0),t.lastRedrawTime===void 0&&(t.lastRedrawTime=0),t.lastDrawTime===void 0&&(t.lastDrawTime=0),t.requestedFrame=!0,t.renderOptions=e},beforeRender:function(e,t){if(!this.destroyed){t==null&&Be("Priority is not optional for beforeRender");var n=this.beforeRenderCallbacks;n.push({fn:e,priority:t}),n.sort(function(r,a){return a.priority-r.priority})}}},qs=function(e,t,n){for(var r=e.beforeRenderCallbacks,a=0;a<r.length;a++)r[a].fn(t,n)};Xs.startRenderLoop=function(){var e=this,t=e.cy;e.renderLoopStarted||(e.renderLoopStarted=!0,pr(function n(r){if(!e.destroyed){if(!t.batching())if(e.requestedFrame&&!e.skipFrame){qs(e,!0,r);var a=wt();e.render(e.renderOptions);var o=e.lastDrawTime=wt();e.averageRedrawTime===void 0&&(e.averageRedrawTime=o-a),e.redrawCount===void 0&&(e.redrawCount=0),e.redrawCount++,e.redrawTotalTime===void 0&&(e.redrawTotalTime=0);var i=o-a;e.redrawTotalTime+=i,e.lastRedrawTime=i,e.averageRedrawTime=e.averageRedrawTime/2+i/2,e.requestedFrame=!1}else qs(e,!1,r);e.skipFrame=!1,pr(n)}}))};var Ys=function(e){this.init(e)},Tn=Ys.prototype;Tn.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Tn.init=function(e){var t=this;t.options=e,t.cy=e.cy;var n=t.container=e.cy.container(),r=t.cy.window();if(r){var a=r.document,o=a.head,i="__________cytoscape_stylesheet",s="__________cytoscape_container",l=a.getElementById(i)!=null;if(n.className.indexOf(s)<0&&(n.className=(n.className||"")+" "+s),!l){var u=a.createElement("style");u.id=i,u.textContent="."+s+" { position: relative; }",o.insertBefore(u,o.children[0])}r.getComputedStyle(n).getPropertyValue("position")==="static"&&we("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=te(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()},Tn.notify=function(e,t){var n=this,r=n.cy;this.destroyed||(e!=="init"?e!=="destroy"?((e==="add"||e==="remove"||e==="move"&&r.hasCompoundNodes()||e==="load"||e==="zorder"||e==="mount")&&n.invalidateCachedZSortedEles(),e==="viewport"&&n.redrawHint("select",!0),e!=="load"&&e!=="resize"&&e!=="mount"||(n.invalidateContainerClientCoordsCache(),n.matchCanvasSize(n.container)),n.redrawHint("eles",!0),n.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()):n.destroy():n.load())},Tn.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{}},Tn.isHeadless=function(){return!1},[Jd,Fs,oh,ir,Ft,Xs].forEach(function(e){he(Tn,e)});var ai=1e3/60,js=function(e){return function(){var t=this,n=this.renderer;if(!t.dequeueingSetup){t.dequeueingSetup=!0;var r=hr(function(){n.redrawHint("eles",!0),n.redrawHint("drag",!0),n.redraw()},e.deqRedrawThreshold),a=e.priority||ca;n.beforeRender(function(o,i){var s=wt(),l=n.averageRedrawTime,u=n.lastRedrawTime,c=[],d=n.cy.extent(),h=n.getPixelRatio();for(o||n.flushRenderedStyleQueue();;){var g=wt(),p=g-s,v=g-i;if(u<ai){var b=ai-(o?l:0);if(v>=e.deqFastCost*b)break}else if(o){if(p>=e.deqCost*u||p>=e.deqAvgCost*l)break}else if(v>=e.deqNoDrawCost*ai)break;var f=e.deq(t,h,d);if(!(f.length>0))break;for(var y=0;y<f.length;y++)c.push(f[y])}c.length>0&&(e.onDeqd(t,c),!o&&e.shouldRedraw(t,c,h,d)&&r())},a(t))}}},sh=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gr;ra(this,e),this.idsByKey=new yt,this.keyForId=new yt,this.cachesByLvl=new yt,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return aa(e,[{key:"getIdsFor",value:function(t){t==null&&Be("Can not get id list for null key");var n=this.idsByKey,r=this.idsByKey.get(t);return r||(r=new ln,n.set(t,r)),r}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),r=this.keyForId.get(n),a=this.getKey(t);this.deleteIdForKey(r,n),this.addIdForKey(a,n),this.keyForId.set(n,a)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteIdForKey(r,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id();return this.keyForId.get(n)!==this.getKey(t)}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,r=this.lvls,a=n.get(t);return a||(a=new yt,n.set(t,a),r.push(t)),a}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var r=this.getKey(t),a=this.getCache(r,n);return a!=null&&this.updateKeyMappingFor(t),a}},{key:"getForCachedKey",value:function(t,n){var r=this.keyForId.get(t.id());return this.getCache(r,n)}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var r=this.getKey(t);return this.hasCache(r,n)}},{key:"setCache",value:function(t,n,r){r.key=t,this.getCachesAt(n).set(t,r)}},{key:"set",value:function(t,n,r){var a=this.getKey(t);this.setCache(a,n,r),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var r=this.getKey(t);this.deleteCache(r,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(r){return n.deleteCache(t,r)})}},{key:"invalidate",value:function(t){var n=t.id(),r=this.keyForId.get(n);this.deleteKeyMappingFor(t);var a=this.doesEleInvalidateKey(t);return a&&this.invalidateKey(r),a||this.getNumberOfIdsForKey(r)===0}}]),e}(),Mn={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},lh=Re({getKey:null,doesEleInvalidateKey:gr,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Li,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),or=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=lh(t);he(n,r),n.lookup=new sh(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},ze=or.prototype;ze.reasons=Mn,ze.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},ze.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},ze.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new Yn(function(e,t){return t.reqs-e.reqs})},ze.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},ze.getElement=function(e,t,n,r,a){var o=this,i=this.renderer,s=i.cy.zoom(),l=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()||!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(r==null&&(r=Math.ceil(pa(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=i.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var g,p=l.get(e,r);if(p&&p.invalidated&&(p.invalidated=!1,p.texture.invalidatedWidth-=p.width),p)return p;if(g=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var v=o.getTextureQueue(g),b=v[v.length-2],f=function(){return o.recycleTexture(g,d)||o.addTexture(g,d)};b||(b=v[v.length-1]),b||(b=f()),b.width-b.usedWidth<d&&(b=f());for(var y,m=function(R){return R&&R.scaledLabelShown===h},k=a&&a===Mn.dequeue,x=a&&a===Mn.highQuality,S=a&&a===Mn.downscale,w=r+1;w<=3;w++){var D=l.get(e,w);if(D){y=D;break}}var E=y&&y.level===r+1?y:null,P=function(){b.context.drawImage(E.texture.canvas,E.x,0,E.width,E.height,b.usedWidth,0,d,c)};if(b.context.setTransform(1,0,0,1,0,0),b.context.clearRect(b.usedWidth,0,d,g),m(E))P();else if(m(y)){if(!x)return o.queueElement(e,y.level-1),y;for(var T=y.level;T>r;T--)E=o.getElement(e,t,n,T,Mn.downscale);P()}else{var B;if(!k&&!x&&!S)for(var M=r-1;M>=-4;M--){var z=l.get(e,M);if(z){B=z;break}}if(m(B))return o.queueElement(e,r),B;b.context.translate(b.usedWidth,0),b.context.scale(u,u),this.drawElement(b.context,e,t,h,!1),b.context.scale(1/u,1/u),b.context.translate(-b.usedWidth,0)}return p={x:b.usedWidth,texture:b,level:r,scale:u,width:d,height:c,scaledLabelShown:h},b.usedWidth+=Math.ceil(d+8),b.eleCaches.push(p),l.set(e,r,p),o.checkTextureFullness(b),p},ze.invalidateElements=function(e){for(var t=0;t<e.length;t++)this.invalidateElement(e[t])},ze.invalidateElement=function(e){var t=this,n=t.lookup,r=[];if(n.isInvalid(e)){for(var a=-4;a<=3;a++){var o=n.getForCachedKey(e,a);o&&r.push(o)}if(n.invalidate(e))for(var i=0;i<r.length;i++){var s=r[i],l=s.texture;l.invalidatedWidth+=s.width,s.invalidated=!0,t.checkTextureUtility(l)}t.removeFromQueue(e)}},ze.checkTextureUtility=function(e){e.invalidatedWidth>=.2*e.width&&this.retireTexture(e)},ze.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Bt(t,e):e.fullnessChecks++},ze.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Bt(n,e),e.retired=!0;for(var a=e.eleCaches,o=0;o<a.length;o++){var i=a[o];r.deleteCache(i.key,i.level)}da(a),this.getRetiredTextureQueue(t).push(e)},ze.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},ze.recycleTexture=function(e,t){for(var n=this.getTextureQueue(e),r=this.getRetiredTextureQueue(e),a=0;a<r.length;a++){var o=r[a];if(o.width>=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,da(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Bt(r,o),n.push(o),o}},ze.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),a=this.getKey(e),o=r[a];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var i={eles:e.spawn().merge(e),level:t,reqs:1,key:a};n.push(i),r[a]=i}},ze.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),a=[],o=t.lookup,i=0;i<1&&n.size()>0;i++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){a.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,Mn.dequeue)}}return a},ze.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),a=n[r];a!=null&&(a.eles.length===1?(a.reqs=ua,t.updateItem(a),t.pop(),n[r]=null):a.eles.unmerge(e))},ze.onDequeue=function(e){this.onDequeues.push(e)},ze.offDequeue=function(e){Bt(this.onDequeues,e)},ze.setupDequeueing=js({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 a=0;a<t.length;a++)for(var o=t[a].eles,i=0;i<o.length;i++){var s=o[i].boundingBox();if(fa(s,r))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var Ws=function(e){var t=this,n=t.renderer=e,r=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=wt()-500,t.skipping=!1,t.eleTxrDeqs=r.collection(),t.scheduleElementRefinement=hr(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},50),n.beforeRender(function(a,o){o-t.lastInvalidationTime<=250?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new Yn(function(a,o){return o.reqs-a.reqs}),t.setupDequeueing()},Xe=Ws.prototype,Hs=0,uh=Math.pow(2,53)-1;Xe.makeLayer=function(e,t){var n=Math.pow(2,t),r=Math.ceil(e.w*n),a=Math.ceil(e.h*n),o=this.renderer.makeOffscreenCanvas(r,a),i={id:Hs=++Hs%uh,bb:e,level:t,width:r,height:a,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=i.context,l=-i.bb.x1,u=-i.bb.y1;return s.scale(n,n),s.translate(l,u),i},Xe.getLayers=function(e,t,n){var r=this,a=r.renderer.cy.zoom(),o=r.firstGet;if(r.firstGet=!1,n==null){if((n=Math.ceil(pa(a*t)))<-4)n=-4;else if(a>=3.99||n>2)return null}r.validateLayersElesOrdering(n,e);var i,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;(function(){var k=function(D){if(r.validateLayersElesOrdering(D,e),r.levelIsComplete(D,e))return s=l[D],!0},x=function(D){if(!s)for(var E=n+D;-4<=E&&E<=2&&!k(E);E+=D);};x(1),x(-1);for(var S=c.length-1;S>=0;S--){var w=c[S];w.invalid&&Bt(c,w)}})();var d=function(k){var x=(k=k||{}).after;if(function(){if(!i){i=Je();for(var D=0;D<e.length;D++)qi(i,e[D].boundingBox())}}(),i.w*u*(i.h*u)>16e6)return null;var S=r.makeLayer(i,n);if(x!=null){var w=c.indexOf(x)+1;c.splice(w,0,S)}else(k.insert===void 0||k.insert)&&c.unshift(S);return S};if(r.skipping&&!o)return null;for(var h=null,g=e.length/1,p=!o,v=0;v<e.length;v++){var b=e[v],f=b._private.rscratch,y=f.imgLayerCaches=f.imgLayerCaches||{},m=y[n];if(m)h=m;else{if((!h||h.eles.length>=g||!ji(h.bb,b.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||p?r.queueLayer(h,b):r.drawEleInLayer(h,b,n,t),h.eles.push(b),y[n]=h}}return s||(p?null:c)},Xe.getEleLevelForLayerLevel=function(e,t){return e},Xe.drawEleInLayer=function(e,t,n,r){var a=this.renderer,o=e.context,i=t.boundingBox();i.w!==0&&i.h!==0&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),a.setImgSmoothing(o,!1),a.drawCachedElement(o,t,null,null,n,!0),a.setImgSmoothing(o,!0))},Xe.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||n.length===0)return!1;for(var r=0,a=0;a<n.length;a++){var o=n[a];if(o.reqs>0||o.invalid)return!1;r+=o.eles.length}return r===t.length},Xe.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r<n.length;r++){for(var a=n[r],o=-1,i=0;i<t.length;i++)if(a.eles[0]===t[i]){o=i;break}if(o<0)this.invalidateLayer(a);else{var s=o;for(i=0;i<a.eles.length;i++)if(a.eles[i]!==t[s+i]){this.invalidateLayer(a);break}}}},Xe.updateElementsInLayers=function(e,t){for(var n=Ln(e[0]),r=0;r<e.length;r++)for(var a=n?null:e[r],o=n?e[r]:e[r].ele,i=o._private.rscratch,s=i.imgLayerCaches=i.imgLayerCaches||{},l=-4;l<=2;l++){var u=s[l];u&&(a&&this.getEleLevelForLayerLevel(u.level)!==a.level||t(u,o,a))}},Xe.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},Xe.invalidateElements=function(e){var t=this;e.length!==0&&(t.lastInvalidationTime=wt(),e.length!==0&&t.haveLayers()&&t.updateElementsInLayers(e,function(n,r,a){t.invalidateLayer(n)}))},Xe.invalidateLayer=function(e){if(this.lastInvalidationTime=wt(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Bt(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var a=0;a<n.length;a++){var o=n[a]._private.rscratch.imgLayerCaches;o&&(o[t]=null)}}},Xe.refineElementTextures=function(e){var t=this;t.updateElementsInLayers(e,function(n,r,a){var o=n.replacement;if(o||((o=n.replacement=t.makeLayer(n.bb,n.level)).replaces=n,o.eles=n.eles),!o.reqs)for(var i=0;i<o.eles.length;i++)t.queueLayer(o,o.eles[i])})},Xe.enqueueElementRefinement=function(e){this.eleTxrDeqs.merge(e),this.scheduleElementRefinement()},Xe.queueLayer=function(e,t){var n=this.layersQueue,r=e.elesQueue,a=r.hasId=r.hasId||{};if(!e.replacement){if(t){if(a[t.id()])return;r.push(t),a[t.id()]=!0}e.reqs?(e.reqs++,n.updateItem(e)):(e.reqs=1,n.push(e))}},Xe.dequeue=function(e){for(var t=this,n=t.layersQueue,r=[],a=0;a<1&&n.size()!==0;){var o=n.peek();if(o.replacement)n.pop();else if(o.replaces&&o!==o.replaces.replacement)n.pop();else if(o.invalid)n.pop();else{var i=o.elesQueue.shift();i&&(t.drawEleInLayer(o,i,o.level,e),a++),r.length===0&&r.push(!0),o.elesQueue.length===0&&(n.pop(),o.reqs=0,o.replaces&&t.applyLayerReplacement(o),t.requestRedraw())}}return r},Xe.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 a=0;a<e.eles.length;a++){var o=e.eles[a]._private,i=o.imgLayerCaches=o.imgLayerCaches||{};i&&(i[e.level]=e)}this.requestRedraw()}},Xe.requestRedraw=hr(function(){var e=this.renderer;e.redrawHint("eles",!0),e.redrawHint("drag",!0),e.redraw()},100),Xe.setupDequeueing=js({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:ca,shouldRedraw:Li,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Ks,Gs={};function ch(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.lineTo(r.x,r.y)}}function dh(e,t,n){for(var r,a=0;a<t.length;a++){var o=t[a];a===0&&(r=o),e.lineTo(o.x,o.y)}e.quadraticCurveTo(n.x,n.y,r.x,r.y)}function Us(e,t,n){e.beginPath&&e.beginPath();for(var r=t,a=0;a<r.length;a++){var o=r[a];e.lineTo(o.x,o.y)}var i=n,s=n[0];for(e.moveTo(s.x,s.y),a=1;a<i.length;a++)o=i[a],e.lineTo(o.x,o.y);e.closePath&&e.closePath()}function hh(e,t,n,r,a){e.beginPath&&e.beginPath(),e.arc(n,r,a,0,2*Math.PI,!1);var o=t,i=o[0];e.moveTo(i.x,i.y);for(var s=0;s<o.length;s++){var l=o[s];e.lineTo(l.x,l.y)}e.closePath&&e.closePath()}function ph(e,t,n,r){e.arc(t,n,r,0,2*Math.PI,!1)}Gs.arrowShapeImpl=function(e){return(Ks||(Ks={polygon:ch,"triangle-backcurve":dh,"triangle-tee":Us,"circle-triangle":hh,"triangle-cross":Us,circle:ph}))[e]};var Bn={drawElement:function(e,t,n,r,a,o){t.isNode()?this.drawNode(e,t,n,r,a,o):this.drawEdge(e,t,n,r,a,o)},drawElementOverlay:function(e,t){t.isNode()?this.drawNodeOverlay(e,t):this.drawEdgeOverlay(e,t)},drawElementUnderlay:function(e,t){t.isNode()?this.drawNodeUnderlay(e,t):this.drawEdgeUnderlay(e,t)},drawCachedElementPortion:function(e,t,n,r,a,o,i,s){var l=this,u=n.getBoundingBox(t);if(u.w!==0&&u.h!==0){var c=n.getElement(t,u,r,a,o);if(c!=null){var d=s(l,t);if(d===0)return;var h,g,p,v,b,f,y=i(l,t),m=u.x1,k=u.y1,x=u.w,S=u.h;if(y!==0){var w=n.getRotationPoint(t);p=w.x,v=w.y,e.translate(p,v),e.rotate(y),(b=l.getImgSmoothing(e))||l.setImgSmoothing(e,!0);var D=n.getRotationOffset(t);h=D.x,g=D.y}else h=m,g=k;d!==1&&(f=e.globalAlpha,e.globalAlpha=f*d),e.drawImage(c.texture.canvas,c.x,0,c.width,c.height,h,g,x,S),d!==1&&(e.globalAlpha=f),y!==0&&(e.rotate(-y),e.translate(-p,-v),b||l.setImgSmoothing(e,!1))}else n.drawElement(e,t)}}},fh=function(){return 0},gh=function(e,t){return e.getTextAngle(t,null)},vh=function(e,t){return e.getTextAngle(t,"source")},yh=function(e,t){return e.getTextAngle(t,"target")},mh=function(e,t){return t.effectiveOpacity()},ii=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Bn.drawCachedElement=function(e,t,n,r,a,o){var i=this,s=i.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,h=t.boundingBox(),g=o===!0?l.reasons.highQuality:null;if(h.w!==0&&h.h!==0&&t.visible()&&(!r||fa(h,r))){var p=t.isEdge(),v=t.element()._private.rscratch.badLine;i.drawElementUnderlay(e,t),i.drawCachedElementPortion(e,t,l,n,a,g,fh,mh),p&&v||i.drawCachedElementPortion(e,t,u,n,a,g,gh,ii),p&&!v&&(i.drawCachedElementPortion(e,t,c,n,a,g,vh,ii),i.drawCachedElementPortion(e,t,d,n,a,g,yh,ii)),i.drawElementOverlay(e,t)}},Bn.drawElements=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];this.drawElement(e,r)}},Bn.drawCachedElements=function(e,t,n,r){for(var a=0;a<t.length;a++){var o=t[a];this.drawCachedElement(e,o,n,r)}},Bn.drawCachedNodes=function(e,t,n,r){for(var a=0;a<t.length;a++){var o=t[a];o.isNode()&&this.drawCachedElement(e,o,n,r)}},Bn.drawLayeredElements=function(e,t,n,r){var a=this.data.lyrTxrCache.getLayers(t,n);if(a)for(var o=0;o<a.length;o++){var i=a[o],s=i.bb;s.w!==0&&s.h!==0&&e.drawImage(i.canvas,s.x1,s.y1,s.w,s.h)}else this.drawCachedElements(e,t,n,r)};var Xt={drawEdge:function(e,t,n){var r=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],a=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5],i=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&s.allpts!=null&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,g=t.pstyle("width").pfValue,p=t.pstyle("line-cap").value,v=t.pstyle("line-outline-width").value,b=t.pstyle("line-outline-color").value,f=u*c,y=u*c,m=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f;d==="straight-triangle"?(i.eleStrokeStyle(e,t,E),i.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=g,e.lineCap=p,i.eleStrokeStyle(e,t,E),i.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},k=function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;i.drawArrowheads(e,t,E)};if(e.lineJoin="round",t.pstyle("ghost").value==="yes"){var x=t.pstyle("ghost-offset-x").pfValue,S=t.pstyle("ghost-offset-y").pfValue,w=t.pstyle("ghost-opacity").value,D=f*w;e.translate(x,S),m(D),k(D),e.translate(-x,-S)}else(function(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f;e.lineWidth=g+v,e.lineCap=p,v>0?(i.colorStrokeStyle(e,b[0],b[1],b[2],E),d==="straight-triangle"?i.drawEdgeTrianglePath(t,e,s.allpts):(i.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"})();a&&i.drawEdgeUnderlay(e,t),m(),k(),a&&i.drawEdgeOverlay(e,t),i.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},Zs=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(r!==0){var a=this,o=a.usePaths(),i=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,i.edgeType!=="self"||o?t.lineCap="round":t.lineCap="butt",a.colorStrokeStyle(t,l[0],l[1],l[2],r),a.drawEdgePath(n,t,i.allpts,"solid")}}}};Xt.drawEdgeOverlay=Zs("overlay"),Xt.drawEdgeUnderlay=Zs("underlay"),Xt.drawEdgePath=function(e,t,n,r){var a,o=e._private.rscratch,i=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var d=n.join("$");o.pathCacheKey&&o.pathCacheKey===d?(a=t=o.pathCache,s=!0):(a=t=new Path2D,o.pathCacheKey=d,o.pathCache=a)}if(i.setLineDash)switch(r){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=c;break;case"solid":i.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"haystack":for(var g=2;g+1<n.length;g+=2)t.lineTo(n[g],n[g+1]);break;case"segments":if(o.isRound){var p,v=vi(o.roundCorners);try{for(v.s();!(p=v.n()).done;)Ls(t,p.value)}catch(f){v.e(f)}finally{v.f()}t.lineTo(n[n.length-2],n[n.length-1])}else for(var b=2;b+1<n.length;b+=2)t.lineTo(n[b],n[b+1])}t=i,l?t.stroke(a):t.stroke(),t.setLineDash&&t.setLineDash([])},Xt.drawEdgeTrianglePath=function(e,t,n){t.fillStyle=t.strokeStyle;for(var r=e.pstyle("width").pfValue,a=0;a+1<n.length;a+=2){var o=[n[a+2]-n[a],n[a+3]-n[a+1]],i=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/i,-o[0]/i],l=[s[0]*r/2,s[1]*r/2];t.beginPath(),t.moveTo(n[a]-l[0],n[a+1]-l[1]),t.lineTo(n[a]+l[0],n[a+1]+l[1]),t.lineTo(n[a+2],n[a+3]),t.closePath(),t.fill()}},Xt.drawArrowheads=function(e,t,n){var r=t._private.rscratch,a=r.edgeType==="haystack";a||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),a||this.drawArrowhead(e,t,"target",r.arrowEndX,r.arrowEndY,r.tgtArrowAngle,n)},Xt.drawArrowhead=function(e,t,n,r,a,o,i){if(!(isNaN(r)||r==null||isNaN(a)||a==null||isNaN(o)||o==null)){var s=this,l=t.pstyle(n+"-arrow-shape").value;if(l!=="none"){var u=t.pstyle(n+"-arrow-fill").value==="hollow"?"both":"filled",c=t.pstyle(n+"-arrow-fill").value,d=t.pstyle("width").pfValue,h=t.pstyle(n+"-arrow-width"),g=h.value==="match-line"?d:h.pfValue;h.units==="%"&&(g*=d);var p=t.pstyle("opacity").value;i===void 0&&(i=p);var v=e.globalCompositeOperation;i===1&&c!=="hollow"||(e.globalCompositeOperation="destination-out",s.colorFillStyle(e,255,255,255,1),s.colorStrokeStyle(e,255,255,255,1),s.drawArrowShape(t,e,u,d,l,g,r,a,o),e.globalCompositeOperation=v);var b=t.pstyle(n+"-arrow-color").value;s.colorFillStyle(e,b[0],b[1],b[2],i),s.colorStrokeStyle(e,b[0],b[1],b[2],i),s.drawArrowShape(t,e,c,d,l,g,r,a,o)}}},Xt.drawArrowShape=function(e,t,n,r,a,o,i,s,l){var u,c=this,d=this.usePaths()&&a!=="triangle-cross",h=!1,g=t,p={x:i,y:s},v=e.pstyle("arrow-scale").value,b=this.getArrowWidth(r,v),f=c.arrowShapes[a];if(d){var y=c.arrowPathCache=c.arrowPathCache||[],m=Yt(a),k=y[m];k!=null?(u=t=k,h=!0):(u=t=new Path2D,y[m]=u)}h||(t.beginPath&&t.beginPath(),d?f.draw(t,1,0,{x:0,y:0},1):f.draw(t,b,l,p,r),t.closePath&&t.closePath()),t=g,d&&(t.translate(i,s),t.rotate(l),t.scale(b,b)),n!=="filled"&&n!=="both"||(d?t.fill(u):t.fill()),n!=="hollow"&&n!=="both"||(t.lineWidth=o/(d?b:1),t.lineJoin="miter",d?t.stroke(u):t.stroke()),d&&(t.scale(1/b,1/b),t.rotate(-l),t.translate(-i,-s))};var bh={safeDrawImage:function(e,t,n,r,a,o,i,s,l,u){if(!(a<=0||o<=0||l<=0||u<=0))try{e.drawImage(t,n,r,a,o,i,s,l,u)}catch(c){we(c)}},drawInscribedImage:function(e,t,n,r,a){var o=this,i=n.position(),s=i.x,l=i.y,u=n.cy().style(),c=u.getIndexedStyle.bind(u),d=c(n,"background-fit","value",r),h=c(n,"background-repeat","value",r),g=n.width(),p=n.height(),v=2*n.padding(),b=g+(c(n,"background-width-relative-to","value",r)==="inner"?0:v),f=p+(c(n,"background-height-relative-to","value",r)==="inner"?0:v),y=n._private.rscratch,m=c(n,"background-clip","value",r)==="node",k=c(n,"background-image-opacity","value",r)*a,x=c(n,"background-image-smoothing","value",r),S=n.pstyle("corner-radius").value;S!=="auto"&&(S=n.pstyle("corner-radius").pfValue);var w=t.width||t.cachedW,D=t.height||t.cachedH;w!=null&&D!=null||(document.body.appendChild(t),w=t.cachedW=t.width||t.offsetWidth,D=t.cachedH=t.height||t.offsetHeight,document.body.removeChild(t));var E=w,P=D;if(c(n,"background-width","value",r)!=="auto"&&(E=c(n,"background-width","units",r)==="%"?c(n,"background-width","pfValue",r)*b:c(n,"background-width","pfValue",r)),c(n,"background-height","value",r)!=="auto"&&(P=c(n,"background-height","units",r)==="%"?c(n,"background-height","pfValue",r)*f:c(n,"background-height","pfValue",r)),E!==0&&P!==0){if(d==="contain")E*=T=Math.min(b/E,f/P),P*=T;else if(d==="cover"){var T;E*=T=Math.max(b/E,f/P),P*=T}var B=s-b/2,M=c(n,"background-position-x","units",r),z=c(n,"background-position-x","pfValue",r);B+=M==="%"?(b-E)*z:z;var R=c(n,"background-offset-x","units",r),F=c(n,"background-offset-x","pfValue",r);B+=R==="%"?(b-E)*F:F;var N=l-f/2,I=c(n,"background-position-y","units",r),X=c(n,"background-position-y","pfValue",r);N+=I==="%"?(f-P)*X:X;var O=c(n,"background-offset-y","units",r),Y=c(n,"background-offset-y","pfValue",r);N+=O==="%"?(f-P)*Y:Y,y.pathCache&&(B-=s,N-=l,s=0,l=0);var j=e.globalAlpha;e.globalAlpha=k;var G=o.getImgSmoothing(e),W=!1;if(x==="no"&&G?(o.setImgSmoothing(e,!1),W=!0):x!=="yes"||G||(o.setImgSmoothing(e,!0),W=!0),h==="no-repeat")m&&(e.save(),y.pathCache?e.clip(y.pathCache):(o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,b,f,S,y),e.clip())),o.safeDrawImage(e,t,0,0,w,D,B,N,E,P),m&&e.restore();else{var q=e.createPattern(t,h);e.fillStyle=q,o.nodeShapes[o.getNodeShape(n)].draw(e,s,l,b,f,S,y),e.translate(B,N),e.fill(),e.translate(-B,-N)}e.globalAlpha=j,W&&o.setImgSmoothing(e,G)}}},en={};function oi(e,t,n,r,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,i=arguments.length>6?arguments[6]:void 0;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+a-o),e.quadraticCurveTo(t+r,n+a,t+r-o,n+a),e.lineTo(t+o,n+a),e.quadraticCurveTo(t,n+a,t,n+a-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),i?e.stroke():e.fill()}en.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),a=Math.ceil(pa(n*r));t=Math.pow(2,a)}return!(e.pstyle("font-size").pfValue*t<e.pstyle("min-zoomed-font-size").pfValue)},en.drawElementText=function(e,t,n,r,a){var o=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5],i=this;if(r==null){if(o&&!i.eleTextBiggerThanMin(t))return}else if(r===!1)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=i.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var g,p=!n;n&&(g=n,e.translate(-g.x1,-g.y1)),a==null?(i.drawText(e,t,null,p,o),t.isEdge()&&(i.drawText(e,t,"source",p,o),i.drawText(e,t,"target",p,o))):i.drawText(e,t,a,p,o),n&&e.translate(g.x1,g.y1)},en.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 t={context:e},this.fontCaches.push(t),t},en.setupTextStyle=function(e,t){var n=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],r=t.pstyle("font-style").strValue,a=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,i=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+i+" "+a+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},en.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",a=e.pstyle(r+"text-rotation"),o=ct(n,"labelAngle",t);return a.strValue==="autorotate"?e.isEdge()?o:0:a.strValue==="none"?0:a.pfValue},en.drawText=function(e,t,n){var r=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],a=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],o=t._private.rscratch,i=a?t.effectiveOpacity():1;if(!a||i!==0&&t.pstyle("text-opacity").value!==0){n==="main"&&(n=null);var s,l,u=ct(o,"labelX",n),c=ct(o,"labelY",n),d=this.getLabelText(t,n);if(d!=null&&d!==""&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,a);var h,g=n?n+"-":"",p=ct(o,"labelWidth",n),v=ct(o,"labelHeight",n),b=t.pstyle(g+"text-margin-x").pfValue,f=t.pstyle(g+"text-margin-y").pfValue,y=t.isEdge(),m=t.pstyle("text-halign").value,k=t.pstyle("text-valign").value;switch(y&&(m="center",k="center"),u+=b,c+=f,(h=r?this.getTextAngle(t,n):0)!==0&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),k){case"top":break;case"center":c+=v/2;break;case"bottom":c+=v}var x=t.pstyle("text-background-opacity").value,S=t.pstyle("text-border-opacity").value,w=t.pstyle("text-border-width").pfValue,D=t.pstyle("text-background-padding").pfValue,E=t.pstyle("text-background-shape").strValue.indexOf("round")===0;if(x>0||w>0&&S>0){var P=u-D;switch(m){case"left":P-=p;break;case"center":P-=p/2}var T=c-v-D,B=p+2*D,M=v+2*D;if(x>0){var z=e.fillStyle,R=t.pstyle("text-background-color").value;e.fillStyle="rgba("+R[0]+","+R[1]+","+R[2]+","+x*i+")",E?oi(e,P,T,B,M,2):e.fillRect(P,T,B,M),e.fillStyle=z}if(w>0&&S>0){var F=e.strokeStyle,N=e.lineWidth,I=t.pstyle("text-border-color").value,X=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+I[0]+","+I[1]+","+I[2]+","+S*i+")",e.lineWidth=w,e.setLineDash)switch(X){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=w/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(E?oi(e,P,T,B,M,2,"stroke"):e.strokeRect(P,T,B,M),X==="double"){var O=w/2;E?oi(e,P+O,T+O,B-2*O,M-2*O,2,"stroke"):e.strokeRect(P+O,T+O,B-2*O,M-2*O)}e.setLineDash&&e.setLineDash([]),e.lineWidth=N,e.strokeStyle=F}}var Y=2*t.pstyle("text-outline-width").pfValue;if(Y>0&&(e.lineWidth=Y),t.pstyle("text-wrap").value==="wrap"){var j=ct(o,"labelWrapCachedLines",n),G=ct(o,"labelLineHeight",n),W=p/2,q=this.getLabelJustification(t);switch(q==="auto"||(m==="left"?q==="left"?u+=-p:q==="center"&&(u+=-W):m==="center"?q==="left"?u+=-W:q==="right"&&(u+=W):m==="right"&&(q==="center"?u+=W:q==="right"&&(u+=p))),k){case"top":case"center":case"bottom":c-=(j.length-1)*G}for(var K=0;K<j.length;K++)Y>0&&e.strokeText(j[K],u,c),e.fillText(j[K],u,c),c+=G}else Y>0&&e.strokeText(d,u,c),e.fillText(d,u,c);h!==0&&(e.rotate(-h),e.translate(-s,-l))}}};var sr={drawNode:function(e,t,n){var r,a,o=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],i=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],s=!(arguments.length>5&&arguments[5]!==void 0)||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(te(d.x)&&te(d.y)&&(!s||t.visible())){var h,g,p=s?t.effectiveOpacity():1,v=l.usePaths(),b=!1,f=t.padding();r=t.width()+2*f,a=t.height()+2*f,n&&(g=n,e.translate(-g.x1,-g.y1));for(var y=t.pstyle("background-image").value,m=new Array(y.length),k=new Array(y.length),x=0,S=0;S<y.length;S++){var w=y[S];if(m[S]=w!=null&&w!=="none"){var D=t.cy().style().getIndexedStyle(t,"background-image-crossorigin","value",S);x++,k[S]=l.getCachedImage(w,D,function(){u.backgroundTimestamp=Date.now(),t.emitAndNotify("background")})}}var E=t.pstyle("background-blacken").value,P=t.pstyle("border-width").pfValue,T=t.pstyle("background-opacity").value*p,B=t.pstyle("border-color").value,M=t.pstyle("border-style").value,z=t.pstyle("border-join").value,R=t.pstyle("border-cap").value,F=t.pstyle("border-position").value,N=t.pstyle("border-dash-pattern").pfValue,I=t.pstyle("border-dash-offset").pfValue,X=t.pstyle("border-opacity").value*p,O=t.pstyle("outline-width").pfValue,Y=t.pstyle("outline-color").value,j=t.pstyle("outline-style").value,G=t.pstyle("outline-opacity").value*p,W=t.pstyle("outline-offset").value,q=t.pstyle("corner-radius").value;q!=="auto"&&(q=t.pstyle("corner-radius").pfValue);var K=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:T;l.eleFillStyle(e,t,$)},U=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X;l.colorStrokeStyle(e,B[0],B[1],B[2],$)},re=function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:G;l.colorStrokeStyle(e,Y[0],Y[1],Y[2],$)},ae=function($,J,oe,ie){var se,pe=l.nodePathCache=l.nodePathCache||[],fe=Ni(oe==="polygon"?oe+","+ie.join(","):oe,""+J,""+$,""+q),xe=pe[fe],ge=!1;return xe!=null?(se=xe,ge=!0,c.pathCache=se):(se=new Path2D,pe[fe]=c.pathCache=se),{path:se,cacheHit:ge}},de=t.pstyle("shape").strValue,ue=t.pstyle("shape-polygon-points").pfValue;if(v){e.translate(d.x,d.y);var Q=ae(r,a,de,ue);h=Q.path,b=Q.cacheHit}var le=function(){if(!b){var $=d;v&&($={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,$.x,$.y,r,a,q,c)}v?e.fill(h):e.fill()},ee=function(){for(var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p,J=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],oe=u.backgrounding,ie=0,se=0;se<k.length;se++){var pe=t.cy().style().getIndexedStyle(t,"background-image-containment","value",se);J&&pe==="over"||!J&&pe==="inside"?ie++:m[se]&&k[se].complete&&!k[se].error&&(ie++,l.drawInscribedImage(e,k[se],t,se,$))}u.backgrounding=ie!==x,oe!==u.backgrounding&&t.updateStyle(!1)},C=function(){var $=arguments.length>0&&arguments[0]!==void 0&&arguments[0],J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;l.hasPie(t)&&(l.drawPie(e,t,J),$&&(v||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,a,q,c)))},_=function(){var $=(E>0?E:-E)*(arguments.length>0&&arguments[0]!==void 0?arguments[0]:p),J=E>0?0:255;E!==0&&(l.colorFillStyle(e,J,J,J,$),v?e.fill(h):e.fill())},A=function(){if(P>0){if(e.lineWidth=P,e.lineCap=R,e.lineJoin=z,e.setLineDash)switch(M){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(N),e.lineDashOffset=I;break;case"solid":case"double":e.setLineDash([])}if(F!=="center"){if(e.save(),e.lineWidth*=2,F==="inside")v?e.clip(h):e.clip();else{var $=new Path2D;$.rect(-r/2-P,-a/2-P,r+2*P,a+2*P),$.addPath(h),e.clip($,"evenodd")}v?e.stroke(h):e.stroke(),e.restore()}else v?e.stroke(h):e.stroke();if(M==="double"){e.lineWidth=P/3;var J=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(h):e.stroke(),e.globalCompositeOperation=J}e.setLineDash&&e.setLineDash([])}},V=function(){if(O>0){if(e.lineWidth=O,e.lineCap="butt",e.setLineDash)switch(j){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var $=d;v&&($={x:0,y:0});var J=l.getNodeShape(t),oe=P;F==="inside"&&(oe=0),F==="outside"&&(oe*=2);var ie,se=(r+oe+(O+W))/r,pe=(a+oe+(O+W))/a,fe=r*se,xe=a*pe,ge=l.nodeShapes[J].points;if(v&&(ie=ae(fe,xe,J,ge).path),J==="ellipse")l.drawEllipsePath(ie||e,$.x,$.y,fe,xe);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(J)){var De=0,Te=0,Ue=0;J==="round-diamond"?De=1.4*(oe+W+O):J==="round-heptagon"?(De=1.075*(oe+W+O),Ue=-(oe/2+W+O)/35):J==="round-hexagon"?De=1.12*(oe+W+O):J==="round-pentagon"?(De=1.13*(oe+W+O),Ue=-(oe/2+W+O)/15):J==="round-tag"?(De=1.12*(oe+W+O),Te=.07*(oe/2+O+W)):J==="round-triangle"&&(De=(oe+W+O)*(Math.PI/2),Ue=-(oe+W/2+O)/Math.PI),De!==0&&(fe=r*(se=(r+De)/r),["round-hexagon","round-tag"].includes(J)||(xe=a*(pe=(a+De)/a)));for(var pt=fe/2,Ke=xe/2,Ze=(q=q==="auto"?Ki(fe,xe):q)+(oe+O+W)/2,ot=new Array(ge.length/2),ft=new Array(ge.length/2),$e=0;$e<ge.length/2;$e++)ot[$e]={x:$.x+Te+pt*ge[2*$e],y:$.y+Ue+Ke*ge[2*$e+1]};var Qe,st,rn,bt,Dt=ot.length;for(st=ot[Dt-1],Qe=0;Qe<Dt;Qe++)rn=ot[Qe%Dt],bt=ot[(Qe+1)%Dt],ft[Qe]=ni(st,rn,bt,Ze),st=rn,rn=bt;l.drawRoundPolygonPath(ie||e,$.x+Te,$.y+Ue,r*se,a*pe,ge,ft)}else["roundrectangle","round-rectangle"].includes(J)?(q=q==="auto"?Kt(fe,xe):q,l.drawRoundRectanglePath(ie||e,$.x,$.y,fe,xe,q+(oe+O+W)/2)):["cutrectangle","cut-rectangle"].includes(J)?(q=q==="auto"?8:q,l.drawCutRectanglePath(ie||e,$.x,$.y,fe,xe,null,q+(oe+O+W)/4)):["bottomroundrectangle","bottom-round-rectangle"].includes(J)?(q=q==="auto"?Kt(fe,xe):q,l.drawBottomRoundRectanglePath(ie||e,$.x,$.y,fe,xe,q+(oe+O+W)/2)):J==="barrel"?l.drawBarrelPath(ie||e,$.x,$.y,fe,xe):J.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(J)?(ge=wr(Er(ge,(oe+O+W)/r)),l.drawPolygonPath(ie||e,$.x,$.y,r,a,ge)):(ge=wr(Er(ge,-((oe+O+W)/r))),l.drawPolygonPath(ie||e,$.x,$.y,r,a,ge));if(v?e.stroke(ie):e.stroke(),j==="double"){e.lineWidth=oe/3;var an=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",v?e.stroke(ie):e.stroke(),e.globalCompositeOperation=an}e.setLineDash&&e.setLineDash([])}};if(t.pstyle("ghost").value==="yes"){var L=t.pstyle("ghost-offset-x").pfValue,Z=t.pstyle("ghost-offset-y").pfValue,H=t.pstyle("ghost-opacity").value,ne=H*p;e.translate(L,Z),re(),V(),K(H*T),le(),ee(ne,!0),U(H*X),A(),C(E!==0||P!==0),ee(ne,!1),_(ne),e.translate(-L,-Z)}v&&e.translate(-d.x,-d.y),i&&l.drawNodeUnderlay(e,t,d,r,a),v&&e.translate(d.x,d.y),re(),V(),K(),le(),ee(p,!0),U(),A(),C(E!==0||P!==0),ee(p,!1),_(),v&&e.translate(-d.x,-d.y),l.drawElementText(e,t,null,o),i&&l.drawNodeOverlay(e,t,d,r,a),n&&e.translate(g.x1,g.y1)}}},$s=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,r,a,o){if(n.visible()){var i=n.pstyle("".concat(e,"-padding")).pfValue,s=n.pstyle("".concat(e,"-opacity")).value,l=n.pstyle("".concat(e,"-color")).value,u=n.pstyle("".concat(e,"-shape")).value,c=n.pstyle("".concat(e,"-corner-radius")).value;if(s>0){if(r=r||n.position(),a==null||o==null){var d=n.padding();a=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,a+2*i,o+2*i,c),t.fill()}}}};sr.drawNodeOverlay=$s("overlay"),sr.drawNodeUnderlay=$s("underlay"),sr.hasPie=function(e){return(e=e[0])._private.hasPie},sr.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var a=t.cy().style(),o=t.pstyle("pie-size"),i=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(i=0,s=0),o.units==="%"?c*=o.pfValue:o.pfValue!==void 0&&(c=o.pfValue/2);for(var h=1;h<=a.pieBackgroundN;h++){var g=t.pstyle("pie-"+h+"-background-size").value,p=t.pstyle("pie-"+h+"-background-color").value,v=t.pstyle("pie-"+h+"-background-opacity").value*n,b=g/100;b+d>1&&(b=1-d);var f=1.5*Math.PI+2*Math.PI*d,y=f+2*Math.PI*b;g===0||d>=1||d+b>1||(e.beginPath(),e.moveTo(i,s),e.arc(i,s,c,f,y),e.closePath(),this.colorFillStyle(e,p[0],p[1],p[2],v),e.fill(),d+=b)}};var nt={};nt.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},nt.paintCache=function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,a=0;a<n.length;a++)if((t=n[a]).context===e){r=!1;break}return r&&(t={context:e},n.push(t)),t},nt.createGradientStyleFor=function(e,t,n,r,a){var o,i=this.usePaths(),s=n.pstyle(t+"-gradient-stop-colors").value,l=n.pstyle(t+"-gradient-stop-positions").pfValue;if(r==="radial-gradient")if(n.isEdge()){var u=n.sourceEndpoint(),c=n.targetEndpoint(),d=n.midpoint(),h=jt(u,d),g=jt(c,d);o=e.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,g))}else{var p=i?{x:0,y:0}:n.position(),v=n.paddedWidth(),b=n.paddedHeight();o=e.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(v,b))}else if(n.isEdge()){var f=n.sourceEndpoint(),y=n.targetEndpoint();o=e.createLinearGradient(f.x,f.y,y.x,y.y)}else{var m=i?{x:0,y:0}:n.position(),k=n.paddedWidth()/2,x=n.paddedHeight()/2;switch(n.pstyle("background-gradient-direction").value){case"to-bottom":o=e.createLinearGradient(m.x,m.y-x,m.x,m.y+x);break;case"to-top":o=e.createLinearGradient(m.x,m.y+x,m.x,m.y-x);break;case"to-left":o=e.createLinearGradient(m.x+k,m.y,m.x-k,m.y);break;case"to-right":o=e.createLinearGradient(m.x-k,m.y,m.x+k,m.y);break;case"to-bottom-right":case"to-right-bottom":o=e.createLinearGradient(m.x-k,m.y-x,m.x+k,m.y+x);break;case"to-top-right":case"to-right-top":o=e.createLinearGradient(m.x-k,m.y+x,m.x+k,m.y-x);break;case"to-bottom-left":case"to-left-bottom":o=e.createLinearGradient(m.x+k,m.y-x,m.x-k,m.y+x);break;case"to-top-left":case"to-left-top":o=e.createLinearGradient(m.x+k,m.y+x,m.x-k,m.y-x)}}if(!o)return null;for(var S=l.length===s.length,w=s.length,D=0;D<w;D++)o.addColorStop(S?l[D]:D/(w-1),"rgba("+s[D][0]+","+s[D][1]+","+s[D][2]+","+a+")");return o},nt.gradientFillStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"background",t,n,r);if(!a)return null;e.fillStyle=a},nt.colorFillStyle=function(e,t,n,r,a){e.fillStyle="rgba("+t+","+n+","+r+","+a+")"},nt.eleFillStyle=function(e,t,n){var r=t.pstyle("background-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientFillStyle(e,t,r,n);else{var a=t.pstyle("background-color").value;this.colorFillStyle(e,a[0],a[1],a[2],n)}},nt.gradientStrokeStyle=function(e,t,n,r){var a=this.createGradientStyleFor(e,"line",t,n,r);if(!a)return null;e.strokeStyle=a},nt.colorStrokeStyle=function(e,t,n,r,a){e.strokeStyle="rgba("+t+","+n+","+r+","+a+")"},nt.eleStrokeStyle=function(e,t,n){var r=t.pstyle("line-fill").value;if(r==="linear-gradient"||r==="radial-gradient")this.gradientStrokeStyle(e,t,r,n);else{var a=t.pstyle("line-color").value;this.colorStrokeStyle(e,a[0],a[1],a[2],n)}},nt.matchCanvasSize=function(e){var t=this,n=t.data,r=t.findContainerClientCoords(),a=r[2],o=r[3],i=t.getPixelRatio(),s=t.motionBlurPxRatio;e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE]&&e!==t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG]||(i=s);var l,u=a*i,c=o*i;if(u!==t.canvasWidth||c!==t.canvasHeight){t.fontCaches=null;var d=n.canvasContainer;d.style.width=a+"px",d.style.height=o+"px";for(var h=0;h<t.CANVAS_LAYERS;h++)(l=n.canvases[h]).width=u,l.height=c,l.style.width=a+"px",l.style.height=o+"px";for(h=0;h<t.BUFFER_COUNT;h++)(l=n.bufferCanvases[h]).width=u,l.height=c,l.style.width=a+"px",l.style.height=o+"px";t.textureMult=1,i<=1&&(l=n.bufferCanvases[t.TEXTURE_BUFFER],t.textureMult=2,l.width=u*t.textureMult,l.height=c*t.textureMult),t.canvasWidth=u,t.canvasHeight=c}},nt.renderTo=function(e,t,n,r){this.render({forcedContext:e,forcedZoom:t,forcedPan:n,drawAllLayers:!0,forcedPxRatio:r})},nt.render=function(e){var t=(e=e||Oi()).forcedContext,n=e.drawAllLayers,r=e.drawOnlyNodeLayer,a=e.forcedZoom,o=e.forcedPan,i=this,s=e.forcedPxRatio===void 0?this.getPixelRatio():e.forcedPxRatio,l=i.cy,u=i.data,c=u.canvasNeedsRedraw,d=i.textureOnViewport&&!t&&(i.pinching||i.hoverData.dragging||i.swipePanning||i.data.wheelZooming),h=e.motionBlur!==void 0?e.motionBlur:i.motionBlur,g=i.motionBlurPxRatio,p=l.hasCompoundNodes(),v=i.hoverData.draggingEles,b=!(!i.hoverData.selecting&&!i.touchData.selecting),f=h=h&&!t&&i.motionBlurEnabled&&!b;t||(i.prevPxRatio!==s&&(i.invalidateContainerClientCoordsCache(),i.matchCanvasSize(i.container),i.redrawHint("eles",!0),i.redrawHint("drag",!0)),i.prevPxRatio=s),!t&&i.motionBlurTimeout&&clearTimeout(i.motionBlurTimeout),h&&(i.mbFrames==null&&(i.mbFrames=0),i.mbFrames++,i.mbFrames<3&&(f=!1),i.mbFrames>i.minMbLowQualFrames&&(i.motionBlurPxRatio=i.mbPxRBlurry)),i.clearingMotionBlur&&(i.motionBlurPxRatio=1),i.textureDrawLastFrame&&!d&&(c[i.NODE]=!0,c[i.SELECT_BOX]=!0);var y=l.style(),m=l.zoom(),k=a!==void 0?a:m,x=l.pan(),S={x:x.x,y:x.y},w={zoom:m,pan:{x:x.x,y:x.y}},D=i.prevViewport;D===void 0||w.zoom!==D.zoom||w.pan.x!==D.pan.x||w.pan.y!==D.pan.y||v&&!p||(i.motionBlurPxRatio=1),o&&(S=o),k*=s,S.x*=s,S.y*=s;var E=i.getCachedZSortedEles();function P(ue,Q,le,ee,C){var _=ue.globalCompositeOperation;ue.globalCompositeOperation="destination-out",i.colorFillStyle(ue,255,255,255,i.motionBlurTransparency),ue.fillRect(Q,le,ee,C),ue.globalCompositeOperation=_}function T(ue,Q){var le,ee,C,_;i.clearingMotionBlur||ue!==u.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]&&ue!==u.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG]?(le=S,ee=k,C=i.canvasWidth,_=i.canvasHeight):(le={x:x.x*g,y:x.y*g},ee=m*g,C=i.canvasWidth*g,_=i.canvasHeight*g),ue.setTransform(1,0,0,1,0,0),Q==="motionBlur"?P(ue,0,0,C,_):t||Q!==void 0&&!Q||ue.clearRect(0,0,C,_),n||(ue.translate(le.x,le.y),ue.scale(ee,ee)),o&&ue.translate(o.x,o.y),a&&ue.scale(a,a)}if(d||(i.textureDrawLastFrame=!1),d){if(i.textureDrawLastFrame=!0,!i.textureCache){i.textureCache={},i.textureCache.bb=l.mutableElements().boundingBox(),i.textureCache.texture=i.data.bufferCanvases[i.TEXTURE_BUFFER];var B=i.data.bufferContexts[i.TEXTURE_BUFFER];B.setTransform(1,0,0,1,0,0),B.clearRect(0,0,i.canvasWidth*i.textureMult,i.canvasHeight*i.textureMult),i.render({forcedContext:B,drawOnlyNodeLayer:!0,forcedPxRatio:s*i.textureMult}),(w=i.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:i.canvasWidth,height:i.canvasHeight}).mpan={x:(0-w.pan.x)/w.zoom,y:(0-w.pan.y)/w.zoom}}c[i.DRAG]=!1,c[i.NODE]=!1;var M=u.contexts[i.NODE],z=i.textureCache.texture;w=i.textureCache.viewport,M.setTransform(1,0,0,1,0,0),h?P(M,0,0,w.width,w.height):M.clearRect(0,0,w.width,w.height);var R=y.core("outside-texture-bg-color").value,F=y.core("outside-texture-bg-opacity").value;i.colorFillStyle(M,R[0],R[1],R[2],F),M.fillRect(0,0,w.width,w.height),m=l.zoom(),T(M,!1),M.clearRect(w.mpan.x,w.mpan.y,w.width/w.zoom/s,w.height/w.zoom/s),M.drawImage(z,w.mpan.x,w.mpan.y,w.width/w.zoom/s,w.height/w.zoom/s)}else i.textureOnViewport&&!t&&(i.textureCache=null);var N=l.extent(),I=i.pinching||i.hoverData.dragging||i.swipePanning||i.data.wheelZooming||i.hoverData.draggingEles||i.cy.animated(),X=i.hideEdgesOnViewport&&I,O=[];if(O[i.NODE]=!c[i.NODE]&&h&&!i.clearedForMotionBlur[i.NODE]||i.clearingMotionBlur,O[i.NODE]&&(i.clearedForMotionBlur[i.NODE]=!0),O[i.DRAG]=!c[i.DRAG]&&h&&!i.clearedForMotionBlur[i.DRAG]||i.clearingMotionBlur,O[i.DRAG]&&(i.clearedForMotionBlur[i.DRAG]=!0),c[i.NODE]||n||r||O[i.NODE]){var Y=h&&!O[i.NODE]&&g!==1;T(M=t||(Y?i.data.bufferContexts[i.MOTIONBLUR_BUFFER_NODE]:u.contexts[i.NODE]),h&&!Y?"motionBlur":void 0),X?i.drawCachedNodes(M,E.nondrag,s,N):i.drawLayeredElements(M,E.nondrag,s,N),i.debug&&i.drawDebugPoints(M,E.nondrag),n||h||(c[i.NODE]=!1)}if(!r&&(c[i.DRAG]||n||O[i.DRAG])&&(Y=h&&!O[i.DRAG]&&g!==1,T(M=t||(Y?i.data.bufferContexts[i.MOTIONBLUR_BUFFER_DRAG]:u.contexts[i.DRAG]),h&&!Y?"motionBlur":void 0),X?i.drawCachedNodes(M,E.drag,s,N):i.drawCachedElements(M,E.drag,s,N),i.debug&&i.drawDebugPoints(M,E.drag),n||h||(c[i.DRAG]=!1)),i.showFps||!r&&c[i.SELECT_BOX]&&!n){if(T(M=t||u.contexts[i.SELECT_BOX]),i.selection[4]==1&&(i.hoverData.selecting||i.touchData.selecting)){m=i.cy.zoom();var j=y.core("selection-box-border-width").value/m;M.lineWidth=j,M.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+")",M.fillRect(i.selection[0],i.selection[1],i.selection[2]-i.selection[0],i.selection[3]-i.selection[1]),j>0&&(M.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+")",M.strokeRect(i.selection[0],i.selection[1],i.selection[2]-i.selection[0],i.selection[3]-i.selection[1]))}if(u.bgActivePosistion&&!i.hoverData.selecting){m=i.cy.zoom();var G=u.bgActivePosistion;M.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+")",M.beginPath(),M.arc(G.x,G.y,y.core("active-bg-size").pfValue/m,0,2*Math.PI),M.fill()}var W=i.lastRedrawTime;if(i.showFps&&W){W=Math.round(W);var q=Math.round(1e3/W);M.setTransform(1,0,0,1,0,0),M.fillStyle="rgba(255, 0, 0, 0.75)",M.strokeStyle="rgba(255, 0, 0, 0.75)",M.lineWidth=1,M.fillText("1 frame = "+W+" ms = "+q+" fps",0,20),M.strokeRect(0,30,250,20),M.fillRect(0,30,250*Math.min(q/60,1),20)}n||(c[i.SELECT_BOX]=!1)}if(h&&g!==1){var K=u.contexts[i.NODE],U=i.data.bufferCanvases[i.MOTIONBLUR_BUFFER_NODE],re=u.contexts[i.DRAG],ae=i.data.bufferCanvases[i.MOTIONBLUR_BUFFER_DRAG],de=function(ue,Q,le){ue.setTransform(1,0,0,1,0,0),le||!f?ue.clearRect(0,0,i.canvasWidth,i.canvasHeight):P(ue,0,0,i.canvasWidth,i.canvasHeight);var ee=g;ue.drawImage(Q,0,0,i.canvasWidth*ee,i.canvasHeight*ee,0,0,i.canvasWidth,i.canvasHeight)};(c[i.NODE]||O[i.NODE])&&(de(K,U,O[i.NODE]),c[i.NODE]=!1),(c[i.DRAG]||O[i.DRAG])&&(de(re,ae,O[i.DRAG]),c[i.DRAG]=!1)}i.prevViewport=w,i.clearingMotionBlur&&(i.clearingMotionBlur=!1,i.motionBlurCleared=!0,i.motionBlur=!0),h&&(i.motionBlurTimeout=setTimeout(function(){i.motionBlurTimeout=null,i.clearedForMotionBlur[i.NODE]=!1,i.clearedForMotionBlur[i.DRAG]=!1,i.motionBlur=!1,i.clearingMotionBlur=!d,i.mbFrames=0,c[i.NODE]=!0,c[i.DRAG]=!0,i.redraw()},100)),t||l.emit("render")};for(var Qs={drawPolygonPath:function(e,t,n,r,a,o){var i=r/2,s=a/2;e.beginPath&&e.beginPath(),e.moveTo(t+i*o[0],n+s*o[1]);for(var l=1;l<o.length/2;l++)e.lineTo(t+i*o[2*l],n+s*o[2*l+1]);e.closePath()},drawRoundPolygonPath:function(e,t,n,r,a,o,i){i.forEach(function(s){return Ls(e,s)}),e.closePath()},drawRoundRectanglePath:function(e,t,n,r,a,o){var i=r/2,s=a/2,l=o==="auto"?Kt(r,a):Math.min(o,s,i);e.beginPath&&e.beginPath(),e.moveTo(t,n-s),e.arcTo(t+i,n-s,t+i,n,l),e.arcTo(t+i,n+s,t,n+s,l),e.arcTo(t-i,n+s,t-i,n,l),e.arcTo(t-i,n-s,t,n-s,l),e.lineTo(t,n-s),e.closePath()},drawBottomRoundRectanglePath:function(e,t,n,r,a,o){var i=r/2,s=a/2,l=o==="auto"?Kt(r,a):o;e.beginPath&&e.beginPath(),e.moveTo(t,n-s),e.lineTo(t+i,n-s),e.lineTo(t+i,n),e.arcTo(t+i,n+s,t,n+s,l),e.arcTo(t-i,n+s,t-i,n,l),e.lineTo(t-i,n-s),e.lineTo(t,n-s),e.closePath()},drawCutRectanglePath:function(e,t,n,r,a,o,i){var s=r/2,l=a/2,u=i==="auto"?8:i;e.beginPath&&e.beginPath(),e.moveTo(t-s+u,n-l),e.lineTo(t+s-u,n-l),e.lineTo(t+s,n-l+u),e.lineTo(t+s,n+l-u),e.lineTo(t+s-u,n+l),e.lineTo(t-s+u,n+l),e.lineTo(t-s,n+l-u),e.lineTo(t-s,n-l+u),e.closePath()},drawBarrelPath:function(e,t,n,r,a){var o=r/2,i=a/2,s=t-o,l=t+o,u=n-i,c=n+i,d=ya(r,a),h=d.widthOffset,g=d.heightOffset,p=d.ctrlPtOffsetPct*h;e.beginPath&&e.beginPath(),e.moveTo(s,u+g),e.lineTo(s,c-g),e.quadraticCurveTo(s+p,c,s+h,c),e.lineTo(l-h,c),e.quadraticCurveTo(l-p,c,l,c-g),e.lineTo(l,u+g),e.quadraticCurveTo(l-p,u,l-h,u),e.lineTo(s+h,u),e.quadraticCurveTo(s+p,u,s,u+g),e.closePath()}},Js=Math.sin(0),el=Math.cos(0),si={},li={},tl=Math.PI/40,_n=0*Math.PI;_n<2*Math.PI;_n+=tl)si[_n]=Math.sin(_n),li[_n]=Math.cos(_n);Qs.drawEllipsePath=function(e,t,n,r,a){if(e.beginPath&&e.beginPath(),e.ellipse)e.ellipse(t,n,r/2,a/2,0,0,2*Math.PI);else for(var o,i,s=r/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=tl)o=t-s*si[u]*Js+s*li[u]*el,i=n+l*li[u]*Js+l*si[u]*el,u===0?e.moveTo(o,i):e.lineTo(o,i);e.closePath()};var lr={};function nl(e){var t=e.indexOf(",");return e.substr(t+1)}function rl(e,t,n){var r=function(){return t.toDataURL(n,e.quality)};switch(e.output){case"blob-promise":return new gn(function(a,o){try{t.toBlob(function(i){i!=null?a(i):o(new Error("`canvas.toBlob()` sent a null value in its callback"))},n,e.quality)}catch(i){o(i)}});case"blob":return function(a,o){for(var i=atob(a),s=new ArrayBuffer(i.length),l=new Uint8Array(s),u=0;u<i.length;u++)l[u]=i.charCodeAt(u);return new Blob([s],{type:o})}(nl(r()),n);case"base64":return nl(r());default:return r()}}lr.createBuffer=function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,[n,n.getContext("2d")]},lr.bufferCanvasImage=function(e){var t=this.cy,n=t.mutableElements().boundingBox(),r=this.findContainerClientCoords(),a=e.full?Math.ceil(n.w):r[2],o=e.full?Math.ceil(n.h):r[3],i=te(e.maxWidth)||te(e.maxHeight),s=this.getPixelRatio(),l=1;if(e.scale!==void 0)a*=e.scale,o*=e.scale,l=e.scale;else if(i){var u=1/0,c=1/0;te(e.maxWidth)&&(u=l*e.maxWidth/a),te(e.maxHeight)&&(c=l*e.maxHeight/o),a*=l=Math.min(u,c),o*=l}i||(a*=s,o*=s,l*=s);var d=document.createElement("canvas");d.width=a,d.height=o,d.style.width=a+"px",d.style.height=o+"px";var h=d.getContext("2d");if(a>0&&o>0){h.clearRect(0,0,a,o),h.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,g),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var p=t.pan(),v={x:p.x*l,y:p.y*l};l*=t.zoom(),h.translate(v.x,v.y),h.scale(l,l),this.drawElements(h,g),h.scale(1/l,1/l),h.translate(-v.x,-v.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,a,o),h.fill())}return d},lr.png=function(e){return rl(e,this.bufferCanvasImage(e),"image/png")},lr.jpg=function(e){return rl(e,this.bufferCanvasImage(e),"image/jpeg")};var xh={nodeShapeImpl:function(e,t,n,r,a,o,i,s){switch(e){case"ellipse":return this.drawEllipsePath(t,n,r,a,o);case"polygon":return this.drawPolygonPath(t,n,r,a,o,i);case"round-polygon":return this.drawRoundPolygonPath(t,n,r,a,o,i,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(t,n,r,a,o,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(t,n,r,a,o,i,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(t,n,r,a,o,s);case"barrel":return this.drawBarrelPath(t,n,r,a,o)}}},wh=al,be=al.prototype;function al(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(be.CANVAS_LAYERS),contexts:new Array(be.CANVAS_LAYERS),canvasNeedsRedraw:new Array(be.CANVAS_LAYERS),bufferCanvases:new Array(be.BUFFER_COUNT),bufferContexts:new Array(be.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",a="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=a,o.position="relative",o.zIndex="0",o.overflow="hidden";var i=e.cy.container();i.appendChild(t.data.canvasContainer),i.style[r]=a;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};yi&&yi.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l<be.CANVAS_LAYERS;l++){var u=t.data.canvases[l]=n.createElement("canvas");t.data.contexts[l]=u.getContext("2d"),Object.keys(s).forEach(function(E){u.style[E]=s[E]}),u.style.position="absolute",u.setAttribute("data-id","layer"+l),u.style.zIndex=String(be.CANVAS_LAYERS-l),t.data.canvasContainer.appendChild(u),t.data.canvasNeedsRedraw[l]=!1}for(t.data.topCanvas=t.data.canvases[0],t.data.canvases[be.NODE].setAttribute("data-id","layer"+be.NODE+"-node"),t.data.canvases[be.SELECT_BOX].setAttribute("data-id","layer"+be.SELECT_BOX+"-selectbox"),t.data.canvases[be.DRAG].setAttribute("data-id","layer"+be.DRAG+"-drag"),l=0;l<be.BUFFER_COUNT;l++)t.data.bufferCanvases[l]=n.createElement("canvas"),t.data.bufferContexts[l]=t.data.bufferCanvases[l].getContext("2d"),t.data.bufferCanvases[l].style.position="absolute",t.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),t.data.bufferCanvases[l].style.zIndex=String(-l-1),t.data.bufferCanvases[l].style.visibility="hidden";t.pathsEnabled=!0;var c=Je(),d=function(E){return{x:-E.w/2,y:-E.h/2}},h=function(E){return E.boundingBox(),E[0]._private.bodyBounds},g=function(E){return E.boundingBox(),E[0]._private.labelBounds.main||c},p=function(E){return E.boundingBox(),E[0]._private.labelBounds.source||c},v=function(E){return E.boundingBox(),E[0]._private.labelBounds.target||c},b=function(E,P){return P},f=function(E,P,T){var B=E?E+"-":"";return{x:P.x+T.pstyle(B+"text-margin-x").pfValue,y:P.y+T.pstyle(B+"text-margin-y").pfValue}},y=function(E,P,T){var B=E[0]._private.rscratch;return{x:B[P],y:B[T]}},m=t.data.eleTxrCache=new or(t,{getKey:function(E){return E[0]._private.nodeKey},doesEleInvalidateKey:function(E){var P=E[0]._private;return P.oldBackgroundTimestamp!==P.backgroundTimestamp},drawElement:function(E,P,T,B,M){return t.drawElement(E,P,T,!1,!1,M)},getBoundingBox:h,getRotationPoint:function(E){return{x:((P=h(E)).x1+P.x2)/2,y:(P.y1+P.y2)/2};var P},getRotationOffset:function(E){return d(h(E))},allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),k=t.data.lblTxrCache=new or(t,{getKey:function(E){return E[0]._private.labelStyleKey},drawElement:function(E,P,T,B,M){return t.drawElementText(E,P,T,B,"main",M)},getBoundingBox:g,getRotationPoint:function(E){return f("",y(E,"labelX","labelY"),E)},getRotationOffset:function(E){var P=g(E),T=d(g(E));if(E.isNode()){switch(E.pstyle("text-halign").value){case"left":T.x=-P.w;break;case"right":T.x=0}switch(E.pstyle("text-valign").value){case"top":T.y=-P.h;break;case"bottom":T.y=0}}return T},isVisible:b}),x=t.data.slbTxrCache=new or(t,{getKey:function(E){return E[0]._private.sourceLabelStyleKey},drawElement:function(E,P,T,B,M){return t.drawElementText(E,P,T,B,"source",M)},getBoundingBox:p,getRotationPoint:function(E){return f("source",y(E,"sourceLabelX","sourceLabelY"),E)},getRotationOffset:function(E){return d(p(E))},isVisible:b}),S=t.data.tlbTxrCache=new or(t,{getKey:function(E){return E[0]._private.targetLabelStyleKey},drawElement:function(E,P,T,B,M){return t.drawElementText(E,P,T,B,"target",M)},getBoundingBox:v,getRotationPoint:function(E){return f("target",y(E,"targetLabelX","targetLabelY"),E)},getRotationOffset:function(E){return d(v(E))},isVisible:b}),w=t.data.lyrTxrCache=new Ws(t);t.onUpdateEleCalcs(function(E,P){m.invalidateElements(P),k.invalidateElements(P),x.invalidateElements(P),S.invalidateElements(P),w.invalidateElements(P);for(var T=0;T<P.length;T++){var B=P[T]._private;B.oldBackgroundTimestamp=B.backgroundTimestamp}});var D=function(E){for(var P=0;P<E.length;P++)w.enqueueElementRefinement(E[P].ele)};m.onDequeue(D),k.onDequeue(D),x.onDequeue(D),S.onDequeue(D)}be.CANVAS_LAYERS=3,be.SELECT_BOX=0,be.DRAG=1,be.NODE=2,be.BUFFER_COUNT=3,be.TEXTURE_BUFFER=0,be.MOTIONBLUR_BUFFER_NODE=1,be.MOTIONBLUR_BUFFER_DRAG=2,be.redrawHint=function(e,t){var n=this;switch(e){case"eles":n.data.canvasNeedsRedraw[be.NODE]=t;break;case"drag":n.data.canvasNeedsRedraw[be.DRAG]=t;break;case"select":n.data.canvasNeedsRedraw[be.SELECT_BOX]=t}};var Eh=typeof Path2D<"u";be.path2dEnabled=function(e){if(e===void 0)return this.pathsEnabled;this.pathsEnabled=!!e},be.usePaths=function(){return Eh&&this.pathsEnabled},be.setImgSmoothing=function(e,t){e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled=t:(e.webkitImageSmoothingEnabled=t,e.mozImageSmoothingEnabled=t,e.msImageSmoothingEnabled=t)},be.getImgSmoothing=function(e){return e.imageSmoothingEnabled!=null?e.imageSmoothingEnabled:e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled},be.makeOffscreenCanvas=function(e,t){var n;return(typeof OffscreenCanvas>"u"?"undefined":Ne(OffscreenCanvas))!=="undefined"?n=new OffscreenCanvas(e,t):((n=this.cy.window().document.createElement("canvas")).width=e,n.height=t),n},[Gs,Bn,Xt,bh,en,sr,nt,Qs,lr,xh].forEach(function(e){he(be,e)});var kh=[{type:"layout",extensions:Qd},{type:"renderer",extensions:[{name:"null",impl:Ss},{name:"base",impl:Ys},{name:"canvas",impl:wh}]}],il={},ol={};function sl(e,t,n){var r=n,a=function(S){we("Can not register `"+t+"` for `"+e+"` since `"+S+"` already exists in the prototype and can not be overridden")};if(e==="core"){if(rr.prototype[t])return a(t);rr.prototype[t]=n}else if(e==="collection"){if(Ve.prototype[t])return a(t);Ve.prototype[t]=n}else if(e==="layout"){for(var o=function(S){this.options=S,n.call(this,S),ve(this._private)||(this._private={}),this._private.cy=S.cy,this._private.listeners=[],this.createEmitter()},i=o.prototype=Object.create(n.prototype),s=[],l=0;l<s.length;l++){var u=s[l];i[u]=i[u]||function(){return this}}i.start&&!i.run?i.run=function(){return this.start(),this}:!i.start&&i.run&&(i.start=function(){return this.run(),this});var c=n.prototype.stop;i.stop=function(){var S=this.options;if(S&&S.animate){var w=this.animations;if(w)for(var D=0;D<w.length;D++)w[D].stop()}return c?c.call(this):this.emit("layoutstop"),this},i.destroy||(i.destroy=function(){return this}),i.cy=function(){return this._private.cy};var d=function(S){return S._private.cy},h={addEventFields:function(S,w){w.layout=S,w.cy=d(S),w.target=S},bubble:function(){return!0},parent:function(S){return d(S)}};he(i,{createEmitter:function(){return this._private.emitter=new Xr(h,this),this},emitter:function(){return this._private.emitter},on:function(S,w){return this.emitter().on(S,w),this},one:function(S,w){return this.emitter().one(S,w),this},once:function(S,w){return this.emitter().one(S,w),this},removeListener:function(S,w){return this.emitter().removeListener(S,w),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(S,w){return this.emitter().emit(S,w),this}}),Ee.eventAliasesOn(i),r=o}else if(e==="renderer"&&t!=="null"&&t!=="base"){var g=ll("renderer","base"),p=g.prototype,v=n,b=n.prototype,f=function(){g.apply(this,arguments),v.apply(this,arguments)},y=f.prototype;for(var m in p){var k=p[m];if(b[m]!=null)return a(m);y[m]=k}for(var x in b)y[x]=b[x];p.clientFunctions.forEach(function(S){y[S]=y[S]||function(){Be("Renderer does not implement `renderer."+S+"()` on its prototype")}}),r=f}else if(e==="__proto__"||e==="constructor"||e==="prototype")return Be(e+" is an illegal type to be registered, possibly lead to prototype pollutions");return Ci({map:il,keys:[e,t],value:r})}function ll(e,t){return Si({map:il,keys:[e,t]})}function Ch(e,t,n,r,a){return Ci({map:ol,keys:[e,t,n,r],value:a})}function Sh(e,t,n,r){return Si({map:ol,keys:[e,t,n,r]})}var ui=function(){return arguments.length===2?ll.apply(null,arguments):arguments.length===3?sl.apply(null,arguments):arguments.length===4?Sh.apply(null,arguments):arguments.length===5?Ch.apply(null,arguments):void Be("Invalid extension access syntax")};rr.prototype.extension=ui,kh.forEach(function(e){e.extensions.forEach(function(t){sl(e.type,t.name,t.impl)})});var ul=function e(){if(!(this instanceof e))return new e;this.length=0},tn=ul.prototype;tn.instanceString=function(){return"stylesheet"},tn.selector=function(e){return this[this.length++]={selector:e,properties:[]},this},tn.css=function(e,t){var n=this.length-1;if(ce(e))this[n].properties.push({name:e,value:t});else if(ve(e))for(var r=e,a=Object.keys(r),o=0;o<a.length;o++){var i=a[o],s=r[i];if(s!=null){var l=je.properties[i]||je.properties[cr(i)];if(l!=null){var u=l.name,c=s;this[n].properties.push({name:u,value:c})}}}return this},tn.style=tn.css,tn.generateStyle=function(e){var t=new je(e);return this.appendToStyle(t)},tn.appendToStyle=function(e){for(var t=0;t<this.length;t++){var n=this[t],r=n.selector,a=n.properties;e.selector(r);for(var o=0;o<a.length;o++){var i=a[o];e.css(i.name,i.value)}}return e};var nn=function(e){return e===void 0&&(e={}),ve(e)?new rr(e):ce(e)?ui.apply(ui,arguments):void 0};nn.use=function(e){var t=Array.prototype.slice.call(arguments,1);return t.unshift(nn),e.apply(null,t),this},nn.warnings=function(e){return Ii(e)},nn.version="3.30.2",nn.stylesheet=nn.Stylesheet=ul;export{nn as c};
|