(function($a){typeof define=="function"&&define.amd?define($a):$a()})(function(){"use strict";function $a(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void $a(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function ih(t){var e="",r,n;try{n=1,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-container">',n=2,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-item-info-header">',n=3,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<i class="icon-picture"></i>',n=4,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+"SEM</div></div>",n=5,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-panes clearfix">',n=6,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-left">',n=7,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-image">',n=8,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+"<div>",n=9,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+"<img/></div></div>",n=10,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-filename"></div></div>',n=11,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-right">',n=12,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semItem.pug",e=e+'<div class="g-sem-tags"></div></div></div>'}catch(a){$a(a,r,n)}return e}const Jx="";function Nr(t){var e=""+t,r=sh.exec(e);if(!r)return t;var n,a,i,s="";for(n=r.index,a=0;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}a!==n&&(s+=e.substring(a,n)),a=n+1,s+=i}return a!==n?s+e.substring(a,n):s}var sh=/["&<>]/;function il(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void il(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function oh(t){var e="",r,n,a;try{var i=t||{};(function(s){a=1,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",(function(){var o=s;if(typeof o.length=="number")for(var u=0,l=o.length;u<l;u++){var f=o[u];a=2,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+'<table class="table table-condensed table-hover">',a=3,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<caption>",a=4,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=f.name)==null?"":r)+"</caption>",a=5,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<thead>",a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<th>",a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"Name</th>",a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<th>",a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"Value</th></thead>",a=8,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<tbody>",a=9,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",(function(){var d=f.data;if(typeof d.length=="number")for(var g=0,m=d.length;g<m;g++){var p=d[g];a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<tr>",a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+" ",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=g)==null?"":r)+"</td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=p)==null?"":r)+"</td></tr>"}else{var m=0;for(var g in d){m++;var p=d[g];a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<tr>",a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+" ",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=g)==null?"":r)+"</td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=p)==null?"":r)+"</td></tr>"}}}).call(this),e=e+"</tbody></table>"}else{var l=0;for(var u in o){l++;var f=o[u];a=2,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+'<table class="table table-condensed table-hover">',a=3,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<caption>",a=4,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=f.name)==null?"":r)+"</caption>",a=5,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<thead>",a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<th>",a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"Name</th>",a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<th>",a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"Value</th></thead>",a=8,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<tbody>",a=9,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",(function(){var p=f.data;if(typeof p.length=="number")for(var b=0,x=p.length;b<x;b++){var w=p[b];a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<tr>",a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+" ",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=b)==null?"":r)+"</td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=w)==null?"":r)+"</td></tr>"}else{var x=0;for(var b in p){x++;var w=p[b];a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<tr>",a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+" ",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=b)==null?"":r)+"</td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+"<td>",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/semMetadata.pug",e=e+Nr((r=w)==null?"":r)+"</td></tr>"}}}).call(this),e=e+"</tbody></table>"}}}).call(this)}).call(this,"config"in i?i.config:typeof config<"u"?config:void 0)}catch(s){il(s,n,a)}return e}const jx="";var uh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sl={};(function(t){(function(e){var r=Object.assign(new Error,{name:"ConfigIniParser Error",message:"Parse config ini file error"}),n=Object.assign(new Error,{name:"ConfigIniParser Error",message:"The specify section not found"}),a=Object.assign(new Error,{name:"ConfigIniParser Error",message:"The specify option not found"}),i=Object.assign(new Error,{name:"ConfigIniParser Error",message:"Found duplicated section in the given ini file"}),s=Object.assign(new Error,{name:"ConfigIniParser Error",message:"Multiple call parse on the same parser instance"}),o=Object.assign(new TypeError,{name:"ConfigIniParser Error",message:"The argument type is not correct"}),u="__DEFAULT_SECTION__",l=/^\s*\[\s*([^\]]+?)\s*\]\s*$/,f=/\s*([^=:\s]+)\s*[=:]\s*(.*)\s*/,d=/^\s*[#;].*/,g=/^\s*$/,m=1,p=1,b=2,x=-1,w=`
`;function E(D,M){for(var L=D.sections,B=0;B<L.length;B++){var N=L[B];if(N.name==M)return N}}function C(D,M){for(var L=D.sections,B=0;B<L.length;B++){var N=L[B];if(N.name==M)return B}return x}function k(D,M){for(var L=D.options,B=0;B<L.length;B++){var N=L[B];if(N.name==M)return N}}function R(D,M){for(var L=D.options,B=0;B<L.length;B++){var N=L[B];if(N.name==M)return B}return x}function A(D){return{name:D,options:[]}}function h(D,M){return{name:D,value:M}}var I=function(D){this.delimiter=D||w,this._calledParse=!1,this._ini={sections:[]},this._ini.sections.push(A(u))};I.prototype.addSection=function(D){if(E(this._ini,D))throw i;var M=A(D);return this._ini.sections.push(M),this},I.prototype.get=function(D,M,L){var B=E(this._ini,D||u);if(B){var N=k(B,M);if(N)return N.value}if(L===void 0)throw a;return L},I.prototype.getOptionFromDefaultSection=function(D,M){return this.get(null,D,M)},I.prototype.getBoolean=function(D,M){var L=this.get(D||u,M);return isNaN(L)?String(L).toLowerCase()=="true":L!=0},I.prototype.getBooleanFromDefaultSection=function(D){return this.getBoolean(null,D)},I.prototype.getNumber=function(D,M){return+this.get(D||u,M)},I.prototype.getNumberFromDefaultSection=function(D){return this.getNumber(null,D)},I.prototype.isHaveSection=function(D){if(!D)throw o;return!!E(this._ini,D)},I.prototype.isHaveOption=function(D,M){var L=E(this._ini,D||u);if(L){var B=k(L,M);if(B)return!0}return!1},I.prototype.isHaveOptionInDefaultSection=function(D){return this.isHaveOption(null,D)},I.prototype.items=function(D){for(var M=E(this._ini,D||u),L=[],B=0;B<M.options.length;B++){var N=M.options[B];L.push([N.name,N.value])}return L},I.prototype.options=function(D){var M=E(this._ini,D||u);if(M){for(var L=[],B=M.options,N,_=0;_<B.length;_++)N=B[_],L.push(N.name);return L}else throw n},I.prototype.removeOption=function(D,M){var L=E(this._ini,D||u);if(L){var B=R(L,M);if(B!=x)return L.options.splice(B,1),!0}return!1},I.prototype.removeOptionFromDefaultSection=function(D){return this.removeOption(null,D)},I.prototype.removeSection=function(D){var M=C(this._ini,D||u);return M!=x?(this._ini.sections.splice(M,1),D===u&&this._ini.sections.push(A(u)),!0):!1},I.prototype.sections=function(){for(var D=[],M=this._ini.sections,L,B=0;B<M.length;B++)L=M[B],L.name!=u&&D.push(L.name);return D},I.prototype.set=function(D,M,L){var B=E(this._ini,D||u),N;if(B)return N=k(B,M),N?(N.value=L,this):(N=h(M,L),B.options.push(N),this);throw n},I.prototype.setOptionInDefaultSection=function(D,M){return this.set(null,D,M)},I.prototype.stringify=function(D){for(var M=[],L=this._ini.sections,B,N,_,U=0;U<L.length;U++){B=L[U],B.name!=u&&M.push("["+B.name+"]"),N=B.options;for(var H=0;H<N.length;H++)_=N[H],M.push(_.name+"="+_.value);M.length>0&&M.push("")}return M.join(D||this.delimiter)},I.prototype.parse=function(D){if(this._calledParse)throw s;this._calledParse=!0;for(var M=D.split(this.delimiter),L=E(this._ini,u),B=0;B<M.length;B++){var N=M[B];if(!(N.match(d)||N.match(g))){var _=N.match(l);if(_){var U=_[m];if(E(this._ini,U))throw i;L=A(U),this._ini.sections.push(L);continue}var H=N.match(f);if(H){var W=H[p],X=H[b],Q=h(W,X);L.options.push(Q);continue}throw r}}return this},I.Errors={Error:r,ErrorNoSection:n,ErrorNoOption:a,ErrorDuplicateSectionError:i,ErrorCallParseMultipleTimes:s,ErrorIncorrectArgumentType:o},e.ConfigIniParser=I})(t)})(sl);const{restRequest:ol}=girder.rest,fo=girder.views.View,fh=girder.collections.FileCollection,ch=fo.extend({className:"g-sem-view",initialize:function(t){this._semImageView=null,this._semMetadataView=null,this.collection=new fh,this.collection.altUrl="item/"+(t.itemId||t.item.get("_id"))+"/files",this.collection.append=!0;var e=this;this.collection.on("g:changed",function(){ol({url:`item/${t.item.id}/tiff_thumbnail`}).done(r=>{e.image=`data:image/png;base64,${r}`,e.trigger("g:tiffLoaded")}),ol({url:`item/${t.item.id}/tiff_metadata`}).done(r=>{const n=new sl.ConfigIniParser(`\r
`);n.parse(r),e.config=n,e.trigger("g:configLoaded")})}).fetch({itemId:t.item.id}),this.listenTo(this,"g:tiffLoaded",this.render)},render:function(){return this.$el.html(ih()),this._semImageView=new dh({el:this.$(".g-sem-image"),parentView:this}),this._semMetadataView=new vh({el:this.$(".g-sem-tags"),parentView:this}),this._semImageView.render(),this._semMetadataView.render(),this}}),dh=fo.extend({className:"g-sem-image",initialize:function(t){this.listenTo(this.parentView,"g:tiffLoaded",this.render)},render:function(){var t=this.$("div > img");return this.parentView.image&&(t[0].src=this.parentView.image,t[0].width=768),this}}),vh=fo.extend({className:"g-sem-tags",initialize:function(t){this.listenTo(this.parentView,"g:configLoaded",this.render)},render:function(){const t=[];return this.parentView.config&&(this.parentView.config.sections().forEach(e=>{var r={name:e,data:{}};this.parentView.config.items(e).forEach(n=>{r.data[n[0]]=n[1]}),t.push(r)}),this.$el.html(oh({config:t}))),this}});var ul={exports:{}};/*!
 * jQuery JavaScript Library v3.7.1
 * https://jquery.com/
 *
 * Copyright OpenJS Foundation and other contributors
 * Released under the MIT license
 * https://jquery.org/license
 *
 * Date: 2023-08-28T13:37Z
 */(function(t){(function(e,r){t.exports=e.document?r(e,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return r(n)}})(typeof window<"u"?window:uh,function(e,r){var n=[],a=Object.getPrototypeOf,i=n.slice,s=n.flat?function(c){return n.flat.call(c)}:function(c){return n.concat.apply([],c)},o=n.push,u=n.indexOf,l={},f=l.toString,d=l.hasOwnProperty,g=d.toString,m=g.call(Object),p={},b=function(v){return typeof v=="function"&&typeof v.nodeType!="number"&&typeof v.item!="function"},x=function(v){return v!=null&&v===v.window},w=e.document,E={type:!0,src:!0,nonce:!0,noModule:!0};function C(c,v,y){y=y||w;var F,T,S=y.createElement("script");if(S.text=c,v)for(F in E)T=v[F]||v.getAttribute&&v.getAttribute(F),T&&S.setAttribute(F,T);y.head.appendChild(S).parentNode.removeChild(S)}function k(c){return c==null?c+"":typeof c=="object"||typeof c=="function"?l[f.call(c)]||"object":typeof c}var R="3.7.1",A=/HTML$/i,h=function(c,v){return new h.fn.init(c,v)};h.fn=h.prototype={jquery:R,constructor:h,length:0,toArray:function(){return i.call(this)},get:function(c){return c==null?i.call(this):c<0?this[c+this.length]:this[c]},pushStack:function(c){var v=h.merge(this.constructor(),c);return v.prevObject=this,v},each:function(c){return h.each(this,c)},map:function(c){return this.pushStack(h.map(this,function(v,y){return c.call(v,y,v)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(h.grep(this,function(c,v){return(v+1)%2}))},odd:function(){return this.pushStack(h.grep(this,function(c,v){return v%2}))},eq:function(c){var v=this.length,y=+c+(c<0?v:0);return this.pushStack(y>=0&&y<v?[this[y]]:[])},end:function(){return this.prevObject||this.constructor()},push:o,sort:n.sort,splice:n.splice},h.extend=h.fn.extend=function(){var c,v,y,F,T,S,P=arguments[0]||{},q=1,V=arguments.length,K=!1;for(typeof P=="boolean"&&(K=P,P=arguments[q]||{},q++),typeof P!="object"&&!b(P)&&(P={}),q===V&&(P=this,q--);q<V;q++)if((c=arguments[q])!=null)for(v in c)F=c[v],!(v==="__proto__"||P===F)&&(K&&F&&(h.isPlainObject(F)||(T=Array.isArray(F)))?(y=P[v],T&&!Array.isArray(y)?S=[]:!T&&!h.isPlainObject(y)?S={}:S=y,T=!1,P[v]=h.extend(K,S,F)):F!==void 0&&(P[v]=F));return P},h.extend({expando:"jQuery"+(R+Math.random()).replace(/\D/g,""),isReady:!0,error:function(c){throw new Error(c)},noop:function(){},isPlainObject:function(c){var v,y;return!c||f.call(c)!=="[object Object]"?!1:(v=a(c),v?(y=d.call(v,"constructor")&&v.constructor,typeof y=="function"&&g.call(y)===m):!0)},isEmptyObject:function(c){var v;for(v in c)return!1;return!0},globalEval:function(c,v,y){C(c,{nonce:v&&v.nonce},y)},each:function(c,v){var y,F=0;if(I(c))for(y=c.length;F<y&&v.call(c[F],F,c[F])!==!1;F++);else for(F in c)if(v.call(c[F],F,c[F])===!1)break;return c},text:function(c){var v,y="",F=0,T=c.nodeType;if(!T)for(;v=c[F++];)y+=h.text(v);return T===1||T===11?c.textContent:T===9?c.documentElement.textContent:T===3||T===4?c.nodeValue:y},makeArray:function(c,v){var y=v||[];return c!=null&&(I(Object(c))?h.merge(y,typeof c=="string"?[c]:c):o.call(y,c)),y},inArray:function(c,v,y){return v==null?-1:u.call(v,c,y)},isXMLDoc:function(c){var v=c&&c.namespaceURI,y=c&&(c.ownerDocument||c).documentElement;return!A.test(v||y&&y.nodeName||"HTML")},merge:function(c,v){for(var y=+v.length,F=0,T=c.length;F<y;F++)c[T++]=v[F];return c.length=T,c},grep:function(c,v,y){for(var F,T=[],S=0,P=c.length,q=!y;S<P;S++)F=!v(c[S],S),F!==q&&T.push(c[S]);return T},map:function(c,v,y){var F,T,S=0,P=[];if(I(c))for(F=c.length;S<F;S++)T=v(c[S],S,y),T!=null&&P.push(T);else for(S in c)T=v(c[S],S,y),T!=null&&P.push(T);return s(P)},guid:1,support:p}),typeof Symbol=="function"&&(h.fn[Symbol.iterator]=n[Symbol.iterator]),h.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(c,v){l["[object "+v+"]"]=v.toLowerCase()});function I(c){var v=!!c&&"length"in c&&c.length,y=k(c);return b(c)||x(c)?!1:y==="array"||v===0||typeof v=="number"&&v>0&&v-1 in c}function D(c,v){return c.nodeName&&c.nodeName.toLowerCase()===v.toLowerCase()}var M=n.pop,L=n.sort,B=n.splice,N="[\\x20\\t\\r\\n\\f]",_=new RegExp("^"+N+"+|((?:^|[^\\\\])(?:\\\\.)*)"+N+"+$","g");h.contains=function(c,v){var y=v&&v.parentNode;return c===y||!!(y&&y.nodeType===1&&(c.contains?c.contains(y):c.compareDocumentPosition&&c.compareDocumentPosition(y)&16))};var U=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function H(c,v){return v?c==="\0"?"�":c.slice(0,-1)+"\\"+c.charCodeAt(c.length-1).toString(16)+" ":"\\"+c}h.escapeSelector=function(c){return(c+"").replace(U,H)};var W=w,X=o;(function(){var c,v,y,F,T,S=X,P,q,V,K,ue,ve=h.expando,re=0,xe=0,Ze=so(),it=so(),je=so(),Yt=so(),Nt=function(z,G){return z===G&&(T=!0),0},Gr="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",Kr="(?:\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",nt="\\["+N+"*("+Kr+")(?:"+N+"*([*^$|!~]?=)"+N+`*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(`+Kr+"))|)"+N+"*\\]",na=":("+Kr+`)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|`+nt+")*)|.*)\\)|)",ct=new RegExp(N+"+","g"),Pt=new RegExp("^"+N+"*,"+N+"*"),Hi=new RegExp("^"+N+"*([>+~]|"+N+")"+N+"*"),Ju=new RegExp(N+"|>"),Xr=new RegExp(na),Wi=new RegExp("^"+Kr+"$"),Yr={ID:new RegExp("^#("+Kr+")"),CLASS:new RegExp("^\\.("+Kr+")"),TAG:new RegExp("^("+Kr+"|[*])"),ATTR:new RegExp("^"+nt),PSEUDO:new RegExp("^"+na),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+Gr+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},An=/^(?:input|select|textarea|button)$/i,Bn=/^h\d$/i,Ar=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ju=/[+~]/,sn=new RegExp("\\\\[\\da-fA-F]{1,6}"+N+"?|\\\\([^\\r\\n\\f])","g"),on=function(z,G){var te="0x"+z.slice(1)-65536;return G||(te<0?String.fromCharCode(te+65536):String.fromCharCode(te>>10|55296,te&1023|56320))},Ux=function(){In()},Gx=uo(function(z){return z.disabled===!0&&D(z,"fieldset")},{dir:"parentNode",next:"legend"});function Kx(){try{return P.activeElement}catch{}}try{S.apply(n=i.call(W.childNodes),W.childNodes),n[W.childNodes.length].nodeType}catch{S={apply:function(G,te){X.apply(G,i.call(te))},call:function(G){X.apply(G,i.call(arguments,1))}}}function yt(z,G,te,ie){var ce,Ce,Pe,Ne,Ae,tt,Xe,Qe=G&&G.ownerDocument,rt=G?G.nodeType:9;if(te=te||[],typeof z!="string"||!z||rt!==1&&rt!==9&&rt!==11)return te;if(!ie&&(In(G),G=G||P,V)){if(rt!==11&&(Ae=Ar.exec(z)))if(ce=Ae[1]){if(rt===9)if(Pe=G.getElementById(ce)){if(Pe.id===ce)return S.call(te,Pe),te}else return te;else if(Qe&&(Pe=Qe.getElementById(ce))&&yt.contains(G,Pe)&&Pe.id===ce)return S.call(te,Pe),te}else{if(Ae[2])return S.apply(te,G.getElementsByTagName(z)),te;if((ce=Ae[3])&&G.getElementsByClassName)return S.apply(te,G.getElementsByClassName(ce)),te}if(!Yt[z+" "]&&(!K||!K.test(z))){if(Xe=z,Qe=G,rt===1&&(Ju.test(z)||Hi.test(z))){for(Qe=ju.test(z)&&el(G.parentNode)||G,(Qe!=G||!p.scope)&&((Ne=G.getAttribute("id"))?Ne=h.escapeSelector(Ne):G.setAttribute("id",Ne=ve)),tt=Ui(z),Ce=tt.length;Ce--;)tt[Ce]=(Ne?"#"+Ne:":scope")+" "+oo(tt[Ce]);Xe=tt.join(",")}try{return S.apply(te,Qe.querySelectorAll(Xe)),te}catch{Yt(z,!0)}finally{Ne===ve&&G.removeAttribute("id")}}}return ah(z.replace(_,"$1"),G,te,ie)}function so(){var z=[];function G(te,ie){return z.push(te+" ")>v.cacheLength&&delete G[z.shift()],G[te+" "]=ie}return G}function Or(z){return z[ve]=!0,z}function za(z){var G=P.createElement("fieldset");try{return!!z(G)}catch{return!1}finally{G.parentNode&&G.parentNode.removeChild(G),G=null}}function Xx(z){return function(G){return D(G,"input")&&G.type===z}}function Yx(z){return function(G){return(D(G,"input")||D(G,"button"))&&G.type===z}}function rh(z){return function(G){return"form"in G?G.parentNode&&G.disabled===!1?"label"in G?"label"in G.parentNode?G.parentNode.disabled===z:G.disabled===z:G.isDisabled===z||G.isDisabled!==!z&&Gx(G)===z:G.disabled===z:"label"in G?G.disabled===z:!1}}function aa(z){return Or(function(G){return G=+G,Or(function(te,ie){for(var ce,Ce=z([],te.length,G),Pe=Ce.length;Pe--;)te[ce=Ce[Pe]]&&(te[ce]=!(ie[ce]=te[ce]))})})}function el(z){return z&&typeof z.getElementsByTagName<"u"&&z}function In(z){var G,te=z?z.ownerDocument||z:W;return te==P||te.nodeType!==9||!te.documentElement||(P=te,q=P.documentElement,V=!h.isXMLDoc(P),ue=q.matches||q.webkitMatchesSelector||q.msMatchesSelector,q.msMatchesSelector&&W!=P&&(G=P.defaultView)&&G.top!==G&&G.addEventListener("unload",Ux),p.getById=za(function(ie){return q.appendChild(ie).id=h.expando,!P.getElementsByName||!P.getElementsByName(h.expando).length}),p.disconnectedMatch=za(function(ie){return ue.call(ie,"*")}),p.scope=za(function(){return P.querySelectorAll(":scope")}),p.cssHas=za(function(){try{return P.querySelector(":has(*,:jqfake)"),!1}catch{return!0}}),p.getById?(v.filter.ID=function(ie){var ce=ie.replace(sn,on);return function(Ce){return Ce.getAttribute("id")===ce}},v.find.ID=function(ie,ce){if(typeof ce.getElementById<"u"&&V){var Ce=ce.getElementById(ie);return Ce?[Ce]:[]}}):(v.filter.ID=function(ie){var ce=ie.replace(sn,on);return function(Ce){var Pe=typeof Ce.getAttributeNode<"u"&&Ce.getAttributeNode("id");return Pe&&Pe.value===ce}},v.find.ID=function(ie,ce){if(typeof ce.getElementById<"u"&&V){var Ce,Pe,Ne,Ae=ce.getElementById(ie);if(Ae){if(Ce=Ae.getAttributeNode("id"),Ce&&Ce.value===ie)return[Ae];for(Ne=ce.getElementsByName(ie),Pe=0;Ae=Ne[Pe++];)if(Ce=Ae.getAttributeNode("id"),Ce&&Ce.value===ie)return[Ae]}return[]}}),v.find.TAG=function(ie,ce){return typeof ce.getElementsByTagName<"u"?ce.getElementsByTagName(ie):ce.querySelectorAll(ie)},v.find.CLASS=function(ie,ce){if(typeof ce.getElementsByClassName<"u"&&V)return ce.getElementsByClassName(ie)},K=[],za(function(ie){var ce;q.appendChild(ie).innerHTML="<a id='"+ve+"' href='' disabled='disabled'></a><select id='"+ve+"-\r\\' disabled='disabled'><option selected=''></option></select>",ie.querySelectorAll("[selected]").length||K.push("\\["+N+"*(?:value|"+Gr+")"),ie.querySelectorAll("[id~="+ve+"-]").length||K.push("~="),ie.querySelectorAll("a#"+ve+"+*").length||K.push(".#.+[+~]"),ie.querySelectorAll(":checked").length||K.push(":checked"),ce=P.createElement("input"),ce.setAttribute("type","hidden"),ie.appendChild(ce).setAttribute("name","D"),q.appendChild(ie).disabled=!0,ie.querySelectorAll(":disabled").length!==2&&K.push(":enabled",":disabled"),ce=P.createElement("input"),ce.setAttribute("name",""),ie.appendChild(ce),ie.querySelectorAll("[name='']").length||K.push("\\["+N+"*name"+N+"*="+N+`*(?:''|"")`)}),p.cssHas||K.push(":has"),K=K.length&&new RegExp(K.join("|")),Nt=function(ie,ce){if(ie===ce)return T=!0,0;var Ce=!ie.compareDocumentPosition-!ce.compareDocumentPosition;return Ce||(Ce=(ie.ownerDocument||ie)==(ce.ownerDocument||ce)?ie.compareDocumentPosition(ce):1,Ce&1||!p.sortDetached&&ce.compareDocumentPosition(ie)===Ce?ie===P||ie.ownerDocument==W&&yt.contains(W,ie)?-1:ce===P||ce.ownerDocument==W&&yt.contains(W,ce)?1:F?u.call(F,ie)-u.call(F,ce):0:Ce&4?-1:1)}),P}yt.matches=function(z,G){return yt(z,null,null,G)},yt.matchesSelector=function(z,G){if(In(z),V&&!Yt[G+" "]&&(!K||!K.test(G)))try{var te=ue.call(z,G);if(te||p.disconnectedMatch||z.document&&z.document.nodeType!==11)return te}catch{Yt(G,!0)}return yt(G,P,null,[z]).length>0},yt.contains=function(z,G){return(z.ownerDocument||z)!=P&&In(z),h.contains(z,G)},yt.attr=function(z,G){(z.ownerDocument||z)!=P&&In(z);var te=v.attrHandle[G.toLowerCase()],ie=te&&d.call(v.attrHandle,G.toLowerCase())?te(z,G,!V):void 0;return ie!==void 0?ie:z.getAttribute(G)},yt.error=function(z){throw new Error("Syntax error, unrecognized expression: "+z)},h.uniqueSort=function(z){var G,te=[],ie=0,ce=0;if(T=!p.sortStable,F=!p.sortStable&&i.call(z,0),L.call(z,Nt),T){for(;G=z[ce++];)G===z[ce]&&(ie=te.push(ce));for(;ie--;)B.call(z,te[ie],1)}return F=null,z},h.fn.uniqueSort=function(){return this.pushStack(h.uniqueSort(i.apply(this)))},v=h.expr={cacheLength:50,createPseudo:Or,match:Yr,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(z){return z[1]=z[1].replace(sn,on),z[3]=(z[3]||z[4]||z[5]||"").replace(sn,on),z[2]==="~="&&(z[3]=" "+z[3]+" "),z.slice(0,4)},CHILD:function(z){return z[1]=z[1].toLowerCase(),z[1].slice(0,3)==="nth"?(z[3]||yt.error(z[0]),z[4]=+(z[4]?z[5]+(z[6]||1):2*(z[3]==="even"||z[3]==="odd")),z[5]=+(z[7]+z[8]||z[3]==="odd")):z[3]&&yt.error(z[0]),z},PSEUDO:function(z){var G,te=!z[6]&&z[2];return Yr.CHILD.test(z[0])?null:(z[3]?z[2]=z[4]||z[5]||"":te&&Xr.test(te)&&(G=Ui(te,!0))&&(G=te.indexOf(")",te.length-G)-te.length)&&(z[0]=z[0].slice(0,G),z[2]=te.slice(0,G)),z.slice(0,3))}},filter:{TAG:function(z){var G=z.replace(sn,on).toLowerCase();return z==="*"?function(){return!0}:function(te){return D(te,G)}},CLASS:function(z){var G=Ze[z+" "];return G||(G=new RegExp("(^|"+N+")"+z+"("+N+"|$)"))&&Ze(z,function(te){return G.test(typeof te.className=="string"&&te.className||typeof te.getAttribute<"u"&&te.getAttribute("class")||"")})},ATTR:function(z,G,te){return function(ie){var ce=yt.attr(ie,z);return ce==null?G==="!=":G?(ce+="",G==="="?ce===te:G==="!="?ce!==te:G==="^="?te&&ce.indexOf(te)===0:G==="*="?te&&ce.indexOf(te)>-1:G==="$="?te&&ce.slice(-te.length)===te:G==="~="?(" "+ce.replace(ct," ")+" ").indexOf(te)>-1:G==="|="?ce===te||ce.slice(0,te.length+1)===te+"-":!1):!0}},CHILD:function(z,G,te,ie,ce){var Ce=z.slice(0,3)!=="nth",Pe=z.slice(-4)!=="last",Ne=G==="of-type";return ie===1&&ce===0?function(Ae){return!!Ae.parentNode}:function(Ae,tt,Xe){var Qe,rt,qe,Et,yr,ir=Ce!==Pe?"nextSibling":"previousSibling",Br=Ae.parentNode,Zr=Ne&&Ae.nodeName.toLowerCase(),Va=!Xe&&!Ne,lr=!1;if(Br){if(Ce){for(;ir;){for(qe=Ae;qe=qe[ir];)if(Ne?D(qe,Zr):qe.nodeType===1)return!1;yr=ir=z==="only"&&!yr&&"nextSibling"}return!0}if(yr=[Pe?Br.firstChild:Br.lastChild],Pe&&Va){for(rt=Br[ve]||(Br[ve]={}),Qe=rt[z]||[],Et=Qe[0]===re&&Qe[1],lr=Et&&Qe[2],qe=Et&&Br.childNodes[Et];qe=++Et&&qe&&qe[ir]||(lr=Et=0)||yr.pop();)if(qe.nodeType===1&&++lr&&qe===Ae){rt[z]=[re,Et,lr];break}}else if(Va&&(rt=Ae[ve]||(Ae[ve]={}),Qe=rt[z]||[],Et=Qe[0]===re&&Qe[1],lr=Et),lr===!1)for(;(qe=++Et&&qe&&qe[ir]||(lr=Et=0)||yr.pop())&&!((Ne?D(qe,Zr):qe.nodeType===1)&&++lr&&(Va&&(rt=qe[ve]||(qe[ve]={}),rt[z]=[re,lr]),qe===Ae)););return lr-=ce,lr===ie||lr%ie===0&&lr/ie>=0}}},PSEUDO:function(z,G){var te,ie=v.pseudos[z]||v.setFilters[z.toLowerCase()]||yt.error("unsupported pseudo: "+z);return ie[ve]?ie(G):ie.length>1?(te=[z,z,"",G],v.setFilters.hasOwnProperty(z.toLowerCase())?Or(function(ce,Ce){for(var Pe,Ne=ie(ce,G),Ae=Ne.length;Ae--;)Pe=u.call(ce,Ne[Ae]),ce[Pe]=!(Ce[Pe]=Ne[Ae])}):function(ce){return ie(ce,0,te)}):ie}},pseudos:{not:Or(function(z){var G=[],te=[],ie=al(z.replace(_,"$1"));return ie[ve]?Or(function(ce,Ce,Pe,Ne){for(var Ae,tt=ie(ce,null,Ne,[]),Xe=ce.length;Xe--;)(Ae=tt[Xe])&&(ce[Xe]=!(Ce[Xe]=Ae))}):function(ce,Ce,Pe){return G[0]=ce,ie(G,null,Pe,te),G[0]=null,!te.pop()}}),has:Or(function(z){return function(G){return yt(z,G).length>0}}),contains:Or(function(z){return z=z.replace(sn,on),function(G){return(G.textContent||h.text(G)).indexOf(z)>-1}}),lang:Or(function(z){return Wi.test(z||"")||yt.error("unsupported lang: "+z),z=z.replace(sn,on).toLowerCase(),function(G){var te;do if(te=V?G.lang:G.getAttribute("xml:lang")||G.getAttribute("lang"))return te=te.toLowerCase(),te===z||te.indexOf(z+"-")===0;while((G=G.parentNode)&&G.nodeType===1);return!1}}),target:function(z){var G=e.location&&e.location.hash;return G&&G.slice(1)===z.id},root:function(z){return z===q},focus:function(z){return z===Kx()&&P.hasFocus()&&!!(z.type||z.href||~z.tabIndex)},enabled:rh(!1),disabled:rh(!0),checked:function(z){return D(z,"input")&&!!z.checked||D(z,"option")&&!!z.selected},selected:function(z){return z.parentNode&&z.parentNode.selectedIndex,z.selected===!0},empty:function(z){for(z=z.firstChild;z;z=z.nextSibling)if(z.nodeType<6)return!1;return!0},parent:function(z){return!v.pseudos.empty(z)},header:function(z){return Bn.test(z.nodeName)},input:function(z){return An.test(z.nodeName)},button:function(z){return D(z,"input")&&z.type==="button"||D(z,"button")},text:function(z){var G;return D(z,"input")&&z.type==="text"&&((G=z.getAttribute("type"))==null||G.toLowerCase()==="text")},first:aa(function(){return[0]}),last:aa(function(z,G){return[G-1]}),eq:aa(function(z,G,te){return[te<0?te+G:te]}),even:aa(function(z,G){for(var te=0;te<G;te+=2)z.push(te);return z}),odd:aa(function(z,G){for(var te=1;te<G;te+=2)z.push(te);return z}),lt:aa(function(z,G,te){var ie;for(te<0?ie=te+G:te>G?ie=G:ie=te;--ie>=0;)z.push(ie);return z}),gt:aa(function(z,G,te){for(var ie=te<0?te+G:te;++ie<G;)z.push(ie);return z})}},v.pseudos.nth=v.pseudos.eq;for(c in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})v.pseudos[c]=Xx(c);for(c in{submit:!0,reset:!0})v.pseudos[c]=Yx(c);function nh(){}nh.prototype=v.filters=v.pseudos,v.setFilters=new nh;function Ui(z,G){var te,ie,ce,Ce,Pe,Ne,Ae,tt=it[z+" "];if(tt)return G?0:tt.slice(0);for(Pe=z,Ne=[],Ae=v.preFilter;Pe;){(!te||(ie=Pt.exec(Pe)))&&(ie&&(Pe=Pe.slice(ie[0].length)||Pe),Ne.push(ce=[])),te=!1,(ie=Hi.exec(Pe))&&(te=ie.shift(),ce.push({value:te,type:ie[0].replace(_," ")}),Pe=Pe.slice(te.length));for(Ce in v.filter)(ie=Yr[Ce].exec(Pe))&&(!Ae[Ce]||(ie=Ae[Ce](ie)))&&(te=ie.shift(),ce.push({value:te,type:Ce,matches:ie}),Pe=Pe.slice(te.length));if(!te)break}return G?Pe.length:Pe?yt.error(z):it(z,Ne).slice(0)}function oo(z){for(var G=0,te=z.length,ie="";G<te;G++)ie+=z[G].value;return ie}function uo(z,G,te){var ie=G.dir,ce=G.next,Ce=ce||ie,Pe=te&&Ce==="parentNode",Ne=xe++;return G.first?function(Ae,tt,Xe){for(;Ae=Ae[ie];)if(Ae.nodeType===1||Pe)return z(Ae,tt,Xe);return!1}:function(Ae,tt,Xe){var Qe,rt,qe=[re,Ne];if(Xe){for(;Ae=Ae[ie];)if((Ae.nodeType===1||Pe)&&z(Ae,tt,Xe))return!0}else for(;Ae=Ae[ie];)if(Ae.nodeType===1||Pe)if(rt=Ae[ve]||(Ae[ve]={}),ce&&D(Ae,ce))Ae=Ae[ie]||Ae;else{if((Qe=rt[Ce])&&Qe[0]===re&&Qe[1]===Ne)return qe[2]=Qe[2];if(rt[Ce]=qe,qe[2]=z(Ae,tt,Xe))return!0}return!1}}function tl(z){return z.length>1?function(G,te,ie){for(var ce=z.length;ce--;)if(!z[ce](G,te,ie))return!1;return!0}:z[0]}function Zx(z,G,te){for(var ie=0,ce=G.length;ie<ce;ie++)yt(z,G[ie],te);return te}function lo(z,G,te,ie,ce){for(var Ce,Pe=[],Ne=0,Ae=z.length,tt=G!=null;Ne<Ae;Ne++)(Ce=z[Ne])&&(!te||te(Ce,ie,ce))&&(Pe.push(Ce),tt&&G.push(Ne));return Pe}function rl(z,G,te,ie,ce,Ce){return ie&&!ie[ve]&&(ie=rl(ie)),ce&&!ce[ve]&&(ce=rl(ce,Ce)),Or(function(Pe,Ne,Ae,tt){var Xe,Qe,rt,qe,Et=[],yr=[],ir=Ne.length,Br=Pe||Zx(G||"*",Ae.nodeType?[Ae]:Ae,[]),Zr=z&&(Pe||!G)?lo(Br,Et,z,Ae,tt):Br;if(te?(qe=ce||(Pe?z:ir||ie)?[]:Ne,te(Zr,qe,Ae,tt)):qe=Zr,ie)for(Xe=lo(qe,yr),ie(Xe,[],Ae,tt),Qe=Xe.length;Qe--;)(rt=Xe[Qe])&&(qe[yr[Qe]]=!(Zr[yr[Qe]]=rt));if(Pe){if(ce||z){if(ce){for(Xe=[],Qe=qe.length;Qe--;)(rt=qe[Qe])&&Xe.push(Zr[Qe]=rt);ce(null,qe=[],Xe,tt)}for(Qe=qe.length;Qe--;)(rt=qe[Qe])&&(Xe=ce?u.call(Pe,rt):Et[Qe])>-1&&(Pe[Xe]=!(Ne[Xe]=rt))}}else qe=lo(qe===Ne?qe.splice(ir,qe.length):qe),ce?ce(null,Ne,qe,tt):S.apply(Ne,qe)})}function nl(z){for(var G,te,ie,ce=z.length,Ce=v.relative[z[0].type],Pe=Ce||v.relative[" "],Ne=Ce?1:0,Ae=uo(function(Qe){return Qe===G},Pe,!0),tt=uo(function(Qe){return u.call(G,Qe)>-1},Pe,!0),Xe=[function(Qe,rt,qe){var Et=!Ce&&(qe||rt!=y)||((G=rt).nodeType?Ae(Qe,rt,qe):tt(Qe,rt,qe));return G=null,Et}];Ne<ce;Ne++)if(te=v.relative[z[Ne].type])Xe=[uo(tl(Xe),te)];else{if(te=v.filter[z[Ne].type].apply(null,z[Ne].matches),te[ve]){for(ie=++Ne;ie<ce&&!v.relative[z[ie].type];ie++);return rl(Ne>1&&tl(Xe),Ne>1&&oo(z.slice(0,Ne-1).concat({value:z[Ne-2].type===" "?"*":""})).replace(_,"$1"),te,Ne<ie&&nl(z.slice(Ne,ie)),ie<ce&&nl(z=z.slice(ie)),ie<ce&&oo(z))}Xe.push(te)}return tl(Xe)}function Qx(z,G){var te=G.length>0,ie=z.length>0,ce=function(Ce,Pe,Ne,Ae,tt){var Xe,Qe,rt,qe=0,Et="0",yr=Ce&&[],ir=[],Br=y,Zr=Ce||ie&&v.find.TAG("*",tt),Va=re+=Br==null?1:Math.random()||.1,lr=Zr.length;for(tt&&(y=Pe==P||Pe||tt);Et!==lr&&(Xe=Zr[Et])!=null;Et++){if(ie&&Xe){for(Qe=0,!Pe&&Xe.ownerDocument!=P&&(In(Xe),Ne=!V);rt=z[Qe++];)if(rt(Xe,Pe||P,Ne)){S.call(Ae,Xe);break}tt&&(re=Va)}te&&((Xe=!rt&&Xe)&&qe--,Ce&&yr.push(Xe))}if(qe+=Et,te&&Et!==qe){for(Qe=0;rt=G[Qe++];)rt(yr,ir,Pe,Ne);if(Ce){if(qe>0)for(;Et--;)yr[Et]||ir[Et]||(ir[Et]=M.call(Ae));ir=lo(ir)}S.apply(Ae,ir),tt&&!Ce&&ir.length>0&&qe+G.length>1&&h.uniqueSort(Ae)}return tt&&(re=Va,y=Br),yr};return te?Or(ce):ce}function al(z,G){var te,ie=[],ce=[],Ce=je[z+" "];if(!Ce){for(G||(G=Ui(z)),te=G.length;te--;)Ce=nl(G[te]),Ce[ve]?ie.push(Ce):ce.push(Ce);Ce=je(z,Qx(ce,ie)),Ce.selector=z}return Ce}function ah(z,G,te,ie){var ce,Ce,Pe,Ne,Ae,tt=typeof z=="function"&&z,Xe=!ie&&Ui(z=tt.selector||z);if(te=te||[],Xe.length===1){if(Ce=Xe[0]=Xe[0].slice(0),Ce.length>2&&(Pe=Ce[0]).type==="ID"&&G.nodeType===9&&V&&v.relative[Ce[1].type]){if(G=(v.find.ID(Pe.matches[0].replace(sn,on),G)||[])[0],G)tt&&(G=G.parentNode);else return te;z=z.slice(Ce.shift().value.length)}for(ce=Yr.needsContext.test(z)?0:Ce.length;ce--&&(Pe=Ce[ce],!v.relative[Ne=Pe.type]);)if((Ae=v.find[Ne])&&(ie=Ae(Pe.matches[0].replace(sn,on),ju.test(Ce[0].type)&&el(G.parentNode)||G))){if(Ce.splice(ce,1),z=ie.length&&oo(Ce),!z)return S.apply(te,ie),te;break}}return(tt||al(z,Xe))(ie,G,!V,te,!G||ju.test(z)&&el(G.parentNode)||G),te}p.sortStable=ve.split("").sort(Nt).join("")===ve,In(),p.sortDetached=za(function(z){return z.compareDocumentPosition(P.createElement("fieldset"))&1}),h.find=yt,h.expr[":"]=h.expr.pseudos,h.unique=h.uniqueSort,yt.compile=al,yt.select=ah,yt.setDocument=In,yt.tokenize=Ui,yt.escape=h.escapeSelector,yt.getText=h.text,yt.isXML=h.isXMLDoc,yt.selectors=h.expr,yt.support=h.support,yt.uniqueSort=h.uniqueSort})();var Q=function(c,v,y){for(var F=[],T=y!==void 0;(c=c[v])&&c.nodeType!==9;)if(c.nodeType===1){if(T&&h(c).is(y))break;F.push(c)}return F},se=function(c,v){for(var y=[];c;c=c.nextSibling)c.nodeType===1&&c!==v&&y.push(c);return y},j=h.expr.match.needsContext,ee=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function de(c,v,y){return b(v)?h.grep(c,function(F,T){return!!v.call(F,T,F)!==y}):v.nodeType?h.grep(c,function(F){return F===v!==y}):typeof v!="string"?h.grep(c,function(F){return u.call(v,F)>-1!==y}):h.filter(v,c,y)}h.filter=function(c,v,y){var F=v[0];return y&&(c=":not("+c+")"),v.length===1&&F.nodeType===1?h.find.matchesSelector(F,c)?[F]:[]:h.find.matches(c,h.grep(v,function(T){return T.nodeType===1}))},h.fn.extend({find:function(c){var v,y,F=this.length,T=this;if(typeof c!="string")return this.pushStack(h(c).filter(function(){for(v=0;v<F;v++)if(h.contains(T[v],this))return!0}));for(y=this.pushStack([]),v=0;v<F;v++)h.find(c,T[v],y);return F>1?h.uniqueSort(y):y},filter:function(c){return this.pushStack(de(this,c||[],!1))},not:function(c){return this.pushStack(de(this,c||[],!0))},is:function(c){return!!de(this,typeof c=="string"&&j.test(c)?h(c):c||[],!1).length}});var ge,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,pe=h.fn.init=function(c,v,y){var F,T;if(!c)return this;if(y=y||ge,typeof c=="string")if(c[0]==="<"&&c[c.length-1]===">"&&c.length>=3?F=[null,c,null]:F=me.exec(c),F&&(F[1]||!v))if(F[1]){if(v=v instanceof h?v[0]:v,h.merge(this,h.parseHTML(F[1],v&&v.nodeType?v.ownerDocument||v:w,!0)),ee.test(F[1])&&h.isPlainObject(v))for(F in v)b(this[F])?this[F](v[F]):this.attr(F,v[F]);return this}else return T=w.getElementById(F[2]),T&&(this[0]=T,this.length=1),this;else return!v||v.jquery?(v||y).find(c):this.constructor(v).find(c);else{if(c.nodeType)return this[0]=c,this.length=1,this;if(b(c))return y.ready!==void 0?y.ready(c):c(h)}return h.makeArray(c,this)};pe.prototype=h.fn,ge=h(w);var we=/^(?:parents|prev(?:Until|All))/,be={children:!0,contents:!0,next:!0,prev:!0};h.fn.extend({has:function(c){var v=h(c,this),y=v.length;return this.filter(function(){for(var F=0;F<y;F++)if(h.contains(this,v[F]))return!0})},closest:function(c,v){var y,F=0,T=this.length,S=[],P=typeof c!="string"&&h(c);if(!j.test(c)){for(;F<T;F++)for(y=this[F];y&&y!==v;y=y.parentNode)if(y.nodeType<11&&(P?P.index(y)>-1:y.nodeType===1&&h.find.matchesSelector(y,c))){S.push(y);break}}return this.pushStack(S.length>1?h.uniqueSort(S):S)},index:function(c){return c?typeof c=="string"?u.call(h(c),this[0]):u.call(this,c.jquery?c[0]:c):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(c,v){return this.pushStack(h.uniqueSort(h.merge(this.get(),h(c,v))))},addBack:function(c){return this.add(c==null?this.prevObject:this.prevObject.filter(c))}});function ae(c,v){for(;(c=c[v])&&c.nodeType!==1;);return c}h.each({parent:function(c){var v=c.parentNode;return v&&v.nodeType!==11?v:null},parents:function(c){return Q(c,"parentNode")},parentsUntil:function(c,v,y){return Q(c,"parentNode",y)},next:function(c){return ae(c,"nextSibling")},prev:function(c){return ae(c,"previousSibling")},nextAll:function(c){return Q(c,"nextSibling")},prevAll:function(c){return Q(c,"previousSibling")},nextUntil:function(c,v,y){return Q(c,"nextSibling",y)},prevUntil:function(c,v,y){return Q(c,"previousSibling",y)},siblings:function(c){return se((c.parentNode||{}).firstChild,c)},children:function(c){return se(c.firstChild)},contents:function(c){return c.contentDocument!=null&&a(c.contentDocument)?c.contentDocument:(D(c,"template")&&(c=c.content||c),h.merge([],c.childNodes))}},function(c,v){h.fn[c]=function(y,F){var T=h.map(this,v,y);return c.slice(-5)!=="Until"&&(F=y),F&&typeof F=="string"&&(T=h.filter(F,T)),this.length>1&&(be[c]||h.uniqueSort(T),we.test(c)&&T.reverse()),this.pushStack(T)}});var Y=/[^\x20\t\r\n\f]+/g;function oe(c){var v={};return h.each(c.match(Y)||[],function(y,F){v[F]=!0}),v}h.Callbacks=function(c){c=typeof c=="string"?oe(c):h.extend({},c);var v,y,F,T,S=[],P=[],q=-1,V=function(){for(T=T||c.once,F=v=!0;P.length;q=-1)for(y=P.shift();++q<S.length;)S[q].apply(y[0],y[1])===!1&&c.stopOnFalse&&(q=S.length,y=!1);c.memory||(y=!1),v=!1,T&&(y?S=[]:S="")},K={add:function(){return S&&(y&&!v&&(q=S.length-1,P.push(y)),function ue(ve){h.each(ve,function(re,xe){b(xe)?(!c.unique||!K.has(xe))&&S.push(xe):xe&&xe.length&&k(xe)!=="string"&&ue(xe)})}(arguments),y&&!v&&V()),this},remove:function(){return h.each(arguments,function(ue,ve){for(var re;(re=h.inArray(ve,S,re))>-1;)S.splice(re,1),re<=q&&q--}),this},has:function(ue){return ue?h.inArray(ue,S)>-1:S.length>0},empty:function(){return S&&(S=[]),this},disable:function(){return T=P=[],S=y="",this},disabled:function(){return!S},lock:function(){return T=P=[],!y&&!v&&(S=y=""),this},locked:function(){return!!T},fireWith:function(ue,ve){return T||(ve=ve||[],ve=[ue,ve.slice?ve.slice():ve],P.push(ve),v||V()),this},fire:function(){return K.fireWith(this,arguments),this},fired:function(){return!!F}};return K};function ye(c){return c}function De(c){throw c}function Be(c,v,y,F){var T;try{c&&b(T=c.promise)?T.call(c).done(v).fail(y):c&&b(T=c.then)?T.call(c,v,y):v.apply(void 0,[c].slice(F))}catch(S){y.apply(void 0,[S])}}h.extend({Deferred:function(c){var v=[["notify","progress",h.Callbacks("memory"),h.Callbacks("memory"),2],["resolve","done",h.Callbacks("once memory"),h.Callbacks("once memory"),0,"resolved"],["reject","fail",h.Callbacks("once memory"),h.Callbacks("once memory"),1,"rejected"]],y="pending",F={state:function(){return y},always:function(){return T.done(arguments).fail(arguments),this},catch:function(S){return F.then(null,S)},pipe:function(){var S=arguments;return h.Deferred(function(P){h.each(v,function(q,V){var K=b(S[V[4]])&&S[V[4]];T[V[1]](function(){var ue=K&&K.apply(this,arguments);ue&&b(ue.promise)?ue.promise().progress(P.notify).done(P.resolve).fail(P.reject):P[V[0]+"With"](this,K?[ue]:arguments)})}),S=null}).promise()},then:function(S,P,q){var V=0;function K(ue,ve,re,xe){return function(){var Ze=this,it=arguments,je=function(){var Nt,Gr;if(!(ue<V)){if(Nt=re.apply(Ze,it),Nt===ve.promise())throw new TypeError("Thenable self-resolution");Gr=Nt&&(typeof Nt=="object"||typeof Nt=="function")&&Nt.then,b(Gr)?xe?Gr.call(Nt,K(V,ve,ye,xe),K(V,ve,De,xe)):(V++,Gr.call(Nt,K(V,ve,ye,xe),K(V,ve,De,xe),K(V,ve,ye,ve.notifyWith))):(re!==ye&&(Ze=void 0,it=[Nt]),(xe||ve.resolveWith)(Ze,it))}},Yt=xe?je:function(){try{je()}catch(Nt){h.Deferred.exceptionHook&&h.Deferred.exceptionHook(Nt,Yt.error),ue+1>=V&&(re!==De&&(Ze=void 0,it=[Nt]),ve.rejectWith(Ze,it))}};ue?Yt():(h.Deferred.getErrorHook?Yt.error=h.Deferred.getErrorHook():h.Deferred.getStackHook&&(Yt.error=h.Deferred.getStackHook()),e.setTimeout(Yt))}}return h.Deferred(function(ue){v[0][3].add(K(0,ue,b(q)?q:ye,ue.notifyWith)),v[1][3].add(K(0,ue,b(S)?S:ye)),v[2][3].add(K(0,ue,b(P)?P:De))}).promise()},promise:function(S){return S!=null?h.extend(S,F):F}},T={};return h.each(v,function(S,P){var q=P[2],V=P[5];F[P[1]]=q.add,V&&q.add(function(){y=V},v[3-S][2].disable,v[3-S][3].disable,v[0][2].lock,v[0][3].lock),q.add(P[3].fire),T[P[0]]=function(){return T[P[0]+"With"](this===T?void 0:this,arguments),this},T[P[0]+"With"]=q.fireWith}),F.promise(T),c&&c.call(T,T),T},when:function(c){var v=arguments.length,y=v,F=Array(y),T=i.call(arguments),S=h.Deferred(),P=function(q){return function(V){F[q]=this,T[q]=arguments.length>1?i.call(arguments):V,--v||S.resolveWith(F,T)}};if(v<=1&&(Be(c,S.done(P(y)).resolve,S.reject,!v),S.state()==="pending"||b(T[y]&&T[y].then)))return S.then();for(;y--;)Be(T[y],P(y),S.reject);return S.promise()}});var Je=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;h.Deferred.exceptionHook=function(c,v){e.console&&e.console.warn&&c&&Je.test(c.name)&&e.console.warn("jQuery.Deferred exception: "+c.message,c.stack,v)},h.readyException=function(c){e.setTimeout(function(){throw c})};var ut=h.Deferred();h.fn.ready=function(c){return ut.then(c).catch(function(v){h.readyException(v)}),this},h.extend({isReady:!1,readyWait:1,ready:function(c){(c===!0?--h.readyWait:h.isReady)||(h.isReady=!0,!(c!==!0&&--h.readyWait>0)&&ut.resolveWith(w,[h]))}}),h.ready.then=ut.then;function at(){w.removeEventListener("DOMContentLoaded",at),e.removeEventListener("load",at),h.ready()}w.readyState==="complete"||w.readyState!=="loading"&&!w.documentElement.doScroll?e.setTimeout(h.ready):(w.addEventListener("DOMContentLoaded",at),e.addEventListener("load",at));var ke=function(c,v,y,F,T,S,P){var q=0,V=c.length,K=y==null;if(k(y)==="object"){T=!0;for(q in y)ke(c,v,q,y[q],!0,S,P)}else if(F!==void 0&&(T=!0,b(F)||(P=!0),K&&(P?(v.call(c,F),v=null):(K=v,v=function(ue,ve,re){return K.call(h(ue),re)})),v))for(;q<V;q++)v(c[q],y,P?F:F.call(c[q],q,v(c[q],y)));return T?c:K?v.call(c):V?v(c[0],y):S},Ie=/^-ms-/,He=/-([a-z])/g;function We(c,v){return v.toUpperCase()}function Le(c){return c.replace(Ie,"ms-").replace(He,We)}var ze=function(c){return c.nodeType===1||c.nodeType===9||!+c.nodeType};function Ge(){this.expando=h.expando+Ge.uid++}Ge.uid=1,Ge.prototype={cache:function(c){var v=c[this.expando];return v||(v={},ze(c)&&(c.nodeType?c[this.expando]=v:Object.defineProperty(c,this.expando,{value:v,configurable:!0}))),v},set:function(c,v,y){var F,T=this.cache(c);if(typeof v=="string")T[Le(v)]=y;else for(F in v)T[Le(F)]=v[F];return T},get:function(c,v){return v===void 0?this.cache(c):c[this.expando]&&c[this.expando][Le(v)]},access:function(c,v,y){return v===void 0||v&&typeof v=="string"&&y===void 0?this.get(c,v):(this.set(c,v,y),y!==void 0?y:v)},remove:function(c,v){var y,F=c[this.expando];if(F!==void 0){if(v!==void 0)for(Array.isArray(v)?v=v.map(Le):(v=Le(v),v=v in F?[v]:v.match(Y)||[]),y=v.length;y--;)delete F[v[y]];(v===void 0||h.isEmptyObject(F))&&(c.nodeType?c[this.expando]=void 0:delete c[this.expando])}},hasData:function(c){var v=c[this.expando];return v!==void 0&&!h.isEmptyObject(v)}};var Fe=new Ge,he=new Ge,O=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function le(c){return c==="true"?!0:c==="false"?!1:c==="null"?null:c===+c+""?+c:O.test(c)?JSON.parse(c):c}function J(c,v,y){var F;if(y===void 0&&c.nodeType===1)if(F="data-"+v.replace(Z,"-$&").toLowerCase(),y=c.getAttribute(F),typeof y=="string"){try{y=le(y)}catch{}he.set(c,v,y)}else y=void 0;return y}h.extend({hasData:function(c){return he.hasData(c)||Fe.hasData(c)},data:function(c,v,y){return he.access(c,v,y)},removeData:function(c,v){he.remove(c,v)},_data:function(c,v,y){return Fe.access(c,v,y)},_removeData:function(c,v){Fe.remove(c,v)}}),h.fn.extend({data:function(c,v){var y,F,T,S=this[0],P=S&&S.attributes;if(c===void 0){if(this.length&&(T=he.get(S),S.nodeType===1&&!Fe.get(S,"hasDataAttrs"))){for(y=P.length;y--;)P[y]&&(F=P[y].name,F.indexOf("data-")===0&&(F=Le(F.slice(5)),J(S,F,T[F])));Fe.set(S,"hasDataAttrs",!0)}return T}return typeof c=="object"?this.each(function(){he.set(this,c)}):ke(this,function(q){var V;if(S&&q===void 0)return V=he.get(S,c),V!==void 0||(V=J(S,c),V!==void 0)?V:void 0;this.each(function(){he.set(this,c,q)})},null,v,arguments.length>1,null,!0)},removeData:function(c){return this.each(function(){he.remove(this,c)})}}),h.extend({queue:function(c,v,y){var F;if(c)return v=(v||"fx")+"queue",F=Fe.get(c,v),y&&(!F||Array.isArray(y)?F=Fe.access(c,v,h.makeArray(y)):F.push(y)),F||[]},dequeue:function(c,v){v=v||"fx";var y=h.queue(c,v),F=y.length,T=y.shift(),S=h._queueHooks(c,v),P=function(){h.dequeue(c,v)};T==="inprogress"&&(T=y.shift(),F--),T&&(v==="fx"&&y.unshift("inprogress"),delete S.stop,T.call(c,P,S)),!F&&S&&S.empty.fire()},_queueHooks:function(c,v){var y=v+"queueHooks";return Fe.get(c,y)||Fe.access(c,y,{empty:h.Callbacks("once memory").add(function(){Fe.remove(c,[v+"queue",y])})})}}),h.fn.extend({queue:function(c,v){var y=2;return typeof c!="string"&&(v=c,c="fx",y--),arguments.length<y?h.queue(this[0],c):v===void 0?this:this.each(function(){var F=h.queue(this,c,v);h._queueHooks(this,c),c==="fx"&&F[0]!=="inprogress"&&h.dequeue(this,c)})},dequeue:function(c){return this.each(function(){h.dequeue(this,c)})},clearQueue:function(c){return this.queue(c||"fx",[])},promise:function(c,v){var y,F=1,T=h.Deferred(),S=this,P=this.length,q=function(){--F||T.resolveWith(S,[S])};for(typeof c!="string"&&(v=c,c=void 0),c=c||"fx";P--;)y=Fe.get(S[P],c+"queueHooks"),y&&y.empty&&(F++,y.empty.add(q));return q(),T.promise(v)}});var ne=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Te=new RegExp("^(?:([+-])=|)("+ne+")([a-z%]*)$","i"),fe=["Top","Right","Bottom","Left"],Ee=w.documentElement,Oe=function(c){return h.contains(c.ownerDocument,c)},Ye={composed:!0};Ee.getRootNode&&(Oe=function(c){return h.contains(c.ownerDocument,c)||c.getRootNode(Ye)===c.ownerDocument});var Re=function(c,v){return c=v||c,c.style.display==="none"||c.style.display===""&&Oe(c)&&h.css(c,"display")==="none"};function Ue(c,v,y,F){var T,S,P=20,q=F?function(){return F.cur()}:function(){return h.css(c,v,"")},V=q(),K=y&&y[3]||(h.cssNumber[v]?"":"px"),ue=c.nodeType&&(h.cssNumber[v]||K!=="px"&&+V)&&Te.exec(h.css(c,v));if(ue&&ue[3]!==K){for(V=V/2,K=K||ue[3],ue=+V||1;P--;)h.style(c,v,ue+K),(1-S)*(1-(S=q()/V||.5))<=0&&(P=0),ue=ue/S;ue=ue*2,h.style(c,v,ue+K),y=y||[]}return y&&(ue=+ue||+V||0,T=y[1]?ue+(y[1]+1)*y[2]:+y[2],F&&(F.unit=K,F.start=ue,F.end=T)),T}var Ke={};function $e(c){var v,y=c.ownerDocument,F=c.nodeName,T=Ke[F];return T||(v=y.body.appendChild(y.createElement(F)),T=h.css(v,"display"),v.parentNode.removeChild(v),T==="none"&&(T="block"),Ke[F]=T,T)}function lt(c,v){for(var y,F,T=[],S=0,P=c.length;S<P;S++)F=c[S],F.style&&(y=F.style.display,v?(y==="none"&&(T[S]=Fe.get(F,"display")||null,T[S]||(F.style.display="")),F.style.display===""&&Re(F)&&(T[S]=$e(F))):y!=="none"&&(T[S]="none",Fe.set(F,"display",y)));for(S=0;S<P;S++)T[S]!=null&&(c[S].style.display=T[S]);return c}h.fn.extend({show:function(){return lt(this,!0)},hide:function(){return lt(this)},toggle:function(c){return typeof c=="boolean"?c?this.show():this.hide():this.each(function(){Re(this)?h(this).show():h(this).hide()})}});var mt=/^(?:checkbox|radio)$/i,rr=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,nr=/^$|^module$|\/(?:java|ecma)script/i;(function(){var c=w.createDocumentFragment(),v=c.appendChild(w.createElement("div")),y=w.createElement("input");y.setAttribute("type","radio"),y.setAttribute("checked","checked"),y.setAttribute("name","t"),v.appendChild(y),p.checkClone=v.cloneNode(!0).cloneNode(!0).lastChild.checked,v.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!v.cloneNode(!0).lastChild.defaultValue,v.innerHTML="<option></option>",p.option=!!v.lastChild})();var vt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};vt.tbody=vt.tfoot=vt.colgroup=vt.caption=vt.thead,vt.th=vt.td,p.option||(vt.optgroup=vt.option=[1,"<select multiple='multiple'>","</select>"]);function ft(c,v){var y;return typeof c.getElementsByTagName<"u"?y=c.getElementsByTagName(v||"*"):typeof c.querySelectorAll<"u"?y=c.querySelectorAll(v||"*"):y=[],v===void 0||v&&D(c,v)?h.merge([c],y):y}function kt(c,v){for(var y=0,F=c.length;y<F;y++)Fe.set(c[y],"globalEval",!v||Fe.get(v[y],"globalEval"))}var Kt=/<|&#?\w+;/;function $t(c,v,y,F,T){for(var S,P,q,V,K,ue,ve=v.createDocumentFragment(),re=[],xe=0,Ze=c.length;xe<Ze;xe++)if(S=c[xe],S||S===0)if(k(S)==="object")h.merge(re,S.nodeType?[S]:S);else if(!Kt.test(S))re.push(v.createTextNode(S));else{for(P=P||ve.appendChild(v.createElement("div")),q=(rr.exec(S)||["",""])[1].toLowerCase(),V=vt[q]||vt._default,P.innerHTML=V[1]+h.htmlPrefilter(S)+V[2],ue=V[0];ue--;)P=P.lastChild;h.merge(re,P.childNodes),P=ve.firstChild,P.textContent=""}for(ve.textContent="",xe=0;S=re[xe++];){if(F&&h.inArray(S,F)>-1){T&&T.push(S);continue}if(K=Oe(S),P=ft(ve.appendChild(S),"script"),K&&kt(P),y)for(ue=0;S=P[ue++];)nr.test(S.type||"")&&y.push(S)}return ve}var Er=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Xt(){return!1}function Cr(c,v,y,F,T,S){var P,q;if(typeof v=="object"){typeof y!="string"&&(F=F||y,y=void 0);for(q in v)Cr(c,q,y,F,v[q],S);return c}if(F==null&&T==null?(T=y,F=y=void 0):T==null&&(typeof y=="string"?(T=F,F=void 0):(T=F,F=y,y=void 0)),T===!1)T=Xt;else if(!T)return c;return S===1&&(P=T,T=function(V){return h().off(V),P.apply(this,arguments)},T.guid=P.guid||(P.guid=h.guid++)),c.each(function(){h.event.add(this,v,T,F,y)})}h.event={global:{},add:function(c,v,y,F,T){var S,P,q,V,K,ue,ve,re,xe,Ze,it,je=Fe.get(c);if(ze(c))for(y.handler&&(S=y,y=S.handler,T=S.selector),T&&h.find.matchesSelector(Ee,T),y.guid||(y.guid=h.guid++),(V=je.events)||(V=je.events=Object.create(null)),(P=je.handle)||(P=je.handle=function(Yt){return typeof h<"u"&&h.event.triggered!==Yt.type?h.event.dispatch.apply(c,arguments):void 0}),v=(v||"").match(Y)||[""],K=v.length;K--;)q=Er.exec(v[K])||[],xe=it=q[1],Ze=(q[2]||"").split(".").sort(),xe&&(ve=h.event.special[xe]||{},xe=(T?ve.delegateType:ve.bindType)||xe,ve=h.event.special[xe]||{},ue=h.extend({type:xe,origType:it,data:F,handler:y,guid:y.guid,selector:T,needsContext:T&&h.expr.match.needsContext.test(T),namespace:Ze.join(".")},S),(re=V[xe])||(re=V[xe]=[],re.delegateCount=0,(!ve.setup||ve.setup.call(c,F,Ze,P)===!1)&&c.addEventListener&&c.addEventListener(xe,P)),ve.add&&(ve.add.call(c,ue),ue.handler.guid||(ue.handler.guid=y.guid)),T?re.splice(re.delegateCount++,0,ue):re.push(ue),h.event.global[xe]=!0)},remove:function(c,v,y,F,T){var S,P,q,V,K,ue,ve,re,xe,Ze,it,je=Fe.hasData(c)&&Fe.get(c);if(!(!je||!(V=je.events))){for(v=(v||"").match(Y)||[""],K=v.length;K--;){if(q=Er.exec(v[K])||[],xe=it=q[1],Ze=(q[2]||"").split(".").sort(),!xe){for(xe in V)h.event.remove(c,xe+v[K],y,F,!0);continue}for(ve=h.event.special[xe]||{},xe=(F?ve.delegateType:ve.bindType)||xe,re=V[xe]||[],q=q[2]&&new RegExp("(^|\\.)"+Ze.join("\\.(?:.*\\.|)")+"(\\.|$)"),P=S=re.length;S--;)ue=re[S],(T||it===ue.origType)&&(!y||y.guid===ue.guid)&&(!q||q.test(ue.namespace))&&(!F||F===ue.selector||F==="**"&&ue.selector)&&(re.splice(S,1),ue.selector&&re.delegateCount--,ve.remove&&ve.remove.call(c,ue));P&&!re.length&&((!ve.teardown||ve.teardown.call(c,Ze,je.handle)===!1)&&h.removeEvent(c,xe,je.handle),delete V[xe])}h.isEmptyObject(V)&&Fe.remove(c,"handle events")}},dispatch:function(c){var v,y,F,T,S,P,q=new Array(arguments.length),V=h.event.fix(c),K=(Fe.get(this,"events")||Object.create(null))[V.type]||[],ue=h.event.special[V.type]||{};for(q[0]=V,v=1;v<arguments.length;v++)q[v]=arguments[v];if(V.delegateTarget=this,!(ue.preDispatch&&ue.preDispatch.call(this,V)===!1)){for(P=h.event.handlers.call(this,V,K),v=0;(T=P[v++])&&!V.isPropagationStopped();)for(V.currentTarget=T.elem,y=0;(S=T.handlers[y++])&&!V.isImmediatePropagationStopped();)(!V.rnamespace||S.namespace===!1||V.rnamespace.test(S.namespace))&&(V.handleObj=S,V.data=S.data,F=((h.event.special[S.origType]||{}).handle||S.handler).apply(T.elem,q),F!==void 0&&(V.result=F)===!1&&(V.preventDefault(),V.stopPropagation()));return ue.postDispatch&&ue.postDispatch.call(this,V),V.result}},handlers:function(c,v){var y,F,T,S,P,q=[],V=v.delegateCount,K=c.target;if(V&&K.nodeType&&!(c.type==="click"&&c.button>=1)){for(;K!==this;K=K.parentNode||this)if(K.nodeType===1&&!(c.type==="click"&&K.disabled===!0)){for(S=[],P={},y=0;y<V;y++)F=v[y],T=F.selector+" ",P[T]===void 0&&(P[T]=F.needsContext?h(T,this).index(K)>-1:h.find(T,this,null,[K]).length),P[T]&&S.push(F);S.length&&q.push({elem:K,handlers:S})}}return K=this,V<v.length&&q.push({elem:K,handlers:v.slice(V)}),q},addProp:function(c,v){Object.defineProperty(h.Event.prototype,c,{enumerable:!0,configurable:!0,get:b(v)?function(){if(this.originalEvent)return v(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[c]},set:function(y){Object.defineProperty(this,c,{enumerable:!0,configurable:!0,writable:!0,value:y})}})},fix:function(c){return c[h.expando]?c:new h.Event(c)},special:{load:{noBubble:!0},click:{setup:function(c){var v=this||c;return mt.test(v.type)&&v.click&&D(v,"input")&&gr(v,"click",!0),!1},trigger:function(c){var v=this||c;return mt.test(v.type)&&v.click&&D(v,"input")&&gr(v,"click"),!0},_default:function(c){var v=c.target;return mt.test(v.type)&&v.click&&D(v,"input")&&Fe.get(v,"click")||D(v,"a")}},beforeunload:{postDispatch:function(c){c.result!==void 0&&c.originalEvent&&(c.originalEvent.returnValue=c.result)}}}};function gr(c,v,y){if(!y){Fe.get(c,v)===void 0&&h.event.add(c,v,Ot);return}Fe.set(c,v,!1),h.event.add(c,v,{namespace:!1,handler:function(F){var T,S=Fe.get(this,v);if(F.isTrigger&1&&this[v]){if(S)(h.event.special[v]||{}).delegateType&&F.stopPropagation();else if(S=i.call(arguments),Fe.set(this,v,S),this[v](),T=Fe.get(this,v),Fe.set(this,v,!1),S!==T)return F.stopImmediatePropagation(),F.preventDefault(),T}else S&&(Fe.set(this,v,h.event.trigger(S[0],S.slice(1),this)),F.stopPropagation(),F.isImmediatePropagationStopped=Ot)}})}h.removeEvent=function(c,v,y){c.removeEventListener&&c.removeEventListener(v,y)},h.Event=function(c,v){if(!(this instanceof h.Event))return new h.Event(c,v);c&&c.type?(this.originalEvent=c,this.type=c.type,this.isDefaultPrevented=c.defaultPrevented||c.defaultPrevented===void 0&&c.returnValue===!1?Ot:Xt,this.target=c.target&&c.target.nodeType===3?c.target.parentNode:c.target,this.currentTarget=c.currentTarget,this.relatedTarget=c.relatedTarget):this.type=c,v&&h.extend(this,v),this.timeStamp=c&&c.timeStamp||Date.now(),this[h.expando]=!0},h.Event.prototype={constructor:h.Event,isDefaultPrevented:Xt,isPropagationStopped:Xt,isImmediatePropagationStopped:Xt,isSimulated:!1,preventDefault:function(){var c=this.originalEvent;this.isDefaultPrevented=Ot,c&&!this.isSimulated&&c.preventDefault()},stopPropagation:function(){var c=this.originalEvent;this.isPropagationStopped=Ot,c&&!this.isSimulated&&c.stopPropagation()},stopImmediatePropagation:function(){var c=this.originalEvent;this.isImmediatePropagationStopped=Ot,c&&!this.isSimulated&&c.stopImmediatePropagation(),this.stopPropagation()}},h.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},h.event.addProp),h.each({focus:"focusin",blur:"focusout"},function(c,v){function y(F){if(w.documentMode){var T=Fe.get(this,"handle"),S=h.event.fix(F);S.type=F.type==="focusin"?"focus":"blur",S.isSimulated=!0,T(F),S.target===S.currentTarget&&T(S)}else h.event.simulate(v,F.target,h.event.fix(F))}h.event.special[c]={setup:function(){var F;if(gr(this,c,!0),w.documentMode)F=Fe.get(this,v),F||this.addEventListener(v,y),Fe.set(this,v,(F||0)+1);else return!1},trigger:function(){return gr(this,c),!0},teardown:function(){var F;if(w.documentMode)F=Fe.get(this,v)-1,F?Fe.set(this,v,F):(this.removeEventListener(v,y),Fe.remove(this,v));else return!1},_default:function(F){return Fe.get(F.target,c)},delegateType:v},h.event.special[v]={setup:function(){var F=this.ownerDocument||this.document||this,T=w.documentMode?this:F,S=Fe.get(T,v);S||(w.documentMode?this.addEventListener(v,y):F.addEventListener(c,y,!0)),Fe.set(T,v,(S||0)+1)},teardown:function(){var F=this.ownerDocument||this.document||this,T=w.documentMode?this:F,S=Fe.get(T,v)-1;S?Fe.set(T,v,S):(w.documentMode?this.removeEventListener(v,y):F.removeEventListener(c,y,!0),Fe.remove(T,v))}}}),h.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(c,v){h.event.special[c]={delegateType:v,bindType:v,handle:function(y){var F,T=this,S=y.relatedTarget,P=y.handleObj;return(!S||S!==T&&!h.contains(T,S))&&(y.type=P.origType,F=P.handler.apply(this,arguments),y.type=v),F}}}),h.fn.extend({on:function(c,v,y,F){return Cr(this,c,v,y,F)},one:function(c,v,y,F){return Cr(this,c,v,y,F,1)},off:function(c,v,y){var F,T;if(c&&c.preventDefault&&c.handleObj)return F=c.handleObj,h(c.delegateTarget).off(F.namespace?F.origType+"."+F.namespace:F.origType,F.selector,F.handler),this;if(typeof c=="object"){for(T in c)this.off(T,v,c[T]);return this}return(v===!1||typeof v=="function")&&(y=v,v=void 0),y===!1&&(y=Xt),this.each(function(){h.event.remove(this,c,y,v)})}});var qt=/<script|<style|<link/i,Bt=/checked\s*(?:[^=]|=\s*.checked.)/i,ar=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function jn(c,v){return D(c,"table")&&D(v.nodeType!==11?v:v.firstChild,"tr")&&h(c).children("tbody")[0]||c}function Pr(c){return c.type=(c.getAttribute("type")!==null)+"/"+c.type,c}function js(c){return(c.type||"").slice(0,5)==="true/"?c.type=c.type.slice(5):c.removeAttribute("type"),c}function eo(c,v){var y,F,T,S,P,q,V;if(v.nodeType===1){if(Fe.hasData(c)&&(S=Fe.get(c),V=S.events,V)){Fe.remove(v,"handle events");for(T in V)for(y=0,F=V[T].length;y<F;y++)h.event.add(v,T,V[T][y])}he.hasData(c)&&(P=he.access(c),q=h.extend({},P),he.set(v,q))}}function qu(c,v){var y=v.nodeName.toLowerCase();y==="input"&&mt.test(c.type)?v.checked=c.checked:(y==="input"||y==="textarea")&&(v.defaultValue=c.defaultValue)}function kn(c,v,y,F){v=s(v);var T,S,P,q,V,K,ue=0,ve=c.length,re=ve-1,xe=v[0],Ze=b(xe);if(Ze||ve>1&&typeof xe=="string"&&!p.checkClone&&Bt.test(xe))return c.each(function(it){var je=c.eq(it);Ze&&(v[0]=xe.call(this,it,je.html())),kn(je,v,y,F)});if(ve&&(T=$t(v,c[0].ownerDocument,!1,c,F),S=T.firstChild,T.childNodes.length===1&&(T=S),S||F)){for(P=h.map(ft(T,"script"),Pr),q=P.length;ue<ve;ue++)V=T,ue!==re&&(V=h.clone(V,!0,!0),q&&h.merge(P,ft(V,"script"))),y.call(c[ue],V,ue);if(q)for(K=P[P.length-1].ownerDocument,h.map(P,js),ue=0;ue<q;ue++)V=P[ue],nr.test(V.type||"")&&!Fe.access(V,"globalEval")&&h.contains(K,V)&&(V.src&&(V.type||"").toLowerCase()!=="module"?h._evalUrl&&!V.noModule&&h._evalUrl(V.src,{nonce:V.nonce||V.getAttribute("nonce")},K):C(V.textContent.replace(ar,""),V,K))}return c}function to(c,v,y){for(var F,T=v?h.filter(v,c):c,S=0;(F=T[S])!=null;S++)!y&&F.nodeType===1&&h.cleanData(ft(F)),F.parentNode&&(y&&Oe(F)&&kt(ft(F,"script")),F.parentNode.removeChild(F));return c}h.extend({htmlPrefilter:function(c){return c},clone:function(c,v,y){var F,T,S,P,q=c.cloneNode(!0),V=Oe(c);if(!p.noCloneChecked&&(c.nodeType===1||c.nodeType===11)&&!h.isXMLDoc(c))for(P=ft(q),S=ft(c),F=0,T=S.length;F<T;F++)qu(S[F],P[F]);if(v)if(y)for(S=S||ft(c),P=P||ft(q),F=0,T=S.length;F<T;F++)eo(S[F],P[F]);else eo(c,q);return P=ft(q,"script"),P.length>0&&kt(P,!V&&ft(c,"script")),q},cleanData:function(c){for(var v,y,F,T=h.event.special,S=0;(y=c[S])!==void 0;S++)if(ze(y)){if(v=y[Fe.expando]){if(v.events)for(F in v.events)T[F]?h.event.remove(y,F):h.removeEvent(y,F,v.handle);y[Fe.expando]=void 0}y[he.expando]&&(y[he.expando]=void 0)}}}),h.fn.extend({detach:function(c){return to(this,c,!0)},remove:function(c){return to(this,c)},text:function(c){return ke(this,function(v){return v===void 0?h.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=v)})},null,c,arguments.length)},append:function(){return kn(this,arguments,function(c){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var v=jn(this,c);v.appendChild(c)}})},prepend:function(){return kn(this,arguments,function(c){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var v=jn(this,c);v.insertBefore(c,v.firstChild)}})},before:function(){return kn(this,arguments,function(c){this.parentNode&&this.parentNode.insertBefore(c,this)})},after:function(){return kn(this,arguments,function(c){this.parentNode&&this.parentNode.insertBefore(c,this.nextSibling)})},empty:function(){for(var c,v=0;(c=this[v])!=null;v++)c.nodeType===1&&(h.cleanData(ft(c,!1)),c.textContent="");return this},clone:function(c,v){return c=c??!1,v=v??c,this.map(function(){return h.clone(this,c,v)})},html:function(c){return ke(this,function(v){var y=this[0]||{},F=0,T=this.length;if(v===void 0&&y.nodeType===1)return y.innerHTML;if(typeof v=="string"&&!qt.test(v)&&!vt[(rr.exec(v)||["",""])[1].toLowerCase()]){v=h.htmlPrefilter(v);try{for(;F<T;F++)y=this[F]||{},y.nodeType===1&&(h.cleanData(ft(y,!1)),y.innerHTML=v);y=0}catch{}}y&&this.empty().append(v)},null,c,arguments.length)},replaceWith:function(){var c=[];return kn(this,arguments,function(v){var y=this.parentNode;h.inArray(this,c)<0&&(h.cleanData(ft(this)),y&&y.replaceChild(v,this))},c)}}),h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(c,v){h.fn[c]=function(y){for(var F,T=[],S=h(y),P=S.length-1,q=0;q<=P;q++)F=q===P?this:this.clone(!0),h(S[q])[v](F),o.apply(T,F.get());return this.pushStack(T)}});var Ri=new RegExp("^("+ne+")(?!px)[a-z%]+$","i"),Li=/^--/,Oa=function(c){var v=c.ownerDocument.defaultView;return(!v||!v.opener)&&(v=e),v.getComputedStyle(c)},Pn=function(c,v,y){var F,T,S={};for(T in v)S[T]=c.style[T],c.style[T]=v[T];F=y.call(c);for(T in v)c.style[T]=S[T];return F},Oi=new RegExp(fe.join("|"),"i");(function(){function c(){if(K){V.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",K.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",Ee.appendChild(V).appendChild(K);var ue=e.getComputedStyle(K);y=ue.top!=="1%",q=v(ue.marginLeft)===12,K.style.right="60%",S=v(ue.right)===36,F=v(ue.width)===36,K.style.position="absolute",T=v(K.offsetWidth/3)===12,Ee.removeChild(V),K=null}}function v(ue){return Math.round(parseFloat(ue))}var y,F,T,S,P,q,V=w.createElement("div"),K=w.createElement("div");K.style&&(K.style.backgroundClip="content-box",K.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle=K.style.backgroundClip==="content-box",h.extend(p,{boxSizingReliable:function(){return c(),F},pixelBoxStyles:function(){return c(),S},pixelPosition:function(){return c(),y},reliableMarginLeft:function(){return c(),q},scrollboxSize:function(){return c(),T},reliableTrDimensions:function(){var ue,ve,re,xe;return P==null&&(ue=w.createElement("table"),ve=w.createElement("tr"),re=w.createElement("div"),ue.style.cssText="position:absolute;left:-11111px;border-collapse:separate",ve.style.cssText="box-sizing:content-box;border:1px solid",ve.style.height="1px",re.style.height="9px",re.style.display="block",Ee.appendChild(ue).appendChild(ve).appendChild(re),xe=e.getComputedStyle(ve),P=parseInt(xe.height,10)+parseInt(xe.borderTopWidth,10)+parseInt(xe.borderBottomWidth,10)===ve.offsetHeight,Ee.removeChild(ue)),P}}))})();function Ur(c,v,y){var F,T,S,P,q=Li.test(v),V=c.style;return y=y||Oa(c),y&&(P=y.getPropertyValue(v)||y[v],q&&P&&(P=P.replace(_,"$1")||void 0),P===""&&!Oe(c)&&(P=h.style(c,v)),!p.pixelBoxStyles()&&Ri.test(P)&&Oi.test(v)&&(F=V.width,T=V.minWidth,S=V.maxWidth,V.minWidth=V.maxWidth=V.width=P,P=y.width,V.width=F,V.minWidth=T,V.maxWidth=S)),P!==void 0?P+"":P}function Ni(c,v){return{get:function(){if(c()){delete this.get;return}return(this.get=v).apply(this,arguments)}}}var _i=["Webkit","Moz","ms"],ro=w.createElement("div").style,pr={};function zi(c){for(var v=c[0].toUpperCase()+c.slice(1),y=_i.length;y--;)if(c=_i[y]+v,c in ro)return c}function Na(c){var v=h.cssProps[c]||pr[c];return v||(c in ro?c:pr[c]=zi(c)||c)}var ea=/^(none|table(?!-c[ea]).+)/,Tr={position:"absolute",visibility:"hidden",display:"block"},no={letterSpacing:"0",fontWeight:"400"};function qv(c,v,y){var F=Te.exec(v);return F?Math.max(0,F[2]-(y||0))+(F[3]||"px"):v}function Hu(c,v,y,F,T,S){var P=v==="width"?1:0,q=0,V=0,K=0;if(y===(F?"border":"content"))return 0;for(;P<4;P+=2)y==="margin"&&(K+=h.css(c,y+fe[P],!0,T)),F?(y==="content"&&(V-=h.css(c,"padding"+fe[P],!0,T)),y!=="margin"&&(V-=h.css(c,"border"+fe[P]+"Width",!0,T))):(V+=h.css(c,"padding"+fe[P],!0,T),y!=="padding"?V+=h.css(c,"border"+fe[P]+"Width",!0,T):q+=h.css(c,"border"+fe[P]+"Width",!0,T));return!F&&S>=0&&(V+=Math.max(0,Math.ceil(c["offset"+v[0].toUpperCase()+v.slice(1)]-S-V-q-.5))||0),V+K}function Hv(c,v,y){var F=Oa(c),T=!p.boxSizingReliable()||y,S=T&&h.css(c,"boxSizing",!1,F)==="border-box",P=S,q=Ur(c,v,F),V="offset"+v[0].toUpperCase()+v.slice(1);if(Ri.test(q)){if(!y)return q;q="auto"}return(!p.boxSizingReliable()&&S||!p.reliableTrDimensions()&&D(c,"tr")||q==="auto"||!parseFloat(q)&&h.css(c,"display",!1,F)==="inline")&&c.getClientRects().length&&(S=h.css(c,"boxSizing",!1,F)==="border-box",P=V in c,P&&(q=c[V])),q=parseFloat(q)||0,q+Hu(c,v,y||(S?"border":"content"),P,F,q)+"px"}h.extend({cssHooks:{opacity:{get:function(c,v){if(v){var y=Ur(c,"opacity");return y===""?"1":y}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(c,v,y,F){if(!(!c||c.nodeType===3||c.nodeType===8||!c.style)){var T,S,P,q=Le(v),V=Li.test(v),K=c.style;if(V||(v=Na(q)),P=h.cssHooks[v]||h.cssHooks[q],y!==void 0){if(S=typeof y,S==="string"&&(T=Te.exec(y))&&T[1]&&(y=Ue(c,v,T),S="number"),y==null||y!==y)return;S==="number"&&!V&&(y+=T&&T[3]||(h.cssNumber[q]?"":"px")),!p.clearCloneStyle&&y===""&&v.indexOf("background")===0&&(K[v]="inherit"),(!P||!("set"in P)||(y=P.set(c,y,F))!==void 0)&&(V?K.setProperty(v,y):K[v]=y)}else return P&&"get"in P&&(T=P.get(c,!1,F))!==void 0?T:K[v]}},css:function(c,v,y,F){var T,S,P,q=Le(v),V=Li.test(v);return V||(v=Na(q)),P=h.cssHooks[v]||h.cssHooks[q],P&&"get"in P&&(T=P.get(c,!0,y)),T===void 0&&(T=Ur(c,v,F)),T==="normal"&&v in no&&(T=no[v]),y===""||y?(S=parseFloat(T),y===!0||isFinite(S)?S||0:T):T}}),h.each(["height","width"],function(c,v){h.cssHooks[v]={get:function(y,F,T){if(F)return ea.test(h.css(y,"display"))&&(!y.getClientRects().length||!y.getBoundingClientRect().width)?Pn(y,Tr,function(){return Hv(y,v,T)}):Hv(y,v,T)},set:function(y,F,T){var S,P=Oa(y),q=!p.scrollboxSize()&&P.position==="absolute",V=q||T,K=V&&h.css(y,"boxSizing",!1,P)==="border-box",ue=T?Hu(y,v,T,K,P):0;return K&&q&&(ue-=Math.ceil(y["offset"+v[0].toUpperCase()+v.slice(1)]-parseFloat(P[v])-Hu(y,v,"border",!1,P)-.5)),ue&&(S=Te.exec(F))&&(S[3]||"px")!=="px"&&(y.style[v]=F,F=h.css(y,v)),qv(y,F,ue)}}}),h.cssHooks.marginLeft=Ni(p.reliableMarginLeft,function(c,v){if(v)return(parseFloat(Ur(c,"marginLeft"))||c.getBoundingClientRect().left-Pn(c,{marginLeft:0},function(){return c.getBoundingClientRect().left}))+"px"}),h.each({margin:"",padding:"",border:"Width"},function(c,v){h.cssHooks[c+v]={expand:function(y){for(var F=0,T={},S=typeof y=="string"?y.split(" "):[y];F<4;F++)T[c+fe[F]+v]=S[F]||S[F-2]||S[0];return T}},c!=="margin"&&(h.cssHooks[c+v].set=qv)}),h.fn.extend({css:function(c,v){return ke(this,function(y,F,T){var S,P,q={},V=0;if(Array.isArray(F)){for(S=Oa(y),P=F.length;V<P;V++)q[F[V]]=h.css(y,F[V],!1,S);return q}return T!==void 0?h.style(y,F,T):h.css(y,F)},c,v,arguments.length>1)}});function mr(c,v,y,F,T){return new mr.prototype.init(c,v,y,F,T)}h.Tween=mr,mr.prototype={constructor:mr,init:function(c,v,y,F,T,S){this.elem=c,this.prop=y,this.easing=T||h.easing._default,this.options=v,this.start=this.now=this.cur(),this.end=F,this.unit=S||(h.cssNumber[y]?"":"px")},cur:function(){var c=mr.propHooks[this.prop];return c&&c.get?c.get(this):mr.propHooks._default.get(this)},run:function(c){var v,y=mr.propHooks[this.prop];return this.options.duration?this.pos=v=h.easing[this.easing](c,this.options.duration*c,0,1,this.options.duration):this.pos=v=c,this.now=(this.end-this.start)*v+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),y&&y.set?y.set(this):mr.propHooks._default.set(this),this}},mr.prototype.init.prototype=mr.prototype,mr.propHooks={_default:{get:function(c){var v;return c.elem.nodeType!==1||c.elem[c.prop]!=null&&c.elem.style[c.prop]==null?c.elem[c.prop]:(v=h.css(c.elem,c.prop,""),!v||v==="auto"?0:v)},set:function(c){h.fx.step[c.prop]?h.fx.step[c.prop](c):c.elem.nodeType===1&&(h.cssHooks[c.prop]||c.elem.style[Na(c.prop)]!=null)?h.style(c.elem,c.prop,c.now+c.unit):c.elem[c.prop]=c.now}}},mr.propHooks.scrollTop=mr.propHooks.scrollLeft={set:function(c){c.elem.nodeType&&c.elem.parentNode&&(c.elem[c.prop]=c.now)}},h.easing={linear:function(c){return c},swing:function(c){return .5-Math.cos(c*Math.PI)/2},_default:"swing"},h.fx=mr.prototype.init,h.fx.step={};var _a,ao,Fx=/^(?:toggle|show|hide)$/,Ex=/queueHooks$/;function Wu(){ao&&(w.hidden===!1&&e.requestAnimationFrame?e.requestAnimationFrame(Wu):e.setTimeout(Wu,h.fx.interval),h.fx.tick())}function Wv(){return e.setTimeout(function(){_a=void 0}),_a=Date.now()}function io(c,v){var y,F=0,T={height:c};for(v=v?1:0;F<4;F+=2-v)y=fe[F],T["margin"+y]=T["padding"+y]=c;return v&&(T.opacity=T.width=c),T}function Uv(c,v,y){for(var F,T=(Lr.tweeners[v]||[]).concat(Lr.tweeners["*"]),S=0,P=T.length;S<P;S++)if(F=T[S].call(y,v,c))return F}function Cx(c,v,y){var F,T,S,P,q,V,K,ue,ve="width"in v||"height"in v,re=this,xe={},Ze=c.style,it=c.nodeType&&Re(c),je=Fe.get(c,"fxshow");y.queue||(P=h._queueHooks(c,"fx"),P.unqueued==null&&(P.unqueued=0,q=P.empty.fire,P.empty.fire=function(){P.unqueued||q()}),P.unqueued++,re.always(function(){re.always(function(){P.unqueued--,h.queue(c,"fx").length||P.empty.fire()})}));for(F in v)if(T=v[F],Fx.test(T)){if(delete v[F],S=S||T==="toggle",T===(it?"hide":"show"))if(T==="show"&&je&&je[F]!==void 0)it=!0;else continue;xe[F]=je&&je[F]||h.style(c,F)}if(V=!h.isEmptyObject(v),!(!V&&h.isEmptyObject(xe))){ve&&c.nodeType===1&&(y.overflow=[Ze.overflow,Ze.overflowX,Ze.overflowY],K=je&&je.display,K==null&&(K=Fe.get(c,"display")),ue=h.css(c,"display"),ue==="none"&&(K?ue=K:(lt([c],!0),K=c.style.display||K,ue=h.css(c,"display"),lt([c]))),(ue==="inline"||ue==="inline-block"&&K!=null)&&h.css(c,"float")==="none"&&(V||(re.done(function(){Ze.display=K}),K==null&&(ue=Ze.display,K=ue==="none"?"":ue)),Ze.display="inline-block")),y.overflow&&(Ze.overflow="hidden",re.always(function(){Ze.overflow=y.overflow[0],Ze.overflowX=y.overflow[1],Ze.overflowY=y.overflow[2]})),V=!1;for(F in xe)V||(je?"hidden"in je&&(it=je.hidden):je=Fe.access(c,"fxshow",{display:K}),S&&(je.hidden=!it),it&&lt([c],!0),re.done(function(){it||lt([c]),Fe.remove(c,"fxshow");for(F in xe)h.style(c,F,xe[F])})),V=Uv(it?je[F]:0,F,re),F in je||(je[F]=V.start,it&&(V.end=V.start,V.start=0))}}function Tx(c,v){var y,F,T,S,P;for(y in c)if(F=Le(y),T=v[F],S=c[y],Array.isArray(S)&&(T=S[1],S=c[y]=S[0]),y!==F&&(c[F]=S,delete c[y]),P=h.cssHooks[F],P&&"expand"in P){S=P.expand(S),delete c[F];for(y in S)y in c||(c[y]=S[y],v[y]=T)}else v[F]=T}function Lr(c,v,y){var F,T,S=0,P=Lr.prefilters.length,q=h.Deferred().always(function(){delete V.elem}),V=function(){if(T)return!1;for(var ve=_a||Wv(),re=Math.max(0,K.startTime+K.duration-ve),xe=re/K.duration||0,Ze=1-xe,it=0,je=K.tweens.length;it<je;it++)K.tweens[it].run(Ze);return q.notifyWith(c,[K,Ze,re]),Ze<1&&je?re:(je||q.notifyWith(c,[K,1,0]),q.resolveWith(c,[K]),!1)},K=q.promise({elem:c,props:h.extend({},v),opts:h.extend(!0,{specialEasing:{},easing:h.easing._default},y),originalProperties:v,originalOptions:y,startTime:_a||Wv(),duration:y.duration,tweens:[],createTween:function(ve,re){var xe=h.Tween(c,K.opts,ve,re,K.opts.specialEasing[ve]||K.opts.easing);return K.tweens.push(xe),xe},stop:function(ve){var re=0,xe=ve?K.tweens.length:0;if(T)return this;for(T=!0;re<xe;re++)K.tweens[re].run(1);return ve?(q.notifyWith(c,[K,1,0]),q.resolveWith(c,[K,ve])):q.rejectWith(c,[K,ve]),this}}),ue=K.props;for(Tx(ue,K.opts.specialEasing);S<P;S++)if(F=Lr.prefilters[S].call(K,c,ue,K.opts),F)return b(F.stop)&&(h._queueHooks(K.elem,K.opts.queue).stop=F.stop.bind(F)),F;return h.map(ue,Uv,K),b(K.opts.start)&&K.opts.start.call(c,K),K.progress(K.opts.progress).done(K.opts.done,K.opts.complete).fail(K.opts.fail).always(K.opts.always),h.fx.timer(h.extend(V,{elem:c,anim:K,queue:K.opts.queue})),K}h.Animation=h.extend(Lr,{tweeners:{"*":[function(c,v){var y=this.createTween(c,v);return Ue(y.elem,c,Te.exec(v),y),y}]},tweener:function(c,v){b(c)?(v=c,c=["*"]):c=c.match(Y);for(var y,F=0,T=c.length;F<T;F++)y=c[F],Lr.tweeners[y]=Lr.tweeners[y]||[],Lr.tweeners[y].unshift(v)},prefilters:[Cx],prefilter:function(c,v){v?Lr.prefilters.unshift(c):Lr.prefilters.push(c)}}),h.speed=function(c,v,y){var F=c&&typeof c=="object"?h.extend({},c):{complete:y||!y&&v||b(c)&&c,duration:c,easing:y&&v||v&&!b(v)&&v};return h.fx.off?F.duration=0:typeof F.duration!="number"&&(F.duration in h.fx.speeds?F.duration=h.fx.speeds[F.duration]:F.duration=h.fx.speeds._default),(F.queue==null||F.queue===!0)&&(F.queue="fx"),F.old=F.complete,F.complete=function(){b(F.old)&&F.old.call(this),F.queue&&h.dequeue(this,F.queue)},F},h.fn.extend({fadeTo:function(c,v,y,F){return this.filter(Re).css("opacity",0).show().end().animate({opacity:v},c,y,F)},animate:function(c,v,y,F){var T=h.isEmptyObject(c),S=h.speed(v,y,F),P=function(){var q=Lr(this,h.extend({},c),S);(T||Fe.get(this,"finish"))&&q.stop(!0)};return P.finish=P,T||S.queue===!1?this.each(P):this.queue(S.queue,P)},stop:function(c,v,y){var F=function(T){var S=T.stop;delete T.stop,S(y)};return typeof c!="string"&&(y=v,v=c,c=void 0),v&&this.queue(c||"fx",[]),this.each(function(){var T=!0,S=c!=null&&c+"queueHooks",P=h.timers,q=Fe.get(this);if(S)q[S]&&q[S].stop&&F(q[S]);else for(S in q)q[S]&&q[S].stop&&Ex.test(S)&&F(q[S]);for(S=P.length;S--;)P[S].elem===this&&(c==null||P[S].queue===c)&&(P[S].anim.stop(y),T=!1,P.splice(S,1));(T||!y)&&h.dequeue(this,c)})},finish:function(c){return c!==!1&&(c=c||"fx"),this.each(function(){var v,y=Fe.get(this),F=y[c+"queue"],T=y[c+"queueHooks"],S=h.timers,P=F?F.length:0;for(y.finish=!0,h.queue(this,c,[]),T&&T.stop&&T.stop.call(this,!0),v=S.length;v--;)S[v].elem===this&&S[v].queue===c&&(S[v].anim.stop(!0),S.splice(v,1));for(v=0;v<P;v++)F[v]&&F[v].finish&&F[v].finish.call(this);delete y.finish})}}),h.each(["toggle","show","hide"],function(c,v){var y=h.fn[v];h.fn[v]=function(F,T,S){return F==null||typeof F=="boolean"?y.apply(this,arguments):this.animate(io(v,!0),F,T,S)}}),h.each({slideDown:io("show"),slideUp:io("hide"),slideToggle:io("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(c,v){h.fn[c]=function(y,F,T){return this.animate(v,y,F,T)}}),h.timers=[],h.fx.tick=function(){var c,v=0,y=h.timers;for(_a=Date.now();v<y.length;v++)c=y[v],!c()&&y[v]===c&&y.splice(v--,1);y.length||h.fx.stop(),_a=void 0},h.fx.timer=function(c){h.timers.push(c),h.fx.start()},h.fx.interval=13,h.fx.start=function(){ao||(ao=!0,Wu())},h.fx.stop=function(){ao=null},h.fx.speeds={slow:600,fast:200,_default:400},h.fn.delay=function(c,v){return c=h.fx&&h.fx.speeds[c]||c,v=v||"fx",this.queue(v,function(y,F){var T=e.setTimeout(y,c);F.stop=function(){e.clearTimeout(T)}})},function(){var c=w.createElement("input"),v=w.createElement("select"),y=v.appendChild(w.createElement("option"));c.type="checkbox",p.checkOn=c.value!=="",p.optSelected=y.selected,c=w.createElement("input"),c.value="t",c.type="radio",p.radioValue=c.value==="t"}();var Gv,Vi=h.expr.attrHandle;h.fn.extend({attr:function(c,v){return ke(this,h.attr,c,v,arguments.length>1)},removeAttr:function(c){return this.each(function(){h.removeAttr(this,c)})}}),h.extend({attr:function(c,v,y){var F,T,S=c.nodeType;if(!(S===3||S===8||S===2)){if(typeof c.getAttribute>"u")return h.prop(c,v,y);if((S!==1||!h.isXMLDoc(c))&&(T=h.attrHooks[v.toLowerCase()]||(h.expr.match.bool.test(v)?Gv:void 0)),y!==void 0){if(y===null){h.removeAttr(c,v);return}return T&&"set"in T&&(F=T.set(c,y,v))!==void 0?F:(c.setAttribute(v,y+""),y)}return T&&"get"in T&&(F=T.get(c,v))!==null?F:(F=h.find.attr(c,v),F??void 0)}},attrHooks:{type:{set:function(c,v){if(!p.radioValue&&v==="radio"&&D(c,"input")){var y=c.value;return c.setAttribute("type",v),y&&(c.value=y),v}}}},removeAttr:function(c,v){var y,F=0,T=v&&v.match(Y);if(T&&c.nodeType===1)for(;y=T[F++];)c.removeAttribute(y)}}),Gv={set:function(c,v,y){return v===!1?h.removeAttr(c,y):c.setAttribute(y,y),y}},h.each(h.expr.match.bool.source.match(/\w+/g),function(c,v){var y=Vi[v]||h.find.attr;Vi[v]=function(F,T,S){var P,q,V=T.toLowerCase();return S||(q=Vi[V],Vi[V]=P,P=y(F,T,S)!=null?V:null,Vi[V]=q),P}});var Sx=/^(?:input|select|textarea|button)$/i,Dx=/^(?:a|area)$/i;h.fn.extend({prop:function(c,v){return ke(this,h.prop,c,v,arguments.length>1)},removeProp:function(c){return this.each(function(){delete this[h.propFix[c]||c]})}}),h.extend({prop:function(c,v,y){var F,T,S=c.nodeType;if(!(S===3||S===8||S===2))return(S!==1||!h.isXMLDoc(c))&&(v=h.propFix[v]||v,T=h.propHooks[v]),y!==void 0?T&&"set"in T&&(F=T.set(c,y,v))!==void 0?F:c[v]=y:T&&"get"in T&&(F=T.get(c,v))!==null?F:c[v]},propHooks:{tabIndex:{get:function(c){var v=h.find.attr(c,"tabindex");return v?parseInt(v,10):Sx.test(c.nodeName)||Dx.test(c.nodeName)&&c.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(h.propHooks.selected={get:function(c){var v=c.parentNode;return v&&v.parentNode&&v.parentNode.selectedIndex,null},set:function(c){var v=c.parentNode;v&&(v.selectedIndex,v.parentNode&&v.parentNode.selectedIndex)}}),h.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){h.propFix[this.toLowerCase()]=this});function ta(c){var v=c.match(Y)||[];return v.join(" ")}function ra(c){return c.getAttribute&&c.getAttribute("class")||""}function Uu(c){return Array.isArray(c)?c:typeof c=="string"?c.match(Y)||[]:[]}h.fn.extend({addClass:function(c){var v,y,F,T,S,P;return b(c)?this.each(function(q){h(this).addClass(c.call(this,q,ra(this)))}):(v=Uu(c),v.length?this.each(function(){if(F=ra(this),y=this.nodeType===1&&" "+ta(F)+" ",y){for(S=0;S<v.length;S++)T=v[S],y.indexOf(" "+T+" ")<0&&(y+=T+" ");P=ta(y),F!==P&&this.setAttribute("class",P)}}):this)},removeClass:function(c){var v,y,F,T,S,P;return b(c)?this.each(function(q){h(this).removeClass(c.call(this,q,ra(this)))}):arguments.length?(v=Uu(c),v.length?this.each(function(){if(F=ra(this),y=this.nodeType===1&&" "+ta(F)+" ",y){for(S=0;S<v.length;S++)for(T=v[S];y.indexOf(" "+T+" ")>-1;)y=y.replace(" "+T+" "," ");P=ta(y),F!==P&&this.setAttribute("class",P)}}):this):this.attr("class","")},toggleClass:function(c,v){var y,F,T,S,P=typeof c,q=P==="string"||Array.isArray(c);return b(c)?this.each(function(V){h(this).toggleClass(c.call(this,V,ra(this),v),v)}):typeof v=="boolean"&&q?v?this.addClass(c):this.removeClass(c):(y=Uu(c),this.each(function(){if(q)for(S=h(this),T=0;T<y.length;T++)F=y[T],S.hasClass(F)?S.removeClass(F):S.addClass(F);else(c===void 0||P==="boolean")&&(F=ra(this),F&&Fe.set(this,"__className__",F),this.setAttribute&&this.setAttribute("class",F||c===!1?"":Fe.get(this,"__className__")||""))}))},hasClass:function(c){var v,y,F=0;for(v=" "+c+" ";y=this[F++];)if(y.nodeType===1&&(" "+ta(ra(y))+" ").indexOf(v)>-1)return!0;return!1}});var kx=/\r/g;h.fn.extend({val:function(c){var v,y,F,T=this[0];return arguments.length?(F=b(c),this.each(function(S){var P;this.nodeType===1&&(F?P=c.call(this,S,h(this).val()):P=c,P==null?P="":typeof P=="number"?P+="":Array.isArray(P)&&(P=h.map(P,function(q){return q==null?"":q+""})),v=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()],(!v||!("set"in v)||v.set(this,P,"value")===void 0)&&(this.value=P))})):T?(v=h.valHooks[T.type]||h.valHooks[T.nodeName.toLowerCase()],v&&"get"in v&&(y=v.get(T,"value"))!==void 0?y:(y=T.value,typeof y=="string"?y.replace(kx,""):y??"")):void 0}}),h.extend({valHooks:{option:{get:function(c){var v=h.find.attr(c,"value");return v??ta(h.text(c))}},select:{get:function(c){var v,y,F,T=c.options,S=c.selectedIndex,P=c.type==="select-one",q=P?null:[],V=P?S+1:T.length;for(S<0?F=V:F=P?S:0;F<V;F++)if(y=T[F],(y.selected||F===S)&&!y.disabled&&(!y.parentNode.disabled||!D(y.parentNode,"optgroup"))){if(v=h(y).val(),P)return v;q.push(v)}return q},set:function(c,v){for(var y,F,T=c.options,S=h.makeArray(v),P=T.length;P--;)F=T[P],(F.selected=h.inArray(h.valHooks.option.get(F),S)>-1)&&(y=!0);return y||(c.selectedIndex=-1),S}}}}),h.each(["radio","checkbox"],function(){h.valHooks[this]={set:function(c,v){if(Array.isArray(v))return c.checked=h.inArray(h(c).val(),v)>-1}},p.checkOn||(h.valHooks[this].get=function(c){return c.getAttribute("value")===null?"on":c.value})});var $i=e.location,Kv={guid:Date.now()},Gu=/\?/;h.parseXML=function(c){var v,y;if(!c||typeof c!="string")return null;try{v=new e.DOMParser().parseFromString(c,"text/xml")}catch{}return y=v&&v.getElementsByTagName("parsererror")[0],(!v||y)&&h.error("Invalid XML: "+(y?h.map(y.childNodes,function(F){return F.textContent}).join(`
`):c)),v};var Xv=/^(?:focusinfocus|focusoutblur)$/,Yv=function(c){c.stopPropagation()};h.extend(h.event,{trigger:function(c,v,y,F){var T,S,P,q,V,K,ue,ve,re=[y||w],xe=d.call(c,"type")?c.type:c,Ze=d.call(c,"namespace")?c.namespace.split("."):[];if(S=ve=P=y=y||w,!(y.nodeType===3||y.nodeType===8)&&!Xv.test(xe+h.event.triggered)&&(xe.indexOf(".")>-1&&(Ze=xe.split("."),xe=Ze.shift(),Ze.sort()),V=xe.indexOf(":")<0&&"on"+xe,c=c[h.expando]?c:new h.Event(xe,typeof c=="object"&&c),c.isTrigger=F?2:3,c.namespace=Ze.join("."),c.rnamespace=c.namespace?new RegExp("(^|\\.)"+Ze.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,c.result=void 0,c.target||(c.target=y),v=v==null?[c]:h.makeArray(v,[c]),ue=h.event.special[xe]||{},!(!F&&ue.trigger&&ue.trigger.apply(y,v)===!1))){if(!F&&!ue.noBubble&&!x(y)){for(q=ue.delegateType||xe,Xv.test(q+xe)||(S=S.parentNode);S;S=S.parentNode)re.push(S),P=S;P===(y.ownerDocument||w)&&re.push(P.defaultView||P.parentWindow||e)}for(T=0;(S=re[T++])&&!c.isPropagationStopped();)ve=S,c.type=T>1?q:ue.bindType||xe,K=(Fe.get(S,"events")||Object.create(null))[c.type]&&Fe.get(S,"handle"),K&&K.apply(S,v),K=V&&S[V],K&&K.apply&&ze(S)&&(c.result=K.apply(S,v),c.result===!1&&c.preventDefault());return c.type=xe,!F&&!c.isDefaultPrevented()&&(!ue._default||ue._default.apply(re.pop(),v)===!1)&&ze(y)&&V&&b(y[xe])&&!x(y)&&(P=y[V],P&&(y[V]=null),h.event.triggered=xe,c.isPropagationStopped()&&ve.addEventListener(xe,Yv),y[xe](),c.isPropagationStopped()&&ve.removeEventListener(xe,Yv),h.event.triggered=void 0,P&&(y[V]=P)),c.result}},simulate:function(c,v,y){var F=h.extend(new h.Event,y,{type:c,isSimulated:!0});h.event.trigger(F,null,v)}}),h.fn.extend({trigger:function(c,v){return this.each(function(){h.event.trigger(c,v,this)})},triggerHandler:function(c,v){var y=this[0];if(y)return h.event.trigger(c,v,y,!0)}});var Px=/\[\]$/,Zv=/\r?\n/g,Ax=/^(?:submit|button|image|reset|file)$/i,Bx=/^(?:input|select|textarea|keygen)/i;function Ku(c,v,y,F){var T;if(Array.isArray(v))h.each(v,function(S,P){y||Px.test(c)?F(c,P):Ku(c+"["+(typeof P=="object"&&P!=null?S:"")+"]",P,y,F)});else if(!y&&k(v)==="object")for(T in v)Ku(c+"["+T+"]",v[T],y,F);else F(c,v)}h.param=function(c,v){var y,F=[],T=function(S,P){var q=b(P)?P():P;F[F.length]=encodeURIComponent(S)+"="+encodeURIComponent(q??"")};if(c==null)return"";if(Array.isArray(c)||c.jquery&&!h.isPlainObject(c))h.each(c,function(){T(this.name,this.value)});else for(y in c)Ku(y,c[y],v,T);return F.join("&")},h.fn.extend({serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var c=h.prop(this,"elements");return c?h.makeArray(c):this}).filter(function(){var c=this.type;return this.name&&!h(this).is(":disabled")&&Bx.test(this.nodeName)&&!Ax.test(c)&&(this.checked||!mt.test(c))}).map(function(c,v){var y=h(this).val();return y==null?null:Array.isArray(y)?h.map(y,function(F){return{name:v.name,value:F.replace(Zv,`\r
`)}}):{name:v.name,value:y.replace(Zv,`\r
`)}}).get()}});var Ix=/%20/g,Mx=/#.*$/,Rx=/([?&])_=[^&]*/,Lx=/^(.*?):[ \t]*([^\r\n]*)$/mg,Ox=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nx=/^(?:GET|HEAD)$/,_x=/^\/\//,Qv={},Xu={},Jv="*/".concat("*"),Yu=w.createElement("a");Yu.href=$i.href;function jv(c){return function(v,y){typeof v!="string"&&(y=v,v="*");var F,T=0,S=v.toLowerCase().match(Y)||[];if(b(y))for(;F=S[T++];)F[0]==="+"?(F=F.slice(1)||"*",(c[F]=c[F]||[]).unshift(y)):(c[F]=c[F]||[]).push(y)}}function eh(c,v,y,F){var T={},S=c===Xu;function P(q){var V;return T[q]=!0,h.each(c[q]||[],function(K,ue){var ve=ue(v,y,F);if(typeof ve=="string"&&!S&&!T[ve])return v.dataTypes.unshift(ve),P(ve),!1;if(S)return!(V=ve)}),V}return P(v.dataTypes[0])||!T["*"]&&P("*")}function Zu(c,v){var y,F,T=h.ajaxSettings.flatOptions||{};for(y in v)v[y]!==void 0&&((T[y]?c:F||(F={}))[y]=v[y]);return F&&h.extend(!0,c,F),c}function zx(c,v,y){for(var F,T,S,P,q=c.contents,V=c.dataTypes;V[0]==="*";)V.shift(),F===void 0&&(F=c.mimeType||v.getResponseHeader("Content-Type"));if(F){for(T in q)if(q[T]&&q[T].test(F)){V.unshift(T);break}}if(V[0]in y)S=V[0];else{for(T in y){if(!V[0]||c.converters[T+" "+V[0]]){S=T;break}P||(P=T)}S=S||P}if(S)return S!==V[0]&&V.unshift(S),y[S]}function Vx(c,v,y,F){var T,S,P,q,V,K={},ue=c.dataTypes.slice();if(ue[1])for(P in c.converters)K[P.toLowerCase()]=c.converters[P];for(S=ue.shift();S;)if(c.responseFields[S]&&(y[c.responseFields[S]]=v),!V&&F&&c.dataFilter&&(v=c.dataFilter(v,c.dataType)),V=S,S=ue.shift(),S){if(S==="*")S=V;else if(V!=="*"&&V!==S){if(P=K[V+" "+S]||K["* "+S],!P){for(T in K)if(q=T.split(" "),q[1]===S&&(P=K[V+" "+q[0]]||K["* "+q[0]],P)){P===!0?P=K[T]:K[T]!==!0&&(S=q[0],ue.unshift(q[1]));break}}if(P!==!0)if(P&&c.throws)v=P(v);else try{v=P(v)}catch(ve){return{state:"parsererror",error:P?ve:"No conversion from "+V+" to "+S}}}}return{state:"success",data:v}}h.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:$i.href,type:"GET",isLocal:Ox.test($i.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jv,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":h.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(c,v){return v?Zu(Zu(c,h.ajaxSettings),v):Zu(h.ajaxSettings,c)},ajaxPrefilter:jv(Qv),ajaxTransport:jv(Xu),ajax:function(c,v){typeof c=="object"&&(v=c,c=void 0),v=v||{};var y,F,T,S,P,q,V,K,ue,ve,re=h.ajaxSetup({},v),xe=re.context||re,Ze=re.context&&(xe.nodeType||xe.jquery)?h(xe):h.event,it=h.Deferred(),je=h.Callbacks("once memory"),Yt=re.statusCode||{},Nt={},Gr={},Kr="canceled",nt={readyState:0,getResponseHeader:function(ct){var Pt;if(V){if(!S)for(S={};Pt=Lx.exec(T);)S[Pt[1].toLowerCase()+" "]=(S[Pt[1].toLowerCase()+" "]||[]).concat(Pt[2]);Pt=S[ct.toLowerCase()+" "]}return Pt==null?null:Pt.join(", ")},getAllResponseHeaders:function(){return V?T:null},setRequestHeader:function(ct,Pt){return V==null&&(ct=Gr[ct.toLowerCase()]=Gr[ct.toLowerCase()]||ct,Nt[ct]=Pt),this},overrideMimeType:function(ct){return V==null&&(re.mimeType=ct),this},statusCode:function(ct){var Pt;if(ct)if(V)nt.always(ct[nt.status]);else for(Pt in ct)Yt[Pt]=[Yt[Pt],ct[Pt]];return this},abort:function(ct){var Pt=ct||Kr;return y&&y.abort(Pt),na(0,Pt),this}};if(it.promise(nt),re.url=((c||re.url||$i.href)+"").replace(_x,$i.protocol+"//"),re.type=v.method||v.type||re.method||re.type,re.dataTypes=(re.dataType||"*").toLowerCase().match(Y)||[""],re.crossDomain==null){q=w.createElement("a");try{q.href=re.url,q.href=q.href,re.crossDomain=Yu.protocol+"//"+Yu.host!=q.protocol+"//"+q.host}catch{re.crossDomain=!0}}if(re.data&&re.processData&&typeof re.data!="string"&&(re.data=h.param(re.data,re.traditional)),eh(Qv,re,v,nt),V)return nt;K=h.event&&re.global,K&&h.active++===0&&h.event.trigger("ajaxStart"),re.type=re.type.toUpperCase(),re.hasContent=!Nx.test(re.type),F=re.url.replace(Mx,""),re.hasContent?re.data&&re.processData&&(re.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&(re.data=re.data.replace(Ix,"+")):(ve=re.url.slice(F.length),re.data&&(re.processData||typeof re.data=="string")&&(F+=(Gu.test(F)?"&":"?")+re.data,delete re.data),re.cache===!1&&(F=F.replace(Rx,"$1"),ve=(Gu.test(F)?"&":"?")+"_="+Kv.guid+++ve),re.url=F+ve),re.ifModified&&(h.lastModified[F]&&nt.setRequestHeader("If-Modified-Since",h.lastModified[F]),h.etag[F]&&nt.setRequestHeader("If-None-Match",h.etag[F])),(re.data&&re.hasContent&&re.contentType!==!1||v.contentType)&&nt.setRequestHeader("Content-Type",re.contentType),nt.setRequestHeader("Accept",re.dataTypes[0]&&re.accepts[re.dataTypes[0]]?re.accepts[re.dataTypes[0]]+(re.dataTypes[0]!=="*"?", "+Jv+"; q=0.01":""):re.accepts["*"]);for(ue in re.headers)nt.setRequestHeader(ue,re.headers[ue]);if(re.beforeSend&&(re.beforeSend.call(xe,nt,re)===!1||V))return nt.abort();if(Kr="abort",je.add(re.complete),nt.done(re.success),nt.fail(re.error),y=eh(Xu,re,v,nt),!y)na(-1,"No Transport");else{if(nt.readyState=1,K&&Ze.trigger("ajaxSend",[nt,re]),V)return nt;re.async&&re.timeout>0&&(P=e.setTimeout(function(){nt.abort("timeout")},re.timeout));try{V=!1,y.send(Nt,na)}catch(ct){if(V)throw ct;na(-1,ct)}}function na(ct,Pt,Hi,Ju){var Xr,Wi,Yr,An,Bn,Ar=Pt;V||(V=!0,P&&e.clearTimeout(P),y=void 0,T=Ju||"",nt.readyState=ct>0?4:0,Xr=ct>=200&&ct<300||ct===304,Hi&&(An=zx(re,nt,Hi)),!Xr&&h.inArray("script",re.dataTypes)>-1&&h.inArray("json",re.dataTypes)<0&&(re.converters["text script"]=function(){}),An=Vx(re,An,nt,Xr),Xr?(re.ifModified&&(Bn=nt.getResponseHeader("Last-Modified"),Bn&&(h.lastModified[F]=Bn),Bn=nt.getResponseHeader("etag"),Bn&&(h.etag[F]=Bn)),ct===204||re.type==="HEAD"?Ar="nocontent":ct===304?Ar="notmodified":(Ar=An.state,Wi=An.data,Yr=An.error,Xr=!Yr)):(Yr=Ar,(ct||!Ar)&&(Ar="error",ct<0&&(ct=0))),nt.status=ct,nt.statusText=(Pt||Ar)+"",Xr?it.resolveWith(xe,[Wi,Ar,nt]):it.rejectWith(xe,[nt,Ar,Yr]),nt.statusCode(Yt),Yt=void 0,K&&Ze.trigger(Xr?"ajaxSuccess":"ajaxError",[nt,re,Xr?Wi:Yr]),je.fireWith(xe,[nt,Ar]),K&&(Ze.trigger("ajaxComplete",[nt,re]),--h.active||h.event.trigger("ajaxStop")))}return nt},getJSON:function(c,v,y){return h.get(c,v,y,"json")},getScript:function(c,v){return h.get(c,void 0,v,"script")}}),h.each(["get","post"],function(c,v){h[v]=function(y,F,T,S){return b(F)&&(S=S||T,T=F,F=void 0),h.ajax(h.extend({url:y,type:v,dataType:S,data:F,success:T},h.isPlainObject(y)&&y))}}),h.ajaxPrefilter(function(c){var v;for(v in c.headers)v.toLowerCase()==="content-type"&&(c.contentType=c.headers[v]||"")}),h._evalUrl=function(c,v,y){return h.ajax({url:c,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(F){h.globalEval(F,v,y)}})},h.fn.extend({wrapAll:function(c){var v;return this[0]&&(b(c)&&(c=c.call(this[0])),v=h(c,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&v.insertBefore(this[0]),v.map(function(){for(var y=this;y.firstElementChild;)y=y.firstElementChild;return y}).append(this)),this},wrapInner:function(c){return b(c)?this.each(function(v){h(this).wrapInner(c.call(this,v))}):this.each(function(){var v=h(this),y=v.contents();y.length?y.wrapAll(c):v.append(c)})},wrap:function(c){var v=b(c);return this.each(function(y){h(this).wrapAll(v?c.call(this,y):c)})},unwrap:function(c){return this.parent(c).not("body").each(function(){h(this).replaceWith(this.childNodes)}),this}}),h.expr.pseudos.hidden=function(c){return!h.expr.pseudos.visible(c)},h.expr.pseudos.visible=function(c){return!!(c.offsetWidth||c.offsetHeight||c.getClientRects().length)},h.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch{}};var $x={0:200,1223:204},qi=h.ajaxSettings.xhr();p.cors=!!qi&&"withCredentials"in qi,p.ajax=qi=!!qi,h.ajaxTransport(function(c){var v,y;if(p.cors||qi&&!c.crossDomain)return{send:function(F,T){var S,P=c.xhr();if(P.open(c.type,c.url,c.async,c.username,c.password),c.xhrFields)for(S in c.xhrFields)P[S]=c.xhrFields[S];c.mimeType&&P.overrideMimeType&&P.overrideMimeType(c.mimeType),!c.crossDomain&&!F["X-Requested-With"]&&(F["X-Requested-With"]="XMLHttpRequest");for(S in F)P.setRequestHeader(S,F[S]);v=function(q){return function(){v&&(v=y=P.onload=P.onerror=P.onabort=P.ontimeout=P.onreadystatechange=null,q==="abort"?P.abort():q==="error"?typeof P.status!="number"?T(0,"error"):T(P.status,P.statusText):T($x[P.status]||P.status,P.statusText,(P.responseType||"text")!=="text"||typeof P.responseText!="string"?{binary:P.response}:{text:P.responseText},P.getAllResponseHeaders()))}},P.onload=v(),y=P.onerror=P.ontimeout=v("error"),P.onabort!==void 0?P.onabort=y:P.onreadystatechange=function(){P.readyState===4&&e.setTimeout(function(){v&&y()})},v=v("abort");try{P.send(c.hasContent&&c.data||null)}catch(q){if(v)throw q}},abort:function(){v&&v()}}}),h.ajaxPrefilter(function(c){c.crossDomain&&(c.contents.script=!1)}),h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(c){return h.globalEval(c),c}}}),h.ajaxPrefilter("script",function(c){c.cache===void 0&&(c.cache=!1),c.crossDomain&&(c.type="GET")}),h.ajaxTransport("script",function(c){if(c.crossDomain||c.scriptAttrs){var v,y;return{send:function(F,T){v=h("<script>").attr(c.scriptAttrs||{}).prop({charset:c.scriptCharset,src:c.url}).on("load error",y=function(S){v.remove(),y=null,S&&T(S.type==="error"?404:200,S.type)}),w.head.appendChild(v[0])},abort:function(){y&&y()}}}});var th=[],Qu=/(=)\?(?=&|$)|\?\?/;h.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var c=th.pop()||h.expando+"_"+Kv.guid++;return this[c]=!0,c}}),h.ajaxPrefilter("json jsonp",function(c,v,y){var F,T,S,P=c.jsonp!==!1&&(Qu.test(c.url)?"url":typeof c.data=="string"&&(c.contentType||"").indexOf("application/x-www-form-urlencoded")===0&&Qu.test(c.data)&&"data");if(P||c.dataTypes[0]==="jsonp")return F=c.jsonpCallback=b(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,P?c[P]=c[P].replace(Qu,"$1"+F):c.jsonp!==!1&&(c.url+=(Gu.test(c.url)?"&":"?")+c.jsonp+"="+F),c.converters["script json"]=function(){return S||h.error(F+" was not called"),S[0]},c.dataTypes[0]="json",T=e[F],e[F]=function(){S=arguments},y.always(function(){T===void 0?h(e).removeProp(F):e[F]=T,c[F]&&(c.jsonpCallback=v.jsonpCallback,th.push(F)),S&&b(T)&&T(S[0]),S=T=void 0}),"script"}),p.createHTMLDocument=function(){var c=w.implementation.createHTMLDocument("").body;return c.innerHTML="<form></form><form></form>",c.childNodes.length===2}(),h.parseHTML=function(c,v,y){if(typeof c!="string")return[];typeof v=="boolean"&&(y=v,v=!1);var F,T,S;return v||(p.createHTMLDocument?(v=w.implementation.createHTMLDocument(""),F=v.createElement("base"),F.href=w.location.href,v.head.appendChild(F)):v=w),T=ee.exec(c),S=!y&&[],T?[v.createElement(T[1])]:(T=$t([c],v,S),S&&S.length&&h(S).remove(),h.merge([],T.childNodes))},h.fn.load=function(c,v,y){var F,T,S,P=this,q=c.indexOf(" ");return q>-1&&(F=ta(c.slice(q)),c=c.slice(0,q)),b(v)?(y=v,v=void 0):v&&typeof v=="object"&&(T="POST"),P.length>0&&h.ajax({url:c,type:T||"GET",dataType:"html",data:v}).done(function(V){S=arguments,P.html(F?h("<div>").append(h.parseHTML(V)).find(F):V)}).always(y&&function(V,K){P.each(function(){y.apply(this,S||[V.responseText,K,V])})}),this},h.expr.pseudos.animated=function(c){return h.grep(h.timers,function(v){return c===v.elem}).length},h.offset={setOffset:function(c,v,y){var F,T,S,P,q,V,K,ue=h.css(c,"position"),ve=h(c),re={};ue==="static"&&(c.style.position="relative"),q=ve.offset(),S=h.css(c,"top"),V=h.css(c,"left"),K=(ue==="absolute"||ue==="fixed")&&(S+V).indexOf("auto")>-1,K?(F=ve.position(),P=F.top,T=F.left):(P=parseFloat(S)||0,T=parseFloat(V)||0),b(v)&&(v=v.call(c,y,h.extend({},q))),v.top!=null&&(re.top=v.top-q.top+P),v.left!=null&&(re.left=v.left-q.left+T),"using"in v?v.using.call(c,re):ve.css(re)}},h.fn.extend({offset:function(c){if(arguments.length)return c===void 0?this:this.each(function(T){h.offset.setOffset(this,c,T)});var v,y,F=this[0];if(F)return F.getClientRects().length?(v=F.getBoundingClientRect(),y=F.ownerDocument.defaultView,{top:v.top+y.pageYOffset,left:v.left+y.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var c,v,y,F=this[0],T={top:0,left:0};if(h.css(F,"position")==="fixed")v=F.getBoundingClientRect();else{for(v=this.offset(),y=F.ownerDocument,c=F.offsetParent||y.documentElement;c&&(c===y.body||c===y.documentElement)&&h.css(c,"position")==="static";)c=c.parentNode;c&&c!==F&&c.nodeType===1&&(T=h(c).offset(),T.top+=h.css(c,"borderTopWidth",!0),T.left+=h.css(c,"borderLeftWidth",!0))}return{top:v.top-T.top-h.css(F,"marginTop",!0),left:v.left-T.left-h.css(F,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var c=this.offsetParent;c&&h.css(c,"position")==="static";)c=c.offsetParent;return c||Ee})}}),h.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(c,v){var y=v==="pageYOffset";h.fn[c]=function(F){return ke(this,function(T,S,P){var q;if(x(T)?q=T:T.nodeType===9&&(q=T.defaultView),P===void 0)return q?q[v]:T[S];q?q.scrollTo(y?q.pageXOffset:P,y?P:q.pageYOffset):T[S]=P},c,F,arguments.length)}}),h.each(["top","left"],function(c,v){h.cssHooks[v]=Ni(p.pixelPosition,function(y,F){if(F)return F=Ur(y,v),Ri.test(F)?h(y).position()[v]+"px":F})}),h.each({Height:"height",Width:"width"},function(c,v){h.each({padding:"inner"+c,content:v,"":"outer"+c},function(y,F){h.fn[F]=function(T,S){var P=arguments.length&&(y||typeof T!="boolean"),q=y||(T===!0||S===!0?"margin":"border");return ke(this,function(V,K,ue){var ve;return x(V)?F.indexOf("outer")===0?V["inner"+c]:V.document.documentElement["client"+c]:V.nodeType===9?(ve=V.documentElement,Math.max(V.body["scroll"+c],ve["scroll"+c],V.body["offset"+c],ve["offset"+c],ve["client"+c])):ue===void 0?h.css(V,K,q):h.style(V,K,ue,q)},v,P?T:void 0,P)}})}),h.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(c,v){h.fn[v]=function(y){return this.on(v,y)}}),h.fn.extend({bind:function(c,v,y){return this.on(c,null,v,y)},unbind:function(c,v){return this.off(c,null,v)},delegate:function(c,v,y,F){return this.on(v,c,y,F)},undelegate:function(c,v,y){return arguments.length===1?this.off(c,"**"):this.off(v,c||"**",y)},hover:function(c,v){return this.on("mouseenter",c).on("mouseleave",v||c)}}),h.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(c,v){h.fn[v]=function(y,F){return arguments.length>0?this.on(v,null,y,F):this.trigger(v)}});var qx=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;h.proxy=function(c,v){var y,F,T;if(typeof v=="string"&&(y=c[v],v=c,c=y),!!b(c))return F=i.call(arguments,2),T=function(){return c.apply(v||this,F.concat(i.call(arguments)))},T.guid=c.guid=c.guid||h.guid++,T},h.holdReady=function(c){c?h.readyWait++:h.ready(!0)},h.isArray=Array.isArray,h.parseJSON=JSON.parse,h.nodeName=D,h.isFunction=b,h.isWindow=x,h.camelCase=Le,h.type=k,h.now=Date.now,h.isNumeric=function(c){var v=h.type(c);return(v==="number"||v==="string")&&!isNaN(c-parseFloat(c))},h.trim=function(c){return c==null?"":(c+"").replace(qx,"$1")};var Hx=e.jQuery,Wx=e.$;return h.noConflict=function(c){return e.$===h&&(e.$=Wx),c&&e.jQuery===h&&(e.jQuery=Hx),h},typeof r>"u"&&(e.jQuery=e.$=h),h})})(ul);var hh=ul.exports;const un=lh(hh);function It(t){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(t)}function ln(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ll(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function fn(t,e,r){return e&&ll(t.prototype,e),r&&ll(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function fl(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function At(t,e){return ph(t)||yh(t,e)||co(t,e)||bh()}function cl(t){return gh(t)||mh(t)||co(t)||wh()}function gh(t){if(Array.isArray(t))return vo(t)}function ph(t){if(Array.isArray(t))return t}function mh(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yh(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],a=!0,i=!1,s,o;try{for(r=r.call(t);!(a=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));a=!0);}catch(u){i=!0,o=u}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw o}}return n}}function co(t,e){if(t){if(typeof t=="string")return vo(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vo(t,e)}}function vo(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wh(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wr(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=co(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,o;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return i=u.done,u},e:function(u){s=!0,o=u},f:function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw o}}}}var Mt=typeof window>"u"?null:window,dl=Mt?Mt.navigator:null;Mt&&Mt.document;var xh=It(""),vl=It({}),Fh=It(function(){}),Eh=typeof HTMLElement>"u"?"undefined":It(HTMLElement),qa=function(e){return e&&e.instanceString&&Tt(e.instanceString)?e.instanceString():null},_e=function(e){return e!=null&&It(e)==xh},Tt=function(e){return e!=null&&It(e)===Fh},bt=function(e){return!br(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},st=function(e){return e!=null&&It(e)===vl&&!bt(e)&&e.constructor===Object},Ch=function(e){return e!=null&&It(e)===vl},Se=function(e){return e!=null&&It(e)===It(1)&&!isNaN(e)},Th=function(e){return Se(e)&&Math.floor(e)===e},Gi=function(e){if(Eh!=="undefined")return e!=null&&e instanceof HTMLElement},br=function(e){return Ha(e)||hl(e)},Ha=function(e){return qa(e)==="collection"&&e._private.single},hl=function(e){return qa(e)==="collection"&&!e._private.single},ho=function(e){return qa(e)==="core"},gl=function(e){return qa(e)==="stylesheet"},Sh=function(e){return qa(e)==="event"},cn=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Dh=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},kh=function(e){return st(e)&&Se(e.x1)&&Se(e.x2)&&Se(e.y1)&&Se(e.y2)},Ph=function(e){return Ch(e)&&Tt(e.then)},Ah=function(){return dl&&dl.userAgent.match(/msie|trident|edge/i)},Wa=function(e,r){r||(r=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var n=function a(){var i=this,s=arguments,o,u=r.apply(i,s),l=a.cache;return(o=l[u])||(o=l[u]=e.apply(i,s)),o};return n.cache={},n},go=Wa(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ki=Wa(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),pl=Wa(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),ml=function(e){return cn(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Rt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Bh="rgb[a]?\\(("+Rt+"[%]?)\\s*,\\s*("+Rt+"[%]?)\\s*,\\s*("+Rt+"[%]?)(?:\\s*,\\s*("+Rt+"))?\\)",Ih="rgb[a]?\\((?:"+Rt+"[%]?)\\s*,\\s*(?:"+Rt+"[%]?)\\s*,\\s*(?:"+Rt+"[%]?)(?:\\s*,\\s*(?:"+Rt+"))?\\)",Mh="hsl[a]?\\(("+Rt+")\\s*,\\s*("+Rt+"[%])\\s*,\\s*("+Rt+"[%])(?:\\s*,\\s*("+Rt+"))?\\)",Rh="hsl[a]?\\((?:"+Rt+")\\s*,\\s*(?:"+Rt+"[%])\\s*,\\s*(?:"+Rt+"[%])(?:\\s*,\\s*(?:"+Rt+"))?\\)",Lh="\\#[0-9a-fA-F]{3}",Oh="\\#[0-9a-fA-F]{6}",yl=function(e,r){return e<r?-1:e>r?1:0},Nh=function(e,r){return-1*yl(e,r)},Ve=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r<e.length;r++){var n=e[r];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];t[s]=n[s]}}return t},_h=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var r=e.length===4,n,a,i,s=16;return r?(n=parseInt(e[1]+e[1],s),a=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s)):(n=parseInt(e[1]+e[2],s),a=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s)),[n,a,i]}},zh=function(e){var r,n,a,i,s,o,u,l;function f(p,b,x){return x<0&&(x+=1),x>1&&(x-=1),x<1/6?p+(b-p)*6*x:x<1/2?b:x<2/3?p+(b-p)*(2/3-x)*6:p}var d=new RegExp("^"+Mh+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,s=d[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(a===0)o=u=l=Math.round(i*255);else{var g=i<.5?i*(1+a):i+a-i*a,m=2*i-g;o=Math.round(255*f(m,g,n+1/3)),u=Math.round(255*f(m,g,n)),l=Math.round(255*f(m,g,n-1/3))}r=[o,u,l,s]}return r},Vh=function(e){var r,n=new RegExp("^"+Bh+"$").exec(e);if(n){r=[];for(var a=[],i=1;i<=3;i++){var s=n[i];if(s[s.length-1]==="%"&&(a[i]=!0),s=parseFloat(s),a[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=a[1]||a[2]||a[3],u=a[1]&&a[2]&&a[3];if(o&&!u)return;var l=n[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;r.push(l)}}return r},$h=function(e){return qh[e.toLowerCase()]},wl=function(e){return(bt(e)?e:null)||$h(e)||_h(e)||Vh(e)||zh(e)},qh={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]},bl=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(st(s))throw Error("Tried to set map with object key");i<n.length-1?(r[s]==null&&(r[s]={}),r=r[s]):r[s]=e.value}},xl=function(e){for(var r=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(st(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r};function Hh(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Mn=Hh,Ua=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wh(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Uh=typeof Ua=="object"&&Ua&&Ua.Object===Object&&Ua,Gh=Uh,Kh=typeof self=="object"&&self&&self.Object===Object&&self,Xh=Gh||Kh||Function("return this")(),Xi=Xh,Yh=function(){return Xi.Date.now()},po=Yh,Zh=/\s/;function Qh(t){for(var e=t.length;e--&&Zh.test(t.charAt(e)););return e}var Jh=Qh,jh=/^\s+/;function eg(t){return t&&t.slice(0,Jh(t)+1).replace(jh,"")}var tg=eg,rg=Xi.Symbol,ia=rg,Fl=Object.prototype,ng=Fl.hasOwnProperty,ag=Fl.toString,Ga=ia?ia.toStringTag:void 0;function ig(t){var e=ng.call(t,Ga),r=t[Ga];try{t[Ga]=void 0;var n=!0}catch{}var a=ag.call(t);return n&&(e?t[Ga]=r:delete t[Ga]),a}var sg=ig,og=Object.prototype,ug=og.toString;function lg(t){return ug.call(t)}var fg=lg,cg="[object Null]",dg="[object Undefined]",El=ia?ia.toStringTag:void 0;function vg(t){return t==null?t===void 0?dg:cg:El&&El in Object(t)?sg(t):fg(t)}var Cl=vg;function hg(t){return t!=null&&typeof t=="object"}var gg=hg,pg="[object Symbol]";function mg(t){return typeof t=="symbol"||gg(t)&&Cl(t)==pg}var Ka=mg,Tl=0/0,yg=/^[-+]0x[0-9a-f]+$/i,wg=/^0b[01]+$/i,bg=/^0o[0-7]+$/i,xg=parseInt;function Fg(t){if(typeof t=="number")return t;if(Ka(t))return Tl;if(Mn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Mn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=tg(t);var r=wg.test(t);return r||bg.test(t)?xg(t.slice(2),r?2:8):yg.test(t)?Tl:+t}var Sl=Fg,Eg="Expected a function",Cg=Math.max,Tg=Math.min;function Sg(t,e,r){var n,a,i,s,o,u,l=0,f=!1,d=!1,g=!0;if(typeof t!="function")throw new TypeError(Eg);e=Sl(e)||0,Mn(r)&&(f=!!r.leading,d="maxWait"in r,i=d?Cg(Sl(r.maxWait)||0,e):i,g="trailing"in r?!!r.trailing:g);function m(A){var h=n,I=a;return n=a=void 0,l=A,s=t.apply(I,h),s}function p(A){return l=A,o=setTimeout(w,e),f?m(A):s}function b(A){var h=A-u,I=A-l,D=e-h;return d?Tg(D,i-I):D}function x(A){var h=A-u,I=A-l;return u===void 0||h>=e||h<0||d&&I>=i}function w(){var A=po();if(x(A))return E(A);o=setTimeout(w,b(A))}function E(A){return o=void 0,g&&n?m(A):(n=a=void 0,s)}function C(){o!==void 0&&clearTimeout(o),l=0,n=u=a=o=void 0}function k(){return o===void 0?s:E(po())}function R(){var A=po(),h=x(A);if(n=arguments,a=this,u=A,h){if(o===void 0)return p(u);if(d)return clearTimeout(o),o=setTimeout(w,e),m(u)}return o===void 0&&(o=setTimeout(w,e)),s}return R.cancel=C,R.flush=k,R}var Xa=Sg,mo=Mt?Mt.performance:null,Dl=mo&&mo.now?function(){return mo.now()}:function(){return Date.now()},Dg=function(){if(Mt){if(Mt.requestAnimationFrame)return function(t){Mt.requestAnimationFrame(t)};if(Mt.mozRequestAnimationFrame)return function(t){Mt.mozRequestAnimationFrame(t)};if(Mt.webkitRequestAnimationFrame)return function(t){Mt.webkitRequestAnimationFrame(t)};if(Mt.msRequestAnimationFrame)return function(t){Mt.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(Dl())},1e3/60)}}(),Yi=function(e){return Dg(e)},Qr=Dl,sa=9261,kl=65599,Ya=5381,Pl=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sa,n=r,a;a=e.next(),!a.done;)n=n*kl+a.value|0;return n},Za=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sa;return r*kl+e|0},Qa=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ya;return(r<<5)+r+e|0},kg=function(e,r){return e*2097152+r},dn=function(e){return e[0]*2097152+e[1]},Zi=function(e,r){return[Za(e[0],r[0]),Qa(e[1],r[1])]},Pg=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return Pl(s,r)},vn=function(e,r){var n={value:0,done:!1},a=0,i=e.length,s={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return Pl(s,r)},Al=function(){return Ag(arguments)},Ag=function(e){for(var r,n=0;n<e.length;n++){var a=e[n];n===0?r=vn(a):r=vn(a,r)}return r},Bl=!0,Bg=console.warn!=null,Ig=console.trace!=null,yo=Number.MAX_SAFE_INTEGER||9007199254740991,Il=function(){return!0},Qi=function(){return!1},Ml=function(){return 0},wo=function(){},St=function(e){throw new Error(e)},Rl=function(e){if(e!==void 0)Bl=!!e;else return Bl},ht=function(e){Rl()&&(Bg?console.warn(e):(console.log(e),Ig&&console.trace()))},Mg=function(e){return Ve({},e)},_r=function(e){return e==null?e:bt(e)?e.slice():st(e)?Mg(e):e},Rg=function(e){return e.slice()},Ll=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},Lg={},Ol=function(){return Lg},_t=function(e){var r=Object.keys(e);return function(n){for(var a={},i=0;i<r.length;i++){var s=r[i],o=n==null?void 0:n[s];a[s]=o===void 0?e[s]:o}return a}},hn=function(e,r,n){for(var a=e.length-1;a>=0&&!(e[a]===r&&(e.splice(a,1),n));a--);},bo=function(e){e.splice(0,e.length)},Og=function(e,r){for(var n=0;n<r.length;n++){var a=r[n];e.push(a)}},Ir=function(e,r,n){return n&&(r=pl(n,r)),e[r]},gn=function(e,r,n,a){n&&(r=pl(n,r)),e[r]=a},Ng=function(){function t(){ln(this,t),this._obj={}}return fn(t,[{key:"set",value:function(r,n){return this._obj[r]=n,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}]),t}(),zr=typeof Map<"u"?Map:Ng,_g="undefined",zg=function(){function t(e){if(ln(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;e.instanceString!=null&&e.instanceString()===this.instanceString()?r=e.toArray():r=e;for(var n=0;n<r.length;n++)this.add(r[n])}}return fn(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var n=this._obj;n[r]!==1&&(n[r]=1,this.size++)}},{key:"delete",value:function(r){var n=this._obj;n[r]===1&&(n[r]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(n){return r.has(n)})}},{key:"forEach",value:function(r,n){return this.toArray().forEach(r,n)}}]),t}(),oa=(typeof Set>"u"?"undefined":It(Set))!==_g?Set:zg,Ji=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!ho(e)){St("An element must have a core reference and parameters set");return}var a=r.group;if(a==null&&(r.data&&r.data.source!=null&&r.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){St("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?a==="edges":!!r.pannable,active:!1,classes:new oa,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.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(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),u=e.zoom();i.position={x:(s.x-o.x)/u,y:(s.y-o.y)/u}}var l=[];bt(r.classes)?l=r.classes:_e(r.classes)&&(l=r.classes.split(/\s+/));for(var f=0,d=l.length;f<d;f++){var g=l[f];!g||g===""||i.classes.add(g)}this.createEmitter();var m=r.style||r.css;m&&(ht("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."),this.style(m)),(n===void 0||n)&&this.restore()},Nl=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;st(n)&&!br(n)&&(s=n,n=s.roots||s.root,a=s.visit,i=s.directed),i=arguments.length===2&&!Tt(a)?a:i,a=Tt(a)?a:function(){};for(var o=this._private.cy,u=n=_e(n)?this.filter(n):n,l=[],f=[],d={},g={},m={},p=0,b,x=this.byGroup(),w=x.nodes,E=x.edges,C=0;C<u.length;C++){var k=u[C],R=k.id();k.isNode()&&(l.unshift(k),e.bfs&&(m[R]=!0,f.push(k)),g[R]=0)}for(var A=function(){var N=e.bfs?l.shift():l.pop(),_=N.id();if(e.dfs){if(m[_])return"continue";m[_]=!0,f.push(N)}var U=g[_],H=d[_],W=H!=null?H.source():null,X=H!=null?H.target():null,Q=H==null?void 0:N.same(W)?X[0]:W[0],se=void 0;if(se=a(N,H,Q,p++,U),se===!0)return b=N,"break";if(se===!1)return"break";for(var j=N.connectedEdges().filter(function(pe){return(!i||pe.source().same(N))&&E.has(pe)}),ee=0;ee<j.length;ee++){var de=j[ee],ge=de.connectedNodes().filter(function(pe){return!pe.same(N)&&w.has(pe)}),me=ge.id();ge.length!==0&&!m[me]&&(ge=ge[0],l.push(ge),e.bfs&&(m[me]=!0,f.push(ge)),d[me]=de,g[me]=g[_]+1)}};l.length!==0;){var h=A();if(h!=="continue"&&h==="break")break}for(var I=o.collection(),D=0;D<f.length;D++){var M=f[D],L=d[M.id()];L!=null&&I.push(L),I.push(M)}return{path:o.collection(I),found:o.collection(b)}}},Ja={breadthFirstSearch:Nl({bfs:!0}),depthFirstSearch:Nl({dfs:!0})};Ja.bfs=Ja.breadthFirstSearch,Ja.dfs=Ja.depthFirstSearch;var Vg=Wh(function(t,e){(function(){var r,n,a,i,s,o,u,l,f,d,g,m,p,b,x;a=Math.floor,d=Math.min,n=function(w,E){return w<E?-1:w>E?1:0},f=function(w,E,C,k,R){var A;if(C==null&&(C=0),R==null&&(R=n),C<0)throw new Error("lo must be non-negative");for(k==null&&(k=w.length);C<k;)A=a((C+k)/2),R(E,w[A])<0?k=A:C=A+1;return[].splice.apply(w,[C,C-C].concat(E)),E},o=function(w,E,C){return C==null&&(C=n),w.push(E),b(w,0,w.length-1,C)},s=function(w,E){var C,k;return E==null&&(E=n),C=w.pop(),w.length?(k=w[0],w[0]=C,x(w,0,E)):k=C,k},l=function(w,E,C){var k;return C==null&&(C=n),k=w[0],w[0]=E,x(w,0,C),k},u=function(w,E,C){var k;return C==null&&(C=n),w.length&&C(w[0],E)<0&&(k=[w[0],E],E=k[0],w[0]=k[1],x(w,0,C)),E},i=function(w,E){var C,k,R,A,h,I;for(E==null&&(E=n),A=(function(){I=[];for(var D=0,M=a(w.length/2);0<=M?D<M:D>M;0<=M?D++:D--)I.push(D);return I}).apply(this).reverse(),h=[],k=0,R=A.length;k<R;k++)C=A[k],h.push(x(w,C,E));return h},p=function(w,E,C){var k;if(C==null&&(C=n),k=w.indexOf(E),k!==-1)return b(w,0,k,C),x(w,k,C)},g=function(w,E,C){var k,R,A,h,I;if(C==null&&(C=n),R=w.slice(0,E),!R.length)return R;for(i(R,C),I=w.slice(E),A=0,h=I.length;A<h;A++)k=I[A],u(R,k,C);return R.sort(C).reverse()},m=function(w,E,C){var k,R,A,h,I,D,M,L,B;if(C==null&&(C=n),E*10<=w.length){if(A=w.slice(0,E).sort(C),!A.length)return A;for(R=A[A.length-1],M=w.slice(E),h=0,D=M.length;h<D;h++)k=M[h],C(k,R)<0&&(f(A,k,0,null,C),A.pop(),R=A[A.length-1]);return A}for(i(w,C),B=[],I=0,L=d(E,w.length);0<=L?I<L:I>L;0<=L?++I:--I)B.push(s(w,C));return B},b=function(w,E,C,k){var R,A,h;for(k==null&&(k=n),R=w[C];C>E;){if(h=C-1>>1,A=w[h],k(R,A)<0){w[C]=A,C=h;continue}break}return w[C]=R},x=function(w,E,C){var k,R,A,h,I;for(C==null&&(C=n),R=w.length,I=E,A=w[E],k=2*E+1;k<R;)h=k+1,h<R&&!(C(w[k],w[h])<0)&&(k=h),w[E]=w[k],E=k,k=2*E+1;return w[E]=A,b(w,I,E,C)},r=function(){w.push=o,w.pop=s,w.replace=l,w.pushpop=u,w.heapify=i,w.updateItem=p,w.nlargest=g,w.nsmallest=m;function w(E){this.cmp=E??n,this.nodes=[]}return w.prototype.push=function(E){return o(this.nodes,E,this.cmp)},w.prototype.pop=function(){return s(this.nodes,this.cmp)},w.prototype.peek=function(){return this.nodes[0]},w.prototype.contains=function(E){return this.nodes.indexOf(E)!==-1},w.prototype.replace=function(E){return l(this.nodes,E,this.cmp)},w.prototype.pushpop=function(E){return u(this.nodes,E,this.cmp)},w.prototype.heapify=function(){return i(this.nodes,this.cmp)},w.prototype.updateItem=function(E){return p(this.nodes,E,this.cmp)},w.prototype.clear=function(){return this.nodes=[]},w.prototype.empty=function(){return this.nodes.length===0},w.prototype.size=function(){return this.nodes.length},w.prototype.clone=function(){var E;return E=new w,E.nodes=this.nodes.slice(0),E},w.prototype.toArray=function(){return this.nodes.slice(0)},w.prototype.insert=w.prototype.push,w.prototype.top=w.prototype.peek,w.prototype.front=w.prototype.peek,w.prototype.has=w.prototype.contains,w.prototype.copy=w.prototype.clone,w}(),function(w,E){return t.exports=E()}(this,function(){return r})}).call(Ua)}),ja=Vg,$g=_t({root:null,weight:function(e){return 1},directed:!1}),qg={dijkstra:function(e){if(!st(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var n=$g(e),a=n.root,i=n.weight,s=n.directed,o=this,u=i,l=_e(a)?this.filter(a)[0]:a[0],f={},d={},g={},m=this.byGroup(),p=m.nodes,b=m.edges;b.unmergeBy(function(U){return U.isLoop()});for(var x=function(H){return f[H.id()]},w=function(H,W){f[H.id()]=W,E.updateItem(H)},E=new ja(function(U,H){return x(U)-x(H)}),C=0;C<p.length;C++){var k=p[C];f[k.id()]=k.same(l)?0:1/0,E.push(k)}for(var R=function(H,W){for(var X=(s?H.edgesTo(W):H.edgesWith(W)).intersect(b),Q=1/0,se,j=0;j<X.length;j++){var ee=X[j],de=u(ee);(de<Q||!se)&&(Q=de,se=ee)}return{edge:se,dist:Q}};E.size()>0;){var A=E.pop(),h=x(A),I=A.id();if(g[I]=h,h!==1/0)for(var D=A.neighborhood().intersect(p),M=0;M<D.length;M++){var L=D[M],B=L.id(),N=R(A,L),_=h+N.dist;_<x(L)&&(w(L,_),d[B]={node:A,edge:N.edge})}}return{distanceTo:function(H){var W=_e(H)?p.filter(H)[0]:H[0];return g[W.id()]},pathTo:function(H){var W=_e(H)?p.filter(H)[0]:H[0],X=[],Q=W,se=Q.id();if(W.length>0)for(X.unshift(W);d[se];){var j=d[se];X.unshift(j.edge),X.unshift(j.node),Q=j.node,se=Q.id()}return o.spawn(X)}}}},Hg={kruskal:function(e){e=e||function(C){return 1};for(var r=this.byGroup(),n=r.nodes,a=r.edges,i=n.length,s=new Array(i),o=n,u=function(k){for(var R=0;R<s.length;R++){var A=s[R];if(A.has(k))return R}},l=0;l<i;l++)s[l]=this.spawn(n[l]);for(var f=a.sort(function(C,k){return e(C)-e(k)}),d=0;d<f.length;d++){var g=f[d],m=g.source()[0],p=g.target()[0],b=u(m),x=u(p),w=s[b],E=s[x];b!==x&&(o.merge(g),w.merge(E),s.splice(x,1))}return o}},Wg=_t({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),Ug={aStar:function(e){var r=this.cy(),n=Wg(e),a=n.root,i=n.goal,s=n.heuristic,o=n.directed,u=n.weight;a=r.collection(a)[0],i=r.collection(i)[0];var l=a.id(),f=i.id(),d={},g={},m={},p=new ja(function(se,j){return g[se.id()]-g[j.id()]}),b=new oa,x={},w={},E=function(j,ee){p.push(j),b.add(ee)},C,k,R=function(){C=p.pop(),k=C.id(),b.delete(k)},A=function(j){return b.has(j)};E(a,l),d[l]=0,g[l]=s(a);for(var h=0;p.size()>0;){if(R(),h++,k===f){for(var I=[],D=i,M=f,L=w[M];I.unshift(D),L!=null&&I.unshift(L),D=x[M],D!=null;)M=D.id(),L=w[M];return{found:!0,distance:d[k],path:this.spawn(I),steps:h}}m[k]=!0;for(var B=C._private.edges,N=0;N<B.length;N++){var _=B[N];if(this.hasElementWithId(_.id())&&!(o&&_.data("source")!==k)){var U=_.source(),H=_.target(),W=U.id()!==k?U:H,X=W.id();if(this.hasElementWithId(X)&&!m[X]){var Q=d[k]+u(_);if(!A(X)){d[X]=Q,g[X]=Q+s(W),E(W,X),x[X]=C,w[X]=_;continue}Q<d[X]&&(d[X]=Q,g[X]=Q+s(W),x[X]=C,w[X]=_)}}}}return{found:!1,distance:void 0,path:void 0,steps:h}}},Gg=_t({weight:function(e){return 1},directed:!1}),Kg={floydWarshall:function(e){for(var r=this.cy(),n=Gg(e),a=n.weight,i=n.directed,s=a,o=this.byGroup(),u=o.nodes,l=o.edges,f=u.length,d=f*f,g=function(de){return u.indexOf(de)},m=function(de){return u[de]},p=new Array(d),b=0;b<d;b++){var x=b%f,w=(b-x)/f;w===x?p[b]=0:p[b]=1/0}for(var E=new Array(d),C=new Array(d),k=0;k<l.length;k++){var R=l[k],A=R.source()[0],h=R.target()[0];if(A!==h){var I=g(A),D=g(h),M=I*f+D,L=s(R);if(p[M]>L&&(p[M]=L,E[M]=D,C[M]=R),!i){var B=D*f+I;!i&&p[B]>L&&(p[B]=L,E[B]=I,C[B]=R)}}}for(var N=0;N<f;N++)for(var _=0;_<f;_++)for(var U=_*f+N,H=0;H<f;H++){var W=_*f+H,X=N*f+H;p[U]+p[X]<p[W]&&(p[W]=p[U]+p[X],E[W]=E[U])}var Q=function(de){return(_e(de)?r.filter(de):de)[0]},se=function(de){return g(Q(de))},j={distance:function(de,ge){var me=se(de),pe=se(ge);return p[me*f+pe]},path:function(de,ge){var me=se(de),pe=se(ge),we=m(me);if(me===pe)return we.collection();if(E[me*f+pe]==null)return r.collection();var be=r.collection(),ae=me,Y;for(be.merge(we);me!==pe;)ae=me,me=E[me*f+pe],Y=C[ae*f+me],be.merge(Y),be.merge(m(me));return be}};return j}},Xg=_t({weight:function(e){return 1},directed:!1,root:null}),Yg={bellmanFord:function(e){var r=this,n=Xg(e),a=n.weight,i=n.directed,s=n.root,o=a,u=this,l=this.cy(),f=this.byGroup(),d=f.edges,g=f.nodes,m=g.length,p=new zr,b=!1,x=[];s=l.collection(s)[0],d.unmergeBy(function(at){return at.isLoop()});for(var w=d.length,E=function(ke){var Ie=p.get(ke.id());return Ie||(Ie={},p.set(ke.id(),Ie)),Ie},C=function(ke){return(_e(ke)?l.$(ke):ke)[0]},k=function(ke){return E(C(ke)).dist},R=function(ke){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,He=C(ke),We=[],Le=He;;){if(Le==null)return r.spawn();var ze=E(Le),Ge=ze.edge,Fe=ze.pred;if(We.unshift(Le[0]),Le.same(Ie)&&We.length>0)break;Ge!=null&&We.unshift(Ge),Le=Fe}return u.spawn(We)},A=0;A<m;A++){var h=g[A],I=E(h);h.same(s)?I.dist=0:I.dist=1/0,I.pred=null,I.edge=null}for(var D=!1,M=function(ke,Ie,He,We,Le,ze){var Ge=We.dist+ze;Ge<Le.dist&&!He.same(We.edge)&&(Le.dist=Ge,Le.pred=ke,Le.edge=He,D=!0)},L=1;L<m;L++){D=!1;for(var B=0;B<w;B++){var N=d[B],_=N.source(),U=N.target(),H=o(N),W=E(_),X=E(U);M(_,U,N,W,X,H),i||M(U,_,N,X,W,H)}if(!D)break}if(D)for(var Q=[],se=0;se<w;se++){var j=d[se],ee=j.source(),de=j.target(),ge=o(j),me=E(ee).dist,pe=E(de).dist;if(me+ge<pe||!i&&pe+ge<me)if(b||(ht("Graph contains a negative weight cycle for Bellman-Ford"),b=!0),e.findNegativeWeightCycles!==!1){var we=[];me+ge<pe&&we.push(ee),!i&&pe+ge<me&&we.push(de);for(var be=we.length,ae=0;ae<be;ae++){var Y=we[ae],oe=[Y];oe.push(E(Y).edge);for(var ye=E(Y).pred;oe.indexOf(ye)===-1;)oe.push(ye),oe.push(E(ye).edge),ye=E(ye).pred;oe=oe.slice(oe.indexOf(ye));for(var De=oe[0].id(),Be=0,Je=2;Je<oe.length;Je+=2)oe[Je].id()<De&&(De=oe[Je].id(),Be=Je);oe=oe.slice(Be).concat(oe.slice(0,Be)),oe.push(oe[0]);var ut=oe.map(function(at){return at.id()}).join(",");Q.indexOf(ut)===-1&&(x.push(u.spawn(oe)),Q.push(ut))}}else break}return{distanceTo:k,pathTo:R,hasNegativeWeightCycle:b,negativeWeightCycles:x}}},Zg=Math.sqrt(2),Qg=function(e,r,n){n.length===0&&St("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],s=a[2],o=r[i],u=r[s],l=n,f=l.length-1;f>=0;f--){var d=l[f],g=d[1],m=d[2];(r[g]===o&&r[m]===u||r[g]===u&&r[m]===o)&&l.splice(f,1)}for(var p=0;p<l.length;p++){var b=l[p];b[1]===u?(l[p]=b.slice(),l[p][1]=o):b[2]===u&&(l[p]=b.slice(),l[p][2]=o)}for(var x=0;x<r.length;x++)r[x]===u&&(r[x]=o);return l},xo=function(e,r,n,a){for(;n>a;){var i=Math.floor(Math.random()*r.length);r=Qg(i,e,r),n--}return r},Jg={kargerStein:function(){var e=this,r=this.byGroup(),n=r.nodes,a=r.edges;a.unmergeBy(function(X){return X.isLoop()});var i=n.length,s=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/Zg);if(i<2){St("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<s;f++){var d=a[f];l.push([f,n.indexOf(d.source()),n.indexOf(d.target())])}for(var g=1/0,m=[],p=new Array(i),b=new Array(i),x=new Array(i),w=function(Q,se){for(var j=0;j<i;j++)se[j]=Q[j]},E=0;E<=o;E++){for(var C=0;C<i;C++)b[C]=C;var k=xo(b,l.slice(),i,u),R=k.slice();w(b,x);var A=xo(b,k,u,2),h=xo(x,R,u,2);A.length<=h.length&&A.length<g?(g=A.length,m=A,w(b,p)):h.length<=A.length&&h.length<g&&(g=h.length,m=h,w(x,p))}for(var I=this.spawn(m.map(function(X){return a[X[0]]})),D=this.spawn(),M=this.spawn(),L=p[0],B=0;B<p.length;B++){var N=p[B],_=n[B];N===L?D.merge(_):M.merge(_)}var U=function(Q){var se=e.spawn();return Q.forEach(function(j){se.merge(j),j.connectedEdges().forEach(function(ee){e.contains(ee)&&!I.contains(ee)&&se.merge(ee)})}),se},H=[U(D),U(M)],W={cut:I,components:H,partition1:D,partition2:M};return W}},jg=function(e){return{x:e.x,y:e.y}},ji=function(e,r,n){return{x:e.x*r+n.x,y:e.y*r+n.y}},_l=function(e,r,n){return{x:(e.x-n.x)/r,y:(e.y-n.y)/r}},ua=function(e){return{x:e[0],y:e[1]}},ep=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a},tp=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=r;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a},rp=function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,s=r;s<n;s++){var o=e[s];isFinite(o)&&(a+=o,i++)}return a/i},np=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(r,n):(n<e.length&&e.splice(n,e.length-n),r>0&&e.splice(0,r));for(var o=0,u=e.length-1;u>=0;u--){var l=e[u];s?isFinite(l)||(e[u]=-1/0,o++):e.splice(u,1)}i&&e.sort(function(g,m){return g-m});var f=e.length,d=Math.floor(f/2);return f%2!==0?e[d+1+o]:(e[d-1+o]+e[d+o])/2},ap=function(e){return Math.PI*e/180},es=function(e,r){return Math.atan2(r,e)-Math.PI/2},Fo=Math.log2||function(t){return Math.log(t)/Math.log(2)},zl=function(e){return e>0?1:e<0?-1:0},Rn=function(e,r){return Math.sqrt(Ln(e,r))},Ln=function(e,r){var n=r.x-e.x,a=r.y-e.y;return n*n+a*a},ip=function(e){for(var r=e.length,n=0,a=0;a<r;a++)n+=e[a];for(var i=0;i<r;i++)e[i]=e[i]/n;return e},zt=function(e,r,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*r+a*a*n},la=function(e,r,n,a){return{x:zt(e.x,r.x,n.x,a),y:zt(e.y,r.y,n.y,a)}},sp=function(e,r,n,a){var i={x:r.x-e.x,y:r.y-e.y},s=Rn(e,r),o={x:i.x/s,y:i.y/s};return n=n??0,a=a??n*s,{x:e.x+o.x*a,y:e.y+o.y*a}},ei=function(e,r,n){return Math.max(e,Math.min(n,r))},fr=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}}},op=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},up=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},lp=function(e,r,n){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+n,y2:e.y2+n,w:e.w,h:e.h}},Vl=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},fp=function(e,r,n){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),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},ts=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},rs=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,s;if(r.length===1)n=a=i=s=r[0];else if(r.length===2)n=i=r[0],s=a=r[1];else if(r.length===4){var o=At(r,4);n=o[0],a=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},$l=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},Eo=function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2<r.x1||r.x2<e.x1||e.y2<r.y1||r.y2<e.y1||e.y1>r.y2||r.y1>e.y2)},fa=function(e,r,n){return e.x1<=r&&r<=e.x2&&e.y1<=n&&n<=e.y2},cp=function(e,r){return fa(e,r.x,r.y)},ql=function(e,r){return fa(e,r.x1,r.y1)&&fa(e,r.x2,r.y2)},Hl=function(e,r,n,a,i,s,o){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?Nn(i,s):u,f=i/2,d=s/2;l=Math.min(l,f,d);var g=l!==f,m=l!==d,p;if(g){var b=n-f+l-o,x=a-d-o,w=n+f-l+o,E=x;if(p=pn(e,r,n,a,b,x,w,E,!1),p.length>0)return p}if(m){var C=n+f+o,k=a-d+l-o,R=C,A=a+d-l+o;if(p=pn(e,r,n,a,C,k,R,A,!1),p.length>0)return p}if(g){var h=n-f+l-o,I=a+d+o,D=n+f-l+o,M=I;if(p=pn(e,r,n,a,h,I,D,M,!1),p.length>0)return p}if(m){var L=n-f-o,B=a-d+l-o,N=L,_=a+d-l+o;if(p=pn(e,r,n,a,L,B,N,_,!1),p.length>0)return p}var U;{var H=n-f+l,W=a-d+l;if(U=ti(e,r,n,a,H,W,l+o),U.length>0&&U[0]<=H&&U[1]<=W)return[U[0],U[1]]}{var X=n+f-l,Q=a-d+l;if(U=ti(e,r,n,a,X,Q,l+o),U.length>0&&U[0]>=X&&U[1]<=Q)return[U[0],U[1]]}{var se=n+f-l,j=a+d-l;if(U=ti(e,r,n,a,se,j,l+o),U.length>0&&U[0]>=se&&U[1]>=j)return[U[0],U[1]]}{var ee=n-f+l,de=a+d-l;if(U=ti(e,r,n,a,ee,de,l+o),U.length>0&&U[0]<=ee&&U[1]>=de)return[U[0],U[1]]}return[]},dp=function(e,r,n,a,i,s,o){var u=o,l=Math.min(n,i),f=Math.max(n,i),d=Math.min(a,s),g=Math.max(a,s);return l-u<=e&&e<=f+u&&d-u<=r&&r<=g+u},vp=function(e,r,n,a,i,s,o,u,l){var f={x1:Math.min(n,o,i)-l,x2:Math.max(n,o,i)+l,y1:Math.min(a,u,s)-l,y2:Math.max(a,u,s)+l};return!(e<f.x1||e>f.x2||r<f.y1||r>f.y2)},hp=function(e,r,n,a){n-=a;var i=r*r-4*e*n;if(i<0)return[];var s=Math.sqrt(i),o=2*e,u=(-r+s)/o,l=(-r-s)/o;return[u,l]},gp=function(e,r,n,a,i){var s=1e-5;e===0&&(e=s),r/=e,n/=e,a/=e;var o,u,l,f,d,g,m,p;if(u=(3*n-r*r)/9,l=-(27*a)+r*(9*n-2*(r*r)),l/=54,o=u*u*u+l*l,i[1]=0,m=r/3,o>0){d=l+Math.sqrt(o),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),g=l-Math.sqrt(o),g=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),i[0]=-m+d+g,m+=(d+g)/2,i[4]=i[2]=-m,m=Math.sqrt(3)*(-g+d)/2,i[3]=m,i[5]=-m;return}if(i[5]=i[3]=0,o===0){p=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-m+2*p,i[4]=i[2]=-(p+m);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),p=2*Math.sqrt(u),i[0]=-m+p*Math.cos(f/3),i[2]=-m+p*Math.cos((f+2*Math.PI)/3),i[4]=-m+p*Math.cos((f+4*Math.PI)/3)},pp=function(e,r,n,a,i,s,o,u){var l=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+a*a-4*a*s+2*a*u+4*s*s-4*s*u+u*u,f=1*9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*a*s-3*a*a-3*a*u-6*s*s+3*s*u,d=1*3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*a*a-6*a*s+a*u-a*r+2*s*s+2*s*r-u*r,g=1*n*i-n*n+n*e-i*e+a*s-a*a+a*r-s*r,m=[];gp(l,f,d,g,m);for(var p=1e-7,b=[],x=0;x<6;x+=2)Math.abs(m[x+1])<p&&m[x]>=0&&m[x]<=1&&b.push(m[x]);b.push(1),b.push(0);for(var w=-1,E,C,k,R=0;R<b.length;R++)E=Math.pow(1-b[R],2)*n+2*(1-b[R])*b[R]*i+b[R]*b[R]*o,C=Math.pow(1-b[R],2)*a+2*(1-b[R])*b[R]*s+b[R]*b[R]*u,k=Math.pow(E-e,2)+Math.pow(C-r,2),w>=0?k<w&&(w=k):w=k;return w},mp=function(e,r,n,a,i,s){var o=[e-n,r-a],u=[i-n,s-a],l=u[0]*u[0]+u[1]*u[1],f=o[0]*o[0]+o[1]*o[1],d=o[0]*u[0]+o[1]*u[1],g=d*d/l;return d<0?f:g>l?(e-i)*(e-i)+(r-s)*(r-s):f-g},cr=function(e,r,n){for(var a,i,s,o,u,l=0,f=0;f<n.length/2;f++)if(a=n[f*2],i=n[f*2+1],f+1<n.length/2?(s=n[(f+1)*2],o=n[(f+1)*2+1]):(s=n[(f+1-n.length/2)*2],o=n[(f+1-n.length/2)*2+1]),!(a==e&&s==e))if(a>=e&&e>=s||a<=e&&e<=s)u=(e-a)/(s-a)*(o-i)+i,u>r&&l++;else continue;return l%2!==0},Jr=function(e,r,n,a,i,s,o,u,l){var f=new Array(n.length),d;u[0]!=null?(d=Math.atan(u[1]/u[0]),u[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=u;for(var g=Math.cos(-d),m=Math.sin(-d),p=0;p<f.length/2;p++)f[p*2]=s/2*(n[p*2]*g-n[p*2+1]*m),f[p*2+1]=o/2*(n[p*2+1]*g+n[p*2]*m),f[p*2]+=a,f[p*2+1]+=i;var b;if(l>0){var x=as(f,-l);b=ns(x)}else b=f;return cr(e,r,b)},yp=function(e,r,n,a,i,s,o,u){for(var l=new Array(n.length*2),f=0;f<u.length;f++){var d=u[f];l[f*4+0]=d.startX,l[f*4+1]=d.startY,l[f*4+2]=d.stopX,l[f*4+3]=d.stopY;var g=Math.pow(d.cx-e,2)+Math.pow(d.cy-r,2);if(g<=Math.pow(d.radius,2))return!0}return cr(e,r,l)},ns=function(e){for(var r=new Array(e.length/2),n,a,i,s,o,u,l,f,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],s=e[d*4+3],d<e.length/4-1?(o=e[(d+1)*4],u=e[(d+1)*4+1],l=e[(d+1)*4+2],f=e[(d+1)*4+3]):(o=e[0],u=e[1],l=e[2],f=e[3]);var g=pn(n,a,i,s,o,u,l,f,!0);r[d*2]=g[0],r[d*2+1]=g[1]}return r},as=function(e,r){for(var n=new Array(e.length*2),a,i,s,o,u=0;u<e.length/2;u++){a=e[u*2],i=e[u*2+1],u<e.length/2-1?(s=e[(u+1)*2],o=e[(u+1)*2+1]):(s=e[0],o=e[1]);var l=o-i,f=-(s-a),d=Math.sqrt(l*l+f*f),g=l/d,m=f/d;n[u*4]=a+g*r,n[u*4+1]=i+m*r,n[u*4+2]=s+g*r,n[u*4+3]=o+m*r}return n},wp=function(e,r,n,a,i,s){var o=n-e,u=a-r;o/=i,u/=s;var l=Math.sqrt(o*o+u*u),f=l-1;if(f<0)return[];var d=f/l;return[(n-e)*d+e,(a-r)*d+r]},On=function(e,r,n,a,i,s,o){return e-=i,r-=s,e/=n/2+o,r/=a/2+o,e*e+r*r<=1},ti=function(e,r,n,a,i,s,o){var u=[n-e,a-r],l=[e-i,r-s],f=u[0]*u[0]+u[1]*u[1],d=2*(l[0]*u[0]+l[1]*u[1]),g=l[0]*l[0]+l[1]*l[1]-o*o,m=d*d-4*f*g;if(m<0)return[];var p=(-d+Math.sqrt(m))/(2*f),b=(-d-Math.sqrt(m))/(2*f),x=Math.min(p,b),w=Math.max(p,b),E=[];if(x>=0&&x<=1&&E.push(x),w>=0&&w<=1&&E.push(w),E.length===0)return[];var C=E[0]*u[0]+e,k=E[0]*u[1]+r;if(E.length>1){if(E[0]==E[1])return[C,k];var R=E[1]*u[0]+e,A=E[1]*u[1]+r;return[C,k,R,A]}else return[C,k]},Co=function(e,r,n){return r<=e&&e<=n||n<=e&&e<=r?e:e<=r&&r<=n||n<=r&&r<=e?r:n},pn=function(e,r,n,a,i,s,o,u,l){var f=e-i,d=n-e,g=o-i,m=r-s,p=a-r,b=u-s,x=g*m-b*f,w=d*m-p*f,E=b*d-g*p;if(E!==0){var C=x/E,k=w/E,R=.001,A=0-R,h=1+R;return A<=C&&C<=h&&A<=k&&k<=h?[e+C*d,r+C*p]:l?[e+C*d,r+C*p]:[]}else return x===0||w===0?Co(e,n,o)===o?[o,u]:Co(e,n,i)===i?[i,s]:Co(i,o,n)===n?[n,a]:[]:[]},ri=function(e,r,n,a,i,s,o,u){var l=[],f,d=new Array(n.length),g=!0;s==null&&(g=!1);var m;if(g){for(var p=0;p<d.length/2;p++)d[p*2]=n[p*2]*s+a,d[p*2+1]=n[p*2+1]*o+i;if(u>0){var b=as(d,-u);m=ns(b)}else m=d}else m=n;for(var x,w,E,C,k=0;k<m.length/2;k++)x=m[k*2],w=m[k*2+1],k<m.length/2-1?(E=m[(k+1)*2],C=m[(k+1)*2+1]):(E=m[0],C=m[1]),f=pn(e,r,a,i,x,w,E,C),f.length!==0&&l.push(f[0],f[1]);return l},bp=function(e,r,n,a,i,s,o,u,l){var f=[],d,g=new Array(n.length*2);l.forEach(function(E,C){C===0?(g[g.length-2]=E.startX,g[g.length-1]=E.startY):(g[C*4-2]=E.startX,g[C*4-1]=E.startY),g[C*4]=E.stopX,g[C*4+1]=E.stopY,d=ti(e,r,a,i,E.cx,E.cy,E.radius),d.length!==0&&f.push(d[0],d[1])});for(var m=0;m<g.length/4;m++)d=pn(e,r,a,i,g[m*4],g[m*4+1],g[m*4+2],g[m*4+3],!1),d.length!==0&&f.push(d[0],d[1]);if(f.length>2){for(var p=[f[0],f[1]],b=Math.pow(p[0]-e,2)+Math.pow(p[1]-r,2),x=1;x<f.length/2;x++){var w=Math.pow(f[x*2]-e,2)+Math.pow(f[x*2+1]-r,2);w<=b&&(p[0]=f[x*2],p[1]=f[x*2+1],b=w)}return p}return f},is=function(e,r,n){var a=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[r[0]+s*a[0],r[1]+s*a[1]]},sr=function(e,r){var n=To(e,r);return n=Wl(n),n},Wl=function(e){for(var r,n,a=e.length/2,i=1/0,s=1/0,o=-1/0,u=-1/0,l=0;l<a;l++)r=e[2*l],n=e[2*l+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,n),u=Math.max(u,n);for(var f=2/(o-i),d=2/(u-s),g=0;g<a;g++)r=e[2*g]=e[2*g]*f,n=e[2*g+1]=e[2*g+1]*d,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,n),u=Math.max(u,n);if(s<-1)for(var m=0;m<a;m++)n=e[2*m+1]=e[2*m+1]+(-1-s);return e},To=function(e,r){var n=1/e*2*Math.PI,a=e%2===0?Math.PI/2+n/2:Math.PI/2;a+=r;for(var i=new Array(e*2),s,o=0;o<e;o++)s=o*n+a,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Nn=function(e,r){return Math.min(e/4,r/4,8)},Ul=function(e,r){return Math.min(e/10,r/10,8)},So=function(){return 8},xp=function(e,r,n){return[e-2*r+n,2*(r-e),e]},Do=function(e,r){return{heightOffset:Math.min(15,.05*r),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}},Fp=_t({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Ep={pageRank:function(e){for(var r=Fp(e),n=r.dampingFactor,a=r.precision,i=r.iterations,s=r.weight,o=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,d=l.length,g=d*d,m=f.length,p=new Array(g),b=new Array(d),x=(1-n)/d,w=0;w<d;w++){for(var E=0;E<d;E++){var C=w*d+E;p[C]=0}b[w]=0}for(var k=0;k<m;k++){var R=f[k],A=R.data("source"),h=R.data("target");if(A!==h){var I=l.indexOfId(A),D=l.indexOfId(h),M=s(R),L=D*d+I;p[L]+=M,b[I]+=M}}for(var B=1/d+x,N=0;N<d;N++)if(b[N]===0)for(var _=0;_<d;_++){var U=_*d+N;p[U]=B}else for(var H=0;H<d;H++){var W=H*d+N;p[W]=p[W]/b[N]+x}for(var X=new Array(d),Q=new Array(d),se,j=0;j<d;j++)X[j]=1;for(var ee=0;ee<i;ee++){for(var de=0;de<d;de++)Q[de]=0;for(var ge=0;ge<d;ge++)for(var me=0;me<d;me++){var pe=ge*d+me;Q[ge]+=p[pe]*X[me]}ip(Q),se=X,X=Q,Q=se;for(var we=0,be=0;be<d;be++){var ae=se[be]-X[be];we+=ae*ae}if(we<a)break}var Y={rank:function(ye){return ye=o.collection(ye)[0],X[l.indexOf(ye)]}};return Y}},Gl=_t({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ca={degreeCentralityNormalized:function(e){e=Gl(e);var r=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var f={},d={},g=0,m=0,p=0;p<a;p++){var b=n[p],x=b.id();e.root=b;var w=this.degreeCentrality(e);g<w.indegree&&(g=w.indegree),m<w.outdegree&&(m=w.outdegree),f[x]=w.indegree,d[x]=w.outdegree}return{indegree:function(C){return g==0?0:(_e(C)&&(C=r.filter(C)),f[C.id()]/g)},outdegree:function(C){return m===0?0:(_e(C)&&(C=r.filter(C)),d[C.id()]/m)}}}else{for(var i={},s=0,o=0;o<a;o++){var u=n[o];e.root=u;var l=this.degreeCentrality(e);s<l.degree&&(s=l.degree),i[u.id()]=l.degree}return{degree:function(C){return s===0?0:(_e(C)&&(C=r.filter(C)),i[C.id()]/s)}}}},degreeCentrality:function(e){e=Gl(e);var r=this.cy(),n=this,a=e,i=a.root,s=a.weight,o=a.directed,u=a.alpha;if(i=r.collection(i)[0],o){for(var m=i.connectedEdges(),p=m.filter(function(A){return A.target().same(i)&&n.has(A)}),b=m.filter(function(A){return A.source().same(i)&&n.has(A)}),x=p.length,w=b.length,E=0,C=0,k=0;k<p.length;k++)E+=s(p[k]);for(var R=0;R<b.length;R++)C+=s(b[R]);return{indegree:Math.pow(x,1-u)*Math.pow(E,u),outdegree:Math.pow(w,1-u)*Math.pow(C,u)}}else{for(var l=i.connectedEdges().intersection(n),f=l.length,d=0,g=0;g<l.length;g++)d+=s(l[g]);return{degree:Math.pow(f,1-u)*Math.pow(d,u)}}}};ca.dc=ca.degreeCentrality,ca.dcn=ca.degreeCentralityNormalised=ca.degreeCentralityNormalized;var Kl=_t({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),da={closenessCentralityNormalized:function(e){for(var r=Kl(e),n=r.harmonic,a=r.weight,i=r.directed,s=this.cy(),o={},u=0,l=this.nodes(),f=this.floydWarshall({weight:a,directed:i}),d=0;d<l.length;d++){for(var g=0,m=l[d],p=0;p<l.length;p++)if(d!==p){var b=f.distance(m,l[p]);n?g+=1/b:g+=b}n||(g=1/g),u<g&&(u=g),o[m.id()]=g}return{closeness:function(w){return u==0?0:(_e(w)?w=s.filter(w)[0].id():w=w.id(),o[w]/u)}}},closenessCentrality:function(e){var r=Kl(e),n=r.root,a=r.weight,i=r.directed,s=r.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:a,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var d=l[f];if(!d.same(n)){var g=o.distanceTo(d);s?u+=1/g:u+=g}}return s?u:1/u}};da.cc=da.closenessCentrality,da.ccn=da.closenessCentralityNormalised=da.closenessCentralityNormalized;var Cp=_t({weight:null,directed:!1}),ko={betweennessCentrality:function(e){for(var r=Cp(e),n=r.directed,a=r.weight,i=a!=null,s=this.cy(),o=this.nodes(),u={},l={},f=0,d={set:function(C,k){l[C]=k,k>f&&(f=k)},get:function(C){return l[C]}},g=0;g<o.length;g++){var m=o[g],p=m.id();n?u[p]=m.outgoers().nodes():u[p]=m.openNeighborhood().nodes(),d.set(p,0)}for(var b=function(C){for(var k=o[C].id(),R=[],A={},h={},I={},D=new ja(function(me,pe){return I[me]-I[pe]}),M=0;M<o.length;M++){var L=o[M].id();A[L]=[],h[L]=0,I[L]=1/0}for(h[k]=1,I[k]=0,D.push(k);!D.empty();){var B=D.pop();if(R.push(B),i)for(var N=0;N<u[B].length;N++){var _=u[B][N],U=s.getElementById(B),H=void 0;U.edgesTo(_).length>0?H=U.edgesTo(_)[0]:H=_.edgesTo(U)[0];var W=a(H);_=_.id(),I[_]>I[B]+W&&(I[_]=I[B]+W,D.nodes.indexOf(_)<0?D.push(_):D.updateItem(_),h[_]=0,A[_]=[]),I[_]==I[B]+W&&(h[_]=h[_]+h[B],A[_].push(B))}else for(var X=0;X<u[B].length;X++){var Q=u[B][X].id();I[Q]==1/0&&(D.push(Q),I[Q]=I[B]+1),I[Q]==I[B]+1&&(h[Q]=h[Q]+h[B],A[Q].push(B))}}for(var se={},j=0;j<o.length;j++)se[o[j].id()]=0;for(;R.length>0;){for(var ee=R.pop(),de=0;de<A[ee].length;de++){var ge=A[ee][de];se[ge]=se[ge]+h[ge]/h[ee]*(1+se[ee])}ee!=o[C].id()&&d.set(ee,d.get(ee)+se[ee])}},x=0;x<o.length;x++)b(x);var w={betweenness:function(C){var k=s.collection(C).id();return d.get(k)},betweennessNormalized:function(C){if(f==0)return 0;var k=s.collection(C).id();return d.get(k)/f}};return w.betweennessNormalised=w.betweennessNormalized,w}};ko.bc=ko.betweennessCentrality;var Tp=_t({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),Sp=function(e){return Tp(e)},Dp=function(e,r){for(var n=0,a=0;a<r.length;a++)n+=r[a](e);return n},kp=function(e,r,n){for(var a=0;a<r;a++)e[a*r+a]=n},Xl=function(e,r){for(var n,a=0;a<r;a++){n=0;for(var i=0;i<r;i++)n+=e[i*r+a];for(var s=0;s<r;s++)e[s*r+a]=e[s*r+a]/n}},Pp=function(e,r,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var s=0;s<n;s++)a[i*n+s]=0;for(var o=0;o<n;o++)for(var u=0;u<n;u++)a[i*n+u]+=e[i*n+o]*r[o*n+u]}return a},Ap=function(e,r,n){for(var a=e.slice(0),i=1;i<n;i++)e=Pp(e,a,r);return e},Bp=function(e,r,n){for(var a=new Array(r*r),i=0;i<r*r;i++)a[i]=Math.pow(e[i],n);return Xl(a,r),a},Ip=function(e,r,n,a){for(var i=0;i<n;i++){var s=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),o=Math.round(r[i]*Math.pow(10,a))/Math.pow(10,a);if(s!==o)return!1}return!0},Mp=function(e,r,n,a){for(var i=[],s=0;s<r;s++){for(var o=[],u=0;u<r;u++)Math.round(e[s*r+u]*1e3)/1e3>0&&o.push(n[u]);o.length!==0&&i.push(a.collection(o))}return i},Rp=function(e,r){for(var n=0;n<e.length;n++)if(!r[n]||e[n].id()!==r[n].id())return!1;return!0},Lp=function(e){for(var r=0;r<e.length;r++)for(var n=0;n<e.length;n++)r!=n&&Rp(e[r],e[n])&&e.splice(n,1);return e},Yl=function(e){for(var r=this.nodes(),n=this.edges(),a=this.cy(),i=Sp(e),s={},o=0;o<r.length;o++)s[r[o].id()]=o;for(var u=r.length,l=u*u,f=new Array(l),d,g=0;g<l;g++)f[g]=0;for(var m=0;m<n.length;m++){var p=n[m],b=s[p.source().id()],x=s[p.target().id()],w=Dp(p,i.attributes);f[b*u+x]+=w,f[x*u+b]+=w}kp(f,u,i.multFactor),Xl(f,u);for(var E=!0,C=0;E&&C<i.maxIterations;)E=!1,d=Ap(f,u,i.expandFactor),f=Bp(d,u,i.inflateFactor),Ip(f,d,l,4)||(E=!0),C++;var k=Mp(f,u,r,a);return k=Lp(k),k},Op={markovClustering:Yl,mcl:Yl},Np=function(e){return e},Zl=function(e,r){return Math.abs(r-e)},Ql=function(e,r,n){return e+Zl(r,n)},Jl=function(e,r,n){return e+Math.pow(n-r,2)},_p=function(e){return Math.sqrt(e)},zp=function(e,r,n){return Math.max(e,Zl(r,n))},ni=function(e,r,n,a,i){for(var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Np,o=a,u,l,f=0;f<e;f++)u=r(f),l=n(f),o=i(o,u,l);return s(o)},va={euclidean:function(e,r,n){return e>=2?ni(e,r,n,0,Jl,_p):ni(e,r,n,0,Ql)},squaredEuclidean:function(e,r,n){return ni(e,r,n,0,Jl)},manhattan:function(e,r,n){return ni(e,r,n,0,Ql)},max:function(e,r,n){return ni(e,r,n,-1/0,zp)}};va["squared-euclidean"]=va.squaredEuclidean,va.squaredeuclidean=va.squaredEuclidean;function ss(t,e,r,n,a,i){var s;return Tt(t)?s=t:s=va[t]||va.euclidean,e===0&&Tt(t)?s(a,i):s(e,r,n,a,i)}var Vp=_t({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Po=function(e){return Vp(e)},os=function(e,r,n,a,i){var s=i!=="kMedoids",o=s?function(d){return n[d]}:function(d){return a[d](n)},u=function(g){return a[g](r)},l=n,f=r;return ss(e,a.length,o,u,l,f)},Ao=function(e,r,n){for(var a=n.length,i=new Array(a),s=new Array(a),o=new Array(r),u=null,l=0;l<a;l++)i[l]=e.min(n[l]).value,s[l]=e.max(n[l]).value;for(var f=0;f<r;f++){u=[];for(var d=0;d<a;d++)u[d]=Math.random()*(s[d]-i[d])+i[d];o[f]=u}return o},jl=function(e,r,n,a,i){for(var s=1/0,o=0,u=0;u<r.length;u++){var l=os(n,e,r[u],a,i);l<s&&(s=l,o=u)}return o},ef=function(e,r,n){for(var a=[],i=null,s=0;s<r.length;s++)i=r[s],n[i.id()]===e&&a.push(i);return a},$p=function(e,r,n){return Math.abs(r-e)<=n},qp=function(e,r,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var s=Math.abs(e[a][i]-r[a][i]);if(s>n)return!1}return!0},Hp=function(e,r,n){for(var a=0;a<n;a++)if(e===r[a])return!0;return!1},tf=function(e,r){var n=new Array(r);if(e.length<50)for(var a=0;a<r;a++){for(var i=e[Math.floor(Math.random()*e.length)];Hp(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<r;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},rf=function(e,r,n){for(var a=0,i=0;i<r.length;i++)a+=os("manhattan",r[i],e,n,"kMedoids");return a},Wp=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Po(e),s=new Array(i.k),o={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=Ao(n,i.k,i.attributes)):It(i.testCentroids)==="object"?u=i.testCentroids:u=Ao(n,i.k,i.attributes):u=Ao(n,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],o[a.id()]=jl(a,u,i.distance,i.attributes,"kMeans");l=!1;for(var g=0;g<i.k;g++){var m=ef(g,n,o);if(m.length!==0){for(var p=i.attributes.length,b=u[g],x=new Array(p),w=new Array(p),E=0;E<p;E++){w[E]=0;for(var C=0;C<m.length;C++)a=m[C],w[E]+=i.attributes[E](a);x[E]=w[E]/m.length,$p(x[E],b[E],i.sensitivityThreshold)||(l=!0)}u[g]=x,s[g]=r.collection(m)}}f++}return s},Up=function(e){var r=this.cy(),n=this.nodes(),a=null,i=Po(e),s=new Array(i.k),o,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(It(i.testCentroids)==="object"?o=i.testCentroids:o=tf(n,i.k)):o=tf(n,i.k);for(var d=!0,g=0;d&&g<i.maxIterations;){for(var m=0;m<n.length;m++)a=n[m],u[a.id()]=jl(a,o,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<o.length;p++){var b=ef(p,n,u);if(b.length!==0){f[p]=rf(o[p],b,i.attributes);for(var x=0;x<b.length;x++)l=rf(b[x],b,i.attributes),l<f[p]&&(f[p]=l,o[p]=b[x],d=!0);s[p]=r.collection(b)}}g++}return s},Gp=function(e,r,n,a,i){for(var s,o,u=0;u<r.length;u++)for(var l=0;l<e.length;l++)a[u][l]=Math.pow(n[u][l],i.m);for(var f=0;f<e.length;f++)for(var d=0;d<i.attributes.length;d++){s=0,o=0;for(var g=0;g<r.length;g++)s+=a[g][f]*i.attributes[d](r[g]),o+=a[g][f];e[f][d]=s/o}},Kp=function(e,r,n,a,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();for(var o,u,l,f=2/(i.m-1),d=0;d<n.length;d++)for(var g=0;g<a.length;g++){o=0;for(var m=0;m<n.length;m++)u=os(i.distance,a[g],n[d],i.attributes,"cmeans"),l=os(i.distance,a[g],n[m],i.attributes,"cmeans"),o+=Math.pow(u/l,f);e[g][d]=1/o}},Xp=function(e,r,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var o,u,l=0;l<r.length;l++){o=-1/0,u=-1;for(var f=0;f<r[0].length;f++)r[l][f]>o&&(o=r[l][f],u=f);i[u].push(e[l])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i},nf=function(e){var r=this.cy(),n=this.nodes(),a=Po(e),i,s,o,u,l;u=new Array(n.length);for(var f=0;f<n.length;f++)u[f]=new Array(a.k);o=new Array(n.length);for(var d=0;d<n.length;d++)o[d]=new Array(a.k);for(var g=0;g<n.length;g++){for(var m=0,p=0;p<a.k;p++)o[g][p]=Math.random(),m+=o[g][p];for(var b=0;b<a.k;b++)o[g][b]=o[g][b]/m}s=new Array(a.k);for(var x=0;x<a.k;x++)s[x]=new Array(a.attributes.length);l=new Array(n.length);for(var w=0;w<n.length;w++)l[w]=new Array(a.k);for(var E=!0,C=0;E&&C<a.maxIterations;)E=!1,Gp(s,n,o,l,a),Kp(o,u,s,n,a),qp(o,u,a.sensitivityThreshold)||(E=!0),C++;return i=Xp(n,o,a,r),{clusters:i,degreeOfMembership:o}},Yp={kMeans:Wp,kMedoids:Up,fuzzyCMeans:nf,fcm:nf},Zp=_t({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Qp={single:"min",complete:"max"},Jp=function(e){var r=Zp(e),n=Qp[r.linkage];return n!=null&&(r.linkage=n),r},af=function(e,r,n,a,i){for(var s=0,o=1/0,u,l=i.attributes,f=function(D,M){return ss(i.distance,l.length,function(L){return l[L](D)},function(L){return l[L](M)},D,M)},d=0;d<e.length;d++){var g=e[d].key,m=n[g][a[g]];m<o&&(s=g,o=m)}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=r[s],b=r[a[s]],x;i.mode==="dendrogram"?x={left:p,right:b,key:p.key}:x={value:p.value.concat(b.value),key:p.key},e[p.index]=x,e.splice(b.index,1),r[p.key]=x;for(var w=0;w<e.length;w++){var E=e[w];p.key===E.key?u=1/0:i.linkage==="min"?(u=n[p.key][E.key],n[p.key][E.key]>n[b.key][E.key]&&(u=n[b.key][E.key])):i.linkage==="max"?(u=n[p.key][E.key],n[p.key][E.key]<n[b.key][E.key]&&(u=n[b.key][E.key])):i.linkage==="mean"?u=(n[p.key][E.key]*p.size+n[b.key][E.key]*b.size)/(p.size+b.size):i.mode==="dendrogram"?u=f(E.value,p.value):u=f(E.value[0],p.value[0]),n[p.key][E.key]=n[E.key][p.key]=u}for(var C=0;C<e.length;C++){var k=e[C].key;if(a[k]===p.key||a[k]===b.key){for(var R=k,A=0;A<e.length;A++){var h=e[A].key;n[k][h]<n[k][R]&&(R=h)}a[k]=R}e[C].index=C}return p.key=b.key=p.index=b.index=null,!0},us=function t(e,r,n){e&&(e.value?r.push(e.value):(e.left&&t(e.left,r),e.right&&t(e.right,r)))},jp=function t(e,r){if(!e)return"";if(e.left&&e.right){var n=t(e.left,r),a=t(e.right,r),i=r.add({group:"nodes",data:{id:n+","+a}});return r.add({group:"edges",data:{source:n,target:i.id()}}),r.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},e0=function t(e,r,n){if(!e)return[];var a=[],i=[],s=[];return r===0?(e.left&&us(e.left,a),e.right&&us(e.right,i),s=a.concat(i),[n.collection(s)]):r===1?e.value?[n.collection(e.value)]:(e.left&&us(e.left,a),e.right&&us(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=t(e.left,r-1,n)),e.right&&(i=t(e.right,r-1,n)),a.concat(i))},sf=function(e){for(var r=this.cy(),n=this.nodes(),a=Jp(e),i=a.attributes,s=function(C,k){return ss(a.distance,i.length,function(R){return i[R](C)},function(R){return i[R](k)},C,k)},o=[],u=[],l=[],f=[],d=0;d<n.length;d++){var g={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};o[d]=g,f[d]=g,u[d]=[],l[d]=0}for(var m=0;m<o.length;m++)for(var p=0;p<=m;p++){var b=void 0;a.mode==="dendrogram"?b=m===p?1/0:s(o[m].value,o[p].value):b=m===p?1/0:s(o[m].value[0],o[p].value[0]),u[m][p]=b,u[p][m]=b,b<u[m][l[m]]&&(l[m]=p)}for(var x=af(o,f,u,l,a);x;)x=af(o,f,u,l,a);var w;return a.mode==="dendrogram"?(w=e0(o[0],a.dendrogramDepth,r),a.addDendrogram&&jp(o[0],r)):(w=new Array(o.length),o.forEach(function(E,C){E.key=E.index=null,w[C]=r.collection(E.value)})),w},t0={hierarchicalClustering:sf,hca:sf},r0=_t({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),n0=function(e){var r=e.damping,n=e.preference;.5<=r&&r<1||St("Damping must range on [0.5, 1).  Got: ".concat(r));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||Se(n)||St("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number.  Got: ").concat(n)),r0(e)},a0=function(e,r,n,a){var i=function(o,u){return a[u](o)};return-ss(e,a.length,function(s){return i(r,s)},function(s){return i(n,s)},r,n)},i0=function(e,r){var n=null;return r==="median"?n=np(e):r==="mean"?n=rp(e):r==="min"?n=ep(e):r==="max"?n=tp(e):n=r,n},s0=function(e,r,n){for(var a=[],i=0;i<e;i++)r[i*e+i]+n[i*e+i]>0&&a.push(i);return a},of=function(e,r,n){for(var a=[],i=0;i<e;i++){for(var s=-1,o=-1/0,u=0;u<n.length;u++){var l=n[u];r[i*e+l]>o&&(s=l,o=r[i*e+l])}s>0&&a.push(s)}for(var f=0;f<n.length;f++)a[n[f]]=n[f];return a},o0=function(e,r,n){for(var a=of(e,r,n),i=0;i<n.length;i++){for(var s=[],o=0;o<a.length;o++)a[o]===n[i]&&s.push(o);for(var u=-1,l=-1/0,f=0;f<s.length;f++){for(var d=0,g=0;g<s.length;g++)d+=r[s[g]*e+s[f]];d>l&&(u=f,l=d)}n[i]=s[u]}return a=of(e,r,n),a},uf=function(e){for(var r=this.cy(),n=this.nodes(),a=n0(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var o,u,l,f,d,g;o=n.length,u=o*o,l=new Array(u);for(var m=0;m<u;m++)l[m]=-1/0;for(var p=0;p<o;p++)for(var b=0;b<o;b++)p!==b&&(l[p*o+b]=a0(a.distance,n[p],n[b],a.attributes));f=i0(l,a.preference);for(var x=0;x<o;x++)l[x*o+x]=f;d=new Array(u);for(var w=0;w<u;w++)d[w]=0;g=new Array(u);for(var E=0;E<u;E++)g[E]=0;for(var C=new Array(o),k=new Array(o),R=new Array(o),A=0;A<o;A++)C[A]=0,k[A]=0,R[A]=0;for(var h=new Array(o*a.minIterations),I=0;I<h.length;I++)h[I]=0;var D;for(D=0;D<a.maxIterations;D++){for(var M=0;M<o;M++){for(var L=-1/0,B=-1/0,N=-1,_=0,U=0;U<o;U++)C[U]=d[M*o+U],_=g[M*o+U]+l[M*o+U],_>=L?(B=L,L=_,N=U):_>B&&(B=_);for(var H=0;H<o;H++)d[M*o+H]=(1-a.damping)*(l[M*o+H]-L)+a.damping*C[H];d[M*o+N]=(1-a.damping)*(l[M*o+N]-B)+a.damping*C[N]}for(var W=0;W<o;W++){for(var X=0,Q=0;Q<o;Q++)C[Q]=g[Q*o+W],k[Q]=Math.max(0,d[Q*o+W]),X+=k[Q];X-=k[W],k[W]=d[W*o+W],X+=k[W];for(var se=0;se<o;se++)g[se*o+W]=(1-a.damping)*Math.min(0,X-k[se])+a.damping*C[se];g[W*o+W]=(1-a.damping)*(X-k[W])+a.damping*C[W]}for(var j=0,ee=0;ee<o;ee++){var de=g[ee*o+ee]+d[ee*o+ee]>0?1:0;h[D%a.minIterations*o+ee]=de,j+=de}if(j>0&&(D>=a.minIterations-1||D==a.maxIterations-1)){for(var ge=0,me=0;me<o;me++){R[me]=0;for(var pe=0;pe<a.minIterations;pe++)R[me]+=h[pe*o+me];(R[me]===0||R[me]===a.minIterations)&&ge++}if(ge===o)break}}for(var we=s0(o,d,g),be=o0(o,l,we),ae={},Y=0;Y<we.length;Y++)ae[we[Y]]=[];for(var oe=0;oe<n.length;oe++){var ye=i[n[oe].id()],De=be[ye];De!=null&&ae[De].push(n[oe])}for(var Be=new Array(we.length),Je=0;Je<we.length;Je++)Be[Je]=r.collection(ae[we[Je]]);return Be},u0={affinityPropagation:uf,ap:uf},l0=_t({root:void 0,directed:!1}),f0={hierholzer:function(e){if(!st(e)){var r=arguments;e={root:r[0],directed:r[1]}}var n=l0(e),a=n.root,i=n.directed,s=this,o=!1,u,l,f;a&&(f=_e(a)?this.filter(a)[0].id():a[0].id());var d={},g={};i?s.forEach(function(E){var C=E.id();if(E.isNode()){var k=E.indegree(!0),R=E.outdegree(!0),A=k-R,h=R-k;A==1?u?o=!0:u=C:h==1?l?o=!0:l=C:(h>1||A>1)&&(o=!0),d[C]=[],E.outgoers().forEach(function(I){I.isEdge()&&d[C].push(I.id())})}else g[C]=[void 0,E.target().id()]}):s.forEach(function(E){var C=E.id();if(E.isNode()){var k=E.degree(!0);k%2&&(u?l?o=!0:l=C:u=C),d[C]=[],E.connectedEdges().forEach(function(R){return d[C].push(R.id())})}else g[C]=[E.source().id(),E.target().id()]});var m={found:!1,trail:void 0};if(o)return m;if(l&&u)if(i){if(f&&l!=f)return m;f=l}else{if(f&&l!=f&&u!=f)return m;f||(f=l)}else f||(f=s[0].id());var p=function(C){for(var k=C,R=[C],A,h,I;d[k].length;)A=d[k].shift(),h=g[A][0],I=g[A][1],k!=I?(d[I]=d[I].filter(function(D){return D!=A}),k=I):!i&&k!=h&&(d[h]=d[h].filter(function(D){return D!=A}),k=h),R.unshift(A),R.unshift(k);return R},b=[],x=[];for(x=p(f);x.length!=1;)d[x[0]].length==0?(b.unshift(s.getElementById(x.shift())),b.unshift(s.getElementById(x.shift()))):x=p(x.shift()).concat(x);b.unshift(s.getElementById(x.shift()));for(var w in d)if(d[w].length)return m;return m.found=!0,m.trail=this.spawn(b,!0),m}},ls=function(){var e=this,r={},n=0,a=0,i=[],s=[],o={},u=function(g,m){for(var p=s.length-1,b=[],x=e.spawn();s[p].x!=g||s[p].y!=m;)b.push(s.pop().edge),p--;b.push(s.pop().edge),b.forEach(function(w){var E=w.connectedNodes().intersection(e);x.merge(w),E.forEach(function(C){var k=C.id(),R=C.connectedEdges().intersection(e);x.merge(C),r[k].cutVertex?x.merge(R.filter(function(A){return A.isLoop()})):x.merge(R)})}),i.push(x)},l=function d(g,m,p){g===p&&(a+=1),r[m]={id:n,low:n++,cutVertex:!1};var b=e.getElementById(m).connectedEdges().intersection(e);if(b.size()===0)i.push(e.spawn(e.getElementById(m)));else{var x,w,E,C;b.forEach(function(k){x=k.source().id(),w=k.target().id(),E=x===m?w:x,E!==p&&(C=k.id(),o[C]||(o[C]=!0,s.push({x:m,y:E,edge:k})),E in r?r[m].low=Math.min(r[m].low,r[E].id):(d(g,E,m),r[m].low=Math.min(r[m].low,r[E].low),r[m].id<=r[E].low&&(r[m].cutVertex=!0,u(m,E))))})}};e.forEach(function(d){if(d.isNode()){var g=d.id();g in r||(a=0,l(g,g),r[g].cutVertex=a>1)}});var f=Object.keys(r).filter(function(d){return r[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(f),components:i}},c0={hopcroftTarjanBiconnected:ls,htbc:ls,htb:ls,hopcroftTarjanBiconnectedComponents:ls},fs=function(){var e=this,r={},n=0,a=[],i=[],s=e.spawn(e),o=function u(l){i.push(l),r[l]={index:n,low:n++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(b){var x=b.target().id();x!==l&&(x in r||u(x),r[x].explored||(r[l].low=Math.min(r[l].low,r[x].low)))}),r[l].index===r[l].low){for(var d=e.spawn();;){var g=i.pop();if(d.merge(e.getElementById(g)),r[g].low=r[l].index,r[g].explored=!0,g===l)break}var m=d.edgesWith(d),p=d.merge(m);a.push(p),s=s.difference(p)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in r||o(l)}}),{cut:s,components:a}},d0={tarjanStronglyConnected:fs,tsc:fs,tscc:fs,tarjanStronglyConnectedComponents:fs},lf={};[Ja,qg,Hg,Ug,Kg,Yg,Jg,Ep,ca,da,ko,Op,Yp,t0,u0,f0,c0,d0].forEach(function(t){Ve(lf,t)});/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/var ff=0,cf=1,df=2,jr=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=ff,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};jr.prototype={fulfill:function(e){return vf(this,cf,"fulfillValue",e)},reject:function(e){return vf(this,df,"rejectReason",e)},then:function(e,r){var n=this,a=new jr;return n.onFulfilled.push(pf(e,a,"fulfill")),n.onRejected.push(pf(r,a,"reject")),hf(n),a.proxy}};var vf=function(e,r,n,a){return e.state===ff&&(e.state=r,e[n]=a,hf(e)),e},hf=function(e){e.state===cf?gf(e,"onFulfilled",e.fulfillValue):e.state===df&&gf(e,"onRejected",e.rejectReason)},gf=function(e,r,n){if(e[r].length!==0){var a=e[r];e[r]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},pf=function(e,r,n){return function(a){if(typeof e!="function")r[n].call(r,a);else{var i;try{i=e(a)}catch(s){r.reject(s);return}v0(r,i)}}},v0=function t(e,r){if(e===r||e.proxy===r){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(It(r)==="object"&&r!==null||typeof r=="function")try{n=r.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(r,function(i){a||(a=!0,i===r?e.reject(new TypeError("circular thenable chain")):t(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(r)};jr.all=function(t){return new jr(function(e,r){for(var n=new Array(t.length),a=0,i=function(u,l){n[u]=l,a++,a===t.length&&e(n)},s=0;s<t.length;s++)(function(o){var u=t[o],l=u!=null&&u.then!=null;if(l)u.then(function(d){i(o,d)},function(d){r(d)});else{var f=u;i(o,f)}})(s)})},jr.resolve=function(t){return new jr(function(e,r){e(t)})},jr.reject=function(t){return new jr(function(e,r){r(t)})};var ha=typeof Promise<"u"?Promise:jr,Bo=function(e,r,n){var a=ho(e),i=!a,s=this._private=Ve({duration:1e3},r,n);if(s.target=e,s.style=s.style||s.css,s.started=!1,s.playing=!1,s.hooked=!1,s.applying=!1,s.progress=0,s.completes=[],s.frames=[],s.complete&&Tt(s.complete)&&s.completes.push(s.complete),i){var o=e.position();s.startPosition=s.startPosition||{x:o.x,y:o.y},s.startStyle=s.startStyle||e.cy().style().getAnimationStartStyle(e,s.style)}if(a){var u=e.pan();s.startPan={x:u.x,y:u.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},_n=Bo.prototype;Ve(_n,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var r,n=e.target._private.animation;e.queue?r=n.queue:r=n.current,r.push(this),br(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 r=this._private;return e===void 0?r.progress*r.duration:this.progress(e/r.duration)},progress:function(e){var r=this._private,n=r.playing;return e===void 0?r.progress:(n&&this.pause(),r.progress=e,r.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,r=e.playing;r&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(l,f){var d=e[l];d!=null&&(e[l]=e[f],e[f]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],s=i.name,o=e.startStyle[s];e.startStyle[s]=i,e.style[a]=o}return r&&this.play(),this},promise:function(e){var r=this._private,n;switch(e){case"frame":n=r.frames;break;default:case"complete":case"completed":n=r.completes}return new ha(function(a,i){n.push(function(){a()})})}}),_n.complete=_n.completed,_n.run=_n.play,_n.running=_n.playing;var h0={animated:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return!1;var s=a[0];if(s)return s._private.animation.current.length>0}},clearQueue:function(){return function(){var r=this,n=r.length!==void 0,a=n?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s<a.length;s++){var o=a[s];o._private.animation.queue=[]}return this}},delay:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:r,duration:r,complete:n}):this}},delayAnimation:function(){return function(r,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:r,duration:r,complete:n}):this}},animation:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this,u=!i,l=!u;if(!o.styleEnabled())return this;var f=o.style();r=Ve({},r,n);var d=Object.keys(r).length===0;if(d)return new Bo(s[0],r);switch(r.duration===void 0&&(r.duration=400),r.duration){case"slow":r.duration=600;break;case"fast":r.duration=200;break}if(l&&(r.style=f.getPropsList(r.style||r.css),r.css=void 0),l&&r.renderedPosition!=null){var g=r.renderedPosition,m=o.pan(),p=o.zoom();r.position=_l(g,p,m)}if(u&&r.panBy!=null){var b=r.panBy,x=o.pan();r.pan={x:x.x+b.x,y:x.y+b.y}}var w=r.center||r.centre;if(u&&w!=null){var E=o.getCenterPan(w.eles,r.zoom);E!=null&&(r.pan=E)}if(u&&r.fit!=null){var C=r.fit,k=o.getFitViewport(C.eles||C.boundingBox,C.padding);k!=null&&(r.pan=k.pan,r.zoom=k.zoom)}if(u&&st(r.zoom)){var R=o.getZoomedViewport(r.zoom);R!=null?(R.zoomed&&(r.zoom=R.zoom),R.panned&&(r.pan=R.pan)):r.zoom=null}return new Bo(s[0],r)}},animate:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;n&&(r=Ve({},r,n));for(var u=0;u<s.length;u++){var l=s[u],f=l.animated()&&(r.queue===void 0||r.queue),d=l.animation(r,f?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(r,n){var a=this,i=a.length!==void 0,s=i?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var u=0;u<s.length;u++){for(var l=s[u],f=l._private,d=f.animation.current,g=0;g<d.length;g++){var m=d[g],p=m._private;n&&(p.duration=0)}r&&(f.animation.queue=[]),n||(f.animation.current=[])}return o.notify("draw"),this}}},g0=Array.isArray,cs=g0,p0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,m0=/^\w*$/;function y0(t,e){if(cs(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Ka(t)?!0:m0.test(t)||!p0.test(t)||e!=null&&t in Object(e)}var w0=y0,b0="[object AsyncFunction]",x0="[object Function]",F0="[object GeneratorFunction]",E0="[object Proxy]";function C0(t){if(!Mn(t))return!1;var e=Cl(t);return e==x0||e==F0||e==b0||e==E0}var T0=C0,S0=Xi["__core-js_shared__"],Io=S0,mf=function(){var t=/[^.]+$/.exec(Io&&Io.keys&&Io.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function D0(t){return!!mf&&mf in t}var k0=D0,P0=Function.prototype,A0=P0.toString;function B0(t){if(t!=null){try{return A0.call(t)}catch{}try{return t+""}catch{}}return""}var I0=B0,M0=/[\\^$.*+?()[\]{}|]/g,R0=/^\[object .+?Constructor\]$/,L0=Function.prototype,O0=Object.prototype,N0=L0.toString,_0=O0.hasOwnProperty,z0=RegExp("^"+N0.call(_0).replace(M0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function V0(t){if(!Mn(t)||k0(t))return!1;var e=T0(t)?z0:R0;return e.test(I0(t))}var $0=V0;function q0(t,e){return t==null?void 0:t[e]}var H0=q0;function W0(t,e){var r=H0(t,e);return $0(r)?r:void 0}var Mo=W0,U0=Mo(Object,"create"),ai=U0;function G0(){this.__data__=ai?ai(null):{},this.size=0}var K0=G0;function X0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Y0=X0,Z0="__lodash_hash_undefined__",Q0=Object.prototype,J0=Q0.hasOwnProperty;function j0(t){var e=this.__data__;if(ai){var r=e[t];return r===Z0?void 0:r}return J0.call(e,t)?e[t]:void 0}var em=j0,tm=Object.prototype,rm=tm.hasOwnProperty;function nm(t){var e=this.__data__;return ai?e[t]!==void 0:rm.call(e,t)}var am=nm,im="__lodash_hash_undefined__";function sm(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=ai&&e===void 0?im:e,this}var om=sm;function ga(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ga.prototype.clear=K0,ga.prototype.delete=Y0,ga.prototype.get=em,ga.prototype.has=am,ga.prototype.set=om;var yf=ga;function um(){this.__data__=[],this.size=0}var lm=um;function fm(t,e){return t===e||t!==t&&e!==e}var wf=fm;function cm(t,e){for(var r=t.length;r--;)if(wf(t[r][0],e))return r;return-1}var ds=cm,dm=Array.prototype,vm=dm.splice;function hm(t){var e=this.__data__,r=ds(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():vm.call(e,r,1),--this.size,!0}var gm=hm;function pm(t){var e=this.__data__,r=ds(e,t);return r<0?void 0:e[r][1]}var mm=pm;function ym(t){return ds(this.__data__,t)>-1}var wm=ym;function bm(t,e){var r=this.__data__,n=ds(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var xm=bm;function pa(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}pa.prototype.clear=lm,pa.prototype.delete=gm,pa.prototype.get=mm,pa.prototype.has=wm,pa.prototype.set=xm;var Fm=pa,Em=Mo(Xi,"Map"),Cm=Em;function Tm(){this.size=0,this.__data__={hash:new yf,map:new(Cm||Fm),string:new yf}}var Sm=Tm;function Dm(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var km=Dm;function Pm(t,e){var r=t.__data__;return km(e)?r[typeof e=="string"?"string":"hash"]:r.map}var vs=Pm;function Am(t){var e=vs(this,t).delete(t);return this.size-=e?1:0,e}var Bm=Am;function Im(t){return vs(this,t).get(t)}var Mm=Im;function Rm(t){return vs(this,t).has(t)}var Lm=Rm;function Om(t,e){var r=vs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Nm=Om;function ma(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ma.prototype.clear=Sm,ma.prototype.delete=Bm,ma.prototype.get=Mm,ma.prototype.has=Lm,ma.prototype.set=Nm;var bf=ma,_m="Expected a function";function Ro(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(_m);var r=function(){var n=arguments,a=e?e.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var s=t.apply(this,n);return r.cache=i.set(a,s)||i,s};return r.cache=new(Ro.Cache||bf),r}Ro.Cache=bf;var zm=Ro,Vm=500;function $m(t){var e=zm(t,function(n){return r.size===Vm&&r.clear(),n}),r=e.cache;return e}var qm=$m,Hm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wm=/\\(\\)?/g,Um=qm(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Hm,function(r,n,a,i){e.push(a?i.replace(Wm,"$1"):n||r)}),e}),xf=Um;function Gm(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}var Ff=Gm,Km=1/0,Ef=ia?ia.prototype:void 0,Cf=Ef?Ef.toString:void 0;function Tf(t){if(typeof t=="string")return t;if(cs(t))return Ff(t,Tf)+"";if(Ka(t))return Cf?Cf.call(t):"";var e=t+"";return e=="0"&&1/t==-Km?"-0":e}var Xm=Tf;function Ym(t){return t==null?"":Xm(t)}var Sf=Ym;function Zm(t,e){return cs(t)?t:w0(t,e)?[t]:xf(Sf(t))}var Df=Zm,Qm=1/0;function Jm(t){if(typeof t=="string"||Ka(t))return t;var e=t+"";return e=="0"&&1/t==-Qm?"-0":e}var Lo=Jm;function jm(t,e){e=Df(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lo(e[r++])];return r&&r==n?t:void 0}var ey=jm;function ty(t,e,r){var n=t==null?void 0:ey(t,e);return n===void 0?r:n}var ry=ty,ny=function(){try{var t=Mo(Object,"defineProperty");return t({},"",{}),t}catch{}}(),kf=ny;function ay(t,e,r){e=="__proto__"&&kf?kf(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var iy=ay,sy=Object.prototype,oy=sy.hasOwnProperty;function uy(t,e,r){var n=t[e];(!(oy.call(t,e)&&wf(n,r))||r===void 0&&!(e in t))&&iy(t,e,r)}var ly=uy,fy=9007199254740991,cy=/^(?:0|[1-9]\d*)$/;function dy(t,e){var r=typeof t;return e=e??fy,!!e&&(r=="number"||r!="symbol"&&cy.test(t))&&t>-1&&t%1==0&&t<e}var vy=dy;function hy(t,e,r,n){if(!Mn(t))return t;e=Df(e,t);for(var a=-1,i=e.length,s=i-1,o=t;o!=null&&++a<i;){var u=Lo(e[a]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(a!=s){var f=o[u];l=n?n(f,u,o):void 0,l===void 0&&(l=Mn(f)?f:vy(e[a+1])?[]:{})}ly(o,u,l),o=o[u]}return t}var gy=hy;function py(t,e,r){return t==null?t:gy(t,e,r)}var my=py;function yy(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var wy=yy;function by(t){return cs(t)?Ff(t,Lo):Ka(t)?[t]:wy(xf(Sf(t)))}var xy=by,Fy={data:function(e){var r={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Ve({},r,e),function(a,i){var s=e,o=this,u=o.length!==void 0,l=u?o:[o],f=u?o[0]:o;if(_e(a)){var d=a.indexOf(".")!==-1,g=d&&xy(a);if(s.allowGetting&&i===void 0){var m;return f&&(s.beforeGet(f),g&&f._private[s.field][a]===void 0?m=ry(f._private[s.field],g):m=f._private[s.field][a]),m}else if(s.allowSetting&&i!==void 0){var p=!s.immutableKeys[a];if(p){var b=fl({},a,i);s.beforeSet(o,b);for(var x=0,w=l.length;x<w;x++){var E=l[x];s.canSet(E)&&(g&&f._private[s.field][a]===void 0?my(E._private[s.field],g,i):E._private[s.field][a]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}}else if(s.allowSetting&&st(a)){var C=a,k,R,A=Object.keys(C);s.beforeSet(o,C);for(var h=0;h<A.length;h++){k=A[h],R=C[k];var I=!s.immutableKeys[k];if(I)for(var D=0;D<l.length;D++){var M=l[D];s.canSet(M)&&(M._private[s.field][k]=R)}}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Tt(a)){var L=a;o.on(s.bindingEvent,L)}else if(s.allowGetting&&a===void 0){var B;return f&&(s.beforeGet(f),B=f._private[s.field]),B}return o}},removeData:function(e){var r={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ve({},r,e),function(a){var i=e,s=this,o=s.length!==void 0,u=o?s:[s];if(_e(a)){for(var l=a.split(/\s+/),f=l.length,d=0;d<f;d++){var g=l[d];if(!cn(g)){var m=!i.immutableKeys[g];if(m)for(var p=0,b=u.length;p<b;p++)u[p]._private[i.field][g]=void 0}}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(a===void 0){for(var x=0,w=u.length;x<w;x++)for(var E=u[x]._private[i.field],C=Object.keys(E),k=0;k<C.length;k++){var R=C[k],A=!i.immutableKeys[R];A&&(E[R]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},Ey={eventAliasesOn:function(e){var r=e;r.addListener=r.listen=r.bind=r.on,r.unlisten=r.unbind=r.off=r.removeListener,r.trigger=r.emit,r.pon=r.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new ha(function(o,u){var l=function(m){i.off.apply(i,d),o(m)},f=s.concat([l]),d=f.concat([]);i.on.apply(i,f)})}}},gt={};[h0,Fy,Ey].forEach(function(t){Ve(gt,t)});var Cy={animate:gt.animate(),animation:gt.animation(),animated:gt.animated(),clearQueue:gt.clearQueue(),delay:gt.delay(),delayAnimation:gt.delayAnimation(),stop:gt.stop()},hs={classes:function(e){var r=this;if(e===void 0){var n=[];return r[0]._private.classes.forEach(function(p){return n.push(p)}),n}else bt(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new oa(e),s=0;s<r.length;s++){for(var o=r[s],u=o._private,l=u.classes,f=!1,d=0;d<e.length;d++){var g=e[d],m=l.has(g);if(!m){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),r},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},toggleClass:function(e,r){bt(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=r===void 0,i=[],s=0,o=n.length;s<o;s++)for(var u=n[s],l=u._private.classes,f=!1,d=0;d<e.length;d++){var g=e[d],m=l.has(g),p=!1;r||a&&!m?(l.add(g),p=!0):(!r||a&&m)&&(l.delete(g),p=!0),!f&&p&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,r){var n=this;if(r==null)r=250;else if(r===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},r),n}};hs.className=hs.classNames=hs.classes;var ot={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Rt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};ot.variable="(?:[\\w-.]|(?:\\\\"+ot.metaChar+"))+",ot.className="(?:[\\w-]|(?:\\\\"+ot.metaChar+"))+",ot.value=ot.string+"|"+ot.number,ot.id=ot.variable,function(){var t,e,r;for(t=ot.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],ot.comparatorOp+="|@"+e;for(t=ot.comparatorOp.split("|"),r=0;r<t.length;r++)e=t[r],!(e.indexOf("!")>=0)&&e!=="="&&(ot.comparatorOp+="|\\!"+e)}();var wt=function(){return{checks:[]}},Me={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Oo=[{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(t,e){return Nh(t.selector,e.selector)}),Ty=function(){for(var t={},e,r=0;r<Oo.length;r++)e=Oo[r],t[e.selector]=e.matches;return t}(),Sy=function(e,r){return Ty[e](r)},Dy="("+Oo.map(function(t){return t.selector}).join("|")+")",ya=function(e){return e.replace(new RegExp("\\\\("+ot.metaChar+")","g"),function(r,n){return n})},mn=function(e,r,n){e[e.length-1]=n},No=[{name:"group",query:!0,regex:"("+ot.group+")",populate:function(e,r,n){var a=At(n,1),i=a[0];r.checks.push({type:Me.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:Dy,populate:function(e,r,n){var a=At(n,1),i=a[0];r.checks.push({type:Me.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+ot.id+")",populate:function(e,r,n){var a=At(n,1),i=a[0];r.checks.push({type:Me.ID,value:ya(i)})}},{name:"className",query:!0,regex:"\\.("+ot.className+")",populate:function(e,r,n){var a=At(n,1),i=a[0];r.checks.push({type:Me.CLASS,value:ya(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+ot.variable+")\\s*\\]",populate:function(e,r,n){var a=At(n,1),i=a[0];r.checks.push({type:Me.DATA_EXIST,field:ya(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+ot.variable+")\\s*("+ot.comparatorOp+")\\s*("+ot.value+")\\s*\\]",populate:function(e,r,n){var a=At(n,3),i=a[0],s=a[1],o=a[2],u=new RegExp("^"+ot.string+"$").exec(o)!=null;u?o=o.substring(1,o.length-1):o=parseFloat(o),r.checks.push({type:Me.DATA_COMPARE,field:ya(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+ot.boolOp+")\\s*("+ot.variable+")\\s*\\]",populate:function(e,r,n){var a=At(n,2),i=a[0],s=a[1];r.checks.push({type:Me.DATA_BOOL,field:ya(s),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+ot.meta+")\\s*("+ot.comparatorOp+")\\s*("+ot.number+")\\s*\\]\\]",populate:function(e,r,n){var a=At(n,3),i=a[0],s=a[1],o=a[2];r.checks.push({type:Me.META_COMPARE,field:ya(i),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:ot.separator,populate:function(e,r){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];n!=null&&(s.subject=n,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var o=e[e.length++]=wt();return o}},{name:"directedEdge",separator:!0,regex:ot.directedEdge,populate:function(e,r){if(e.currentSubject==null){var n=wt(),a=r,i=wt();return n.checks.push({type:Me.DIRECTED_EDGE,source:a,target:i}),mn(e,r,n),e.edgeCount++,i}else{var s=wt(),o=r,u=wt();return s.checks.push({type:Me.NODE_SOURCE,source:o,target:u}),mn(e,r,s),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:ot.undirectedEdge,populate:function(e,r){if(e.currentSubject==null){var n=wt(),a=r,i=wt();return n.checks.push({type:Me.UNDIRECTED_EDGE,nodes:[a,i]}),mn(e,r,n),e.edgeCount++,i}else{var s=wt(),o=r,u=wt();return s.checks.push({type:Me.NODE_NEIGHBOR,node:o,neighbor:u}),mn(e,r,s),u}}},{name:"child",separator:!0,regex:ot.child,populate:function(e,r){if(e.currentSubject==null){var n=wt(),a=wt(),i=e[e.length-1];return n.checks.push({type:Me.CHILD,parent:i,child:a}),mn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=wt(),o=e[e.length-1],u=wt(),l=wt(),f=wt(),d=wt();return s.checks.push({type:Me.COMPOUND_SPLIT,left:o,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Me.TRUE}],d.checks.push({type:Me.TRUE}),u.checks.push({type:Me.PARENT,parent:d,child:f}),mn(e,o,s),e.currentSubject=l,e.compoundCount++,f}else{var g=wt(),m=wt(),p=[{type:Me.PARENT,parent:g,child:m}];return g.checks=r.checks,r.checks=p,e.compoundCount++,m}}},{name:"descendant",separator:!0,regex:ot.descendant,populate:function(e,r){if(e.currentSubject==null){var n=wt(),a=wt(),i=e[e.length-1];return n.checks.push({type:Me.DESCENDANT,ancestor:i,descendant:a}),mn(e,r,n),e.compoundCount++,a}else if(e.currentSubject===r){var s=wt(),o=e[e.length-1],u=wt(),l=wt(),f=wt(),d=wt();return s.checks.push({type:Me.COMPOUND_SPLIT,left:o,right:u,subject:l}),l.checks=r.checks,r.checks=[{type:Me.TRUE}],d.checks.push({type:Me.TRUE}),u.checks.push({type:Me.ANCESTOR,ancestor:d,descendant:f}),mn(e,o,s),e.currentSubject=l,e.compoundCount++,f}else{var g=wt(),m=wt(),p=[{type:Me.ANCESTOR,ancestor:g,descendant:m}];return g.checks=r.checks,r.checks=p,e.compoundCount++,m}}},{name:"subject",modifier:!0,regex:ot.subject,populate:function(e,r){if(e.currentSubject!=null&&e.currentSubject!==r)return ht("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=r;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===Me.DIRECTED_EDGE?a.type=Me.NODE_TARGET:i===Me.UNDIRECTED_EDGE&&(a.type=Me.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];No.forEach(function(t){return t.regexObj=new RegExp("^"+t.regex)});var ky=function(e){for(var r,n,a,i=0;i<No.length;i++){var s=No[i],o=s.name,u=e.match(s.regexObj);if(u!=null){n=u,r=s,a=o;var l=u[0];e=e.substring(l.length);break}}return{expr:r,match:n,name:a,remaining:e}},Py=function(e){var r=e.match(/^\s+/);if(r){var n=r[0];e=e.substring(n.length)}return e},Ay=function(e){var r=this,n=r.inputText=e,a=r[0]=wt();for(r.length=1,n=Py(n);;){var i=ky(n);if(i.expr==null)return ht("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(r,a,s);if(o===!1)return!1;if(o!=null&&(a=o),n=i.remaining,n.match(/^\s*$/))break}var u=r[r.length-1];r.currentSubject!=null&&(u.subject=r.currentSubject),u.edgeCount=r.edgeCount,u.compoundCount=r.compoundCount;for(var l=0;l<r.length;l++){var f=r[l];if(f.compoundCount>0&&f.edgeCount>0)return ht("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return ht("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&ht("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},By=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},r=function(f){return _e(f)?'"'+f+'"':e(f)},n=function(f){return" "+f+" "},a=function(f,d){var g=f.type,m=f.value;switch(g){case Me.GROUP:{var p=e(m);return p.substring(0,p.length-1)}case Me.DATA_COMPARE:{var b=f.field,x=f.operator;return"["+b+n(e(x))+r(m)+"]"}case Me.DATA_BOOL:{var w=f.operator,E=f.field;return"["+e(w)+E+"]"}case Me.DATA_EXIST:{var C=f.field;return"["+C+"]"}case Me.META_COMPARE:{var k=f.operator,R=f.field;return"[["+R+n(e(k))+r(m)+"]]"}case Me.STATE:return m;case Me.ID:return"#"+m;case Me.CLASS:return"."+m;case Me.PARENT:case Me.CHILD:return i(f.parent,d)+n(">")+i(f.child,d);case Me.ANCESTOR:case Me.DESCENDANT:return i(f.ancestor,d)+" "+i(f.descendant,d);case Me.COMPOUND_SPLIT:{var A=i(f.left,d),h=i(f.subject,d),I=i(f.right,d);return A+(A.length>0?" ":"")+h+I}case Me.TRUE:return""}},i=function(f,d){return f.checks.reduce(function(g,m,p){return g+(d===f&&p===0?"$":"")+a(m,d)},"")},s="",o=0;o<this.length;o++){var u=this[o];s+=i(u,u.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s},Iy={parse:Ay,toString:By},Pf=function(e,r,n){var a,i=_e(e),s=Se(e),o=_e(n),u,l,f=!1,d=!1,g=!1;switch(r.indexOf("!")>=0&&(r=r.replace("!",""),d=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),f=!0),(i||o||f)&&(u=!i&&!s?"":""+e,l=""+n),f&&(e=u=u.toLowerCase(),n=l=l.toLowerCase()),r){case"*=":a=u.indexOf(l)>=0;break;case"$=":a=u.indexOf(l,u.length-l.length)>=0;break;case"^=":a=u.indexOf(l)===0;break;case"=":a=e===n;break;case">":g=!0,a=e>n;break;case">=":g=!0,a=e>=n;break;case"<":g=!0,a=e<n;break;case"<=":g=!0,a=e<=n;break;default:a=!1;break}return d&&(e!=null||!g)&&(a=!a),a},My=function(e,r){switch(r){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Ry=function(e){return e!==void 0},_o=function(e,r){return e.data(r)},Ly=function(e,r){return e[r]()},Dt=[],Ct=function(e,r){return e.checks.every(function(n){return Dt[n.type](n,r)})};Dt[Me.GROUP]=function(t,e){var r=t.value;return r==="*"||r===e.group()},Dt[Me.STATE]=function(t,e){var r=t.value;return Sy(r,e)},Dt[Me.ID]=function(t,e){var r=t.value;return e.id()===r},Dt[Me.CLASS]=function(t,e){var r=t.value;return e.hasClass(r)},Dt[Me.META_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Pf(Ly(e,r),n,a)},Dt[Me.DATA_COMPARE]=function(t,e){var r=t.field,n=t.operator,a=t.value;return Pf(_o(e,r),n,a)},Dt[Me.DATA_BOOL]=function(t,e){var r=t.field,n=t.operator;return My(_o(e,r),n)},Dt[Me.DATA_EXIST]=function(t,e){var r=t.field;return t.operator,Ry(_o(e,r))},Dt[Me.UNDIRECTED_EDGE]=function(t,e){var r=t.nodes[0],n=t.nodes[1],a=e.source(),i=e.target();return Ct(r,a)&&Ct(n,i)||Ct(n,a)&&Ct(r,i)},Dt[Me.NODE_NEIGHBOR]=function(t,e){return Ct(t.node,e)&&e.neighborhood().some(function(r){return r.isNode()&&Ct(t.neighbor,r)})},Dt[Me.DIRECTED_EDGE]=function(t,e){return Ct(t.source,e.source())&&Ct(t.target,e.target())},Dt[Me.NODE_SOURCE]=function(t,e){return Ct(t.source,e)&&e.outgoers().some(function(r){return r.isNode()&&Ct(t.target,r)})},Dt[Me.NODE_TARGET]=function(t,e){return Ct(t.target,e)&&e.incomers().some(function(r){return r.isNode()&&Ct(t.source,r)})},Dt[Me.CHILD]=function(t,e){return Ct(t.child,e)&&Ct(t.parent,e.parent())},Dt[Me.PARENT]=function(t,e){return Ct(t.parent,e)&&e.children().some(function(r){return Ct(t.child,r)})},Dt[Me.DESCENDANT]=function(t,e){return Ct(t.descendant,e)&&e.ancestors().some(function(r){return Ct(t.ancestor,r)})},Dt[Me.ANCESTOR]=function(t,e){return Ct(t.ancestor,e)&&e.descendants().some(function(r){return Ct(t.descendant,r)})},Dt[Me.COMPOUND_SPLIT]=function(t,e){return Ct(t.subject,e)&&Ct(t.left,e)&&Ct(t.right,e)},Dt[Me.TRUE]=function(){return!0},Dt[Me.COLLECTION]=function(t,e){var r=t.value;return r.has(e)},Dt[Me.FILTER]=function(t,e){var r=t.value;return r(e)};var Oy=function(e){var r=this;if(r.length===1&&r[0].checks.length===1&&r[0].checks[0].type===Me.ID)return e.getElementById(r[0].checks[0].value).collection();var n=function(i){for(var s=0;s<r.length;s++){var o=r[s];if(Ct(o,i))return!0}return!1};return r.text()==null&&(n=function(){return!0}),e.filter(n)},Ny=function(e){for(var r=this,n=0;n<r.length;n++){var a=r[n];if(Ct(a,e))return!0}return!1},_y={matches:Ny,filter:Oy},yn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||_e(e)&&e.match(/^\s*$/)||(br(e)?this.addQuery({checks:[{type:Me.COLLECTION,value:e.collection()}]}):Tt(e)?this.addQuery({checks:[{type:Me.FILTER,value:e}]}):_e(e)?this.parse(e)||(this.invalid=!0):St("A selector must be created from a string; found "))},wn=yn.prototype;[Iy,_y].forEach(function(t){return Ve(wn,t)}),wn.text=function(){return this.inputText},wn.size=function(){return this.length},wn.eq=function(t){return this[t]},wn.sameText=function(t){return!this.invalid&&!t.invalid&&this.text()===t.text()},wn.addQuery=function(t){this[this.length++]=t},wn.selector=wn.toString;var bn={allAre:function(e){var r=new yn(e);return this.every(function(n){return r.matches(n)})},is:function(e){var r=new yn(e);return this.some(function(n){return r.matches(n)})},some:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,r){for(var n=0;n<this.length;n++){var a=r?e.apply(r,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var r=this.length,n=e.length;return r!==n?!1:r===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(r){return e.hasElementWithId(r.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var r=this.neighborhood();return e.every(function(n){return r.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var r=this;return e.every(function(n){return r.hasElementWithId(n.id())})}};bn.allAreNeighbours=bn.allAreNeighbors,bn.has=bn.contains,bn.equal=bn.equals=bn.same;var Sr=function(e,r){return function(a,i,s,o){var u=a,l=this,f;if(u==null?f="":br(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var d=l[0]._private,g=d.traversalCache=d.traversalCache||{},m=g[r]=g[r]||[],p=vn(f),b=m[p];return b||(m[p]=e.call(l,a,i,s,o))}else return e.call(l,a,i,s,o)}},wa={parent:function(e){var r=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],s=i._private.parent;s&&r.push(s)}return this.spawn(r,!0).filter(e)},parents:function(e){for(var r=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++){var i=n[a];r.push(i)}n=n.parent()}return this.spawn(r,!0).filter(e)},commonAncestors:function(e){for(var r,n=0;n<this.length;n++){var a=this[n],i=a.parents();r=r||i,r=r.intersect(i)}return r.filter(e)},orphans:function(e){return this.stdFilter(function(r){return r.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(r){return r.isChild()}).filter(e)},children:Sr(function(t){for(var e=[],r=0;r<this.length;r++)for(var n=this[r],a=n._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(t)},"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 r=[];function n(a){for(var i=0;i<a.length;i++){var s=a[i];r.push(s),s.children().nonempty()&&n(s.children())}}return n(this.children()),this.spawn(r,!0).filter(e)}};function zo(t,e,r,n){for(var a=[],i=new oa,s=t.cy(),o=s.hasCompoundNodes(),u=0;u<t.length;u++){var l=t[u];r?a.push(l):o&&n(a,i,l)}for(;a.length>0;){var f=a.shift();e(f),i.add(f.id()),o&&n(a,i,f)}return t}function Af(t,e,r){if(r.isParent())for(var n=r._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||t.push(i)}}wa.forEachDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zo(this,t,e,Af)};function Bf(t,e,r){if(r.isChild()){var n=r._private.parent;e.has(n.id())||t.push(n)}}wa.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zo(this,t,e,Bf)};function zy(t,e,r){Bf(t,e,r),Af(t,e,r)}wa.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return zo(this,t,e,zy)},wa.ancestors=wa.parents;var ii,If;ii=If={data:gt.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:gt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:gt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:gt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:gt.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:gt.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},ii.attr=ii.data,ii.removeAttr=ii.removeData;var Vy=If,gs={};function Vo(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var n=0,a=r[0],i=a._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(n+=t(a,o))}return n}else return}}Ve(gs,{degree:Vo(function(t,e){return e.source().same(e.target())?2:1}),indegree:Vo(function(t,e){return e.target().same(t)?1:0}),outdegree:Vo(function(t,e){return e.source().same(t)?1:0})});function ba(t,e){return function(r){for(var n,a=this.nodes(),i=0;i<a.length;i++){var s=a[i],o=s[t](r);o!==void 0&&(n===void 0||e(o,n))&&(n=o)}return n}}Ve(gs,{minDegree:ba("degree",function(t,e){return t<e}),maxDegree:ba("degree",function(t,e){return t>e}),minIndegree:ba("indegree",function(t,e){return t<e}),maxIndegree:ba("indegree",function(t,e){return t>e}),minOutdegree:ba("outdegree",function(t,e){return t<e}),maxOutdegree:ba("outdegree",function(t,e){return t>e})}),Ve(gs,{totalDegree:function(e){for(var r=0,n=this.nodes(),a=0;a<n.length;a++)r+=n[a].degree(e);return r}});var Mr,Mf,Rf=function(e,r,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,o={x:r.x!=null?r.x-s.x:0,y:r.y!=null?r.y-s.y:0};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},Lf={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,r){Rf(e,r,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Mr=Mf={position:gt.data(Lf),silentPosition:gt.data(Ve({},Lf,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,r){Rf(e,r,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,r){if(st(e))r?this.silentPosition(e):this.position(e);else if(Tt(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var s=this[i],o=void 0;(o=n(s,i))&&(r?s.silentPosition(o):s.position(o))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,r,n){var a;if(st(e)?(a={x:Se(e.x)?e.x:0,y:Se(e.y)?e.y:0},n=r):_e(e)&&Se(r)&&(a={x:0,y:0},a[e]=r),a!=null){var i=this.cy();i.startBatch();for(var s=0;s<this.length;s++){var o=this[s];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var u=o.position(),l={x:u.x+a.x,y:u.y+a.y};n?o.silentPosition(l):o.position(l)}}i.endBatch()}return this},silentShift:function(e,r){return st(e)?this.shift(e,!0):_e(e)&&Se(r)&&this.shift(e,r,!0),this},renderedPosition:function(e,r){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),o=st(e)?e:void 0,u=o!==void 0||r!==void 0&&_e(e);if(n&&n.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];r!==void 0?f.position(e,(r-s[e])/i):o!==void 0&&f.position(_l(o,i,s))}else{var d=n.position();return o=ji(d,i,s),e===void 0?o:o[e]}else if(!u)return;return this},relativePosition:function(e,r){var n=this[0],a=this.cy(),i=st(e)?e:void 0,s=i!==void 0||r!==void 0&&_e(e),o=a.hasCompoundNodes();if(n&&n.isNode())if(s)for(var u=0;u<this.length;u++){var l=this[u],f=o?l.parent():null,d=f&&f.length>0,g=d;d&&(f=f[0]);var m=g?f.position():{x:0,y:0};r!==void 0?l.position(e,r+m[e]):i!==void 0&&l.position({x:i.x+m.x,y:i.y+m.y})}else{var p=n.position(),b=o?n.parent():null,x=b&&b.length>0,w=x;x&&(b=b[0]);var E=w?b.position():{x:0,y:0};return i={x:p.x-E.x,y:p.y-E.y},e===void 0?i:i[e]}else if(!s)return;return this}},Mr.modelPosition=Mr.point=Mr.position,Mr.modelPositions=Mr.points=Mr.positions,Mr.renderedPoint=Mr.renderedPosition,Mr.relativePoint=Mr.relativePosition;var $y=Mf,xa,xn;xa=xn={},xn.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),n=r.zoom(),a=r.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,o=e.y1*n+a.y,u=e.y2*n+a.y;return{x1:i,x2:s,y1:o,y2:u,w:s-i,h:u-o}},xn.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var n=r._private;n.compoundBoundsClean=!1,n.bbCache=null,t||r.emitAndNotify("bounds")}}),this)},xn.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,u=s.children(),l=s.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},d=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),g=o.position;(d.w===0||d.h===0)&&(d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},d.x1=g.x-d.w/2,d.x2=g.x+d.w/2,d.y1=g.y-d.h/2,d.y2=g.y+d.h/2);function m(D,M,L){var B=0,N=0,_=M+L;return D>0&&_>0&&(B=M/_*D,N=L/_*D),{biasDiff:B,biasComplementDiff:N}}function p(D,M,L,B){if(L.units==="%")switch(B){case"width":return D>0?L.pfValue*D:0;case"height":return M>0?L.pfValue*M:0;case"average":return D>0&&M>0?L.pfValue*(D+M)/2:0;case"min":return D>0&&M>0?D>M?L.pfValue*M:L.pfValue*D:0;case"max":return D>0&&M>0?D>M?L.pfValue*D:L.pfValue*M:0;default:return 0}else return L.units==="px"?L.pfValue:0}var b=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(b=b*100/f.width.val);var x=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(x=x*100/f.width.val);var w=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(w=w*100/f.height.val);var E=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(E=E*100/f.height.val);var C=m(f.width.val-d.w,b,x),k=C.biasDiff,R=C.biasComplementDiff,A=m(f.height.val-d.h,w,E),h=A.biasDiff,I=A.biasComplementDiff;o.autoPadding=p(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,f.width.val),g.x=(-k+d.x1+d.x2+R)/2,o.autoHeight=Math.max(d.h,f.height.val),g.y=(-h+d.y1+d.y2+I)/2}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||t)&&(r(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Dr=function(e){return e===1/0||e===-1/0?0:e},Rr=function(e,r,n,a,i){a-r===0||i-n===0||r==null||n==null||a==null||i==null||(e.x1=r<e.x1?r:e.x1,e.x2=a>e.x2?a:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},zn=function(e,r){return r==null?e:Rr(e,r.x1,r.y1,r.x2,r.y2)},si=function(e,r,n){return Ir(e,r,n)},ps=function(e,r,n){if(!r.cy().headless()){var a=r._private,i=a.rstyle,s=i.arrowWidth/2,o=r.pstyle(n+"-arrow-shape").value,u,l;if(o!=="none"){n==="source"?(u=i.srcX,l=i.srcY):n==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=a.arrowBounds=a.arrowBounds||{},d=f[n]=f[n]||{};d.x1=u-s,d.y1=l-s,d.x2=u+s,d.y2=l+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,ts(d,1),Rr(e,d.x1,d.y1,d.x2,d.y2)}}},$o=function(e,r,n){if(!r.cy().headless()){var a;n?a=n+"-":a="";var i=r._private,s=i.rstyle,o=r.pstyle(a+"label").strValue;if(o){var u=r.pstyle("text-halign"),l=r.pstyle("text-valign"),f=si(s,"labelWidth",n),d=si(s,"labelHeight",n),g=si(s,"labelX",n),m=si(s,"labelY",n),p=r.pstyle(a+"text-margin-x").pfValue,b=r.pstyle(a+"text-margin-y").pfValue,x=r.isEdge(),w=r.pstyle(a+"text-rotation"),E=r.pstyle("text-outline-width").pfValue,C=r.pstyle("text-border-width").pfValue,k=C/2,R=r.pstyle("text-background-padding").pfValue,A=2,h=d,I=f,D=I/2,M=h/2,L,B,N,_;if(x)L=g-D,B=g+D,N=m-M,_=m+M;else{switch(u.value){case"left":L=g-I,B=g;break;case"center":L=g-D,B=g+D;break;case"right":L=g,B=g+I;break}switch(l.value){case"top":N=m-h,_=m;break;case"center":N=m-M,_=m+M;break;case"bottom":N=m,_=m+h;break}}var U=p-Math.max(E,k)-R-A,H=p+Math.max(E,k)+R+A,W=b-Math.max(E,k)-R-A,X=b+Math.max(E,k)+R+A;L+=U,B+=H,N+=W,_+=X;var Q=n||"main",se=i.labelBounds,j=se[Q]=se[Q]||{};j.x1=L,j.y1=N,j.x2=B,j.y2=_,j.w=B-L,j.h=_-N,j.leftPad=U,j.rightPad=H,j.topPad=W,j.botPad=X;var ee=x&&w.strValue==="autorotate",de=w.pfValue!=null&&w.pfValue!==0;if(ee||de){var ge=ee?si(i.rstyle,"labelAngle",n):w.pfValue,me=Math.cos(ge),pe=Math.sin(ge),we=(L+B)/2,be=(N+_)/2;if(!x){switch(u.value){case"left":we=B;break;case"right":we=L;break}switch(l.value){case"top":be=_;break;case"bottom":be=N;break}}var ae=function(at,ke){return at=at-we,ke=ke-be,{x:at*me-ke*pe+we,y:at*pe+ke*me+be}},Y=ae(L,N),oe=ae(L,_),ye=ae(B,N),De=ae(B,_);L=Math.min(Y.x,oe.x,ye.x,De.x),B=Math.max(Y.x,oe.x,ye.x,De.x),N=Math.min(Y.y,oe.y,ye.y,De.y),_=Math.max(Y.y,oe.y,ye.y,De.y)}var Be=Q+"Rot",Je=se[Be]=se[Be]||{};Je.x1=L,Je.y1=N,Je.x2=B,Je.y2=_,Je.w=B-L,Je.h=_-N,Rr(e,L,N,B,_),Rr(i.labelBounds.all,L,N,B,_)}return e}},qy=function(e,r){if(!r.cy().headless()){var n=r.pstyle("outline-opacity").value,a=r.pstyle("outline-width").value;if(n>0&&a>0){var i=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,o=a+i,u=(e.w+o*2)/e.w,l=(e.h+o*2)/e.h,f=0,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+o*2.4)/e.w,d=-o/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+o*2.4)/e.w:s==="star"?(u=(e.w+o*2.8)/e.w,l=(e.h+o*2.6)/e.h,d=-o/3.8):s==="triangle"?(u=(e.w+o*2.8)/e.w,l=(e.h+o*2.4)/e.h,d=-o/1.4):s==="vee"&&(u=(e.w+o*4.4)/e.w,l=(e.h+o*3.8)/e.h,d=-o*.5);var g=e.h*l-e.h,m=e.w*u-e.w;if(rs(e,[Math.ceil(g/2),Math.ceil(m/2)]),f!=0||d!==0){var p=lp(e,f,d);Vl(e,p)}}}},Hy=function(e,r){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=fr(),o=e._private,u=e.isNode(),l=e.isEdge(),f,d,g,m,p,b,x=o.rstyle,w=u&&a?e.pstyle("bounds-expansion").pfValue:[0],E=function(ut){return ut.pstyle("display").value!=="none"},C=!a||E(e)&&(!l||E(e.source())&&E(e.target()));if(C){var k=0,R=0;a&&r.includeOverlays&&(k=e.pstyle("overlay-opacity").value,k!==0&&(R=e.pstyle("overlay-padding").value));var A=0,h=0;a&&r.includeUnderlays&&(A=e.pstyle("underlay-opacity").value,A!==0&&(h=e.pstyle("underlay-padding").value));var I=Math.max(R,h),D=0,M=0;if(a&&(D=e.pstyle("width").pfValue,M=D/2),u&&r.includeNodes){var L=e.position();p=L.x,b=L.y;var B=e.outerWidth(),N=B/2,_=e.outerHeight(),U=_/2;f=p-N,d=p+N,g=b-U,m=b+U,Rr(s,f,g,d,m),a&&r.includeOutlines&&qy(s,e)}else if(l&&r.includeEdges)if(a&&!i){var H=e.pstyle("curve-style").strValue;if(f=Math.min(x.srcX,x.midX,x.tgtX),d=Math.max(x.srcX,x.midX,x.tgtX),g=Math.min(x.srcY,x.midY,x.tgtY),m=Math.max(x.srcY,x.midY,x.tgtY),f-=M,d+=M,g-=M,m+=M,Rr(s,f,g,d,m),H==="haystack"){var W=x.haystackPts;if(W&&W.length===2){if(f=W[0].x,g=W[0].y,d=W[1].x,m=W[1].y,f>d){var X=f;f=d,d=X}if(g>m){var Q=g;g=m,m=Q}Rr(s,f-M,g-M,d+M,m+M)}}else if(H==="bezier"||H==="unbundled-bezier"||H.endsWith("segments")||H.endsWith("taxi")){var se;switch(H){case"bezier":case"unbundled-bezier":se=x.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":se=x.linePts;break}if(se!=null)for(var j=0;j<se.length;j++){var ee=se[j];f=ee.x-M,d=ee.x+M,g=ee.y-M,m=ee.y+M,Rr(s,f,g,d,m)}}}else{var de=e.source(),ge=de.position(),me=e.target(),pe=me.position();if(f=ge.x,d=pe.x,g=ge.y,m=pe.y,f>d){var we=f;f=d,d=we}if(g>m){var be=g;g=m,m=be}f-=M,d+=M,g-=M,m+=M,Rr(s,f,g,d,m)}if(a&&r.includeEdges&&l&&(ps(s,e,"mid-source"),ps(s,e,"mid-target"),ps(s,e,"source"),ps(s,e,"target")),a){var ae=e.pstyle("ghost").value==="yes";if(ae){var Y=e.pstyle("ghost-offset-x").pfValue,oe=e.pstyle("ghost-offset-y").pfValue;Rr(s,s.x1+Y,s.y1+oe,s.x2+Y,s.y2+oe)}}var ye=o.bodyBounds=o.bodyBounds||{};$l(ye,s),rs(ye,w),ts(ye,1),a&&(f=s.x1,d=s.x2,g=s.y1,m=s.y2,Rr(s,f-I,g-I,d+I,m+I));var De=o.overlayBounds=o.overlayBounds||{};$l(De,s),rs(De,w),ts(De,1);var Be=o.labelBounds=o.labelBounds||{};Be.all!=null?up(Be.all):Be.all=fr(),a&&r.includeLabels&&(r.includeMainLabels&&$o(s,e,null),l&&(r.includeSourceLabels&&$o(s,e,"source"),r.includeTargetLabels&&$o(s,e,"target")))}return s.x1=Dr(s.x1),s.y1=Dr(s.y1),s.x2=Dr(s.x2),s.y2=Dr(s.y2),s.w=Dr(s.x2-s.x1),s.h=Dr(s.y2-s.y1),s.w>0&&s.h>0&&C&&(rs(s,w),ts(s,1)),s},Of=function(e){var r=0,n=function(s){return(s?1:0)<<r++},a=0;return a+=n(e.incudeNodes),a+=n(e.includeEdges),a+=n(e.includeLabels),a+=n(e.includeMainLabels),a+=n(e.includeSourceLabels),a+=n(e.includeTargetLabels),a+=n(e.includeOverlays),a+=n(e.includeOutlines),a},Nf=function(e){if(e.isEdge()){var r=e.source().position(),n=e.target().position(),a=function(s){return Math.round(s)};return Pg([a(r.x),a(r.y),a(n.x),a(n.y)])}else return 0},_f=function(e,r){var n=e._private,a,i=e.isEdge(),s=r==null?zf:Of(r),o=s===zf,u=Nf(e),l=n.bbCachePosKey===u,f=r.useCache&&l,d=function(b){return b._private.bbCache==null||b._private.styleDirty},g=!f||d(e)||i&&(d(e.source())||d(e.target()));if(g?(l||e.recalculateRenderedStyle(f),a=Hy(e,oi),n.bbCache=a,n.bbCachePosKey=u):a=n.bbCache,!o){var m=e.isNode();a=fr(),(r.includeNodes&&m||r.includeEdges&&!m)&&(r.includeOverlays?zn(a,n.overlayBounds):zn(a,n.bodyBounds)),r.includeLabels&&(r.includeMainLabels&&(!i||r.includeSourceLabels&&r.includeTargetLabels)?zn(a,n.labelBounds.all):(r.includeMainLabels&&zn(a,n.labelBounds.mainRot),r.includeSourceLabels&&zn(a,n.labelBounds.sourceRot),r.includeTargetLabels&&zn(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},oi={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},zf=Of(oi),Vf=_t(oi);xn.boundingBox=function(t){var e;if(this.length===1&&this[0]._private.bbCache!=null&&!this[0]._private.styleDirty&&(t===void 0||t.useCache===void 0||t.useCache===!0))t===void 0?t=oi:t=Vf(t),e=_f(this[0],t);else{e=fr(),t=t||oi;var r=Vf(t),n=this,a=n.cy(),i=a.styleEnabled();if(i)for(var s=0;s<n.length;s++){var o=n[s],u=o._private,l=Nf(o),f=u.bbCachePosKey===l,d=r.useCache&&f&&!u.styleDirty;o.recalculateRenderedStyle(d)}this.updateCompoundBounds(!t.useCache);for(var g=0;g<n.length;g++){var m=n[g];zn(e,_f(m,r))}}return e.x1=Dr(e.x1),e.y1=Dr(e.y1),e.x2=Dr(e.x2),e.y2=Dr(e.y2),e.w=Dr(e.x2-e.x1),e.h=Dr(e.y2-e.y1),e},xn.dirtyBoundingBoxCache=function(){for(var t=0;t<this.length;t++){var e=this[t]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},xn.boundingBoxAt=function(t){var e=this.nodes(),r=this.cy(),n=r.hasCompoundNodes(),a=r.collection();if(n&&(a=e.filter(function(l){return l.isParent()}),e=e.not(a)),st(t)){var i=t;t=function(){return i}}var s=function(f,d){return f._private.bbAtOldPos=t(f,d)},o=function(f){return f._private.bbAtOldPos};r.startBatch(),e.forEach(s).silentPositions(t),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var u=op(this.boundingBox({useCache:!1}));return e.silentPositions(o),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),r.endBatch(),u},xa.boundingbox=xa.bb=xa.boundingBox,xa.renderedBoundingbox=xa.renderedBoundingBox;var Wy=xn,ui,li;ui=li={};var $f=function(e){e.uppercaseName=ml(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=ml(e.outerName),ui[e.name]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var o=n.pstyle(e.name);switch(o.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return o.pfValue}}else return 1},ui["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,s=i._private.styleEnabled;if(n)if(s){var o=n[e.name](),u=n.pstyle("border-width").pfValue,l=2*n.padding();return o+u+l}else return 1},ui["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},ui["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};$f({name:"width"}),$f({name:"height"}),li.padding=function(){var t=this[0],e=t._private;return t.isParent()?(t.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:t.pstyle("padding").pfValue):t.pstyle("padding").pfValue},li.paddedHeight=function(){var t=this[0];return t.height()+2*t.padding()},li.paddedWidth=function(){var t=this[0];return t.width()+2*t.padding()};var Uy=li,Gy=function(e,r){if(e.isEdge())return r(e)},Ky=function(e,r){if(e.isEdge()){var n=e.cy();return ji(r(e),n.zoom(),n.pan())}},Xy=function(e,r){if(e.isEdge()){var n=e.cy(),a=n.pan(),i=n.zoom();return r(e).map(function(s){return ji(s,i,a)})}},Yy=function(e){return e.renderer().getControlPoints(e)},Zy=function(e){return e.renderer().getSegmentPoints(e)},Qy=function(e){return e.renderer().getSourceEndpoint(e)},Jy=function(e){return e.renderer().getTargetEndpoint(e)},jy=function(e){return e.renderer().getEdgeMidpoint(e)},qf={controlPoints:{get:Yy,mult:!0},segmentPoints:{get:Zy,mult:!0},sourceEndpoint:{get:Qy},targetEndpoint:{get:Jy},midpoint:{get:jy}},ew=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},tw=Object.keys(qf).reduce(function(t,e){var r=qf[e],n=ew(e);return t[e]=function(){return Gy(this,r.get)},r.mult?t[n]=function(){return Xy(this,r.get)}:t[n]=function(){return Ky(this,r.get)},t},{}),rw=Ve({},$y,Wy,Uy,tw);/*!
  Event object based on jQuery events, MIT license

  https://jquery.org/license/
  https://tldrlegal.com/license/mit-license
  https://github.com/jquery/jquery/blob/master/src/event.js
  */var Hf=function(e,r){this.recycle(e,r)};function fi(){return!1}function ms(){return!0}Hf.prototype={instanceString:function(){return"event"},recycle:function(e,r){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=fi,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?ms:fi):e!=null&&e.type?r=e:this.type=e,r!=null&&(this.originalEvent=r.originalEvent,this.type=r.type!=null?r.type:this.type,this.cy=r.cy,this.target=r.target,this.position=r.position,this.renderedPosition=r.renderedPosition,this.namespace=r.namespace,this.layout=r.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,a=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*a+i.x,y:n.y*a+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=ms;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=ms;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=ms,this.stopPropagation()},isDefaultPrevented:fi,isPropagationStopped:fi,isImmediatePropagationStopped:fi};var Wf=/^([^.]+)(\.(?:[^.]+))?$/,nw=".*",Uf={qualifierCompare:function(e,r){return e===r},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},Gf=Object.keys(Uf),aw={};function ys(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:aw,e=arguments.length>1?arguments[1]:void 0,r=0;r<Gf.length;r++){var n=Gf[r];this[n]=t[n]||Uf[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Fn=ys.prototype,Kf=function(e,r,n,a,i,s,o){Tt(a)&&(i=a,a=null),o&&(s==null?s=o:s=Ve({},s,o));for(var u=bt(n)?n:n.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!cn(f)){var d=f.match(Wf);if(d){var g=d[1],m=d[2]?d[2]:null,p=r(e,f,g,m,a,i,s);if(p===!1)break}}}},Xf=function(e,r){return e.addEventFields(e.context,r),new Hf(r.type,r)},iw=function(e,r,n){if(Sh(n)){r(e,n);return}else if(st(n)){r(e,Xf(e,n));return}for(var a=bt(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!cn(s)){var o=s.match(Wf);if(o){var u=o[1],l=o[2]?o[2]:null,f=Xf(e,{type:u,namespace:l,target:e.context});r(e,f)}}}};Fn.on=Fn.addListener=function(t,e,r,n,a){return Kf(this,function(i,s,o,u,l,f,d){Tt(f)&&i.listeners.push({event:s,callback:f,type:o,namespace:u,qualifier:l,conf:d})},t,e,r,n,a),this},Fn.one=function(t,e,r,n){return this.on(t,e,r,n,{one:!0})},Fn.removeListener=Fn.off=function(t,e,r,n){var a=this;this.emitting!==0&&(this.listeners=Rg(this.listeners));for(var i=this.listeners,s=function(l){var f=i[l];Kf(a,function(d,g,m,p,b,x){if((f.type===m||t==="*")&&(!p&&f.namespace!==".*"||f.namespace===p)&&(!b||d.qualifierCompare(f.qualifier,b))&&(!x||f.callback===x))return i.splice(l,1),!1},t,e,r,n)},o=i.length-1;o>=0;o--)s(o);return this},Fn.removeAllListeners=function(){return this.removeListener("*")},Fn.emit=Fn.trigger=function(t,e,r){var n=this.listeners,a=n.length;return this.emitting++,bt(e)||(e=[e]),iw(this,function(i,s){r!=null&&(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],a=n.length);for(var o=function(f){var d=n[f];if(d.type===s.type&&(!d.namespace||d.namespace===s.namespace||d.namespace===nw)&&i.eventMatches(i.context,d,s)){var g=[s];e!=null&&Og(g,e),i.beforeEmit(i.context,d,s),d.conf&&d.conf.one&&(i.listeners=i.listeners.filter(function(b){return b!==d}));var m=i.callbackContext(i.context,d,s),p=d.callback.apply(m,g);i.afterEmit(i.context,d,s),p===!1&&(s.stopPropagation(),s.preventDefault())}},u=0;u<a;u++)o(u);i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},t),this.emitting--,this};var sw={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ha(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e.cy(),r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e},beforeEmit:function(e,r){r.conf&&r.conf.once&&r.conf.onceCollection.removeListener(r.event,r.qualifier,r.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},ws=function(e){return _e(e)?new yn(e):e},Yf={createEmitter:function(){for(var e=0;e<this.length;e++){var r=this[e],n=r._private;n.emitter||(n.emitter=new ys(sw,r))}return this},emitter:function(){return this._private.emitter},on:function(e,r,n){for(var a=ws(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n)}return this},removeListener:function(e,r,n){for(var a=ws(r),i=0;i<this.length;i++){var s=this[i];s.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var r=this[e];r.emitter().removeAllListeners()}return this},one:function(e,r,n){for(var a=ws(r),i=0;i<this.length;i++){var s=this[i];s.emitter().one(e,a,n)}return this},once:function(e,r,n){for(var a=ws(r),i=0;i<this.length;i++){var s=this[i];s.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,r){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,r)}return this},emitAndNotify:function(e,r){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,r),this}};gt.eventAliasesOn(Yf);var Zf={nodes:function(e){return this.filter(function(r){return r.isNode()}).filter(e)},edges:function(e){return this.filter(function(r){return r.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),r=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):r.push(a)}return{nodes:e,edges:r}},filter:function(e,r){if(e===void 0)return this;if(_e(e)||br(e))return new yn(e).filter(this);if(Tt(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i],o=r?e.apply(r,[s,i,a]):e(s,i,a);o&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){_e(e)&&(e=this.filter(e));for(var r=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||r.push(a)}return r}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(_e(e)){var r=e;return this.filter(r)}for(var n=this.spawn(),a=this,i=e,s=this.length<e.length,o=s?a:i,u=s?i:a,l=0;l<o.length;l++){var f=o[l];u.has(f)&&n.push(f)}return n},xor:function(e){var r=this._private.cy;_e(e)&&(e=r.$(e));var n=this.spawn(),a=this,i=e,s=function(u,l){for(var f=0;f<u.length;f++){var d=u[f],g=d._private.data.id,m=l.hasElementWithId(g);m||n.push(d)}};return s(a,i),s(i,a),n},diff:function(e){var r=this._private.cy;_e(e)&&(e=r.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),s=this,o=e,u=function(f,d,g){for(var m=0;m<f.length;m++){var p=f[m],b=p._private.data.id,x=d.hasElementWithId(b);x?i.merge(p):g.push(p)}};return u(s,o,n),u(o,s,a),{left:n,right:a,both:i}},add:function(e){var r=this._private.cy;if(!e)return this;if(_e(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i],o=!this.has(s);o&&a.push(s)}return a},merge:function(e){var r=this._private,n=r.cy;if(!e)return this;if(e&&_e(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=r.map,s=0;s<e.length;s++){var o=e[s],u=o._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=o,i.set(u,{ele:o,index:f})}}return this},unmergeAt:function(e){var r=this[e],n=r.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var s=e===this.length-1;if(this.length>1&&!s){var o=this.length-1,u=this[o],l=u._private.data.id;this[o]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var r=this._private,n=e._private.data.id,a=r.map,i=a.get(n);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},unmerge:function(e){var r=this._private.cy;if(!e)return this;if(e&&_e(e)){var n=e;e=r.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var r=this.length-1;r>=0;r--){var n=this[r];e(n)&&this.unmergeAt(r)}return this},map:function(e,r){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],o=r?e.apply(r,[s,i,a]):e(s,i,a);n.push(o)}return n},reduce:function(e,r){for(var n=r,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,r){for(var n=-1/0,a,i=this,s=0;s<i.length;s++){var o=i[s],u=r?e.apply(r,[o,s,i]):e(o,s,i);u>n&&(n=u,a=o)}return{value:n,ele:a}},min:function(e,r){for(var n=1/0,a,i=this,s=0;s<i.length;s++){var o=i[s],u=r?e.apply(r,[o,s,i]):e(o,s,i);u<n&&(n=u,a=o)}return{value:n,ele:a}}},dt=Zf;dt.u=dt["|"]=dt["+"]=dt.union=dt.or=dt.add,dt["\\"]=dt["!"]=dt["-"]=dt.difference=dt.relativeComplement=dt.subtract=dt.not,dt.n=dt["&"]=dt["."]=dt.and=dt.intersection=dt.intersect,dt["^"]=dt["(+)"]=dt["(-)"]=dt.symmetricDifference=dt.symdiff=dt.xor,dt.fnFilter=dt.filterFn=dt.stdFilter=dt.filter,dt.complement=dt.abscomp=dt.absoluteComplement;var ow={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}},Qf=function(e,r){var n=e.cy(),a=n.hasCompoundNodes();function i(f){var d=f.pstyle("z-compound-depth");return d.value==="auto"?a?f.zDepth():0:d.value==="bottom"?-1:d.value==="top"?yo:0}var s=i(e)-i(r);if(s!==0)return s;function o(f){var d=f.pstyle("z-index-compare");return d.value==="auto"&&f.isNode()?1:0}var u=o(e)-o(r);if(u!==0)return u;var l=e.pstyle("z-index").value-r.pstyle("z-index").value;return l!==0?l:e.poolIndex()-r.poolIndex()},bs={forEach:function(e,r){if(Tt(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],s=r?e.apply(r,[i,a,this]):e(i,a,this);if(s===!1)break}return this},toArray:function(){for(var e=[],r=0;r<this.length;r++)e.push(this[r]);return e},slice:function(e,r){var n=[],a=this.length;r==null&&(r=a),e==null&&(e=0),e<0&&(e=a+e),r<0&&(r=a+r);for(var i=e;i>=0&&i<r&&i<a;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Tt(e))return this;var r=this.toArray().sort(e);return this.spawn(r)},sortByZIndex:function(){return this.sort(Qf)},zDepth:function(){var e=this[0];if(e){var r=e._private,n=r.group;if(n==="nodes"){var a=r.data.parent?e.parents().size():0;return e.isParent()?a:yo-1}else{var i=r.source,s=r.target,o=i.zDepth(),u=s.zDepth();return Math.max(o,u,0)}}}};bs.each=bs.forEach;var uw=function(){var e="undefined",r=(typeof Symbol>"u"?"undefined":It(Symbol))!=e&&It(Symbol.iterator)!=e;r&&(bs[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return fl({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};uw();var lw=_t({nodeDimensionsIncludeLabels:!1}),xs={layoutDimensions:function(e){e=lw(e);var r;if(!this.takesUpSpace())r={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();r={w:n.w,h:n.h}}else r={w:this.outerWidth(),h:this.outerHeight()};return(r.w===0||r.h===0)&&(r.w=r.h=1),r},layoutPositions:function(e,r,n){var a=this.nodes().filter(function(R){return!R.isParent()}),i=this.cy(),s=r.eles,o=function(A){return A.id()},u=Wa(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(A,h,I){var D={x:h.x1+h.w/2,y:h.y1+h.h/2},M={x:(I.x-D.x)*A,y:(I.y-D.y)*A};return{x:D.x+M.x,y:D.y+M.y}},f=r.spacingFactor&&r.spacingFactor!==1,d=function(){if(!f)return null;for(var A=fr(),h=0;h<a.length;h++){var I=a[h],D=u(I,h);fp(A,D.x,D.y)}return A},g=d(),m=Wa(function(R,A){var h=u(R,A);if(f){var I=Math.abs(r.spacingFactor);h=l(I,g,h)}return r.transform!=null&&(h=r.transform(R,h)),h},o);if(r.animate){for(var p=0;p<a.length;p++){var b=a[p],x=m(b,p),w=r.animateFilter==null||r.animateFilter(b,p);if(w){var E=b.animation({position:x,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(E)}else b.position(x)}if(r.fit){var C=i.animation({fit:{boundingBox:s.boundingBoxAt(m),padding:r.padding},duration:r.animationDuration,easing:r.animationEasing});e.animations.push(C)}else if(r.zoom!==void 0&&r.pan!==void 0){var k=i.animation({zoom:r.zoom,pan:r.pan,duration:r.animationDuration,easing:r.animationEasing});e.animations.push(k)}e.animations.forEach(function(R){return R.play()}),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),ha.all(e.animations.map(function(R){return R.promise()})).then(function(){e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(m),r.fit&&i.fit(r.eles,r.padding),r.zoom!=null&&i.zoom(r.zoom),r.pan&&i.pan(r.pan),e.one("layoutready",r.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",r.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){var r=this.cy();return r.makeLayout(Ve({},e,{eles:this}))}};xs.createLayout=xs.makeLayout=xs.layout;function Jf(t,e,r){var n=r._private,a=n.styleCache=n.styleCache||[],i;return(i=a[t])!=null||(i=a[t]=e(r)),i}function Fs(t,e){return t=vn(t),function(n){return Jf(t,e,n)}}function Es(t,e){t=vn(t);var r=function(a){return e.call(a)};return function(){var a=this[0];if(a)return Jf(t,r,a)}}var Ht={recalculateRenderedStyle:function(e){var r=this.cy(),n=r.renderer(),a=r.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),r=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(r)}else this.forEach(function(a){r(a),a.connectedEdges().forEach(r)});return this},updateStyle:function(e){var r=this._private.cy;if(!r.styleEnabled())return this;if(r.batching()){var n=r._private.batchStyleEles;return n.merge(this),this}var a=r.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var s=i;return e?s.emitAndNotify("style"):s.emit("style"),i.forEach(function(o){return o._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var r=0;r<this.length;r++){var n=this[r];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(r?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var n=r.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},renderedStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=this[0];if(n)return r.style().getRenderedStyle(n,e)},style:function(e,r){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(st(e)){var s=e;i.applyBypass(this,s,a),this.emitAndNotify("style")}else if(_e(e))if(r===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,r,a),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var r=this.cy();if(!r.styleEnabled())return this;var n=!1,a=r.style(),i=this;if(e===void 0)for(var s=0;s<i.length;s++){var o=i[s];a.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];a.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 r=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!r)return i;var s=a.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++){var u=s[o],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0],n=r.cy().hasCompoundNodes();if(r)return n?r.effectiveOpacity()===0:r.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var r=this[0];return!!r._private.backgrounding}};function qo(t,e){var r=t._private,n=r.data.parent?t.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function Ho(t){var e=t.ok,r=t.edgeOkViaNode||t.ok,n=t.parentOk||t.ok;return function(){var a=this.cy();if(!a.styleEnabled())return!0;var i=this[0],s=a.hasCompoundNodes();if(i){var o=i._private;if(!e(i))return!1;if(i.isNode())return!s||qo(i,n);var u=o.source,l=o.target;return r(u)&&(!s||qo(u,r))&&(u===l||r(l)&&(!s||qo(l,r)))}}}var Fa=Fs("eleTakesUpSpace",function(t){return t.pstyle("display").value==="element"&&t.width()!==0&&(t.isNode()?t.height()!==0:!0)});Ht.takesUpSpace=Es("takesUpSpace",Ho({ok:Fa}));var fw=Fs("eleInteractive",function(t){return t.pstyle("events").value==="yes"&&t.pstyle("visibility").value==="visible"&&Fa(t)}),cw=Fs("parentInteractive",function(t){return t.pstyle("visibility").value==="visible"&&Fa(t)});Ht.interactive=Es("interactive",Ho({ok:fw,parentOk:cw,edgeOkViaNode:Fa})),Ht.noninteractive=function(){var t=this[0];if(t)return!t.interactive()};var dw=Fs("eleVisible",function(t){return t.pstyle("visibility").value==="visible"&&t.pstyle("opacity").pfValue!==0&&Fa(t)}),vw=Fa;Ht.visible=Es("visible",Ho({ok:dw,edgeOkViaNode:vw})),Ht.hidden=function(){var t=this[0];if(t)return!t.visible()},Ht.isBundledBezier=Es("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1}),Ht.bypass=Ht.css=Ht.style,Ht.renderedCss=Ht.renderedStyle,Ht.removeBypass=Ht.removeCss=Ht.removeStyle,Ht.pstyle=Ht.parsedStyle;var En={};function jf(t){return function(){var e=arguments,r=[];if(e.length===2){var n=e[0],a=e[1];this.on(t.event,n,a)}else if(e.length===1&&Tt(e[0])){var i=e[0];this.on(t.event,i)}else if(e.length===0||e.length===1&&bt(e[0])){for(var s=e.length===1?e[0]:null,o=0;o<this.length;o++){var u=this[o],l=!t.ableField||u._private[t.ableField],f=u._private[t.field]!=t.value;if(t.overrideAble){var d=t.overrideAble(u);if(d!==void 0&&(l=d,!d))return this}l&&(u._private[t.field]=t.value,f&&r.push(u))}var g=this.spawn(r);g.updateStyle(),g.emit(t.event),s&&g.emit(s)}return this}}function Ea(t){En[t.field]=function(){var e=this[0];if(e){if(t.overrideField){var r=t.overrideField(e);if(r!==void 0)return r}return e._private[t.field]}},En[t.on]=jf({event:t.on,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!0}),En[t.off]=jf({event:t.off,field:t.field,ableField:t.ableField,overrideAble:t.overrideAble,value:!1})}Ea({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"}),Ea({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"}),Ea({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"}),Ea({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"}),En.deselect=En.unselect,En.grabbed=function(){var t=this[0];if(t)return t._private.grabbed},Ea({field:"active",on:"activate",off:"unactivate"}),Ea({field:"pannable",on:"panify",off:"unpanify"}),En.inactive=function(){var t=this[0];if(t)return!t._private.active};var Zt={},ec=function(e){return function(n){for(var a=this,i=[],s=0;s<a.length;s++){var o=a[s];if(o.isNode()){for(var u=!1,l=o.connectedEdges(),f=0;f<l.length;f++){var d=l[f],g=d.source(),m=d.target();if(e.noIncomingEdges&&m===o&&g!==o||e.noOutgoingEdges&&g===o&&m!==o){u=!0;break}}u||i.push(o)}}return this.spawn(i,!0).filter(n)}},tc=function(e){return function(r){for(var n=this,a=[],i=0;i<n.length;i++){var s=n[i];if(s.isNode())for(var o=s.connectedEdges(),u=0;u<o.length;u++){var l=o[u],f=l.source(),d=l.target();e.outgoing&&f===s?(a.push(l),a.push(d)):e.incoming&&d===s&&(a.push(l),a.push(f))}}return this.spawn(a,!0).filter(r)}},rc=function(e){return function(r){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(s.length===0)break;for(var o=!1,u=0;u<s.length;u++){var l=s[u],f=l.id();i[f]||(i[f]=!0,a.push(l),o=!0)}if(!o)break;n=s}return this.spawn(a,!0).filter(r)}};Zt.clearTraversalCache=function(){for(var t=0;t<this.length;t++)this[t]._private.traversalCache=null},Ve(Zt,{roots:ec({noIncomingEdges:!0}),leaves:ec({noOutgoingEdges:!0}),outgoers:Sr(tc({outgoing:!0}),"outgoers"),successors:rc({outgoing:!0}),incomers:Sr(tc({incoming:!0}),"incomers"),predecessors:rc({incoming:!0})}),Ve(Zt,{neighborhood:Sr(function(t){for(var e=[],r=this.nodes(),n=0;n<r.length;n++)for(var a=r[n],i=a.connectedEdges(),s=0;s<i.length;s++){var o=i[s],u=o.source(),l=o.target(),f=a===u?l:u;f.length>0&&e.push(f[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),Zt.neighbourhood=Zt.neighborhood,Zt.closedNeighbourhood=Zt.closedNeighborhood,Zt.openNeighbourhood=Zt.openNeighborhood,Ve(Zt,{source:Sr(function(e){var r=this[0],n;return r&&(n=r._private.source||r.cy().collection()),n&&e?n.filter(e):n},"source"),target:Sr(function(e){var r=this[0],n;return r&&(n=r._private.target||r.cy().collection()),n&&e?n.filter(e):n},"target"),sources:nc({attr:"source"}),targets:nc({attr:"target"})});function nc(t){return function(r){for(var n=[],a=0;a<this.length;a++){var i=this[a],s=i._private[t.attr];s&&n.push(s)}return this.spawn(n,!0).filter(r)}}Ve(Zt,{edgesWith:Sr(ac(),"edgesWith"),edgesTo:Sr(ac({thisIsSrc:!0}),"edgesTo")});function ac(t){return function(r){var n=[],a=this._private.cy,i=t||{};_e(r)&&(r=a.$(r));for(var s=0;s<r.length;s++)for(var o=r[s]._private.edges,u=0;u<o.length;u++){var l=o[u],f=l._private.data,d=this.hasElementWithId(f.source)&&r.hasElementWithId(f.target),g=r.hasElementWithId(f.source)&&this.hasElementWithId(f.target),m=d||g;m&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!g)||n.push(l))}return this.spawn(n,!0)}}Ve(Zt,{connectedEdges:Sr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++){var o=i[s];e.push(o)}}return this.spawn(e,!0).filter(t)},"connectedEdges"),connectedNodes:Sr(function(t){for(var e=[],r=this,n=0;n<r.length;n++){var a=r[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(t)},"connectedNodes"),parallelEdges:Sr(ic(),"parallelEdges"),codirectedEdges:Sr(ic({codirected:!0}),"codirectedEdges")});function ic(t){var e={codirected:!1};return t=Ve({},e,t),function(n){for(var a=[],i=this.edges(),s=t,o=0;o<i.length;o++)for(var u=i[o],l=u._private,f=l.source,d=f._private.data.id,g=l.data.target,m=f._private.edges,p=0;p<m.length;p++){var b=m[p],x=b._private.data,w=x.target,E=x.source,C=w===g&&E===d,k=d===w&&g===E;(s.codirected&&C||!s.codirected&&(C||k))&&a.push(b)}return this.spawn(a,!0).filter(n)}}Ve(Zt,{components:function(e){var r=this,n=r.cy(),a=n.collection(),i=e==null?r.nodes():e.nodes(),s=[];e!=null&&i.empty()&&(i=e.sources());var o=function(f,d){a.merge(f),i.unmerge(f),d.merge(f)};if(i.empty())return r.spawn();var u=function(){var f=n.collection();s.push(f);var d=i[0];o(d,f),r.bfs({directed:!1,roots:d,visit:function(m){return o(m,f)}}),f.forEach(function(g){g.connectedEdges().forEach(function(m){r.has(m)&&f.has(m.source())&&f.has(m.target())&&f.merge(m)})})};do u();while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),Zt.componentsOf=Zt.components;var Wt=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){St("A collection must have a reference to the core");return}var i=new zr,s=!1;if(!r)r=[];else if(r.length>0&&st(r[0])&&!Ha(r[0])){s=!0;for(var o=[],u=new oa,l=0,f=r.length;l<f;l++){var d=r[l];d.data==null&&(d.data={});var g=d.data;if(g.id==null)g.id=Ll();else if(e.hasElementWithId(g.id)||u.has(g.id))continue;var m=new Ji(e,d,!1);o.push(m),u.add(g.id)}r=o}this.length=0;for(var p=0,b=r.length;p<b;p++){var x=r[p][0];if(x!=null){var w=x._private.data.id;(!n||!i.has(w))&&(n&&i.set(w,{index:this.length,ele:x}),this[this.length]=x,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(E){this.lazyMap=E},rebuildMap:function(){for(var C=this.lazyMap=new zr,k=this.eles,R=0;R<k.length;R++){var A=k[R];C.set(A.id(),{index:R,ele:A})}}},n&&(this._private.map=i),s&&!a&&this.restore()},xt=Ji.prototype=Wt.prototype=Object.create(Array.prototype);xt.instanceString=function(){return"collection"},xt.spawn=function(t,e){return new Wt(this.cy(),t,e)},xt.spawnSelf=function(){return this.spawn(this)},xt.cy=function(){return this._private.cy},xt.renderer=function(){return this._private.cy.renderer()},xt.element=function(){return this[0]},xt.collection=function(){return hl(this)?this:new Wt(this._private.cy,[this])},xt.unique=function(){return new Wt(this._private.cy,this,!0)},xt.hasElementWithId=function(t){return t=""+t,this._private.map.has(t)},xt.getElementById=function(t){t=""+t;var e=this._private.cy,r=this._private.map.get(t);return r?r.ele:new Wt(e)},xt.$id=xt.getElementById,xt.poolIndex=function(){var t=this._private.cy,e=t._private.elements,r=this[0]._private.data.id;return e._private.map.get(r).index},xt.indexOf=function(t){var e=t[0]._private.data.id;return this._private.map.get(e).index},xt.indexOfId=function(t){return t=""+t,this._private.map.get(t).index},xt.json=function(t){var e=this.element(),r=this.cy();if(e==null&&t)return this;if(e!=null){var n=e._private;if(st(t)){if(r.startBatch(),t.data){e.data(t.data);var a=n.data;if(e.isEdge()){var i=!1,s={},o=t.data.source,u=t.data.target;o!=null&&o!=a.source&&(s.source=""+o,i=!0),u!=null&&u!=a.target&&(s.target=""+u,i=!0),i&&(e=e.move(s))}else{var l="parent"in t.data,f=t.data.parent;l&&(f!=null||a.parent!=null)&&f!=a.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}t.position&&e.position(t.position);var d=function(b,x,w){var E=t[b];E!=null&&E!==n[b]&&(E?e[x]():e[w]())};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"),t.classes!=null&&e.classes(t.classes),r.endBatch(),this}else if(t===void 0){var g={data:_r(n.data),position:_r(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};g.classes="";var m=0;return n.classes.forEach(function(p){return g.classes+=m++===0?p:" "+p}),g}}},xt.jsons=function(){for(var t=[],e=0;e<this.length;e++){var r=this[e],n=r.json();t.push(n)}return t},xt.clone=function(){for(var t=this.cy(),e=[],r=0;r<this.length;r++){var n=this[r],a=n.json(),i=new Ji(t,a,!1);e.push(i)}return new Wt(t,e)},xt.copy=xt.clone,xt.restore=function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=r.cy(),a=n._private,i=[],s=[],o,u=0,l=r.length;u<l;u++){var f=r[u];e&&!f.removed()||(f.isNode()?i.push(f):s.push(f))}o=i.concat(s);var d,g=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var m=o[d],p=m._private,b=p.data;if(m.clearTraversalCache(),!(!e&&!p.removed)){if(b.id===void 0)b.id=Ll();else if(Se(b.id))b.id=""+b.id;else if(cn(b.id)||!_e(b.id)){St("Can not create element with invalid string ID `"+b.id+"`"),g();continue}else if(n.hasElementWithId(b.id)){St("Can not create second element with ID `"+b.id+"`"),g();continue}}var x=b.id;if(m.isNode()){var w=p.position;w.x==null&&(w.x=0),w.y==null&&(w.y=0)}if(m.isEdge()){for(var E=m,C=["source","target"],k=C.length,R=!1,A=0;A<k;A++){var h=C[A],I=b[h];Se(I)&&(I=b[h]=""+b[h]),I==null||I===""?(St("Can not create edge `"+x+"` with unspecified "+h),R=!0):n.hasElementWithId(I)||(St("Can not create edge `"+x+"` with nonexistant "+h+" `"+I+"`"),R=!0)}if(R){g();continue}var D=n.getElementById(b.source),M=n.getElementById(b.target);D.same(M)?D._private.edges.push(E):(D._private.edges.push(E),M._private.edges.push(E)),E._private.source=D,E._private.target=M}p.map=new zr,p.map.set(x,{ele:m,index:0}),p.removed=!1,e&&n.addToPool(m)}for(var L=0;L<i.length;L++){var B=i[L],N=B._private.data;Se(N.parent)&&(N.parent=""+N.parent);var _=N.parent,U=_!=null;if(U||B._private.parent){var H=B._private.parent?n.collection().merge(B._private.parent):n.getElementById(_);if(H.empty())N.parent=void 0;else if(H[0].removed())ht("Node added with missing parent, reference to parent removed"),N.parent=void 0,B._private.parent=null;else{for(var W=!1,X=H;!X.empty();){if(B.same(X)){W=!0,N.parent=void 0;break}X=X.parent()}W||(H[0]._private.children.push(B),B._private.parent=H[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Q=o.length===r.length?r:new Wt(n,o),se=0;se<Q.length;se++){var j=Q[se];j.isNode()||(j.parallelEdges().clearTraversalCache(),j.source().clearTraversalCache(),j.target().clearTraversalCache())}var ee;a.hasCompoundNodes?ee=n.collection().merge(Q).merge(Q.connectedNodes()).merge(Q.parent()):ee=Q,ee.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t),t?Q.emitAndNotify("add"):e&&Q.emit("add")}return r},xt.removed=function(){var t=this[0];return t&&t._private.removed},xt.inside=function(){var t=this[0];return t&&!t._private.removed},xt.remove=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,n=[],a={},i=r._private.cy;function s(_){for(var U=_._private.edges,H=0;H<U.length;H++)u(U[H])}function o(_){for(var U=_._private.children,H=0;H<U.length;H++)u(U[H])}function u(_){var U=a[_.id()];e&&_.removed()||U||(a[_.id()]=!0,_.isNode()?(n.push(_),s(_),o(_)):n.unshift(_))}for(var l=0,f=r.length;l<f;l++){var d=r[l];u(d)}function g(_,U){var H=_._private.edges;hn(H,U),_.clearTraversalCache()}function m(_){_.clearTraversalCache()}var p=[];p.ids={};function b(_,U){U=U[0],_=_[0];var H=_._private.children,W=_.id();hn(H,U),U._private.parent=null,p.ids[W]||(p.ids[W]=!0,p.push(_))}r.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var x=0;x<n.length;x++){var w=n[x];if(w.isEdge()){var E=w.source()[0],C=w.target()[0];g(E,w),g(C,w);for(var k=w.parallelEdges(),R=0;R<k.length;R++){var A=k[R];m(A),A.isBundledBezier()&&A.dirtyBoundingBoxCache()}}else{var h=w.parent();h.length!==0&&b(h,w)}e&&(w._private.removed=!0)}var I=i._private.elements;i._private.hasCompoundNodes=!1;for(var D=0;D<I.length;D++){var M=I[D];if(M.isParent()){i._private.hasCompoundNodes=!0;break}}var L=new Wt(this.cy(),n);L.size()>0&&(t?L.emitAndNotify("remove"):e&&L.emit("remove"));for(var B=0;B<p.length;B++){var N=p[B];(!e||!N.removed())&&N.updateStyle()}return L},xt.move=function(t){var e=this._private.cy,r=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(t.source!==void 0||t.target!==void 0){var s=i(t.source),o=i(t.target),u=s!=null&&e.hasElementWithId(s),l=o!=null&&e.hasElementWithId(o);(u||l)&&(e.batch(function(){r.remove(n,a),r.emitAndNotify("moveout");for(var m=0;m<r.length;m++){var p=r[m],b=p._private.data;p.isEdge()&&(u&&(b.source=s),l&&(b.target=o))}r.restore(n,a)}),r.emitAndNotify("move"))}else if(t.parent!==void 0){var f=i(t.parent),d=f===null||e.hasElementWithId(f);if(d){var g=f===null?void 0:f;e.batch(function(){var m=r.remove(n,a);m.emitAndNotify("moveout");for(var p=0;p<r.length;p++){var b=r[p],x=b._private.data;b.isNode()&&(x.parent=g)}m.restore(n,a)}),r.emitAndNotify("move")}}return this},[lf,Cy,hs,bn,wa,Vy,gs,rw,Yf,Zf,ow,bs,xs,Ht,En,Zt].forEach(function(t){Ve(xt,t)});var hw={add:function(e){var r,n=this;if(br(e)){var a=e;if(a._private.cy===n)r=a.restore();else{for(var i=[],s=0;s<a.length;s++){var o=a[s];i.push(o.json())}r=new Wt(n,i)}}else if(bt(e)){var u=e;r=new Wt(n,u)}else if(st(e)&&(bt(e.nodes)||bt(e.edges))){for(var l=e,f=[],d=["nodes","edges"],g=0,m=d.length;g<m;g++){var p=d[g],b=l[p];if(bt(b))for(var x=0,w=b.length;x<w;x++){var E=Ve({group:p},b[x]);f.push(E)}}r=new Wt(n,f)}else{var C=e;r=new Ji(n,C).collection()}return r},remove:function(e){if(!br(e)){if(_e(e)){var r=e;e=this.$(r)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function gw(t,e,r,n){var a=4,i=.001,s=1e-7,o=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;t=Math.min(t,1),r=Math.min(r,1),t=Math.max(t,0),r=Math.max(r,0);var g=f?new Float32Array(u):new Array(u);function m(M,L){return 1-3*L+3*M}function p(M,L){return 3*L-6*M}function b(M){return 3*M}function x(M,L,B){return((m(L,B)*M+p(L,B))*M+b(L))*M}function w(M,L,B){return 3*m(L,B)*M*M+2*p(L,B)*M+b(L)}function E(M,L){for(var B=0;B<a;++B){var N=w(L,t,r);if(N===0)return L;var _=x(L,t,r)-M;L-=_/N}return L}function C(){for(var M=0;M<u;++M)g[M]=x(M*l,t,r)}function k(M,L,B){var N,_,U=0;do _=L+(B-L)/2,N=x(_,t,r)-M,N>0?B=_:L=_;while(Math.abs(N)>s&&++U<o);return _}function R(M){for(var L=0,B=1,N=u-1;B!==N&&g[B]<=M;++B)L+=l;--B;var _=(M-g[B])/(g[B+1]-g[B]),U=L+_*l,H=w(U,t,r);return H>=i?E(M,U):H===0?U:k(M,L,L+l)}var A=!1;function h(){A=!0,(t!==e||r!==n)&&C()}var I=function(L){return A||h(),t===e&&r===n?L:L===0?0:L===1?1:x(R(L),e,n)};I.getControlPoints=function(){return[{x:t,y:e},{x:r,y:n}]};var D="generateBezier("+[t,e,r,n]+")";return I.toString=function(){return D},I}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var pw=function(){function t(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var s={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:s.v,dv:t(s)}}function r(n,a){var i={dx:n.v,dv:t(n)},s=e(n,a*.5,i),o=e(n,a*.5,s),u=e(n,a,o),l=1/6*(i.dx+2*(s.dx+o.dx)+u.dx),f=1/6*(i.dv+2*(s.dv+o.dv)+u.dv);return n.x=n.x+l*a,n.v=n.v+f*a,n}return function n(a,i,s){var o={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,d=16/1e3,g,m,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,o.tension=a,o.friction=i,g=s!==null,g?(l=n(a,i),m=l/s*d):m=d;p=r(p||o,m),u.push(1+p.x),l+=16,Math.abs(p.x)>f&&Math.abs(p.v)>f;);return g?function(b){return u[b*(u.length-1)|0]}:l}}(),Ft=function(e,r,n,a){var i=gw(e,r,n,a);return function(s,o,u){return s+(o-s)*i(u)}},Cs={linear:function(e,r,n){return e+(r-e)*n},ease:Ft(.25,.1,.25,1),"ease-in":Ft(.42,0,1,1),"ease-out":Ft(0,0,.58,1),"ease-in-out":Ft(.42,0,.58,1),"ease-in-sine":Ft(.47,0,.745,.715),"ease-out-sine":Ft(.39,.575,.565,1),"ease-in-out-sine":Ft(.445,.05,.55,.95),"ease-in-quad":Ft(.55,.085,.68,.53),"ease-out-quad":Ft(.25,.46,.45,.94),"ease-in-out-quad":Ft(.455,.03,.515,.955),"ease-in-cubic":Ft(.55,.055,.675,.19),"ease-out-cubic":Ft(.215,.61,.355,1),"ease-in-out-cubic":Ft(.645,.045,.355,1),"ease-in-quart":Ft(.895,.03,.685,.22),"ease-out-quart":Ft(.165,.84,.44,1),"ease-in-out-quart":Ft(.77,0,.175,1),"ease-in-quint":Ft(.755,.05,.855,.06),"ease-out-quint":Ft(.23,1,.32,1),"ease-in-out-quint":Ft(.86,0,.07,1),"ease-in-expo":Ft(.95,.05,.795,.035),"ease-out-expo":Ft(.19,1,.22,1),"ease-in-out-expo":Ft(1,0,0,1),"ease-in-circ":Ft(.6,.04,.98,.335),"ease-out-circ":Ft(.075,.82,.165,1),"ease-in-out-circ":Ft(.785,.135,.15,.86),spring:function(e,r,n){if(n===0)return Cs.linear;var a=pw(e,r,n);return function(i,s,o){return i+(s-i)*a(o)}},"cubic-bezier":Ft};function sc(t,e,r,n,a){if(n===1||e===r)return r;var i=a(e,r,n);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}function oc(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}function Ca(t,e,r,n,a){var i=a!=null?a.type:null;r<0?r=0:r>1&&(r=1);var s=oc(t,a),o=oc(e,a);if(Se(s)&&Se(o))return sc(i,s,o,r,n);if(bt(s)&&bt(o)){for(var u=[],l=0;l<o.length;l++){var f=s[l],d=o[l];if(f!=null&&d!=null){var g=sc(i,f,d,r,n);u.push(g)}else u.push(d)}return u}}function mw(t,e,r,n){var a=!n,i=t._private,s=e._private,o=s.easing,u=s.startTime,l=n?t:t.cy(),f=l.style();if(!s.easingImpl)if(o==null)s.easingImpl=Cs.linear;else{var d;if(_e(o)){var g=f.parse("transition-timing-function",o);d=g.value}else d=o;var m,p;_e(d)?(m=d,p=[]):(m=d[1],p=d.slice(2).map(function(Q){return+Q})),p.length>0?(m==="spring"&&p.push(s.duration),s.easingImpl=Cs[m].apply(null,p)):s.easingImpl=Cs[m]}var b=s.easingImpl,x;if(s.duration===0?x=1:x=(r-u)/s.duration,s.applying&&(x=s.progress),x<0?x=0:x>1&&(x=1),s.delay==null){var w=s.startPosition,E=s.position;if(E&&a&&!t.locked()){var C={};ci(w.x,E.x)&&(C.x=Ca(w.x,E.x,x,b)),ci(w.y,E.y)&&(C.y=Ca(w.y,E.y,x,b)),t.position(C)}var k=s.startPan,R=s.pan,A=i.pan,h=R!=null&&n;h&&(ci(k.x,R.x)&&(A.x=Ca(k.x,R.x,x,b)),ci(k.y,R.y)&&(A.y=Ca(k.y,R.y,x,b)),t.emit("pan"));var I=s.startZoom,D=s.zoom,M=D!=null&&n;M&&(ci(I,D)&&(i.zoom=ei(i.minZoom,Ca(I,D,x,b),i.maxZoom)),t.emit("zoom")),(h||M)&&t.emit("viewport");var L=s.style;if(L&&L.length>0&&a){for(var B=0;B<L.length;B++){var N=L[B],_=N.name,U=N,H=s.startStyle[_],W=f.properties[H.name],X=Ca(H,U,x,b,W);f.overrideBypass(t,_,X)}t.emit("style")}}return s.progress=x,x}function ci(t,e){return t==null||e==null?!1:Se(t)&&Se(e)?!0:!!(t&&e)}function yw(t,e,r,n){var a=e._private;a.started=!0,a.startTime=r-a.progress*a.duration}function uc(t,e){var r=e._private.aniEles,n=[];function a(f,d){var g=f._private,m=g.animation.current,p=g.animation.queue,b=!1;if(m.length===0){var x=p.shift();x&&m.push(x)}for(var w=function(A){for(var h=A.length-1;h>=0;h--){var I=A[h];I()}A.splice(0,A.length)},E=m.length-1;E>=0;E--){var C=m[E],k=C._private;if(k.stopped){m.splice(E,1),k.hooked=!1,k.playing=!1,k.started=!1,w(k.frames);continue}!k.playing&&!k.applying||(k.playing&&k.applying&&(k.applying=!1),k.started||yw(f,C,t),mw(f,C,t,d),k.applying&&(k.applying=!1),w(k.frames),k.step!=null&&k.step(t),C.completed()&&(m.splice(E,1),k.hooked=!1,k.playing=!1,k.started=!1,w(k.completes)),b=!0)}return!d&&m.length===0&&p.length===0&&n.push(f),b}for(var i=!1,s=0;s<r.length;s++){var o=r[s],u=a(o);i=i||u}var l=a(e,!0);(i||l)&&(r.length>0?e.notify("draw",r):e.notify("draw")),r.unmerge(n),e.emit("step")}var ww={animate:gt.animate(),animation:gt.animation(),animated:gt.animated(),clearQueue:gt.clearQueue(),delay:gt.delay(),delayAnimation:gt.delayAnimation(),stop:gt.stop(),addToAnimationPool:function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&Yi(function(i){uc(i,e),r()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){uc(s,e)},n.beforeRenderPriorities.animations):r()}},bw={qualifierCompare:function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},eventMatches:function(e,r,n){var a=r.qualifier;return a!=null?e!==n.target&&Ha(n.target)&&a.matches(n.target):!0},addEventFields:function(e,r){r.cy=e,r.target=e},callbackContext:function(e,r,n){return r.qualifier!=null?n.target:e}},Ts=function(e){return _e(e)?new yn(e):e},lc={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new ys(bw,this)),this},emitter:function(){return this._private.emitter},on:function(e,r,n){return this.emitter().on(e,Ts(r),n),this},removeListener:function(e,r,n){return this.emitter().removeListener(e,Ts(r),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,r,n){return this.emitter().one(e,Ts(r),n),this},once:function(e,r,n){return this.emitter().one(e,Ts(r),n),this},emit:function(e,r){return this.emitter().emit(e,r),this},emitAndNotify:function(e,r){return this.emit(e),this.notify(e,r),this}};gt.eventAliasesOn(lc);var Wo={png:function(e){var r=this._private.renderer;return e=e||{},r.png(e)},jpg:function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)}};Wo.jpeg=Wo.jpg;var Ss={layout:function(e){var r=this;if(e==null){St("Layout options must be specified to make a layout");return}if(e.name==null){St("A `name` must be specified to make a layout");return}var n=e.name,a=r.extension("layout",n);if(a==null){St("No such layout `"+n+"` found.  Did you forget to import it and `cytoscape.use()` it?");return}var i;_e(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new a(Ve({},e,{cy:r,eles:i}));return s}};Ss.createLayout=Ss.makeLayout=Ss.layout;var xw={notify:function(e,r){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();r!=null&&a.merge(r);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},notifications:function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.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 r=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?r.notify(n):r.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var r=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i],o=r.getElementById(i);o.data(s)}})}},Fw=_t({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:12,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),Uo={renderTo:function(e,r,n,a){var i=this._private.renderer;return i.renderTo(e,r,n,a),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 r=this,n=r.extension("renderer",e.name);if(n==null){St("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&ht("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 a=Fw(e);a.cy=r,r._private.renderer=new n(a),this.notify("init")},destroyRenderer:function(){var e=this;e.notify("destroy");var r=e.container();if(r)for(r._cyreg=null;r.childNodes.length>0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var a=n._private;a.rscratch={},a.rstyle={},a.animation.current=[],a.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};Uo.invalidateDimensions=Uo.resize;var Ds={collection:function(e,r){return _e(e)?this.$(e):br(e)?e.collection():bt(e)?(r||(r={}),new Wt(this,e,r.unique,r.removed)):new Wt(this)},nodes:function(e){var r=this.$(function(n){return n.isNode()});return e?r.filter(e):r},edges:function(e){var r=this.$(function(n){return n.isEdge()});return e?r.filter(e):r},$:function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},mutableElements:function(){return this._private.elements}};Ds.elements=Ds.filter=Ds.$;var Qt={},di="t",Ew="f";Qt.apply=function(t){for(var e=this,r=e._private,n=r.cy,a=n.collection(),i=0;i<t.length;i++){var s=t[i],o=e.getContextMeta(s);if(!o.empty){var u=e.getContextStyle(o),l=e.applyContextStyle(o,u,s);s._private.appliedInitStyle?e.updateTransitions(s,l.diffProps):s._private.appliedInitStyle=!0;var f=e.updateStyleHints(s);f&&a.push(s)}}return a},Qt.getPropertiesDiff=function(t,e){var r=this,n=r._private.propDiffs=r._private.propDiffs||{},a=t+"-"+e,i=n[a];if(i)return i;for(var s=[],o={},u=0;u<r.length;u++){var l=r[u],f=t[u]===di,d=e[u]===di,g=f!==d,m=l.mappedProperties.length>0;if(g||d&&m){var p=void 0;g&&m||g?p=l.properties:m&&(p=l.mappedProperties);for(var b=0;b<p.length;b++){for(var x=p[b],w=x.name,E=!1,C=u+1;C<r.length;C++){var k=r[C],R=e[C]===di;if(R&&(E=k.properties[x.name]!=null,E))break}!o[w]&&!E&&(o[w]=!0,s.push(w))}}}return n[a]=s,s},Qt.getContextMeta=function(t){for(var e=this,r="",n,a=t._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i],o=s.selector&&s.selector.matches(t);o?r+=di:r+=Ew}return n=e.getPropertiesDiff(a,r),t._private.styleCxtKey=r,{key:r,diffPropNames:n,empty:n.length===0}},Qt.getContextStyle=function(t){var e=t.key,r=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<r.length;i++){var s=r[i],o=e[i]===di;if(o)for(var u=0;u<s.properties.length;u++){var l=s.properties[u];a[l.name]=l}}return n[e]=a,a},Qt.applyContextStyle=function(t,e,r){for(var n=this,a=t.diffPropNames,i={},s=n.types,o=0;o<a.length;o++){var u=a[o],l=e[u],f=r.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===s.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var d=f.mapping,g=d.fnValue=l.value(r);if(g===d.prevFnValue)continue}var m=i[u]={prev:f};n.applyParsedProperty(r,l),m.next=r.pstyle(u),m.next&&m.next.bypass&&(m.next=m.next.bypassed)}}return{diffProps:i}},Qt.updateStyleHints=function(t){var e=t._private,r=this,n=r.propertyGroupNames,a=r.propertyGroupKeys,i=function(oe,ye,De){return r.getPropertiesHash(oe,ye,De)},s=e.styleKey;if(t.removed())return!1;var o=e.group==="nodes",u=t._private.style;n=Object.keys(u);for(var l=0;l<a.length;l++){var f=a[l];e.styleKeys[f]=[sa,Ya]}for(var d=function(oe,ye){return e.styleKeys[ye][0]=Za(oe,e.styleKeys[ye][0])},g=function(oe,ye){return e.styleKeys[ye][1]=Qa(oe,e.styleKeys[ye][1])},m=function(oe,ye){d(oe,ye),g(oe,ye)},p=function(oe,ye){for(var De=0;De<oe.length;De++){var Be=oe.charCodeAt(De);d(Be,ye),g(Be,ye)}},b=2e9,x=function(oe){return-128<oe&&oe<128&&Math.floor(oe)!==oe?b-(oe*1024|0):oe},w=0;w<n.length;w++){var E=n[w],C=u[E];if(C!=null){var k=this.properties[E],R=k.type,A=k.groupKey,h=void 0;k.hashOverride!=null?h=k.hashOverride(t,C):C.pfValue!=null&&(h=C.pfValue);var I=k.enums==null?C.value:null,D=h!=null,M=I!=null,L=D||M,B=C.units;if(R.number&&L&&!R.multiple){var N=D?h:I;m(x(N),A),!D&&B!=null&&p(B,A)}else p(C.strValue,A)}}for(var _=[sa,Ya],U=0;U<a.length;U++){var H=a[U],W=e.styleKeys[H];_[0]=Za(W[0],_[0]),_[1]=Qa(W[1],_[1])}e.styleKey=kg(_[0],_[1]);var X=e.styleKeys;e.labelDimsKey=dn(X.labelDimensions);var Q=i(t,["label"],X.labelDimensions);if(e.labelKey=dn(Q),e.labelStyleKey=dn(Zi(X.commonLabel,Q)),!o){var se=i(t,["source-label"],X.labelDimensions);e.sourceLabelKey=dn(se),e.sourceLabelStyleKey=dn(Zi(X.commonLabel,se));var j=i(t,["target-label"],X.labelDimensions);e.targetLabelKey=dn(j),e.targetLabelStyleKey=dn(Zi(X.commonLabel,j))}if(o){var ee=e.styleKeys,de=ee.nodeBody,ge=ee.nodeBorder,me=ee.nodeOutline,pe=ee.backgroundImage,we=ee.compound,be=ee.pie,ae=[de,ge,me,pe,we,be].filter(function(Y){return Y!=null}).reduce(Zi,[sa,Ya]);e.nodeKey=dn(ae),e.hasPie=be!=null&&be[0]!==sa&&be[1]!==Ya}return s!==e.styleKey},Qt.clearStyleHints=function(t){var e=t._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null},Qt.applyParsedProperty=function(t,e){var r=this,n=e,a=t._private.style,i,s=r.types,o=r.properties[n.name].type,u=n.bypass,l=a[n.name],f=l&&l.bypass,d=t._private,g="mapping",m=function(de){return de==null?null:de.pfValue!=null?de.pfValue:de.value},p=function(){var de=m(l),ge=m(n);r.checkTriggers(t,n.name,de,ge)};if(e.name==="curve-style"&&t.isEdge()&&(e.value!=="bezier"&&t.isLoop()||e.value==="haystack"&&(t.source().isParent()||t.target().isParent()))&&(n=e=this.parse(e.name,"bezier",u)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return l?l.bypass?(a[n.name]=l.bypassed,p(),!0):!1:(p(),!0);var b=function(){ht("Do not assign mappings to elements without corresponding data (i.e. ele `"+t.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case s.mapData:{for(var x=n.field.split("."),w=d.data,E=0;E<x.length&&w;E++){var C=x[E];w=w[C]}if(w==null)return b(),!1;var k;if(Se(w)){var R=n.fieldMax-n.fieldMin;R===0?k=0:k=(w-n.fieldMin)/R}else return ht("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+w+"` for `"+t.id()+"` is non-numeric)"),!1;if(k<0?k=0:k>1&&(k=1),o.color){var A=n.valueMin[0],h=n.valueMax[0],I=n.valueMin[1],D=n.valueMax[1],M=n.valueMin[2],L=n.valueMax[2],B=n.valueMin[3]==null?1:n.valueMin[3],N=n.valueMax[3]==null?1:n.valueMax[3],_=[Math.round(A+(h-A)*k),Math.round(I+(D-I)*k),Math.round(M+(L-M)*k),Math.round(B+(N-B)*k)];i={bypass:n.bypass,name:n.name,value:_,strValue:"rgb("+_[0]+", "+_[1]+", "+_[2]+")"}}else if(o.number){var U=n.valueMin+(n.valueMax-n.valueMin)*k;i=this.parse(n.name,U,n.bypass,g)}else return!1;if(!i)return b(),!1;i.mapping=n,n=i;break}case s.data:{for(var H=n.field.split("."),W=d.data,X=0;X<H.length&&W;X++){var Q=H[X];W=W[Q]}if(W!=null&&(i=this.parse(n.name,W,n.bypass,g)),!i)return b(),!1;i.mapping=n,n=i;break}case s.fn:{var se=n.value,j=n.fnValue!=null?n.fnValue:se(t);if(n.prevFnValue=j,j==null)return ht("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+t.id()+"` is null)"),!1;if(i=this.parse(n.name,j,n.bypass,g),!i)return ht("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+t.id()+"` is invalid)"),!1;i.mapping=_r(n),n=i;break}case void 0:break;default:return!1}return u?(f?n.bypassed=l.bypassed:n.bypassed=l,a[n.name]=n):f?l.bypassed=n:a[n.name]=n,p(),!0},Qt.cleanElements=function(t,e){for(var r=0;r<t.length;r++){var n=t[r];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),!e)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],u=a[o];u!=null&&(u.bypass?u.bypassed=null:a[o]=null)}}},Qt.update=function(){var t=this._private.cy,e=t.mutableElements();e.updateStyle()},Qt.updateTransitions=function(t,e){var r=this,n=t._private,a=t.pstyle("transition-property").value,i=t.pstyle("transition-duration").pfValue,s=t.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},u=!1,l=0;l<a.length;l++){var f=a[l],d=t.pstyle(f),g=e[f];if(g){var m=g.prev,p=m,b=g.next!=null?g.next:d,x=!1,w=void 0,E=1e-6;p&&(Se(p.pfValue)&&Se(b.pfValue)?(x=b.pfValue-p.pfValue,w=p.pfValue+E*x):Se(p.value)&&Se(b.value)?(x=b.value-p.value,w=p.value+E*x):bt(p.value)&&bt(b.value)&&(x=p.value[0]!==b.value[0]||p.value[1]!==b.value[1]||p.value[2]!==b.value[2],w=p.strValue),x&&(o[f]=b.strValue,this.applyBypass(t,f,w),u=!0))}}if(!u)return;n.transitioning=!0,new ha(function(C){s>0?t.delayAnimation(s).play().promise().then(C):C()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(t,a),t.emitAndNotify("style"),n.transitioning=!1)},Qt.checkTrigger=function(t,e,r,n,a,i){var s=this.properties[e],o=a(s);o!=null&&o(r,n)&&i(s)},Qt.checkZOrderTrigger=function(t,e,r,n){var a=this;this.checkTrigger(t,e,r,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",t)})},Qt.checkBoundsTrigger=function(t,e,r,n){this.checkTrigger(t,e,r,n,function(a){return a.triggersBounds},function(a){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),a.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||n==="bezier")&&t.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()}),a.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||n==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},Qt.checkTriggers=function(t,e,r,n){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,n),this.checkBoundsTrigger(t,e,r,n)};var vi={};vi.applyBypass=function(t,e,r,n){var a=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;o<a.properties.length;o++){var u=a.properties[o],l=u.name,f=this.parse(l,r,!0);f&&i.push(f)}}else if(_e(e)){var d=this.parse(e,r,!0);d&&i.push(d)}else if(st(e)){var g=e;n=r;for(var m=Object.keys(g),p=0;p<m.length;p++){var b=m[p],x=g[b];if(x===void 0&&(x=g[Ki(b)]),x!==void 0){var w=this.parse(b,x,!0);w&&i.push(w)}}}else return!1;if(i.length===0)return!1;for(var E=!1,C=0;C<t.length;C++){for(var k=t[C],R={},A=void 0,h=0;h<i.length;h++){var I=i[h];if(n){var D=k.pstyle(I.name);A=R[I.name]={prev:D}}E=this.applyParsedProperty(k,_r(I))||E,n&&(A.next=k.pstyle(I.name))}E&&this.updateStyleHints(k),n&&this.updateTransitions(k,R,s)}return E},vi.overrideBypass=function(t,e,r){e=go(e);for(var n=0;n<t.length;n++){var a=t[n],i=a._private.style[e],s=this.properties[e].type,o=s.color,u=s.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,r):(i.value=r,i.pfValue!=null&&(i.pfValue=r),o?i.strValue="rgb("+r.join(",")+")":u?i.strValue=r.join(" "):i.strValue=""+r,this.updateStyleHints(a)),this.checkTriggers(a,e,l,r)}},vi.removeAllBypasses=function(t,e){return this.removeBypasses(t,this.propertyNames,e)},vi.removeBypasses=function(t,e,r){for(var n=!0,a=0;a<t.length;a++){for(var i=t[a],s={},o=0;o<e.length;o++){var u=e[o],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var d="",g=this.parse(u,d,!0),m=s[l.name]={prev:f};this.applyParsedProperty(i,g),m.next=i.pstyle(l.name)}}this.updateStyleHints(i),r&&this.updateTransitions(i,s,n)}};var Go={};Go.getEmSizeInPixels=function(){var t=this.containerCss("font-size");return t!=null?parseFloat(t):1},Go.containerCss=function(t){var e=this._private.cy,r=e.container(),n=e.window();if(n&&r&&n.getComputedStyle)return n.getComputedStyle(r).getPropertyValue(t)};var Vr={};Vr.getRenderedStyle=function(t,e){return e?this.getStylePropertyValue(t,e,!0):this.getRawStyle(t,!0)},Vr.getRawStyle=function(t,e){var r=this;if(t=t[0],t){for(var n={},a=0;a<r.properties.length;a++){var i=r.properties[a],s=r.getStylePropertyValue(t,i.name,e);s!=null&&(n[i.name]=s,n[Ki(i.name)]=s)}return n}},Vr.getIndexedStyle=function(t,e,r,n){var a=t.pstyle(e)[r][n];return a??t.cy().style().getDefaultProperty(e)[r][0]},Vr.getStylePropertyValue=function(t,e,r){var n=this;if(t=t[0],t){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=t.pstyle(a.name);if(s){var o=s.value,u=s.units,l=s.strValue;if(r&&i.number&&o!=null&&Se(o)){var f=t.cy().zoom(),d=function(x){return x*f},g=function(x,w){return d(x)+w},m=bt(o),p=m?u.every(function(b){return b!=null}):u!=null;return p?m?o.map(function(b,x){return g(b,u[x])}).join(" "):g(o,u):m?o.map(function(b){return _e(b)?b:""+d(b)}).join(" "):""+d(o)}else if(l!=null)return l}return null}},Vr.getAnimationStartStyle=function(t,e){for(var r={},n=0;n<e.length;n++){var a=e[n],i=a.name,s=t.pstyle(i);s!==void 0&&(st(s)?s=this.parse(i,s.strValue):s=this.parse(i,s)),s&&(r[i]=s)}return r},Vr.getPropsList=function(t){var e=this,r=[],n=t,a=e.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],u=n[o],l=a[o]||a[go(o)],f=this.parse(l.name,u);f&&r.push(f)}return r},Vr.getNonDefaultPropertiesHash=function(t,e,r){var n=r.slice(),a,i,s,o,u,l;for(u=0;u<e.length;u++)if(a=e[u],i=t.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=Za(o,n[0]),n[1]=Qa(o,n[1]);else for(s=i.strValue,l=0;l<s.length;l++)o=s.charCodeAt(l),n[0]=Za(o,n[0]),n[1]=Qa(o,n[1]);return n},Vr.getPropertiesHash=Vr.getNonDefaultPropertiesHash;var ks={};ks.appendFromJson=function(t){for(var e=this,r=0;r<t.length;r++){var n=t[r],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var o=0;o<s.length;o++){var u=s[o],l=i[u];e.css(u,l)}}return e},ks.fromJson=function(t){var e=this;return e.resetToDefault(),e.appendFromJson(t),e},ks.json=function(){for(var t=[],e=this.defaultLength;e<this.length;e++){for(var r=this[e],n=r.selector,a=r.properties,i={},s=0;s<a.length;s++){var o=a[s];i[o.name]=o.strValue}t.push({selector:n?n.toString():"core",style:i})}return t};var Ko={};Ko.appendFromString=function(t){var e=this,r=this,n=""+t,a,i,s;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function o(){n.length>a.length?n=n.substr(a.length):n=""}function u(){i.length>s.length?i=i.substr(s.length):i=""}for(;;){var l=n.match(/^\s*$/);if(l)break;var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){ht("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=f[0];var d=f[1];if(d!=="core"){var g=new yn(d);if(g.invalid){ht("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();continue}}var m=f[2],p=!1;i=m;for(var b=[];;){var x=i.match(/^\s*$/);if(x)break;var w=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!w){ht("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+m),p=!0;break}s=w[0];var E=w[1],C=w[2],k=e.properties[E];if(!k){ht("Skipping property: Invalid property name in: "+s),u();continue}var R=r.parse(E,C);if(!R){ht("Skipping property: Invalid property definition in: "+s),u();continue}b.push({name:E,val:C}),u()}if(p){o();break}r.selector(d);for(var A=0;A<b.length;A++){var h=b[A];r.css(h.name,h.val)}o()}return r},Ko.fromString=function(t){var e=this;return e.resetToDefault(),e.appendFromString(t),e};var Ut={};(function(){var t=Rt,e=Ih,r=Rh,n=Lh,a=Oh,i=function(ae){return"^"+ae+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(ae){var Y=t+"|\\w+|"+e+"|"+r+"|"+n+"|"+a;return"^"+ae+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+t+")\\s*\\,\\s*("+t+")\\s*,\\s*("+Y+")\\s*\\,\\s*("+Y+")\\)$"},o=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Ut.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:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:s("mapData")},mapLayoutData:{mapping:!0,regex:s("mapLayoutData")},mapScratch:{mapping:!0,regex:s("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(ae,Y){switch(ae.length){case 2:return Y[0]!=="deg"&&Y[0]!=="rad"&&Y[1]!=="deg"&&Y[1]!=="rad";case 1:return _e(ae[0])||Y[0]==="deg"||Y[0]==="rad";default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\s*,\\s*("+t+")\\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(ae){var Y=ae.length;return Y===1||Y===2||Y===4}}};var u={zeroNonZero:function(ae,Y){return(ae==null||Y==null)&&ae!==Y||ae==0&&Y!=0?!0:ae!=0&&Y==0},any:function(ae,Y){return ae!=Y},emptyNonEmpty:function(ae,Y){var oe=cn(ae),ye=cn(Y);return oe&&!ye||!oe&&ye}},l=Ut.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],d=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],g=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],m=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],p=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification}],b=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any}],x=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:!0},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],w=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],E=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],C=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],k=function(ae,Y){return Y.value==="label"?-ae.poolIndex():Y.pfValue},R=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:k},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:k},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],A=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],h=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],I=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],D=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],M=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelBeziers:!0},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],L=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],B=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],N=[];Ut.pieBackgroundN=16,N.push({name:"pie-size",type:l.sizeMaybePercent});for(var _=1;_<=Ut.pieBackgroundN;_++)N.push({name:"pie-"+_+"-background-color",type:l.color}),N.push({name:"pie-"+_+"-background-size",type:l.percent}),N.push({name:"pie-"+_+"-background-opacity",type:l.zeroOneNumber});var U=[],H=Ut.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(be){H.forEach(function(ae){var Y=ae+"-"+be.name,oe=be.type,ye=be.triggersBounds;U.push({name:Y,type:oe,triggersBounds:ye})})},{});var W=Ut.properties=[].concat(b,C,x,w,E,L,p,m,f,d,g,R,A,h,I,N,D,M,U,B),X=Ut.propertyGroups={behavior:b,transition:C,visibility:x,overlay:w,underlay:E,ghost:L,commonLabel:p,labelDimensions:m,mainLabel:f,sourceLabel:d,targetLabel:g,nodeBody:R,nodeBorder:A,nodeOutline:h,backgroundImage:I,pie:N,compound:D,edgeLine:M,edgeArrow:U,core:B},Q=Ut.propertyGroupNames={},se=Ut.propertyGroupKeys=Object.keys(X);se.forEach(function(be){Q[be]=X[be].map(function(ae){return ae.name}),X[be].forEach(function(ae){return ae.groupKey=be})});var j=Ut.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"}];Ut.propertyNames=W.map(function(be){return be.name});for(var ee=0;ee<W.length;ee++){var de=W[ee];W[de.name]=de}for(var ge=0;ge<j.length;ge++){var me=j[ge],pe=W[me.pointsTo],we={name:me.name,alias:!0,pointsTo:pe};W.push(we),W[me.name]=we}})(),Ut.getDefaultProperty=function(t){return this.getDefaultProperties()[t]},Ut.getDefaultProperties=function(){var t=this._private;if(t.defaultProperties!=null)return t.defaultProperties;for(var e=Ve({"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(u,l){for(var f=1;f<=Ut.pieBackgroundN;f++){var d=l.name.replace("{{i}}",f),g=l.value;u[d]=g}return u},{}),{"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(u,l){return Ut.arrowPrefixes.forEach(function(f){var d=f+"-"+l.name,g=l.value;u[d]=g}),u},{})),r={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,s=e[i],o=this.parse(i,s);r[i]=o}}return t.defaultProperties=r,t.defaultProperties},Ut.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={};Ps.parse=function(t,e,r,n){var a=this;if(Tt(e))return a.parseImplWarn(t,e,r,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,s=r?"t":"f",o=""+e,u=Al(t,o,s,i),l=a.propCache=a.propCache||[],f;return(f=l[u])||(f=l[u]=a.parseImplWarn(t,e,r,n)),(r||n==="mapping")&&(f=_r(f),f&&(f.value=_r(f.value))),f},Ps.parseImplWarn=function(t,e,r,n){var a=this.parseImpl(t,e,r,n);return!a&&e!=null&&ht("The style property `".concat(t,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&ht("The style value of `label` is deprecated for `"+a.name+"`"),a},Ps.parseImpl=function(t,e,r,n){var a=this;t=go(t);var i=a.properties[t],s=e,o=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,t=i.name);var u=_e(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(r&&(e===""||e===null))return{name:t,value:e,bypass:!0,deleteBypass:!0};if(Tt(e))return{name:t,value:e,strValue:"fn",mapped:o.fn,bypass:r};var f,d;if(!(!u||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(o.data.regex).exec(e))){if(r)return!1;var g=o.data;return{name:t,value:f,strValue:""+e,mapped:g,field:f[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(o.mapData.regex).exec(e))){if(r||l.multiple)return!1;var m=o.mapData;if(!(l.color||l.number))return!1;var p=this.parse(t,d[4]);if(!p||p.mapped)return!1;var b=this.parse(t,d[5]);if(!b||b.mapped)return!1;if(p.pfValue===b.pfValue||p.strValue===b.strValue)return ht("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+p.strValue+"`"),this.parse(t,p.strValue);if(l.color){var x=p.value,w=b.value,E=x[0]===w[0]&&x[1]===w[1]&&x[2]===w[2]&&(x[3]===w[3]||(x[3]==null||x[3]===1)&&(w[3]==null||w[3]===1));if(E)return!1}return{name:t,value:d,strValue:""+e,mapped:m,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:p.value,valueMax:b.value,bypass:r}}}if(l.multiple&&n!=="multiple"){var C;if(u?C=e.split(/\s+/):bt(e)?C=e:C=[e],l.evenMultiple&&C.length%2!==0)return null;for(var k=[],R=[],A=[],h="",I=!1,D=0;D<C.length;D++){var M=a.parse(t,C[D],r,"multiple");I=I||_e(M.value),k.push(M.value),A.push(M.pfValue!=null?M.pfValue:M.value),R.push(M.units),h+=(D>0?" ":"")+M.strValue}return l.validate&&!l.validate(k,R)?null:l.singleEnum&&I?k.length===1&&_e(k[0])?{name:t,value:k[0],strValue:k[0],bypass:r}:null:{name:t,value:k,pfValue:A,strValue:h,bypass:r,units:R}}var L=function(){for(var ae=0;ae<l.enums.length;ae++){var Y=l.enums[ae];if(Y===e)return{name:t,value:e,strValue:""+e,bypass:r}}return null};if(l.number){var B,N="px";if(l.units&&(B=l.units),l.implicitUnits&&(N=l.implicitUnits),!l.unitless)if(u){var _="px|em"+(l.allowPercent?"|\\%":"");B&&(_=B);var U=e.match("^("+Rt+")("+_+")?$");U&&(e=U[1],B=U[2]||N)}else(!B||l.implicitUnits)&&(B=N);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=s,L();if(l.integer&&!Th(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var H={name:t,value:e,strValue:""+e+(B||""),units:B,bypass:r};return l.unitless||B!=="px"&&B!=="em"?H.pfValue=e:H.pfValue=B==="px"||!B?e:this.getEmSizeInPixels()*e,(B==="ms"||B==="s")&&(H.pfValue=B==="ms"?e:1e3*e),(B==="deg"||B==="rad")&&(H.pfValue=B==="rad"?e:ap(e)),B==="%"&&(H.pfValue=e/100),H}else if(l.propList){var W=[],X=""+e;if(X!=="none"){for(var Q=X.split(/\s*,\s*|\s+/),se=0;se<Q.length;se++){var j=Q[se].trim();a.properties[j]?W.push(j):ht("`"+j+"` is not a valid property name")}if(W.length===0)return null}return{name:t,value:W,strValue:W.length===0?"none":W.join(" "),bypass:r}}else if(l.color){var ee=wl(e);return ee?{name:t,value:ee,pfValue:ee,strValue:"rgb("+ee[0]+","+ee[1]+","+ee[2]+")",bypass:r}:null}else if(l.regex||l.regexes){if(l.enums){var de=L();if(de)return de}for(var ge=l.regexes?l.regexes:[l.regex],me=0;me<ge.length;me++){var pe=new RegExp(ge[me]),we=pe.exec(e);if(we)return{name:t,value:l.singleRegexMatchValue?we[1]:we,strValue:""+e,bypass:r}}return null}else return l.string?{name:t,value:""+e,strValue:""+e,bypass:r}:l.enums?L():null};var Jt=function t(e){if(!(this instanceof t))return new t(e);if(!ho(e)){St("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},jt=Jt.prototype;jt.instanceString=function(){return"style"},jt.clear=function(){for(var t=this._private,e=t.cy,r=e.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,t.contextStyles={},t.propDiffs={},this.cleanElements(r,!0),r.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},jt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},jt.core=function(t){return this._private.coreStyle[t]||this.getDefaultProperty(t)},jt.selector=function(t){var e=t==="core"?null:new yn(t),r=this.length++;return this[r]={selector:e,properties:[],mappedProperties:[],index:r},this},jt.css=function(){var t=this,e=arguments;if(e.length===1)for(var r=e[0],n=0;n<t.properties.length;n++){var a=t.properties[n],i=r[a.name];i===void 0&&(i=r[Ki(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this},jt.style=jt.css,jt.cssRule=function(t,e){var r=this.parse(t,e);if(r){var n=this.length-1;this[n].properties.push(r),this[n].properties[r.name]=r,r.name.match(/pie-(\d+)-background-size/)&&r.value&&(this._private.hasPie=!0),r.mapped&&this[n].mappedProperties.push(r);var a=!this[n].selector;a&&(this._private.coreStyle[r.name]=r)}return this},jt.append=function(t){return gl(t)?t.appendToStyle(this):bt(t)?this.appendFromJson(t):_e(t)&&this.appendFromString(t),this},Jt.fromJson=function(t,e){var r=new Jt(t);return r.fromJson(e),r},Jt.fromString=function(t,e){return new Jt(t).fromString(e)},[Qt,vi,Go,Vr,ks,Ko,Ut,Ps].forEach(function(t){Ve(jt,t)}),Jt.types=jt.types,Jt.properties=jt.properties,Jt.propertyGroups=jt.propertyGroups,Jt.propertyGroupNames=jt.propertyGroupNames,Jt.propertyGroupKeys=jt.propertyGroupKeys;var Cw={style:function(e){if(e){var r=this.setStyle(e);r.update()}return this._private.style},setStyle:function(e){var r=this._private;return gl(e)?r.style=e.generateStyle(this):bt(e)?r.style=Jt.fromJson(this,e):_e(e)?r.style=Jt.fromString(this,e):r.style=Jt(this),r.style},updateStyle:function(){this.mutableElements().updateStyle()}},Tw="single",Vn={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var r=this._private;if(r.selectionType==null&&(r.selectionType=Tw),e!==void 0)(e==="additive"||e==="single")&&(r.selectionType=e);else return r.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,r=this._private.pan,n,a,i,s,o;switch(e.length){case 0:return r;case 1:if(_e(e[0]))return n=e[0],r[n];if(st(e[0])){if(!this._private.panningEnabled)return this;i=e[0],s=i.x,o=i.y,Se(s)&&(r.x=s),Se(o)&&(r.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&Se(a)&&(r[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,r){var n=arguments,a=this._private.pan,i,s,o,u,l;if(!this._private.panningEnabled)return this;switch(n.length){case 1:st(e)&&(o=n[0],u=o.x,l=o.y,Se(u)&&(a.x+=u),Se(l)&&(a.y+=l),this.emit("pan viewport"));break;case 2:i=e,s=r,(i==="x"||i==="y")&&Se(s)&&(a[i]+=s),this.emit("pan viewport");break}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,r){var n=this.getFitViewport(e,r);if(n){var a=this._private;a.zoom=n.zoom,a.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,r){if(Se(e)&&r===void 0&&(r=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(_e(e)){var a=e;e=this.$(a)}else if(kh(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else br(e)||(e=this.mutableElements());if(!(br(e)&&e.empty())){n=n||e.boundingBox();var s=this.width(),o=this.height(),u;if(r=Se(r)?r:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((s-2*r)/n.w,(o-2*r)/n.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(s-u*(n.x1+n.x2))/2,y:(o-u*(n.y1+n.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,r){var n=this._private;if(r==null){var a=e;e=a.min,r=a.max}return Se(e)&&Se(r)&&e<=r?(n.minZoom=e,n.maxZoom=r):Se(e)&&r===void 0&&e<=n.maxZoom?n.minZoom=e:Se(r)&&e===void 0&&r>=n.minZoom&&(n.maxZoom=r),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 r=this._private,n=r.pan,a=r.zoom,i,s,o=!1;if(r.zoomingEnabled||(o=!0),Se(e)?s=e:st(e)&&(s=e.level,e.position!=null?i=ji(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=s<r.minZoom?r.minZoom:s,o||!Se(s)||s===a||i!=null&&(!Se(i.x)||!Se(i.y)))return null;if(i!=null){var u=n,l=a,f=s,d={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:d}}else return{zoomed:!0,panned:!1,zoom:s,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var r=this.getZoomedViewport(e),n=this._private;return r==null||!r.zoomed?this:(n.zoom=r.zoom,r.panned&&(n.pan.x=r.pan.x,n.pan.y=r.pan.y),this.emit("zoom"+(r.panned?" pan":"")+" viewport"),this.notify("viewport"),this)},viewport:function(e){var r=this._private,n=!0,a=!0,i=[],s=!1,o=!1;if(!e)return this;if(Se(e.zoom)||(n=!1),st(e.pan)||(a=!1),!n&&!a)return this;if(n){var u=e.zoom;u<r.minZoom||u>r.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=u,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var l=e.pan;Se(l.x)&&(r.pan.x=l.x,o=!1),Se(l.y)&&(r.pan.y=l.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,r){if(this._private.panningEnabled){if(_e(e)){var n=e;e=this.mutableElements().filter(n)}else br(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(a.x1+a.x2))/2,y:(s-r*(a.y1+a.y2))/2};return o}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,r=e.container,n=this;return e.sizeCache=e.sizeCache||(r?function(){var a=n.window().getComputedStyle(r),i=function(o){return parseFloat(a.getPropertyValue(o))};return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("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,r=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/r,x2:(n.x2-e.x)/r,y1:(n.y1-e.y)/r,y2:(n.y2-e.y)/r};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};Vn.centre=Vn.center,Vn.autolockNodes=Vn.autolock,Vn.autoungrabifyNodes=Vn.autoungrabify;var hi={data:gt.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:gt.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:gt.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:gt.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};hi.attr=hi.data,hi.removeAttr=hi.removeData;var gi=function(e){var r=this;e=Ve({},e);var n=e.container;n&&!Gi(n)&&Gi(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=r;var s=Mt!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=Ve({name:s?"grid":"null"},o.layout),o.renderer=Ve({name:s?"canvas":"null"},o.renderer);var u=function(p,b,x){return b!==void 0?b:x!==void 0?x:p},l=this._private={container:n,ready:!1,options:o,elements:new Wt(this),listeners:[],aniEles:new Wt(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,o.zoomingEnabled),userZoomingEnabled:u(!0,o.userZoomingEnabled),panningEnabled:u(!0,o.panningEnabled),userPanningEnabled:u(!0,o.userPanningEnabled),boxSelectionEnabled:u(!0,o.boxSelectionEnabled),autolock:u(!1,o.autolock,o.autolockNodes),autoungrabify:u(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:u(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:Se(o.zoom)?o.zoom:1,pan:{x:st(o.pan)&&Se(o.pan.x)?o.pan.x:0,y:st(o.pan)&&Se(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var f=function(p,b){var x=p.some(Ph);if(x)return ha.all(p).then(b);b(p)};l.styleEnabled&&r.setStyle([]);var d=Ve({},o,o.renderer);r.initRenderer(d);var g=function(p,b,x){r.notifications(!1);var w=r.mutableElements();w.length>0&&w.remove(),p!=null&&(st(p)||bt(p))&&r.add(p),r.one("layoutready",function(C){r.notifications(!0),r.emit(C),r.one("load",b),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",x),r.emit("done")});var E=Ve({},r._private.options.layout);E.eles=r.elements(),r.layout(E).run()};f([o.style,o.elements],function(m){var p=m[0],b=m[1];l.styleEnabled&&r.style().append(p),g(b,function(){r.startAnimationLoop(),l.ready=!0,Tt(o.ready)&&r.on("ready",o.ready);for(var x=0;x<i.length;x++){var w=i[x];r.on("ready",w)}a&&(a.readies=[]),r.emit("ready")},o.done)})},As=gi.prototype;Ve(As,{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(){var e=this._private.container;if(e==null)return Mt;var r=this._private.container.ownerDocument;return r===void 0||r==null?Mt:r.defaultView||Mt},mount:function(e){if(e!=null){var r=this,n=r._private,a=n.options;return!Gi(e)&&Gi(e[0])&&(e=e[0]),r.stopAnimationLoop(),r.destroyRenderer(),n.container=e,n.styleEnabled=!0,r.invalidateSize(),r.initRenderer(Ve({},a,a.renderer,{name:a.renderer.name==="null"?"canvas":a.renderer.name})),r.startAnimationLoop(),r.style(a.style),r.emit("mount"),r}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return _r(this._private.options)},json:function(e){var r=this,n=r._private,a=r.mutableElements(),i=function(k){return r.getElementById(k.id())};if(st(e)){if(r.startBatch(),e.elements){var s={},o=function(k,R){for(var A=[],h=[],I=0;I<k.length;I++){var D=k[I];if(!D.data.id){ht("cy.json() cannot handle elements without an ID attribute");continue}var M=""+D.data.id,L=r.getElementById(M);s[M]=!0,L.length!==0?h.push({ele:L,json:D}):(R&&(D.group=R),A.push(D))}r.add(A);for(var B=0;B<h.length;B++){var N=h[B],_=N.ele,U=N.json;_.json(U)}};if(bt(e.elements))o(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],d=e.elements[f];bt(d)&&o(d,f)}var g=r.collection();a.filter(function(C){return!s[C.id()]}).forEach(function(C){C.isParent()?g.merge(C):C.remove()}),g.forEach(function(C){return C.children().move({parent:null})}),g.forEach(function(C){return i(C).remove()})}e.style&&r.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&r.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&r.pan(e.pan),e.data&&r.data(e.data);for(var m=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<m.length;p++){var b=m[p];e[b]!=null&&r[b](e[b])}return r.endBatch(),this}else{var x=!!e,w={};x?w.elements=this.elements().map(function(C){return C.json()}):(w.elements={},a.forEach(function(C){var k=C.group();w.elements[k]||(w.elements[k]=[]),w.elements[k].push(C.json())})),this._private.styleEnabled&&(w.style=r.style().json()),w.data=_r(r.data());var E=n.options;return w.zoomingEnabled=n.zoomingEnabled,w.userZoomingEnabled=n.userZoomingEnabled,w.zoom=n.zoom,w.minZoom=n.minZoom,w.maxZoom=n.maxZoom,w.panningEnabled=n.panningEnabled,w.userPanningEnabled=n.userPanningEnabled,w.pan=_r(n.pan),w.boxSelectionEnabled=n.boxSelectionEnabled,w.renderer=_r(E.renderer),w.hideEdgesOnViewport=E.hideEdgesOnViewport,w.textureOnViewport=E.textureOnViewport,w.wheelSensitivity=E.wheelSensitivity,w.motionBlur=E.motionBlur,w.multiClickDebounceTime=E.multiClickDebounceTime,w}}}),As.$id=As.getElementById,[hw,ww,lc,Wo,Ss,xw,Uo,Ds,Cw,Vn,hi].forEach(function(t){Ve(As,t)});var Sw={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}},Dw={maximal:!1,acyclic:!1},Ta=function(e){return e.scratch("breadthfirst")},fc=function(e,r){return e.scratch("breadthfirst",r)};function cc(t){this.options=Ve({},Sw,Dw,t)}cc.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=r.nodes().filter(function(ke){return ke.isChildless()}),a=r,i=t.directed,s=t.acyclic||t.maximal||t.maximalAdjustments>0,o=!!t.boundingBox,u=e.extent(),l=fr(o?t.boundingBox:{x1:u.x1,y1:u.y1,w:u.w,h:u.h}),f;if(br(t.roots))f=t.roots;else if(bt(t.roots)){for(var d=[],g=0;g<t.roots.length;g++){var m=t.roots[g],p=e.getElementById(m);d.push(p)}f=e.collection(d)}else if(_e(t.roots))f=e.$(t.roots);else if(i)f=n.roots();else{var b=r.components();f=e.collection();for(var x=function(Ie){var He=b[Ie],We=He.maxDegree(!1),Le=He.filter(function(ze){return ze.degree(!1)===We});f=f.add(Le)},w=0;w<b.length;w++)x(w)}var E=[],C={},k=function(Ie,He){E[He]==null&&(E[He]=[]);var We=E[He].length;E[He].push(Ie),fc(Ie,{index:We,depth:He})},R=function(Ie,He){var We=Ta(Ie),Le=We.depth,ze=We.index;E[Le][ze]=null,Ie.isChildless()&&k(Ie,He)};a.bfs({roots:f,directed:t.directed,visit:function(Ie,He,We,Le,ze){var Ge=Ie[0],Fe=Ge.id();Ge.isChildless()&&k(Ge,ze),C[Fe]=!0}});for(var A=[],h=0;h<n.length;h++){var I=n[h];C[I.id()]||A.push(I)}var D=function(Ie){for(var He=E[Ie],We=0;We<He.length;We++){var Le=He[We];if(Le==null){He.splice(We,1),We--;continue}fc(Le,{depth:Ie,index:We})}},M=function(Ie,He){for(var We=Ta(Ie),Le=Ie.incomers().filter(function(le){return le.isNode()&&r.has(le)}),ze=-1,Ge=Ie.id(),Fe=0;Fe<Le.length;Fe++){var he=Le[Fe],O=Ta(he);ze=Math.max(ze,O.depth)}if(We.depth<=ze){if(!t.acyclic&&He[Ge])return null;var Z=ze+1;return R(Ie,Z),He[Ge]=Z,!0}return!1};if(i&&s){var L=[],B={},N=function(Ie){return L.push(Ie)},_=function(){return L.shift()};for(n.forEach(function(ke){return L.push(ke)});L.length>0;){var U=_(),H=M(U,B);if(H)U.outgoers().filter(function(ke){return ke.isNode()&&r.has(ke)}).forEach(N);else if(H===null){ht("Detected double maximal shift for node `"+U.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}var W=0;if(t.avoidOverlap)for(var X=0;X<n.length;X++){var Q=n[X],se=Q.layoutDimensions(t),j=se.w,ee=se.h;W=Math.max(W,j,ee)}var de={},ge=function(Ie){if(de[Ie.id()])return de[Ie.id()];for(var He=Ta(Ie).depth,We=Ie.neighborhood(),Le=0,ze=0,Ge=0;Ge<We.length;Ge++){var Fe=We[Ge];if(!(Fe.isEdge()||Fe.isParent()||!n.has(Fe))){var he=Ta(Fe);if(he!=null){var O=he.index,Z=he.depth;if(!(O==null||Z==null)){var le=E[Z].length;Z<He&&(Le+=O/le,ze++)}}}}return ze=Math.max(1,ze),Le=Le/ze,ze===0&&(Le=0),de[Ie.id()]=Le,Le},me=function(Ie,He){var We=ge(Ie),Le=ge(He),ze=We-Le;return ze===0?yl(Ie.id(),He.id()):ze};t.depthSort!==void 0&&(me=t.depthSort);for(var pe=E.length,we=0;we<pe;we++)E[we].sort(me),D(we);for(var be=[],ae=0;ae<A.length;ae++)be.push(A[ae]);var Y=function(){for(var Ie=0;Ie<pe;Ie++)D(Ie)};be.length&&(E.unshift(be),pe=E.length,Y());for(var oe=0,ye=0;ye<pe;ye++)oe=Math.max(E[ye].length,oe);var De={x:l.x1+l.w/2,y:l.y1+l.h/2},Be=n.reduce(function(ke,Ie){return function(He){return{w:ke.w===-1?He.w:(ke.w+He.w)/2,h:ke.h===-1?He.h:(ke.h+He.h)/2}}(Ie.boundingBox({includeLabels:t.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),Je=Math.max(pe===1?0:o?(l.h-t.padding*2-Be.h)/(pe-1):(l.h-t.padding*2-Be.h)/(pe+1),W),ut=E.reduce(function(ke,Ie){return Math.max(ke,Ie.length)},0),at=function(Ie){var He=Ta(Ie),We=He.depth,Le=He.index;if(t.circle){var ze=Math.min(l.w/2/pe,l.h/2/pe);ze=Math.max(ze,W);var Ge=ze*We+ze-(pe>0&&E[0].length<=3?ze/2:0),Fe=2*Math.PI/E[We].length*Le;return We===0&&E[0].length===1&&(Ge=1),{x:De.x+Ge*Math.cos(Fe),y:De.y+Ge*Math.sin(Fe)}}else{var he=E[We].length,O=Math.max(he===1?0:o?(l.w-t.padding*2-Be.w)/((t.grid?ut:he)-1):(l.w-t.padding*2-Be.w)/((t.grid?ut:he)+1),W),Z={x:De.x+(Le+1-(he+1)/2)*O,y:De.y+(We+1-(pe+1)/2)*Je};return Z}};return r.nodes().layoutPositions(this,t,at),this};var kw={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function dc(t){this.options=Ve({},kw,t)}dc.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=fr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),f,d=0,g=0;g<i.length;g++){var m=i[g],p=m.layoutDimensions(e),b=p.w,x=p.h;d=Math.max(d,b,x)}if(Se(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(s.h,s.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var w=Math.cos(l)-Math.cos(0),E=Math.sin(l)-Math.sin(0),C=Math.sqrt(d*d/(w*w+E*E));f=Math.max(C,f)}var k=function(A,h){var I=e.startAngle+h*l*(a?1:-1),D=f*Math.cos(I),M=f*Math.sin(I),L={x:o.x+D,y:o.y+M};return L};return n.nodes().layoutPositions(this,e,k),this};var Pw={fit:!0,padding:30,startAngle:3/2*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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function vc(t){this.options=Ve({},Pw,t)}vc.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=t.cy,a=e.eles,i=a.nodes().not(":parent"),s=fr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=[],l=0,f=0;f<i.length;f++){var d=i[f],g=void 0;g=e.concentric(d),u.push({value:g,node:d}),d._private.scratch.concentric=g}i.updateStyle();for(var m=0;m<i.length;m++){var p=i[m],b=p.layoutDimensions(e);l=Math.max(l,b.w,b.h)}u.sort(function(Be,Je){return Je.value-Be.value});for(var x=e.levelWidth(i),w=[[]],E=w[0],C=0;C<u.length;C++){var k=u[C];if(E.length>0){var R=Math.abs(E[0].value-k.value);R>=x&&(E=[],w.push(E))}E.push(k)}var A=l+e.minNodeSpacing;if(!e.avoidOverlap){var h=w.length>0&&w[0].length>1,I=Math.min(s.w,s.h)/2-A,D=I/(w.length+h?1:0);A=Math.min(A,D)}for(var M=0,L=0;L<w.length;L++){var B=w[L],N=e.sweep===void 0?2*Math.PI-2*Math.PI/B.length:e.sweep,_=B.dTheta=N/Math.max(1,B.length-1);if(B.length>1&&e.avoidOverlap){var U=Math.cos(_)-Math.cos(0),H=Math.sin(_)-Math.sin(0),W=Math.sqrt(A*A/(U*U+H*H));M=Math.max(W,M)}B.r=M,M+=A}if(e.equidistant){for(var X=0,Q=0,se=0;se<w.length;se++){var j=w[se],ee=j.r-Q;X=Math.max(X,ee)}Q=0;for(var de=0;de<w.length;de++){var ge=w[de];de===0&&(Q=ge.r),ge.r=Q,Q+=X}}for(var me={},pe=0;pe<w.length;pe++)for(var we=w[pe],be=we.dTheta,ae=we.r,Y=0;Y<we.length;Y++){var oe=we[Y],ye=e.startAngle+(r?1:-1)*be*Y,De={x:o.x+ae*Math.cos(ye),y:o.y+ae*Math.sin(ye)};me[oe.node.id()]=De}return a.nodes().layoutPositions(this,e,function(Be){var Je=Be.id();return me[Je]}),this};var Xo,Aw={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,r){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 Bs(t){this.options=Ve({},Aw,t),this.options.layout=this;var e=this.options.eles.nodes(),r=this.options.eles.edges(),n=r.filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),o=e.some(function(l){return l.data("id")===i}),u=e.some(function(l){return l.data("id")===s});return!o||!u});this.options.eles=this.options.eles.not(n)}Bs.prototype.run=function(){var t=this.options,e=t.cy,r=this;r.stopped=!1,(t.animate===!0||t.animate===!1)&&r.emit({type:"layoutstart",layout:r}),t.debug===!0?Xo=!0:Xo=!1;var n=Bw(e,r,t);Xo&&Rw(n),t.randomize&&Lw(n);var a=Qr(),i=function(){Ow(n,e,t),t.fit===!0&&e.fit(t.padding)},s=function(g){return!(r.stopped||g>=t.numIter||(Nw(n,t),n.temperature=n.temperature*t.coolingFactor,n.temperature<t.minTemp))},o=function(){if(t.animate===!0||t.animate===!1)i(),r.one("layoutstop",t.stop),r.emit({type:"layoutstop",layout:r});else{var g=t.eles.nodes(),m=hc(n,t,g);g.layoutPositions(r,t,m)}},u=0,l=!0;if(t.animate===!0){var f=function d(){for(var g=0;l&&g<t.refresh;)l=s(u),u++,g++;if(!l)pc(n,t),o();else{var m=Qr();m-a>=t.animationThreshold&&i(),Yi(d)}};f()}else{for(;l;)l=s(u),u++;pc(n,t),o()}return this},Bs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Bs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Bw=function(e,r,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=fr(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},u=n.eles.components(),l={},f=0;f<u.length;f++)for(var d=u[f],g=0;g<d.length;g++){var m=d[g];l[m.id()]=f}for(var f=0;f<o.nodeSize;f++){var p=i[f],b=p.layoutDimensions(n),x={};x.isLocked=p.locked(),x.id=p.data("id"),x.parentId=p.data("parent"),x.cmptId=l[p.id()],x.children=[],x.positionX=p.position("x"),x.positionY=p.position("y"),x.offsetX=0,x.offsetY=0,x.height=b.w,x.width=b.h,x.maxX=x.positionX+x.width/2,x.minX=x.positionX-x.width/2,x.maxY=x.positionY+x.height/2,x.minY=x.positionY-x.height/2,x.padLeft=parseFloat(p.style("padding")),x.padRight=parseFloat(p.style("padding")),x.padTop=parseFloat(p.style("padding")),x.padBottom=parseFloat(p.style("padding")),x.nodeRepulsion=Tt(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,o.layoutNodes.push(x),o.idToIndex[x.id]=f}for(var w=[],E=0,C=-1,k=[],f=0;f<o.nodeSize;f++){var p=o.layoutNodes[f],R=p.parentId;R!=null?o.layoutNodes[o.idToIndex[R]].children.push(p.id):(w[++C]=p.id,k.push(p.id))}for(o.graphSet.push(k);E<=C;){var A=w[E++],h=o.idToIndex[A],m=o.layoutNodes[h],I=m.children;if(I.length>0){o.graphSet.push(I);for(var f=0;f<I.length;f++)w[++C]=I[f]}}for(var f=0;f<o.graphSet.length;f++)for(var D=o.graphSet[f],g=0;g<D.length;g++){var M=o.idToIndex[D[g]];o.indexToGraph[M]=f}for(var f=0;f<o.edgeSize;f++){var L=a[f],B={};B.id=L.data("id"),B.sourceId=L.data("source"),B.targetId=L.data("target");var N=Tt(n.idealEdgeLength)?n.idealEdgeLength(L):n.idealEdgeLength,_=Tt(n.edgeElasticity)?n.edgeElasticity(L):n.edgeElasticity,U=o.idToIndex[B.sourceId],H=o.idToIndex[B.targetId],W=o.indexToGraph[U],X=o.indexToGraph[H];if(W!=X){for(var Q=Iw(B.sourceId,B.targetId,o),se=o.graphSet[Q],j=0,x=o.layoutNodes[U];se.indexOf(x.id)===-1;)x=o.layoutNodes[o.idToIndex[x.parentId]],j++;for(x=o.layoutNodes[H];se.indexOf(x.id)===-1;)x=o.layoutNodes[o.idToIndex[x.parentId]],j++;N*=j*n.nestingFactor}B.idealLength=N,B.elasticity=_,o.layoutEdges.push(B)}return o},Iw=function(e,r,n){var a=Mw(e,r,0,n);return 2>a.count?0:a.graph},Mw=function t(e,r,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(r))return{count:2,graph:n};for(var s=0,o=0;o<i.length;o++){var u=i[o],l=a.idToIndex[u],f=a.layoutNodes[l].children;if(f.length!==0){var d=a.indexToGraph[a.idToIndex[f[0]]],g=t(e,r,d,a);if(g.count!==0)if(g.count===1){if(s++,s===2)break}else return g}}return{count:s,graph:n}},Rw,Lw=function(e,r){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];s.children.length===0&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*a)}},hc=function(e,r,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return r.boundingBox&&(n.forEach(function(s){var o=e.layoutNodes[e.idToIndex[s.data("id")]];i.x1=Math.min(i.x1,o.positionX),i.x2=Math.max(i.x2,o.positionX),i.y1=Math.min(i.y1,o.positionY),i.y2=Math.max(i.y2,o.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(s,o){var u=e.layoutNodes[e.idToIndex[s.data("id")]];if(r.boundingBox){var l=(u.positionX-i.x1)/i.w,f=(u.positionY-i.y1)/i.h;return{x:a.x1+l*a.w,y:a.y1+f*a.h}}else return{x:u.positionX,y:u.positionY}}},Ow=function(e,r,n){var a=n.layout,i=n.eles.nodes(),s=hc(e,n,i);i.positions(s),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Nw=function(e,r,n){_w(e,r),$w(e),qw(e,r),Hw(e),Ww(e)},_w=function(e,r){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,s=0;s<i;s++)for(var o=e.layoutNodes[e.idToIndex[a[s]]],u=s+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[a[u]]];zw(o,l,e,r)}},gc=function(e){return-e+2*e*Math.random()},zw=function(e,r,n,a){var i=e.cmptId,s=r.cmptId;if(!(i!==s&&!n.isCompound)){var o=r.positionX-e.positionX,u=r.positionY-e.positionY,l=1;o===0&&u===0&&(o=gc(l),u=gc(l));var f=Vw(e,r,o,u);if(f>0)var d=a.nodeOverlap*f,g=Math.sqrt(o*o+u*u),m=d*o/g,p=d*u/g;else var b=Is(e,o,u),x=Is(r,-1*o,-1*u),w=x.x-b.x,E=x.y-b.y,C=w*w+E*E,g=Math.sqrt(C),d=(e.nodeRepulsion+r.nodeRepulsion)/C,m=d*w/g,p=d*E/g;e.isLocked||(e.offsetX-=m,e.offsetY-=p),r.isLocked||(r.offsetX+=m,r.offsetY+=p)}},Vw=function(e,r,n,a){if(n>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(a>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Is=function(e,r,n){var a=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,u=n/r,l=s/o,f={};return r===0&&0<n||r===0&&0>n?(f.x=a,f.y=i+s/2,f):0<r&&-1*l<=u&&u<=l?(f.x=a+o/2,f.y=i+o*n/2/r,f):0>r&&-1*l<=u&&u<=l?(f.x=a-o/2,f.y=i-o*n/2/r,f):0<n&&(u<=-1*l||u>=l)?(f.x=a+s*r/2/n,f.y=i+s/2,f):(0>n&&(u<=-1*l||u>=l)&&(f.x=a-s*r/2/n,f.y=i-s/2),f)},$w=function(e,r){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],s=e.layoutNodes[i],o=e.idToIndex[a.targetId],u=e.layoutNodes[o],l=u.positionX-s.positionX,f=u.positionY-s.positionY;if(!(l===0&&f===0)){var d=Is(s,l,f),g=Is(u,-1*l,-1*f),m=g.x-d.x,p=g.y-d.y,b=Math.sqrt(m*m+p*p),x=Math.pow(a.idealLength-b,2)/a.elasticity;if(b!==0)var w=x*m/b,E=x*p/b;else var w=0,E=0;s.isLocked||(s.offsetX+=w,s.offsetY+=E),u.isLocked||(u.offsetX-=w,u.offsetY-=E)}}},qw=function(e,r){if(r.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(a===0)var o=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],o=f.positionX,u=f.positionY;for(var d=0;d<s;d++){var g=e.layoutNodes[e.idToIndex[i[d]]];if(!g.isLocked){var m=o-g.positionX,p=u-g.positionY,b=Math.sqrt(m*m+p*p);if(b>n){var x=r.gravity*m/b,w=r.gravity*p/b;g.offsetX+=x,g.offsetY+=w}}}}},Hw=function(e,r){var n=[],a=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;a<=i;){var s=n[a++],o=e.idToIndex[s],u=e.layoutNodes[o],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,d=u.offsetY,g=0;g<l.length;g++){var m=e.layoutNodes[e.idToIndex[l[g]]];m.offsetX+=f,m.offsetY+=d,n[++i]=l[g]}u.offsetX=0,u.offsetY=0}}},Ww=function(e,r){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=Uw(a.offsetX,a.offsetY,e.temperature);a.positionX+=i.x,a.positionY+=i.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,Gw(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.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)}},Uw=function(e,r,n){var a=Math.sqrt(e*e+r*r);if(a>n)var i={x:n*e/a,y:n*r/a};else var i={x:e,y:r};return i},Gw=function t(e,r){var n=e.parentId;if(n!=null){var a=r.layoutNodes[r.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return t(a,r)}},pc=function(e,r){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],o=s.cmptId,u=a[o]=a[o]||[];u.push(s)}for(var l=0,i=0;i<a.length;i++){var f=a[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var d=0;d<f.length;d++){var g=f[d];f.x1=Math.min(f.x1,g.positionX-g.width/2),f.x2=Math.max(f.x2,g.positionX+g.width/2),f.y1=Math.min(f.y1,g.positionY-g.height/2),f.y2=Math.max(f.y2,g.positionY+g.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}a.sort(function(E,C){return C.w*C.h-E.w*E.h});for(var m=0,p=0,b=0,x=0,w=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var f=a[i];if(f){for(var d=0;d<f.length;d++){var g=f[d];g.isLocked||(g.positionX+=m-f.x1,g.positionY+=p-f.y1)}m+=f.w+r.componentSpacing,b+=f.w+r.componentSpacing,x=Math.max(x,f.h),b>w&&(p+=x+r.componentSpacing,m=0,b=0,x=0)}}},Kw={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function mc(t){this.options=Ve({},Kw,t)}mc.prototype.run=function(){var t=this.options,e=t,r=t.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=fr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(de){return{x:i.x1,y:i.y1}});else{var s=a.size(),o=Math.sqrt(s*i.h/i.w),u=Math.round(o),l=Math.round(i.w/i.h*o),f=function(ge){if(ge==null)return Math.min(u,l);var me=Math.min(u,l);me==u?u=ge:l=ge},d=function(ge){if(ge==null)return Math.max(u,l);var me=Math.max(u,l);me==u?u=ge:l=ge},g=e.rows,m=e.cols!=null?e.cols:e.columns;if(g!=null&&m!=null)u=g,l=m;else if(g!=null&&m==null)u=g,l=Math.ceil(s/u);else if(g==null&&m!=null)l=m,u=Math.ceil(s/l);else if(l*u>s){var p=f(),b=d();(p-1)*b>=s?f(p-1):(b-1)*p>=s&&d(b-1)}else for(;l*u<s;){var x=f(),w=d();(w+1)*x>=s?d(w+1):f(x+1)}var E=i.w/l,C=i.h/u;if(e.condense&&(E=0,C=0),e.avoidOverlap)for(var k=0;k<a.length;k++){var R=a[k],A=R._private.position;(A.x==null||A.y==null)&&(A.x=0,A.y=0);var h=R.layoutDimensions(e),I=e.avoidOverlapPadding,D=h.w+I,M=h.h+I;E=Math.max(E,D),C=Math.max(C,M)}for(var L={},B=function(ge,me){return!!L["c-"+ge+"-"+me]},N=function(ge,me){L["c-"+ge+"-"+me]=!0},_=0,U=0,H=function(){U++,U>=l&&(U=0,_++)},W={},X=0;X<a.length;X++){var Q=a[X],se=e.position(Q);if(se&&(se.row!==void 0||se.col!==void 0)){var j={row:se.row,col:se.col};if(j.col===void 0)for(j.col=0;B(j.row,j.col);)j.col++;else if(j.row===void 0)for(j.row=0;B(j.row,j.col);)j.row++;W[Q.id()]=j,N(j.row,j.col)}}var ee=function(ge,me){var pe,we;if(ge.locked()||ge.isParent())return!1;var be=W[ge.id()];if(be)pe=be.col*E+E/2+i.x1,we=be.row*C+C/2+i.y1;else{for(;B(_,U);)H();pe=U*E+E/2+i.x1,we=_*C+C/2+i.y1,N(_,U),H()}return{x:pe,y:we}};a.layoutPositions(this,e,ee)}return this};var Xw={ready:function(){},stop:function(){}};function Yo(t){this.options=Ve({},Xw,t)}Yo.prototype.run=function(){var t=this.options,e=t.eles,r=this;return t.cy,r.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),r.one("layoutready",t.ready),r.emit("layoutready"),r.one("layoutstop",t.stop),r.emit("layoutstop"),this},Yo.prototype.stop=function(){return this};var Yw={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,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function yc(t){this.options=Ve({},Yw,t)}yc.prototype.run=function(){var t=this.options,e=t.eles,r=e.nodes(),n=Tt(t.positions);function a(i){if(t.positions==null)return jg(i.position());if(n)return t.positions(i);var s=t.positions[i._private.data.id];return s??null}return r.layoutPositions(this,t,function(i,s){var o=a(i);return i.locked()||o==null?!1:o}),this};var Zw={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,r){return!0},ready:void 0,stop:void 0,transform:function(e,r){return r}};function wc(t){this.options=Ve({},Zw,t)}wc.prototype.run=function(){var t=this.options,e=t.cy,r=t.eles,n=fr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return r.nodes().layoutPositions(this,t,a),this};var Qw=[{name:"breadthfirst",impl:cc},{name:"circle",impl:dc},{name:"concentric",impl:vc},{name:"cose",impl:Bs},{name:"grid",impl:mc},{name:"null",impl:Yo},{name:"preset",impl:yc},{name:"random",impl:wc}];function bc(t){this.options=t,this.notifications=0}var xc=function(){},Fc=function(){throw new Error("A headless instance can not render images")};bc.prototype={recalculateRenderedStyle:xc,notify:function(){this.notifications++},init:xc,isHeadless:function(){return!0},png:Fc,jpg:Fc};var Zo={};Zo.arrowShapeWidth=.3,Zo.registerArrowShapes=function(){var t=this.arrowShapes={},e=this,r=function(l,f,d,g,m,p,b){var x=m.x-d/2-b,w=m.x+d/2+b,E=m.y-d/2-b,C=m.y+d/2+b,k=x<=l&&l<=w&&E<=f&&f<=C;return k},n=function(l,f,d,g,m){var p=l*Math.cos(g)-f*Math.sin(g),b=l*Math.sin(g)+f*Math.cos(g),x=p*d,w=b*d,E=x+m.x,C=w+m.y;return{x:E,y:C}},a=function(l,f,d,g){for(var m=[],p=0;p<l.length;p+=2){var b=l[p],x=l[p+1];m.push(n(b,x,f,d,g))}return m},i=function(l){for(var f=[],d=0;d<l.length;d++){var g=l[d];f.push(g.x,g.y)}return f},s=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},o=function(l,f){_e(f)&&(f=t[f]),t[l]=Ve({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(g,m,p,b,x,w){var E=i(a(this.points,p+2*w,b,x)),C=cr(g,m,E);return C},roughCollide:r,draw:function(g,m,p,b){var x=a(this.points,m,p,b);e.arrowShapeImpl("polygon")(g,x)},spacing:function(g){return 0},gap:s},f)};o("none",{collide:Qi,roughCollide:Qi,draw:wo,spacing:Ml,gap:Ml}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:t.triangle.points,controlPoint:[0,-.15],roughCollide:r,draw:function(l,f,d,g,m){var p=a(this.points,f,d,g),b=this.controlPoint,x=n(b[0],b[1],f,d,g);e.arrowShapeImpl(this.name)(l,p,x)},gap:function(l){return s(l)*.8}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,d,g,m,p,b){var x=i(a(this.points,d+2*b,g,m)),w=i(a(this.pointsTee,d+2*b,g,m)),E=cr(l,f,x)||cr(l,f,w);return E},draw:function(l,f,d,g,m){var p=a(this.points,f,d,g),b=a(this.pointsTee,f,d,g);e.arrowShapeImpl(this.name)(l,p,b)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,d,g,m,p,b){var x=m,w=Math.pow(x.x-l,2)+Math.pow(x.y-f,2)<=Math.pow((d+2*b)*this.radius,2),E=i(a(this.points,d+2*b,g,m));return cr(l,f,E)||w},draw:function(l,f,d,g,m){var p=a(this.pointsTr,f,d,g);e.arrowShapeImpl(this.name)(l,p,g.x,g.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),o("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var d=this.baseCrossLinePts.slice(),g=f/l,m=3,p=5;return d[m]=d[m]-g,d[p]=d[p]-g,d},collide:function(l,f,d,g,m,p,b){var x=i(a(this.points,d+2*b,g,m)),w=i(a(this.crossLinePts(d,p),d+2*b,g,m)),E=cr(l,f,x)||cr(l,f,w);return E},draw:function(l,f,d,g,m){var p=a(this.points,f,d,g),b=a(this.crossLinePts(f,m),f,d,g);e.arrowShapeImpl(this.name)(l,p,b)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return s(l)*.525}}),o("circle",{radius:.15,collide:function(l,f,d,g,m,p,b){var x=m,w=Math.pow(x.x-l,2)+Math.pow(x.y-f,2)<=Math.pow((d+2*b)*this.radius,2);return w},draw:function(l,f,d,g,m){e.arrowShapeImpl(this.name)(l,g.x,g.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),o("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),o("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),o("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}})};var $n={};$n.projectIntoViewport=function(t,e){var r=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],o=r.pan(),u=r.zoom(),l=((t-a)/s-o.x)/u,f=((e-i)/s-o.y)/u;return[l,f]},$n.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var t=this.container,e=t.getBoundingClientRect(),r=this.cy.window().getComputedStyle(t),n=function(w){return parseFloat(r.getPropertyValue(w))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},s=t.clientWidth,o=t.clientHeight,u=a.left+a.right,l=a.top+a.bottom,f=i.left+i.right,d=e.width/(s+f),g=s-u,m=o-l,p=e.left+a.left+i.left,b=e.top+a.top+i.top;return this.containerBB=[p,b,g,m,d]},$n.invalidateContainerClientCoordsCache=function(){this.containerBB=null},$n.findNearestElement=function(t,e,r,n){return this.findNearestElements(t,e,r,n)[0]},$n.findNearestElements=function(t,e,r,n){var a=this,i=this,s=i.getCachedZSortedEles(),o=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(n?24:8)/u,d=(n?8:2)/u,g=(n?8:2)/u,m=1/0,p,b;r&&(s=s.interactive);function x(h,I){if(h.isNode()){if(b)return;b=h,o.push(h)}if(h.isEdge()&&(I==null||I<m))if(p){if(p.pstyle("z-compound-depth").value===h.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===h.pstyle("z-compound-depth").value){for(var D=0;D<o.length;D++)if(o[D].isEdge()){o[D]=h,p=h,m=I??m;break}}}else o.push(h),p=h,m=I??m}function w(h){var I=h.outerWidth()+2*d,D=h.outerHeight()+2*d,M=I/2,L=D/2,B=h.position(),N=h.pstyle("corner-radius").value==="auto"?"auto":h.pstyle("corner-radius").pfValue,_=h._private.rscratch;if(B.x-M<=t&&t<=B.x+M&&B.y-L<=e&&e<=B.y+L){var U=i.nodeShapes[a.getNodeShape(h)];if(U.checkPoint(t,e,0,I,D,B.x,B.y,N,_))return x(h,0),!0}}function E(h){var I=h._private,D=I.rscratch,M=h.pstyle("width").pfValue,L=h.pstyle("arrow-scale").value,B=M/2+f,N=B*B,_=B*2,X=I.source,Q=I.target,U;if(D.edgeType==="segments"||D.edgeType==="straight"||D.edgeType==="haystack"){for(var H=D.allpts,W=0;W+3<H.length;W+=2)if(dp(t,e,H[W],H[W+1],H[W+2],H[W+3],_)&&N>(U=mp(t,e,H[W],H[W+1],H[W+2],H[W+3])))return x(h,U),!0}else if(D.edgeType==="bezier"||D.edgeType==="multibezier"||D.edgeType==="self"||D.edgeType==="compound"){for(var H=D.allpts,W=0;W+5<D.allpts.length;W+=4)if(vp(t,e,H[W],H[W+1],H[W+2],H[W+3],H[W+4],H[W+5],_)&&N>(U=pp(t,e,H[W],H[W+1],H[W+2],H[W+3],H[W+4],H[W+5])))return x(h,U),!0}for(var X=X||I.source,Q=Q||I.target,se=a.getArrowWidth(M,L),j=[{name:"source",x:D.arrowStartX,y:D.arrowStartY,angle:D.srcArrowAngle},{name:"target",x:D.arrowEndX,y:D.arrowEndY,angle:D.tgtArrowAngle},{name:"mid-source",x:D.midX,y:D.midY,angle:D.midsrcArrowAngle},{name:"mid-target",x:D.midX,y:D.midY,angle:D.midtgtArrowAngle}],W=0;W<j.length;W++){var ee=j[W],de=i.arrowShapes[h.pstyle(ee.name+"-arrow-shape").value],ge=h.pstyle("width").pfValue;if(de.roughCollide(t,e,se,ee.angle,{x:ee.x,y:ee.y},ge,f)&&de.collide(t,e,se,ee.angle,{x:ee.x,y:ee.y},ge,f))return x(h),!0}l&&o.length>0&&(w(X),w(Q))}function C(h,I,D){return Ir(h,I,D)}function k(h,I){var D=h._private,M=g,L;I?L=I+"-":L="",h.boundingBox();var B=D.labelBounds[I||"main"],N=h.pstyle(L+"label").value,_=h.pstyle("text-events").strValue==="yes";if(!(!_||!N)){var U=C(D.rscratch,"labelX",I),H=C(D.rscratch,"labelY",I),W=C(D.rscratch,"labelAngle",I),X=h.pstyle(L+"text-margin-x").pfValue,Q=h.pstyle(L+"text-margin-y").pfValue,se=B.x1-M-X,j=B.x2+M-X,ee=B.y1-M-Q,de=B.y2+M-Q;if(W){var ge=Math.cos(W),me=Math.sin(W),pe=function(De,Be){return De=De-U,Be=Be-H,{x:De*ge-Be*me+U,y:De*me+Be*ge+H}},we=pe(se,ee),be=pe(se,de),ae=pe(j,ee),Y=pe(j,de),oe=[we.x+X,we.y+Q,ae.x+X,ae.y+Q,Y.x+X,Y.y+Q,be.x+X,be.y+Q];if(cr(t,e,oe))return x(h),!0}else if(fa(B,t,e))return x(h),!0}}for(var R=s.length-1;R>=0;R--){var A=s[R];A.isNode()?w(A)||k(A):E(A)||k(A)||k(A,"source")||k(A,"target")}return o},$n.getAllInBox=function(t,e,r,n){var a=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,r),o=Math.max(t,r),u=Math.min(e,n),l=Math.max(e,n);t=s,r=o,e=u,n=l;for(var f=fr({x1:t,y1:e,x2:r,y2:n}),d=0;d<a.length;d++){var g=a[d];if(g.isNode()){var m=g,p=m.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:!1});Eo(f,p)&&!ql(p,f)&&i.push(m)}else{var b=g,x=b._private,w=x.rscratch;if(w.startX!=null&&w.startY!=null&&!fa(f,w.startX,w.startY)||w.endX!=null&&w.endY!=null&&!fa(f,w.endX,w.endY))continue;if(w.edgeType==="bezier"||w.edgeType==="multibezier"||w.edgeType==="self"||w.edgeType==="compound"||w.edgeType==="segments"||w.edgeType==="haystack"){for(var E=x.rstyle.bezierPts||x.rstyle.linePts||x.rstyle.haystackPts,C=!0,k=0;k<E.length;k++)if(!cp(f,E[k])){C=!1;break}C&&i.push(b)}else(w.edgeType==="haystack"||w.edgeType==="straight")&&i.push(b)}}return i};var Ms={};Ms.calculateArrowAngles=function(t){var e=t._private.rscratch,r=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",s=e.edgeType==="compound",o=e.edgeType==="self",u,l,f,d,g,m,w,E;if(r?(f=e.haystackPts[0],d=e.haystackPts[1],g=e.haystackPts[2],m=e.haystackPts[3]):(f=e.arrowStartX,d=e.arrowStartY,g=e.arrowEndX,m=e.arrowEndY),w=e.midX,E=e.midY,i)u=f-e.segpts[0],l=d-e.segpts[1];else if(a||s||o||n){var p=e.allpts,b=zt(p[0],p[2],p[4],.1),x=zt(p[1],p[3],p[5],.1);u=f-b,l=d-x}else u=f-w,l=d-E;e.srcArrowAngle=es(u,l);var w=e.midX,E=e.midY;if(r&&(w=(f+g)/2,E=(d+m)/2),u=g-f,l=m-d,i){var p=e.allpts;if(p.length/2%2===0){var C=p.length/2,k=C-2;u=p[C]-p[k],l=p[C+1]-p[k+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var C=p.length/2-1,k=C-2;u=p[C]-p[k],l=p[C+1]-p[k+1]}}else if(a||s||o){var p=e.allpts,R=e.ctrlpts,A,h,I,D;if(R.length/2%2===0){var M=p.length/2-1,L=M+2,B=L+2;A=zt(p[M],p[L],p[B],0),h=zt(p[M+1],p[L+1],p[B+1],0),I=zt(p[M],p[L],p[B],1e-4),D=zt(p[M+1],p[L+1],p[B+1],1e-4)}else{var L=p.length/2-1,M=L-2,B=L+2;A=zt(p[M],p[L],p[B],.4999),h=zt(p[M+1],p[L+1],p[B+1],.4999),I=zt(p[M],p[L],p[B],.5),D=zt(p[M+1],p[L+1],p[B+1],.5)}u=I-A,l=D-h}if(e.midtgtArrowAngle=es(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var C=p.length/2-1,N=C+2;u=-(p[N]-p[C]),l=-(p[N+1]-p[C+1])}}}if(e.midsrcArrowAngle=es(u,l),i)u=g-e.segpts[e.segpts.length-2],l=m-e.segpts[e.segpts.length-1];else if(a||s||o||n){var p=e.allpts,_=p.length,b=zt(p[_-6],p[_-4],p[_-2],.9),x=zt(p[_-5],p[_-3],p[_-1],.9);u=g-b,l=m-x}else u=g-w,l=m-E;e.tgtArrowAngle=es(u,l)},Ms.getArrowWidth=Ms.getArrowHeight=function(t,e){var r=this.arrowWidthCache=this.arrowWidthCache||{},n=r[t+", "+e];return n||(n=Math.max(Math.pow(t*13.37,.9),29)*e,r[t+", "+e]=n,n)};var Qo,Jo,$r={},kr={},Ec,Cc,qn,Rs,en,Hn,Wn,qr,Sa,Ls,Tc,Sc,jo,eu,Dc,kc=function(e,r,n){n.x=r.x-e.x,n.y=r.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)},Jw=function(e,r){r.x=e.x*-1,r.y=e.y*-1,r.nx=e.nx*-1,r.ny=e.ny*-1,r.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},jw=function(e,r,n,a,i){if(e!==Dc?kc(r,e,$r):Jw(kr,$r),kc(r,n,kr),Ec=$r.nx*kr.ny-$r.ny*kr.nx,Cc=$r.nx*kr.nx-$r.ny*-kr.ny,en=Math.asin(Math.max(-1,Math.min(1,Ec))),Math.abs(en)<1e-6){Qo=r.x,Jo=r.y,Wn=Sa=0;return}qn=1,Rs=!1,Cc<0?en<0?en=Math.PI+en:(en=Math.PI-en,qn=-1,Rs=!0):en>0&&(qn=-1,Rs=!0),r.radius!==void 0?Sa=r.radius:Sa=a,Hn=en/2,Ls=Math.min($r.len/2,kr.len/2),i?(qr=Math.abs(Math.cos(Hn)*Sa/Math.sin(Hn)),qr>Ls?(qr=Ls,Wn=Math.abs(qr*Math.sin(Hn)/Math.cos(Hn))):Wn=Sa):(qr=Math.min(Ls,Sa),Wn=Math.abs(qr*Math.sin(Hn)/Math.cos(Hn))),jo=r.x+kr.nx*qr,eu=r.y+kr.ny*qr,Qo=jo-kr.ny*Wn*qn,Jo=eu+kr.nx*Wn*qn,Tc=r.x+$r.nx*qr,Sc=r.y+$r.ny*qr,Dc=r};function Pc(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function tu(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(jw(t,e,r,n,a),{cx:Qo,cy:Jo,radius:Wn,startX:Tc,startY:Sc,stopX:jo,stopY:eu,startAngle:$r.ang+Math.PI/2*qn,endAngle:kr.ang-Math.PI/2*qn,counterClockwise:Rs})}var er={};er.findMidptPtsEtc=function(t,e){var r=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),u=s.units!=null&&o.units!=null,l=function(R,A,h,I){var D=I-A,M=h-R,L=Math.sqrt(M*M+D*D);return{x:-D/L,y:M/L}},f=t.pstyle("edge-distances").value;switch(f){case"node-position":i=r;break;case"intersection":i=n;break;case"endpoints":{if(u){var d=this.manualEndptToPx(t.source()[0],s),g=At(d,2),m=g[0],p=g[1],b=this.manualEndptToPx(t.target()[0],o),x=At(b,2),w=x[0],E=x[1],C={x1:m,y1:p,x2:w,y2:E};a=l(m,p,w,E),i=C}else ht("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint.  Falling back on edge-distances:intersection (default).")),i=n;break}}return{midptPts:i,vectorNormInverse:a}},er.findHaystackPoints=function(t){for(var e=0;e<t.length;e++){var r=t[e],n=r._private,a=n.rscratch;if(!a.haystack){var i=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=n.source,o=n.target,u=s.position(),l=o.position(),f=s.width(),d=o.width(),g=s.height(),m=o.height(),p=r.pstyle("haystack-radius").value,b=p/2;a.haystackPts=a.allpts=[a.source.x*f*b+u.x,a.source.y*g*b+u.y,a.target.x*d*b+l.x,a.target.y*m*b+l.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(r),this.calculateArrowAngles(r),this.recalculateEdgeLabelProjections(r),this.calculateLabelAngles(r)}},er.findSegmentsPoints=function(t,e){var r=t._private.rscratch,n=t.pstyle("segment-weights"),a=t.pstyle("segment-distances"),i=t.pstyle("segment-radii"),s=t.pstyle("radius-type"),o=Math.min(n.pfValue.length,a.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=s.pfValue[s.pfValue.length-1];r.edgeType="segments",r.segpts=[],r.radii=[],r.isArcRadius=[];for(var f=0;f<o;f++){var d=n.pfValue[f],g=a.pfValue[f],m=1-d,p=d,b=this.findMidptPtsEtc(t,e),x=b.midptPts,w=b.vectorNormInverse,E={x:x.x1*m+x.x2*p,y:x.y1*m+x.y2*p};r.segpts.push(E.x+w.x*g,E.y+w.y*g),r.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:u),r.isArcRadius.push((s.pfValue[f]!==void 0?s.pfValue[f]:l)==="arc-radius")}},er.findLoopPoints=function(t,e,r,n){var a=t._private.rscratch,i=e.dirCounts,s=e.srcPos,o=t.pstyle("control-point-distances"),u=o?o.pfValue[0]:void 0,l=t.pstyle("loop-direction").pfValue,f=t.pstyle("loop-sweep").pfValue,d=t.pstyle("control-point-step-size").pfValue;a.edgeType="self";var g=r,m=d;n&&(g=0,m=u);var p=l-Math.PI/2,b=p-f/2,x=p+f/2,w=l+"_"+f;g=i[w]===void 0?i[w]=0:++i[w],a.ctrlpts=[s.x+Math.cos(b)*1.4*m*(g/3+1),s.y+Math.sin(b)*1.4*m*(g/3+1),s.x+Math.cos(x)*1.4*m*(g/3+1),s.y+Math.sin(x)*1.4*m*(g/3+1)]},er.findCompoundLoopPoints=function(t,e,r,n){var a=t._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,d=t.pstyle("control-point-step-size").pfValue,g=t.pstyle("control-point-distances"),m=g?g.pfValue[0]:void 0,p=r,b=d;n&&(p=0,b=m);var x=50,w={x:i.x-o/2,y:i.y-u/2},E={x:s.x-l/2,y:s.y-f/2},C={x:Math.min(w.x,E.x),y:Math.min(w.y,E.y)},k=.5,R=Math.max(k,Math.log(o*.01)),A=Math.max(k,Math.log(l*.01));a.ctrlpts=[C.x,C.y-(1+Math.pow(x,1.12)/100)*b*(p/3+1)*R,C.x-(1+Math.pow(x,1.12)/100)*b*(p/3+1)*A,C.y]},er.findStraightEdgePoints=function(t){t._private.rscratch.edgeType="straight"},er.findBezierPoints=function(t,e,r,n,a){var i=t._private.rscratch,s=t.pstyle("control-point-step-size").pfValue,o=t.pstyle("control-point-distances"),u=t.pstyle("control-point-weights"),l=o&&u?Math.min(o.value.length,u.value.length):1,f=o?o.pfValue[0]:void 0,d=u.value[0],g=n;i.edgeType=g?"multibezier":"bezier",i.ctrlpts=[];for(var m=0;m<l;m++){var p=(.5-e.eles.length/2+r)*s*(a?-1:1),b=void 0,x=zl(p);g&&(f=o?o.pfValue[m]:s,d=u.value[m]),n?b=f:b=f!==void 0?x*f:void 0;var w=b!==void 0?b:p,E=1-d,C=d,k=this.findMidptPtsEtc(t,e),R=k.midptPts,A=k.vectorNormInverse,h={x:R.x1*E+R.x2*C,y:R.y1*E+R.y2*C};i.ctrlpts.push(h.x+A.x*w,h.y+A.y*w)}},er.findTaxiPoints=function(t,e){var r=t._private.rscratch;r.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",o="downward",u="upward",l="auto",f=e.posPts,d=e.srcW,g=e.srcH,m=e.tgtW,p=e.tgtH,b=t.pstyle("edge-distances").value,x=b!=="node-position",w=t.pstyle("taxi-direction").value,E=w,C=t.pstyle("taxi-turn"),k=C.units==="%",R=C.pfValue,A=R<0,h=t.pstyle("taxi-turn-min-distance").pfValue,I=x?(d+m)/2:0,D=x?(g+p)/2:0,M=f.x2-f.x1,L=f.y2-f.y1,B=function(fe,Ee){return fe>0?Math.max(fe-Ee,0):Math.min(fe+Ee,0)},N=B(M,I),_=B(L,D),U=!1;E===l?w=Math.abs(N)>Math.abs(_)?a:n:E===u||E===o?(w=n,U=!0):(E===i||E===s)&&(w=a,U=!0);var H=w===n,W=H?_:N,X=H?L:M,Q=zl(X),se=!1;!(U&&(k||A))&&(E===o&&X<0||E===u&&X>0||E===i&&X>0||E===s&&X<0)&&(Q*=-1,W=Q*Math.abs(W),se=!0);var j;if(k){var ee=R<0?1+R:R;j=ee*W}else{var de=R<0?W:0;j=de+R*Q}var ge=function(fe){return Math.abs(fe)<h||Math.abs(fe)>=Math.abs(W)},me=ge(j),pe=ge(Math.abs(W)-Math.abs(j)),we=me||pe;if(we&&!se)if(H){var be=Math.abs(X)<=g/2,ae=Math.abs(M)<=m/2;if(be){var Y=(f.x1+f.x2)/2,oe=f.y1,ye=f.y2;r.segpts=[Y,oe,Y,ye]}else if(ae){var De=(f.y1+f.y2)/2,Be=f.x1,Je=f.x2;r.segpts=[Be,De,Je,De]}else r.segpts=[f.x1,f.y2]}else{var ut=Math.abs(X)<=d/2,at=Math.abs(L)<=p/2;if(ut){var ke=(f.y1+f.y2)/2,Ie=f.x1,He=f.x2;r.segpts=[Ie,ke,He,ke]}else if(at){var We=(f.x1+f.x2)/2,Le=f.y1,ze=f.y2;r.segpts=[We,Le,We,ze]}else r.segpts=[f.x2,f.y1]}else if(H){var Ge=f.y1+j+(x?g/2*Q:0),Fe=f.x1,he=f.x2;r.segpts=[Fe,Ge,he,Ge]}else{var O=f.x1+j+(x?d/2*Q:0),Z=f.y1,le=f.y2;r.segpts=[O,Z,O,le]}if(r.isRound){var J=t.pstyle("taxi-radius").value,ne=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(J),r.isArcRadius=new Array(r.segpts.length/2).fill(ne)}},er.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,d=e.srcCornerRadius,g=e.tgtCornerRadius,m=e.srcRs,p=e.tgtRs,b=!Se(r.startX)||!Se(r.startY),x=!Se(r.arrowStartX)||!Se(r.arrowStartY),w=!Se(r.endX)||!Se(r.endY),E=!Se(r.arrowEndX)||!Se(r.arrowEndY),C=3,k=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,R=C*k,A=Rn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),h=A<R,I=Rn({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.endX,y:r.endY}),D=I<R,M=!1;if(b||x||h){M=!0;var L={x:r.ctrlpts[0]-n.x,y:r.ctrlpts[1]-n.y},B=Math.sqrt(L.x*L.x+L.y*L.y),N={x:L.x/B,y:L.y/B},_=Math.max(i,s),U={x:r.ctrlpts[0]+N.x*2*_,y:r.ctrlpts[1]+N.y*2*_},H=l.intersectLine(n.x,n.y,i,s,U.x,U.y,0,d,m);h?(r.ctrlpts[0]=r.ctrlpts[0]+N.x*(R-A),r.ctrlpts[1]=r.ctrlpts[1]+N.y*(R-A)):(r.ctrlpts[0]=H[0]+N.x*R,r.ctrlpts[1]=H[1]+N.y*R)}if(w||E||D){M=!0;var W={x:r.ctrlpts[0]-a.x,y:r.ctrlpts[1]-a.y},X=Math.sqrt(W.x*W.x+W.y*W.y),Q={x:W.x/X,y:W.y/X},se=Math.max(i,s),j={x:r.ctrlpts[0]+Q.x*2*se,y:r.ctrlpts[1]+Q.y*2*se},ee=f.intersectLine(a.x,a.y,o,u,j.x,j.y,0,g,p);D?(r.ctrlpts[0]=r.ctrlpts[0]+Q.x*(R-I),r.ctrlpts[1]=r.ctrlpts[1]+Q.y*(R-I)):(r.ctrlpts[0]=ee[0]+Q.x*R,r.ctrlpts[1]=ee[1]+Q.y*R)}M&&this.findEndpoints(t)}},er.storeAllpts=function(t){var e=t._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var r=0;r+1<e.ctrlpts.length;r+=2)e.allpts.push(e.ctrlpts[r],e.ctrlpts[r+1]),r+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[r]+e.ctrlpts[r+2])/2,(e.ctrlpts[r+1]+e.ctrlpts[r+3])/2);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=zt(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=zt(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var s=e.radii[i/2-1],o=e.isArcRadius[i/2-1];e.roundCorners.push(tu({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:s},{x:e.allpts[i+2],y:e.allpts[i+3]},s,o))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var d={x:e.segpts[f],y:e.segpts[f+1]},g=e.roundCorners[f/2],m=[d.x-g.cx,d.y-g.cy],p=g.radius/Math.sqrt(Math.pow(m[0],2)+Math.pow(m[1],2));m=m.map(function(b){return b*p}),e.midX=g.cx+m[0],e.midY=g.cy+m[1],e.midVector=m}}}},er.checkForInvalidEdgeWarning=function(t){var e=t[0]._private.rscratch;e.nodesOverlap||Se(e.startX)&&Se(e.startY)&&Se(e.endX)&&Se(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,ht("Edge `"+t.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."))},er.findEdgeControlPoints=function(t){var e=this;if(!(!t||t.length===0)){for(var r=this,n=r.cy,a=n.hasCompoundNodes(),i={map:new zr,get:function(h){var I=this.map.get(h[0]);return I!=null?I.get(h[1]):null},set:function(h,I){var D=this.map.get(h[0]);D==null&&(D=new zr,this.map.set(h[0],D)),D.set(h[1],I)}},s=[],o=[],u=0;u<t.length;u++){var l=t[u],f=l._private,d=l.pstyle("curve-style").value;if(!(l.removed()||!l.takesUpSpace())){if(d==="haystack"){o.push(l);continue}var g=d==="unbundled-bezier"||d.endsWith("segments")||d==="straight"||d==="straight-triangle"||d.endsWith("taxi"),m=d==="unbundled-bezier"||d==="bezier",p=f.source,b=f.target,x=p.poolIndex(),w=b.poolIndex(),E=[x,w].sort(),C=i.get(E);C==null&&(C={eles:[]},i.set(E,C),s.push(E)),C.eles.push(l),g&&(C.hasUnbundled=!0),m&&(C.hasBezier=!0)}}for(var k=function(h){var I=s[h],D=i.get(I),M=void 0;if(!D.hasUnbundled){var L=D.eles[0].parallelEdges().filter(function(O){return O.isBundledBezier()});bo(D.eles),L.forEach(function(O){return D.eles.push(O)}),D.eles.sort(function(O,Z){return O.poolIndex()-Z.poolIndex()})}var B=D.eles[0],N=B.source(),_=B.target();if(N.poolIndex()>_.poolIndex()){var U=N;N=_,_=U}var H=D.srcPos=N.position(),W=D.tgtPos=_.position(),X=D.srcW=N.outerWidth(),Q=D.srcH=N.outerHeight(),se=D.tgtW=_.outerWidth(),j=D.tgtH=_.outerHeight(),ee=D.srcShape=r.nodeShapes[e.getNodeShape(N)],de=D.tgtShape=r.nodeShapes[e.getNodeShape(_)],ge=D.srcCornerRadius=N.pstyle("corner-radius").value==="auto"?"auto":N.pstyle("corner-radius").pfValue,me=D.tgtCornerRadius=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,pe=D.tgtRs=_._private.rscratch,we=D.srcRs=N._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var be=0;be<D.eles.length;be++){var ae=D.eles[be],Y=ae[0]._private.rscratch,oe=ae.pstyle("curve-style").value,ye=oe==="unbundled-bezier"||oe.endsWith("segments")||oe.endsWith("taxi"),De=!N.same(ae.source());if(!D.calculatedIntersection&&N!==_&&(D.hasBezier||D.hasUnbundled)){D.calculatedIntersection=!0;var Be=ee.intersectLine(H.x,H.y,X,Q,W.x,W.y,0,ge,we),Je=D.srcIntn=Be,ut=de.intersectLine(W.x,W.y,se,j,H.x,H.y,0,me,pe),at=D.tgtIntn=ut,ke=D.intersectionPts={x1:Be[0],x2:ut[0],y1:Be[1],y2:ut[1]},Ie=D.posPts={x1:H.x,x2:W.x,y1:H.y,y2:W.y},He=ut[1]-Be[1],We=ut[0]-Be[0],Le=Math.sqrt(We*We+He*He),ze=D.vector={x:We,y:He},Ge=D.vectorNorm={x:ze.x/Le,y:ze.y/Le},Fe={x:-Ge.y,y:Ge.x};D.nodesOverlap=!Se(Le)||de.checkPoint(Be[0],Be[1],0,se,j,W.x,W.y,me,pe)||ee.checkPoint(ut[0],ut[1],0,X,Q,H.x,H.y,ge,we),D.vectorNormInverse=Fe,M={nodesOverlap:D.nodesOverlap,dirCounts:D.dirCounts,calculatedIntersection:!0,hasBezier:D.hasBezier,hasUnbundled:D.hasUnbundled,eles:D.eles,srcPos:W,srcRs:pe,tgtPos:H,tgtRs:we,srcW:se,srcH:j,tgtW:X,tgtH:Q,srcIntn:at,tgtIntn:Je,srcShape:de,tgtShape:ee,posPts:{x1:Ie.x2,y1:Ie.y2,x2:Ie.x1,y2:Ie.y1},intersectionPts:{x1:ke.x2,y1:ke.y2,x2:ke.x1,y2:ke.y1},vector:{x:-ze.x,y:-ze.y},vectorNorm:{x:-Ge.x,y:-Ge.y},vectorNormInverse:{x:-Fe.x,y:-Fe.y}}}var he=De?M:D;Y.nodesOverlap=he.nodesOverlap,Y.srcIntn=he.srcIntn,Y.tgtIntn=he.tgtIntn,Y.isRound=oe.startsWith("round"),a&&(N.isParent()||N.isChild()||_.isParent()||_.isChild())&&(N.parents().anySame(_)||_.parents().anySame(N)||N.same(_)&&N.isParent())?e.findCompoundLoopPoints(ae,he,be,ye):N===_?e.findLoopPoints(ae,he,be,ye):oe.endsWith("segments")?e.findSegmentsPoints(ae,he):oe.endsWith("taxi")?e.findTaxiPoints(ae,he):oe==="straight"||!ye&&D.eles.length%2===1&&be===Math.floor(D.eles.length/2)?e.findStraightEdgePoints(ae):e.findBezierPoints(ae,he,be,ye,De),e.findEndpoints(ae),e.tryToCorrectInvalidPoints(ae,he),e.checkForInvalidEdgeWarning(ae),e.storeAllpts(ae),e.storeEdgeProjections(ae),e.calculateArrowAngles(ae),e.recalculateEdgeLabelProjections(ae),e.calculateLabelAngles(ae)}},R=0;R<s.length;R++)k(R);this.findHaystackPoints(o)}};function Ac(t){var e=[];if(t!=null){for(var r=0;r<t.length;r+=2){var n=t[r],a=t[r+1];e.push({x:n,y:a})}return e}}er.getSegmentPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="segments")return Ac(e.segpts)},er.getControlPoints=function(t){var e=t[0]._private.rscratch;this.recalculateRenderedStyle(t);var r=e.edgeType;if(r==="bezier"||r==="multibezier"||r==="self"||r==="compound")return Ac(e.ctrlpts)},er.getEdgeMidpoint=function(t){var e=t[0]._private.rscratch;return this.recalculateRenderedStyle(t),{x:e.midX,y:e.midY}};var pi={};pi.manualEndptToPx=function(t,e){var r=this,n=t.position(),a=t.outerWidth(),i=t.outerHeight(),s=t._private.rscratch;if(e.value.length===2){var o=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(o[0]=o[0]*a),e.units[1]==="%"&&(o[1]=o[1]*i),o[0]+=n.x,o[1]+=n.y,o}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(a,i),f=[n.x+Math.cos(u)*l,n.y+Math.sin(u)*l];return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x,n.y,a,i,f[0],f[1],0,t.pstyle("corner-radius").value==="auto"?"auto":t.pstyle("corner-radius").pfValue,s)}},pi.findEndpoints=function(t){var e=this,r,n=t.source()[0],a=t.target()[0],i=n.position(),s=a.position(),o=t.pstyle("target-arrow-shape").value,u=t.pstyle("source-arrow-shape").value,l=t.pstyle("target-distance-from-node").pfValue,f=t.pstyle("source-distance-from-node").pfValue,d=n._private.rscratch,g=a._private.rscratch,m=t.pstyle("curve-style").value,p=t._private.rscratch,b=p.edgeType,x=m==="taxi",w=b==="self"||b==="compound",E=b==="bezier"||b==="multibezier"||w,C=b!=="bezier",k=b==="straight"||b==="segments",R=b==="segments",A=E||C||k,h=w||x,I=t.pstyle("source-endpoint"),D=h?"outside-to-node":I.value,M=n.pstyle("corner-radius").value==="auto"?"auto":n.pstyle("corner-radius").pfValue,L=t.pstyle("target-endpoint"),B=h?"outside-to-node":L.value,N=a.pstyle("corner-radius").value==="auto"?"auto":a.pstyle("corner-radius").pfValue;p.srcManEndpt=I,p.tgtManEndpt=L;var _,U,H,W;if(E){var X=[p.ctrlpts[0],p.ctrlpts[1]],Q=C?[p.ctrlpts[p.ctrlpts.length-2],p.ctrlpts[p.ctrlpts.length-1]]:X;_=Q,U=X}else if(k){var se=R?p.segpts.slice(0,2):[s.x,s.y],j=R?p.segpts.slice(p.segpts.length-2):[i.x,i.y];_=j,U=se}if(B==="inside-to-node")r=[s.x,s.y];else if(L.units)r=this.manualEndptToPx(a,L);else if(B==="outside-to-line")r=p.tgtIntn;else if(B==="outside-to-node"||B==="outside-to-node-or-label"?H=_:(B==="outside-to-line"||B==="outside-to-line-or-label")&&(H=[i.x,i.y]),r=e.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),H[0],H[1],0,N,g),B==="outside-to-node-or-label"||B==="outside-to-line-or-label"){var ee=a._private.rscratch,de=ee.labelWidth,ge=ee.labelHeight,me=ee.labelX,pe=ee.labelY,we=de/2,be=ge/2,ae=a.pstyle("text-valign").value;ae==="top"?pe-=be:ae==="bottom"&&(pe+=be);var Y=a.pstyle("text-halign").value;Y==="left"?me-=we:Y==="right"&&(me+=we);var oe=ri(H[0],H[1],[me-we,pe-be,me+we,pe-be,me+we,pe+be,me-we,pe+be],s.x,s.y);if(oe.length>0){var ye=i,De=Ln(ye,ua(r)),Be=Ln(ye,ua(oe)),Je=De;if(Be<De&&(r=oe,Je=Be),oe.length>2){var ut=Ln(ye,{x:oe[2],y:oe[3]});ut<Je&&(r=[oe[2],oe[3]])}}}var at=is(r,_,e.arrowShapes[o].spacing(t)+l),ke=is(r,_,e.arrowShapes[o].gap(t)+l);if(p.endX=ke[0],p.endY=ke[1],p.arrowEndX=at[0],p.arrowEndY=at[1],D==="inside-to-node")r=[i.x,i.y];else if(I.units)r=this.manualEndptToPx(n,I);else if(D==="outside-to-line")r=p.srcIntn;else if(D==="outside-to-node"||D==="outside-to-node-or-label"?W=U:(D==="outside-to-line"||D==="outside-to-line-or-label")&&(W=[s.x,s.y]),r=e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x,i.y,n.outerWidth(),n.outerHeight(),W[0],W[1],0,M,d),D==="outside-to-node-or-label"||D==="outside-to-line-or-label"){var Ie=n._private.rscratch,He=Ie.labelWidth,We=Ie.labelHeight,Le=Ie.labelX,ze=Ie.labelY,Ge=He/2,Fe=We/2,he=n.pstyle("text-valign").value;he==="top"?ze-=Fe:he==="bottom"&&(ze+=Fe);var O=n.pstyle("text-halign").value;O==="left"?Le-=Ge:O==="right"&&(Le+=Ge);var Z=ri(W[0],W[1],[Le-Ge,ze-Fe,Le+Ge,ze-Fe,Le+Ge,ze+Fe,Le-Ge,ze+Fe],i.x,i.y);if(Z.length>0){var le=s,J=Ln(le,ua(r)),ne=Ln(le,ua(Z)),Te=J;if(ne<J&&(r=[Z[0],Z[1]],Te=ne),Z.length>2){var fe=Ln(le,{x:Z[2],y:Z[3]});fe<Te&&(r=[Z[2],Z[3]])}}}var Ee=is(r,U,e.arrowShapes[u].spacing(t)+f),Oe=is(r,U,e.arrowShapes[u].gap(t)+f);p.startX=Oe[0],p.startY=Oe[1],p.arrowStartX=Ee[0],p.arrowStartY=Ee[1],A&&(!Se(p.startX)||!Se(p.startY)||!Se(p.endX)||!Se(p.endY)?p.badLine=!0:p.badLine=!1)},pi.getSourceEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}},pi.getTargetEndpoint=function(t){var e=t[0]._private.rscratch;switch(this.recalculateRenderedStyle(t),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var ru={};function eb(t,e,r){for(var n=function(l,f,d,g){return zt(l,f,d,g)},a=e._private,i=a.rstyle.bezierPts,s=0;s<t.bezierProjPcts.length;s++){var o=t.bezierProjPcts[s];i.push({x:n(r[0],r[2],r[4],o),y:n(r[1],r[3],r[5],o)})}}ru.storeEdgeProjections=function(t){var e=t._private,r=e.rscratch,n=r.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<r.allpts.length;a+=4)eb(this,t,r.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<r.allpts.length;a+=2)i.push({x:r.allpts[a],y:r.allpts[a+1]});else if(n==="haystack"){var s=r.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth},ru.recalculateEdgeProjections=function(t){this.findEdgeControlPoints(t)};var Hr={};Hr.recalculateNodeLabelProjection=function(t){var e=t.pstyle("label").strValue;if(!cn(e)){var r,n,a=t._private,i=t.width(),s=t.height(),o=t.padding(),u=t.position(),l=t.pstyle("text-halign").strValue,f=t.pstyle("text-valign").strValue,d=a.rscratch,g=a.rstyle;switch(l){case"left":r=u.x-i/2-o;break;case"right":r=u.x+i/2+o;break;default:r=u.x}switch(f){case"top":n=u.y-s/2-o;break;case"bottom":n=u.y+s/2+o;break;default:n=u.y}d.labelX=r,d.labelY=n,g.labelX=r,g.labelY=n,this.calculateLabelAngles(t),this.applyLabelDimensions(t)}};var Bc=function(e,r){var n=Math.atan(r/e);return e===0&&n<0&&(n=n*-1),n},Ic=function(e,r){var n=r.x-e.x,a=r.y-e.y;return Bc(n,a)},tb=function(e,r,n,a){var i=ei(0,a-.001,1),s=ei(0,a+.001,1),o=la(e,r,n,i),u=la(e,r,n,s);return Ic(o,u)};Hr.recalculateEdgeLabelProjections=function(t){var e,r=t._private,n=r.rscratch,a=this,i={mid:t.pstyle("label").strValue,source:t.pstyle("source-label").strValue,target:t.pstyle("target-label").strValue};if(i.mid||i.source||i.target){e={x:n.midX,y:n.midY};var s=function(d,g,m){gn(r.rscratch,d,g,m),gn(r.rstyle,d,g,m)};s("labelX",null,e.x),s("labelY",null,e.y);var o=Bc(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var u=function f(){if(f.cache)return f.cache;for(var d=[],g=0;g+5<n.allpts.length;g+=4){var m={x:n.allpts[g],y:n.allpts[g+1]},p={x:n.allpts[g+2],y:n.allpts[g+3]},b={x:n.allpts[g+4],y:n.allpts[g+5]};d.push({p0:m,p1:p,p2:b,startDist:0,length:0,segments:[]})}var x=r.rstyle.bezierPts,w=a.bezierProjPcts.length;function E(h,I,D,M,L){var B=Rn(I,D),N=h.segments[h.segments.length-1],_={p0:I,p1:D,t0:M,t1:L,startDist:N?N.startDist+N.length:0,length:B};h.segments.push(_),h.length+=B}for(var C=0;C<d.length;C++){var k=d[C],R=d[C-1];R&&(k.startDist=R.startDist+R.length),E(k,k.p0,x[C*w],0,a.bezierProjPcts[0]);for(var A=0;A<w-1;A++)E(k,x[C*w+A],x[C*w+A+1],a.bezierProjPcts[A],a.bezierProjPcts[A+1]);E(k,x[C*w+w-1],k.p2,a.bezierProjPcts[w-1],1)}return f.cache=d},l=function(d){var g,m=d==="source";if(i[d]){var p=t.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var b=u(),x,w=0,E=0,C=0;C<b.length;C++){for(var k=b[m?C:b.length-1-C],R=0;R<k.segments.length;R++){var A=k.segments[m?R:k.segments.length-1-R],h=C===b.length-1&&R===k.segments.length-1;if(w=E,E+=A.length,E>=p||h){x={cp:k,segment:A};break}}if(x)break}var I=x.cp,D=x.segment,M=(p-w)/D.length,L=D.t1-D.t0,B=m?D.t0+L*M:D.t1-L*M;B=ei(0,B,1),e=la(I.p0,I.p1,I.p2,B),g=tb(I.p0,I.p1,I.p2,B);break}case"straight":case"segments":case"haystack":{for(var N=0,_,U,H,W,X=n.allpts.length,Q=0;Q+3<X&&(m?(H={x:n.allpts[Q],y:n.allpts[Q+1]},W={x:n.allpts[Q+2],y:n.allpts[Q+3]}):(H={x:n.allpts[X-2-Q],y:n.allpts[X-1-Q]},W={x:n.allpts[X-4-Q],y:n.allpts[X-3-Q]}),_=Rn(H,W),U=N,N+=_,!(N>=p));Q+=2);var se=p-U,j=se/_;j=ei(0,j,1),e=sp(H,W,j),g=Ic(H,W);break}}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,g)}};l("source"),l("target"),this.applyLabelDimensions(t)}},Hr.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))},Hr.applyPrefixedLabelDimensions=function(t,e){var r=t._private,n=this.getLabelText(t,e),a=this.calculateLabelDimensions(t,n),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Ir(r.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(o.length,1),l=a.height/u,f=l*i,d=a.width,g=a.height+(u-1)*(i-1)*l;gn(r.rstyle,"labelWidth",e,d),gn(r.rscratch,"labelWidth",e,d),gn(r.rstyle,"labelHeight",e,g),gn(r.rscratch,"labelHeight",e,g),gn(r.rscratch,"labelLineHeight",e,f)},Hr.getLabelText=function(t,e){var r=t._private,n=e?e+"-":"",a=t.pstyle(n+"label").strValue,i=t.pstyle("text-transform").value,s=function(de,ge){return ge?(gn(r.rscratch,de,e,ge),ge):Ir(r.rscratch,de,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var u=s("labelKey");if(u!=null&&s("labelWrapKey")===u)return s("labelWrapCachedText");for(var l="​",f=a.split(`
`),d=t.pstyle("text-max-width").pfValue,g=t.pstyle("text-overflow-wrap").value,m=g==="anywhere",p=[],b=/[\s\u200b]+|$/g,x=0;x<f.length;x++){var w=f[x],E=this.calculateLabelDimensions(t,w),C=E.width;if(m){var k=w.split("").join(l);w=k}if(C>d){var R=w.matchAll(b),A="",h=0,I=wr(R),D;try{for(I.s();!(D=I.n()).done;){var M=D.value,L=M[0],B=w.substring(h,M.index);h=M.index+L.length;var N=A.length===0?B:A+B+L,_=this.calculateLabelDimensions(t,N),U=_.width;U<=d?A+=B+L:(A&&p.push(A),A=B+L)}}catch(ee){I.e(ee)}finally{I.f()}A.match(/^[\s\u200b]+$/)||p.push(A)}else p.push(w)}s("labelWrapCachedLines",p),a=s("labelWrapCachedText",p.join(`
`)),s("labelWrapKey",u)}else if(o==="ellipsis"){var H=t.pstyle("text-max-width").pfValue,W="",X="…",Q=!1;if(this.calculateLabelDimensions(t,a).width<H)return a;for(var se=0;se<a.length;se++){var j=this.calculateLabelDimensions(t,W+a[se]+X).width;if(j>H)break;W+=a[se],se===a.length-1&&(Q=!0)}return Q||(W+=X),W}return a},Hr.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e},Hr.calculateLabelDimensions=function(t,e){var r=this,n=r.cy.window(),a=n.document,i=vn(e,t._private.labelDimsKey),s=r.labelDimCache||(r.labelDimCache=[]),o=s[i];if(o!=null)return o;var u=0,l=t.pstyle("font-style").strValue,f=t.pstyle("font-size").pfValue,d=t.pstyle("font-family").strValue,g=t.pstyle("font-weight").strValue,m=this.labelCalcCanvas,p=this.labelCalcCanvasContext;if(!m){m=this.labelCalcCanvas=a.createElement("canvas"),p=this.labelCalcCanvasContext=m.getContext("2d");var b=m.style;b.position="absolute",b.left="-9999px",b.top="-9999px",b.zIndex="-1",b.visibility="hidden",b.pointerEvents="none"}p.font="".concat(l," ").concat(g," ").concat(f,"px ").concat(d);for(var x=0,w=0,E=e.split(`
`),C=0;C<E.length;C++){var k=E[C],R=p.measureText(k),A=Math.ceil(R.width),h=f;x=Math.max(A,x),w+=h}return x+=u,w+=u,s[i]={width:x,height:w}},Hr.calculateLabelAngle=function(t,e){var r=t._private,n=r.rscratch,a=t.isEdge(),i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=s.strValue;return o==="none"?0:a&&o==="autorotate"?n.labelAutoAngle:o==="autorotate"?0:s.pfValue},Hr.calculateLabelAngles=function(t){var e=this,r=t.isEdge(),n=t._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(t),r&&(a.sourceLabelAngle=e.calculateLabelAngle(t,"source"),a.targetLabelAngle=e.calculateLabelAngle(t,"target"))};var Mc={},Rc=28,Lc=!1;Mc.getNodeShape=function(t){var e=this,r=t.pstyle("shape").value;if(r==="cutrectangle"&&(t.width()<Rc||t.height()<Rc))return Lc||(ht("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Lc=!0),"rectangle";if(t.isParent())return r==="rectangle"||r==="roundrectangle"||r==="round-rectangle"||r==="cutrectangle"||r==="cut-rectangle"||r==="barrel"?r:"rectangle";if(r==="polygon"){var n=t.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return r};var Os={};Os.registerCalculationListeners=function(){var t=this.cy,e=t.collection(),r=this,n=function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var u=0;u<s.length;u++){var l=s[u],f=l._private,d=f.rstyle;d.clean=!1,d.cleanConnected=!1}};r.binder(t).on("bounds.* dirty.*",function(s){var o=s.target;n(o)}).on("style.* background.*",function(s){var o=s.target;n(o,!1)});var a=function(s){if(s){var o=r.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(n(l.connectedEdges()),f.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++){var g=o[d];g(s,e)}r.recalculateRenderedStyle(e),e=t.collection()}};r.flushRenderedStyleQueue=function(){a(!0)},r.beforeRender(a,r.beforeRenderPriorities.eleCalcs)},Os.onUpdateEleCalcs=function(t){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(t)},Os.recalculateRenderedStyle=function(t,e){var r=function(k){return k._private.rstyle.cleanConnected},n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<t.length;i++){var s=t[i],o=s._private,u=o.rstyle;s.isEdge()&&(!r(s.source())||!r(s.target()))&&(u.clean=!1),!(e&&u.clean||s.removed())&&s.pstyle("display").value!=="none"&&(o.group==="nodes"?a.push(s):n.push(s),u.clean=!0)}for(var l=0;l<a.length;l++){var f=a[l],d=f._private,g=d.rstyle,m=f.position();this.recalculateNodeLabelProjection(f),g.nodeX=m.x,g.nodeY=m.y,g.nodeW=f.pstyle("width").pfValue,g.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var b=n[p],x=b._private,w=x.rstyle,E=x.rscratch;w.srcX=E.arrowStartX,w.srcY=E.arrowStartY,w.tgtX=E.arrowEndX,w.tgtY=E.arrowEndY,w.midX=E.midX,w.midY=E.midY,w.labelAngle=E.labelAngle,w.sourceLabelAngle=E.sourceLabelAngle,w.targetLabelAngle=E.targetLabelAngle}}};var Ns={};Ns.updateCachedGrabbedEles=function(){var t=this.cachedZSortedEles;if(t){t.drag=[],t.nondrag=[];for(var e=[],r=0;r<t.length;r++){var n=t[r],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?t.drag.push(n):t.nondrag.push(n)}for(var r=0;r<e.length;r++){var n=e[r];t.drag.push(n)}}},Ns.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null},Ns.getCachedZSortedEles=function(t){if(t||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(Qf),e.interactive=e.filter(function(r){return r.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var Oc={};[$n,Ms,er,pi,ru,Hr,Mc,Os,Ns].forEach(function(t){Ve(Oc,t)});var Nc={};Nc.getCachedImage=function(t,e,r){var n=this,a=n.imageCache=n.imageCache||{},i=a[t];if(i)return i.image.complete||i.image.addEventListener("load",r),i.image;i=a[t]=a[t]||{};var s=i.image=new Image;s.addEventListener("load",r),s.addEventListener("error",function(){s.error=!0});var o="data:",u=t.substring(0,o.length).toLowerCase()===o;return u||(e=e==="null"?null:e,s.crossOrigin=e),s.src=t,s};var Da={};Da.registerBinding=function(t,e,r,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(t)){for(var i=[],s=0;s<t.length;s++){var o=t[s];if(o!==void 0){var u=this.binder(o);i.push(u.on.apply(u,a))}}return i}var u=this.binder(t);return u.on.apply(u,a)},Da.binder=function(t){var e=this,r=e.cy.window(),n=t===r||t===r.document||t===r.document.body||Dh(t);if(e.supportsPassiveEvents==null){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});r.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(u,l,f){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:t,args:d}),(t.addEventListener||t.on).apply(t,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}},Da.nodeIsDraggable=function(t){return t&&t.isNode()&&!t.locked()&&t.grabbable()},Da.nodeIsGrabbable=function(t){return this.nodeIsDraggable(t)&&t.interactive()},Da.load=function(){var t=this,e=t.cy.window(),r=function(O){return O.selected()},n=function(O){var Z=O.getRootNode();if(Z&&Z.nodeType===11&&Z.host!==void 0)return Z},a=function(O,Z,le,J){O==null&&(O=t.cy);for(var ne=0;ne<Z.length;ne++){var Te=Z[ne];O.emit({originalEvent:le,type:Te,position:J})}},i=function(O){return O.shiftKey||O.metaKey||O.ctrlKey},s=function(O,Z){var le=!0;if(t.cy.hasCompoundNodes()&&O&&O.pannable())for(var J=0;Z&&J<Z.length;J++){var O=Z[J];if(O.isNode()&&O.isParent()&&!O.pannable()){le=!1;break}}else le=!0;return le},o=function(O){O[0]._private.grabbed=!0},u=function(O){O[0]._private.grabbed=!1},l=function(O){O[0]._private.rscratch.inDragLayer=!0},f=function(O){O[0]._private.rscratch.inDragLayer=!1},d=function(O){O[0]._private.rscratch.isGrabTarget=!0},g=function(O){O[0]._private.rscratch.isGrabTarget=!1},m=function(O,Z){var le=Z.addToList,J=le.has(O);!J&&O.grabbable()&&!O.locked()&&(le.merge(O),o(O))},p=function(O,Z){if(O.cy().hasCompoundNodes()&&!(Z.inDragLayer==null&&Z.addToList==null)){var le=O.descendants();Z.inDragLayer&&(le.forEach(l),le.connectedEdges().forEach(l)),Z.addToList&&m(le,Z)}},b=function(O,Z){Z=Z||{};var le=O.cy().hasCompoundNodes();Z.inDragLayer&&(O.forEach(l),O.neighborhood().stdFilter(function(J){return!le||J.isEdge()}).forEach(l)),Z.addToList&&O.forEach(function(J){m(J,Z)}),p(O,Z),E(O,{inDragLayer:Z.inDragLayer}),t.updateCachedGrabbedEles()},x=b,w=function(O){O&&(t.getCachedZSortedEles().forEach(function(Z){u(Z),f(Z),g(Z)}),t.updateCachedGrabbedEles())},E=function(O,Z){if(!(Z.inDragLayer==null&&Z.addToList==null)&&O.cy().hasCompoundNodes()){var le=O.ancestors().orphans();if(!le.same(O)){var J=le.descendants().spawnSelf().merge(le).unmerge(O).unmerge(O.descendants()),ne=J.connectedEdges();Z.inDragLayer&&(ne.forEach(l),J.forEach(l)),Z.addToList&&J.forEach(function(Te){m(Te,Z)})}}},C=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},k=typeof MutationObserver<"u",R=typeof ResizeObserver<"u";k?(t.removeObserver=new MutationObserver(function(he){for(var O=0;O<he.length;O++){var Z=he[O],le=Z.removedNodes;if(le)for(var J=0;J<le.length;J++){var ne=le[J];if(ne===t.container){t.destroy();break}}}}),t.container.parentNode&&t.removeObserver.observe(t.container.parentNode,{childList:!0})):t.registerBinding(t.container,"DOMNodeRemoved",function(he){t.destroy()});var A=Xa(function(){t.cy.resize()},100);k&&(t.styleObserver=new MutationObserver(A),t.styleObserver.observe(t.container,{attributes:!0})),t.registerBinding(e,"resize",A),R&&(t.resizeObserver=new ResizeObserver(A),t.resizeObserver.observe(t.container));var h=function(O,Z){for(;O!=null;)Z(O),O=O.parentNode},I=function(){t.invalidateContainerClientCoordsCache()};h(t.container,function(he){t.registerBinding(he,"transitionend",I),t.registerBinding(he,"animationend",I),t.registerBinding(he,"scroll",I)}),t.registerBinding(t.container,"contextmenu",function(he){he.preventDefault()});var D=function(){return t.selection[4]!==0},M=function(O){for(var Z=t.findContainerClientCoords(),le=Z[0],J=Z[1],ne=Z[2],Te=Z[3],fe=O.touches?O.touches:[O],Ee=!1,Oe=0;Oe<fe.length;Oe++){var Ye=fe[Oe];if(le<=Ye.clientX&&Ye.clientX<=le+ne&&J<=Ye.clientY&&Ye.clientY<=J+Te){Ee=!0;break}}if(!Ee)return!1;for(var Re=t.container,Ue=O.target,Ke=Ue.parentNode,$e=!1;Ke;){if(Ke===Re){$e=!0;break}Ke=Ke.parentNode}return!!$e};t.registerBinding(t.container,"mousedown",function(O){if(M(O)&&!(t.hoverData.which===1&&O.which!==1)){O.preventDefault(),C(),t.hoverData.capture=!0,t.hoverData.which=O.which;var Z=t.cy,le=[O.clientX,O.clientY],J=t.projectIntoViewport(le[0],le[1]),ne=t.selection,Te=t.findNearestElements(J[0],J[1],!0,!1),fe=Te[0],Ee=t.dragData.possibleDragElements;t.hoverData.mdownPos=J,t.hoverData.mdownGPos=le;var Oe=function(){t.hoverData.tapholdCancelled=!1,clearTimeout(t.hoverData.tapholdTimeout),t.hoverData.tapholdTimeout=setTimeout(function(){if(!t.hoverData.tapholdCancelled){var lt=t.hoverData.down;lt?lt.emit({originalEvent:O,type:"taphold",position:{x:J[0],y:J[1]}}):Z.emit({originalEvent:O,type:"taphold",position:{x:J[0],y:J[1]}})}},t.tapholdDuration)};if(O.which==3){t.hoverData.cxtStarted=!0;var Ye={originalEvent:O,type:"cxttapstart",position:{x:J[0],y:J[1]}};fe?(fe.activate(),fe.emit(Ye),t.hoverData.down=fe):Z.emit(Ye),t.hoverData.downTime=new Date().getTime(),t.hoverData.cxtDragged=!1}else if(O.which==1){fe&&fe.activate();{if(fe!=null&&t.nodeIsGrabbable(fe)){var Re=function(lt){return{originalEvent:O,type:lt,position:{x:J[0],y:J[1]}}},Ue=function(lt){lt.emit(Re("grab"))};if(d(fe),!fe.selected())Ee=t.dragData.possibleDragElements=Z.collection(),x(fe,{addToList:Ee}),fe.emit(Re("grabon")).emit(Re("grab"));else{Ee=t.dragData.possibleDragElements=Z.collection();var Ke=Z.$(function($e){return $e.isNode()&&$e.selected()&&t.nodeIsGrabbable($e)});b(Ke,{addToList:Ee}),fe.emit(Re("grabon")),Ke.forEach(Ue)}t.redrawHint("eles",!0),t.redrawHint("drag",!0)}t.hoverData.down=fe,t.hoverData.downs=Te,t.hoverData.downTime=new Date().getTime()}a(fe,["mousedown","tapstart","vmousedown"],O,{x:J[0],y:J[1]}),fe==null?(ne[4]=1,t.data.bgActivePosistion={x:J[0],y:J[1]},t.redrawHint("select",!0),t.redraw()):fe.pannable()&&(ne[4]=1),Oe()}ne[0]=ne[2]=J[0],ne[1]=ne[3]=J[1]}},!1);var L=n(t.container);t.registerBinding([e,L],"mousemove",function(O){var Z=t.hoverData.capture;if(!(!Z&&!M(O))){var le=!1,J=t.cy,ne=J.zoom(),Te=[O.clientX,O.clientY],fe=t.projectIntoViewport(Te[0],Te[1]),Ee=t.hoverData.mdownPos,Oe=t.hoverData.mdownGPos,Ye=t.selection,Re=null;!t.hoverData.draggingEles&&!t.hoverData.dragging&&!t.hoverData.selecting&&(Re=t.findNearestElement(fe[0],fe[1],!0,!1));var Ue=t.hoverData.last,Ke=t.hoverData.down,$e=[fe[0]-Ye[2],fe[1]-Ye[3]],lt=t.dragData.possibleDragElements,mt;if(Oe){var rr=Te[0]-Oe[0],nr=rr*rr,vt=Te[1]-Oe[1],ft=vt*vt,kt=nr+ft;t.hoverData.isOverThresholdDrag=mt=kt>=t.desktopTapThreshold2}var Kt=i(O);mt&&(t.hoverData.tapholdCancelled=!0);var $t=function(){var Pr=t.hoverData.dragDelta=t.hoverData.dragDelta||[];Pr.length===0?(Pr.push($e[0]),Pr.push($e[1])):(Pr[0]+=$e[0],Pr[1]+=$e[1])};le=!0,a(Re,["mousemove","vmousemove","tapdrag"],O,{x:fe[0],y:fe[1]});var Er=function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||J.emit({originalEvent:O,type:"boxstart",position:{x:fe[0],y:fe[1]}}),Ye[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()};if(t.hoverData.which===3){if(mt){var Ot={originalEvent:O,type:"cxtdrag",position:{x:fe[0],y:fe[1]}};Ke?Ke.emit(Ot):J.emit(Ot),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||Re!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:O,type:"cxtdragout",position:{x:fe[0],y:fe[1]}}),t.hoverData.cxtOver=Re,Re&&Re.emit({originalEvent:O,type:"cxtdragover",position:{x:fe[0],y:fe[1]}}))}}else if(t.hoverData.dragging){if(le=!0,J.panningEnabled()&&J.userPanningEnabled()){var Xt;if(t.hoverData.justStartedPan){var Cr=t.hoverData.mdownPos;Xt={x:(fe[0]-Cr[0])*ne,y:(fe[1]-Cr[1])*ne},t.hoverData.justStartedPan=!1}else Xt={x:$e[0]*ne,y:$e[1]*ne};J.panBy(Xt),J.emit("dragpan"),t.hoverData.dragged=!0}fe=t.projectIntoViewport(O.clientX,O.clientY)}else if(Ye[4]==1&&(Ke==null||Ke.pannable())){if(mt){if(!t.hoverData.dragging&&J.boxSelectionEnabled()&&(Kt||!J.panningEnabled()||!J.userPanningEnabled()))Er();else if(!t.hoverData.selecting&&J.panningEnabled()&&J.userPanningEnabled()){var gr=s(Ke,t.hoverData.downs);gr&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,Ye[4]=0,t.data.bgActivePosistion=ua(Ee),t.redrawHint("select",!0),t.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&Re!=Ue&&(Ue&&a(Ue,["mouseout","tapdragout"],O,{x:fe[0],y:fe[1]}),Re&&a(Re,["mouseover","tapdragover"],O,{x:fe[0],y:fe[1]}),t.hoverData.last=Re),Ke)if(mt){if(J.boxSelectionEnabled()&&Kt)Ke&&Ke.grabbed()&&(w(lt),Ke.emit("freeon"),lt.emit("free"),t.dragData.didDrag&&(Ke.emit("dragfreeon"),lt.emit("dragfree"))),Er();else if(Ke&&Ke.grabbed()&&t.nodeIsDraggable(Ke)){var qt=!t.dragData.didDrag;qt&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||b(lt,{inDragLayer:!0});var Bt={x:0,y:0};if(Se($e[0])&&Se($e[1])&&(Bt.x+=$e[0],Bt.y+=$e[1],qt)){var ar=t.hoverData.dragDelta;ar&&Se(ar[0])&&Se(ar[1])&&(Bt.x+=ar[0],Bt.y+=ar[1])}t.hoverData.draggingEles=!0,lt.silentShift(Bt).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else $t();le=!0}if(Ye[2]=fe[0],Ye[3]=fe[1],le)return O.stopPropagation&&O.stopPropagation(),O.preventDefault&&O.preventDefault(),!1}},!1);var B,N,_;t.registerBinding(e,"mouseup",function(O){if(!(t.hoverData.which===1&&O.which!==1&&t.hoverData.capture)){var Z=t.hoverData.capture;if(Z){t.hoverData.capture=!1;var le=t.cy,J=t.projectIntoViewport(O.clientX,O.clientY),ne=t.selection,Te=t.findNearestElement(J[0],J[1],!0,!1),fe=t.dragData.possibleDragElements,Ee=t.hoverData.down,Oe=i(O);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,Ee&&Ee.unactivate(),t.hoverData.which===3){var Ye={originalEvent:O,type:"cxttapend",position:{x:J[0],y:J[1]}};if(Ee?Ee.emit(Ye):le.emit(Ye),!t.hoverData.cxtDragged){var Re={originalEvent:O,type:"cxttap",position:{x:J[0],y:J[1]}};Ee?Ee.emit(Re):le.emit(Re)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(Te,["mouseup","tapend","vmouseup"],O,{x:J[0],y:J[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(Ee,["click","tap","vclick"],O,{x:J[0],y:J[1]}),N=!1,O.timeStamp-_<=le.multiClickDebounceTime()?(B&&clearTimeout(B),N=!0,_=null,a(Ee,["dblclick","dbltap","vdblclick"],O,{x:J[0],y:J[1]})):(B=setTimeout(function(){N||a(Ee,["oneclick","onetap","voneclick"],O,{x:J[0],y:J[1]})},le.multiClickDebounceTime()),_=O.timeStamp)),Ee==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!i(O)&&(le.$(r).unselect(["tapunselect"]),fe.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=fe=le.collection()),Te==Ee&&!t.dragData.didDrag&&!t.hoverData.selecting&&Te!=null&&Te._private.selectable&&(t.hoverData.dragging||(le.selectionType()==="additive"||Oe?Te.selected()?Te.unselect(["tapunselect"]):Te.select(["tapselect"]):Oe||(le.$(r).unmerge(Te).unselect(["tapunselect"]),Te.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var Ue=le.collection(t.getAllInBox(ne[0],ne[1],ne[2],ne[3]));t.redrawHint("select",!0),Ue.length>0&&t.redrawHint("eles",!0),le.emit({type:"boxend",originalEvent:O,position:{x:J[0],y:J[1]}});var Ke=function(mt){return mt.selectable()&&!mt.selected()};le.selectionType()==="additive"||Oe||le.$(r).unmerge(Ue).unselect(),Ue.emit("box").stdFilter(Ke).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!ne[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var $e=Ee&&Ee.grabbed();w(fe),$e&&(Ee.emit("freeon"),fe.emit("free"),t.dragData.didDrag&&(Ee.emit("dragfreeon"),fe.emit("dragfree")))}}ne[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null,t.hoverData.which=null}}},!1);var U=function(O){if(!t.scrollingPage){var Z=t.cy,le=Z.zoom(),J=Z.pan(),ne=t.projectIntoViewport(O.clientX,O.clientY),Te=[ne[0]*le+J.x,ne[1]*le+J.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||D()){O.preventDefault();return}if(Z.panningEnabled()&&Z.userPanningEnabled()&&Z.zoomingEnabled()&&Z.userZoomingEnabled()){O.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var fe;O.deltaY!=null?fe=O.deltaY/-250:O.wheelDeltaY!=null?fe=O.wheelDeltaY/1e3:fe=O.wheelDelta/1e3,fe=fe*t.wheelSensitivity;var Ee=O.deltaMode===1;Ee&&(fe*=33);var Oe=Z.zoom()*Math.pow(10,fe);O.type==="gesturechange"&&(Oe=t.gestureStartZoom*O.scale),Z.zoom({level:Oe,renderedPosition:{x:Te[0],y:Te[1]}}),Z.emit(O.type==="gesturechange"?"pinchzoom":"scrollzoom")}}};t.registerBinding(t.container,"wheel",U,!0),t.registerBinding(e,"scroll",function(O){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},!0),t.registerBinding(t.container,"gesturestart",function(O){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||O.preventDefault()},!0),t.registerBinding(t.container,"gesturechange",function(he){t.hasTouchStarted||U(he)},!0),t.registerBinding(t.container,"mouseout",function(O){var Z=t.projectIntoViewport(O.clientX,O.clientY);t.cy.emit({originalEvent:O,type:"mouseout",position:{x:Z[0],y:Z[1]}})},!1),t.registerBinding(t.container,"mouseover",function(O){var Z=t.projectIntoViewport(O.clientX,O.clientY);t.cy.emit({originalEvent:O,type:"mouseover",position:{x:Z[0],y:Z[1]}})},!1);var H,W,X,Q,se,j,ee,de,ge,me,pe,we,be,ae=function(O,Z,le,J){return Math.sqrt((le-O)*(le-O)+(J-Z)*(J-Z))},Y=function(O,Z,le,J){return(le-O)*(le-O)+(J-Z)*(J-Z)},oe;t.registerBinding(t.container,"touchstart",oe=function(O){if(t.hasTouchStarted=!0,!!M(O)){C(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var Z=t.cy,le=t.touchData.now,J=t.touchData.earlier;if(O.touches[0]){var ne=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);le[0]=ne[0],le[1]=ne[1]}if(O.touches[1]){var ne=t.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);le[2]=ne[0],le[3]=ne[1]}if(O.touches[2]){var ne=t.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);le[4]=ne[0],le[5]=ne[1]}if(O.touches[1]){t.touchData.singleTouchMoved=!0,w(t.dragData.touchDragEles);var Te=t.findContainerClientCoords();ge=Te[0],me=Te[1],pe=Te[2],we=Te[3],H=O.touches[0].clientX-ge,W=O.touches[0].clientY-me,X=O.touches[1].clientX-ge,Q=O.touches[1].clientY-me,be=0<=H&&H<=pe&&0<=X&&X<=pe&&0<=W&&W<=we&&0<=Q&&Q<=we;var fe=Z.pan(),Ee=Z.zoom();se=ae(H,W,X,Q),j=Y(H,W,X,Q),ee=[(H+X)/2,(W+Q)/2],de=[(ee[0]-fe.x)/Ee,(ee[1]-fe.y)/Ee];var Oe=200,Ye=Oe*Oe;if(j<Ye&&!O.touches[2]){var Re=t.findNearestElement(le[0],le[1],!0,!0),Ue=t.findNearestElement(le[2],le[3],!0,!0);Re&&Re.isNode()?(Re.activate().emit({originalEvent:O,type:"cxttapstart",position:{x:le[0],y:le[1]}}),t.touchData.start=Re):Ue&&Ue.isNode()?(Ue.activate().emit({originalEvent:O,type:"cxttapstart",position:{x:le[0],y:le[1]}}),t.touchData.start=Ue):Z.emit({originalEvent:O,type:"cxttapstart",position:{x:le[0],y:le[1]}}),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!0,t.touchData.cxtDragged=!1,t.data.bgActivePosistion=void 0,t.redraw();return}}if(O.touches[2])Z.boxSelectionEnabled()&&O.preventDefault();else if(!O.touches[1]){if(O.touches[0]){var Ke=t.findNearestElements(le[0],le[1],!0,!0),$e=Ke[0];if($e!=null&&($e.activate(),t.touchData.start=$e,t.touchData.starts=Ke,t.nodeIsGrabbable($e))){var lt=t.dragData.touchDragEles=Z.collection(),mt=null;t.redrawHint("eles",!0),t.redrawHint("drag",!0),$e.selected()?(mt=Z.$(function(kt){return kt.selected()&&t.nodeIsGrabbable(kt)}),b(mt,{addToList:lt})):x($e,{addToList:lt}),d($e);var rr=function(Kt){return{originalEvent:O,type:Kt,position:{x:le[0],y:le[1]}}};$e.emit(rr("grabon")),mt?mt.forEach(function(kt){kt.emit(rr("grab"))}):$e.emit(rr("grab"))}a($e,["touchstart","tapstart","vmousedown"],O,{x:le[0],y:le[1]}),$e==null&&(t.data.bgActivePosistion={x:ne[0],y:ne[1]},t.redrawHint("select",!0),t.redraw()),t.touchData.singleTouchMoved=!1,t.touchData.singleTouchStartTime=+new Date,clearTimeout(t.touchData.tapholdTimeout),t.touchData.tapholdTimeout=setTimeout(function(){t.touchData.singleTouchMoved===!1&&!t.pinching&&!t.touchData.selecting&&a(t.touchData.start,["taphold"],O,{x:le[0],y:le[1]})},t.tapholdDuration)}}if(O.touches.length>=1){for(var nr=t.touchData.startPosition=[null,null,null,null,null,null],vt=0;vt<le.length;vt++)nr[vt]=J[vt]=le[vt];var ft=O.touches[0];t.touchData.startGPosition=[ft.clientX,ft.clientY]}}},!1);var ye;t.registerBinding(e,"touchmove",ye=function(O){var Z=t.touchData.capture;if(!(!Z&&!M(O))){var le=t.selection,J=t.cy,ne=t.touchData.now,Te=t.touchData.earlier,fe=J.zoom();if(O.touches[0]){var Ee=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);ne[0]=Ee[0],ne[1]=Ee[1]}if(O.touches[1]){var Ee=t.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);ne[2]=Ee[0],ne[3]=Ee[1]}if(O.touches[2]){var Ee=t.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);ne[4]=Ee[0],ne[5]=Ee[1]}var Oe=t.touchData.startGPosition,Ye;if(Z&&O.touches[0]&&Oe){for(var Re=[],Ue=0;Ue<ne.length;Ue++)Re[Ue]=ne[Ue]-Te[Ue];var Ke=O.touches[0].clientX-Oe[0],$e=Ke*Ke,lt=O.touches[0].clientY-Oe[1],mt=lt*lt,rr=$e+mt;Ye=rr>=t.touchTapThreshold2}if(Z&&t.touchData.cxt){O.preventDefault();var nr=O.touches[0].clientX-ge,vt=O.touches[0].clientY-me,ft=O.touches[1].clientX-ge,kt=O.touches[1].clientY-me,Kt=Y(nr,vt,ft,kt),$t=Kt/j,Er=150,Ot=Er*Er,Xt=1.5,Cr=Xt*Xt;if($t>=Cr||Kt>=Ot){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var gr={originalEvent:O,type:"cxttapend",position:{x:ne[0],y:ne[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(gr),t.touchData.start=null):J.emit(gr)}}if(Z&&t.touchData.cxt){var gr={originalEvent:O,type:"cxtdrag",position:{x:ne[0],y:ne[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(gr):J.emit(gr),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var qt=t.findNearestElement(ne[0],ne[1],!0,!0);(!t.touchData.cxtOver||qt!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:O,type:"cxtdragout",position:{x:ne[0],y:ne[1]}}),t.touchData.cxtOver=qt,qt&&qt.emit({originalEvent:O,type:"cxtdragover",position:{x:ne[0],y:ne[1]}}))}else if(Z&&O.touches[2]&&J.boxSelectionEnabled())O.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||J.emit({originalEvent:O,type:"boxstart",position:{x:ne[0],y:ne[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,le[4]=1,!le||le.length===0||le[0]===void 0?(le[0]=(ne[0]+ne[2]+ne[4])/3,le[1]=(ne[1]+ne[3]+ne[5])/3,le[2]=(ne[0]+ne[2]+ne[4])/3+1,le[3]=(ne[1]+ne[3]+ne[5])/3+1):(le[2]=(ne[0]+ne[2]+ne[4])/3,le[3]=(ne[1]+ne[3]+ne[5])/3),t.redrawHint("select",!0),t.redraw();else if(Z&&O.touches[1]&&!t.touchData.didSelect&&J.zoomingEnabled()&&J.panningEnabled()&&J.userZoomingEnabled()&&J.userPanningEnabled()){O.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Bt=t.dragData.touchDragEles;if(Bt){t.redrawHint("drag",!0);for(var ar=0;ar<Bt.length;ar++){var jn=Bt[ar]._private;jn.grabbed=!1,jn.rscratch.inDragLayer=!1}}var Pr=t.touchData.start,nr=O.touches[0].clientX-ge,vt=O.touches[0].clientY-me,ft=O.touches[1].clientX-ge,kt=O.touches[1].clientY-me,js=ae(nr,vt,ft,kt),eo=js/se;if(be){var qu=nr-H,kn=vt-W,to=ft-X,Ri=kt-Q,Li=(qu+to)/2,Oa=(kn+Ri)/2,Pn=J.zoom(),Oi=Pn*eo,Ur=J.pan(),Ni=de[0]*Pn+Ur.x,_i=de[1]*Pn+Ur.y,ro={x:-Oi/Pn*(Ni-Ur.x-Li)+Ni,y:-Oi/Pn*(_i-Ur.y-Oa)+_i};if(Pr&&Pr.active()){var Bt=t.dragData.touchDragEles;w(Bt),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Pr.unactivate().emit("freeon"),Bt.emit("free"),t.dragData.didDrag&&(Pr.emit("dragfreeon"),Bt.emit("dragfree"))}J.viewport({zoom:Oi,pan:ro,cancelOnFailedZoom:!0}),J.emit("pinchzoom"),se=js,H=nr,W=vt,X=ft,Q=kt,t.pinching=!0}if(O.touches[0]){var Ee=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);ne[0]=Ee[0],ne[1]=Ee[1]}if(O.touches[1]){var Ee=t.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);ne[2]=Ee[0],ne[3]=Ee[1]}if(O.touches[2]){var Ee=t.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);ne[4]=Ee[0],ne[5]=Ee[1]}}else if(O.touches[0]&&!t.touchData.didSelect){var pr=t.touchData.start,zi=t.touchData.last,qt;if(!t.hoverData.draggingEles&&!t.swipePanning&&(qt=t.findNearestElement(ne[0],ne[1],!0,!0)),Z&&pr!=null&&O.preventDefault(),Z&&pr!=null&&t.nodeIsDraggable(pr))if(Ye){var Bt=t.dragData.touchDragEles,Na=!t.dragData.didDrag;Na&&b(Bt,{inDragLayer:!0}),t.dragData.didDrag=!0;var ea={x:0,y:0};if(Se(Re[0])&&Se(Re[1])&&(ea.x+=Re[0],ea.y+=Re[1],Na)){t.redrawHint("eles",!0);var Tr=t.touchData.dragDelta;Tr&&Se(Tr[0])&&Se(Tr[1])&&(ea.x+=Tr[0],ea.y+=Tr[1])}t.hoverData.draggingEles=!0,Bt.silentShift(ea).emit("position drag"),t.redrawHint("drag",!0),t.touchData.startPosition[0]==Te[0]&&t.touchData.startPosition[1]==Te[1]&&t.redrawHint("eles",!0),t.redraw()}else{var Tr=t.touchData.dragDelta=t.touchData.dragDelta||[];Tr.length===0?(Tr.push(Re[0]),Tr.push(Re[1])):(Tr[0]+=Re[0],Tr[1]+=Re[1])}if(a(pr||qt,["touchmove","tapdrag","vmousemove"],O,{x:ne[0],y:ne[1]}),(!pr||!pr.grabbed())&&qt!=zi&&(zi&&zi.emit({originalEvent:O,type:"tapdragout",position:{x:ne[0],y:ne[1]}}),qt&&qt.emit({originalEvent:O,type:"tapdragover",position:{x:ne[0],y:ne[1]}})),t.touchData.last=qt,Z)for(var ar=0;ar<ne.length;ar++)ne[ar]&&t.touchData.startPosition[ar]&&Ye&&(t.touchData.singleTouchMoved=!0);if(Z&&(pr==null||pr.pannable())&&J.panningEnabled()&&J.userPanningEnabled()){var no=s(pr,t.touchData.starts);no&&(O.preventDefault(),t.data.bgActivePosistion||(t.data.bgActivePosistion=ua(t.touchData.startPosition)),t.swipePanning?(J.panBy({x:Re[0]*fe,y:Re[1]*fe}),J.emit("dragpan")):Ye&&(t.swipePanning=!0,J.panBy({x:Ke*fe,y:lt*fe}),J.emit("dragpan"),pr&&(pr.unactivate(),t.redrawHint("select",!0),t.touchData.start=null)));var Ee=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);ne[0]=Ee[0],ne[1]=Ee[1]}}for(var Ue=0;Ue<ne.length;Ue++)Te[Ue]=ne[Ue];Z&&O.touches.length>0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},!1);var De;t.registerBinding(e,"touchcancel",De=function(O){var Z=t.touchData.start;t.touchData.capture=!1,Z&&Z.unactivate()});var Be,Je,ut,at;if(t.registerBinding(e,"touchend",Be=function(O){var Z=t.touchData.start,le=t.touchData.capture;if(le)O.touches.length===0&&(t.touchData.capture=!1),O.preventDefault();else return;var J=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var ne=t.cy,Te=ne.zoom(),fe=t.touchData.now,Ee=t.touchData.earlier;if(O.touches[0]){var Oe=t.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);fe[0]=Oe[0],fe[1]=Oe[1]}if(O.touches[1]){var Oe=t.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);fe[2]=Oe[0],fe[3]=Oe[1]}if(O.touches[2]){var Oe=t.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);fe[4]=Oe[0],fe[5]=Oe[1]}Z&&Z.unactivate();var Ye;if(t.touchData.cxt){if(Ye={originalEvent:O,type:"cxttapend",position:{x:fe[0],y:fe[1]}},Z?Z.emit(Ye):ne.emit(Ye),!t.touchData.cxtDragged){var Re={originalEvent:O,type:"cxttap",position:{x:fe[0],y:fe[1]}};Z?Z.emit(Re):ne.emit(Re)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!O.touches[2]&&ne.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var Ue=ne.collection(t.getAllInBox(J[0],J[1],J[2],J[3]));J[0]=void 0,J[1]=void 0,J[2]=void 0,J[3]=void 0,J[4]=0,t.redrawHint("select",!0),ne.emit({type:"boxend",originalEvent:O,position:{x:fe[0],y:fe[1]}});var Ke=function(Ot){return Ot.selectable()&&!Ot.selected()};Ue.emit("box").stdFilter(Ke).select().emit("boxselect"),Ue.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(Z!=null&&Z.unactivate(),O.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!O.touches[1]){if(!O.touches[0]){if(!O.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var $e=t.dragData.touchDragEles;if(Z!=null){var lt=Z._private.grabbed;w($e),t.redrawHint("drag",!0),t.redrawHint("eles",!0),lt&&(Z.emit("freeon"),$e.emit("free"),t.dragData.didDrag&&(Z.emit("dragfreeon"),$e.emit("dragfree"))),a(Z,["touchend","tapend","vmouseup","tapdragout"],O,{x:fe[0],y:fe[1]}),Z.unactivate(),t.touchData.start=null}else{var mt=t.findNearestElement(fe[0],fe[1],!0,!0);a(mt,["touchend","tapend","vmouseup","tapdragout"],O,{x:fe[0],y:fe[1]})}var rr=t.touchData.startPosition[0]-fe[0],nr=rr*rr,vt=t.touchData.startPosition[1]-fe[1],ft=vt*vt,kt=nr+ft,Kt=kt*Te*Te;t.touchData.singleTouchMoved||(Z||ne.$(":selected").unselect(["tapunselect"]),a(Z,["tap","vclick"],O,{x:fe[0],y:fe[1]}),Je=!1,O.timeStamp-at<=ne.multiClickDebounceTime()?(ut&&clearTimeout(ut),Je=!0,at=null,a(Z,["dbltap","vdblclick"],O,{x:fe[0],y:fe[1]})):(ut=setTimeout(function(){Je||a(Z,["onetap","voneclick"],O,{x:fe[0],y:fe[1]})},ne.multiClickDebounceTime()),at=O.timeStamp)),Z!=null&&!t.dragData.didDrag&&Z._private.selectable&&Kt<t.touchTapThreshold2&&!t.pinching&&(ne.selectionType()==="single"?(ne.$(r).unmerge(Z).unselect(["tapunselect"]),Z.select(["tapselect"])):Z.selected()?Z.unselect(["tapunselect"]):Z.select(["tapselect"]),t.redrawHint("eles",!0)),t.touchData.singleTouchMoved=!0}}}for(var $t=0;$t<fe.length;$t++)Ee[$t]=fe[$t];t.dragData.didDrag=!1,O.touches.length===0&&(t.touchData.dragDelta=[],t.touchData.startPosition=[null,null,null,null,null,null],t.touchData.startGPosition=null,t.touchData.didSelect=!1),O.touches.length<2&&(O.touches.length===1&&(t.touchData.startGPosition=[O.touches[0].clientX,O.touches[0].clientY]),t.pinching=!1,t.redrawHint("eles",!0),t.redraw())},!1),typeof TouchEvent>"u"){var ke=[],Ie=function(O){return{clientX:O.clientX,clientY:O.clientY,force:1,identifier:O.pointerId,pageX:O.pageX,pageY:O.pageY,radiusX:O.width/2,radiusY:O.height/2,screenX:O.screenX,screenY:O.screenY,target:O.target}},He=function(O){return{event:O,touch:Ie(O)}},We=function(O){ke.push(He(O))},Le=function(O){for(var Z=0;Z<ke.length;Z++){var le=ke[Z];if(le.event.pointerId===O.pointerId){ke.splice(Z,1);return}}},ze=function(O){var Z=ke.filter(function(le){return le.event.pointerId===O.pointerId})[0];Z.event=O,Z.touch=Ie(O)},Ge=function(O){O.touches=ke.map(function(Z){return Z.touch})},Fe=function(O){return O.pointerType==="mouse"||O.pointerType===4};t.registerBinding(t.container,"pointerdown",function(he){Fe(he)||(he.preventDefault(),We(he),Ge(he),oe(he))}),t.registerBinding(t.container,"pointerup",function(he){Fe(he)||(Le(he),Ge(he),Be(he))}),t.registerBinding(t.container,"pointercancel",function(he){Fe(he)||(Le(he),Ge(he),De(he))}),t.registerBinding(t.container,"pointermove",function(he){Fe(he)||(he.preventDefault(),ze(he),Ge(he),ye(he))})}};var tn={};tn.generatePolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,draw:function(n,a,i,s,o,u){this.renderer.nodeShapeImpl("polygon",n,a,i,s,o,this.points)},intersectLine:function(n,a,i,s,o,u,l,f){return ri(o,u,this.points,n,a,i/2,s/2,l)},checkPoint:function(n,a,i,s,o,u,l,f){return Jr(n,a,this.points,u,l,s,o,[0,-1],i)}}},tn.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,o,u){return wp(i,s,e,r,n/2+o,a/2+o)},checkPoint:function(e,r,n,a,i,s,o,u){return On(e,r,a,i,s,o,n)}}},tn.generateRoundPolygon=function(t,e){return this.nodeShapes[t]={renderer:this,name:t,points:e,getOrCreateCorners:function(n,a,i,s,o,u,l){if(u[l]!==void 0&&u[l+"-cx"]===n&&u[l+"-cy"]===a)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=n,u[l+"-cy"]=a;var f=i/2,d=s/2;o=o==="auto"?Ul(i,s):o;for(var g=new Array(e.length/2),m=0;m<e.length/2;m++)g[m]={x:n+f*e[m*2],y:a+d*e[m*2+1]};var p,b,x,w,E=g.length;for(b=g[E-1],p=0;p<E;p++)x=g[p%E],w=g[(p+1)%E],u[l][p]=tu(b,x,w,o),b=x,x=w;return u[l]},draw:function(n,a,i,s,o,u,l){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,o,this.points,this.getOrCreateCorners(a,i,s,o,u,l,"drawCorners"))},intersectLine:function(n,a,i,s,o,u,l,f,d){return bp(o,u,this.points,n,a,i,s,l,this.getOrCreateCorners(n,a,i,s,f,d,"corners"))},checkPoint:function(n,a,i,s,o,u,l,f,d){return yp(n,a,this.points,u,l,s,o,this.getOrCreateCorners(u,l,s,o,f,d,"corners"))}}},tn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:sr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,o,u){return Hl(i,s,e,r,n,a,o,u)},checkPoint:function(e,r,n,a,i,s,o,u){var l=a/2,f=i/2;u=u==="auto"?Nn(a,i):u,u=Math.min(l,f,u);var d=u*2;return!!(Jr(e,r,this.points,s,o,a,i-d,[0,-1],n)||Jr(e,r,this.points,s,o,a-d,i,[0,-1],n)||On(e,r,d,d,s-l+u,o-f+u,n)||On(e,r,d,d,s+l-u,o-f+u,n)||On(e,r,d,d,s+l-u,o+f-u,n)||On(e,r,d,d,s-l+u,o+f-u,n))}}},tn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:So(),points:sr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,null,s)},generateCutTrianglePts:function(e,r,n,a,i){var s=i==="auto"?this.cornerLength:i,o=r/2,u=e/2,l=n-u,f=n+u,d=a-o,g=a+o;return{topLeft:[l,d+s,l+s,d,l+s,d+s],topRight:[f-s,d,f,d+s,f-s,d+s],bottomRight:[f,g-s,f-s,g,f-s,g-s],bottomLeft:[l+s,g,l,g-s,l+s,g-s]}},intersectLine:function(e,r,n,a,i,s,o,u){var l=this.generateCutTrianglePts(n+2*o,a+2*o,e,r,u),f=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return ri(i,s,f,e,r)},checkPoint:function(e,r,n,a,i,s,o,u){var l=u==="auto"?this.cornerLength:u;if(Jr(e,r,this.points,s,o,a,i-2*l,[0,-1],n)||Jr(e,r,this.points,s,o,a-2*l,i,[0,-1],n))return!0;var f=this.generateCutTrianglePts(a,i,s,o);return cr(e,r,f.topLeft)||cr(e,r,f.topRight)||cr(e,r,f.bottomRight)||cr(e,r,f.bottomLeft)}}},tn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:sr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i)},intersectLine:function(e,r,n,a,i,s,o,u){var l=.15,f=.5,d=.85,g=this.generateBarrelBezierPts(n+2*o,a+2*o,e,r),m=function(x){var w=la({x:x[0],y:x[1]},{x:x[2],y:x[3]},{x:x[4],y:x[5]},l),E=la({x:x[0],y:x[1]},{x:x[2],y:x[3]},{x:x[4],y:x[5]},f),C=la({x:x[0],y:x[1]},{x:x[2],y:x[3]},{x:x[4],y:x[5]},d);return[x[0],x[1],w.x,w.y,E.x,E.y,C.x,C.y,x[4],x[5]]},p=[].concat(m(g.topLeft),m(g.topRight),m(g.bottomRight),m(g.bottomLeft));return ri(i,s,p,e,r)},generateBarrelBezierPts:function(e,r,n,a){var i=r/2,s=e/2,o=n-s,u=n+s,l=a-i,f=a+i,d=Do(e,r),g=d.heightOffset,m=d.widthOffset,p=d.ctrlPtOffsetPct*e,b={topLeft:[o,l+g,o+p,l,o+m,l],topRight:[u-m,l,u-p,l,u,l+g],bottomRight:[u,f-g,u-p,f,u-m,f],bottomLeft:[o+m,f,o+p,f,o,f-g]};return b.topLeft.isTop=!0,b.topRight.isTop=!0,b.bottomLeft.isBottom=!0,b.bottomRight.isBottom=!0,b},checkPoint:function(e,r,n,a,i,s,o,u){var l=Do(a,i),f=l.heightOffset,d=l.widthOffset;if(Jr(e,r,this.points,s,o,a,i-2*f,[0,-1],n)||Jr(e,r,this.points,s,o,a-2*d,i,[0,-1],n))return!0;for(var g=this.generateBarrelBezierPts(a,i,s,o),m=function(I,D,M){var L=M[4],B=M[2],N=M[0],_=M[5],U=M[1],H=Math.min(L,N),W=Math.max(L,N),X=Math.min(_,U),Q=Math.max(_,U);if(H<=I&&I<=W&&X<=D&&D<=Q){var se=xp(L,B,N),j=hp(se[0],se[1],se[2],I),ee=j.filter(function(de){return 0<=de&&de<=1});if(ee.length>0)return ee[0]}return null},p=Object.keys(g),b=0;b<p.length;b++){var x=p[b],w=g[x],E=m(e,r,w);if(E!=null){var C=w[5],k=w[3],R=w[1],A=zt(C,k,R,E);if(w.isTop&&A<=r||w.isBottom&&r<=A)return!0}}return!1}}},tn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:sr(4,0),draw:function(e,r,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,r,n,a,i,this.points,s)},intersectLine:function(e,r,n,a,i,s,o,u){var l=e-(n/2+o),f=r-(a/2+o),d=f,g=e+(n/2+o),m=pn(i,s,e,r,l,f,g,d,!1);return m.length>0?m:Hl(i,s,e,r,n,a,o,u)},checkPoint:function(e,r,n,a,i,s,o,u){u=u==="auto"?Nn(a,i):u;var l=2*u;if(Jr(e,r,this.points,s,o,a,i-l,[0,-1],n)||Jr(e,r,this.points,s,o,a-l,i,[0,-1],n))return!0;var f=a/2+2*n,d=i/2+2*n,g=[s-f,o-d,s-f,o,s+f,o,s+f,o-d];return!!(cr(e,r,g)||On(e,r,l,l,s+a/2-u,o+i/2-u,n)||On(e,r,l,l,s-a/2+u,o+i/2-u,n))}}},tn.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",sr(3,0)),this.generateRoundPolygon("round-triangle",sr(3,0)),this.generatePolygon("rectangle",sr(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",sr(5,0)),this.generateRoundPolygon("round-pentagon",sr(5,0)),this.generatePolygon("hexagon",sr(6,0)),this.generateRoundPolygon("round-hexagon",sr(6,0)),this.generatePolygon("heptagon",sr(7,0)),this.generateRoundPolygon("round-heptagon",sr(7,0)),this.generatePolygon("octagon",sr(8,0)),this.generateRoundPolygon("round-octagon",sr(8,0));var n=new Array(20);{var a=To(5,0),i=To(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[o*2]*=s,i[o*2+1]*=s;for(var o=0;o<20/4;o++)n[o*4]=a[o*2],n[o*4+1]=a[o*2+1],n[o*4+2]=i[o*2],n[o*4+3]=i[o*2+1]}n=Wl(n),this.generatePolygon("star",n),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 u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}t.makePolygon=function(l){var f=l.join("$"),d="polygon-"+f,g;return(g=this[d])?g:e.generatePolygon(d,l)}};var mi={};mi.timeToRender=function(){return this.redrawTotalTime/this.redrawCount},mi.redraw=function(t){t=t||Ol();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=t},mi.beforeRender=function(t,e){if(!this.destroyed){e==null&&St("Priority is not optional for beforeRender");var r=this.beforeRenderCallbacks;r.push({fn:t,priority:e}),r.sort(function(n,a){return a.priority-n.priority})}};var _c=function(e,r,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(r,n)};mi.startRenderLoop=function(){var t=this,e=t.cy;if(!t.renderLoopStarted){t.renderLoopStarted=!0;var r=function n(a){if(!t.destroyed){if(!e.batching())if(t.requestedFrame&&!t.skipFrame){_c(t,!0,a);var i=Qr();t.render(t.renderOptions);var s=t.lastDrawTime=Qr();t.averageRedrawTime===void 0&&(t.averageRedrawTime=s-i),t.redrawCount===void 0&&(t.redrawCount=0),t.redrawCount++,t.redrawTotalTime===void 0&&(t.redrawTotalTime=0);var o=s-i;t.redrawTotalTime+=o,t.lastRedrawTime=o,t.averageRedrawTime=t.averageRedrawTime/2+o/2,t.requestedFrame=!1}else _c(t,!1,a);t.skipFrame=!1,Yi(n)}};Yi(r)}};var rb=function(e){this.init(e)},zc=rb,ka=zc.prototype;ka.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ka.init=function(t){var e=this;e.options=t,e.cy=t.cy;var r=e.container=t.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",u=a.getElementById(s)!=null;if(r.className.indexOf(o)<0&&(r.className=(r.className||"")+" "+o),!u){var l=a.createElement("style");l.id=s,l.textContent="."+o+" { position: relative; }",i.insertBefore(l,i.children[0])}var f=n.getComputedStyle(r),d=f.getPropertyValue("position");d==="static"&&ht("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.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]},e.redraws=0,e.showFps=t.showFps,e.debug=t.debug,e.webgl=t.webgl,e.hideEdgesOnViewport=t.hideEdgesOnViewport,e.textureOnViewport=t.textureOnViewport,e.wheelSensitivity=t.wheelSensitivity,e.motionBlurEnabled=t.motionBlur,e.forcedPixelRatio=Se(t.pixelRatio)?t.pixelRatio:null,e.motionBlur=t.motionBlur,e.motionBlurOpacity=t.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=t.desktopTapThreshold,e.desktopTapThreshold2=t.desktopTapThreshold*t.desktopTapThreshold,e.touchTapThreshold=t.touchTapThreshold,e.touchTapThreshold2=t.touchTapThreshold*t.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},ka.notify=function(t,e){var r=this,n=r.cy;if(!this.destroyed){if(t==="init"){r.load();return}if(t==="destroy"){r.destroy();return}(t==="add"||t==="remove"||t==="move"&&n.hasCompoundNodes()||t==="load"||t==="zorder"||t==="mount")&&r.invalidateCachedZSortedEles(),t==="viewport"&&r.redrawHint("select",!0),t==="gc"&&r.redrawHint("gc",!0),(t==="load"||t==="resize"||t==="mount")&&(r.invalidateContainerClientCoordsCache(),r.matchCanvasSize(r.container)),r.redrawHint("eles",!0),r.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},ka.destroy=function(){var t=this;t.destroyed=!0,t.cy.stopAnimationLoop();for(var e=0;e<t.bindings.length;e++){var r=t.bindings[e],n=r,a=n.target;(a.off||a.removeEventListener).apply(a,n.args)}if(t.bindings=[],t.beforeRenderCallbacks=[],t.onUpdateEleCalcsFns=[],t.removeObserver&&t.removeObserver.disconnect(),t.styleObserver&&t.styleObserver.disconnect(),t.resizeObserver&&t.resizeObserver.disconnect(),t.labelCalcDiv)try{document.body.removeChild(t.labelCalcDiv)}catch{}},ka.isHeadless=function(){return!1},[Zo,Oc,Nc,Da,tn,mi].forEach(function(t){Ve(ka,t)});var nu=1e3/60,Vc={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=Xa(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),s=function(l,f){var d=Qr(),g=a.averageRedrawTime,m=a.lastRedrawTime,p=[],b=a.cy.extent(),x=a.getPixelRatio();for(l||a.flushRenderedStyleQueue();;){var w=Qr(),E=w-d,C=w-f;if(m<nu){var k=nu-(l?g:0);if(C>=e.deqFastCost*k)break}else if(l){if(E>=e.deqCost*m||E>=e.deqAvgCost*g)break}else if(C>=e.deqNoDrawCost*nu)break;var R=e.deq(n,x,b);if(R.length>0)for(var A=0;A<R.length;A++)p.push(R[A]);else break}p.length>0&&(e.onDeqd(n,p),!l&&e.shouldRedraw(n,p,x,b)&&i())},o=e.priority||wo;a.beforeRender(s,o(n))}}}},nb=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Qi;ln(this,t),this.idsByKey=new zr,this.keyForId=new zr,this.cachesByLvl=new zr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return fn(t,[{key:"getIdsFor",value:function(r){r==null&&St("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(r);return a||(a=new oa,n.set(r,a)),a}},{key:"addIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).add(n)}},{key:"deleteIdForKey",value:function(r,n){r!=null&&this.getIdsFor(r).delete(n)}},{key:"getNumberOfIdsForKey",value:function(r){return r==null?0:this.getIdsFor(r).size}},{key:"updateKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(r){var n=r.id(),a=this.keyForId.get(n),i=this.getKey(r);return a!==i}},{key:"isInvalid",value:function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)}},{key:"getCachesAt",value:function(r){var n=this.cachesByLvl,a=this.lvls,i=n.get(r);return i||(i=new zr,n.set(r,i),a.push(r)),i}},{key:"getCache",value:function(r,n){return this.getCachesAt(n).get(r)}},{key:"get",value:function(r,n){var a=this.getKey(r),i=this.getCache(a,n);return i!=null&&this.updateKeyMappingFor(r),i}},{key:"getForCachedKey",value:function(r,n){var a=this.keyForId.get(r.id()),i=this.getCache(a,n);return i}},{key:"hasCache",value:function(r,n){return this.getCachesAt(n).has(r)}},{key:"has",value:function(r,n){var a=this.getKey(r);return this.hasCache(a,n)}},{key:"setCache",value:function(r,n,a){a.key=r,this.getCachesAt(n).set(r,a)}},{key:"set",value:function(r,n,a){var i=this.getKey(r);this.setCache(i,n,a),this.updateKeyMappingFor(r)}},{key:"deleteCache",value:function(r,n){this.getCachesAt(n).delete(r)}},{key:"delete",value:function(r,n){var a=this.getKey(r);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(r){var n=this;this.lvls.forEach(function(a){return n.deleteCache(r,a)})}},{key:"invalidate",value:function(r){var n=r.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(a),i||this.getNumberOfIdsForKey(a)===0}}]),t}(),$c=25,_s=50,zs=-4,au=3,qc=7.99,ab=8,ib=1024,sb=1024,ob=1024,ub=.2,lb=.8,fb=10,cb=.15,db=.1,vb=.9,hb=.9,gb=100,pb=1,Pa={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},mb=_t({getKey:null,doesEleInvalidateKey:Qi,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Il,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),yi=function(e,r){var n=this;n.renderer=e,n.onDequeues=[];var a=mb(r);Ve(n,a),n.lookup=new nb(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},Lt=yi.prototype;Lt.reasons=Pa,Lt.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]},Lt.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=r[t]=r[t]||[];return n},Lt.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new ja(function(r,n){return n.reqs-r.reqs});return e},Lt.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e},Lt.getElement=function(t,e,r,n,a){var i=this,s=this.renderer,o=s.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(n==null&&(n=Math.ceil(Fo(o*r))),n<zs)n=zs;else if(o>=qc||n>au)return null;var l=Math.pow(2,n),f=e.h*l,d=e.w*l,g=s.eleTextBiggerThanMin(t,l);if(!this.isVisible(t,g))return null;var m=u.get(t,n);if(m&&m.invalidated&&(m.invalidated=!1,m.texture.invalidatedWidth-=m.width),m)return m;var p;if(f<=$c?p=$c:f<=_s?p=_s:p=Math.ceil(f/_s)*_s,f>ob||d>sb)return null;var b=i.getTextureQueue(p),x=b[b.length-2],w=function(){return i.recycleTexture(p,d)||i.addTexture(p,d)};x||(x=b[b.length-1]),x||(x=w()),x.width-x.usedWidth<d&&(x=w());for(var E=function(H){return H&&H.scaledLabelShown===g},C=a&&a===Pa.dequeue,k=a&&a===Pa.highQuality,R=a&&a===Pa.downscale,A,h=n+1;h<=au;h++){var I=u.get(t,h);if(I){A=I;break}}var D=A&&A.level===n+1?A:null,M=function(){x.context.drawImage(D.texture.canvas,D.x,0,D.width,D.height,x.usedWidth,0,d,f)};if(x.context.setTransform(1,0,0,1,0,0),x.context.clearRect(x.usedWidth,0,d,p),E(D))M();else if(E(A))if(k){for(var L=A.level;L>n;L--)D=i.getElement(t,e,r,L,Pa.downscale);M()}else return i.queueElement(t,A.level-1),A;else{var B;if(!C&&!k&&!R)for(var N=n-1;N>=zs;N--){var _=u.get(t,N);if(_){B=_;break}}if(E(B))return i.queueElement(t,n),B;x.context.translate(x.usedWidth,0),x.context.scale(l,l),this.drawElement(x.context,t,e,g,!1),x.context.scale(1/l,1/l),x.context.translate(-x.usedWidth,0)}return m={x:x.usedWidth,texture:x,level:n,scale:l,width:d,height:f,scaledLabelShown:g},x.usedWidth+=Math.ceil(d+ab),x.eleCaches.push(m),u.set(t,n,m),i.checkTextureFullness(x),m},Lt.invalidateElements=function(t){for(var e=0;e<t.length;e++)this.invalidateElement(t[e])},Lt.invalidateElement=function(t){var e=this,r=e.lookup,n=[],a=r.isInvalid(t);if(a){for(var i=zs;i<=au;i++){var s=r.getForCachedKey(t,i);s&&n.push(s)}var o=r.invalidate(t);if(o)for(var u=0;u<n.length;u++){var l=n[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(t)}},Lt.checkTextureUtility=function(t){t.invalidatedWidth>=ub*t.width&&this.retireTexture(t)},Lt.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>lb&&t.fullnessChecks>=fb?hn(r,t):t.fullnessChecks++},Lt.retireTexture=function(t){var e=this,r=t.height,n=e.getTextureQueue(r),a=this.lookup;hn(n,t),t.retired=!0;for(var i=t.eleCaches,s=0;s<i.length;s++){var o=i[s];a.deleteCache(o.key,o.level)}bo(i);var u=e.getRetiredTextureQueue(r);u.push(t)},Lt.addTexture=function(t,e){var r=this,n=r.getTextureQueue(t),a={};return n.push(a),a.eleCaches=[],a.height=t,a.width=Math.max(ib,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=r.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},Lt.recycleTexture=function(t,e){for(var r=this,n=r.getTextureQueue(t),a=r.getRetiredTextureQueue(t),i=0;i<a.length;i++){var s=a[i];if(s.width>=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,bo(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),hn(a,s),n.push(s),s}},Lt.queueElement=function(t,e){var r=this,n=r.getElementQueue(),a=r.getElementKeyToQueue(),i=this.getKey(t),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,n.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};n.push(o),a[i]=o}},Lt.dequeue=function(t){for(var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<pb&&r.size()>0;s++){var o=r.pop(),u=o.key,l=o.eles[0],f=i.hasCache(l,o.level);if(n[u]=null,f)continue;a.push(o);var d=e.getBoundingBox(l);e.getElement(l,d,t,o.level,Pa.dequeue)}return a},Lt.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(t),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=yo,r.updateItem(i),r.pop(),n[a]=null):i.eles.unmerge(t))},Lt.onDequeue=function(t){this.onDequeues.push(t)},Lt.offDequeue=function(t){hn(this.onDequeues,t)},Lt.setupDequeueing=Vc.setupDequeueing({deqRedrawThreshold:gb,deqCost:cb,deqAvgCost:db,deqNoDrawCost:vb,deqFastCost:hb,deq:function(e,r,n){return e.dequeue(r,n)},onDeqd:function(e,r){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(r)}},shouldRedraw:function(e,r,n,a){for(var i=0;i<r.length;i++)for(var s=r[i].eles,o=0;o<s.length;o++){var u=s[o].boundingBox();if(Eo(u,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var yb=1,wi=-4,Vs=2,wb=3.99,bb=50,xb=50,Fb=.15,Eb=.1,Cb=.9,Tb=.9,Sb=1,Hc=250,Db=4e3*4e3,Wc=32767,kb=!0,Uc=function(e){var r=this,n=r.renderer=e,a=n.cy;r.layersByLevel={},r.firstGet=!0,r.lastInvalidationTime=Qr()-2*Hc,r.skipping=!1,r.eleTxrDeqs=a.collection(),r.scheduleElementRefinement=Xa(function(){r.refineElementTextures(r.eleTxrDeqs),r.eleTxrDeqs.unmerge(r.eleTxrDeqs)},xb),n.beforeRender(function(s,o){o-r.lastInvalidationTime<=Hc?r.skipping=!0:r.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(o,u){return u.reqs-o.reqs};r.layersQueue=new ja(i),r.setupDequeueing()},Gt=Uc.prototype,Gc=0,Pb=Math.pow(2,53)-1;Gt.makeLayer=function(t,e){var r=Math.pow(2,e),n=Math.ceil(t.w*r),a=Math.ceil(t.h*r),i=this.renderer.makeOffscreenCanvas(n,a),s={id:Gc=++Gc%Pb,bb:t,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,u=-s.bb.x1,l=-s.bb.y1;return o.scale(r,r),o.translate(u,l),s},Gt.getLayers=function(t,e,r){var n=this,a=n.renderer,i=a.cy,s=i.zoom(),o=n.firstGet;if(n.firstGet=!1,r==null){if(r=Math.ceil(Fo(s*e)),r<wi)r=wi;else if(s>=wb||r>Vs)return null}n.validateLayersElesOrdering(r,t);var u=n.layersByLevel,l=Math.pow(2,r),f=u[r]=u[r]||[],d,g=n.levelIsComplete(r,t),m,p=function(){var M=function(U){if(n.validateLayersElesOrdering(U,t),n.levelIsComplete(U,t))return m=u[U],!0},L=function(U){if(!m)for(var H=r+U;wi<=H&&H<=Vs&&!M(H);H+=U);};L(1),L(-1);for(var B=f.length-1;B>=0;B--){var N=f[B];N.invalid&&hn(f,N)}};if(!g)p();else return f;var b=function(){if(!d){d=fr();for(var M=0;M<t.length;M++)Vl(d,t[M].boundingBox())}return d},x=function(M){M=M||{};var L=M.after;b();var B=Math.ceil(d.w*l),N=Math.ceil(d.h*l);if(B>Wc||N>Wc)return null;var _=B*N;if(_>Db)return null;var U=n.makeLayer(d,r);if(L!=null){var H=f.indexOf(L)+1;f.splice(H,0,U)}else(M.insert===void 0||M.insert)&&f.unshift(U);return U};if(n.skipping&&!o)return null;for(var w=null,E=t.length/yb,C=!o,k=0;k<t.length;k++){var R=t[k],A=R._private.rscratch,h=A.imgLayerCaches=A.imgLayerCaches||{},I=h[r];if(I){w=I;continue}if((!w||w.eles.length>=E||!ql(w.bb,R.boundingBox()))&&(w=x({insert:!0,after:w}),!w))return null;m||C?n.queueLayer(w,R):n.drawEleInLayer(w,R,r,e),w.eles.push(R),h[r]=w}return m||(C?null:f)},Gt.getEleLevelForLayerLevel=function(t,e){return t},Gt.drawEleInLayer=function(t,e,r,n){var a=this,i=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=a.getEleLevelForLayerLevel(r,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,kb),i.setImgSmoothing(s,!0))},Gt.levelIsComplete=function(t,e){var r=this,n=r.layersByLevel[t];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var s=n[i];if(s.reqs>0||s.invalid)return!1;a+=s.eles.length}return a===e.length},Gt.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var n=0;n<r.length;n++){for(var a=r[n],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0){this.invalidateLayer(a);continue}for(var o=i,s=0;s<a.eles.length;s++)if(a.eles[s]!==e[o+s]){this.invalidateLayer(a);break}}},Gt.updateElementsInLayers=function(t,e){for(var r=this,n=Ha(t[0]),a=0;a<t.length;a++)for(var i=n?null:t[a],s=n?t[a]:t[a].ele,o=s._private.rscratch,u=o.imgLayerCaches=o.imgLayerCaches||{},l=wi;l<=Vs;l++){var f=u[l];f&&(i&&r.getEleLevelForLayerLevel(f.level)!==i.level||e(f,s,i))}},Gt.haveLayers=function(){for(var t=this,e=!1,r=wi;r<=Vs;r++){var n=t.layersByLevel[r];if(n&&n.length>0){e=!0;break}}return e},Gt.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=Qr(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,function(n,a,i){e.invalidateLayer(n)}))},Gt.invalidateLayer=function(t){if(this.lastInvalidationTime=Qr(),!t.invalid){var e=t.level,r=t.eles,n=this.layersByLevel[e];hn(n,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var a=0;a<r.length;a++){var i=r[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},Gt.refineElementTextures=function(t){var e=this;e.updateElementsInLayers(t,function(n,a,i){var s=n.replacement;if(s||(s=n.replacement=e.makeLayer(n.bb,n.level),s.replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})},Gt.enqueueElementRefinement=function(t){this.eleTxrDeqs.merge(t),this.scheduleElementRefinement()},Gt.queueLayer=function(t,e){var r=this,n=r.layersQueue,a=t.elesQueue,i=a.hasId=a.hasId||{};if(!t.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}t.reqs?(t.reqs++,n.updateItem(t)):(t.reqs=1,n.push(t))}},Gt.dequeue=function(t){for(var e=this,r=e.layersQueue,n=[],a=0;a<Sb&&r.size()!==0;){var i=r.peek();if(i.replacement){r.pop();continue}if(i.replaces&&i!==i.replaces.replacement){r.pop();continue}if(i.invalid){r.pop();continue}var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,t),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(r.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n},Gt.applyLayerReplacement=function(t){var e=this,r=e.layersByLevel[t.level],n=t.replaces,a=r.indexOf(n);if(!(a<0||n.invalid)){r[a]=t;for(var i=0;i<t.eles.length;i++){var s=t.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[t.level]=t)}e.requestRedraw()}},Gt.requestRedraw=Xa(function(){var t=this.renderer;t.redrawHint("eles",!0),t.redrawHint("drag",!0),t.redraw()},100),Gt.setupDequeueing=Vc.setupDequeueing({deqRedrawThreshold:bb,deqCost:Fb,deqAvgCost:Eb,deqNoDrawCost:Cb,deqFastCost:Tb,deq:function(e,r){return e.dequeue(r)},onDeqd:wo,shouldRedraw:Il,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var Kc={},Xc;function Ab(t,e){for(var r=0;r<e.length;r++){var n=e[r];t.lineTo(n.x,n.y)}}function Bb(t,e,r){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),t.lineTo(i.x,i.y)}t.quadraticCurveTo(r.x,r.y,n.x,n.y)}function Yc(t,e,r){t.beginPath&&t.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];t.lineTo(i.x,i.y)}var s=r,o=r[0];t.moveTo(o.x,o.y);for(var a=1;a<s.length;a++){var i=s[a];t.lineTo(i.x,i.y)}t.closePath&&t.closePath()}function Ib(t,e,r,n,a){t.beginPath&&t.beginPath(),t.arc(r,n,a,0,Math.PI*2,!1);var i=e,s=i[0];t.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var u=i[o];t.lineTo(u.x,u.y)}t.closePath&&t.closePath()}function Mb(t,e,r,n){t.arc(e,r,n,0,Math.PI*2,!1)}Kc.arrowShapeImpl=function(t){return(Xc||(Xc={polygon:Ab,"triangle-backcurve":Bb,"triangle-tee":Yc,"circle-triangle":Ib,"triangle-cross":Yc,circle:Mb}))[t]};var Wr={};Wr.drawElement=function(t,e,r,n,a,i){var s=this;e.isNode()?s.drawNode(t,e,r,n,a,i):s.drawEdge(t,e,r,n,a,i)},Wr.drawElementOverlay=function(t,e){var r=this;e.isNode()?r.drawNodeOverlay(t,e):r.drawEdgeOverlay(t,e)},Wr.drawElementUnderlay=function(t,e){var r=this;e.isNode()?r.drawNodeUnderlay(t,e):r.drawEdgeUnderlay(t,e)},Wr.drawCachedElementPortion=function(t,e,r,n,a,i,s,o){var u=this,l=r.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=r.getElement(e,l,n,a,i);if(f!=null){var d=o(u,e);if(d===0)return;var g=s(u,e),m=l.x1,p=l.y1,b=l.w,x=l.h,w,E,C,k,R;if(g!==0){var A=r.getRotationPoint(e);C=A.x,k=A.y,t.translate(C,k),t.rotate(g),R=u.getImgSmoothing(t),R||u.setImgSmoothing(t,!0);var h=r.getRotationOffset(e);w=h.x,E=h.y}else w=m,E=p;var I;d!==1&&(I=t.globalAlpha,t.globalAlpha=I*d),t.drawImage(f.texture.canvas,f.x,0,f.width,f.height,w,E,b,x),d!==1&&(t.globalAlpha=I),g!==0&&(t.rotate(-g),t.translate(-C,-k),R||u.setImgSmoothing(t,!1))}else r.drawElement(t,e)}};var Rb=function(){return 0},Lb=function(e,r){return e.getTextAngle(r,null)},Ob=function(e,r){return e.getTextAngle(r,"source")},Nb=function(e,r){return e.getTextAngle(r,"target")},_b=function(e,r){return r.effectiveOpacity()},iu=function(e,r){return r.pstyle("text-opacity").pfValue*r.effectiveOpacity()};Wr.drawCachedElement=function(t,e,r,n,a,i){var s=this,o=s.data,u=o.eleTxrCache,l=o.lblTxrCache,f=o.slbTxrCache,d=o.tlbTxrCache,g=e.boundingBox(),m=i===!0?u.reasons.highQuality:null;if(!(g.w===0||g.h===0||!e.visible())&&(!n||Eo(g,n))){var p=e.isEdge(),b=e.element()._private.rscratch.badLine;s.drawElementUnderlay(t,e),s.drawCachedElementPortion(t,e,u,r,a,m,Rb,_b),(!p||!b)&&s.drawCachedElementPortion(t,e,l,r,a,m,Lb,iu),p&&!b&&(s.drawCachedElementPortion(t,e,f,r,a,m,Ob,iu),s.drawCachedElementPortion(t,e,d,r,a,m,Nb,iu)),s.drawElementOverlay(t,e)}},Wr.drawElements=function(t,e){for(var r=this,n=0;n<e.length;n++){var a=e[n];r.drawElement(t,a)}},Wr.drawCachedElements=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];a.drawCachedElement(t,s,r,n)}},Wr.drawCachedNodes=function(t,e,r,n){for(var a=this,i=0;i<e.length;i++){var s=e[i];s.isNode()&&a.drawCachedElement(t,s,r,n)}},Wr.drawLayeredElements=function(t,e,r,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,r);if(i)for(var s=0;s<i.length;s++){var o=i[s],u=o.bb;u.w===0||u.h===0||t.drawImage(o.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(t,e,r,n)};var rn={};rn.drawEdge=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var u;r&&(u=r,t.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,g=e.pstyle("line-style").value,m=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,b=e.pstyle("line-outline-width").value,x=e.pstyle("line-outline-color").value,w=l*f,E=l*f,C=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;d==="straight-triangle"?(s.eleStrokeStyle(t,e,U),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=m,t.lineCap=p,s.eleStrokeStyle(t,e,U),s.drawEdgePath(e,t,o.allpts,g),t.lineCap="butt")},k=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;if(t.lineWidth=m+b,t.lineCap=p,b>0)s.colorStrokeStyle(t,x[0],x[1],x[2],U);else{t.lineCap="butt";return}d==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,g),t.lineCap="butt")},R=function(){a&&s.drawEdgeOverlay(t,e)},A=function(){a&&s.drawEdgeUnderlay(t,e)},h=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E;s.drawArrowheads(t,e,U)},I=function(){s.drawElementText(t,e,null,n)};t.lineJoin="round";var D=e.pstyle("ghost").value==="yes";if(D){var M=e.pstyle("ghost-offset-x").pfValue,L=e.pstyle("ghost-offset-y").pfValue,B=e.pstyle("ghost-opacity").value,N=w*B;t.translate(M,L),C(N),h(N),t.translate(-M,-L)}else k();A(),C(),h(),R(),I(),r&&t.translate(u.x1,u.y1)}};var Zc=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(a!==0){var i=this,s=i.usePaths(),o=n._private.rscratch,u=n.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=n.pstyle("".concat(e,"-color")).value;r.lineWidth=l,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,f[0],f[1],f[2],a),i.drawEdgePath(n,r,o.allpts,"solid")}}}};rn.drawEdgeOverlay=Zc("overlay"),rn.drawEdgeUnderlay=Zc("underlay"),rn.drawEdgePath=function(t,e,r,n){var a=t._private.rscratch,i=e,s,o=!1,u=this.usePaths(),l=t.pstyle("line-dash-pattern").pfValue,f=t.pstyle("line-dash-offset").pfValue;if(u){var d=r.join("$"),g=a.pathCacheKey&&a.pathCacheKey===d;g?(s=e=a.pathCache,o=!0):(s=e=new Path2D,a.pathCacheKey=d,a.pathCache=s)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var m=2;m+3<r.length;m+=4)e.quadraticCurveTo(r[m],r[m+1],r[m+2],r[m+3]);break;case"straight":case"haystack":for(var p=2;p+1<r.length;p+=2)e.lineTo(r[p],r[p+1]);break;case"segments":if(a.isRound){var b=wr(a.roundCorners),x;try{for(b.s();!(x=b.n()).done;){var w=x.value;Pc(e,w)}}catch(C){b.e(C)}finally{b.f()}e.lineTo(r[r.length-2],r[r.length-1])}else for(var E=2;E+1<r.length;E+=2)e.lineTo(r[E],r[E+1]);break}e=i,u?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},rn.drawEdgeTrianglePath=function(t,e,r){e.fillStyle=e.strokeStyle;for(var n=t.pstyle("width").pfValue,a=0;a+1<r.length;a+=2){var i=[r[a+2]-r[a],r[a+3]-r[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],u=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(r[a]-u[0],r[a+1]-u[1]),e.lineTo(r[a]+u[0],r[a+1]+u[1]),e.lineTo(r[a+2],r[a+3]),e.closePath(),e.fill()}},rn.drawArrowheads=function(t,e,r){var n=e._private.rscratch,a=n.edgeType==="haystack";a||this.drawArrowhead(t,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,r),this.drawArrowhead(t,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,r),this.drawArrowhead(t,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,r),a||this.drawArrowhead(t,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,r)},rn.drawArrowhead=function(t,e,r,n,a,i,s){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var o=this,u=e.pstyle(r+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(r+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(r+"-arrow-fill").value,d=e.pstyle("width").pfValue,g=e.pstyle(r+"-arrow-width"),m=g.value==="match-line"?d:g.pfValue;g.units==="%"&&(m*=d);var p=e.pstyle("opacity").value;s===void 0&&(s=p);var b=t.globalCompositeOperation;(s!==1||f==="hollow")&&(t.globalCompositeOperation="destination-out",o.colorFillStyle(t,255,255,255,1),o.colorStrokeStyle(t,255,255,255,1),o.drawArrowShape(e,t,l,d,u,m,n,a,i),t.globalCompositeOperation=b);var x=e.pstyle(r+"-arrow-color").value;o.colorFillStyle(t,x[0],x[1],x[2],s),o.colorStrokeStyle(t,x[0],x[1],x[2],s),o.drawArrowShape(e,t,f,d,u,m,n,a,i)}}},rn.drawArrowShape=function(t,e,r,n,a,i,s,o,u){var l=this,f=this.usePaths()&&a!=="triangle-cross",d=!1,g,m=e,p={x:s,y:o},b=t.pstyle("arrow-scale").value,x=this.getArrowWidth(n,b),w=l.arrowShapes[a];if(f){var E=l.arrowPathCache=l.arrowPathCache||[],C=vn(a),k=E[C];k!=null?(g=e=k,d=!0):(g=e=new Path2D,E[C]=g)}d||(e.beginPath&&e.beginPath(),f?w.draw(e,1,0,{x:0,y:0},1):w.draw(e,x,u,p,n),e.closePath&&e.closePath()),e=m,f&&(e.translate(s,o),e.rotate(u),e.scale(x,x)),(r==="filled"||r==="both")&&(f?e.fill(g):e.fill()),(r==="hollow"||r==="both")&&(e.lineWidth=i/(f?x:1),e.lineJoin="miter",f?e.stroke(g):e.stroke()),f&&(e.scale(1/x,1/x),e.rotate(-u),e.translate(-s,-o))};var su={};su.safeDrawImage=function(t,e,r,n,a,i,s,o,u,l){if(!(a<=0||i<=0||u<=0||l<=0))try{t.drawImage(e,r,n,a,i,s,o,u,l)}catch(f){ht(f)}},su.drawInscribedImage=function(t,e,r,n,a){var i=this,s=r.position(),o=s.x,u=s.y,l=r.cy().style(),f=l.getIndexedStyle.bind(l),d=f(r,"background-fit","value",n),g=f(r,"background-repeat","value",n),m=r.width(),p=r.height(),b=r.padding()*2,x=m+(f(r,"background-width-relative-to","value",n)==="inner"?0:b),w=p+(f(r,"background-height-relative-to","value",n)==="inner"?0:b),E=r._private.rscratch,C=f(r,"background-clip","value",n),k=C==="node",R=f(r,"background-image-opacity","value",n)*a,A=f(r,"background-image-smoothing","value",n),h=r.pstyle("corner-radius").value;h!=="auto"&&(h=r.pstyle("corner-radius").pfValue);var I=e.width||e.cachedW,D=e.height||e.cachedH;(I==null||D==null)&&(document.body.appendChild(e),I=e.cachedW=e.width||e.offsetWidth,D=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var M=I,L=D;if(f(r,"background-width","value",n)!=="auto"&&(f(r,"background-width","units",n)==="%"?M=f(r,"background-width","pfValue",n)*x:M=f(r,"background-width","pfValue",n)),f(r,"background-height","value",n)!=="auto"&&(f(r,"background-height","units",n)==="%"?L=f(r,"background-height","pfValue",n)*w:L=f(r,"background-height","pfValue",n)),!(M===0||L===0)){if(d==="contain"){var B=Math.min(x/M,w/L);M*=B,L*=B}else if(d==="cover"){var B=Math.max(x/M,w/L);M*=B,L*=B}var N=o-x/2,_=f(r,"background-position-x","units",n),U=f(r,"background-position-x","pfValue",n);_==="%"?N+=(x-M)*U:N+=U;var H=f(r,"background-offset-x","units",n),W=f(r,"background-offset-x","pfValue",n);H==="%"?N+=(x-M)*W:N+=W;var X=u-w/2,Q=f(r,"background-position-y","units",n),se=f(r,"background-position-y","pfValue",n);Q==="%"?X+=(w-L)*se:X+=se;var j=f(r,"background-offset-y","units",n),ee=f(r,"background-offset-y","pfValue",n);j==="%"?X+=(w-L)*ee:X+=ee,E.pathCache&&(N-=o,X-=u,o=0,u=0);var de=t.globalAlpha;t.globalAlpha=R;var ge=i.getImgSmoothing(t),me=!1;if(A==="no"&&ge?(i.setImgSmoothing(t,!1),me=!0):A==="yes"&&!ge&&(i.setImgSmoothing(t,!0),me=!0),g==="no-repeat")k&&(t.save(),E.pathCache?t.clip(E.pathCache):(i.nodeShapes[i.getNodeShape(r)].draw(t,o,u,x,w,h,E),t.clip())),i.safeDrawImage(t,e,0,0,I,D,N,X,M,L),k&&t.restore();else{var pe=t.createPattern(e,g);t.fillStyle=pe,i.nodeShapes[i.getNodeShape(r)].draw(t,o,u,x,w,h,E),t.translate(N,X),t.fill(),t.translate(-N,-X)}t.globalAlpha=de,me&&i.setImgSmoothing(t,ge)}};var Un={};Un.eleTextBiggerThanMin=function(t,e){if(!e){var r=t.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Fo(r*n));e=Math.pow(2,a)}var i=t.pstyle("font-size").pfValue*e,s=t.pstyle("min-zoomed-font-size").pfValue;return!(i<s)},Un.drawElementText=function(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(n==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var u=s.getLabelJustification(e);t.textAlign=u,t.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,f=e.pstyle("label"),d=e.pstyle("source-label"),g=e.pstyle("target-label");if(l||(!f||!f.value)&&(!d||!d.value)&&(!g||!g.value))return;t.textAlign="center",t.textBaseline="bottom"}var m=!r,p;r&&(p=r,t.translate(-p.x1,-p.y1)),a==null?(s.drawText(t,e,null,m,i),e.isEdge()&&(s.drawText(t,e,"source",m,i),s.drawText(t,e,"target",m,i))):s.drawText(t,e,a,m,i),r&&t.translate(p.x1,p.y1)},Un.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r<this.fontCaches.length;r++)if(e=this.fontCaches[r],e.context===t)return e;return e={context:t},this.fontCaches.push(e),e},Un.setupTextStyle=function(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*o,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;t.font=n+" "+s+" "+a+" "+i,t.lineJoin="round",this.colorFillStyle(t,l[0],l[1],l[2],o),this.colorStrokeStyle(t,f[0],f[1],f[2],u)};function ou(t,e,r,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+n-i,r),t.quadraticCurveTo(e+n,r,e+n,r+i),t.lineTo(e+n,r+a-i),t.quadraticCurveTo(e+n,r+a,e+n-i,r+a),t.lineTo(e+i,r+a),t.quadraticCurveTo(e,r+a,e,r+a-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),s?t.stroke():t.fill()}Un.getTextAngle=function(t,e){var r,n=t._private,a=n.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation");if(s.strValue==="autorotate"){var o=Ir(a,"labelAngle",e);r=t.isEdge()?o:0}else s.strValue==="none"?r=0:r=s.pfValue;return r},Un.drawText=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=a?e.effectiveOpacity():1;if(!(a&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var u=Ir(s,"labelX",r),l=Ir(s,"labelY",r),f,d,g=this.getLabelText(e,r);if(g!=null&&g!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(t,e,a);var m=r?r+"-":"",p=Ir(s,"labelWidth",r),b=Ir(s,"labelHeight",r),x=e.pstyle(m+"text-margin-x").pfValue,w=e.pstyle(m+"text-margin-y").pfValue,E=e.isEdge(),C=e.pstyle("text-halign").value,k=e.pstyle("text-valign").value;E&&(C="center",k="center"),u+=x,l+=w;var R;switch(n?R=this.getTextAngle(e,r):R=0,R!==0&&(f=u,d=l,t.translate(f,d),t.rotate(R),u=0,l=0),k){case"top":break;case"center":l+=b/2;break;case"bottom":l+=b;break}var A=e.pstyle("text-background-opacity").value,h=e.pstyle("text-border-opacity").value,I=e.pstyle("text-border-width").pfValue,D=e.pstyle("text-background-padding").pfValue,M=e.pstyle("text-background-shape").strValue,L=M.indexOf("round")===0,B=2;if(A>0||I>0&&h>0){var N=u-D;switch(C){case"left":N-=p;break;case"center":N-=p/2;break}var _=l-b-D,U=p+2*D,H=b+2*D;if(A>0){var W=t.fillStyle,X=e.pstyle("text-background-color").value;t.fillStyle="rgba("+X[0]+","+X[1]+","+X[2]+","+A*o+")",L?ou(t,N,_,U,H,B):t.fillRect(N,_,U,H),t.fillStyle=W}if(I>0&&h>0){var Q=t.strokeStyle,se=t.lineWidth,j=e.pstyle("text-border-color").value,ee=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+j[0]+","+j[1]+","+j[2]+","+h*o+")",t.lineWidth=I,t.setLineDash)switch(ee){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=I/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(L?ou(t,N,_,U,H,B,"stroke"):t.strokeRect(N,_,U,H),ee==="double"){var de=I/2;L?ou(t,N+de,_+de,U-de*2,H-de*2,B,"stroke"):t.strokeRect(N+de,_+de,U-de*2,H-de*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=se,t.strokeStyle=Q}}var ge=2*e.pstyle("text-outline-width").pfValue;if(ge>0&&(t.lineWidth=ge),e.pstyle("text-wrap").value==="wrap"){var me=Ir(s,"labelWrapCachedLines",r),pe=Ir(s,"labelLineHeight",r),we=p/2,be=this.getLabelJustification(e);switch(be==="auto"||(C==="left"?be==="left"?u+=-p:be==="center"&&(u+=-we):C==="center"?be==="left"?u+=-we:be==="right"&&(u+=we):C==="right"&&(be==="center"?u+=we:be==="right"&&(u+=p))),k){case"top":l-=(me.length-1)*pe;break;case"center":case"bottom":l-=(me.length-1)*pe;break}for(var ae=0;ae<me.length;ae++)ge>0&&t.strokeText(me[ae],u,l),t.fillText(me[ae],u,l),l+=pe}else ge>0&&t.strokeText(g,u,l),t.fillText(g,u,l);R!==0&&(t.rotate(-R),t.translate(-f,-d))}}};var Aa={};Aa.drawNode=function(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,u,l=e._private,f=l.rscratch,d=e.position();if(!(!Se(d.x)||!Se(d.y))&&!(i&&!e.visible())){var g=i?e.effectiveOpacity():1,m=s.usePaths(),p,b=!1,x=e.padding();o=e.width()+2*x,u=e.height()+2*x;var w;r&&(w=r,t.translate(-w.x1,-w.y1));for(var E=e.pstyle("background-image"),C=E.value,k=new Array(C.length),R=new Array(C.length),A=0,h=0;h<C.length;h++){var I=C[h],D=k[h]=I!=null&&I!=="none";if(D){var M=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",h);A++,R[h]=s.getCachedImage(I,M,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var L=e.pstyle("background-blacken").value,B=e.pstyle("border-width").pfValue,N=e.pstyle("background-opacity").value*g,_=e.pstyle("border-color").value,U=e.pstyle("border-style").value,H=e.pstyle("border-join").value,W=e.pstyle("border-cap").value,X=e.pstyle("border-position").value,Q=e.pstyle("border-dash-pattern").pfValue,se=e.pstyle("border-dash-offset").pfValue,j=e.pstyle("border-opacity").value*g,ee=e.pstyle("outline-width").pfValue,de=e.pstyle("outline-color").value,ge=e.pstyle("outline-style").value,me=e.pstyle("outline-opacity").value*g,pe=e.pstyle("outline-offset").value,we=e.pstyle("corner-radius").value;we!=="auto"&&(we=e.pstyle("corner-radius").pfValue);var be=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N;s.eleFillStyle(t,e,J)},ae=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:j;s.colorStrokeStyle(t,_[0],_[1],_[2],J)},Y=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:me;s.colorStrokeStyle(t,de[0],de[1],de[2],J)},oe=function(J,ne,Te,fe){var Ee=s.nodePathCache=s.nodePathCache||[],Oe=Al(Te==="polygon"?Te+","+fe.join(","):Te,""+ne,""+J,""+we),Ye=Ee[Oe],Re,Ue=!1;return Ye!=null?(Re=Ye,Ue=!0,f.pathCache=Re):(Re=new Path2D,Ee[Oe]=f.pathCache=Re),{path:Re,cacheHit:Ue}},ye=e.pstyle("shape").strValue,De=e.pstyle("shape-polygon-points").pfValue;if(m){t.translate(d.x,d.y);var Be=oe(o,u,ye,De);p=Be.path,b=Be.cacheHit}var Je=function(){if(!b){var J=d;m&&(J={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(p||t,J.x,J.y,o,u,we,f)}m?t.fill(p):t.fill()},ut=function(){for(var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Te=l.backgrounding,fe=0,Ee=0;Ee<R.length;Ee++){var Oe=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ee);if(ne&&Oe==="over"||!ne&&Oe==="inside"){fe++;continue}k[Ee]&&R[Ee].complete&&!R[Ee].error&&(fe++,s.drawInscribedImage(t,R[Ee],e,Ee,J))}l.backgrounding=fe!==A,Te!==l.backgrounding&&e.updateStyle(!1)},at=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:g;s.hasPie(e)&&(s.drawPie(t,e,ne),J&&(m||s.nodeShapes[s.getNodeShape(e)].draw(t,d.x,d.y,o,u,we,f)))},ke=function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g,ne=(L>0?L:-L)*J,Te=L>0?0:255;L!==0&&(s.colorFillStyle(t,Te,Te,Te,ne),m?t.fill(p):t.fill())},Ie=function(){if(B>0){if(t.lineWidth=B,t.lineCap=W,t.lineJoin=H,t.setLineDash)switch(U){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(Q),t.lineDashOffset=se;break;case"solid":case"double":t.setLineDash([]);break}if(X!=="center"){if(t.save(),t.lineWidth*=2,X==="inside")m?t.clip(p):t.clip();else{var J=new Path2D;J.rect(-o/2-B,-u/2-B,o+2*B,u+2*B),J.addPath(p),t.clip(J,"evenodd")}m?t.stroke(p):t.stroke(),t.restore()}else m?t.stroke(p):t.stroke();if(U==="double"){t.lineWidth=B/3;var ne=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(p):t.stroke(),t.globalCompositeOperation=ne}t.setLineDash&&t.setLineDash([])}},He=function(){if(ee>0){if(t.lineWidth=ee,t.lineCap="butt",t.setLineDash)switch(ge){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var J=d;m&&(J={x:0,y:0});var ne=s.getNodeShape(e),Te=B;X==="inside"&&(Te=0),X==="outside"&&(Te*=2);var fe=(o+Te+(ee+pe))/o,Ee=(u+Te+(ee+pe))/u,Oe=o*fe,Ye=u*Ee,Re=s.nodeShapes[ne].points,Ue;if(m){var Ke=oe(Oe,Ye,ne,Re);Ue=Ke.path}if(ne==="ellipse")s.drawEllipsePath(Ue||t,J.x,J.y,Oe,Ye);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ne)){var $e=0,lt=0,mt=0;ne==="round-diamond"?$e=(Te+pe+ee)*1.4:ne==="round-heptagon"?($e=(Te+pe+ee)*1.075,mt=-(Te/2+pe+ee)/35):ne==="round-hexagon"?$e=(Te+pe+ee)*1.12:ne==="round-pentagon"?($e=(Te+pe+ee)*1.13,mt=-(Te/2+pe+ee)/15):ne==="round-tag"?($e=(Te+pe+ee)*1.12,lt=(Te/2+ee+pe)*.07):ne==="round-triangle"&&($e=(Te+pe+ee)*(Math.PI/2),mt=-(Te+pe/2+ee)/Math.PI),$e!==0&&(fe=(o+$e)/o,Oe=o*fe,["round-hexagon","round-tag"].includes(ne)||(Ee=(u+$e)/u,Ye=u*Ee)),we=we==="auto"?Ul(Oe,Ye):we;for(var rr=Oe/2,nr=Ye/2,vt=we+(Te+ee+pe)/2,ft=new Array(Re.length/2),kt=new Array(Re.length/2),Kt=0;Kt<Re.length/2;Kt++)ft[Kt]={x:J.x+lt+rr*Re[Kt*2],y:J.y+mt+nr*Re[Kt*2+1]};var $t,Er,Ot,Xt,Cr=ft.length;for(Er=ft[Cr-1],$t=0;$t<Cr;$t++)Ot=ft[$t%Cr],Xt=ft[($t+1)%Cr],kt[$t]=tu(Er,Ot,Xt,vt),Er=Ot,Ot=Xt;s.drawRoundPolygonPath(Ue||t,J.x+lt,J.y+mt,o*fe,u*Ee,Re,kt)}else if(["roundrectangle","round-rectangle"].includes(ne))we=we==="auto"?Nn(Oe,Ye):we,s.drawRoundRectanglePath(Ue||t,J.x,J.y,Oe,Ye,we+(Te+ee+pe)/2);else if(["cutrectangle","cut-rectangle"].includes(ne))we=we==="auto"?So():we,s.drawCutRectanglePath(Ue||t,J.x,J.y,Oe,Ye,null,we+(Te+ee+pe)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ne))we=we==="auto"?Nn(Oe,Ye):we,s.drawBottomRoundRectanglePath(Ue||t,J.x,J.y,Oe,Ye,we+(Te+ee+pe)/2);else if(ne==="barrel")s.drawBarrelPath(Ue||t,J.x,J.y,Oe,Ye);else if(ne.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ne)){var gr=(Te+ee+pe)/o;Re=ns(as(Re,gr)),s.drawPolygonPath(Ue||t,J.x,J.y,o,u,Re)}else{var qt=(Te+ee+pe)/o;Re=ns(as(Re,-qt)),s.drawPolygonPath(Ue||t,J.x,J.y,o,u,Re)}if(m?t.stroke(Ue):t.stroke(),ge==="double"){t.lineWidth=Te/3;var Bt=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",m?t.stroke(Ue):t.stroke(),t.globalCompositeOperation=Bt}t.setLineDash&&t.setLineDash([])}},We=function(){a&&s.drawNodeOverlay(t,e,d,o,u)},Le=function(){a&&s.drawNodeUnderlay(t,e,d,o,u)},ze=function(){s.drawElementText(t,e,null,n)},Ge=e.pstyle("ghost").value==="yes";if(Ge){var Fe=e.pstyle("ghost-offset-x").pfValue,he=e.pstyle("ghost-offset-y").pfValue,O=e.pstyle("ghost-opacity").value,Z=O*g;t.translate(Fe,he),Y(),He(),be(O*N),Je(),ut(Z,!0),ae(O*j),Ie(),at(L!==0||B!==0),ut(Z,!1),ke(Z),t.translate(-Fe,-he)}m&&t.translate(-d.x,-d.y),Le(),m&&t.translate(d.x,d.y),Y(),He(),be(),Je(),ut(g,!0),ae(),Ie(),at(L!==0||B!==0),ut(g,!1),ke(),m&&t.translate(-d.x,-d.y),ze(),We(),r&&t.translate(w.x1,w.y1)}};var Qc=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,n,a,i,s){var o=this;if(n.visible()){var u=n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-opacity")).value,f=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,g=n.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(a=a||n.position(),i==null||s==null){var m=n.padding();i=n.width()+2*m,s=n.height()+2*m}o.colorFillStyle(r,f[0],f[1],f[2],l),o.nodeShapes[d].draw(r,a.x,a.y,i+u*2,s+u*2,g),r.fill()}}}};Aa.drawNodeOverlay=Qc("overlay"),Aa.drawNodeUnderlay=Qc("underlay"),Aa.hasPie=function(t){return t=t[0],t._private.hasPie},Aa.drawPie=function(t,e,r,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),s=n.x,o=n.y,u=e.width(),l=e.height(),f=Math.min(u,l)/2,d=0,g=this.usePaths();g&&(s=0,o=0),i.units==="%"?f=f*i.pfValue:i.pfValue!==void 0&&(f=i.pfValue/2);for(var m=1;m<=a.pieBackgroundN;m++){var p=e.pstyle("pie-"+m+"-background-size").value,b=e.pstyle("pie-"+m+"-background-color").value,x=e.pstyle("pie-"+m+"-background-opacity").value*r,w=p/100;w+d>1&&(w=1-d);var E=1.5*Math.PI+2*Math.PI*d,C=2*Math.PI*w,k=E+C;p===0||d>=1||d+w>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,f,E,k),t.closePath(),this.colorFillStyle(t,b[0],b[1],b[2],x),t.fill(),d+=w)}};var or={},zb=100;or.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r},or.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===t){r=!1;break}return r&&(n={context:t},e.push(n)),n},or.createGradientStyleFor=function(t,e,r,n,a){var i,s=this.usePaths(),o=r.pstyle(e+"-gradient-stop-colors").value,u=r.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(r.isEdge()){var l=r.sourceEndpoint(),f=r.targetEndpoint(),d=r.midpoint(),g=Rn(l,d),m=Rn(f,d);i=t.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(g,m))}else{var p=s?{x:0,y:0}:r.position(),b=r.paddedWidth(),x=r.paddedHeight();i=t.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(b,x))}else if(r.isEdge()){var w=r.sourceEndpoint(),E=r.targetEndpoint();i=t.createLinearGradient(w.x,w.y,E.x,E.y)}else{var C=s?{x:0,y:0}:r.position(),k=r.paddedWidth(),R=r.paddedHeight(),A=k/2,h=R/2,I=r.pstyle("background-gradient-direction").value;switch(I){case"to-bottom":i=t.createLinearGradient(C.x,C.y-h,C.x,C.y+h);break;case"to-top":i=t.createLinearGradient(C.x,C.y+h,C.x,C.y-h);break;case"to-left":i=t.createLinearGradient(C.x+A,C.y,C.x-A,C.y);break;case"to-right":i=t.createLinearGradient(C.x-A,C.y,C.x+A,C.y);break;case"to-bottom-right":case"to-right-bottom":i=t.createLinearGradient(C.x-A,C.y-h,C.x+A,C.y+h);break;case"to-top-right":case"to-right-top":i=t.createLinearGradient(C.x-A,C.y+h,C.x+A,C.y-h);break;case"to-bottom-left":case"to-left-bottom":i=t.createLinearGradient(C.x+A,C.y-h,C.x-A,C.y+h);break;case"to-top-left":case"to-left-top":i=t.createLinearGradient(C.x+A,C.y+h,C.x-A,C.y-h);break}}if(!i)return null;for(var D=u.length===o.length,M=o.length,L=0;L<M;L++)i.addColorStop(D?u[L]:L/(M-1),"rgba("+o[L][0]+","+o[L][1]+","+o[L][2]+","+a+")");return i},or.gradientFillStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"background",e,r,n);if(!a)return null;t.fillStyle=a},or.colorFillStyle=function(t,e,r,n,a){t.fillStyle="rgba("+e+","+r+","+n+","+a+")"},or.eleFillStyle=function(t,e,r){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(t,e,n,r);else{var a=e.pstyle("background-color").value;this.colorFillStyle(t,a[0],a[1],a[2],r)}},or.gradientStrokeStyle=function(t,e,r,n){var a=this.createGradientStyleFor(t,"line",e,r,n);if(!a)return null;t.strokeStyle=a},or.colorStrokeStyle=function(t,e,r,n,a){t.strokeStyle="rgba("+e+","+r+","+n+","+a+")"},or.eleStrokeStyle=function(t,e,r){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(t,e,n,r);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(t,a[0],a[1],a[2],r)}},or.matchCanvasSize=function(t){var e=this,r=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],s=e.getPixelRatio(),o=e.motionBlurPxRatio;(t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||t===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=o);var u=a*s,l=i*s,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var d=r.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var g=0;g<e.CANVAS_LAYERS;g++)f=r.canvases[g],f.width=u,f.height=l,f.style.width=a+"px",f.style.height=i+"px";for(var g=0;g<e.BUFFER_COUNT;g++)f=r.bufferCanvases[g],f.width=u,f.height=l,f.style.width=a+"px",f.style.height=i+"px";e.textureMult=1,s<=1&&(f=r.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=s}},or.renderTo=function(t,e,r,n){this.render({forcedContext:t,forcedZoom:e,forcedPan:r,drawAllLayers:!0,forcedPxRatio:n})},or.clearCanvas=function(){var t=this,e=t.data;function r(n){n.clearRect(0,0,t.canvasWidth,t.canvasHeight)}r(e.contexts[t.NODE]),r(e.contexts[t.DRAG])},or.render=function(t){var e=this;t=t||Ol();var r=e.cy,n=t.forcedContext,a=t.drawAllLayers,i=t.drawOnlyNodeLayer,s=t.forcedZoom,o=t.forcedPan,u=t.forcedPxRatio===void 0?this.getPixelRatio():t.forcedPxRatio,l=e.data,f=l.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),g=t.motionBlur!==void 0?t.motionBlur:e.motionBlur,m=e.motionBlurPxRatio,p=r.hasCompoundNodes(),b=e.hoverData.draggingEles,x=!!(e.hoverData.selecting||e.touchData.selecting);g=g&&!n&&e.motionBlurEnabled&&!x;var w=g;n||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),g&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(w=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(f[e.NODE]=!0,f[e.SELECT_BOX]=!0);var E=r.style(),C=r.zoom(),k=s!==void 0?s:C,R=r.pan(),A={x:R.x,y:R.y},h={zoom:C,pan:{x:R.x,y:R.y}},I=e.prevViewport,D=I===void 0||h.zoom!==I.zoom||h.pan.x!==I.pan.x||h.pan.y!==I.pan.y;!D&&!(b&&!p)&&(e.motionBlurPxRatio=1),o&&(A=o),k*=u,A.x*=u,A.y*=u;var M=e.getCachedZSortedEles();function L(ae,Y,oe,ye,De){var Be=ae.globalCompositeOperation;ae.globalCompositeOperation="destination-out",e.colorFillStyle(ae,255,255,255,e.motionBlurTransparency),ae.fillRect(Y,oe,ye,De),ae.globalCompositeOperation=Be}function B(ae,Y){var oe,ye,De,Be;!e.clearingMotionBlur&&(ae===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||ae===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(oe={x:R.x*m,y:R.y*m},ye=C*m,De=e.canvasWidth*m,Be=e.canvasHeight*m):(oe=A,ye=k,De=e.canvasWidth,Be=e.canvasHeight),ae.setTransform(1,0,0,1,0,0),Y==="motionBlur"?L(ae,0,0,De,Be):!n&&(Y===void 0||Y)&&ae.clearRect(0,0,De,Be),a||(ae.translate(oe.x,oe.y),ae.scale(ye,ye)),o&&ae.translate(o.x,o.y),s&&ae.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=r.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var N=e.data.bufferContexts[e.TEXTURE_BUFFER];N.setTransform(1,0,0,1,0,0),N.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:N,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var h=e.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:e.canvasWidth,height:e.canvasHeight};h.mpan={x:(0-h.pan.x)/h.zoom,y:(0-h.pan.y)/h.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var _=l.contexts[e.NODE],U=e.textureCache.texture,h=e.textureCache.viewport;_.setTransform(1,0,0,1,0,0),g?L(_,0,0,h.width,h.height):_.clearRect(0,0,h.width,h.height);var H=E.core("outside-texture-bg-color").value,W=E.core("outside-texture-bg-opacity").value;e.colorFillStyle(_,H[0],H[1],H[2],W),_.fillRect(0,0,h.width,h.height);var C=r.zoom();B(_,!1),_.clearRect(h.mpan.x,h.mpan.y,h.width/h.zoom/u,h.height/h.zoom/u),_.drawImage(U,h.mpan.x,h.mpan.y,h.width/h.zoom/u,h.height/h.zoom/u)}else e.textureOnViewport&&!n&&(e.textureCache=null);var X=r.extent(),Q=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),se=e.hideEdgesOnViewport&&Q,j=[];if(j[e.NODE]=!f[e.NODE]&&g&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,j[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),j[e.DRAG]=!f[e.DRAG]&&g&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,j[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||a||i||j[e.NODE]){var ee=g&&!j[e.NODE]&&m!==1,_=n||(ee?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),de=g&&!ee?"motionBlur":void 0;B(_,de),se?e.drawCachedNodes(_,M.nondrag,u,X):e.drawLayeredElements(_,M.nondrag,u,X),e.debug&&e.drawDebugPoints(_,M.nondrag),!a&&!g&&(f[e.NODE]=!1)}if(!i&&(f[e.DRAG]||a||j[e.DRAG])){var ee=g&&!j[e.DRAG]&&m!==1,_=n||(ee?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);B(_,g&&!ee?"motionBlur":void 0),se?e.drawCachedNodes(_,M.drag,u,X):e.drawCachedElements(_,M.drag,u,X),e.debug&&e.drawDebugPoints(_,M.drag),!a&&!g&&(f[e.DRAG]=!1)}if(this.drawSelectionRectangle(t,B),g&&m!==1){var ge=l.contexts[e.NODE],me=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],pe=l.contexts[e.DRAG],we=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],be=function(Y,oe,ye){Y.setTransform(1,0,0,1,0,0),ye||!w?Y.clearRect(0,0,e.canvasWidth,e.canvasHeight):L(Y,0,0,e.canvasWidth,e.canvasHeight);var De=m;Y.drawImage(oe,0,0,e.canvasWidth*De,e.canvasHeight*De,0,0,e.canvasWidth,e.canvasHeight)};(f[e.NODE]||j[e.NODE])&&(be(ge,me,j[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||j[e.DRAG])&&(be(pe,we,j[e.DRAG]),f[e.DRAG]=!1)}e.prevViewport=h,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),g&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},zb)),n||r.emit("render")};var bi;or.drawSelectionRectangle=function(t,e){var r=this,n=r.cy,a=r.data,i=n.style(),s=t.drawOnlyNodeLayer,o=t.drawAllLayers,u=a.canvasNeedsRedraw,l=t.forcedContext;if(r.showFps||!s&&u[r.SELECT_BOX]&&!o){var f=l||a.contexts[r.SELECT_BOX];if(e(f),r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var d=r.cy.zoom(),g=i.core("selection-box-border-width").value/d;f.lineWidth=g,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]),g>0&&(f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]))}if(a.bgActivePosistion&&!r.hoverData.selecting){var d=r.cy.zoom(),m=a.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(m.x,m.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),f.fill()}var p=r.lastRedrawTime;if(r.showFps&&p){p=Math.round(p);var b=Math.round(1e3/p),x="1 frame = "+p+" ms = "+b+" fps";if(f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",!bi){var w=f.measureText(x);bi=w.actualBoundingBoxAscent}f.fillText(x,0,bi);var E=60;f.strokeRect(0,bi+10,250,20),f.fillRect(0,bi+10,250*Math.min(b/E,1),20)}o||(u[r.SELECT_BOX]=!1)}};function Jc(t,e,r){var n=t.createShader(e);if(t.shaderSource(n,r),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(n));return n}function Vb(t,e,r){var n=Jc(t,t.VERTEX_SHADER,e),a=Jc(t,t.FRAGMENT_SHADER,r),i=t.createProgram();if(t.attachShader(i,n),t.attachShader(i,a),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))throw new Error("Could not initialize shaders");return i}function $b(t,e,r){r===void 0&&(r=e);var n=t.makeOffscreenCanvas(e,r),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function uu(t){var e=t.pixelRatio,r=t.cy.zoom(),n=t.cy.pan();return{zoom:r*e,pan:{x:n.x*e,y:n.y*e}}}function lu(t,e,r,n,a){var i=n*r+e.x,s=a*r+e.y;return s=Math.round(t.canvasHeight-s),[i,s]}function $s(t,e,r){var n=t[0]/255,a=t[1]/255,i=t[2]/255,s=e,o=r||new Array(4);return o[0]=n*s,o[1]=a*s,o[2]=i*s,o[3]=s,o}function qs(t,e){var r=e||new Array(4);return r[0]=(t>>0&255)/255,r[1]=(t>>8&255)/255,r[2]=(t>>16&255)/255,r[3]=(t>>24&255)/255,r}function qb(t){return t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24)}function Hb(t,e){var r=t.createTexture();return r.buffer=function(n){t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_NEAREST),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)},r.deleteTexture=function(){t.deleteTexture(r)},r}function jc(t,e){switch(e){case"float":return[1,t.FLOAT,4];case"vec2":return[2,t.FLOAT,4];case"vec3":return[3,t.FLOAT,4];case"vec4":return[4,t.FLOAT,4];case"int":return[1,t.INT,4];case"ivec2":return[2,t.INT,4]}}function ed(t,e,r){switch(e){case t.FLOAT:return new Float32Array(r);case t.INT:return new Int32Array(r)}}function Wb(t,e,r,n,a,i){switch(e){case t.FLOAT:return new Float32Array(r.buffer,i*n,a);case t.INT:return new Int32Array(r.buffer,i*n,a)}}function Ub(t,e,r,n){var a=jc(t,e),i=At(a,2),s=i[0],o=i[1],u=ed(t,o,n),l=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,u,t.STATIC_DRAW),o===t.FLOAT?t.vertexAttribPointer(r,s,o,!1,0,0):o===t.INT&&t.vertexAttribIPointer(r,s,o,0,0),t.enableVertexAttribArray(r),t.bindBuffer(t.ARRAY_BUFFER,null),l}function xr(t,e,r,n){var a=jc(t,r),i=At(a,3),s=i[0],o=i[1],u=i[2],l=ed(t,o,e*s),f=s*u,d=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,d),t.bufferData(t.ARRAY_BUFFER,e*f,t.DYNAMIC_DRAW),t.enableVertexAttribArray(n),o===t.FLOAT?t.vertexAttribPointer(n,s,o,!1,f,0):o===t.INT&&t.vertexAttribIPointer(n,s,o,f,0),t.vertexAttribDivisor(n,1),t.bindBuffer(t.ARRAY_BUFFER,null);for(var g=new Array(e),m=0;m<e;m++)g[m]=Wb(t,o,l,f,s,m);return d.dataArray=l,d.stride=f,d.size=s,d.getView=function(p){return g[p]},d.setPoint=function(p,b,x){var w=g[p];w[0]=b,w[1]=x},d.bufferSubData=function(p){t.bindBuffer(t.ARRAY_BUFFER,d),p?t.bufferSubData(t.ARRAY_BUFFER,0,l,0,p*s):t.bufferSubData(t.ARRAY_BUFFER,0,l)},d}function Gb(t){var e=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0),t.bindFramebuffer(t.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,n,a,0,t.RGBA,t.UNSIGNED_BYTE,null)},e}var td=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});function xi(){var t=new td(9);return td!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function rd(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Kb(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],u=e[5],l=e[6],f=e[7],d=e[8],g=r[0],m=r[1],p=r[2],b=r[3],x=r[4],w=r[5],E=r[6],C=r[7],k=r[8];return t[0]=g*n+m*s+p*l,t[1]=g*a+m*o+p*f,t[2]=g*i+m*u+p*d,t[3]=b*n+x*s+w*l,t[4]=b*a+x*o+w*f,t[5]=b*i+x*u+w*d,t[6]=E*n+C*s+k*l,t[7]=E*a+C*o+k*f,t[8]=E*i+C*u+k*d,t}function Hs(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],u=e[5],l=e[6],f=e[7],d=e[8],g=r[0],m=r[1];return t[0]=n,t[1]=a,t[2]=i,t[3]=s,t[4]=o,t[5]=u,t[6]=g*n+m*s+l,t[7]=g*a+m*o+f,t[8]=g*i+m*u+d,t}function nd(t,e,r){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],u=e[5],l=e[6],f=e[7],d=e[8],g=Math.sin(r),m=Math.cos(r);return t[0]=m*n+g*s,t[1]=m*a+g*o,t[2]=m*i+g*u,t[3]=m*s-g*n,t[4]=m*o-g*a,t[5]=m*u-g*i,t[6]=l,t[7]=f,t[8]=d,t}function fu(t,e,r){var n=r[0],a=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=a*e[3],t[4]=a*e[4],t[5]=a*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Xb(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}var Fi={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},Ei=_t({getKey:null,drawElement:null,getBoundingBox:null,getRotation:null,getRotationPoint:null,getRotationOffset:null,isVisible:null,getPadding:null}),Yb=function(){function t(e,r){ln(this,t),this.debugID=Math.floor(Math.random()*1e4),this.r=e,this.atlasSize=r.webglTexSize,this.rows=r.webglTexRows,this.enableWrapping=r.enableWrapping,this.texHeight=Math.floor(this.atlasSize/this.rows),this.maxTexWidth=this.atlasSize,this.texture=null,this.canvas=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=r.createTextureCanvas(e,this.atlasSize,this.atlasSize),this.scratch=r.createTextureCanvas(e,this.atlasSize,this.texHeight,"scratch")}return fn(t,[{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(r){var n=r.w,a=r.h,i=this.texHeight,s=this.maxTexWidth,o=i/a,u=n*o,l=a*o;return u>s&&(o=s/n,u=n*o,l=a*o),{scale:o,texW:u,texH:l}}},{key:"draw",value:function(r,n,a){var i=this,s=this.atlasSize,o=this.rows,u=this.texHeight,l=this.getScale(n),f=l.scale,d=l.texW,g=l.texH,m=[null,null],p=function(C,k){if(a&&k){var R=k.context,A=C.x,h=C.row,I=A,D=u*h;R.save(),R.translate(I,D),R.scale(f,f),a(R,n),R.restore()}},b=function(){p(i.freePointer,i.canvas),m[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:d,h:g},m[1]={x:i.freePointer.x+d,y:i.freePointer.row*u,w:0,h:g},i.freePointer.x+=d,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},x=function(){var C=i.scratch,k=i.canvas;C.clear(),p({x:0,row:0},C);var R=s-i.freePointer.x,A=d-R,h=u;{var I=i.freePointer.x,D=i.freePointer.row*u,M=R;k.context.drawImage(C,0,0,M,h,I,D,M,h),m[0]={x:I,y:D,w:M,h:g}}{var L=R,B=(i.freePointer.row+1)*u,N=A;k&&k.context.drawImage(C,L,0,N,h,0,B,N,h),m[1]={x:0,y:B,w:N,h:g}}i.freePointer.x=A,i.freePointer.row++},w=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=s)b();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(w(),b()):this.enableWrapping?x():(w(),b())}return this.keyToLocation.set(r,m),this.needsBuffer=!0,m}},{key:"getOffsets",value:function(r){return this.keyToLocation.get(r)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(r){var n=this.atlasSize,a=this.rows,i=this.getScale(r),s=i.texW;return this.freePointer.x+s>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(r){this.texture||(this.texture=Hb(r,this.debugID)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1)}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null,this.needsBuffer=!0)}}]),t}(),Zb=function(){function t(e,r){ln(this,t),this.r=e,this.opts=r,this.keyToIds=new Map,this.idToKey=new Map,this.atlases=[],this.styleKeyToAtlas=new Map,this.styleKeyNeedsRedraw=new Set,this.forceGC=!1}return fn(t,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"getIdsFor",value:function(r){var n=this.keyToIds.get(r);return n||(n=new Set,this.keyToIds.set(r,n)),n}},{key:"_createAtlas",value:function(){var r=this.r,n=this.opts;return new Yb(r,n)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var r=this.r,n=this.opts,a=n.webglTexSize,i=Math.floor(a/n.webglTexRows);this.scratch=n.createTextureCanvas(r,a,i,"scratch")}return this.scratch}},{key:"draw",value:function(r,n,a,i){if(this.styleKeyNeedsRedraw.has(n)){this.styleKeyNeedsRedraw.delete(n),this.deleteKey(r,n);var s=this.styleKeyToAtlas.get(n);s&&(s.forceGC=!0),this.styleKeyToAtlas.delete(n)}var o=this.styleKeyToAtlas.get(n);return o||(o=this.atlases[this.atlases.length-1],(!o||!o.canFit(a))&&(o=this._createAtlas(),this.atlases.push(o)),o.draw(n,a,i),this.styleKeyToAtlas.set(n,o),this.getIdsFor(n).add(r),this.idToKey.set(r,n)),o}},{key:"getAtlas",value:function(r){return this.styleKeyToAtlas.get(r)}},{key:"hasAtlas",value:function(r){return this.styleKeyToAtlas.has(r)}},{key:"deleteKey",value:function(r,n){this.idToKey.delete(r),this.getIdsFor(n).delete(r)}},{key:"checkKeyIsInvalid",value:function(r,n){if(!this.idToKey.has(r))return!1;var a=this.idToKey.get(r);return a!=n?(this.deleteKey(r,a),!0):!1}},{key:"_getKeysToCollect",value:function(){var r=new Set,n=wr(this.styleKeyToAtlas.keys()),a;try{for(n.s();!(a=n.n()).done;){var i=a.value;this.getIdsFor(i).size==0&&r.add(i)}}catch(s){n.e(s)}finally{n.f()}return r}},{key:"gc",value:function(){var r=this,n=this.atlases.some(function(g){return g.forceGC}),a=this._getKeysToCollect();if(a.size===0&&!n){console.log("nothing to garbage collect");return}var i=[],s=new Map,o=null,u=wr(this.atlases),l;try{var f=function(){var m=l.value,p=m.getKeys(),b=Qb(a,p);if(b.size===0&&!m.forceGC)return i.push(m),p.forEach(function(h){return s.set(h,m)}),"continue";o||(o=r._createAtlas(),i.push(o));var x=wr(p),w;try{for(x.s();!(w=x.n()).done;){var E=w.value;if(!b.has(E)){var C=m.getOffsets(E),k=At(C,2),R=k[0],A=k[1];o.canFit({w:R.w+A.w,h:R.h})||(o=r._createAtlas(),i.push(o)),r._copyTextureToNewAtlas(E,m,o),s.set(E,o)}}}catch(h){x.e(h)}finally{x.f()}};for(u.s();!(l=u.n()).done;)var d=f()}catch(g){u.e(g)}finally{u.f()}this.atlases=i,this.styleKeyToAtlas=s}},{key:"_copyTextureToNewAtlas",value:function(r,n,a){var i=n.getOffsets(r),s=At(i,2),o=s[0],u=s[1];if(u.w===0)a.draw(r,o,function(g){g.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),l.context.drawImage(n.canvas,u.x,u.y,u.w,u.h,o.w,0,u.w,u.h);var f=o.w+u.w,d=o.h;a.draw(r,{w:f,h:d},function(g){g.drawImage(l,0,0,f,d,0,0,f,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}]),t}();function Qb(t,e){return t.intersection?t.intersection(e):new Set(cl(t).filter(function(r){return e.has(r)}))}var Jb=function(){function t(e,r){ln(this,t),this.r=e;var n=r;this.globalOptions=n,this.maxAtlases=n.webglTexPerBatch,this.atlasSize=n.webglTexSize,this.renderTypes=new Map,this.maxAtlasesPerBatch=r.webglTexPerBatch,this.batchAtlases=[],this._cacheScratchCanvas(n)}return fn(t,[{key:"_cacheScratchCanvas",value:function(r){var n=-1,a=-1,i=null,s=r.createTextureCanvas;r.createTextureCanvas=function(o,u,l,f){return f?((!i||u!=n||l!=a)&&(n=u,a=l,i=s(o,u,l)),i):s(o,u,l)}}},{key:"addRenderType",value:function(r,n){var a=new Zb(this.r,this.globalOptions),i=n;this.renderTypes.set(r,Ve({type:r,atlasCollection:a},i))}},{key:"getRenderTypes",value:function(){return cl(this.renderTypes.values())}},{key:"getRenderTypeOpts",value:function(r){return this.renderTypes.get(r)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.forceRedraw,i=a===void 0?!1:a,s=n.filterEle,o=s===void 0?function(){return!0}:s,u=n.filterType,l=u===void 0?function(){return!0}:u,f=!1,d=wr(r),g;try{for(d.s();!(g=d.n()).done;){var m=g.value;if(o(m)){var p=m.id(),b=wr(this.getRenderTypes()),x;try{for(b.s();!(x=b.n()).done;){var w=x.value;if(l(w.type)){var E=w.getKey(m);i?(w.atlasCollection.deleteKey(p,E),w.atlasCollection.styleKeyNeedsRedraw.add(E),f=!0):f|=w.atlasCollection.checkKeyIsInvalid(p,E)}}}catch(C){b.e(C)}finally{b.f()}}}}catch(C){d.e(C)}finally{d.f()}return f}},{key:"gc",value:function(){var r=wr(this.getRenderTypes()),n;try{for(r.s();!(n=r.n()).done;){var a=n.value;a.atlasCollection.gc()}}catch(i){r.e(i)}finally{r.f()}}},{key:"isRenderable",value:function(r,n){var a=this.getRenderTypeOpts(n);return a&&a.isVisible(r)}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"getOrCreateAtlas",value:function(r,n,a){var i=this.renderTypes.get(a),s=i.getKey(r),o=r.id();return i.atlasCollection.draw(o,s,n,function(u){i.drawElement(u,r,n,!0,!0)})}},{key:"getAtlasIndexForBatch",value:function(r){var n=this.batchAtlases.indexOf(r);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)return;this.batchAtlases.push(r),n=this.batchAtlases.length-1}return n}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlases},function(r,n){return n})}},{key:"getAtlasInfo",value:function(r,n){var a=this.renderTypes.get(n),i=a.getBoundingBox(r),s=this.getOrCreateAtlas(r,i,n),o=this.getAtlasIndexForBatch(s);if(o!==void 0){var u=a.getKey(r),l=s.getOffsets(u),f=At(l,2),d=f[0],g=f[1];return{atlasID:o,tex:d,tex1:d,tex2:g,bb:i,type:n,styleKey:u}}}},{key:"canAddToCurrentBatch",value:function(r,n){if(this.batchAtlases.length===this.maxAtlasesPerBatch){var a=this.renderTypes.get(n),i=a.getKey(r),s=a.atlasCollection.getAtlas(i);return s&&this.batchAtlases.includes(s)}return!0}},{key:"setTransformMatrix",value:function(r,n,a){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,s=n.bb,o=n.type,u=n.tex1,l=n.tex2,f=this.getRenderTypeOpts(o),d=f.getPadding?f.getPadding(a):0,g=u.w/(u.w+l.w);i||(g=1-g);var m=this.getAdjustedBB(s,d,i,g),p,b;rd(r);var x=f.getRotation?f.getRotation(a):0;if(x!==0){var w=f.getRotationPoint(a),E=w.x,C=w.y;Hs(r,r,[E,C]),nd(r,r,x);var k=f.getRotationOffset(a);p=k.x+m.xOffset,b=k.y}else p=m.x1,b=m.y1;Hs(r,r,[p,b]),fu(r,r,[m.w,m.h])}},{key:"getTransformMatrix",value:function(r,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=xi();return this.setTransformMatrix(i,r,n,a),i}},{key:"getAdjustedBB",value:function(r,n,a,i){var s=r.x1,o=r.y1,u=r.w,l=r.h;n&&(s-=n,o-=n,u+=2*n,l+=2*n);var f=0,d=u*i;return a&&i<1?u=d:!a&&i<1&&(f=u-d,s+=f,u=d),{x1:s,y1:o,w:u,h:l,xOffset:f}}},{key:"getDebugInfo",value:function(){var r=[],n=wr(this.renderTypes),a;try{for(n.s();!(a=n.n()).done;){var i=At(a.value,2),s=i[0],o=i[1],u=o.atlasCollection.getCounts(),l=u.keyCount,f=u.atlasCount;r.push({type:s,keyCount:l,atlasCount:f})}}catch(d){n.e(d)}finally{n.f()}return r}}]),t}(),cu=0,ad=1,id=2,du=3,jb=function(){function t(e,r,n){ln(this,t),this.r=e,this.gl=r,this.maxInstances=n.webglBatchSize,this.maxAtlases=n.webglTexPerBatch,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,n.enableWrapping=!0,n.createTextureCanvas=$b,this.atlasManager=new Jb(e,n),this.program=this.createShaderProgram(Fi.SCREEN),this.pickingProgram=this.createShaderProgram(Fi.PICKING),this.vao=this.createVAO(),this.debugInfo=[]}return fn(t,[{key:"addTextureRenderType",value:function(r,n){this.atlasManager.addRenderType(r,n)}},{key:"invalidate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.type,i=this.atlasManager;return a?i.invalidate(r,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(r)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"createShaderProgram",value:function(r){var n=this.gl,a=`#version 300 es
      precision highp float;

      uniform mat3 uPanZoomMatrix;
      uniform int  uAtlasSize;
      
      // instanced
      in vec2 aPosition; 

      // what are we rendering?
      in int aVertType;

      // for picking
      in vec4 aIndex;
      
      // For textures
      in int aAtlasId; // which shader unit/atlas to use
      in vec4 aTex1; // x/y/w/h of texture in atlas
      in vec4 aTex2; 

      // for any transforms that are needed
      in vec4 aScaleRotate1;  // vectors use fewer attributes than matrices
      in vec2 aTranslate1;
      in vec4 aScaleRotate2;
      in vec2 aTranslate2;

      // for edges
      in vec4 aPointAPointB;
      in vec4 aPointCPointD;
      in float aLineWidth;
      in vec4 aEdgeColor;

      out vec2 vTexCoord;
      out vec4 vEdgeColor;
      flat out int vAtlasId;
      flat out vec4 vIndex;
      flat out int vVertType;

      void main(void) {
        int vid = gl_VertexID;
        vec2 position = aPosition;

        if(aVertType == `.concat(cu,`) {
          float texX;
          float texY;
          float texW;
          float texH;
          mat3  texMatrix;

          int vid = gl_VertexID;
          if(vid <= 5) {
            texX = aTex1.x;
            texY = aTex1.y;
            texW = aTex1.z;
            texH = aTex1.w;
            texMatrix = mat3(
              vec3(aScaleRotate1.xy, 0.0),
              vec3(aScaleRotate2.zw, 0.0),
              vec3(aTranslate1,      1.0)
            );
          } else {
            texX = aTex2.x;
            texY = aTex2.y;
            texW = aTex2.z;
            texH = aTex2.w;
            texMatrix = mat3(
              vec3(aScaleRotate2.xy, 0.0),
              vec3(aScaleRotate2.zw, 0.0),
              vec3(aTranslate2,      1.0)
            );
          }

          if(vid == 1 || vid == 2 || vid == 4 || vid == 7 || vid == 8 || vid == 10) {
            texX += texW;
          }
          if(vid == 2 || vid == 4 || vid == 5 || vid == 8 || vid == 10 || vid == 11) {
            texY += texH;
          }

          float d = float(uAtlasSize);
          vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1

          gl_Position = vec4(uPanZoomMatrix * texMatrix * vec3(position, 1.0), 1.0);
        } 
        else if(aVertType == `).concat(ad,` && vid < 6) {
          vec2 source = aPointAPointB.xy;
          vec2 target = aPointAPointB.zw;

          // adjust the geometry so that the line is centered on the edge
          position.y = position.y - 0.5;

          vec2 xBasis = target - source;
          vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));
          vec2 point = source + xBasis * position.x + yBasis * aLineWidth * position.y;

          gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
          vEdgeColor = aEdgeColor;
        } 
        else if(aVertType == `).concat(id,` && vid < 6) {
          vec2 pointA = aPointAPointB.xy;
          vec2 pointB = aPointAPointB.zw;
          vec2 pointC = aPointCPointD.xy;
          vec2 pointD = aPointCPointD.zw;

          // adjust the geometry so that the line is centered on the edge
          position.y = position.y - 0.5;

          vec2 p0 = pointA;
          vec2 p1 = pointB;
          vec2 p2 = pointC;
          vec2 pos = position;
          if(position.x == 1.0) {
            p0 = pointD;
            p1 = pointC;
            p2 = pointB;
            pos = vec2(0.0, -position.y);
          }

          vec2 p01 = p1 - p0;
          vec2 p12 = p2 - p1;
          vec2 p21 = p1 - p2;

          // Find the normal vector.
          vec2 tangent = normalize(normalize(p12) + normalize(p01));
          vec2 normal = vec2(-tangent.y, tangent.x);

          // Find the vector perpendicular to p0 -> p1.
          vec2 p01Norm = normalize(vec2(-p01.y, p01.x));

          // Determine the bend direction.
          float sigma = sign(dot(p01 + p21, normal));
          float width = aLineWidth;

          if(sign(pos.y) == -sigma) {
            // This is an intersecting vertex. Adjust the position so that there's no overlap.
            vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);
            gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
          } else {
            // This is a non-intersecting vertex. Treat it like a mitre join.
            vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);
            gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);
          }

          vEdgeColor = aEdgeColor;
        } 
        else if(aVertType == `).concat(du,` && vid < 3) {
          // massage the first triangle into an edge arrow
          if(vid == 0)
            position = vec2(-0.15, -0.3);
          if(vid == 1)
            position = vec2( 0.0,   0.0);
          if(vid == 2)
            position = vec2( 0.15, -0.3);

          mat3 transform = mat3(
            vec3(aScaleRotate1.xy, 0.0),
            vec3(aScaleRotate1.zw, 0.0),
            vec3(aTranslate1,      1.0)
          );
          gl_Position = vec4(uPanZoomMatrix * transform * vec3(position, 1.0), 1.0);
          vEdgeColor = aEdgeColor;
        } else {
          gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space
        }

        vAtlasId = aAtlasId;
        vIndex = aIndex;
        vVertType = aVertType;
      }
    `),i=this.atlasManager.getIndexArray(),s=`#version 300 es
      precision highp float;

      // define texture unit for each node in the batch
      `.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(`
	`),`

      uniform vec4 uBGColor;

      in vec2 vTexCoord;
      in vec4 vEdgeColor;
      flat in int vAtlasId;
      flat in vec4 vIndex;
      flat in int vVertType;

      out vec4 outColor;

      void main(void) {
        if(vVertType == `).concat(cu,`) {
          `).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(`
	else `),`
        } else if(vVertType == `).concat(du,`) {
          // blend arrow color with background (using premultiplied alpha)
          outColor.rgb = vEdgeColor.rgb + (uBGColor.rgb * (1.0 - vEdgeColor.a)); 
          outColor.a = 1.0; // make opaque, masks out line under arrow
        } else {
          outColor = vEdgeColor;
        }

        `).concat(r.picking?`if(outColor.a == 0.0) discard;
             else outColor = vIndex;`:"",`
      }
    `),o=Vb(n,a,s);o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex1=n.getAttribLocation(o,"aTex1"),o.aTex2=n.getAttribLocation(o,"aTex2"),o.aScaleRotate1=n.getAttribLocation(o,"aScaleRotate1"),o.aTranslate1=n.getAttribLocation(o,"aTranslate1"),o.aScaleRotate2=n.getAttribLocation(o,"aScaleRotate2"),o.aTranslate2=n.getAttribLocation(o,"aTranslate2"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aEdgeColor=n.getAttribLocation(o,"aEdgeColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uTextures=[];for(var u=0;u<this.atlasManager.maxAtlases;u++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(u)));return o}},{key:"createVAO",value:function(){var r=[0,0,1,0,1,1,0,0,1,1,0,1],n=[].concat(r,r);this.vertexCount=n.length/2;var a=this.maxInstances,i=this.gl,s=this.program,o=i.createVertexArray();return i.bindVertexArray(o),Ub(i,"vec2",s.aPosition,n),this.indexBuffer=xr(i,a,"vec4",s.aIndex),this.vertTypeBuffer=xr(i,a,"int",s.aVertType),this.atlasIdBuffer=xr(i,a,"int",s.aAtlasId),this.tex1Buffer=xr(i,a,"vec4",s.aTex1),this.tex2Buffer=xr(i,a,"vec4",s.aTex2),this.scaleRotate1Buffer=xr(i,a,"vec4",s.aScaleRotate1),this.translate1Buffer=xr(i,a,"vec2",s.aTranslate1),this.scaleRotate2Buffer=xr(i,a,"vec4",s.aScaleRotate2),this.translate2Buffer=xr(i,a,"vec2",s.aTranslate2),this.pointAPointBBuffer=xr(i,a,"vec4",s.aPointAPointB),this.pointCPointDBuffer=xr(i,a,"vec4",s.aPointCPointD),this.lineWidthBuffer=xr(i,a,"float",s.aLineWidth),this.edgeColorBuffer=xr(i,a,"vec4",s.aEdgeColor),i.bindVertexArray(null),o}},{key:"buffers",get:function(){var r=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return n.endsWith("Buffer")}).map(function(n){return r[n]})),this._buffers}},{key:"startFrame",value:function(r,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fi.SCREEN;this.panZoomMatrix=r,this.debugInfo=n,this.renderTarget=a,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.atlasManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"getTempMatrix",value:function(){return this.tempMatrix=this.tempMatrix||xi()}},{key:"drawTexture",value:function(r,n,a){var i=this.atlasManager;if(i.isRenderable(r,a)){i.canAddToCurrentBatch(r,a)||this.endBatch();var s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=cu;var o=this.indexBuffer.getView(s);qs(n,o);var u=i.getAtlasInfo(r,a,u),l=u.atlasID,f=u.tex1,d=u.tex2,g=this.atlasIdBuffer.getView(s);g[0]=l;var m=this.tex1Buffer.getView(s);m[0]=f.x,m[1]=f.y,m[2]=f.w,m[3]=f.h;var p=this.tex2Buffer.getView(s);p[0]=d.x,p[1]=d.y,p[2]=d.w,p[3]=d.h;for(var b=this.getTempMatrix(),x=0,w=[1,2];x<w.length;x++){var E=w[x];i.setTransformMatrix(b,u,r,E===1);var C=this["scaleRotate".concat(E,"Buffer")].getView(s);C[0]=b[0],C[1]=b[1],C[2]=b[3],C[3]=b[4];var k=this["translate".concat(E,"Buffer")].getView(s);k[0]=b[6],k[1]=b[7]}this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"drawEdgeArrow",value:function(r,n,a){var i=r._private.rscratch,s,o,u;if(a==="source"?(s=i.arrowStartX,o=i.arrowStartY,u=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(s)||s==null||isNaN(o)||o==null||isNaN(u)||u==null)){var l=r.pstyle(a+"-arrow-shape").value;if(l!=="none"){var f=r.pstyle(a+"-arrow-color").value,d=r.pstyle("opacity").value,g=r.pstyle("line-opacity").value,m=d*g,p=r.pstyle("width").pfValue,b=r.pstyle("arrow-scale").value,x=this.r.getArrowWidth(p,b),w=this.getTempMatrix();rd(w),Hs(w,w,[s,o]),fu(w,w,[x,x]),nd(w,w,u);var E=this.instanceCount;this.vertTypeBuffer.getView(E)[0]=du;var C=this.indexBuffer.getView(E);qs(n,C);var k=this.edgeColorBuffer.getView(E);$s(f,m,k);var R=this.scaleRotate1Buffer.getView(E);R[0]=w[0],R[1]=w[1],R[2]=w[3],R[3]=w[4];var A=this.translate1Buffer.getView(E);A[0]=w[6],A[1]=w[7],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(r,n){var a=r.pstyle("opacity").value,i=r.pstyle("line-opacity").value,s=r.pstyle("width").pfValue,o=r.pstyle("line-color").value,u=a*i,l=this.getEdgePoints(r);if(l.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),l.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=ad;var d=this.indexBuffer.getView(f);qs(n,d);var g=this.edgeColorBuffer.getView(f);$s(o,u,g);var m=this.lineWidthBuffer.getView(f);m[0]=s;var p=this.pointAPointBBuffer.getView(f);p[0]=l[0],p[1]=l[1],p[2]=l[2],p[3]=l[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var b=0;b<l.length-2;b+=2){var x=this.instanceCount;this.vertTypeBuffer.getView(x)[0]=id;var w=this.indexBuffer.getView(x);qs(n,w);var E=this.edgeColorBuffer.getView(x);$s(o,u,E);var C=this.lineWidthBuffer.getView(x);C[0]=s;var k=l[b-2],R=l[b-1],A=l[b],h=l[b+1],I=l[b+2],D=l[b+3],M=l[b+4],L=l[b+5];b==0&&(k=2*A-I+.001,R=2*h-D+.001),b==l.length-4&&(M=2*I-A+.001,L=2*D-h+.001);var B=this.pointAPointBBuffer.getView(x);B[0]=k,B[1]=R,B[2]=A,B[3]=h;var N=this.pointCPointDBuffer.getView(x);N[0]=I,N[1]=D,N[2]=M,N[3]=L,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"getEdgePoints",value:function(r){var n=r._private.rscratch,a=n.allpts;if(a.length==4)return a;var i=this.getNumSegments(r);return this.getCurveSegmentPoints(a,i)}},{key:"getNumSegments",value:function(r){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"getCurveSegmentPoints",value:function(r,n){if(r.length==4)return r;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=r[0],a[1]=r[1];else if(i==n)a[i*2]=r[r.length-2],a[i*2+1]=r[r.length-1];else{var s=i/n;this.setCurvePoint(r,s,a,i*2)}return a}},{key:"setCurvePoint",value:function(r,n,a,i){if(r.length<=2)a[i]=r[0],a[i+1]=r[1];else{for(var s=Array(r.length-2),o=0;o<s.length;o+=2){var u=(1-n)*r[o]+n*r[o+2],l=(1-n)*r[o+1]+n*r[o+3];s[o]=u,s[o+1]=l}return this.setCurvePoint(s,n,a,i)}}},{key:"endBatch",value:function(){var r=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var s=this.renderTarget.picking?this.pickingProgram:this.program;r.useProgram(s),r.bindVertexArray(n);var o=wr(this.buffers),u;try{for(o.s();!(u=o.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(p){o.e(p)}finally{o.f()}for(var f=this.atlasManager.getAtlases(),d=0;d<f.length;d++)f[d].bufferIfNeeded(r);for(var g=0;g<f.length;g++)r.activeTexture(r.TEXTURE0+g),r.bindTexture(r.TEXTURE_2D,f[g].texture),r.uniform1i(s.uTextures[g],g);r.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),r.uniform1i(s.uAtlasSize,this.atlasManager.atlasSize);var m=$s(this.bgColor,1);r.uniform4fv(s.uBGColor,m),r.drawArraysInstanced(r.TRIANGLES,0,a,i),r.bindVertexArray(null),r.bindTexture(r.TEXTURE_2D,null),this.debugInfo&&this.debugInfo.push({count:i,atlasCount:f.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){return this.debugInfo}},{key:"getAtlasDebugInfo",value:function(){return this.atlasManager.getDebugInfo()}}]),t}();function sd(t,e){return"rgba(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(e,")")}var e2=function(){function t(e){ln(this,t),this.r=e}return fn(t,[{key:"getStyleKey",value:function(r,n){var a=this.getStyle(r,n),i=a.shape,s=a.opacity,o=a.color;if(!i)return null;var u=n.width(),l=n.height(),f=sd(o,s);return vn("".concat(i,"-").concat(u,"-").concat(l,"-").concat(f))}},{key:"isVisible",value:function(r,n){var a=n.pstyle("".concat(r,"-opacity")).value;return a>0}},{key:"getStyle",value:function(r,n){var a=n.pstyle("".concat(r,"-opacity")).value,i=n.pstyle("".concat(r,"-color")).value,s=n.pstyle("".concat(r,"-shape")).value;return{opacity:a,color:i,shape:s}}},{key:"getPadding",value:function(r,n){return n.pstyle("".concat(r,"-padding")).pfValue}},{key:"draw",value:function(r,n,a,i){if(this.isVisible(r,a)){var s=this.r,o=i.w,u=i.h,l=o/2,f=u/2,d=this.getStyle(r,a),g=d.shape,m=d.color,p=d.opacity;n.save(),n.fillStyle=sd(m,p),g==="round-rectangle"||g==="roundrectangle"?s.drawRoundRectanglePath(n,l,f,o,u,"auto"):g==="ellipse"&&s.drawEllipsePath(n,l,f,o,u),n.fill(),n.restore()}}}]),t}();function t2(t){var e=t&&t.style&&t.style.backgroundColor||"white";return wl(e)}var od={};od.initWebgl=function(t,e){var r=this,n=r.data.contexts[r.WEBGL],a=t.cy.container();t.bgColor=t2(a),t.webglTexSize=Math.min(t.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),t.webglTexRows=Math.min(t.webglTexRows,54),t.webglBatchSize=Math.min(t.webglBatchSize,16384),t.webglTexPerBatch=Math.min(t.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),r.webglDebug=t.webglDebug,r.webglDebugShowAtlases=t.webglDebugShowAtlases,console.log("max texture units",n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),console.log("max texture size",n.getParameter(n.MAX_TEXTURE_SIZE)),console.log("webgl options",t),r.pickingFrameBuffer=Gb(n),r.pickingFrameBuffer.needsDraw=!0;var i=function(f){return r.getTextAngle(f,null)},s=function(f){var d=f.pstyle("label");return d&&d.value};r.eleDrawing=new jb(r,n,t);var o=new e2(r);r.eleDrawing.addTextureRenderType("node-body",Ei({getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement,isVisible:function(f){return f.visible()}})),r.eleDrawing.addTextureRenderType("node-label",Ei({getKey:e.getLabelKey,getBoundingBox:e.getLabelBox,drawElement:e.drawLabel,getRotation:i,getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s})),r.eleDrawing.addTextureRenderType("node-overlay",Ei({getBoundingBox:e.getElementBox,getKey:function(f){return o.getStyleKey("overlay",f)},drawElement:function(f,d,g){return o.draw("overlay",f,d,g)},isVisible:function(f){return o.isVisible("overlay",f)},getPadding:function(f){return o.getPadding("overlay",f)}})),r.eleDrawing.addTextureRenderType("node-underlay",Ei({getBoundingBox:e.getElementBox,getKey:function(f){return o.getStyleKey("underlay",f)},drawElement:function(f,d,g){return o.draw("underlay",f,d,g)},isVisible:function(f){return o.isVisible("underlay",f)},getPadding:function(f){return o.getPadding("underlay",f)}})),r.eleDrawing.addTextureRenderType("edge-label",Ei({getKey:e.getLabelKey,getBoundingBox:e.getLabelBox,drawElement:e.drawLabel,getRotation:i,getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:s}));var u=Xa(function(){console.log("garbage collect flag set"),r.data.gc=!0},1e4);r.onUpdateEleCalcs(function(l,f){var d=!1;f&&f.length>0&&(d|=r.eleDrawing.invalidate(f)),d&&u()}),r2(r)};function r2(t){{var e=t.render;t.render=function(i){i=i||{};var s=t.cy;t.webgl&&(s.zoom()>qc?(n2(t),e.call(t,i)):(a2(t),ld(t,i,Fi.SCREEN)))}}{var r=t.matchCanvasSize;t.matchCanvasSize=function(i){r.call(t,i),t.pickingFrameBuffer.setFramebufferAttachmentSizes(t.canvasWidth,t.canvasHeight),t.pickingFrameBuffer.needsDraw=!0}}t.findNearestElements=function(i,s,o,u){return f2(t,i,s)};{var n=t.invalidateCachedZSortedEles;t.invalidateCachedZSortedEles=function(){n.call(t),t.pickingFrameBuffer.needsDraw=!0}}{var a=t.notify;t.notify=function(i,s){a.call(t,i,s),i==="viewport"||i==="bounds"?t.pickingFrameBuffer.needsDraw=!0:i==="background"&&t.eleDrawing.invalidate(s,{type:"node-body"})}}}function n2(t){var e=t.data.contexts[t.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function a2(t){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,t.canvasWidth,t.canvasHeight),n.restore()};e(t.data.contexts[t.NODE]),e(t.data.contexts[t.DRAG])}function i2(t){var e=t.canvasWidth,r=t.canvasHeight,n=uu(t),a=n.pan,i=n.zoom,s=xi();Hs(s,s,[a.x,a.y]),fu(s,s,[i,i]);var o=xi();Xb(o,e,r);var u=xi();return Kb(u,o,s),u}function ud(t,e){var r=t.canvasWidth,n=t.canvasHeight,a=uu(t),i=a.pan,s=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,r,n),e.translate(i.x,i.y),e.scale(s,s)}function s2(t,e){t.drawSelectionRectangle(e,function(r){return ud(t,r)})}function o2(t){var e=t.data.contexts[t.NODE];e.save(),ud(t,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}function u2(t){var e=function(a,i,s){for(var o=a.atlasManager.getRenderTypeOpts(i),u=t.data.contexts[t.NODE],l=.125,f=o.atlasCollection.atlases,d=0;d<f.length;d++){var g=f[d],m=g.canvas,p=m.width,b=m.height,x=p*d,w=m.height*s;u.save(),u.scale(l,l),u.drawImage(m,x,w),u.strokeStyle="black",u.rect(x,w,p,b),u.stroke(),u.restore()}},r=0;e(t.eleDrawing,"node-body",r++),e(t.eleDrawing,"node-label",r++)}function l2(t,e,r,n,a){var i,s,o,u,l=uu(t),f=l.pan,d=l.zoom;if(n===void 0||a===void 0){var g=lu(t,f,d,e,r),m=At(g,2),p=m[0],b=m[1],x=6;i=p-x/2,s=b-x/2,o=x,u=x}else{var w=lu(t,f,d,e,r),E=At(w,2),C=E[0],k=E[1],R=lu(t,f,d,n,a),A=At(R,2),h=A[0],I=A[1];i=C,s=I,o=Math.abs(h-C),u=Math.abs(I-k)}if(o===0||u===0)return[];var D=t.data.contexts[t.WEBGL];D.bindFramebuffer(D.FRAMEBUFFER,t.pickingFrameBuffer),t.pickingFrameBuffer.needsDraw&&(D.viewport(0,0,D.canvas.width,D.canvas.height),ld(t,null,Fi.PICKING),t.pickingFrameBuffer.needsDraw=!1);var M=o*u,L=new Uint8Array(M*4);D.readPixels(i,s,o,u,D.RGBA,D.UNSIGNED_BYTE,L),D.bindFramebuffer(D.FRAMEBUFFER,null);for(var B=new Set,N=0;N<M;N++){var _=L.slice(N*4,N*4+4),U=qb(_)-1;U>=0&&B.add(U)}return B}function f2(t,e,r){var n=l2(t,e,r),a=t.getCachedZSortedEles(),i,s,o=wr(n),u;try{for(o.s();!(u=o.n()).done;){var l=u.value,f=a[l];if(!i&&f.isNode()&&(i=f),!s&&f.isEdge()&&(s=f),i&&s)break}}catch(d){o.e(d)}finally{o.f()}return[i,s].filter(Boolean)}function ld(t,e,r){var n,a;t.webglDebug&&(a=[],n=performance.now());var i=t.eleDrawing,s=0;if(r.screen&&t.data.canvasNeedsRedraw[t.SELECT_BOX]&&s2(t,e),t.data.canvasNeedsRedraw[t.NODE]||r.picking){var o=function(B,N){N+=1,B.isNode()?(i.drawTexture(B,N,"node-underlay"),i.drawTexture(B,N,"node-body"),i.drawTexture(B,N,"node-label"),i.drawTexture(B,N,"node-overlay")):(i.drawEdgeLine(B,N),i.drawEdgeArrow(B,N,"source"),i.drawEdgeArrow(B,N,"target"),i.drawTexture(B,N,"edge-label"))},u=t.data.contexts[t.WEBGL];r.screen?(u.clearColor(0,0,0,0),u.enable(u.BLEND),u.blendFunc(u.ONE,u.ONE_MINUS_SRC_ALPHA)):u.disable(u.BLEND),u.clear(u.COLOR_BUFFER_BIT|u.DEPTH_BUFFER_BIT),u.viewport(0,0,u.canvas.width,u.canvas.height);var l=i2(t),f=t.getCachedZSortedEles();if(s=f.length,i.startFrame(l,a,r),r.screen){for(var d=0;d<f.nondrag.length;d++)o(f.nondrag[d],d);for(var g=0;g<f.drag.length;g++)o(f.drag[g],-1)}else if(r.picking)for(var m=0;m<f.length;m++)o(f[m],m);i.endFrame(),t.data.gc&&(console.log("Garbage Collect!"),t.data.gc=!1,i.gc()),r.screen&&t.webglDebugShowAtlases&&(o2(t),u2(t)),t.data.canvasNeedsRedraw[t.NODE]=!1,t.data.canvasNeedsRedraw[t.DRAG]=!1}if(t.webglDebug){var p=performance.now(),b=!0,x=0,w=0,E=wr(a),C;try{for(E.s();!(C=E.n()).done;){var k=C.value;x++,w+=k.count}}catch(L){E.e(L)}finally{E.f()}var R=Math.ceil(p-n),A="".concat(s," elements, ").concat(w," rectangles, ").concat(x," batches");if(b)console.log("WebGL (".concat(r.name,") - ").concat(A));else{console.log("WebGL render (".concat(r.name,") - frame time ").concat(R,"ms")),console.log("  ".concat(A)),console.log("Texture Atlases Used:");var h=i.getAtlasDebugInfo(),I=wr(h),D;try{for(I.s();!(D=I.n()).done;){var M=D.value;console.log("  ".concat(M.type,": ").concat(M.keyCount," keys, ").concat(M.atlasCount," atlases"))}}catch(L){I.e(L)}finally{I.f()}console.log("")}}}var Cn={};Cn.drawPolygonPath=function(t,e,r,n,a,i){var s=n/2,o=a/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+o*i[1]);for(var u=1;u<i.length/2;u++)t.lineTo(e+s*i[u*2],r+o*i[u*2+1]);t.closePath()},Cn.drawRoundPolygonPath=function(t,e,r,n,a,i,s){s.forEach(function(o){return Pc(t,o)}),t.closePath()},Cn.drawRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,o=a/2,u=i==="auto"?Nn(n,a):Math.min(i,o,s);t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.arcTo(e+s,r-o,e+s,r,u),t.arcTo(e+s,r+o,e,r+o,u),t.arcTo(e-s,r+o,e-s,r,u),t.arcTo(e-s,r-o,e,r-o,u),t.lineTo(e,r-o),t.closePath()},Cn.drawBottomRoundRectanglePath=function(t,e,r,n,a,i){var s=n/2,o=a/2,u=i==="auto"?Nn(n,a):i;t.beginPath&&t.beginPath(),t.moveTo(e,r-o),t.lineTo(e+s,r-o),t.lineTo(e+s,r),t.arcTo(e+s,r+o,e,r+o,u),t.arcTo(e-s,r+o,e-s,r,u),t.lineTo(e-s,r-o),t.lineTo(e,r-o),t.closePath()},Cn.drawCutRectanglePath=function(t,e,r,n,a,i,s){var o=n/2,u=a/2,l=s==="auto"?So():s;t.beginPath&&t.beginPath(),t.moveTo(e-o+l,r-u),t.lineTo(e+o-l,r-u),t.lineTo(e+o,r-u+l),t.lineTo(e+o,r+u-l),t.lineTo(e+o-l,r+u),t.lineTo(e-o+l,r+u),t.lineTo(e-o,r+u-l),t.lineTo(e-o,r-u+l),t.closePath()},Cn.drawBarrelPath=function(t,e,r,n,a){var i=n/2,s=a/2,o=e-i,u=e+i,l=r-s,f=r+s,d=Do(n,a),g=d.widthOffset,m=d.heightOffset,p=d.ctrlPtOffsetPct*g;t.beginPath&&t.beginPath(),t.moveTo(o,l+m),t.lineTo(o,f-m),t.quadraticCurveTo(o+p,f,o+g,f),t.lineTo(u-g,f),t.quadraticCurveTo(u-p,f,u,f-m),t.lineTo(u,l+m),t.quadraticCurveTo(u-p,l,u-g,l),t.lineTo(o+g,l),t.quadraticCurveTo(o+p,l,o,l+m),t.closePath()};for(var fd=Math.sin(0),cd=Math.cos(0),vu={},hu={},dd=Math.PI/40,Ba=0*Math.PI;Ba<2*Math.PI;Ba+=dd)vu[Ba]=Math.sin(Ba),hu[Ba]=Math.cos(Ba);Cn.drawEllipsePath=function(t,e,r,n,a){if(t.beginPath&&t.beginPath(),t.ellipse)t.ellipse(e,r,n/2,a/2,0,0,2*Math.PI);else for(var i,s,o=n/2,u=a/2,l=0*Math.PI;l<2*Math.PI;l+=dd)i=e-o*vu[l]*fd+o*hu[l]*cd,s=r+u*hu[l]*fd+u*vu[l]*cd,l===0?t.moveTo(i,s):t.lineTo(i,s);t.closePath()};var Ci={};Ci.createBuffer=function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,[r,r.getContext("2d")]},Ci.bufferCanvasImage=function(t){var e=this.cy,r=e.mutableElements(),n=r.boundingBox(),a=this.findContainerClientCoords(),i=t.full?Math.ceil(n.w):a[2],s=t.full?Math.ceil(n.h):a[3],o=Se(t.maxWidth)||Se(t.maxHeight),u=this.getPixelRatio(),l=1;if(t.scale!==void 0)i*=t.scale,s*=t.scale,l=t.scale;else if(o){var f=1/0,d=1/0;Se(t.maxWidth)&&(f=l*t.maxWidth/i),Se(t.maxHeight)&&(d=l*t.maxHeight/s),l=Math.min(f,d),i*=l,s*=l}o||(i*=u,s*=u,l*=u);var g=document.createElement("canvas");g.width=i,g.height=s,g.style.width=i+"px",g.style.height=s+"px";var m=g.getContext("2d");if(i>0&&s>0){m.clearRect(0,0,i,s),m.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(t.full)m.translate(-n.x1*l,-n.y1*l),m.scale(l,l),this.drawElements(m,p),m.scale(1/l,1/l),m.translate(n.x1*l,n.y1*l);else{var b=e.pan(),x={x:b.x*l,y:b.y*l};l*=e.zoom(),m.translate(x.x,x.y),m.scale(l,l),this.drawElements(m,p),m.scale(1/l,1/l),m.translate(-x.x,-x.y)}t.bg&&(m.globalCompositeOperation="destination-over",m.fillStyle=t.bg,m.rect(0,0,i,s),m.fill())}return g};function c2(t,e){for(var r=atob(t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return new Blob([n],{type:e})}function vd(t){var e=t.indexOf(",");return t.substr(e+1)}function hd(t,e,r){var n=function(){return e.toDataURL(r,t.quality)};switch(t.output){case"blob-promise":return new ha(function(a,i){try{e.toBlob(function(s){s!=null?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},r,t.quality)}catch(s){i(s)}});case"blob":return c2(vd(n()),r);case"base64":return vd(n());case"base64uri":default:return n()}}Ci.png=function(t){return hd(t,this.bufferCanvasImage(t),"image/png")},Ci.jpg=function(t){return hd(t,this.bufferCanvasImage(t),"image/jpeg")};var gd={};gd.nodeShapeImpl=function(t,e,r,n,a,i,s,o){switch(t){case"ellipse":return this.drawEllipsePath(e,r,n,a,i);case"polygon":return this.drawPolygonPath(e,r,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,r,n,a,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,r,n,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,r,n,a,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,r,n,a,i,o);case"barrel":return this.drawBarrelPath(e,r,n,a,i)}};var d2=pd,et=pd.prototype;et.CANVAS_LAYERS=3,et.SELECT_BOX=0,et.DRAG=1,et.NODE=2,et.WEBGL=3,et.CANVAS_TYPES=["2d","2d","2d","webgl2"],et.BUFFER_COUNT=3,et.TEXTURE_BUFFER=0,et.MOTIONBLUR_BUFFER_NODE=1,et.MOTIONBLUR_BUFFER_DRAG=2;function pd(t){var e=this,r=e.cy.window(),n=r.document;t.webgl&&(et.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(et.CANVAS_LAYERS),contexts:new Array(et.CANVAS_LAYERS),canvasNeedsRedraw:new Array(et.CANVAS_LAYERS),bufferCanvases:new Array(et.BUFFER_COUNT),bufferContexts:new Array(et.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var s=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,s.position="relative",s.zIndex="0",s.overflow="hidden";var o=t.cy.container();o.appendChild(e.data.canvasContainer),o.style[a]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Ah()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<et.CANVAS_LAYERS;l++){var f=e.data.canvases[l]=n.createElement("canvas"),d=et.CANVAS_TYPES[l];e.data.contexts[l]=f.getContext(d),e.data.contexts[l]||St("Could not create canvas of type "+d),Object.keys(u).forEach(function(ae){f.style[ae]=u[ae]}),f.style.position="absolute",f.setAttribute("data-id","layer"+l),f.style.zIndex=String(et.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[et.NODE].setAttribute("data-id","layer"+et.NODE+"-node"),e.data.canvases[et.SELECT_BOX].setAttribute("data-id","layer"+et.SELECT_BOX+"-selectbox"),e.data.canvases[et.DRAG].setAttribute("data-id","layer"+et.DRAG+"-drag"),e.data.canvases[et.WEBGL]&&e.data.canvases[et.WEBGL].setAttribute("data-id","layer"+et.WEBGL+"-webgl");for(var l=0;l<et.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=n.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var g=fr(),m=function(Y){return{x:(Y.x1+Y.x2)/2,y:(Y.y1+Y.y2)/2}},p=function(Y){return{x:-Y.w/2,y:-Y.h/2}},b=function(Y){var oe=Y[0]._private,ye=oe.oldBackgroundTimestamp===oe.backgroundTimestamp;return!ye},x=function(Y){return Y[0]._private.nodeKey},w=function(Y){return Y[0]._private.labelStyleKey},E=function(Y){return Y[0]._private.sourceLabelStyleKey},C=function(Y){return Y[0]._private.targetLabelStyleKey},k=function(Y,oe,ye,De,Be){return e.drawElement(Y,oe,ye,!1,!1,Be)},R=function(Y,oe,ye,De,Be){return e.drawElementText(Y,oe,ye,De,"main",Be)},A=function(Y,oe,ye,De,Be){return e.drawElementText(Y,oe,ye,De,"source",Be)},h=function(Y,oe,ye,De,Be){return e.drawElementText(Y,oe,ye,De,"target",Be)},I=function(Y){return Y.boundingBox(),Y[0]._private.bodyBounds},D=function(Y){return Y.boundingBox(),Y[0]._private.labelBounds.main||g},M=function(Y){return Y.boundingBox(),Y[0]._private.labelBounds.source||g},L=function(Y){return Y.boundingBox(),Y[0]._private.labelBounds.target||g},B=function(Y,oe){return oe},N=function(Y){return m(I(Y))},_=function(Y,oe,ye){var De=Y?Y+"-":"";return{x:oe.x+ye.pstyle(De+"text-margin-x").pfValue,y:oe.y+ye.pstyle(De+"text-margin-y").pfValue}},U=function(Y,oe,ye){var De=Y[0]._private.rscratch;return{x:De[oe],y:De[ye]}},H=function(Y){return _("",U(Y,"labelX","labelY"),Y)},W=function(Y){return _("source",U(Y,"sourceLabelX","sourceLabelY"),Y)},X=function(Y){return _("target",U(Y,"targetLabelX","targetLabelY"),Y)},Q=function(Y){return p(I(Y))},se=function(Y){return p(M(Y))},j=function(Y){return p(L(Y))},ee=function(Y){var oe=D(Y),ye=p(D(Y));if(Y.isNode()){switch(Y.pstyle("text-halign").value){case"left":ye.x=-oe.w-(oe.leftPad||0);break;case"right":ye.x=-(oe.rightPad||0);break}switch(Y.pstyle("text-valign").value){case"top":ye.y=-oe.h-(oe.topPad||0);break;case"bottom":ye.y=-(oe.botPad||0);break}}return ye},de=e.data.eleTxrCache=new yi(e,{getKey:x,doesEleInvalidateKey:b,drawElement:k,getBoundingBox:I,getRotationPoint:N,getRotationOffset:Q,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),ge=e.data.lblTxrCache=new yi(e,{getKey:w,drawElement:R,getBoundingBox:D,getRotationPoint:H,getRotationOffset:ee,isVisible:B}),me=e.data.slbTxrCache=new yi(e,{getKey:E,drawElement:A,getBoundingBox:M,getRotationPoint:W,getRotationOffset:se,isVisible:B}),pe=e.data.tlbTxrCache=new yi(e,{getKey:C,drawElement:h,getBoundingBox:L,getRotationPoint:X,getRotationOffset:j,isVisible:B}),we=e.data.lyrTxrCache=new Uc(e);e.onUpdateEleCalcs(function(Y,oe){de.invalidateElements(oe),ge.invalidateElements(oe),me.invalidateElements(oe),pe.invalidateElements(oe),we.invalidateElements(oe);for(var ye=0;ye<oe.length;ye++){var De=oe[ye]._private;De.oldBackgroundTimestamp=De.backgroundTimestamp}});var be=function(Y){for(var oe=0;oe<Y.length;oe++)we.enqueueElementRefinement(Y[oe].ele)};de.onDequeue(be),ge.onDequeue(be),me.onDequeue(be),pe.onDequeue(be),t.webgl&&e.initWebgl(t,{getStyleKey:x,getLabelKey:w,drawElement:k,drawLabel:R,getElementBox:I,getLabelBox:D,getElementRotationPoint:N,getElementRotationOffset:Q,getLabelRotationPoint:H,getLabelRotationOffset:ee})}et.redrawHint=function(t,e){var r=this;switch(t){case"eles":r.data.canvasNeedsRedraw[et.NODE]=e;break;case"drag":r.data.canvasNeedsRedraw[et.DRAG]=e;break;case"select":r.data.canvasNeedsRedraw[et.SELECT_BOX]=e;break;case"gc":r.data.gc=!0;break}};var v2=typeof Path2D<"u";et.path2dEnabled=function(t){if(t===void 0)return this.pathsEnabled;this.pathsEnabled=!!t},et.usePaths=function(){return v2&&this.pathsEnabled},et.setImgSmoothing=function(t,e){t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled=e:(t.webkitImageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e)},et.getImgSmoothing=function(t){return t.imageSmoothingEnabled!=null?t.imageSmoothingEnabled:t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled},et.makeOffscreenCanvas=function(t,e){var r;if((typeof OffscreenCanvas>"u"?"undefined":It(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var n=this.cy.window(),a=n.document;r=a.createElement("canvas"),r.width=t,r.height=e}return r},[Kc,Wr,rn,su,Un,Aa,or,od,Cn,Ci,gd].forEach(function(t){Ve(et,t)});var h2=[{name:"null",impl:bc},{name:"base",impl:zc},{name:"canvas",impl:d2}],g2=[{type:"layout",extensions:Qw},{type:"renderer",extensions:h2}],md={},yd={};function wd(t,e,r){var n=r,a=function(I){ht("Can not register `"+e+"` for `"+t+"` since `"+I+"` already exists in the prototype and can not be overridden")};if(t==="core"){if(gi.prototype[e])return a(e);gi.prototype[e]=r}else if(t==="collection"){if(Wt.prototype[e])return a(e);Wt.prototype[e]=r}else if(t==="layout"){for(var i=function(I){this.options=I,r.call(this,I),st(this._private)||(this._private={}),this._private.cy=I.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(r.prototype),o=[],u=0;u<o.length;u++){var l=o[u];s[l]=s[l]||function(){return this}}s.start&&!s.run?s.run=function(){return this.start(),this}:!s.start&&s.run&&(s.start=function(){return this.run(),this});var f=r.prototype.stop;s.stop=function(){var h=this.options;if(h&&h.animate){var I=this.animations;if(I)for(var D=0;D<I.length;D++)I[D].stop()}return f?f.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(I){return I._private.cy},g={addEventFields:function(I,D){D.layout=I,D.cy=d(I),D.target=I},bubble:function(){return!0},parent:function(I){return d(I)}};Ve(s,{createEmitter:function(){return this._private.emitter=new ys(g,this),this},emitter:function(){return this._private.emitter},on:function(I,D){return this.emitter().on(I,D),this},one:function(I,D){return this.emitter().one(I,D),this},once:function(I,D){return this.emitter().one(I,D),this},removeListener:function(I,D){return this.emitter().removeListener(I,D),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(I,D){return this.emitter().emit(I,D),this}}),gt.eventAliasesOn(s),n=i}else if(t==="renderer"&&e!=="null"&&e!=="base"){var m=bd("renderer","base"),p=m.prototype,b=r,x=r.prototype,w=function(){m.apply(this,arguments),b.apply(this,arguments)},E=w.prototype;for(var C in p){var k=p[C],R=x[C]!=null;if(R)return a(C);E[C]=k}for(var A in x)E[A]=x[A];p.clientFunctions.forEach(function(h){E[h]=E[h]||function(){St("Renderer does not implement `renderer."+h+"()` on its prototype")}}),n=w}else if(t==="__proto__"||t==="constructor"||t==="prototype")return St(t+" is an illegal type to be registered, possibly lead to prototype pollutions");return bl({map:md,keys:[t,e],value:n})}function bd(t,e){return xl({map:md,keys:[t,e]})}function p2(t,e,r,n,a){return bl({map:yd,keys:[t,e,r,n],value:a})}function m2(t,e,r,n){return xl({map:yd,keys:[t,e,r,n]})}var gu=function(){if(arguments.length===2)return bd.apply(null,arguments);if(arguments.length===3)return wd.apply(null,arguments);if(arguments.length===4)return m2.apply(null,arguments);if(arguments.length===5)return p2.apply(null,arguments);St("Invalid extension access syntax")};gi.prototype.extension=gu,g2.forEach(function(t){t.extensions.forEach(function(e){wd(t.type,e.name,e.impl)})});var xd=function t(){if(!(this instanceof t))return new t;this.length=0},Gn=xd.prototype;Gn.instanceString=function(){return"stylesheet"},Gn.selector=function(t){var e=this.length++;return this[e]={selector:t,properties:[]},this},Gn.css=function(t,e){var r=this.length-1;if(_e(t))this[r].properties.push({name:t,value:e});else if(st(t))for(var n=t,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],o=n[s];if(o!=null){var u=Jt.properties[s]||Jt.properties[Ki(s)];if(u!=null){var l=u.name,f=o;this[r].properties.push({name:l,value:f})}}}return this},Gn.style=Gn.css,Gn.generateStyle=function(t){var e=new Jt(t);return this.appendToStyle(e)},Gn.appendToStyle=function(t){for(var e=0;e<this.length;e++){var r=this[e],n=r.selector,a=r.properties;t.selector(n);for(var i=0;i<a.length;i++){var s=a[i];t.css(s.name,s.value)}}return t};var y2="3.31.0",Tn=function(e){if(e===void 0&&(e={}),st(e))return new gi(e);if(_e(e))return gu.apply(gu,arguments)};Tn.use=function(t){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Tn),t.apply(null,e),this},Tn.warnings=function(t){return Rl(t)},Tn.version=y2,Tn.stylesheet=Tn.Stylesheet=xd;function Fd(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void Fd(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function w2(t){var e="",r,n;try{n=1,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div class="g-graph-container">',n=2,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div class="g-item-info-header">',n=3,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<i class="icon-picture"></i>',n=4,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+"GEMD Graph</div></div>",n=5,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div class="g-graph-panes clearfix">',n=6,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div class="g-graph-left">',n=7,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div id="cy"></div></div>',n=8,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div class="g-graph-right">',n=9,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/graphItem.pug",e=e+'<div id="cy-json"></div></div></div>'}catch(a){Fd(a,r,n)}return e}const eF="",{restRequest:b2}=girder.rest,x2=girder.views.View;var Ed={node:{css:!1,data:!0,position:!0,discludeds:[]},edge:{css:!1,data:!0,discludeds:[]},layoutBy:"cose"};Tn("core","graphml",function(t){var e=this,r,n=function(a,i,s,o){function u(l,f){l.children("node").each(function(){var d=i(this),g=d.attr("id");g.includes("[")&&(g=g.split(" [")[0]);var m={data:{id:d.attr("id"),label:g},css:{},position:{}};f!==null&&(m.data.parent=f.attr("id")),d.children("data").each(function(){var p=i(this);m.data[p.attr("key")]=p.text()}),a.add({group:"nodes",data:m.data,css:m.css,position:m.position,style:{"background-color":m.data.color}}),d.children("graph").each(function(){var p=i(this);u(p,d)})})}a.batch(function(){i(i.parseXML(t)).find("graph").first().each(function(){var g=i(this);u(g,null),g.find("edge").each(function(){var m=i(this),p={data:{id:m.attr("id"),source:m.attr("source"),target:m.attr("target")},css:{},position:{}};m.find("data").each(function(){var b=i(this);p.data[b.attr("key")]=b.text()}),a.add({group:"edges",data:p.data,css:p.css})})});var d=typeof s.layoutBy;d==="string"?a.layout({name:s.layoutBy}).run():d==="function"&&s.layoutBy()})};switch(typeof t){case"string":console.log("Importing GraphML..."),r=n(e,un,Ed);break;case"object":un.extend(!0,Ed,t),r=e;break;case"undefined":console.log("Exporter doesn't work yet.");break;default:console.log("Functionality(argument) of .graphml() is not recognized.")}return r});const F2=x2.extend({className:"g-graph-view",initialize:function(t){this.graphId=t.graphId;var e=this;b2({url:`file/${t.graphId}/download`}).done(r=>{e.graphFile=r,e.render()})},render:function(){if(this.$el.html(w2()),document.getElementById("cy")){var t=this,e=Tn({container:document.getElementById("cy"),style:[{selector:"node",style:{"background-color":"#666",label:"data(label)"}},{selector:"edge",style:{width:3,"line-color":"#ccc","target-arrow-color":"#ccc","target-arrow-shape":"triangle","curve-style":"bezier"}}],layout:{name:"grid",rows:1},ready:function(){console.log(t.graphFile),this.graphml({layoutBy:"cose"}),this.graphml(t.graphFile)}});e.on("tap","node",function(){const r=JSON.stringify(JSON.parse(this.data("object")),null,2),n=/(https?:\/\/[^\s]+)/g,a=r.replace(n,function(i){return'<a href="'+i+'" target="_blank">'+i+"</a>"});document.getElementById("cy-json").innerHTML="<pre>"+a+"</pre>",console.log("tapped "+this.id())})}return this}});var Cd="1.13.7",Td=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},Ws=Array.prototype,pu=Object.prototype,Sd=typeof Symbol<"u"?Symbol.prototype:null,E2=Ws.push,Ti=Ws.slice,Si=pu.toString,C2=pu.hasOwnProperty,Dd=typeof ArrayBuffer<"u",T2=typeof DataView<"u",S2=Array.isArray,kd=Object.keys,Pd=Object.create,Ad=Dd&&ArrayBuffer.isView,D2=isNaN,k2=isFinite,Bd=!{toString:null}.propertyIsEnumerable("toString"),Id=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],P2=Math.pow(2,53)-1;function dr(t,e){return e=e==null?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),n=Array(r),a=0;a<r;a++)n[a]=arguments[a+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n);case 2:return t.call(this,arguments[0],arguments[1],n)}var i=Array(e+1);for(a=0;a<e;a++)i[a]=arguments[a];return i[e]=n,t.apply(this,i)}}function Kn(t){var e=typeof t;return e==="function"||e==="object"&&!!t}function A2(t){return t===null}function Md(t){return t===void 0}function Rd(t){return t===!0||t===!1||Si.call(t)==="[object Boolean]"}function B2(t){return!!(t&&t.nodeType===1)}function tr(t){var e="[object "+t+"]";return function(r){return Si.call(r)===e}}const mu=tr("String"),Ld=tr("Number"),I2=tr("Date"),M2=tr("RegExp"),R2=tr("Error"),Od=tr("Symbol"),Nd=tr("ArrayBuffer");var _d=tr("Function"),L2=Td.document&&Td.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof L2!="function"&&(_d=function(t){return typeof t=="function"||!1});const ur=_d,zd=tr("Object");var Vd=T2&&(!/\[native code\]/.test(String(DataView))||zd(new DataView(new ArrayBuffer(8)))),yu=typeof Map<"u"&&zd(new Map),O2=tr("DataView");function N2(t){return t!=null&&ur(t.getInt8)&&Nd(t.buffer)}const Us=Vd?N2:O2,Xn=S2||tr("Array");function Sn(t,e){return t!=null&&C2.call(t,e)}var wu=tr("Arguments");(function(){wu(arguments)||(wu=function(t){return Sn(t,"callee")})})();const bu=wu;function _2(t){return!Od(t)&&k2(t)&&!isNaN(parseFloat(t))}function $d(t){return Ld(t)&&D2(t)}function qd(t){return function(){return t}}function Hd(t){return function(e){var r=t(e);return typeof r=="number"&&r>=0&&r<=P2}}function Wd(t){return function(e){return e==null?void 0:e[t]}}const Gs=Wd("byteLength"),z2=Hd(Gs);var V2=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function $2(t){return Ad?Ad(t)&&!Us(t):z2(t)&&V2.test(Si.call(t))}const Ud=Dd?$2:qd(!1),vr=Wd("length");function q2(t){for(var e={},r=t.length,n=0;n<r;++n)e[t[n]]=!0;return{contains:function(a){return e[a]===!0},push:function(a){return e[a]=!0,t.push(a)}}}function Gd(t,e){e=q2(e);var r=Id.length,n=t.constructor,a=ur(n)&&n.prototype||pu,i="constructor";for(Sn(t,i)&&!e.contains(i)&&e.push(i);r--;)i=Id[r],i in t&&t[i]!==a[i]&&!e.contains(i)&&e.push(i)}function Vt(t){if(!Kn(t))return[];if(kd)return kd(t);var e=[];for(var r in t)Sn(t,r)&&e.push(r);return Bd&&Gd(t,e),e}function H2(t){if(t==null)return!0;var e=vr(t);return typeof e=="number"&&(Xn(t)||mu(t)||bu(t))?e===0:vr(Vt(t))===0}function Kd(t,e){var r=Vt(e),n=r.length;if(t==null)return!n;for(var a=Object(t),i=0;i<n;i++){var s=r[i];if(e[s]!==a[s]||!(s in a))return!1}return!0}function pt(t){if(t instanceof pt)return t;if(!(this instanceof pt))return new pt(t);this._wrapped=t}pt.VERSION=Cd,pt.prototype.value=function(){return this._wrapped},pt.prototype.valueOf=pt.prototype.toJSON=pt.prototype.value,pt.prototype.toString=function(){return String(this._wrapped)};function Xd(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,Gs(t))}var Yd="[object DataView]";function xu(t,e,r,n){if(t===e)return t!==0||1/t===1/e;if(t==null||e==null)return!1;if(t!==t)return e!==e;var a=typeof t;return a!=="function"&&a!=="object"&&typeof e!="object"?!1:Zd(t,e,r,n)}function Zd(t,e,r,n){t instanceof pt&&(t=t._wrapped),e instanceof pt&&(e=e._wrapped);var a=Si.call(t);if(a!==Si.call(e))return!1;if(Vd&&a=="[object Object]"&&Us(t)){if(!Us(e))return!1;a=Yd}switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:+t==0?1/+t===1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return Sd.valueOf.call(t)===Sd.valueOf.call(e);case"[object ArrayBuffer]":case Yd:return Zd(Xd(t),Xd(e),r,n)}var i=a==="[object Array]";if(!i&&Ud(t)){var s=Gs(t);if(s!==Gs(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;i=!0}if(!i){if(typeof t!="object"||typeof e!="object")return!1;var o=t.constructor,u=e.constructor;if(o!==u&&!(ur(o)&&o instanceof o&&ur(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}r=r||[],n=n||[];for(var l=r.length;l--;)if(r[l]===t)return n[l]===e;if(r.push(t),n.push(e),i){if(l=t.length,l!==e.length)return!1;for(;l--;)if(!xu(t[l],e[l],r,n))return!1}else{var f=Vt(t),d;if(l=f.length,Vt(e).length!==l)return!1;for(;l--;)if(d=f[l],!(Sn(e,d)&&xu(t[d],e[d],r,n)))return!1}return r.pop(),n.pop(),!0}function W2(t,e){return xu(t,e)}function Di(t){if(!Kn(t))return[];var e=[];for(var r in t)e.push(r);return Bd&&Gd(t,e),e}function Fu(t){var e=vr(t);return function(r){if(r==null)return!1;var n=Di(r);if(vr(n))return!1;for(var a=0;a<e;a++)if(!ur(r[t[a]]))return!1;return t!==jd||!ur(r[Eu])}}var Eu="forEach",Qd="has",Cu=["clear","delete"],Jd=["get",Qd,"set"],U2=Cu.concat(Eu,Jd),jd=Cu.concat(Jd),G2=["add"].concat(Cu,Eu,Qd);const K2=yu?Fu(U2):tr("Map"),X2=yu?Fu(jd):tr("WeakMap"),Y2=yu?Fu(G2):tr("Set"),Z2=tr("WeakSet");function Ia(t){for(var e=Vt(t),r=e.length,n=Array(r),a=0;a<r;a++)n[a]=t[e[a]];return n}function Q2(t){for(var e=Vt(t),r=e.length,n=Array(r),a=0;a<r;a++)n[a]=[e[a],t[e[a]]];return n}function ev(t){for(var e={},r=Vt(t),n=0,a=r.length;n<a;n++)e[t[r[n]]]=r[n];return e}function Tu(t){var e=[];for(var r in t)ur(t[r])&&e.push(r);return e.sort()}function Su(t,e){return function(r){var n=arguments.length;if(e&&(r=Object(r)),n<2||r==null)return r;for(var a=1;a<n;a++)for(var i=arguments[a],s=t(i),o=s.length,u=0;u<o;u++){var l=s[u];(!e||r[l]===void 0)&&(r[l]=i[l])}return r}}const tv=Su(Di),Ks=Su(Vt),rv=Su(Di,!0);function J2(){return function(){}}function nv(t){if(!Kn(t))return{};if(Pd)return Pd(t);var e=J2();e.prototype=t;var r=new e;return e.prototype=null,r}function j2(t,e){var r=nv(t);return e&&Ks(r,e),r}function e1(t){return Kn(t)?Xn(t)?t.slice():tv({},t):t}function t1(t,e){return e(t),t}function av(t){return Xn(t)?t:[t]}pt.toPath=av;function ki(t){return pt.toPath(t)}function Du(t,e){for(var r=e.length,n=0;n<r;n++){if(t==null)return;t=t[e[n]]}return r?t:void 0}function iv(t,e,r){var n=Du(t,ki(e));return Md(n)?r:n}function r1(t,e){e=ki(e);for(var r=e.length,n=0;n<r;n++){var a=e[n];if(!Sn(t,a))return!1;t=t[a]}return!!r}function ku(t){return t}function Pi(t){return t=Ks({},t),function(e){return Kd(e,t)}}function Pu(t){return t=ki(t),function(e){return Du(e,t)}}function Ai(t,e,r){if(e===void 0)return t;switch(r??3){case 1:return function(n){return t.call(e,n)};case 3:return function(n,a,i){return t.call(e,n,a,i)};case 4:return function(n,a,i,s){return t.call(e,n,a,i,s)}}return function(){return t.apply(e,arguments)}}function sv(t,e,r){return t==null?ku:ur(t)?Ai(t,e,r):Kn(t)&&!Xn(t)?Pi(t):Pu(t)}function Au(t,e){return sv(t,e,1/0)}pt.iteratee=Au;function hr(t,e,r){return pt.iteratee!==Au?pt.iteratee(t,e):sv(t,e,r)}function n1(t,e,r){e=hr(e,r);for(var n=Vt(t),a=n.length,i={},s=0;s<a;s++){var o=n[s];i[o]=e(t[o],o,t)}return i}function ov(){}function a1(t){return t==null?ov:function(e){return iv(t,e)}}function i1(t,e,r){var n=Array(Math.max(0,t));e=Ai(e,r,1);for(var a=0;a<t;a++)n[a]=e(a);return n}function Bu(t,e){return e==null&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}const Bi=Date.now||function(){return new Date().getTime()};function uv(t){var e=function(i){return t[i]},r="(?:"+Vt(t).join("|")+")",n=RegExp(r),a=RegExp(r,"g");return function(i){return i=i==null?"":""+i,n.test(i)?i.replace(a,e):i}}const lv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},s1=uv(lv),o1=ev(lv),u1=uv(o1),l1=pt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Iu=/(.)^/,f1={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},c1=/\\|'|\r|\n|\u2028|\u2029/g;function d1(t){return"\\"+f1[t]}var v1=/^\s*(\w|\$)+\s*$/;function h1(t,e,r){!e&&r&&(e=r),e=rv({},e,pt.templateSettings);var n=RegExp([(e.escape||Iu).source,(e.interpolate||Iu).source,(e.evaluate||Iu).source].join("|")+"|$","g"),a=0,i="__p+='";t.replace(n,function(l,f,d,g,m){return i+=t.slice(a,m).replace(c1,d1),a=m+l.length,f?i+=`'+
((__t=(`+f+`))==null?'':_.escape(__t))+
'`:d?i+=`'+
((__t=(`+d+`))==null?'':__t)+
'`:g&&(i+=`';
`+g+`
__p+='`),l}),i+=`';
`;var s=e.variable;if(s){if(!v1.test(s))throw new Error("variable is not a bare identifier: "+s)}else i=`with(obj||{}){
`+i+`}
`,s="obj";i=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};
`+i+`return __p;
`;var o;try{o=new Function(s,"_",i)}catch(l){throw l.source=i,l}var u=function(l){return o.call(this,l,pt)};return u.source="function("+s+`){
`+i+"}",u}function g1(t,e,r){e=ki(e);var n=e.length;if(!n)return ur(r)?r.call(t):r;for(var a=0;a<n;a++){var i=t==null?void 0:t[e[a]];i===void 0&&(i=r,a=n),t=ur(i)?i.call(t):i}return t}var p1=0;function m1(t){var e=++p1+"";return t?t+e:e}function y1(t){var e=pt(t);return e._chain=!0,e}function fv(t,e,r,n,a){if(!(n instanceof e))return t.apply(r,a);var i=nv(t.prototype),s=t.apply(i,a);return Kn(s)?s:i}var Ma=dr(function(t,e){var r=Ma.placeholder,n=function(){for(var a=0,i=e.length,s=Array(i),o=0;o<i;o++)s[o]=e[o]===r?arguments[a++]:e[o];for(;a<arguments.length;)s.push(arguments[a++]);return fv(t,n,this,this,s)};return n});Ma.placeholder=pt;const cv=dr(function(t,e,r){if(!ur(t))throw new TypeError("Bind must be called on a function");var n=dr(function(a){return fv(t,n,e,this,r.concat(a))});return n}),Fr=Hd(vr);function Yn(t,e,r,n){if(n=n||[],!e&&e!==0)e=1/0;else if(e<=0)return n.concat(t);for(var a=n.length,i=0,s=vr(t);i<s;i++){var o=t[i];if(Fr(o)&&(Xn(o)||bu(o)))if(e>1)Yn(o,e-1,r,n),a=n.length;else for(var u=0,l=o.length;u<l;)n[a++]=o[u++];else r||(n[a++]=o)}return n}const w1=dr(function(t,e){e=Yn(e,!1,!1);var r=e.length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=e[r];t[n]=cv(t[n],t)}return t});function b1(t,e){var r=function(n){var a=r.cache,i=""+(e?e.apply(this,arguments):n);return Sn(a,i)||(a[i]=t.apply(this,arguments)),a[i]};return r.cache={},r}const dv=dr(function(t,e,r){return setTimeout(function(){return t.apply(null,r)},e)}),x1=Ma(dv,pt,1);function F1(t,e,r){var n,a,i,s,o=0;r||(r={});var u=function(){o=r.leading===!1?0:Bi(),n=null,s=t.apply(a,i),n||(a=i=null)},l=function(){var f=Bi();!o&&r.leading===!1&&(o=f);var d=e-(f-o);return a=this,i=arguments,d<=0||d>e?(n&&(clearTimeout(n),n=null),o=f,s=t.apply(a,i),n||(a=i=null)):!n&&r.trailing!==!1&&(n=setTimeout(u,d)),s};return l.cancel=function(){clearTimeout(n),o=0,n=a=i=null},l}function E1(t,e,r){var n,a,i,s,o,u=function(){var f=Bi()-a;e>f?n=setTimeout(u,e-f):(n=null,r||(s=t.apply(o,i)),n||(i=o=null))},l=dr(function(f){return o=this,i=f,a=Bi(),n||(n=setTimeout(u,e),r&&(s=t.apply(o,i))),s});return l.cancel=function(){clearTimeout(n),n=i=o=null},l}function C1(t,e){return Ma(e,t)}function Mu(t){return function(){return!t.apply(this,arguments)}}function T1(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function S1(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function vv(t,e){var r;return function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=null),r}}const D1=Ma(vv,2);function hv(t,e,r){e=hr(e,r);for(var n=Vt(t),a,i=0,s=n.length;i<s;i++)if(a=n[i],e(t[a],a,t))return a}function gv(t){return function(e,r,n){r=hr(r,n);for(var a=vr(e),i=t>0?0:a-1;i>=0&&i<a;i+=t)if(r(e[i],i,e))return i;return-1}}const Ru=gv(1),pv=gv(-1);function mv(t,e,r,n){r=hr(r,n,1);for(var a=r(e),i=0,s=vr(t);i<s;){var o=Math.floor((i+s)/2);r(t[o])<a?i=o+1:s=o}return i}function yv(t,e,r){return function(n,a,i){var s=0,o=vr(n);if(typeof i=="number")t>0?s=i>=0?i:Math.max(i+o,s):o=i>=0?Math.min(i+1,o):i+o+1;else if(r&&i&&o)return i=r(n,a),n[i]===a?i:-1;if(a!==a)return i=e(Ti.call(n,s,o),$d),i>=0?i+s:-1;for(i=t>0?s:o-1;i>=0&&i<o;i+=t)if(n[i]===a)return i;return-1}}const wv=yv(1,Ru,mv),k1=yv(-1,pv);function Lu(t,e,r){var n=Fr(t)?Ru:hv,a=n(t,e,r);if(a!==void 0&&a!==-1)return t[a]}function P1(t,e){return Lu(t,Pi(e))}function nn(t,e,r){e=Ai(e,r);var n,a;if(Fr(t))for(n=0,a=t.length;n<a;n++)e(t[n],n,t);else{var i=Vt(t);for(n=0,a=i.length;n<a;n++)e(t[i[n]],i[n],t)}return t}function Zn(t,e,r){e=hr(e,r);for(var n=!Fr(t)&&Vt(t),a=(n||t).length,i=Array(a),s=0;s<a;s++){var o=n?n[s]:s;i[s]=e(t[o],o,t)}return i}function bv(t){var e=function(r,n,a,i){var s=!Fr(r)&&Vt(r),o=(s||r).length,u=t>0?0:o-1;for(i||(a=r[s?s[u]:u],u+=t);u>=0&&u<o;u+=t){var l=s?s[u]:u;a=n(a,r[l],l,r)}return a};return function(r,n,a,i){var s=arguments.length>=3;return e(r,Ai(n,i,4),a,s)}}const Ou=bv(1),xv=bv(-1);function Ra(t,e,r){var n=[];return e=hr(e,r),nn(t,function(a,i,s){e(a,i,s)&&n.push(a)}),n}function A1(t,e,r){return Ra(t,Mu(hr(e)),r)}function Fv(t,e,r){e=hr(e,r);for(var n=!Fr(t)&&Vt(t),a=(n||t).length,i=0;i<a;i++){var s=n?n[i]:i;if(!e(t[s],s,t))return!1}return!0}function Ev(t,e,r){e=hr(e,r);for(var n=!Fr(t)&&Vt(t),a=(n||t).length,i=0;i<a;i++){var s=n?n[i]:i;if(e(t[s],s,t))return!0}return!1}function an(t,e,r,n){return Fr(t)||(t=Ia(t)),(typeof r!="number"||n)&&(r=0),wv(t,e,r)>=0}const B1=dr(function(t,e,r){var n,a;return ur(e)?a=e:(e=ki(e),n=e.slice(0,-1),e=e[e.length-1]),Zn(t,function(i){var s=a;if(!s){if(n&&n.length&&(i=Du(i,n)),i==null)return;s=i[e]}return s==null?s:s.apply(i,r)})});function Nu(t,e){return Zn(t,Pu(e))}function I1(t,e){return Ra(t,Pi(e))}function Cv(t,e,r){var n=-1/0,a=-1/0,i,s;if(e==null||typeof e=="number"&&typeof t[0]!="object"&&t!=null){t=Fr(t)?t:Ia(t);for(var o=0,u=t.length;o<u;o++)i=t[o],i!=null&&i>n&&(n=i)}else e=hr(e,r),nn(t,function(l,f,d){s=e(l,f,d),(s>a||s===-1/0&&n===-1/0)&&(n=l,a=s)});return n}function M1(t,e,r){var n=1/0,a=1/0,i,s;if(e==null||typeof e=="number"&&typeof t[0]!="object"&&t!=null){t=Fr(t)?t:Ia(t);for(var o=0,u=t.length;o<u;o++)i=t[o],i!=null&&i<n&&(n=i)}else e=hr(e,r),nn(t,function(l,f,d){s=e(l,f,d),(s<a||s===1/0&&n===1/0)&&(n=l,a=s)});return n}var R1=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Tv(t){return t?Xn(t)?Ti.call(t):mu(t)?t.match(R1):Fr(t)?Zn(t,ku):Ia(t):[]}function Sv(t,e,r){if(e==null||r)return Fr(t)||(t=Ia(t)),t[Bu(t.length-1)];var n=Tv(t),a=vr(n);e=Math.max(Math.min(e,a),0);for(var i=a-1,s=0;s<e;s++){var o=Bu(s,i),u=n[s];n[s]=n[o],n[o]=u}return n.slice(0,e)}function L1(t){return Sv(t,1/0)}function O1(t,e,r){var n=0;return e=hr(e,r),Nu(Zn(t,function(a,i,s){return{value:a,index:n++,criteria:e(a,i,s)}}).sort(function(a,i){var s=a.criteria,o=i.criteria;if(s!==o){if(s>o||s===void 0)return 1;if(s<o||o===void 0)return-1}return a.index-i.index}),"value")}function Xs(t,e){return function(r,n,a){var i=e?[[],[]]:{};return n=hr(n,a),nn(r,function(s,o){var u=n(s,o,r);t(i,s,u)}),i}}const N1=Xs(function(t,e,r){Sn(t,r)?t[r].push(e):t[r]=[e]}),_1=Xs(function(t,e,r){t[r]=e}),z1=Xs(function(t,e,r){Sn(t,r)?t[r]++:t[r]=1}),V1=Xs(function(t,e,r){t[r?0:1].push(e)},!0);function $1(t){return t==null?0:Fr(t)?t.length:Vt(t).length}function q1(t,e,r){return e in r}const Dv=dr(function(t,e){var r={},n=e[0];if(t==null)return r;ur(n)?(e.length>1&&(n=Ai(n,e[1])),e=Di(t)):(n=q1,e=Yn(e,!1,!1),t=Object(t));for(var a=0,i=e.length;a<i;a++){var s=e[a],o=t[s];n(o,s,t)&&(r[s]=o)}return r}),H1=dr(function(t,e){var r=e[0],n;return ur(r)?(r=Mu(r),e.length>1&&(n=e[1])):(e=Zn(Yn(e,!1,!1),String),r=function(a,i){return!an(e,i)}),Dv(t,r,n)});function kv(t,e,r){return Ti.call(t,0,Math.max(0,t.length-(e==null||r?1:e)))}function _u(t,e,r){return t==null||t.length<1?e==null||r?void 0:[]:e==null||r?t[0]:kv(t,t.length-e)}function Ys(t,e,r){return Ti.call(t,e==null||r?1:e)}function W1(t,e,r){return t==null||t.length<1?e==null||r?void 0:[]:e==null||r?t[t.length-1]:Ys(t,Math.max(0,t.length-e))}function U1(t){return Ra(t,Boolean)}function G1(t,e){return Yn(t,e,!1)}const Pv=dr(function(t,e){return e=Yn(e,!0,!0),Ra(t,function(r){return!an(e,r)})}),K1=dr(function(t,e){return Pv(t,e)});function zu(t,e,r,n){Rd(e)||(n=r,r=e,e=!1),r!=null&&(r=hr(r,n));for(var a=[],i=[],s=0,o=vr(t);s<o;s++){var u=t[s],l=r?r(u,s,t):u;e&&!r?((!s||i!==l)&&a.push(u),i=l):r?an(i,l)||(i.push(l),a.push(u)):an(a,u)||a.push(u)}return a}const X1=dr(function(t){return zu(Yn(t,!0,!0))});function Y1(t){for(var e=[],r=arguments.length,n=0,a=vr(t);n<a;n++){var i=t[n];if(!an(e,i)){var s;for(s=1;s<r&&an(arguments[s],i);s++);s===r&&e.push(i)}}return e}function Vu(t){for(var e=t&&Cv(t,vr).length||0,r=Array(e),n=0;n<e;n++)r[n]=Nu(t,n);return r}const Z1=dr(Vu);function Q1(t,e){for(var r={},n=0,a=vr(t);n<a;n++)e?r[t[n]]=e[n]:r[t[n][0]]=t[n][1];return r}function J1(t,e,r){e==null&&(e=t||0,t=0),r||(r=e<t?-1:1);for(var n=Math.max(Math.ceil((e-t)/r),0),a=Array(n),i=0;i<n;i++,t+=r)a[i]=t;return a}function j1(t,e){if(e==null||e<1)return[];for(var r=[],n=0,a=t.length;n<a;)r.push(Ti.call(t,n,n+=e));return r}function $u(t,e){return t._chain?pt(e).chain():e}function Av(t){return nn(Tu(t),function(e){var r=pt[e]=t[e];pt.prototype[e]=function(){var n=[this._wrapped];return E2.apply(n,arguments),$u(this,r.apply(pt,n))}}),pt}nn(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=Ws[t];pt.prototype[t]=function(){var r=this._wrapped;return r!=null&&(e.apply(r,arguments),(t==="shift"||t==="splice")&&r.length===0&&delete r[0]),$u(this,r)}}),nn(["concat","join","slice"],function(t){var e=Ws[t];pt.prototype[t]=function(){var r=this._wrapped;return r!=null&&(r=e.apply(r,arguments)),$u(this,r)}});var Qn=Av(Object.freeze(Object.defineProperty({__proto__:null,VERSION:Cd,after:S1,all:Fv,allKeys:Di,any:Ev,assign:Ks,before:vv,bind:cv,bindAll:w1,chain:y1,chunk:j1,clone:e1,collect:Zn,compact:U1,compose:T1,constant:qd,contains:an,countBy:z1,create:j2,debounce:E1,default:pt,defaults:rv,defer:x1,delay:dv,detect:Lu,difference:Pv,drop:Ys,each:nn,escape:s1,every:Fv,extend:tv,extendOwn:Ks,filter:Ra,find:Lu,findIndex:Ru,findKey:hv,findLastIndex:pv,findWhere:P1,first:_u,flatten:G1,foldl:Ou,foldr:xv,forEach:nn,functions:Tu,get:iv,groupBy:N1,has:r1,head:_u,identity:ku,include:an,includes:an,indexBy:_1,indexOf:wv,initial:kv,inject:Ou,intersection:Y1,invert:ev,invoke:B1,isArguments:bu,isArray:Xn,isArrayBuffer:Nd,isBoolean:Rd,isDataView:Us,isDate:I2,isElement:B2,isEmpty:H2,isEqual:W2,isError:R2,isFinite:_2,isFunction:ur,isMap:K2,isMatch:Kd,isNaN:$d,isNull:A2,isNumber:Ld,isObject:Kn,isRegExp:M2,isSet:Y2,isString:mu,isSymbol:Od,isTypedArray:Ud,isUndefined:Md,isWeakMap:X2,isWeakSet:Z2,iteratee:Au,keys:Vt,last:W1,lastIndexOf:k1,map:Zn,mapObject:n1,matcher:Pi,matches:Pi,max:Cv,memoize:b1,methods:Tu,min:M1,mixin:Av,negate:Mu,noop:ov,now:Bi,object:Q1,omit:H1,once:D1,pairs:Q2,partial:Ma,partition:V1,pick:Dv,pluck:Nu,property:Pu,propertyOf:a1,random:Bu,range:J1,reduce:Ou,reduceRight:xv,reject:A1,rest:Ys,restArguments:dr,result:g1,sample:Sv,select:Ra,shuffle:L1,size:$1,some:Ev,sortBy:O1,sortedIndex:mv,tail:Ys,take:_u,tap:t1,template:h1,templateSettings:l1,throttle:F1,times:i1,toArray:Tv,toPath:av,transpose:Vu,unescape:u1,union:X1,uniq:zu,unique:zu,uniqueId:m1,unzip:Vu,values:Ia,where:I1,without:K1,wrap:C1,zip:Z1},Symbol.toStringTag,{value:"Module"})));Qn._=Qn;function Bv(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void Bv(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function ex(t){var e="",r,n;try{n=1,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewWidget.pug",e=e+'<div class="g-widget-item-previews-header">',n=2,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewWidget.pug",e=e+'<i class="icon-eye"></i>',n=3,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewWidget.pug",e=e+" Item Previews</div>",n=5,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewWidget.pug",e=e+'<div class="g-widget-item-previews-container">',n=6,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewWidget.pug",e=e+'<div class="g-widget-item-previews-wrapper"></div></div>'}catch(a){Bv(a,r,n)}return e}function Ii(t,e,r,n){if(e===!1||e==null||!e&&(t==="class"||t==="style"))return"";if(e===!0)return" "+(n?t:t+'="'+t+'"');var a=typeof e;return a!=="object"&&a!=="function"||typeof e.toJSON!="function"||(e=e.toJSON()),typeof e=="string"||(e=JSON.stringify(e),r||e.indexOf('"')===-1)?(r&&(e=Zs(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"}function Zs(t){var e=""+t,r=tx.exec(e);if(!r)return t;var n,a,i,s="";for(n=r.index,a=0;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}a!==n&&(s+=e.substring(a,n)),a=n+1,s+=i}return a!==n?s+e.substring(a,n):s}var tx=/["&<>]/;function Iv(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void Iv(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function rx(t){var e="",r,n,a;try{var i=t||{};(function(s,o,u){a=1,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+'<div class="g-widget-item-preview">',a=3,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<h4>",a=4,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<a"+(' class="g-item-preview-link"'+Ii("data-id",u.id,!0,!1))+">",a=4,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+Zs((r=u.name())==null?"":r)+"</a></h4>",a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",(function(){var l=o;if(typeof l.length=="number")for(var f=0,d=l.length;f<d;f++){var g=l[f];a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",g.type==="image"?(a=8,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<div>",a=9,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<img"+Ii("src",g.value,!0,!1)+"/></div>"):g.type==="json"&&(a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<textarea"+(' class="json"'+Ii("data-id",u.id,!0,!1))+">",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+Zs((r=s.stringify(g.value,null,"	"))==null?"":r)+"</textarea>")}else{var d=0;for(var f in l){d++;var g=l[f];a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",g.type==="image"?(a=8,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<div>",a=9,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<img"+Ii("src",g.value,!0,!1)+"/></div>"):g.type==="json"&&(a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+"<textarea"+(' class="json"'+Ii("data-id",u.id,!0,!1))+">",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/itemPreviewItem.pug",e=e+Zs((r=s.stringify(g.value,null,"	"))==null?"":r)+"</textarea>")}}}).call(this),e=e+"</div>"}).call(this,"JSON"in i?i.JSON:typeof JSON<"u"?JSON:void 0,"contents"in i?i.contents:typeof contents<"u"?contents:void 0,"item"in i?i.item:typeof item<"u"?item:void 0)}catch(s){Iv(s,n,a)}return e}const rF="",Mv=girder.views.View,{getApiRoot:nx,restRequest:Rv}=girder.rest,{_whenAll:Lv}=girder.misc;var ax=Mv.extend({events:{"click a.g-item-preview-link":function(t){var e=this.$(t.currentTarget).data("id");this.parentView.itemListView.trigger("g:itemClicked",this.collection.get(e))}},initialize:function(t){this.debouncedaddMoreItems=Qn.debounce(this.addMoreItems,100),this.onScroll=Qn.debounce(this.onScroll,100),this.initialized=!1,this.addingMoreItems=!1,this.supportedItems=[]},setCollection:function(t){this.collection=t,this.listenTo(this.collection,"g:changed",()=>{this.supportedItems=this.collection.filter(this._isSupportedItem.bind(this)),this.supportedItems.length!==0&&(this.isNotFull()||this.isNearBottom())&&this.debouncedaddMoreItems()})},_MAX_JSON_SIZE:2e6,_MAX_IMAGE_SIZE:2e7,_LOAD_BATCH_SIZE:2,_isSupportedItem:function(t){return this._isImageItem(t.name())||this._isJSONItem(t.name())},_isJSONItem:function(t){return/(json)$/i.test(t)},_isImageItem:function(t){return/(jpg|jpeg|png|gif)$/i.test(t)},setElement:function(t){return this.initialized=!1,Mv.prototype.setElement.apply(this,arguments)},render:function(){return this.initialized||(this.initialized=!0,this.renderedIndex=0,this.$el.html(ex()),this.$(".g-widget-item-previews-container").on("scroll",t=>this.onScroll(t)),this.debouncedaddMoreItems()),this},isNotFull:function(){return this.$(".g-widget-item-previews-wrapper").height()<=this.$(".g-widget-item-previews-container").height()},allItemAdded:function(){return this.renderedIndex>=this.supportedItems.length},addMoreItems:function(){this.addingMoreItems=!0;var t=this.supportedItems.slice(this.renderedIndex,this.renderedIndex+this._LOAD_BATCH_SIZE);if(this.renderedIndex=Math.min(this.renderedIndex+this._LOAD_BATCH_SIZE,this.supportedItems.length),!!t.length){var e=this.$(".g-widget-item-previews-wrapper");Lv(t.map(r=>Rv({url:`item/${r.id}/files`,data:{limit:5}}).then(n=>Lv(n.map(a=>this.tryGetFileContent(a,a.mimeType)))))).done(r=>{t.forEach((n,a)=>{var i=r[a].filter(s=>s);i.length&&e.append(rx({item:n,contents:i}))}),!this.allItemAdded()&&this.isNotFull()&&this.addMoreItems()}).always(()=>{this.addingMoreItems=!1})}},isNearBottom:function(){var t=this.$(".g-widget-item-previews-container");return t.scrollTop()+t.innerHeight()>=t[0].scrollHeight-200},onScroll:function(t){this.isNearBottom()&&!this.addingMoreItems&&!this.allItemAdded()&&this.addMoreItems()},tryGetFileContent:function(t,e){if(this._isJSONItem(t.name))return t.size>this._MAX_JSON_SIZE?un.Deferred().resolve(null).promise():this.getJsonContent(`file/${t._id}/download`);if(this._isImageItem(e))return t.size>this._MAX_IMAGE_SIZE?un.Deferred().resolve(null).promise():this.getImageContent(`file/${t._id}/download`)},getJsonContent:function(t){return Rv({url:t,method:"GET",error:null}).then(e=>({type:"json",value:e}))},getImageContent:function(t){var e=un.Deferred(),n=nx()+"/"+t,a=new Image;return a.onload=function(){e.resolve({type:"image",value:n})},a.src=n,e.promise()}});const{wrap:ix}=girder.utilities.PluginUtils,sx=girder.views.widgets.HierarchyWidget;ix(sx,"render",function(t){return t.call(this),this.parentModel.resourceName==="folder"&&this._showItems&&(this.itemPreviewView=new ax({class:"g-item-previews-container",collection:this.itemListView.collection,parentView:this}),this.$el.append(this.itemPreviewView.$el),this.itemPreviewView.setCollection(this.itemListView.collection),this.itemPreviewView.render()),this});function Ov(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void Ov(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function ox(t){var e="",r,n;try{n=1,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<div class="form-group">',n=2,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<label for="g-htmdec-data">',n=2,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+"HTMDEC Data",n=3,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<select class="form-control input-sm" id="g-htmdec-data">',n=4,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<option value="default" selected="selected">',n=4,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+"Not HTMDEC</option>",n=5,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<option value="sem">',n=5,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+"SEM Data</option>",n=6,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<option value="pdv">',n=6,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+"PDV Data</option>",n=7,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+'<option value="syncFolder">',n=7,r="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/filesystemImport.pug",e=e+"Sync Folder</option></select></label></div>"}catch(a){Ov(a,r,n)}return e}const ux=girder.router,Nv=girder.views.body.FilesystemImportView,{wrap:lx}=girder.utilities.PluginUtils;Nv.prototype.events["submit .g-filesystem-import-form"]=function(t){t.preventDefault();var e=this.$("#g-filesystem-import-dest-id").val().trim().split(/\s/)[0],r=this.$("#g-filesystem-import-dest-type").val(),n=this.$("#g-filesystem-import-leaf-items").val();this.$(".g-validation-failed-message").empty(),this.assetstore.off("g:imported").on("g:imported",function(){ux.navigate(r+"/"+e,{trigger:!0})},this).on("g:error",function(a){this.$(".g-validation-failed-message").text(a.responseJSON.message)},this).import({importPath:this.$("#g-filesystem-import-path").val().trim(),leafFoldersAsItems:n,destinationId:e,destinationType:r,dataType:this.$("#g-htmdec-data").val(),progress:!0})},lx(Nv,"render",function(t){return t.call(this),un(".g-filesystem-import-form > .form-group").last().after(ox()),this});function Dn(t,e,r,n){if(e===!1||e==null||!e&&(t==="class"||t==="style"))return"";if(e===!0)return" "+(n?t:t+'="'+t+'"');var a=typeof e;return a!=="object"&&a!=="function"||typeof e.toJSON!="function"||(e=e.toJSON()),typeof e=="string"||(e=JSON.stringify(e),r||e.indexOf('"')===-1)?(r&&(e=Mi(e))," "+t+'="'+e+'"'):" "+t+"='"+e.replace(/'/g,"&#39;")+"'"}function Mi(t){var e=""+t,r=fx.exec(e);if(!r)return t;var n,a,i,s="";for(n=r.index,a=0;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}a!==n&&(s+=e.substring(a,n)),a=n+1,s+=i}return a!==n?s+e.substring(a,n):s}var fx=/["&<>]/;function _v(t,e,r,n){if(!(t instanceof Error))throw t;if(!(typeof window>"u"&&e||n))throw t.message+=" on line "+r,t;var a,i,s,o;try{n=n||require("fs").readFileSync(e,{encoding:"utf8"}),a=3,i=n.split(`
`),s=Math.max(r-a,0),o=Math.min(i.length,r+a)}catch(u){return t.message+=" - could not read from "+e+" ("+u.message+")",void _v(t,null,r)}a=i.slice(s,o).map(function(u,l){var f=l+s+1;return(f==r?"  > ":"    ")+f+"| "+u}).join(`
`),t.path=e;try{t.message=(e||"Pug")+":"+r+`
`+a+`

`+t.message}catch{}throw t}function cx(t){var e="",r,n,a;try{var i=t||{};(function(s,o,u){a=1,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<div class="g-item-rel-sims g-info list-entry">',a=2,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<i class="icon-link-ext"></i>',a=3,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+"Related Data",a=4,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",(function(){var l=s;if(typeof l.length=="number")for(var f=0,d=l.length;f<d;f++){var g=l[f];a=5,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<li class="g-sim-list-entry">',a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+"<a"+(' class="g-item-list-link g-right-border"'+Dn("g-item-cid",g.cid,!0,!1)+Dn("href",`#folder/${g._id}`,!0,!1))+">",a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+Mi((r=g.name)==null?"":r)+"</a></li>"}else{var d=0;for(var f in l){d++;var g=l[f];a=5,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<li class="g-sim-list-entry">',a=6,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+"<a"+(' class="g-item-list-link g-right-border"'+Dn("g-item-cid",g.cid,!0,!1)+Dn("href",`#folder/${g._id}`,!0,!1))+">",a=7,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+Mi((r=g.name)==null?"":r)+"</a></li>"}}}).call(this),a=8,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",(function(){var l=o;if(typeof l.length=="number")for(var f=0,d=l.length;f<d;f++){var g=l[f];a=9,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",g._id!=u.model.id&&(a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<li class="g-sim-list-entry">',a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+"<a"+(' class="g-item-list-link g-right-border"'+Dn("g-item-cid",g.cid,!0,!1)+Dn("href",`#item/${g._id}`,!0,!1))+">",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+Mi((r=g.name)==null?"":r)+"</a></li>")}else{var d=0;for(var f in l){d++;var g=l[f];a=9,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",g._id!=u.model.id&&(a=10,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<li class="g-sim-list-entry">',a=11,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+"<a"+(' class="g-item-list-link g-right-border"'+Dn("g-item-cid",g.cid,!0,!1)+Dn("href",`#item/${g._id}`,!0,!1))+">",a=12,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+Mi((r=g.name)==null?"":r)+"</a></li>")}}}).call(this),e=e+"</div>",a=13,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<div class="g-item-analyze-in-wt g-info list-entry">',a=14,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<i class="icon-eye">',a=15,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+'<a class="g-item-list-link" id="ainwt" href="#" style="font-style: normal;">',a=16,n="/home/runner/work/girder-sem-viewer/girder-sem-viewer/girder_sem_viewer/web_client/templates/relatedDataWidget.pug",e=e+"Analyze in WholeTale</a></i></div>"}).call(this,"folders"in i?i.folders:typeof folders<"u"?folders:void 0,"items"in i?i.items:typeof items<"u"?items:void 0,"parentView"in i?i.parentView:typeof parentView<"u"?parentView:void 0)}catch(s){_v(s,n,a)}return e}const nF="",{restRequest:dx}=girder.rest,zv=girder.views.body.ItemView,{wrap:Vv}=girder.utilities.PluginUtils;Vv(zv,"initialize",function(t,...e){if(t.apply(this,e),this._dataRequest=null,this.model.attributes.meta&&this.model.attributes.meta.jhu_id){const r=this.model.attributes.meta.jhu_id,n={baseParentId:this.model.attributes.baseParentId,baseParentType:this.model.attributes.baseParentType};this._dataRequest=dx({url:"resource/search",data:{q:r,mode:"jhuId",types:JSON.stringify(["item","folder"]),filters:JSON.stringify(n),limit:10}})}}),Vv(zv,"render",function(t){return this.once("g:rendered",function(){this._dataRequest!==null&&this._dataRequest.done(e=>{$(".g-item-info").append(cx({items:e.item,folders:e.folder,parentView:this}));const r=e.item.map(u=>({itemId:u._id,mountPath:`/${u.name}`,_modelType:"item"})),n=e.folder.map(u=>({itemId:u._id,mountPath:`/${u.name}`,_modelType:"folder"})),a=r.concat(n),i=window.location.hostname.split(".")[0],s=window.location.origin.replace(i,"dashboard")+"/mine",o=new URLSearchParams;o.set("name","My Tale"),o.set("asTale",!1),o.set("dataSet",JSON.stringify(a)),document.querySelector("#ainwt").href=`${s}?${o.toString()}`})},this),t.call(this),this});const aF="",vx=girder.models.FileModel,hx=girder.models.FolderModel,gx=girder.views.widgets.HierarchyWidget,La=girder.views.widgets.UploadWidget,{getCurrentUser:px}=girder.auth,{AccessType:$v}=girder.constants,{formatSize:Qs}=girder.misc,{wrap:Jn}=girder.utilities.PluginUtils,{restRequest:mx}=girder.rest;function Js(t){const e=t.webkitRelativePath.split("/");return e.length>1?e.slice(0,-1).join("/")+"/":""}function yx(t){const e=Array.from(t),r=new Map;return e.sort((n,a)=>{const i=Js(n),s=Js(a);return i.localeCompare(s)}),e.forEach(n=>{const a=Js(n);r.has(a)||r.set(a,[]),r.get(a).push(n)}),Array.from(r.values())}Jn(La,"initialize",function(t,e){return t.call(this,e),this.onlyFiles=Qn.has(e,"onlyFiles")?e.onlyFiles:!1,this.onlyFolders=Qn.has(e,"onlyFolders")?e.onlyFolders:!1,this}),Jn(La,"render",function(t){if(this.parentType=this.parent.attributes._modelType,t.call(this),this.parentType!=="item"&&!this.onlyFiles){var e='<div class="g-upload-folder"><i class="icon-folder-open"></i>Select a folder to upload</div>';e+='<div class="form-group hide"><input type="file" id="folderInput" webkitdirectory multiple></div>',this.$(".g-drop-zone").after(e)}return(this.parentType==="user"||this.parentType==="collection"||this.onlyFolders)&&this.$(".g-drop-zone").addClass("hide"),this}),Jn(La,"events",function(t){return this.events["submit #g-upload-form"]=function(e){e.preventDefault(),this.$(".g-upload-folder").addClass("hide"),this.startUpload()},this.events["click .g-resume-upload"]=function(){this.$(".g-upload-error-message").html(""),this.currentFile.resumeUpload()},this.events["click .g-restart-upload"]=function(){this.$(".g-upload-error-message").html(""),this.uploadNextFile()},this.events["change #g-files"]=function(){var e=this.$("#g-files")[0].files;e.length&&(this.files=e,this.filesChanged())},this.events["click .g-drop-zone"]=function(){this.$("#g-files").click()},this.events["dragenter .g-drop-zone"]=function(e){e.stopPropagation(),e.preventDefault(),e.originalEvent.dataTransfer.dropEffect="copy",this.$(".g-drop-zone").addClass("g-dropzone-show").html('<i class="icon-bullseye"/> Drop files here')},this.events["dragleave .g-drop-zone"]=function(e){e.stopPropagation(),e.preventDefault(),this.$(".g-drop-zone").removeClass("g-dropzone-show").html('<i class="icon-docs"/> Browse or drop files')},this.events["dragover .g-drop-zone"]=function(e){var r=e.originalEvent.dataTransfer;if(r){var n=r.effectAllowed;r.dropEffect=n==="move"||n==="linkMove"?"move":"copy",e.preventDefault()}},this.events["drop .g-drop-zone"]="filesDropped",this.events["click .g-upload-folder"]=function(){this.$("#folderInput").click()},this.events["change #folderInput"]=function(){var e=this.$("#folderInput")[0].files;e.length>0&&(this.files=e,this.filesChanged())},this.events}),Jn(La,"uploadNextFile",function(t){const e=yx(this.files);e.length===1&&e[0][0].webkitRelativePath===""?t.call(this):(this.totalFiles=this.files.length,this.groupedFiles=e,this.currentDirIndex=0,this.uploadNextFileRecursive())}),Jn(La,"uploadNextFileRecursive",function(t){this.files=this.groupedFiles[this.currentDirIndex],this._currentDirFileIndex=0,this._currentDirTotalFiles=this.files.length;const e=Js(this.files[0]).slice(0,-1);if(this.currentDirIndex>=this.groupedFiles.length){this.modal&&this.$el.modal("hide"),this.trigger("g:uploadFinished",{files:[].concat(...this.groupedFiles),totalFiles:this.totalFiles,folder:e});return}var r=this;mx({url:"folder/recursive",method:"POST",data:{parentId:this.parent.id,parentType:this.parentType,path:e}}).done(function(n){var a=new hx;a.set(n),r._uploadNext(a)})}),Jn(La,"_uploadNext",function(t,e){if(!(this._currentDirFileIndex>=this._currentDirTotalFiles)){this.currentFile=new vx,this.currentFile.on("g:upload.complete",function(){this.files[this._currentDirFileIndex].id=this.currentFile.id,this._currentDirFileIndex+=1,this._currentDirFileIndex<this._currentDirTotalFiles?this._uploadNext(e):(this.currentDirIndex+=1,this.currentDirIndex<this.groupedFiles.length?this.uploadNextFileRecursive():(this.modal&&this.$el.modal("hide"),this.trigger("g:uploadFinished",{files:[].concat(...this.groupedFiles),totalFiles:this.totalFiles})))},this).on("g:upload.chunkSent",function(n){this.overallProgress+=n.bytes},this).on("g:upload.progress",function(n){var a=n.startByte+n.loaded;this.$(".g-progress-current>.progress-bar").css("width",Math.ceil(100*a/n.total)+"%"),this.$(".g-progress-overall>.progress-bar").css("width",Math.ceil(100*(this.overallProgress+n.loaded)/this.totalSize)+"%"),this.$(".g-current-progress-message").html('<i class="icon-doc-text"/>'+(this.currentIndex+1)+" of "+this.files.length+" - <b>"+n.file.name+"</b>: "+Qs(a)+" / "+Qs(n.total)),this.$(".g-overall-progress-message").html("Overall progress: "+Qs(this.overallProgress+n.loaded)+" / "+Qs(this.totalSize))},this).on("g:upload.error",function(n){var a=n.message+' <a class="g-resume-upload">Click here to resume the upload</a>';un(".g-upload-error-message").html(a)},this).on("g:upload.errorStarting",function(n){var a=n.message+' <a class="g-restart-upload">Click here to restart the upload</a>';un(".g-upload-error-message").html(a)},this);var r=this.otherParams;Qn.isFunction(this.otherParams)&&(r=this.otherParams(this)),this.currentFile.upload(e,this.files[this._currentDirFileIndex],null,r)}}),Jn(gx,"render",function(t){const e=this.parentModel.getAccessLevel(),r=px(),n=this.parentModel.resourceName,a=`<button
                      class="g-upload-here-button btn btn-sm btn-success"
                      title="Upload here">
                      <i class="icon-upload"></i>
                    </button>`;t.call(this);const i=this.$(".g-folder-header-buttons");r&&n==="collection"&&e>=$v.WRITE&&i.length>0&&this.$(".g-collection-info-button").after(a),r&&n==="user"&&e>=$v.WRITE&&i.prepend(a)});const{wrap:wx}=girder.utilities.PluginUtils,bx=girder.views.body.ItemView,xx=girder.views.widgets.SearchFieldWidget;wx(bx,"render",function(t){return this.once("g:rendered",()=>{(this.model.attributes.name.endsWith(".tif")||this.model.attributes.name.endsWith(".tiff"))&&new ch({parentView:this,item:this.model}).render().$el.insertAfter(this.$(".g-item-info")),this.model.attributes.meta&&this.model.attributes.meta.graphml&&new F2({parentView:this,graphId:this.model.attributes.meta.graphml}).render().$el.insertAfter(this.$(".g-item-info"))}),t.call(this)}),xx.addMode("jhuId",["item","folder"],"Search by JHU ID","You are searching for all data collected for a specific JHU ID. (e.g. F138-R2C7)")});
//# sourceMappingURL=girder-plugin-sem-viewer.umd.cjs.map
