@qaecy/cue-ui 0.0.58 → 0.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/1520.js +1 -1
- package/{2021.js → 1701.js} +1 -1
- package/1837.js +1 -1
- package/2283.js +1 -1
- package/2317.js +1 -1
- package/2775.js +1 -1
- package/2839.js +1 -1
- package/29.js +1 -1
- package/3202.js +1 -0
- package/{5277.js → 3213.js} +1 -1
- package/3614.js +1 -1
- package/{2003.js → 3842.js} +1 -1
- package/3869.js +1 -0
- package/4098.js +1 -1
- package/5381.js +1 -1
- package/5649.js +1 -1
- package/6233.js +1 -1
- package/6947.js +1 -1
- package/7727.js +1 -0
- package/9396.js +1 -1
- package/9707.js +1 -0
- package/992.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/2081.js +0 -1
- package/880.js +0 -1
- package/8855.js +0 -1
package/{2021.js → 1701.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[2021],{6034(Ze,Re,Y){"use strict";Y.d(Re,{y:()=>$});var q=Y(7705),M=Y(7598),E=Y(9769),T=Y(5187),I=Y(2271),y=Y(5547);const x=["*"];let b=(()=>{class B{style=(0,q.hFB)("");gap=(0,q.hFB)("m");columns=(0,q.hFB)(1);getStyles=(0,I.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(xe){return new(xe||B)};static \u0275cmp=y.VBU({type:B,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(xe,ne){2&xe&&y.Aen(ne.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:x,decls:1,vars:0,template:function(xe,ne){1&xe&&(y.NAR(),y.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return B})();var A=Y(2245),D=Y(5381),k=Y(29);const G=["*"];function P(B,re){if(1&B&&(y.j41(0,"cue-typography",2),y.EFF(1),y.k0s()),2&B){const j=y.XpG();y.R7$(),y.SpI(" ",j.label()," ")}}let $=(()=>{class B{label=(0,q.hFB)("");variant=(0,q.hFB)("default");shadow=(0,q.hFB)(!1);padded=(0,q.hFB)(!0);showCloseBtn=(0,q.hFB)(!0);position=(0,q.hFB)("top-left");clickedClose=(0,q.CGW)();margin=(0,q.hFB)("0.5rem");close(j){j.stopPropagation(),j.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(xe){return new(xe||B)};static \u0275cmp=y.VBU({type:B,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:G,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(xe,ne){1&xe&&(y.NAR(),y.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),y.nVh(4,P,2,1,"cue-typography",2),y.nrm(5,"span",3),y.j41(6,"cue-svg-icon",4),y.bIt("click",function(S){return ne.close(S)}),y.k0s()(),y.SdG(7),y.k0s()()()),2&xe&&(y.xc7("top","top-left"===ne.position()||"top-right"===ne.position()?ne.margin():"null")("bottom","bottom-left"===ne.position()||"bottom-right"===ne.position()?ne.margin():"null")("left","top-left"===ne.position()||"bottom-left"===ne.position()?ne.margin():"null")("right","top-right"===ne.position()||"bottom-right"===ne.position()?ne.margin():"null"),y.Y8G("variant",ne.variant())("shadow",ne.shadow())("padded",ne.padded()),y.R7$(3),y.xc7("padding",ne.padded()?"0":"10px"),y.R7$(),y.vxM(ne.label()&&"undefined"!==ne.label()?4:-1))},dependencies:[E.MD,T.Card,b,A.Typography,D.FlexContainer,k.A,M.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content;z-index:100}"]})}return B})()},9134(Ze,Re,Y){"use strict";Y.d(Re,{v:()=>I});var q=Y(7705),M=Y(6034),E=Y(7517),T=Y(5547);let I=(()=>{class y{title=(0,q.hFB)("Legend");layers=(0,q.hFB)([]);position=(0,q.hFB)("top-left");close=(0,q.CGW)();visibilityChange=(0,q.CGW)();layerChange=(0,q.CGW)();visibilityAll=(0,q.CGW)();static \u0275fac=function(A){return new(A||y)};static \u0275cmp=T.VBU({type:y,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(A,D){1&A&&(T.j41(0,"cue-draggable-card",0),T.bIt("clickedClose",function(){return D.close.emit()}),T.j41(1,"div",1)(2,"cue-layer-legend",2),T.bIt("visibilityAll",function(G){return D.visibilityAll.emit(G)})("layerChange",function(G){return D.layerChange.emit(G)})("visibilityChange",function(G){return D.visibilityChange.emit(G)}),T.k0s()()()),2&A&&(T.Y8G("label",D.title())("padded",!1)("position",D.position()),T.R7$(2),T.Y8G("layers",D.layers()))},dependencies:[M.y,E.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return y})()},9937(Ze,Re,Y){"use strict";Y.d(Re,{t:()=>M0});var q=Y(467),M=Y(7705),E=Y(5802),T=Y(2271);class I{hideClassAssignmentTriples=!0;hideDatatypePropertyTriples=!0;collapseIntoClassificationLabels=[];preferredLabelLanguage="en";showClassLabelOnInstance=!0}var x=Y(2130),b=Y(8402);class A{_doc;_omitClassAssignments;_omitDatatypeProperties;_preferredLabelLanguage;_collapseIntoClassificationLabels;_context;_nodes=[];_edges=[];_seenNodes=[];_resourceLabels={};_resourceAltLabels={};_resolvedCollapsePredicates=new Set;_knownPrefixes={schema:"http://schema.org/"};constructor(e,t=!0,n=!0,a="en",i=[]){this._doc=e,this._omitClassAssignments=t,this._omitDatatypeProperties=n,this._preferredLabelLanguage=a,this._collapseIntoClassificationLabels=i}get elementData(){return{nodes:this._nodes,edges:this._edges}}init(){var e=this;return(0,q.A)(function*(){return"http://schema.org/"==e._doc["@context"]&&(e._doc["@context"]="https://schema.org/"),e._context={...e._doc["@context"],...e._knownPrefixes},e._nodes=[],e._edges=[],e._seenNodes=[],e._resourceLabels={},e._resourceAltLabels={},e._resolvedCollapsePredicates=new Set(e._collapseIntoClassificationLabels.map(n=>e._expandIRI(n))),(yield(0,x.toRDF)(e._doc)).forEach(n=>e._processQuad(n)),e._nodes=e._appendNames(e._nodes),e._edges=e._appendNames(e._edges),{nodes:e._nodes,edges:e._edges}})()}append(e){var t=this;return(0,q.A)(function*(){return(yield(0,x.toRDF)(e)).forEach(a=>t._processQuad(a)),t._nodes=t._appendNames(t._nodes),t._edges=t._appendNames(t._edges),{nodes:t._nodes,edges:t._edges}})()}_processQuad(e){const t=e.subject.value;let n=e.predicate.value,a=e.object.value;if("http://www.w3.org/2004/02/skos/core#prefLabel"===n||"http://www.w3.org/2000/01/rdf-schema#label"===n||"http://schema.org/name"===n)return void(Object.keys(this._resourceLabels).includes(t)?this._resourceLabels[t].push(e.object):this._resourceLabels[t]=[e.object]);if("http://www.w3.org/2004/02/skos/core#altLabel"===n)return void(Object.keys(this._resourceAltLabels).includes(t)?this._resourceAltLabels[t].push(e.object):this._resourceAltLabels[t]=[e.object]);if(this._appendNamedNode(t),this._resolvedCollapsePredicates.has(n)){const s=this._nodes.find(o=>o.data.id===t);return void(void 0!==s&&(void 0===s.data.boxLabels&&(s.data.boxLabels=[]),s.data.boxLabels.push(this._appendPrefix(a))))}if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===n&&(n="a",this._seenNodes.includes(t))){const s=this._nodes.find(o=>o.data.id===t);void 0!==s&&(void 0===s.data.boxLabels&&(s.data.boxLabels=[]),s.data.boxLabels.push(this._appendPrefix(a)))}const i=e.object.termType;if("Literal"===i){if(a=this._appendLiteralNode(a),this._seenNodes.includes(t)){const s=this._nodes.find(o=>o.data.id===t);if(void 0!==s){void 0===s.data.properties&&(s.data.properties={});const o=this._getIdFromIRI(n);s.data.properties[o]=e.object.value}}}else"BlankNode"===i?this._appendNamedNode(a,"individual"):"NamedNode"===i?this._appendNamedNode(a,"a"===n?"class":"individual"):console.warn("Unknown term type "+i);this._appendEdge(t,n,a,"Literal"===i)}_appendNames(e){return e.map(t=>{const n=t.data.iri,a=(void 0!==t.data.id?this._resourceLabels[t.data.id]:void 0)??(void 0!==n?this._resourceLabels[n]:void 0)??(void 0!==t.data.id?this._resourceAltLabels[t.data.id]:void 0)??(void 0!==n?this._resourceAltLabels[n]:void 0);if(Array.isArray(a))1===a.length?t.data.label=a[0].value:console.log("MORE THAN ONE LABEL NOT YET SUPPORTED");else{if("class"===t.classes){if(null==t.data.iri)return t;t.data.label=this._getIdFromIRI(t.data.iri)}if("edge"===t.classes){if(null==t.data.iri)return t;t.data.label=this._getIdFromIRI(t.data.iri)}}const i=t.data;return void 0!==i.size&&(""!=t.data.label&&(i.size=44),Array.isArray(i.boxLabels)&&(i.boxLabels=i.boxLabels.map(s=>{const o=this._expandIRI(s),l=this._resourceLabels[o]??this._resourceAltLabels[o];return Array.isArray(l)&&l.length>0?l[0].value:s}))),t})}_appendNamedNode(e,t="individual"){if(!this._omitClassAssignments||"class"!==t)if(this._seenNodes.includes(e)){if("class"===t){const n=this._nodes.find(a=>a.data.id===e);null!=n&&(n.classes=t)}}else this._nodes.push({data:{id:e,iri:e,label:"",size:24},classes:t}),this._seenNodes.push(e)}_appendLiteralNode(e){if(this._omitDatatypeProperties)return"";""===e&&(e="-");const t=this._camelize(e);return this._seenNodes.includes(t)||(this._nodes.push({data:{id:t,label:e,size:2*e.length},classes:"literal"}),this._seenNodes.push(t)),t}_appendEdge(e,t,n,a=!1){this._omitClassAssignments&&"a"===t||this._omitDatatypeProperties&&a||this._edges.push({data:{id:(0,b.A)(),source:e,target:n,label:this._appendPrefix(t),iri:t},classes:"edge"})}_expandIRI(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;const t=e.indexOf(":");if(t>0){const n=e.substring(0,t),a=e.substring(t+1),i=this._context?.[n];if(i)return i+a}return e}_appendPrefix(e){const t=Object.keys(this._context),n=Object.values(this._context);for(const a in n){const i=n[a];if(e.startsWith(i)){e=e.replace(i,`${t[a]}:`);break}}return e}_camelize(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(t,n){return 0===n?t.toLowerCase():t.toUpperCase()}).replace(/\s+/g,"")}_getIdFromIRI(e){return e.includes("#")?e.split("#")[1]:e.split("/").pop()??e}}class D{_doc;_settings;_elementDataHandler;_elementData;constructor(e,t=new I){this._doc=e,this._settings=t,this._elementDataHandler=new A(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels)}set settings(e){this._settings=e,this._elementDataHandler=new A(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels)}init(){var e=this;return(0,q.A)(function*(){return e._elementData=yield e._elementDataHandler.init(),e._elementData})()}appendElementData(e){var t=this;return(0,q.A)(function*(){return t._elementData=yield t._elementDataHandler.append(e),t._elementData})()}compact(){console.log("COMPACT")}expand(){console.log("EXPAND")}}class G{props={display:!0,displayOnlyOnHover:!0};boxLabels={display:!0,displayOnlyOnHover:!1}}function P(r,e,t=new G){function n(){r.nodes().forEach(s=>{const o=s.renderedHeight(),l=document.getElementById(`box-${s.id()}`);if(l){if(t.boxLabels.display){const u=s.data().boxLabels;if(void 0!==u){let c=document.getElementById(`labels-box-${s.id()}`);c?c.style.bottom=o/2-10+"px":(c=document.createElement("div"),c.id=`labels-box-${s.id()}`,c.className="box-label",c.style.bottom=o/2-10+"px",t.boxLabels.displayOnlyOnHover&&(c.style.display="none"),l.appendChild(c),u.forEach((d,f)=>{if(!c)return;const h=document.createElement("div");h.id=`labels-box-${s.id()}-${f}`,h.className="entry",h.innerHTML=d,c.appendChild(h)}))}}if(t.props.display){const u=s.data().properties;if(void 0!==u){let c=document.getElementById(`props-box-${s.id()}`);c?c.style.top=o/2-10+"px":(c=document.createElement("div"),c.id=`props-box-${s.id()}`,c.style.right="0px",c.className="property",c.style.top=o/2-10+"px",t.props.displayOnlyOnHover&&(c.style.display="none"),l.appendChild(c),Object.keys(u).forEach((d,f)=>{if(!c)return;const h=document.createElement("div");h.id=`props-box-${s.id()}-${f}`,h.className="entry",h.innerHTML=`<span class="key">${d}</span><span class="value">${u[d]}</span>`,c.appendChild(h)}))}}}})}!function k(r,e){function t(){r.nodes().forEach(a=>{const i=a.renderedPosition();let s=document.getElementById(`box-${a.id()}`);s||(s=document.createElement("div"),s.id=`box-${a.id()}`,s.style.position="absolute",e.appendChild(s)),s.style.left=`${i.x}px`,s.style.top=`${i.y}px`})}t(),r.on("position","node",t),r.on("pan zoom",t),r.on("remove","node",function n(a){const i=a.target.id(),s=document.getElementById(`box-${i}`);s&&s.remove()}),window.addEventListener("resize",t)}(r,e),n(),r.on("zoom",()=>{n(),function i(){if(!t.boxLabels.display)return;const o=r.zoom()>=.6;r.nodes().forEach(l=>{const u=document.getElementById(`labels-box-${l.id()}`);u&&(t.boxLabels.displayOnlyOnHover||(u.style.display=o?"flex":"none"))})}()}),r.on("mouseover","node",s=>{const o=s.target;if(t.props.displayOnlyOnHover){const l=document.getElementById(`props-box-${o.id()}`);l&&(l.style.display="flex")}if(t.boxLabels.displayOnlyOnHover){const l=document.getElementById(`labels-box-${o.id()}`);l&&(l.style.display="flex")}}),r.on("mouseout","node",s=>{const o=s.target;if(t.props.displayOnlyOnHover){const l=document.getElementById(`props-box-${o.id()}`);l&&(l.style.display="none")}if(t.boxLabels.displayOnlyOnHover){const l=document.getElementById(`labels-box-${o.id()}`);l&&(l.style.display="none")}})}function O(r){return getComputedStyle(document.documentElement).getPropertyValue(r).trim()}const $={get backgroundColor(){return O("--cue-main-background")||"#f5f6f9"},get edgeColor(){return O("--cue-primary")||"#2859e1"},edgeFontSize:"5rem",edgeWidth:"1.5rem",get nodeColor(){return O("--cue-primary")||"#2859e1"},nodeOpacity:"0.9",font:"Poppins",directed:!0,labelSelector:"label",showNodeLabels:!0,showEdgeLabels:!0,get hoverBorderColor(){return O("--cue-primary")||"#2859e1"},get textColor(){return O("--cue-primaryContrast")||"#ffffff"}},B=(r=$)=>{const e=O("--cue-primary")||"#2859e1",t=O("--cue-primaryContrast")||"#ffffff",n=O("--cue-accent")||"#e2f552",a=O("--cue-accentContrast")||"#121c2b",i=O("--cue-neutral")||"#8394b0",s=O("--cue-main-foreground")||"#121c2b",o=r.backgroundColor;return[{selector:"node",style:{label:l=>l.data(r.labelSelector)&&r.showNodeLabels?l.data(r.labelSelector):"",shape:"round-rectangle","text-valign":"bottom","text-margin-y":10,"font-family":r.font,"font-size":"6rem",opacity:r.nodeOpacity,color:s,"text-outline-width":0,"text-outline-color":l=>l.data("color")?l.data("color"):e,"background-color":l=>l.data("color")?l.data("color"):e,width:l=>l.data("size")?l.data("size"):"24",height:l=>l.data("size")?l.data("size"):"24","background-image":l=>l.data("imgPath")?l.data("imgPath"):"none","background-fit":"cover","background-width":"100%","background-height":"100%","background-image-opacity":.2}},{selector:"edge",style:{label:"","font-family":r.font,"font-size":r.edgeFontSize,color:e,"target-arrow-color":e,"curve-style":"bezier","target-arrow-shape":r.directed?"triangle":"none","arrow-scale":.8,"line-color":e,"line-opacity":.5,width:l=>l.data("width")?l.data("width"):r.edgeWidth}},{selector:"edge.edge-hover",style:{label:l=>l.data(r.labelSelector)&&r.showEdgeLabels?l.data(r.labelSelector):"","line-opacity":1,width:l=>l.data("width")?l.data("width"):r.edgeWidth,"text-valign":"center","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":o,"text-background-padding":4,"font-size":r.edgeFontSize,"font-weight":"600"}},{selector:".triple",style:{"background-color":o,"border-color":l=>l.data("color")?l.data("color"):e}},{selector:".literal",style:{label:l=>l.data(r.labelSelector)?l.data(r.labelSelector):"","text-valign":"center","font-size":"6rem","border-color":s,"background-color":o,"text-outline-width":0,"border-width":0,"background-opacity":0,color:s}},{selector:".loading",style:{shape:"ellipse","pie-size":"100%","pie-1-background-color":e,"pie-1-background-size":l=>`${l.data("pct")}%`,"pie-2-background-color":n,"pie-2-background-size":l=>100-parseInt(l.data("pct"))+"%",label:l=>void 0!==l.data("pct")&&100!==l.data("pct")?`${parseInt(l.data("pct"))}%`:"","font-size":"5rem","border-width":1,"border-opacity":1,"border-color":t}},{selector:".dropzone",style:{"border-color":e,"border-width":6,"border-opacity":1}},{selector:".collapser",style:{"background-color":i,"text-outline-color":i,"text-outline-width":0,"text-valign":"center",color:t,"border-width":0,"border-opacity":0,opacity:1}},{selector:".collapser-expanded",style:{opacity:.65}},{selector:".class",style:{"background-color":n,"text-outline-color":n,color:a}},{selector:".faded",style:{opacity:.12}},{selector:"node.focused",style:{"outline-color":l=>l.data("color")||e,"outline-width":"2px","outline-offset":"3px","outline-opacity":.5,"outline-style":"solid"}}]};class j{_requestId;_animationRunning=!1;constructor(e,t=!0,n=1e-4,a=.02){this._build(e,t,n,a)}stop(){void 0!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0,this._animationRunning=!1)}_build(e,t=!0,n=1e-4,a=.02){const i=()=>{this._animationRunning&&(e.nodes().forEach((s,o)=>{const l=s.position(),u=Math.sin(performance.now()*n+o)*a,c=Math.cos(performance.now()*n+o)*a;s.position({x:l.x+u,y:l.y+c})}),this._requestId=requestAnimationFrame(i))};this._animationRunning=!0,this._requestId=requestAnimationFrame(i),t&&e.on("mouseover","node",()=>{this.stop()})}}var xe=Y(6894),ne=Y.n(xe);function R(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function _(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ie(r,e,t){return e&&function ee(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,Me(n.key),n)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function H(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=se(r))||e){t&&(r=t);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||null==t.return||t.return()}finally{if(o)throw i}}}}function ae(r,e,t){return(e=Me(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fe(r,e){return function S(r){if(Array.isArray(r))return r}(r)||function ve(r,e){var t=null==r?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,a,i,s,o=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw a}}return o}}(r,e)||se(r,e)||function Ee(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(r){return function L(r){if(Array.isArray(r))return R(r)}(r)||function me(r){if(typeof Symbol<"u"&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||se(r)||function Ge(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Me(r){var e=function ce(r,e){if("object"!=typeof r||!r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(r,"string");return"symbol"==typeof e?e:e+""}function pe(r){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function se(r,e){if(r){if("string"==typeof r)return R(r,e);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?R(r,e):void 0}}var $i,Tl,Ki,Cl,Zi,Dl,Ji,Sl,Qi,Ll,es,Al,ts,Il,ns,Nl,as,Rl,is,Ml,ss,Pl,os,kl,ls,Bl,us,_l,Ne=typeof window>"u"?null:window,Je=Ne?Ne.navigator:null,qe=pe(""),et=pe({}),ke=pe(function(){}),We=typeof HTMLElement>"u"?"undefined":pe(HTMLElement),we=function(e){return e&&e.instanceString&&Be(e.instanceString)?e.instanceString():null},oe=function(e){return null!=e&&pe(e)==qe},Be=function(e){return null!=e&&pe(e)===ke},Ye=function(e){return!vt(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},Oe=function(e){return null!=e&&pe(e)===et&&!Ye(e)&&e.constructor===Object},_e=function(e){return null!=e&&pe(e)===pe(1)&&!isNaN(e)},nt=function(e){if("undefined"!==We)return null!=e&&e instanceof HTMLElement},vt=function(e){return It(e)||$t(e)},It=function(e){return"collection"===we(e)&&e._private.single},$t=function(e){return"collection"===we(e)&&!e._private.single},xr=function(e){return"core"===we(e)},gn=function(e){return"stylesheet"===we(e)},Sr=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},Hf=function(e){return function(e){return null!=e&&pe(e)===et}(e)&&Be(e.then)},Mn=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var n=function(){var o,s=arguments,l=t.apply(this,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(this,s)),o};return n.cache={},n},qi=Mn(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ua=Mn(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),yl=Mn(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),ml=function(e){return Sr(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Kr=function(e,t){return e.slice(-1*t.length)===t},Jt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Xf="rgb[a]?\\(("+Jt+"[%]?)\\s*,\\s*("+Jt+"[%]?)\\s*,\\s*("+Jt+"[%]?)(?:\\s*,\\s*("+Jt+"))?\\)",jf="rgb[a]?\\((?:"+Jt+"[%]?)\\s*,\\s*(?:"+Jt+"[%]?)\\s*,\\s*(?:"+Jt+"[%]?)(?:\\s*,\\s*(?:"+Jt+"))?\\)",Yf="hsl[a]?\\(("+Jt+")\\s*,\\s*("+Jt+"[%])\\s*,\\s*("+Jt+"[%])(?:\\s*,\\s*("+Jt+"))?\\)",Wf="hsl[a]?\\((?:"+Jt+")\\s*,\\s*(?:"+Jt+"[%])\\s*,\\s*(?:"+Jt+"[%])(?:\\s*,\\s*(?:"+Jt+"))?\\)",bl=function(e,t){return e<t?-1:e>t?1:0},mt=null!=Object.assign?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(null!=n)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];r[s]=n[s]}}return r},wl=function(e){return(Ye(e)?e:null)||function(e){return th[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var n,a,i,s=16;return 4===e.length?(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]}}(e)||function(e){var t,n=new RegExp("^"+Xf+"$").exec(e);if(n){t=[];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;t.push(Math.floor(s))}if((a[1]||a[2]||a[3])&&!(a[1]&&a[2]&&a[3]))return;var u=n[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;t.push(u)}}return t}(e)||function(e){var t,n,a,i,s,o,l,u;function c(v,m,p){return p<0&&(p+=1),p>1&&(p-=1),p<1/6?v+6*(m-v)*p:p<.5?m:p<2/3?v+(m-v)*(2/3-p)*6:v}var d=new RegExp("^"+Yf+"$").exec(e);if(d){if((n=parseInt(d[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(a=parseFloat(d[2]))<0||a>100||(a/=100,(i=parseFloat(d[3]))<0||i>100)||(i/=100,void 0!==(s=d[4])&&((s=parseFloat(s))<0||s>1)))return;if(0===a)o=l=u=Math.round(255*i);else{var f=i<.5?i*(1+a):i+a-i*a,h=2*i-f;o=Math.round(255*c(h,f,n+1/3)),l=Math.round(255*c(h,f,n)),u=Math.round(255*c(h,f,n-1/3))}t=[o,l,u,s]}return t}(e)},th={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]},xl=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to set map with object key");i<n.length-1?(null==t[s]&&(t[s]={}),t=t[s]):t[s]=e.value}},El=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to get map with object key");if(null==(t=t[s]))return t}return t},Xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oa(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function la(){return Tl?$i:(Tl=1,$i=function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)})}function ja(){if(Dl)return Zi;Dl=1;var r=function rh(){return Cl?Ki:(Cl=1,Ki="object"==typeof Xa&&Xa&&Xa.Object===Object&&Xa)}(),e="object"==typeof self&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Zi=t}function rs(){if(Il)return ts;Il=1;var r=ja();return ts=r.Symbol}function Ol(){if(Ml)return is;Ml=1;var r=rs(),e=function sh(){if(Nl)return ns;Nl=1;var r=rs(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;return ns=function i(s){var o=t.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}}(),t=function oh(){if(Rl)return as;Rl=1;var e=Object.prototype.toString;return as=function t(n){return e.call(n)}}(),i=r?r.toStringTag:void 0;return is=function s(o){return null==o?void 0===o?"[object Undefined]":"[object Null]":i&&i in Object(o)?e(o):t(o)}}function ua(){if(kl)return os;kl=1;var r=Ol(),e=function lh(){return Pl?ss:(Pl=1,ss=function r(e){return null!=e&&"object"==typeof e})}();return os=function n(a){return"symbol"==typeof a||e(a)&&"[object Symbol]"==r(a)}}var dh=function ch(){if(_l)return us;_l=1;var r=la(),e=function nh(){if(Sl)return Ji;Sl=1;var r=ja();return Ji=function(){return r.Date.now()}}(),t=function uh(){if(Bl)return ls;Bl=1;var r=function ih(){if(Al)return es;Al=1;var r=function ah(){if(Ll)return Qi;Ll=1;var r=/\s/;return Qi=function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}}(),e=/^\s+/;return es=function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}}(),e=la(),t=ua(),a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;return ls=function l(u){if("number"==typeof u)return u;if(t(u))return NaN;if(e(u)){var c="function"==typeof u.valueOf?u.valueOf():u;u=e(c)?c+"":c}if("string"!=typeof u)return 0===u?u:+u;u=r(u);var d=i.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):a.test(u)?NaN:+u}}(),a=Math.max,i=Math.min;return us=function s(o,l,u){var c,d,f,h,v,m,p=0,g=!1,w=!1,C=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function N(Q){var le=c,de=d;return c=d=void 0,p=Q,h=o.apply(de,le)}function F(Q){var le=Q-m;return void 0===m||le>=l||le<0||w&&Q-p>=f}function U(){var Q=e();if(F(Q))return W(Q);v=setTimeout(U,function V(Q){var he=l-(Q-m);return w?i(he,f-(Q-p)):he}(Q))}function W(Q){return v=void 0,C&&c?N(Q):(c=d=void 0,h)}function J(){var Q=e(),le=F(Q);if(c=arguments,d=this,m=Q,le){if(void 0===v)return function z(Q){return p=Q,v=setTimeout(U,l),g?N(Q):h}(m);if(w)return clearTimeout(v),v=setTimeout(U,l),N(m)}return void 0===v&&(v=setTimeout(U,l)),h}return l=t(l)||0,r(u)&&(g=!!u.leading,f=(w="maxWait"in u)?a(t(u.maxWait)||0,l):f,C="trailing"in u?!!u.trailing:C),J.cancel=function Z(){void 0!==v&&clearTimeout(v),p=0,c=m=d=v=void 0},J.flush=function K(){return void 0===v?h:W(e())},J},us}(),ca=oa(dh),cs=Ne?Ne.performance:null,Fl=cs&&cs.now?function(){return cs.now()}:function(){return Date.now()},fh=function(){if(Ne){if(Ne.requestAnimationFrame)return function(r){Ne.requestAnimationFrame(r)};if(Ne.mozRequestAnimationFrame)return function(r){Ne.mozRequestAnimationFrame(r)};if(Ne.webkitRequestAnimationFrame)return function(r){Ne.webkitRequestAnimationFrame(r)};if(Ne.msRequestAnimationFrame)return function(r){Ne.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(Fl())},1e3/60)}}(),Ya=function(e){return fh(e)},Ur=Fl,pn=9261,On=5381,zl=function(e){for(var a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn;!(a=e.next()).done;)n=65599*n+a.value|0;return n},da=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn)+e|0},fa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:On;return(t<<5)+t+e|0},Zr=function(e){return 2097152*e[0]+e[1]},Wa=function(e,t){return[da(e[0],t[0]),fa(e[1],t[1])]},Vl=function(e,t){var n={value:0,done:!1},a=0,i=e.length;return zl({next:function(){return a<i?n.value=e[a++]:n.done=!0,n}},t)},yn=function(e,t){var n={value:0,done:!1},a=0,i=e.length;return zl({next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}},t)},Hl=function(){return vh(arguments)},vh=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];t=0===n?yn(a):yn(a,t)}return t};var Ul=!0,mh=null!=console.warn,bh=null!=console.trace,ds=Number.MAX_SAFE_INTEGER||9007199254740991,Xl=function(){return!0},qa=function(){return!1},jl=function(){return 0},fs=function(){},Xt=function(e){throw new Error(e)},Yl=function(e){if(void 0===e)return Ul;Ul=!!e},_t=function(e){Yl()&&(mh?console.warn(e):(console.log(e),bh&&console.trace()))},Pr=function(e){return null==e?e:Ye(e)?e.slice():Oe(e)?function(e){return mt({},e)}(e):e},Wl=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},Eh={},ql=function(){return Eh},ir=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var s=t[i],o=n?.[s];a[s]=void 0===o?e[s]:o}return a}},Jr=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},hs=function(e){e.splice(0,e.length)},vr=function(e,t,n){return n&&(t=yl(n,t)),e[t]},kr=function(e,t,n,a){n&&(t=yl(n,t)),e[t]=a},Xr=typeof Map<"u"?Map:function(){return ie(function r(){_(this,r),this._obj={}},[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return void 0!==this._obj[t]}},{key:"get",value:function(t){return this._obj[t]}}])}(),Sh=function(){return ie(function r(e){if(_(this,r),this._obj=Object.create(null),this.size=0,null!=e){var t;t=null!=e.instanceString&&e.instanceString()===this.instanceString()?e.toArray():e;for(var n=0;n<t.length;n++)this.add(t[n])}},[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;1!==n[t]&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;1===n[t]&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return 1===this._obj[t]}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])}(),Pn="undefined"!==(typeof Set>"u"?"undefined":pe(Set))?Set:Sh,$a=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&xr(e)){var a=t.group;if(null==a&&(a=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===a||"edges"===a){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===a:!!t.pannable,active:!1,classes:new Pn,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Ye(t.classes)?u=t.classes:oe(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var f=u[c];!f||""===f||i.classes.add(f)}this.createEmitter(),(void 0===n||n)&&this.restore();var h=t.style||t.css;h&&(_t("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))}else Xt("An element must be of type `nodes` or `edges`; you specified `"+a+"`")}else Xt("An element must have a core reference and parameters set")},$l=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;Oe(n)&&!vt(n)&&(n=(s=n).roots||s.root,a=s.visit,i=s.directed),i=2!==arguments.length||Be(a)?i:a,a=Be(a)?a:function(){};for(var m,o=this._private.cy,l=n=oe(n)?this.filter(n):n,u=[],c=[],d={},f={},h={},v=0,p=this.byGroup(),g=p.nodes,w=p.edges,C=0;C<l.length;C++){var N=l[C],z=N.id();N.isNode()&&(u.unshift(N),e.bfs&&(h[z]=!0,c.push(N)),f[z]=0)}for(var F,V=function(){var Q=e.bfs?u.shift():u.pop(),le=Q.id();if(e.dfs){if(h[le])return 0;h[le]=!0,c.push(Q)}var Le,de=f[le],he=d[le],ue=null!=he?he.source():null,ge=null!=he?he.target():null,Se=null==he?void 0:Q.same(ue)?ge[0]:ue[0];if(!0===(Le=a(Q,he,Se,v++,de)))return m=Q,1;if(!1===Le)return 1;for(var ye=Q.connectedEdges().filter(function(Qe){return(!i||Qe.source().same(Q))&&w.has(Qe)}),De=0;De<ye.length;De++){var Ue=ye[De],$e=Ue.connectedNodes().filter(function(Qe){return!Qe.same(Q)&&g.has(Qe)}),Xe=$e.id();0!==$e.length&&!h[Xe]&&(u.push($e=$e[0]),e.bfs&&(h[Xe]=!0,c.push($e)),d[Xe]=Ue,f[Xe]=f[le]+1)}};0!==u.length&&(0===(F=V())||1!==F););for(var U=o.collection(),W=0;W<c.length;W++){var Z=c[W],K=d[Z.id()];null!=K&&U.push(K),U.push(Z)}return{path:o.collection(U),found:o.collection(m)}}},ha={breadthFirstSearch:$l({bfs:!0}),depthFirstSearch:$l({dfs:!0})};ha.bfs=ha.breadthFirstSearch,ha.dfs=ha.depthFirstSearch;var Kl,vs,Zl,Ka={exports:{}},Lh=Ka.exports;var ps,va=oa(function Ih(){return Zl||(Zl=1,vs=function Ah(){return Kl||(Kl=1,r=Ka,function(){var t,n,a,i,s,o,l,u,c,d,f,h,v,m,p;a=Math.floor,d=Math.min,n=function(g,w){return g<w?-1:g>w?1:0},c=function(g,w,C,N,z){var V;if(null==C&&(C=0),null==z&&(z=n),C<0)throw new Error("lo must be non-negative");for(null==N&&(N=g.length);C<N;)z(w,g[V=a((C+N)/2)])<0?N=V:C=V+1;return[].splice.apply(g,[C,C-C].concat(w)),w},o=function(g,w,C){return null==C&&(C=n),g.push(w),m(g,0,g.length-1,C)},s=function(g,w){var C,N;return null==w&&(w=n),C=g.pop(),g.length?(N=g[0],g[0]=C,p(g,0,w)):N=C,N},u=function(g,w,C){var N;return null==C&&(C=n),N=g[0],g[0]=w,p(g,0,C),N},l=function(g,w,C){var N;return null==C&&(C=n),g.length&&C(g[0],w)<0&&(w=(N=[g[0],w])[0],g[0]=N[1],p(g,0,C)),w},i=function(g,w){var N,z,V,F,U;for(null==w&&(w=n),F=[],N=0,z=(V=function(){U=[];for(var W=0,Z=a(g.length/2);0<=Z?W<Z:W>Z;0<=Z?W++:W--)U.push(W);return U}.apply(this).reverse()).length;N<z;N++)F.push(p(g,V[N],w));return F},v=function(g,w,C){var N;if(null==C&&(C=n),-1!==(N=g.indexOf(w)))return m(g,0,N,C),p(g,N,C)},f=function(g,w,C){var z,V,F,U;if(null==C&&(C=n),!(z=g.slice(0,w)).length)return z;for(i(z,C),V=0,F=(U=g.slice(w)).length;V<F;V++)l(z,U[V],C);return z.sort(C).reverse()},h=function(g,w,C){var N,z,V,F,U,W,Z,K,J;if(null==C&&(C=n),10*w<=g.length){if(!(V=g.slice(0,w).sort(C)).length)return V;for(z=V[V.length-1],F=0,W=(Z=g.slice(w)).length;F<W;F++)C(N=Z[F],z)<0&&(c(V,N,0,null,C),V.pop(),z=V[V.length-1]);return V}for(i(g,C),J=[],U=0,K=d(w,g.length);0<=K?U<K:U>K;0<=K?++U:--U)J.push(s(g,C));return J},m=function(g,w,C,N){var z,V,F;for(null==N&&(N=n),z=g[C];C>w&&N(z,V=g[F=C-1>>1])<0;)g[C]=V,C=F;return g[C]=z},p=function(g,w,C){var N,z,V,F,U;for(null==C&&(C=n),z=g.length,U=w,V=g[w],N=2*w+1;N<z;)(F=N+1)<z&&!(C(g[N],g[F])<0)&&(N=F),g[w]=g[N],N=2*(w=N)+1;return g[w]=V,m(g,U,w,C)},t=function(){function g(w){this.cmp=w??n,this.nodes=[]}return g.push=o,g.pop=s,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=v,g.nlargest=f,g.nsmallest=h,g.prototype.push=function(w){return o(this.nodes,w,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(w){return-1!==this.nodes.indexOf(w)},g.prototype.replace=function(w){return u(this.nodes,w,this.cmp)},g.prototype.pushpop=function(w){return l(this.nodes,w,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(w){return v(this.nodes,w,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return 0===this.nodes.length},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var w;return(w=new g).nodes=this.nodes.slice(0),w},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),r.exports=t}.call(Lh)),Ka.exports;var r}()),vs}()),Rh=ir({root:null,weight:function(e){return 1},directed:!1}),Mh={dijkstra:function(e){if(!Oe(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Rh(e),a=n.root,s=n.directed,o=this,l=n.weight,u=oe(a)?this.filter(a)[0]:a[0],c={},d={},f={},h=this.byGroup(),v=h.nodes,m=h.edges;m.unmergeBy(function(de){return de.isLoop()});for(var p=function(he){return c[he.id()]},g=function(he,ue){c[he.id()]=ue,w.updateItem(he)},w=new va(function(de,he){return p(de)-p(he)}),C=0;C<v.length;C++){var N=v[C];c[N.id()]=N.same(u)?0:1/0,w.push(N)}for(var z=function(he,ue){for(var Le,ge=(s?he.edgesTo(ue):he.edgesWith(ue)).intersect(m),Se=1/0,ye=0;ye<ge.length;ye++){var De=ge[ye],Ue=l(De);(Ue<Se||!Le)&&(Se=Ue,Le=De)}return{edge:Le,dist:Se}};w.size()>0;){var V=w.pop(),F=p(V),U=V.id();if(f[U]=F,F!==1/0)for(var W=V.neighborhood().intersect(v),Z=0;Z<W.length;Z++){var K=W[Z],J=K.id(),Q=z(V,K),le=F+Q.dist;le<p(K)&&(g(K,le),d[J]={node:V,edge:Q.edge})}}return{distanceTo:function(he){var ue=oe(he)?v.filter(he)[0]:he[0];return f[ue.id()]},pathTo:function(he){var ue=oe(he)?v.filter(he)[0]:he[0],ge=[],Se=ue,Le=Se.id();if(ue.length>0)for(ge.unshift(ue);d[Le];){var ye=d[Le];ge.unshift(ye.edge),ge.unshift(ye.node),Le=(Se=ye.node).id()}return o.spawn(ge)}}}},Oh={kruskal:function(e){e=e||function(C){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,s=new Array(i),o=n,l=function(N){for(var z=0;z<s.length;z++)if(s[z].has(N))return z},u=0;u<i;u++)s[u]=this.spawn(n[u]);for(var c=a.sort(function(C,N){return e(C)-e(N)}),d=0;d<c.length;d++){var f=c[d],h=f.source()[0],v=f.target()[0],m=l(h),p=l(v),g=s[m],w=s[p];m!==p&&(o.merge(f),g.merge(w),s.splice(p,1))}return o}},Ph=ir({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),kh={aStar:function(e){var t=this.cy(),n=Ph(e),a=n.root,i=n.goal,s=n.heuristic,o=n.directed,l=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var C,N,u=a.id(),c=i.id(),d={},f={},h={},v=new va(function(Le,ye){return f[Le.id()]-f[ye.id()]}),m=new Pn,p={},g={},w=function(ye,De){v.push(ye),m.add(De)},z=function(){C=v.pop(),N=C.id(),m.delete(N)},V=function(ye){return m.has(ye)};w(a,u),d[u]=0,f[u]=s(a);for(var F=0;v.size()>0;){if(z(),F++,N===c){for(var U=[],W=i,Z=c,K=g[Z];U.unshift(W),null!=K&&U.unshift(K),null!=(W=p[Z]);)K=g[Z=W.id()];return{found:!0,distance:d[N],path:this.spawn(U),steps:F}}h[N]=!0;for(var J=C._private.edges,Q=0;Q<J.length;Q++){var le=J[Q];if(this.hasElementWithId(le.id())&&(!o||le.data("source")===N)){var de=le.source(),he=le.target(),ue=de.id()!==N?de:he,ge=ue.id();if(this.hasElementWithId(ge)&&!h[ge]){var Se=d[N]+l(le);if(!V(ge)){d[ge]=Se,f[ge]=Se+s(ue),w(ue,ge),p[ge]=C,g[ge]=le;continue}Se<d[ge]&&(d[ge]=Se,f[ge]=Se+s(ue),p[ge]=C,g[ge]=le)}}}}return{found:!1,distance:void 0,path:void 0,steps:F}}},Bh=ir({weight:function(e){return 1},directed:!1}),_h={floydWarshall:function(e){for(var t=this.cy(),n=Bh(e),i=n.directed,s=n.weight,o=this.byGroup(),l=o.nodes,u=o.edges,c=l.length,d=c*c,f=function(Ue){return l.indexOf(Ue)},h=function(Ue){return l[Ue]},v=new Array(d),m=0;m<d;m++){var p=m%c;v[m]=(m-p)/c===p?0:1/0}for(var w=new Array(d),C=new Array(d),N=0;N<u.length;N++){var z=u[N],V=z.source()[0],F=z.target()[0];if(V!==F){var U=f(V),W=f(F),Z=U*c+W,K=s(z);if(v[Z]>K&&(v[Z]=K,w[Z]=W,C[Z]=z),!i){var J=W*c+U;!i&&v[J]>K&&(v[J]=K,w[J]=U,C[J]=z)}}}for(var Q=0;Q<c;Q++)for(var le=0;le<c;le++)for(var de=le*c+Q,he=0;he<c;he++){var ue=le*c+he,ge=Q*c+he;v[de]+v[ge]<v[ue]&&(v[ue]=v[de]+v[ge],w[ue]=w[de])}var Le=function(Ue){return f(function(Ue){return(oe(Ue)?t.filter(Ue):Ue)[0]}(Ue))};return{distance:function(Ue,$e){var Xe=Le(Ue),Qe=Le($e);return v[Xe*c+Qe]},path:function(Ue,$e){var Xe=Le(Ue),Qe=Le($e),tt=h(Xe);if(Xe===Qe)return tt.collection();if(null==w[Xe*c+Qe])return t.collection();var at=t.collection();for(at.merge(tt);Xe!==Qe;)at.merge(C[Xe*c+(Xe=w[Xe*c+Qe])]),at.merge(h(Xe));return at}}}},Fh=ir({weight:function(e){return 1},directed:!1,root:null}),Gh={bellmanFord:function(e){var t=this,n=Fh(e),i=n.directed,s=n.root,o=n.weight,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,f=c.nodes,h=f.length,v=new Xr,m=!1,p=[];s=u.collection(s)[0],d.unmergeBy(function(Et){return Et.isLoop()});for(var g=d.length,w=function(bt){var pt=v.get(bt.id());return pt||(pt={},v.set(bt.id(),pt)),pt},C=function(bt){return(oe(bt)?u.$(bt):bt)[0]},V=0;V<h;V++){var F=f[V],U=w(F);U.dist=F.same(s)?0:1/0,U.pred=null,U.edge=null}for(var W=!1,Z=function(bt,pt,ot,gt,ht,Tt){var wt=gt.dist+Tt;wt<ht.dist&&!ot.same(gt.edge)&&(ht.dist=wt,ht.pred=bt,ht.edge=ot,W=!0)},K=1;K<h;K++){W=!1;for(var J=0;J<g;J++){var Q=d[J],le=Q.source(),de=Q.target(),he=o(Q),ue=w(le),ge=w(de);Z(le,0,Q,ue,ge,he),i||Z(de,0,Q,ge,ue,he)}if(!W)break}if(W)for(var Se=[],Le=0;Le<g;Le++){var ye=d[Le],De=ye.source(),Ue=ye.target(),$e=o(ye),Xe=w(De).dist,Qe=w(Ue).dist;if(Xe+$e<Qe||!i&&Qe+$e<Xe){if(m||(_t("Graph contains a negative weight cycle for Bellman-Ford"),m=!0),!1===e.findNegativeWeightCycles)break;var tt=[];Xe+$e<Qe&&tt.push(De),!i&&Qe+$e<Xe&&tt.push(Ue);for(var at=tt.length,He=0;He<at;He++){var Te=tt[He],Ie=[Te];Ie.push(w(Te).edge);for(var Pe=w(Te).pred;-1===Ie.indexOf(Pe);)Ie.push(Pe),Ie.push(w(Pe).edge),Pe=w(Pe).pred;for(var ze=(Ie=Ie.slice(Ie.indexOf(Pe)))[0].id(),rt=0,ct=2;ct<Ie.length;ct+=2)Ie[ct].id()<ze&&(ze=Ie[ct].id(),rt=ct);(Ie=Ie.slice(rt).concat(Ie.slice(0,rt))).push(Ie[0]);var Nt=Ie.map(function(Et){return Et.id()}).join(",");-1===Se.indexOf(Nt)&&(p.push(l.spawn(Ie)),Se.push(Nt))}}}return{distanceTo:function(bt){return w(C(bt)).dist},pathTo:function(bt){for(var pt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,gt=[],ht=C(bt);;){if(null==ht)return t.spawn();var Tt=w(ht),wt=Tt.edge,Lt=Tt.pred;if(gt.unshift(ht[0]),ht.same(pt)&>.length>0)break;null!=wt&>.unshift(wt),ht=Lt}return l.spawn(gt)},hasNegativeWeightCycle:m,negativeWeightCycles:p}}},zh=Math.sqrt(2),Vh=function(e,t,n){0===n.length&&Xt("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],o=t[a[1]],l=t[a[2]],u=n,c=u.length-1;c>=0;c--){var d=u[c],f=d[1],h=d[2];(t[f]===o&&t[h]===l||t[f]===l&&t[h]===o)&&u.splice(c,1)}for(var v=0;v<u.length;v++){var m=u[v];m[1]===l?(u[v]=m.slice(),u[v][1]=o):m[2]===l&&(u[v]=m.slice(),u[v][2]=o)}for(var p=0;p<t.length;p++)t[p]===l&&(t[p]=o);return u},gs=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=Vh(i,e,t),n--}return t},Hh={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function(ge){return ge.isLoop()});var i=n.length,s=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/zh);if(!(i<2)){for(var u=[],c=0;c<s;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,h=[],v=new Array(i),m=new Array(i),p=new Array(i),g=function(Se,Le){for(var ye=0;ye<i;ye++)Le[ye]=Se[ye]},w=0;w<=o;w++){for(var C=0;C<i;C++)m[C]=C;var N=gs(m,u.slice(),i,l),z=N.slice();g(m,p);var V=gs(m,N,l,2),F=gs(p,z,l,2);V.length<=F.length&&V.length<f?(f=V.length,h=V,g(m,v)):F.length<=V.length&&F.length<f&&(f=F.length,h=F,g(p,v))}for(var U=this.spawn(h.map(function(ge){return a[ge[0]]})),W=this.spawn(),Z=this.spawn(),K=v[0],J=0;J<v.length;J++){var le=n[J];v[J]===K?W.merge(le):Z.merge(le)}var de=function(Se){var Le=e.spawn();return Se.forEach(function(ye){Le.merge(ye),ye.connectedEdges().forEach(function(De){e.contains(De)&&!U.contains(De)&&Le.merge(De)})}),Le},he=[de(W),de(Z)];return{cut:U,components:he,partition1:W,partition2:Z}}Xt("At least 2 nodes are required for Karger-Stein algorithm")}},Za=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Jl=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},kn=function(e){return{x:e[0],y:e[1]}},Ja=function(e,t){return Math.atan2(t,e)-Math.PI/2},ys=Math.log2||function(r){return Math.log(r)/Math.log(2)},ms=function(e){return e>0?1:e<0?-1:0},mn=function(e,t){return Math.sqrt(bn(e,t))},bn=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},$h=function(e){for(var t=e.length,n=0,a=0;a<t;a++)n+=e[a];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},tr=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},Bn=function(e,t,n,a){return{x:tr(e.x,t.x,n.x,a),y:tr(e.y,t.y,n.y,a)}},ga=function(e,t,n){return Math.max(e,Math.min(n,t))},gr=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Qh=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Ql=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Qa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ei=function(e){var n,a,i,s,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===t.length)n=a=i=s=t[0];else if(2===t.length)n=i=t[0],s=a=t[1];else if(4===t.length){var o=fe(t,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},eu=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},bs=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Qr=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},tu=function(e,t){return Qr(e,t.x,t.y)},ru=function(e,t){return Qr(e,t.x1,t.y1)&&Qr(e,t.x2,t.y2)},ev=null!==(ps=Math.hypot)&&void 0!==ps?ps:function(r,e){return Math.sqrt(r*r+e*e)};var nu=function(e,t,n,a,i,s,o){var v,de,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",u="auto"===l?tn(i,s):l,c=i/2,d=s/2,f=(u=Math.min(u,c,d))!==c,h=u!==d;if(f){var p=a-d-o;if((v=en(e,t,n,a,n-c+u-o,p,n+c-u+o,p,!1)).length>0)return v}if(h){var C=n+c+o;if((v=en(e,t,n,a,C,a-d+u-o,C,a+d-u+o,!1)).length>0)return v}if(f){var U=a+d+o;if((v=en(e,t,n,a,n-c+u-o,U,n+c-u+o,U,!1)).length>0)return v}if(h){var K=n-c-o;if((v=en(e,t,n,a,K,a-d+u-o,K,a+d-u+o,!1)).length>0)return v}var he=n-c+u,ue=a-d+u;if((de=pa(e,t,n,a,he,ue,u+o)).length>0&&de[0]<=he&&de[1]<=ue)return[de[0],de[1]];var ge=n+c-u,Se=a-d+u;if((de=pa(e,t,n,a,ge,Se,u+o)).length>0&&de[0]>=ge&&de[1]<=Se)return[de[0],de[1]];var Le=n+c-u,ye=a+d-u;if((de=pa(e,t,n,a,Le,ye,u+o)).length>0&&de[0]>=Le&&de[1]>=ye)return[de[0],de[1]];var De=n-c+u,Ue=a+d-u;return(de=pa(e,t,n,a,De,Ue,u+o)).length>0&&de[0]<=De&&de[1]>=Ue?[de[0],de[1]]:[]},nv=function(e,t,n,a,i,s,o){var l=o,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,s),f=Math.max(a,s);return u-l<=e&&e<=c+l&&d-l<=t&&t<=f+l},av=function(e,t,n,a,i,s,o,l,u){var c_x1=Math.min(n,o,i)-u,c_x2=Math.max(n,o,i)+u,c_y1=Math.min(a,l,s)-u,c_y2=Math.max(a,l,s)+u;return!(e<c_x1||e>c_x2||t<c_y1||t>c_y2)},ov=function(e,t,n,a,i,s,o,l){var h=[];!function(e,t,n,a,i){var o,l,u,c,d,f,h,v;0===e&&(e=1e-5),u=-27*(a/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(l=(3*n-t*t)/9)*l*l+(u/=54)*u,i[1]=0,h=t/3,o>0?(d=(d=u+Math.sqrt(o))<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=(f=u-Math.sqrt(o))<0?-Math.pow(-f,1/3):Math.pow(f,1/3),i[0]=-h+d+f,i[4]=i[2]=-(h+=(d+f)/2),h=Math.sqrt(3)*(-f+d)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===o?(v=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=2*v-h,i[4]=i[2]=-(v+h)):(c=(l=-l)*l*l,c=Math.acos(u/Math.sqrt(c)),v=2*Math.sqrt(l),i[0]=-h+v*Math.cos(c/3),i[2]=-h+v*Math.cos((c+2*Math.PI)/3),i[4]=-h+v*Math.cos((c+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+a*a-4*a*s+2*a*l+4*s*s-4*s*l+l*l,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*a*s-3*a*a-3*a*l-6*s*s+3*s*l,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*l-a*t+2*s*s+2*s*t-l*t,1*n*i-n*n+n*e-i*e+a*s-a*a+a*t-s*t,h);for(var m=[],p=0;p<6;p+=2)Math.abs(h[p+1])<1e-7&&h[p]>=0&&h[p]<=1&&m.push(h[p]);m.push(1),m.push(0);for(var w,C,N,g=-1,z=0;z<m.length;z++)w=Math.pow(1-m[z],2)*n+2*(1-m[z])*m[z]*i+m[z]*m[z]*o,C=Math.pow(1-m[z],2)*a+2*(1-m[z])*m[z]*s+m[z]*m[z]*l,N=Math.pow(w-e,2)+Math.pow(C-t,2),g>=0?N<g&&(g=N):g=N;return g},lv=function(e,t,n,a,i,s){var o=[e-n,t-a],l=[i-n,s-a],u=l[0]*l[0]+l[1]*l[1],c=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],f=d*d/u;return d<0?c:f>u?(e-i)*(e-i)+(t-s)*(t-s):c-f},mr=function(e,t,n){for(var a,i,s,o,u=0,c=0;c<n.length/2;c++)if(i=n[2*c+1],c+1<n.length/2?(s=n[2*(c+1)],o=n[2*(c+1)+1]):(s=n[2*(c+1-n.length/2)],o=n[2*(c+1-n.length/2)+1]),(a=n[2*c])!=e||s!=e){if(!(a>=e&&e>=s||a<=e&&e<=s))continue;(e-a)/(s-a)*(o-i)+i>t&&u++}return u%2!=0},jr=function(e,t,n,a,i,s,o,l,u){var d,m,c=new Array(n.length);null!=l[0]?(d=Math.atan(l[1]/l[0]),l[0]<0?d+=Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),h=Math.sin(-d),v=0;v<c.length/2;v++)c[2*v]=s/2*(n[2*v]*f-n[2*v+1]*h),c[2*v+1]=o/2*(n[2*v+1]*f+n[2*v]*h),c[2*v]+=a,c[2*v+1]+=i;if(u>0){var p=ri(c,-u);m=ti(p)}else m=c;return mr(e,t,m)},ti=function(e){for(var o,l,u,c,t=new Array(e.length/2),d=0;d<e.length/4;d++){d<e.length/4-1?(o=e[4*(d+1)],l=e[4*(d+1)+1],u=e[4*(d+1)+2],c=e[4*(d+1)+3]):(o=e[0],l=e[1],u=e[2],c=e[3]);var f=en(e[4*d],e[4*d+1],e[4*d+2],e[4*d+3],o,l,u,c,!0);t[2*d]=f[0],t[2*d+1]=f[1]}return t},ri=function(e,t){for(var a,i,s,o,n=new Array(2*e.length),l=0;l<e.length/2;l++){l<e.length/2-1?(s=e[2*(l+1)],o=e[2*(l+1)+1]):(s=e[0],o=e[1]);var u=o-(i=e[2*l+1]),c=-(s-(a=e[2*l])),d=Math.sqrt(u*u+c*c),f=u/d,h=c/d;n[4*l]=a+f*t,n[4*l+1]=i+h*t,n[4*l+2]=s+f*t,n[4*l+3]=o+h*t}return n},wn=function(e,t,n,a,i,s,o){return e-=i,t-=s,(e/=n/2+o)*e+(t/=a/2+o)*t<=1},pa=function(e,t,n,a,i,s,o){var l=[n-e,a-t],u=[e-i,t-s],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),h=d*d-4*c*(u[0]*u[0]+u[1]*u[1]-o*o);if(h<0)return[];var v=(-d+Math.sqrt(h))/(2*c),m=(-d-Math.sqrt(h))/(2*c),p=Math.min(v,m),g=Math.max(v,m),w=[];if(p>=0&&p<=1&&w.push(p),g>=0&&g<=1&&w.push(g),0===w.length)return[];var C=w[0]*l[0]+e,N=w[0]*l[1]+t;return w.length>1?w[0]==w[1]?[C,N]:[C,N,w[1]*l[0]+e,w[1]*l[1]+t]:[C,N]},ws=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,a,i,s,o,l,u){var c=e-i,d=n-e,f=o-i,h=t-s,v=a-t,m=l-s,p=f*h-m*c,g=d*h-v*c,w=m*d-f*v;if(0!==w){var C=p/w,N=g/w,V=-.001;return V<=C&&C<=1.001&&V<=N&&N<=1.001||u?[e+C*d,t+C*v]:[]}return 0===p||0===g?ws(e,n,o)===o?[o,l]:ws(e,n,i)===i?[i,s]:ws(i,o,n)===n?[n,a]:[]:[]},dv=function(e,t,n,a,i){var s=[],o=a/2,l=i/2,u=t,c=n;s.push({x:u+o*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:u+o*e[2*d],y:c+l*e[2*d+1]});return s},ya=function(e,t,n,a,i,s,o,l){var c,h,u=[],d=new Array(n.length),f=!0;if(null==s&&(f=!1),f){for(var v=0;v<d.length/2;v++)d[2*v]=n[2*v]*s+a,d[2*v+1]=n[2*v+1]*o+i;if(l>0){var m=ri(d,-l);h=ti(m)}else h=d}else h=n;for(var w,C,N=0;N<h.length/2;N++)N<h.length/2-1?(w=h[2*(N+1)],C=h[2*(N+1)+1]):(w=h[0],C=h[1]),0!==(c=en(e,t,a,i,h[2*N],h[2*N+1],w,C)).length&&u.push(c[0],c[1]);return u},ni=function(e,t,n){var a=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[t[0]+s*a[0],t[1]+s*a[1]]},pr=function(e,t){var n=xs(e,t);return au(n)},au=function(e){for(var t,n,a=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<a;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,n),l=Math.max(l,n);for(var c=2/(o-i),d=2/(l-s),f=0;f<a;f++)t=e[2*f]=e[2*f]*c,n=e[2*f+1]=e[2*f+1]*d,i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var h=0;h<a;h++)n=e[2*h+1]=e[2*h+1]+(-1-s);return e},xs=function(e,t){var n=1/e*2*Math.PI,a=e%2==0?Math.PI/2+n/2:Math.PI/2;a+=t;for(var s,i=new Array(2*e),o=0;o<e;o++)s=o*n+a,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},tn=function(e,t){return Math.min(e/4,t/4,8)},iu=function(e,t){return Math.min(e/10,t/10,8)},Ts=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Cs(r,e){function t(d){for(var f=[],h=0;h<d.length;h++){var v=d[h],m=d[(h+1)%d.length],p={x:m.x-v.x,y:m.y-v.y},g={x:-p.y,y:p.x},w=Math.sqrt(g.x*g.x+g.y*g.y);f.push({x:g.x/w,y:g.y/w})}return f}function n(d,f){var p,h=1/0,v=-1/0,m=H(d);try{for(m.s();!(p=m.n()).done;){var g=p.value,w=g.x*f.x+g.y*f.y;h=Math.min(h,w),v=Math.max(v,w)}}catch(C){m.e(C)}finally{m.f()}return{min:h,max:v}}function a(d,f){return!(d.max<f.min||f.max<d.min)}var o,s=H([].concat(te(t(r)),te(t(e))));try{for(s.s();!(o=s.n()).done;){var l=o.value;if(!a(n(r,l),n(e,l)))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var vv=ir({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),gv={pageRank:function(e){for(var t=vv(e),n=t.dampingFactor,a=t.precision,i=t.iterations,s=t.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,h=c.length,v=new Array(d*d),m=new Array(d),p=(1-n)/d,g=0;g<d;g++){for(var w=0;w<d;w++)v[g*d+w]=0;m[g]=0}for(var N=0;N<h;N++){var z=c[N],V=z.data("source"),F=z.data("target");if(V!==F){var U=u.indexOfId(V),W=u.indexOfId(F),Z=s(z);v[W*d+U]+=Z,m[U]+=Z}}for(var J=1/d+p,Q=0;Q<d;Q++)if(0===m[Q])for(var le=0;le<d;le++)v[le*d+Q]=J;else for(var he=0;he<d;he++){var ue=he*d+Q;v[ue]=v[ue]/m[Q]+p}for(var Le,ge=new Array(d),Se=new Array(d),ye=0;ye<d;ye++)ge[ye]=1;for(var De=0;De<i;De++){for(var Ue=0;Ue<d;Ue++)Se[Ue]=0;for(var $e=0;$e<d;$e++)for(var Xe=0;Xe<d;Xe++)Se[$e]+=v[$e*d+Xe]*ge[Xe];$h(Se),Le=ge,ge=Se,Se=Le;for(var tt=0,at=0;at<d;at++){var He=Le[at]-ge[at];tt+=He*He}if(tt<a)break}return{rank:function(Pe){return Pe=o.collection(Pe)[0],ge[u.indexOf(Pe)]}}}},su=ir({root:null,weight:function(e){return 1},directed:!1,alpha:0}),_n={degreeCentralityNormalized:function(e){e=su(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},f=0,h=0,v=0;v<a;v++){var m=n[v],p=m.id();e.root=m;var g=this.degreeCentrality(e);f<g.indegree&&(f=g.indegree),h<g.outdegree&&(h=g.outdegree),c[p]=g.indegree,d[p]=g.outdegree}return{indegree:function(C){return 0==f?0:(oe(C)&&(C=t.filter(C)),c[C.id()]/f)},outdegree:function(C){return 0===h?0:(oe(C)&&(C=t.filter(C)),d[C.id()]/h)}}}for(var i={},s=0,o=0;o<a;o++){var l=n[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(C){return 0===s?0:(oe(C)&&(C=t.filter(C)),i[C.id()]/s)}}},degreeCentrality:function(e){e=su(e);var t=this.cy(),n=this,i=e.root,s=e.weight,o=e.directed,l=e.alpha;if(i=t.collection(i)[0],o){for(var h=i.connectedEdges(),v=h.filter(function(V){return V.target().same(i)&&n.has(V)}),m=h.filter(function(V){return V.source().same(i)&&n.has(V)}),p=v.length,g=m.length,w=0,C=0,N=0;N<v.length;N++)w+=s(v[N]);for(var z=0;z<m.length;z++)C+=s(m[z]);return{indegree:Math.pow(p,1-l)*Math.pow(w,l),outdegree:Math.pow(g,1-l)*Math.pow(C,l)}}for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,f=0;f<u.length;f++)d+=s(u[f]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}};_n.dc=_n.degreeCentrality,_n.dcn=_n.degreeCentralityNormalised=_n.degreeCentralityNormalized;var ou=ir({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Fn={closenessCentralityNormalized:function(e){for(var t=ou(e),n=t.harmonic,a=t.weight,i=t.directed,s=this.cy(),o={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var f=0,h=u[d],v=0;v<u.length;v++)if(d!==v){var m=c.distance(h,u[v]);f+=n?1/m:m}n||(f=1/f),l<f&&(l=f),o[h.id()]=f}return{closeness:function(g){return 0==l?0:(g=oe(g)?s.filter(g)[0].id():g.id(),o[g]/l)}}},closenessCentrality:function(e){var t=ou(e),n=t.root,a=t.weight,i=t.directed,s=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var f=o.distanceTo(d);l+=s?1/f:f}}return s?l:1/l}};Fn.cc=Fn.closenessCentrality,Fn.ccn=Fn.closenessCentralityNormalised=Fn.closenessCentralityNormalized;var pv=ir({weight:null,directed:!1}),Ds={betweennessCentrality:function(e){for(var t=pv(e),n=t.directed,a=t.weight,i=null!=a,s=this.cy(),o=this.nodes(),l={},u={},c=0,d={set:function(C,N){u[C]=N,N>c&&(c=N)},get:function(C){return u[C]}},f=0;f<o.length;f++){var h=o[f],v=h.id();l[v]=n?h.outgoers().nodes():h.openNeighborhood().nodes(),d.set(v,0)}for(var m=function(){for(var C=o[p].id(),N=[],z={},V={},F={},U=new va(function($e,Xe){return F[$e]-F[Xe]}),W=0;W<o.length;W++){var Z=o[W].id();z[Z]=[],V[Z]=0,F[Z]=1/0}for(V[C]=1,F[C]=0,U.push(C);!U.empty();){var K=U.pop();if(N.push(K),i)for(var J=0;J<l[K].length;J++){var de,Q=l[K][J],le=s.getElementById(K);de=le.edgesTo(Q).length>0?le.edgesTo(Q)[0]:Q.edgesTo(le)[0];var he=a(de);Q=Q.id(),F[Q]>F[K]+he&&(F[Q]=F[K]+he,U.nodes.indexOf(Q)<0?U.push(Q):U.updateItem(Q),V[Q]=0,z[Q]=[]),F[Q]==F[K]+he&&(V[Q]=V[Q]+V[K],z[Q].push(K))}else for(var ue=0;ue<l[K].length;ue++){var ge=l[K][ue].id();F[ge]==1/0&&(U.push(ge),F[ge]=F[K]+1),F[ge]==F[K]+1&&(V[ge]=V[ge]+V[K],z[ge].push(K))}}for(var Se={},Le=0;Le<o.length;Le++)Se[o[Le].id()]=0;for(;N.length>0;){for(var ye=N.pop(),De=0;De<z[ye].length;De++){var Ue=z[ye][De];Se[Ue]=Se[Ue]+V[Ue]/V[ye]*(1+Se[ye])}ye!=o[p].id()&&d.set(ye,d.get(ye)+Se[ye])}},p=0;p<o.length;p++)m();var g={betweenness:function(C){var N=s.collection(C).id();return d.get(N)},betweennessNormalized:function(C){if(0==c)return 0;var N=s.collection(C).id();return d.get(N)/c}};return g.betweennessNormalised=g.betweennessNormalized,g}};Ds.bc=Ds.betweennessCentrality;var yv=ir({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),bv=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},lu=function(e,t){for(var n,a=0;a<t;a++){n=0;for(var i=0;i<t;i++)n+=e[i*t+a];for(var s=0;s<t;s++)e[s*t+a]=e[s*t+a]/n}},xv=function(e,t,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 l=0;l<n;l++)a[i*n+l]+=e[i*n+o]*t[o*n+l]}return a},Ev=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=xv(e,a,t);return e},Tv=function(e,t,n){for(var a=new Array(t*t),i=0;i<t*t;i++)a[i]=Math.pow(e[i],n);return lu(a,t),a},Cv=function(e,t,n,a){for(var i=0;i<n;i++)if(Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a)!==Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a))return!1;return!0},Sv=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},uu=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=function(e){return yv(e)}(e),s={},o=0;o<t.length;o++)s[t[o].id()]=o;for(var d,l=t.length,u=l*l,c=new Array(u),f=0;f<u;f++)c[f]=0;for(var h=0;h<n.length;h++){var v=n[h],m=s[v.source().id()],p=s[v.target().id()],g=bv(v,i.attributes);c[m*l+p]+=g,c[p*l+m]+=g}(function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n})(c,l,i.multFactor),lu(c,l);for(var w=!0,C=0;w&&C<i.maxIterations;)w=!1,d=Ev(c,l,i.expandFactor),c=Tv(d,l,i.inflateFactor),Cv(c,d,u,4)||(w=!0),C++;var N=function(e,t,n,a){for(var i=[],s=0;s<t;s++){for(var o=[],l=0;l<t;l++)Math.round(1e3*e[s*t+l])/1e3>0&&o.push(n[l]);0!==o.length&&i.push(a.collection(o))}return i}(c,l,t,a);return N=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Sv(e[t],e[n])&&e.splice(n,1);return e}(N),N},Av={markovClustering:uu,mcl:uu},Iv=function(e){return e},cu=function(e,t){return Math.abs(t-e)},du=function(e,t,n){return e+cu(t,n)},fu=function(e,t,n){return e+Math.pow(n-t,2)},Nv=function(e){return Math.sqrt(e)},Rv=function(e,t,n){return Math.max(e,cu(t,n))},ma=function(e,t,n,a,i){for(var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Iv,o=a,c=0;c<e;c++)o=i(o,t(c),n(c));return s(o)},Gn={euclidean:function(e,t,n){return e>=2?ma(e,t,n,0,fu,Nv):ma(e,t,n,0,du)},squaredEuclidean:function(e,t,n){return ma(e,t,n,0,fu)},manhattan:function(e,t,n){return ma(e,t,n,0,du)},max:function(e,t,n){return ma(e,t,n,-1/0,Rv)}};function ai(r,e,t,n,a,i){var s;return s=Be(r)?r:Gn[r]||Gn.euclidean,0===e&&Be(r)?s(a,i):s(e,t,n,a,i)}Gn["squared-euclidean"]=Gn.squaredEuclidean,Gn.squaredeuclidean=Gn.squaredEuclidean;var Mv=ir({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Ss=function(e){return Mv(e)},ii=function(e,t,n,a,i){var o="kMedoids"!==i?function(d){return n[d]}:function(d){return a[d](n)};return ai(e,a.length,o,function(f){return a[f](t)},n,t)},Ls=function(e,t,n){for(var a=n.length,i=new Array(a),s=new Array(a),o=new Array(t),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var c=0;c<t;c++){l=[];for(var d=0;d<a;d++)l[d]=Math.random()*(s[d]-i[d])+i[d];o[c]=l}return o},hu=function(e,t,n,a,i){for(var s=1/0,o=0,l=0;l<t.length;l++){var u=ii(n,e,t[l],a,i);u<s&&(s=u,o=l)}return o},vu=function(e,t,n){for(var a=[],i=null,s=0;s<t.length;s++)n[(i=t[s]).id()]===e&&a.push(i);return a},Ov=function(e,t,n){return Math.abs(t-e)<=n},Pv=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++)if(Math.abs(e[a][i]-t[a][i])>n)return!1;return!0},kv=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},gu=function(e,t){var n=new Array(t);if(e.length<50)for(var a=0;a<t;a++){for(var i=e[Math.floor(Math.random()*e.length)];kv(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<t;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},pu=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=ii("manhattan",t[i],e,n,"kMedoids");return a},Fv=function(e,t,n,a,i){for(var s,o,l=0;l<t.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var c=0;c<e.length;c++)for(var d=0;d<i.attributes.length;d++){s=0,o=0;for(var f=0;f<t.length;f++)s+=a[f][c]*i.attributes[d](t[f]),o+=a[f][c];e[c][d]=s/o}},Gv=function(e,t,n,a,i){for(var s=0;s<e.length;s++)t[s]=e[s].slice();for(var o,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var f=0;f<a.length;f++){o=0;for(var h=0;h<n.length;h++)l=ii(i.distance,a[f],n[d],i.attributes,"cmeans"),u=ii(i.distance,a[f],n[h],i.attributes,"cmeans"),o+=Math.pow(l/u,c);e[f][d]=1/o}},yu=function(e){var i,s,o,l,u,t=this.cy(),n=this.nodes(),a=Ss(e);l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=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 f=0;f<n.length;f++){for(var h=0,v=0;v<a.k;v++)o[f][v]=Math.random(),h+=o[f][v];for(var m=0;m<a.k;m++)o[f][m]=o[f][m]/h}s=new Array(a.k);for(var p=0;p<a.k;p++)s[p]=new Array(a.attributes.length);u=new Array(n.length);for(var g=0;g<n.length;g++)u[g]=new Array(a.k);for(var w=!0,C=0;w&&C<a.maxIterations;)w=!1,Fv(s,n,o,u,a),Gv(o,l,s,n,a),Pv(o,l,a.sensitivityThreshold)||(w=!0),C++;return i=function(e,t,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var o,l,u=0;u<t.length;u++){o=-1/0,l=-1;for(var c=0;c<t[0].length;c++)t[u][c]>o&&(o=t[u][c],l=c);i[l].push(e[u])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i}(n,o,a,t),{clusters:i,degreeOfMembership:o}},Vv={kMeans:function(e){var l,t=this.cy(),n=this.nodes(),a=null,i=Ss(e),s=new Array(i.k),o={};l=i.testMode?"number"==typeof i.testCentroids?Ls(n,i.k,i.attributes):"object"===pe(i.testCentroids)?i.testCentroids:Ls(n,i.k,i.attributes):Ls(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)o[(a=n[d]).id()]=hu(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var f=0;f<i.k;f++){var h=vu(f,n,o);if(0!==h.length){for(var v=i.attributes.length,m=l[f],p=new Array(v),g=new Array(v),w=0;w<v;w++){g[w]=0;for(var C=0;C<h.length;C++)g[w]+=i.attributes[w](a=h[C]);p[w]=g[w]/h.length,Ov(p[w],m[w],i.sensitivityThreshold)||(u=!0)}l[f]=p,s[f]=t.collection(h)}}c++}return s},kMedoids:function(e){var o,u,t=this.cy(),n=this.nodes(),a=null,i=Ss(e),s=new Array(i.k),l={},c=new Array(i.k);i.testMode?"number"==typeof i.testCentroids||(o="object"===pe(i.testCentroids)?i.testCentroids:gu(n,i.k)):o=gu(n,i.k);for(var d=!0,f=0;d&&f<i.maxIterations;){for(var h=0;h<n.length;h++)l[(a=n[h]).id()]=hu(a,o,i.distance,i.attributes,"kMedoids");d=!1;for(var v=0;v<o.length;v++){var m=vu(v,n,l);if(0!==m.length){c[v]=pu(o[v],m,i.attributes);for(var p=0;p<m.length;p++)(u=pu(m[p],m,i.attributes))<c[v]&&(c[v]=u,o[v]=m[p],d=!0);s[v]=t.collection(m)}}f++}return s},fuzzyCMeans:yu,fcm:yu},Hv=ir({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Uv={single:"min",complete:"max"},mu=function(e,t,n,a,i){for(var l,s=0,o=1/0,u=i.attributes,c=function(W,Z){return ai(i.distance,u.length,function(K){return u[K](W)},function(K){return u[K](Z)},W,Z)},d=0;d<e.length;d++){var f=e[d].key,h=n[f][a[f]];h<o&&(s=f,o=h)}if("threshold"===i.mode&&o>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,v=t[s],m=t[a[s]];p="dendrogram"===i.mode?{left:v,right:m,key:v.key}:{value:v.value.concat(m.value),key:v.key},e[v.index]=p,e.splice(m.index,1),t[v.key]=p;for(var g=0;g<e.length;g++){var w=e[g];v.key===w.key?l=1/0:"min"===i.linkage?(l=n[v.key][w.key],n[v.key][w.key]>n[m.key][w.key]&&(l=n[m.key][w.key])):"max"===i.linkage?(l=n[v.key][w.key],n[v.key][w.key]<n[m.key][w.key]&&(l=n[m.key][w.key])):l="mean"===i.linkage?(n[v.key][w.key]*v.size+n[m.key][w.key]*m.size)/(v.size+m.size):"dendrogram"===i.mode?c(w.value,v.value):c(w.value[0],v.value[0]),n[v.key][w.key]=n[w.key][v.key]=l}for(var C=0;C<e.length;C++){var N=e[C].key;if(a[N]===v.key||a[N]===m.key){for(var z=N,V=0;V<e.length;V++){var F=e[V].key;n[N][F]<n[N][z]&&(z=F)}a[N]=z}e[C].index=C}return v.key=m.key=v.index=m.index=null,!0},zn=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&zn(e.left,t),e.right&&zn(e.right,t)))},As=function(e,t){if(!e)return"";if(e.left&&e.right){var n=As(e.left,t),a=As(e.right,t),i=t.add({group:"nodes",data:{id:n+","+a}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}return e.value?e.value.id():void 0},Is=function(e,t,n){if(!e)return[];var a=[],i=[],s=[];return 0===t?(e.left&&zn(e.left,a),e.right&&zn(e.right,i),s=a.concat(i),[n.collection(s)]):1===t?e.value?[n.collection(e.value)]:(e.left&&zn(e.left,a),e.right&&zn(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=Is(e.left,t-1,n)),e.right&&(i=Is(e.right,t-1,n)),a.concat(i))},bu=function(e){for(var t=this.cy(),n=this.nodes(),a=function(e){var t=Hv(e),n=Uv[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=a.attributes,s=function(C,N){return ai(a.distance,i.length,function(z){return i[z](C)},function(z){return i[z](N)},C,N)},o=[],l=[],u=[],c=[],d=0;d<n.length;d++){var f={value:"dendrogram"===a.mode?n[d]:[n[d]],key:d,index:d};o[d]=f,c[d]=f,l[d]=[],u[d]=0}for(var h=0;h<o.length;h++)for(var v=0;v<=h;v++){var m;m="dendrogram"===a.mode?h===v?1/0:s(o[h].value,o[v].value):h===v?1/0:s(o[h].value[0],o[v].value[0]),l[h][v]=m,l[v][h]=m,m<l[h][u[h]]&&(u[h]=v)}for(var p=mu(o,c,l,u,a);p;)p=mu(o,c,l,u,a);var g;return"dendrogram"===a.mode?(g=Is(o[0],a.dendrogramDepth,t),a.addDendrogram&&As(o[0],t)):(g=new Array(o.length),o.forEach(function(w,C){w.key=w.index=null,g[C]=t.collection(w.value)})),g},jv={hierarchicalClustering:bu,hca:bu},Yv=ir({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),qv=function(e,t,n,a){var i=function(o,l){return a[l](o)};return-ai(e,a.length,function(s){return i(t,s)},function(s){return i(n,s)},t,n)},wu=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var u=n[l];t[i*e+u]>o&&(s=u,o=t[i*e+u])}s>0&&a.push(s)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},xu=function(e){for(var t=this.cy(),n=this.nodes(),a=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Xt("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||_e(n)||Xt("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),Yv(e)}(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var o,l,u,c,d,f,W;l=(o=n.length)*o,u=new Array(l);for(var h=0;h<l;h++)u[h]=-1/0;for(var v=0;v<o;v++)for(var m=0;m<o;m++)v!==m&&(u[v*o+m]=qv(a.distance,n[v],n[m],a.attributes));c=function(e,t){var n;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,l=e.length-1;l>=0;l--)s?isFinite(e[l])||(e[l]=-1/0,o++):e.splice(l,1);i&&e.sort(function(f,h){return f-h});var c=e.length,d=Math.floor(c/2);return c%2!=0?e[d+1+o]:(e[d-1+o]+e[d+o])/2}(e):"mean"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,a=0,i=0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s<n;s++){var o=e[s];isFinite(o)&&(a+=o,i++)}return a/i}(e):"min"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,a=1/0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a}(e):"max"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,a=-1/0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a}(e):t,n}(u,a.preference);for(var p=0;p<o;p++)u[p*o+p]=c;d=new Array(l);for(var g=0;g<l;g++)d[g]=0;f=new Array(l);for(var w=0;w<l;w++)f[w]=0;for(var C=new Array(o),N=new Array(o),z=new Array(o),V=0;V<o;V++)C[V]=0,N[V]=0,z[V]=0;for(var F=new Array(o*a.minIterations),U=0;U<F.length;U++)F[U]=0;for(W=0;W<a.maxIterations;W++){for(var Z=0;Z<o;Z++){for(var K=-1/0,J=-1/0,Q=-1,le=0,de=0;de<o;de++)C[de]=d[Z*o+de],(le=f[Z*o+de]+u[Z*o+de])>=K?(J=K,K=le,Q=de):le>J&&(J=le);for(var he=0;he<o;he++)d[Z*o+he]=(1-a.damping)*(u[Z*o+he]-K)+a.damping*C[he];d[Z*o+Q]=(1-a.damping)*(u[Z*o+Q]-J)+a.damping*C[Q]}for(var ue=0;ue<o;ue++){for(var ge=0,Se=0;Se<o;Se++)C[Se]=f[Se*o+ue],N[Se]=Math.max(0,d[Se*o+ue]),ge+=N[Se];ge-=N[ue],N[ue]=d[ue*o+ue],ge+=N[ue];for(var Le=0;Le<o;Le++)f[Le*o+ue]=(1-a.damping)*Math.min(0,ge-N[Le])+a.damping*C[Le];f[ue*o+ue]=(1-a.damping)*(ge-N[ue])+a.damping*C[ue]}for(var ye=0,De=0;De<o;De++){var Ue=f[De*o+De]+d[De*o+De]>0?1:0;F[W%a.minIterations*o+De]=Ue,ye+=Ue}if(ye>0&&(W>=a.minIterations-1||W==a.maxIterations-1)){for(var $e=0,Xe=0;Xe<o;Xe++){z[Xe]=0;for(var Qe=0;Qe<a.minIterations;Qe++)z[Xe]+=F[Qe*o+Xe];(0===z[Xe]||z[Xe]===a.minIterations)&&$e++}if($e===o)break}}for(var tt=function(e,t,n){for(var a=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&a.push(i);return a}(o,d,f),at=function(e,t,n){for(var a=wu(e,t,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 l=-1,u=-1/0,c=0;c<s.length;c++){for(var d=0,f=0;f<s.length;f++)d+=t[s[f]*e+s[c]];d>u&&(l=c,u=d)}n[i]=s[l]}return wu(e,t,n)}(o,u,tt),He={},Te=0;Te<tt.length;Te++)He[tt[Te]]=[];for(var Ie=0;Ie<n.length;Ie++){var ze=at[i[n[Ie].id()]];null!=ze&&He[ze].push(n[Ie])}for(var rt=new Array(tt.length),ct=0;ct<tt.length;ct++)rt[ct]=t.collection(He[tt[ct]]);return rt},Jv={affinityPropagation:xu,ap:xu},Qv=ir({root:void 0,directed:!1}),eg={hierholzer:function(e){if(!Oe(e)){var t=arguments;e={root:t[0],directed:t[1]}}var l,u,c,n=Qv(e),a=n.root,i=n.directed,s=this,o=!1;a&&(c=oe(a)?this.filter(a)[0].id():a[0].id());var d={},f={};s.forEach(i?function(w){var C=w.id();if(w.isNode()){var N=w.indegree(!0),z=w.outdegree(!0),V=N-z,F=z-N;1==V?l?o=!0:l=C:1==F?u?o=!0:u=C:(F>1||V>1)&&(o=!0),d[C]=[],w.outgoers().forEach(function(U){U.isEdge()&&d[C].push(U.id())})}else f[C]=[void 0,w.target().id()]}:function(w){var C=w.id();w.isNode()?(w.degree(!0)%2&&(l?u?o=!0:u=C:l=C),d[C]=[],w.connectedEdges().forEach(function(z){return d[C].push(z.id())})):f[C]=[w.source().id(),w.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(u&&l)if(i){if(c&&u!=c)return h;c=u}else{if(c&&u!=c&&l!=c)return h;c||(c=u)}else c||(c=s[0].id());var v=function(C){for(var V,F,U,N=C,z=[C];d[N].length;)V=d[N].shift(),F=f[V][0],N!=(U=f[V][1])?(d[U]=d[U].filter(function(W){return W!=V}),N=U):!i&&N!=F&&(d[F]=d[F].filter(function(W){return W!=V}),N=F),z.unshift(V),z.unshift(N);return z},m=[],p=[];for(p=v(c);1!=p.length;)0==d[p[0]].length?(m.unshift(s.getElementById(p.shift())),m.unshift(s.getElementById(p.shift()))):p=v(p.shift()).concat(p);for(var g in m.unshift(s.getElementById(p.shift())),d)if(d[g].length)return h;return h.found=!0,h.trail=this.spawn(m,!0),h}},si=function(){var e=this,t={},n=0,a=0,i=[],s=[],o={},u=function(f,h,v){f===v&&(a+=1),t[h]={id:n,low:n++,cutVertex:!1};var p,g,w,C,m=e.getElementById(h).connectedEdges().intersection(e);0===m.size()?i.push(e.spawn(e.getElementById(h))):m.forEach(function(N){p=N.source().id(),g=N.target().id(),(w=p===h?g:p)!==v&&(C=N.id(),o[C]||(o[C]=!0,s.push({x:h,y:w,edge:N})),w in t?t[h].low=Math.min(t[h].low,t[w].id):(u(f,w,h),t[h].low=Math.min(t[h].low,t[w].low),t[h].id<=t[w].low&&(t[h].cutVertex=!0,function(f,h){for(var v=s.length-1,m=[],p=e.spawn();s[v].x!=f||s[v].y!=h;)m.push(s.pop().edge),v--;m.push(s.pop().edge),m.forEach(function(g){var w=g.connectedNodes().intersection(e);p.merge(g),w.forEach(function(C){var N=C.id(),z=C.connectedEdges().intersection(e);p.merge(C),p.merge(t[N].cutVertex?z.filter(function(V){return V.isLoop()}):z)})}),i.push(p)}(h,w))))})};e.forEach(function(d){if(d.isNode()){var f=d.id();f in t||(a=0,u(f,f),t[f].cutVertex=a>1)}});var c=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:i}},oi=function(){var e=this,t={},n=0,a=[],i=[],s=e.spawn(e),o=function(u){if(i.push(u),t[u]={index:n,low:n++,explored:!1},e.getElementById(u).connectedEdges().intersection(e).forEach(function(m){var p=m.target().id();p!==u&&(p in t||o(p),t[p].explored||(t[u].low=Math.min(t[u].low,t[p].low)))}),t[u].index===t[u].low){for(var d=e.spawn();;){var f=i.pop();if(d.merge(e.getElementById(f)),t[f].low=t[u].index,t[f].explored=!0,f===u)break}var h=d.edgesWith(d),v=d.merge(h);a.push(v),s=s.difference(v)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||o(u)}}),{cut:s,components:a}},Eu={};[ha,Mh,Oh,kh,_h,Gh,Hh,gv,_n,Fn,Ds,Av,Vv,jv,Jv,eg,{hopcroftTarjanBiconnected:si,htbc:si,htb:si,hopcroftTarjanBiconnectedComponents:si},{tarjanStronglyConnected:oi,tsc:oi,tscc:oi,tarjanStronglyConnectedComponents:oi}].forEach(function(r){mt(Eu,r)});var Lr=function(e){if(!(this instanceof Lr))return new Lr(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Lr.prototype={fulfill:function(e){return Su(this,1,"fulfillValue",e)},reject:function(e){return Su(this,2,"rejectReason",e)},then:function(e,t){var n=this,a=new Lr;return n.onFulfilled.push(Iu(e,a,"fulfill")),n.onRejected.push(Iu(t,a,"reject")),Lu(n),a.proxy}};var Su=function(e,t,n,a){return 0===e.state&&(e.state=t,e[n]=a,Lu(e)),e},Lu=function(e){1===e.state?Au(e,"onFulfilled",e.fulfillValue):2===e.state&&Au(e,"onRejected",e.rejectReason)},Au=function(e,t,n){if(0!==e[t].length){var a=e[t];e[t]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Iu=function(e,t,n){return function(a){if("function"!=typeof e)t[n].call(t,a);else{var i;try{i=e(a)}catch(s){return void t.reject(s)}Nu(t,i)}}},Nu=function(e,t){if(e!==t&&e.proxy!==t){var n;if("object"===pe(t)&&null!==t||"function"==typeof t)try{n=t.then}catch(i){return void e.reject(i)}if("function"!=typeof n)e.fulfill(t);else{var a=!1;try{n.call(t,function(i){a||(a=!0,i===t?e.reject(new TypeError("circular thenable chain")):Nu(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}}}else e.reject(new TypeError("cannot resolve promise with itself"))};Lr.all=function(r){return new Lr(function(e,t){for(var n=new Array(r.length),a=0,i=function(l,u){n[l]=u,++a===r.length&&e(n)},s=0;s<r.length;s++)(function(o){var l=r[o];null!=l&&null!=l.then?l.then(function(d){i(o,d)},function(d){t(d)}):i(o,l)})(s)})},Lr.resolve=function(r){return new Lr(function(e,t){e(r)})},Lr.reject=function(r){return new Lr(function(e,t){t(r)})};var Vn=typeof Promise<"u"?Promise:Lr,Ns=function(e,t,n){var a=xr(e),i=!a,s=this._private=mt({duration:1e3},t,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&&Be(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 l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},xn=Ns.prototype;mt(xn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n=e.target._private.animation;(e.queue?n.queue:n.current).push(this),vt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];null!=d&&(e[u]=e[c],e[c]=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 t&&this.play(),this},promise:function(e){var n,t=this._private;return n="frame"===e?t.frames:t.completes,new Vn(function(a,i){n.push(function(){a()})})}}),xn.complete=xn.completed,xn.run=xn.play,xn.running=xn.playing;var Rs,Ru,Ms,Mu,Os,Ou,Ps,Pu,ks,ku,Bs,Bu,_s,_u,Fs,Fu,Gs,Gu,Vs,zu,Hs,Vu,Us,Hu,Xs,Uu,js,Xu,Ys,ju,Ws,Yu,qs,Wu,$s,qu,Ks,Ku,Zs,Zu,Js,Ju,Qs,Qu,eo,ec,to,tc,ro,rc,no,nc,ao,ac,io,ic,so,sc,oo,oc,lo,lc,uo,uc,co,cc,fo,dc,ho,fc,vo,hc,go,gc,po,yc,yo,mc,mo,wc,bo,Ec,xo,Tc,Eo,Cc,ng={animated:function(){return function(){var t=this,a=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return!1;var s=a[0];return s?s._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var t=this,a=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var s=0;s<a.length;s++)a[s]._private.animation.queue=[];return this}},delay:function(){return function(t,n){return(this._private.cy||this).styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){return(this._private.cy||this).styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var a=this,i=void 0!==a.length,s=i?a:[a],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var c=o.style();if(t=mt({},t,n),0===Object.keys(t).length)return new Ns(s[0],t);switch(void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}if(u&&(t.style=c.getPropsList(t.style||t.css),t.css=void 0),u&&null!=t.renderedPosition){var f=t.renderedPosition,h=o.pan(),v=o.zoom();t.position=Jl(f,v,h)}if(l&&null!=t.panBy){var m=t.panBy,p=o.pan();t.pan={x:p.x+m.x,y:p.y+m.y}}var g=t.center||t.centre;if(l&&null!=g){var w=o.getCenterPan(g.eles,t.zoom);null!=w&&(t.pan=w)}if(l&&null!=t.fit){var C=t.fit,N=o.getFitViewport(C.eles||C.boundingBox,C.padding);null!=N&&(t.pan=N.pan,t.zoom=N.zoom)}if(l&&Oe(t.zoom)){var z=o.getZoomedViewport(t.zoom);null!=z?(z.zoomed&&(t.zoom=z.zoom),z.panned&&(t.pan=z.pan)):t.zoom=null}return new Ns(s[0],t)}},animate:function(){return function(t,n){var a=this,s=void 0!==a.length?a:[a];if(!(this._private.cy||this).styleEnabled())return this;n&&(t=mt({},t,n));for(var l=0;l<s.length;l++){var u=s[l],c=u.animated()&&(void 0===t.queue||t.queue);u.animation(t,c?{queue:!0}:void 0).play()}return this}},stop:function(){return function(t,n){var a=this,s=void 0!==a.length?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var c=s[l]._private,d=c.animation.current,f=0;f<d.length;f++)n&&(d[f]._private.duration=0);t&&(c.animation.queue=[]),n||(c.animation.current=[])}return o.notify("draw"),this}}};function li(){return Ru?Rs:(Ru=1,Rs=Array.isArray)}function ug(){if(_u)return _s;_u=1;var r=function ig(){if(Ou)return Os;Ou=1;var r=Ol(),e=la();return Os=function s(o){if(!e(o))return!1;var l=r(o);return"[object Function]"==l||"[object GeneratorFunction]"==l||"[object AsyncFunction]"==l||"[object Proxy]"==l}}(),e=function og(){if(ku)return ks;ku=1;var n,r=function sg(){if(Pu)return Ps;Pu=1;var r=ja();return Ps=r["__core-js_shared__"]}(),e=(n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return ks=function t(n){return!!e&&e in n},ks}(),t=la(),n=function lg(){if(Bu)return Bs;Bu=1;var e=Function.prototype.toString;return Bs=function t(n){if(null!=n){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}}(),i=/^\[object .+?Constructor\]$/,c=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return _s=function d(f){return!(!t(f)||e(f))&&(r(f)?c:i).test(n(f))}}function zs(){if(Gu)return Gs;Gu=1;var r=ug(),e=function cg(){return Fu?Fs:(Fu=1,Fs=function r(e,t){return e?.[t]})}();return Gs=function t(n,a){var i=e(n,a);return r(i)?i:void 0}}function ui(){if(zu)return Vs;zu=1;var e=zs()(Object,"create");return Vs=e}function $u(){return qu?$s:(qu=1,$s=function r(e,t){return e===t||e!=e&&t!=t})}function ci(){if(Ku)return Ks;Ku=1;var r=$u();return Ks=function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}}function Cg(){if(nc)return no;nc=1;var r=function pg(){if(Yu)return Ws;Yu=1;var r=function dg(){if(Vu)return Hs;Vu=1;var r=ui();return Hs=function e(){this.__data__=r?r(null):{},this.size=0}}(),e=function fg(){return Hu?Us:(Hu=1,Us=function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t})}(),t=function hg(){if(Uu)return Xs;Uu=1;var r=ui(),n=Object.prototype.hasOwnProperty;return Xs=function a(i){var s=this.__data__;if(r){var o=s[i];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(s,i)?s[i]:void 0}}(),n=function vg(){if(Xu)return js;Xu=1;var r=ui(),t=Object.prototype.hasOwnProperty;return js=function n(a){var i=this.__data__;return r?void 0!==i[a]:t.call(i,a)}}(),a=function gg(){if(ju)return Ys;ju=1;var r=ui();return Ys=function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&void 0===a?"__lodash_hash_undefined__":a,this}}();function i(s){var o=-1,l=null==s?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Ws=i}(),e=function Eg(){if(tc)return to;tc=1;var r=function yg(){return Wu?qs:(Wu=1,qs=function r(){this.__data__=[],this.size=0})}(),e=function mg(){if(Zu)return Zs;Zu=1;var r=ci(),t=Array.prototype.splice;return Zs=function n(a){var i=this.__data__,s=r(i,a);return!(s<0||(s==i.length-1?i.pop():t.call(i,s,1),--this.size,0))}}(),t=function bg(){if(Ju)return Js;Ju=1;var r=ci();return Js=function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}}(),n=function wg(){if(Qu)return Qs;Qu=1;var r=ci();return Qs=function e(t){return r(this.__data__,t)>-1}}(),a=function xg(){if(ec)return eo;ec=1;var r=ci();return eo=function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}}();function i(s){var o=-1,l=null==s?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,to=i}(),t=function Tg(){if(rc)return ro;rc=1;var t=zs()(ja(),"Map");return ro=t}();return no=function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}}function di(){if(ic)return io;ic=1;var r=function Dg(){return ac?ao:(ac=1,ao=function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e})}();return io=function e(t,n){var a=t.__data__;return r(n)?a["string"==typeof n?"string":"hash"]:a.map}}function Mg(){if(fc)return ho;fc=1;var r=function Rg(){if(dc)return fo;dc=1;var r=function Ng(){if(cc)return co;cc=1;var r=Cg(),e=function Sg(){if(sc)return so;sc=1;var r=di();return so=function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}(),t=function Lg(){if(oc)return oo;oc=1;var r=di();return oo=function e(t){return r(this,t).get(t)}}(),n=function Ag(){if(lc)return lo;lc=1;var r=di();return lo=function e(t){return r(this,t).has(t)}}(),a=function Ig(){if(uc)return uo;uc=1;var r=di();return uo=function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}}();function i(s){var o=-1,l=null==s?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,co=i}();function t(n,a){if("function"!=typeof n||null!=a&&"function"!=typeof a)throw new TypeError("Expected a function");var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,fo=t}();return ho=function t(n){var a=r(n,function(s){return 500===i.size&&i.clear(),s}),i=a.cache;return a}}function vc(){if(hc)return vo;hc=1;var r=Mg(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return 46===a.charCodeAt(0)&&i.push(""),a.replace(e,function(s,o,l,u){i.push(l?u.replace(t,"$1"):o||s)}),i});return vo=n}function pc(){return gc?go:(gc=1,go=function r(e,t){for(var n=-1,a=null==e?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i})}function bc(){if(mc)return yo;mc=1;var r=function Og(){if(yc)return po;yc=1;var r=rs(),e=pc(),t=li(),n=ua(),a=r?r.prototype:void 0,i=a?a.toString:void 0;return po=function s(o){if("string"==typeof o)return o;if(t(o))return e(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return"0"==l&&1/o==-1/0?"-0":l}}();return yo=function e(t){return null==t?"":r(t)}}function xc(){if(wc)return mo;wc=1;var r=li(),e=function ag(){if(Mu)return Ms;Mu=1;var r=li(),e=ua(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return Ms=function a(i,s){if(r(i))return!1;var o=typeof i;return!("number"!=o&&"symbol"!=o&&"boolean"!=o&&null!=i&&!e(i))||n.test(i)||!t.test(i)||null!=s&&i in Object(s)}}(),t=vc(),n=bc();return mo=function a(i,s){return r(i)?i:e(i,s)?[i]:t(n(i))}}function wo(){if(Ec)return bo;Ec=1;var r=ua();return bo=function e(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}}var To,Dc,Co,Sc,Do,Lc,So,Ac,Lo,Ic,Ao,Nc,Bg=function kg(){if(Cc)return Eo;Cc=1;var r=function Pg(){if(Tc)return xo;Tc=1;var r=xc(),e=wo();return xo=function t(n,a){for(var i=0,s=(a=r(a,n)).length;null!=n&&i<s;)n=n[e(a[i++])];return i&&i==s?n:void 0}}();return Eo=function e(t,n,a){var i=null==t?void 0:r(t,n);return void 0===i?a:i}}(),_g=oa(Bg);function Hg(){if(Ic)return Lo;Ic=1;var r=function zg(){if(Lc)return Do;Lc=1;var r=function Gg(){if(Sc)return Co;Sc=1;var r=function Fg(){if(Dc)return To;Dc=1;var r=zs(),e=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}}();return To=e}();return Co=function e(t,n,a){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}}(),e=$u(),n=Object.prototype.hasOwnProperty;return Do=function a(i,s,o){var l=i[s];(!n.call(i,s)||!e(l,o)||void 0===o&&!(s in i))&&r(i,s,o)}}(),e=xc(),t=function Vg(){if(Ac)return So;Ac=1;var e=/^(?:0|[1-9]\d*)$/;return So=function t(n,a){var i=typeof n;return!!(a=a??9007199254740991)&&("number"==i||"symbol"!=i&&e.test(n))&&n>-1&&n%1==0&&n<a}}(),n=la(),a=wo();return Lo=function i(s,o,l,u){if(!n(s))return s;for(var c=-1,d=(o=e(o,s)).length,f=d-1,h=s;null!=h&&++c<d;){var v=a(o[c]),m=l;if("__proto__"===v||"constructor"===v||"prototype"===v)return s;if(c!=f){var p=h[v];void 0===(m=u?u(p,v,h):void 0)&&(m=n(p)?p:t(o[c+1])?[]:{})}r(h,v,m),h=h[v]}return s}}var Io,Rc,No,Mc,jg=oa(function Ug(){if(Nc)return Ao;Nc=1;var r=Hg();return Ao=function e(t,n,a){return null==t?t:r(t,n,a)}}()),qg=function Wg(){if(Mc)return No;Mc=1;var r=pc(),e=function Yg(){return Rc?Io:(Rc=1,Io=function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t})}(),t=li(),n=ua(),a=vc(),i=wo(),s=bc();return No=function o(l){return t(l)?r(l,i):n(l)?[l]:e(a(s(l)))}}(),$g=oa(qg),Kg={data:function(e){return e=mt({},{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}},e),function(a,i){var s=e,o=this,l=void 0!==o.length,u=l?o:[o],c=l?o[0]:o;if(oe(a)){var h,f=-1!==a.indexOf(".")&&$g(a);if(s.allowGetting&&void 0===i)return c&&(s.beforeGet(c),h=f&&void 0===c._private[s.field][a]?_g(c._private[s.field],f):c._private[s.field][a]),h;if(s.allowSetting&&void 0!==i&&!s.immutableKeys[a]){var m=ae({},a,i);s.beforeSet(o,m);for(var p=0,g=u.length;p<g;p++){var w=u[p];s.canSet(w)&&(f&&void 0===c._private[s.field][a]?jg(w._private[s.field],f,i):w._private[s.field][a]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}else if(s.allowSetting&&Oe(a)){var N,z,C=a,V=Object.keys(C);s.beforeSet(o,C);for(var F=0;F<V.length;F++)if(z=C[N=V[F]],!s.immutableKeys[N])for(var W=0;W<u.length;W++){var Z=u[W];s.canSet(Z)&&(Z._private[s.field][N]=z)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Be(a))o.on(s.bindingEvent,a);else if(s.allowGetting&&void 0===a){var J;return c&&(s.beforeGet(c),J=c._private[s.field]),J}return o}},removeData:function(e){return e=mt({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(a){var i=e,s=this,l=void 0!==s.length?s:[s];if(oe(a)){for(var u=a.split(/\s+/),c=u.length,d=0;d<c;d++){var f=u[d];if(!Sr(f)&&!i.immutableKeys[f])for(var v=0,m=l.length;v<m;v++)l[v]._private[i.field][f]=void 0}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(void 0===a){for(var p=0,g=l.length;p<g;p++)for(var w=l[p]._private[i.field],C=Object.keys(w),N=0;N<C.length;N++){var z=C[N];!i.immutableKeys[z]&&(w[z]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},Zg={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new Vn(function(o,l){var c=s.concat([function(h){i.off.apply(i,d),o(h)}]),d=c.concat([]);i.on.apply(i,c)})}}},Ft={};[ng,Kg,Zg].forEach(function(r){mt(Ft,r)});var Jg={animate:Ft.animate(),animation:Ft.animation(),animated:Ft.animated(),clearQueue:Ft.clearQueue(),delay:Ft.delay(),delayAnimation:Ft.delayAnimation(),stop:Ft.stop()},fi={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach(function(v){return n.push(v)}),n}Ye(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new Pn(e),s=0;s<t.length;s++){for(var o=t[s],l=o._private,u=l.classes,c=!1,d=0;d<e.length;d++)if(!u.has(e[d])){c=!0;break}c||(c=u.size!==e.length),c&&(l.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){Ye(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=void 0===t,i=[],s=0,o=n.length;s<o;s++)for(var l=n[s],u=l._private.classes,c=!1,d=0;d<e.length;d++){var f=e[d],h=u.has(f),v=!1;t||a&&!h?(u.add(f),v=!0):(!t||a&&h)&&(u.delete(f),v=!0),!c&&v&&(i.push(l),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};fi.className=fi.classNames=fi.classes;var Ot={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:Jt,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 r,e,t;for(r=Ot.comparatorOp.split("|"),t=0;t<r.length;t++)Ot.comparatorOp+="|@"+(e=r[t]);for(r=Ot.comparatorOp.split("|"),t=0;t<r.length;t++)!((e=r[t]).indexOf("!")>=0)&&"="!==e&&(Ot.comparatorOp+="|\\!"+e)}();var Ro=[{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(r,e){return function(e,t){return-1*bl(e,t)}(r.selector,e.selector)}),Qg=function(){for(var e,r={},t=0;t<Ro.length;t++)r[(e=Ro[t]).selector]=e.matches;return r}(),tp="("+Ro.map(function(r){return r.selector}).join("|")+")",Hn=function(e){return e.replace(new RegExp("\\\\("+Ot.metaChar+")","g"),function(t,n){return n})},rn=function(e,t,n){e[e.length-1]=n},Mo=[{name:"group",query:!0,regex:"("+Ot.group+")",populate:function(e,t,n){var i=fe(n,1)[0];t.checks.push({type:0,value:"*"===i?i:i+"s"})}},{name:"state",query:!0,regex:tp,populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:7,value:a[0]})}},{name:"id",query:!0,regex:"\\#("+Ot.id+")",populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:8,value:Hn(a[0])})}},{name:"className",query:!0,regex:"\\.("+Ot.className+")",populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:9,value:Hn(a[0])})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ot.variable+")\\s*\\]",populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:4,field:Hn(a[0])})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ot.variable+")\\s*("+Ot.comparatorOp+")\\s*("+Ot.value+")\\s*\\]",populate:function(e,t,n){var a=fe(n,3),i=a[0],s=a[1],o=a[2];o=null!=new RegExp("^"+Ot.string+"$").exec(o)?o.substring(1,o.length-1):parseFloat(o),t.checks.push({type:3,field:Hn(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ot.boolOp+")\\s*("+Ot.variable+")\\s*\\]",populate:function(e,t,n){var a=fe(n,2),i=a[0];t.checks.push({type:5,field:Hn(a[1]),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ot.meta+")\\s*("+Ot.comparatorOp+")\\s*("+Ot.number+")\\s*\\]\\]",populate:function(e,t,n){var a=fe(n,3),s=a[1],o=a[2];t.checks.push({type:6,field:Hn(a[0]),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Ot.separator,populate:function(e,t){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];return null!=n&&(s.subject=n,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:Ot.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},i={checks:[]};return n.checks.push({type:11,source:t,target:i}),rn(e,0,n),e.edgeCount++,i}var s={checks:[]},l={checks:[]};return s.checks.push({type:12,source:t,target:l}),rn(e,0,s),e.edgeCount++,l}},{name:"undirectedEdge",separator:!0,regex:Ot.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},i={checks:[]};return n.checks.push({type:10,nodes:[t,i]}),rn(e,0,n),e.edgeCount++,i}var s={checks:[]},l={checks:[]};return s.checks.push({type:14,node:t,neighbor:l}),rn(e,0,s),l}},{name:"child",separator:!0,regex:Ot.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},a={checks:[]};return n.checks.push({type:15,parent:e[e.length-1],child:a}),rn(e,0,n),e.compoundCount++,a}if(e.currentSubject===t){var s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]},d={checks:[]};return s.checks.push({type:19,left:e[e.length-1],right:l,subject:u}),u.checks=t.checks,t.checks=[{type:20}],d.checks.push({type:20}),l.checks.push({type:17,parent:d,child:c}),rn(e,0,s),e.currentSubject=u,e.compoundCount++,c}var f={checks:[]},h={checks:[]},v=[{type:17,parent:f,child:h}];return f.checks=t.checks,t.checks=v,e.compoundCount++,h}},{name:"descendant",separator:!0,regex:Ot.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},a={checks:[]};return n.checks.push({type:16,ancestor:e[e.length-1],descendant:a}),rn(e,0,n),e.compoundCount++,a}if(e.currentSubject===t){var s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]},d={checks:[]};return s.checks.push({type:19,left:e[e.length-1],right:l,subject:u}),u.checks=t.checks,t.checks=[{type:20}],d.checks.push({type:20}),l.checks.push({type:18,ancestor:d,descendant:c}),rn(e,0,s),e.currentSubject=u,e.compoundCount++,c}var f={checks:[]},h={checks:[]},v=[{type:18,ancestor:f,descendant:h}];return f.checks=t.checks,t.checks=v,e.compoundCount++,h}},{name:"subject",modifier:!0,regex:Ot.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return _t("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var a=e[e.length-1].checks[0],i=null==a?null:a.type;11===i?a.type=13:10===i&&(a.type=14,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];Mo.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var rp=function(e){for(var t,n,a,i=0;i<Mo.length;i++){var s=Mo[i],o=s.name,l=e.match(s.regexObj);if(null!=l){n=l,t=s,a=o,e=e.substring(l[0].length);break}}return{expr:t,match:n,name:a,remaining:e}},sp={parse:function(e){var t=this,n=t.inputText=e,a=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);return t&&(e=e.substring(t[0].length)),e}(n);;){var i=rp(n);if(null==i.expr)return _t("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(t,a,s);if(!1===o)return!1;if(null!=o&&(a=o),(n=i.remaining).match(/^\s*$/))break}var l=t[t.length-1];null!=t.currentSubject&&(l.subject=t.currentSubject),l.edgeCount=t.edgeCount,l.compoundCount=t.compoundCount;for(var u=0;u<t.length;u++){var c=t[u];if(c.compoundCount>0&&c.edgeCount>0)return _t("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return _t("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&_t("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(c){return c??""},t=function(c){return oe(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},i=function(c,d){return c.checks.reduce(function(f,h,v){return f+(d===c&&0===v?"$":"")+function(c,d){var h=c.value;switch(c.type){case 0:var v=e(h);return v.substring(0,v.length-1);case 3:return"["+c.field+n(e(c.operator))+t(h)+"]";case 5:var w=c.field;return"["+e(c.operator)+w+"]";case 4:return"["+c.field+"]";case 6:return"[["+c.field+n(e(c.operator))+t(h)+"]]";case 7:return h;case 8:return"#"+h;case 9:return"."+h;case 17:case 15:return i(c.parent,d)+n(">")+i(c.child,d);case 18:case 16:return i(c.ancestor,d)+" "+i(c.descendant,d);case 19:var V=i(c.left,d),F=i(c.subject,d),U=i(c.right,d);return V+(V.length>0?" ":"")+F+U;case 20:return""}}(h,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=i(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s}},Oc=function(e,t,n){var a,l,u,i=oe(e),s=_e(e),o=oe(n),c=!1,d=!1,f=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(i||o||c)&&(l=i||s?""+e:"",u=""+n),c&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),t){case"*=":a=l.indexOf(u)>=0;break;case"$=":a=l.indexOf(u,l.length-u.length)>=0;break;case"^=":a=0===l.indexOf(u);break;case"=":a=e===n;break;case">":f=!0,a=e>n;break;case">=":f=!0,a=e>=n;break;case"<":f=!0,a=e<n;break;case"<=":f=!0,a=e<=n;break;default:a=!1}return d&&(null!=e||!f)&&(a=!a),a},Oo=function(e,t){return e.data(t)},Yt=[],Ut=function(e,t){return e.checks.every(function(n){return Yt[n.type](n,t)})};Yt[0]=function(r,e){var t=r.value;return"*"===t||t===e.group()},Yt[7]=function(r,e){return function(e,t){return Qg[e](t)}(r.value,e)},Yt[8]=function(r,e){var t=r.value;return e.id()===t},Yt[9]=function(r,e){return e.hasClass(r.value)},Yt[6]=function(r,e){var n=r.operator,a=r.value;return Oc(function(e,t){return e[t]()}(e,r.field),n,a)},Yt[3]=function(r,e){var n=r.operator,a=r.value;return Oc(Oo(e,r.field),n,a)},Yt[5]=function(r,e){var n=r.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Oo(e,r.field),n)},Yt[4]=function(r,e){return function(e){return void 0!==e}(Oo(e,r.field))},Yt[10]=function(r,e){var t=r.nodes[0],n=r.nodes[1],a=e.source(),i=e.target();return Ut(t,a)&&Ut(n,i)||Ut(n,a)&&Ut(t,i)},Yt[14]=function(r,e){return Ut(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Ut(r.neighbor,t)})},Yt[11]=function(r,e){return Ut(r.source,e.source())&&Ut(r.target,e.target())},Yt[12]=function(r,e){return Ut(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Ut(r.target,t)})},Yt[13]=function(r,e){return Ut(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Ut(r.source,t)})},Yt[15]=function(r,e){return Ut(r.child,e)&&Ut(r.parent,e.parent())},Yt[17]=function(r,e){return Ut(r.parent,e)&&e.children().some(function(t){return Ut(r.child,t)})},Yt[16]=function(r,e){return Ut(r.descendant,e)&&e.ancestors().some(function(t){return Ut(r.ancestor,t)})},Yt[18]=function(r,e){return Ut(r.ancestor,e)&&e.descendants().some(function(t){return Ut(r.descendant,t)})},Yt[19]=function(r,e){return Ut(r.subject,e)&&Ut(r.left,e)&&Ut(r.right,e)},Yt[20]=function(){return!0},Yt[1]=function(r,e){return r.value.has(e)},Yt[2]=function(r,e){return(0,r.value)(e)};var fp={matches:function(e){for(var n=0;n<this.length;n++)if(Ut(this[n],e))return!0;return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&8===t[0].checks[0].type)return e.getElementById(t[0].checks[0].value).collection();var n=function(i){for(var s=0;s<t.length;s++)if(Ut(t[s],i))return!0;return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},nn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||oe(e)&&e.match(/^\s*$/)||(vt(e)?this.addQuery({checks:[{type:1,value:e.collection()}]}):Be(e)?this.addQuery({checks:[{type:2,value:e}]}):oe(e)?this.parse(e)||(this.invalid=!0):Xt("A selector must be created from a string; found "))},an=nn.prototype;[sp,fp].forEach(function(r){return mt(an,r)}),an.text=function(){return this.inputText},an.size=function(){return this.length},an.eq=function(r){return this[r]},an.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()},an.addQuery=function(r){this[this.length++]=r},an.selector=an.toString;var sn={allAre:function(e){var t=new nn(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new nn(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?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(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};sn.allAreNeighbours=sn.allAreNeighbors,sn.has=sn.contains,sn.equal=sn.equals=sn.same;var ba,Bc,Er=function(e,t){return function(a,i,s,o){var c,l=a,u=this;if(null==l?c="":vt(l)&&1===l.length&&(c=l.id()),1===u.length&&c){var d=u[0]._private,f=d.traversalCache=d.traversalCache||{},h=f[t]=f[t]||[],v=yn(c);return h[v]||(h[v]=e.call(u,a,i,s,o))}return e.call(u,a,i,s,o)}},Un={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var s=this[a]._private.parent;s&&t.push(s)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++)t.push(n[a]);n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var i=this[n].parents();t=(t=t||i).intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:Er(function(r){for(var e=[],t=0;t<this.length;t++)for(var a=this[t]._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function n(a){for(var i=0;i<a.length;i++){var s=a[i];t.push(s),s.children().nonempty()&&n(s.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Po(r,e,t,n){for(var a=[],i=new Pn,o=r.cy().hasCompoundNodes(),l=0;l<r.length;l++){var u=r[l];t?a.push(u):o&&n(a,i,u)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),o&&n(a,i,c)}return r}function Pc(r,e,t){if(t.isParent())for(var n=t._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||r.push(i)}}function kc(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}function hp(r,e,t){kc(r,e,t),Pc(r,e,t)}Un.forEachDown=function(r){return Po(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Pc)},Un.forEachUp=function(r){return Po(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],kc)},Un.forEachUpAndDown=function(r){return Po(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],hp)},Un.ancestors=Un.parents,ba=Bc={data:Ft.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:Ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ft.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ft.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},ba.attr=ba.data,ba.removeAttr=ba.removeData;var vp=Bc,hi={};function ko(r){return function(e){var t=this;if(void 0===e&&(e=!0),0===t.length);else if(t.isNode()&&!t.removed()){for(var n=0,a=t[0],i=a._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(n+=r(a,o))}return n}}}function Xn(r,e){return function(t){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i][r](t);void 0!==o&&(void 0===n||e(o,n))&&(n=o)}return n}}mt(hi,{degree:ko(function(r,e){return e.source().same(e.target())?2:1}),indegree:ko(function(r,e){return e.target().same(r)?1:0}),outdegree:ko(function(r,e){return e.source().same(r)?1:0})}),mt(hi,{minDegree:Xn("degree",function(r,e){return r<e}),maxDegree:Xn("degree",function(r,e){return r>e}),minIndegree:Xn("indegree",function(r,e){return r<e}),maxIndegree:Xn("indegree",function(r,e){return r>e}),minOutdegree:Xn("outdegree",function(r,e){return r<e}),maxOutdegree:Xn("outdegree",function(r,e){return r>e})}),mt(hi,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var Ar,_c,Fc=function(e,t,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,o={x:null!=t.x?t.x-s.x:0,y:null!=t.y?t.y-s.y:0};i.isParent()&&!(0===o.x&&0===o.y)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},Gc={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){Fc(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Ar=_c={position:Ft.data(Gc),silentPosition:Ft.data(mt({},Gc,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Fc(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Oe(e))t?this.silentPosition(e):this.position(e);else if(Be(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o,s=this[i];(o=n(s,i))&&(t?s.silentPosition(o):s.position(o))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var a;if(Oe(e)?(a={x:_e(e.x)?e.x:0,y:_e(e.y)?e.y:0},n=t):oe(e)&&_e(t)&&((a={x:0,y:0})[e]=t),null!=a){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 l=o.position(),u={x:l.x+a.x,y:l.y+a.y};n?o.silentPosition(u):o.position(u)}}i.endBatch()}return this},silentShift:function(e,t){return Oe(e)?this.shift(e,!0):oe(e)&&_e(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),o=Oe(e)?e:void 0,l=void 0!==o||void 0!==t&&oe(e);if(n&&n.isNode()){if(!l){var d=n.position();return o=Za(d,i,s),void 0===e?o:o[e]}for(var u=0;u<this.length;u++){var c=this[u];void 0!==t?c.position(e,(t-s[e])/i):void 0!==o&&c.position(Jl(o,i,s))}}else if(!l)return;return this},relativePosition:function(e,t){var n=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=void 0!==i||void 0!==t&&oe(e),o=a.hasCompoundNodes();if(n&&n.isNode()){if(!s){var v=n.position(),m=o?n.parent():null,p=m&&m.length>0;p&&(m=m[0]);var w=p?m.position():{x:0,y:0};return i={x:v.x-w.x,y:v.y-w.y},void 0===e?i:i[e]}for(var l=0;l<this.length;l++){var u=this[l],c=o?u.parent():null,d=c&&c.length>0;d&&(c=c[0]);var h=d?c.position():{x:0,y:0};void 0!==t?u.position(e,t+h[e]):void 0!==i&&u.position({x:i.x+h.x,y:i.y+h.y})}}else if(!s)return;return this}},Ar.modelPosition=Ar.point=Ar.position,Ar.modelPositions=Ar.points=Ar.positions,Ar.renderedPoint=Ar.renderedPosition,Ar.relativePoint=Ar.relativePosition;var Wn,on,gp=_c,jn=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Yn=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}};Wn=on={},on.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),a=t.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,o=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}},on.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this):this},on.updateCompoundBounds=function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(s.isParent()){var o=s._private,l=s.children(),u="include"===s.pstyle("compound-sizing-wrt-labels").value,c={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=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(0===d.w||0===d.h)&&((d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue}).x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);var m=c.width.left.value;"px"===c.width.left.units&&c.width.val>0&&(m=100*m/c.width.val);var p=c.width.right.value;"px"===c.width.right.units&&c.width.val>0&&(p=100*p/c.width.val);var g=c.height.top.value;"px"===c.height.top.units&&c.height.val>0&&(g=100*g/c.height.val);var w=c.height.bottom.value;"px"===c.height.bottom.units&&c.height.val>0&&(w=100*w/c.height.val);var C=h(c.width.val-d.w,m,p),N=C.biasDiff,z=C.biasComplementDiff,V=h(c.height.val-d.h,g,w),F=V.biasDiff,U=V.biasComplementDiff;o.autoPadding=function v(W,Z,K,J){if("%"!==K.units)return"px"===K.units?K.pfValue:0;switch(J){case"width":return W>0?K.pfValue*W:0;case"height":return Z>0?K.pfValue*Z:0;case"average":return W>0&&Z>0?K.pfValue*(W+Z)/2:0;case"min":return W>0&&Z>0?W>Z?K.pfValue*Z:K.pfValue*W:0;case"max":return W>0&&Z>0?W>Z?K.pfValue*W:K.pfValue*Z:0;default:return 0}}(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,c.width.val),f.x=(-N+d.x1+d.x2+z)/2,o.autoHeight=Math.max(d.h,c.height.val),f.y=(-F+d.y1+d.y2+U)/2}function h(W,Z,K){var J=0,Q=0,le=Z+K;return W>0&&le>0&&(J=Z/le*W,Q=K/le*W),{biasDiff:J,biasComplementDiff:Q}}}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||r)&&(t(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Tr=function(e){return e===1/0||e===-1/0?0:e},Ir=function(e,t,n,a,i){a-t===0||i-n===0||null==t||null==n||null==a||null==i||(e.x1=t<e.x1?t: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)},ln=function(e,t){return null==t?e:Ir(e,t.x1,t.y1,t.x2,t.y2)},wa=function(e,t,n){return vr(e,t,n)},vi=function(e,t,n){if(!t.cy().headless()){var l,u,a=t._private,i=a.rstyle,s=i.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(l=i.srcX,u=i.srcY):"target"===n?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var c=a.arrowBounds=a.arrowBounds||{},d=c[n]=c[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,Qa(d,1),Ir(e,d.x1,d.y1,d.x2,d.y2)}}},Bo=function(e,t,n){if(!t.cy().headless()){var a,i=t._private,s=i.rstyle;if(t.pstyle((a=n?n+"-":"")+"label").strValue){var K,J,Q,le,l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),c=wa(s,"labelWidth",n),d=wa(s,"labelHeight",n),f=wa(s,"labelX",n),h=wa(s,"labelY",n),v=t.pstyle(a+"text-margin-x").pfValue,m=t.pstyle(a+"text-margin-y").pfValue,p=t.isEdge(),g=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,N=t.pstyle("text-border-width").pfValue/2,z=t.pstyle("text-background-padding").pfValue,F=d,U=c,W=U/2,Z=F/2;if(p)K=f-W,J=f+W,Q=h-Z,le=h+Z;else{switch(jn(l.value)){case"left":K=f-U,J=f;break;case"center":K=f-W,J=f+W;break;case"right":K=f,J=f+U}switch(Yn(u.value)){case"top":Q=h-F,le=h;break;case"center":Q=h-Z,le=h+Z;break;case"bottom":Q=h,le=h+F}}var de=v-Math.max(w,N)-z-2,he=v+Math.max(w,N)+z+2,ue=m-Math.max(w,N)-z-2,ge=m+Math.max(w,N)+z+2;K+=de,J+=he,Q+=ue,le+=ge;var Se=n||"main",Le=i.labelBounds,ye=Le[Se]=Le[Se]||{};ye.x1=K,ye.y1=Q,ye.x2=J,ye.y2=le,ye.w=J-K,ye.h=le-Q,ye.leftPad=de,ye.rightPad=he,ye.topPad=ue,ye.botPad=ge;var De=p&&"autorotate"===g.strValue;if(De||null!=g.pfValue&&0!==g.pfValue){var $e=De?wa(i.rstyle,"labelAngle",n):g.pfValue,Xe=Math.cos($e),Qe=Math.sin($e),tt=(K+J)/2,at=(Q+le)/2;if(!p){switch(jn(l.value)){case"left":tt=J;break;case"right":tt=K}switch(Yn(u.value)){case"top":at=le;break;case"bottom":at=Q}}var He=function(Et,bt){return{x:(Et-=tt)*Xe-(bt-=at)*Qe+tt,y:Et*Qe+bt*Xe+at}},Te=He(K,Q),Ie=He(K,le),Pe=He(J,Q),ze=He(J,le);K=Math.min(Te.x,Ie.x,Pe.x,ze.x),J=Math.max(Te.x,Ie.x,Pe.x,ze.x),Q=Math.min(Te.y,Ie.y,Pe.y,ze.y),le=Math.max(Te.y,Ie.y,Pe.y,ze.y)}var rt=Se+"Rot",ct=Le[rt]=Le[rt]||{};ct.x1=K,ct.y1=Q,ct.x2=J,ct.y2=le,ct.w=J-K,ct.h=le-Q,Ir(e,K,Q,J,le),Ir(i.labelBounds.all,K,Q,J,le)}return e}},zc=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,s=t.pstyle("outline-width").value+t.pstyle("outline-offset").value;Vc(e,t,n,s,"outside",s/2)}},Vc=function(e,t,n,a,i,s){if(!(0===n||a<=0||"inside"===i)){var l=t.cy().renderer(),u=l.nodeShapes[l.getNodeShape(t)];if(u){var c=t.position(),d=c.x,f=c.y,h=t.width(),v=t.height();if(u.hasMiterBounds){"center"===i&&(a/=2);var m=u.miterBounds(d,f,h,v,a);ln(e,m)}else null!=s&&s>0&&ei(e,[s,s,s,s])}}},Hc=function(e){var t=0,n=function(s){return(s?1:0)<<t++},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))+n(e.includeOutlines)},Uc=function(e){var t=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return Vl([t(n.x),t(n.y),t(a.x),t(a.y)])}var i=e.position();return Vl([t(i.x),t(i.y)])},Xc=function(e,t){var a,n=e._private,i=e.isEdge(),o=(null==t?jc:Hc(t))===jc;if(null==n.bbCache?(a=function(e,t){var c,d,f,h,v,m,n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=gr(),o=e._private,l=e.isNode(),u=e.isEdge(),p=o.rstyle,g=l&&a?e.pstyle("bounds-expansion").pfValue:[0],w=function(Nt){return"none"!==Nt.pstyle("display").value},C=!a||w(e)&&(!u||w(e.source())&&w(e.target()));if(C){var z=0;a&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(z=e.pstyle("overlay-padding").value);var F=0;a&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(F=e.pstyle("underlay-padding").value);var U=Math.max(z,F),Z=0;if(a&&(Z=e.pstyle("width").pfValue/2),l&&t.includeNodes){var K=e.position();v=K.x,m=K.y;var Q=e.outerWidth()/2,de=e.outerHeight()/2;Ir(s,c=v-Q,f=m-de,d=v+Q,h=m+de),a&&zc(s,e),a&&t.includeOutlines&&!i&&zc(s,e),a&&function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,a=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Vc(e,t,n,a,i)}}(s,e)}else if(u&&t.includeEdges)if(a&&!i){var he=e.pstyle("curve-style").strValue;if(c=Math.min(p.srcX,p.midX,p.tgtX),d=Math.max(p.srcX,p.midX,p.tgtX),f=Math.min(p.srcY,p.midY,p.tgtY),h=Math.max(p.srcY,p.midY,p.tgtY),Ir(s,c-=Z,f-=Z,d+=Z,h+=Z),"haystack"===he){var ue=p.haystackPts;if(ue&&2===ue.length){if((c=ue[0].x)>(d=ue[1].x)){var ge=c;c=d,d=ge}if((f=ue[0].y)>(h=ue[1].y)){var Se=f;f=h,h=Se}Ir(s,c-Z,f-Z,d+Z,h+Z)}}else if("bezier"===he||"unbundled-bezier"===he||Kr(he,"segments")||Kr(he,"taxi")){var Le;switch(he){case"bezier":case"unbundled-bezier":Le=p.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":Le=p.linePts}if(null!=Le)for(var ye=0;ye<Le.length;ye++){var De=Le[ye];Ir(s,c=De.x-Z,f=De.y-Z,d=De.x+Z,h=De.y+Z)}}}else{var $e=e.source().position(),Qe=e.target().position();if((c=$e.x)>(d=Qe.x)){var tt=c;c=d,d=tt}if((f=$e.y)>(h=Qe.y)){var at=f;f=h,h=at}Ir(s,c-=Z,f-=Z,d+=Z,h+=Z)}if(a&&t.includeEdges&&u&&(vi(s,e,"mid-source"),vi(s,e,"mid-target"),vi(s,e,"source"),vi(s,e,"target")),a&&"yes"===e.pstyle("ghost").value){var Te=e.pstyle("ghost-offset-x").pfValue,Ie=e.pstyle("ghost-offset-y").pfValue;Ir(s,s.x1+Te,s.y1+Ie,s.x2+Te,s.y2+Ie)}var Pe=o.bodyBounds=o.bodyBounds||{};eu(Pe,s),ei(Pe,g),Qa(Pe,1),a&&Ir(s,(c=s.x1)-U,(f=s.y1)-U,(d=s.x2)+U,(h=s.y2)+U);var ze=o.overlayBounds=o.overlayBounds||{};eu(ze,s),ei(ze,g),Qa(ze,1);var rt=o.labelBounds=o.labelBounds||{};null!=rt.all?function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0}(rt.all):rt.all=gr(),a&&t.includeLabels&&(t.includeMainLabels&&Bo(s,e,null),u&&(t.includeSourceLabels&&Bo(s,e,"source"),t.includeTargetLabels&&Bo(s,e,"target")))}return s.x1=Tr(s.x1),s.y1=Tr(s.y1),s.x2=Tr(s.x2),s.y2=Tr(s.y2),s.w=Tr(s.x2-s.x1),s.h=Tr(s.y2-s.y1),s.w>0&&s.h>0&&C&&(ei(s,g),Qa(s,1)),s}(e,xa),n.bbCache=a,n.bbCachePosKey=Uc(e)):a=n.bbCache,!o){var l=e.isNode();a=gr(),(t.includeNodes&&l||t.includeEdges&&!l)&&ln(a,t.includeOverlays?n.overlayBounds:n.bodyBounds),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ln(a,n.labelBounds.all):(t.includeMainLabels&&ln(a,n.labelBounds.mainRot),t.includeSourceLabels&&ln(a,n.labelBounds.sourceRot),t.includeTargetLabels&&ln(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},xa={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},jc=Hc(xa),Yc=ir(xa);on.boundingBox=function(r){var e,t=void 0===r||void 0===r.useCache||!0===r.useCache,n=Mn(function(c){var d=c._private;return null==d.bbCache||d.styleDirty||d.bbCachePosKey!==Uc(c)},function(c){return c.id()});if(t&&1===this.length&&!n(this[0]))r=void 0===r?xa:Yc(r),e=Xc(this[0],r);else{e=gr();var a=Yc(r=r||xa),i=this,o=i.cy().styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var l=0;l<i.length;l++){var u=i[l];n(u)&&u.dirtyBoundingBoxCache(),ln(e,Xc(u,a))}}return e.x1=Tr(e.x1),e.y1=Tr(e.y1),e.x2=Tr(e.x2),e.y2=Tr(e.y2),e.w=Tr(e.x2-e.x1),e.h=Tr(e.y2-e.y1),e},on.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._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},on.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),a=t.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Oe(r)){var i=r;r=function(){return i}}t.startBatch(),e.forEach(function(c,d){return c._private.bbAtOldPos=r(c,d)}).silentPositions(r),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return e.silentPositions(function(c){return c._private.bbAtOldPos}),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),l},Wn.boundingbox=Wn.bb=Wn.boundingBox,Wn.renderedBoundingbox=Wn.renderedBoundingBox;var Ea,Ta,bp=on;Ea=Ta={};var Wc=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),Ea[e.name]=function(){var n=this[0],a=n._private;if(n){if(a.cy._private.styleEnabled){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var o=n.pstyle(e.name);return"label"===o.strValue?(n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0):o.pfValue}return 1}},Ea["outer"+e.uppercaseName]=function(){var n=this[0];if(n){if(n._private.cy._private.styleEnabled){var o=n[e.name](),l=n.pstyle("border-position").value;return o+("center"===l?n.pstyle("border-width").pfValue:"outside"===l?2*n.pstyle("border-width").pfValue:0)+2*n.padding()}return 1}},Ea["rendered"+e.uppercaseName]=function(){var n=this[0];if(n)return n[e.name]()*this.cy().zoom()},Ea["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n)return n[e.outerName]()*this.cy().zoom()}};Wc({name:"width"}),Wc({name:"height"}),Ta.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),void 0!==e.autoPadding?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue},Ta.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()},Ta.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var wp=Ta,qc={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Np=Object.keys(qc).reduce(function(r,e){var t=qc[e],n=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(e);return r[e]=function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)}(this,t.get)},r[n]=t.mult?function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return t(e).map(function(s){return Za(s,i,a)})}}(this,t.get)}:function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return Za(t(e),n.zoom(),n.pan())}}(this,t.get)},r},{}),Rp=mt({},gp,bp,wp,Np),$c=function(e,t){this.recycle(e,t)};function Ca(){return!1}function gi(){return!0}$c.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ca,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?gi:Ca):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,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=gi;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=gi;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=gi,this.stopPropagation()},isDefaultPrevented:Ca,isPropagationStopped:Ca,isImmediatePropagationStopped:Ca};var Kc=/^([^.]+)(\.(?:[^.]+))?$/,Zc={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Jc=Object.keys(Zc),Op={};function pi(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Op,e=arguments.length>1?arguments[1]:void 0,t=0;t<Jc.length;t++){var n=Jc[t];this[n]=r[n]||Zc[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var un=pi.prototype,Qc=function(e,t,n,a,i,s,o){Be(a)&&(i=a,a=null),o&&(s=null==s?o:mt({},s,o));for(var l=Ye(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!Sr(c)){var d=c.match(Kc);if(d&&!1===t(e,c,d[1],d[2]?d[2]:null,a,i,s))break}}},ed=function(e,t){return e.addEventFields(e.context,t),new $c(t.type,t)};un.on=un.addListener=function(r,e,t,n,a){return Qc(this,function(i,s,o,l,u,c,d){Be(c)&&i.listeners.push({event:s,callback:c,type:o,namespace:l,qualifier:u,conf:d})},r,e,t,n,a),this},un.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})},un.removeListener=un.off=function(r,e,t,n){var a=this;0!==this.emitting&&(this.listeners=function(e){return e.slice()}(this.listeners));for(var i=this.listeners,s=function(u){var c=i[u];Qc(a,function(d,f,h,v,m,p){if((c.type===h||"*"===r)&&(!v&&".*"!==c.namespace||c.namespace===v)&&(!m||d.qualifierCompare(c.qualifier,m))&&(!p||c.callback===p))return i.splice(u,1),!1},r,e,t,n)},o=i.length-1;o>=0;o--)s(o);return this},un.removeAllListeners=function(){return this.removeListener("*")},un.emit=un.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Ye(e)||(e=[e]),function(e,t,n){if(function(e){return"event"===we(e)}(n))t(e,n);else if(Oe(n))t(e,ed(e,n));else for(var a=Ye(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!Sr(s)){var o=s.match(Kc);o&&t(e,ed(e,{type:o[1],namespace:o[2]?o[2]:null,target:e.context}))}}}(this,function(i,s){null!=t&&(a=(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}]).length);for(var o=function(){var c=n[l];if(c.type===s.type&&(!c.namespace||c.namespace===s.namespace||".*"===c.namespace)&&i.eventMatches(i.context,c,s)){var d=[s];null!=e&&function(e,t){for(var n=0;n<t.length;n++)e.push(t[n])}(d,e),i.beforeEmit(i.context,c,s),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(v){return v!==c}));var f=i.callbackContext(i.context,c,s),h=c.callback.apply(f,d);i.afterEmit(i.context,c,s),!1===h&&(s.stopPropagation(),s.preventDefault())}},l=0;l<a;l++)o();i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},r),this.emitting--,this};var kp={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return null==a||e!==n.target&&It(n.target)&&a.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},yi=function(e){return oe(e)?new nn(e):e},td={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new pi(kp,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().on(e,a,n);return this},removeListener:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,a,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().one(e,a,n);return this},once:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().on(e,a,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Ft.eventAliasesOn(td);var rd={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):t.push(a)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(oe(e)||vt(e))return new nn(e).filter(this);if(Be(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i];(t?e.apply(t,[s,i,a]):e(s,i,a))&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){oe(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var a=this[n];e.has(a)||t.push(a)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(oe(e))return this.filter(e);for(var n=this.spawn(),s=this.length<e.length,o=s?this:e,l=s?e:this,u=0;u<o.length;u++){var c=o[u];l.has(c)&&n.push(c)}return n},xor:function(e){var t=this._private.cy;oe(e)&&(e=t.$(e));var n=this.spawn(),i=e,s=function(l,u){for(var c=0;c<l.length;c++){var d=l[c];u.hasElementWithId(d._private.data.id)||n.push(d)}};return s(this,i),s(i,this),n},diff:function(e){var t=this._private.cy;oe(e)&&(e=t.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=e,l=function(c,d,f){for(var h=0;h<c.length;h++){var v=c[h];d.hasElementWithId(v._private.data.id)?i.merge(v):f.push(v)}};return l(this,o,n),l(o,this,a),{left:n,right:a,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(oe(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i];!this.has(s)&&a.push(s)}return a},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&oe(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=t.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id;if(!i.has(l)){var c=this.length++;this[c]=o,i.set(l,{ele:o,index:c})}}return this},unmergeAt:function(e){var n=this[e].id(),i=this._private.map;if(this[e]=void 0,i.delete(n),this.length>1&&e!==this.length-1){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){var i=this._private.map.get((e=e[0])._private.data.id);return i?(this.unmergeAt(i.index),this):this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&oe(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],o=t?e.apply(t,[s,i,a]):e(s,i,a);n.push(o)}return n},reduce:function(e,t){for(var n=t,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,t){for(var a,n=-1/0,i=this,s=0;s<i.length;s++){var o=i[s],l=t?e.apply(t,[o,s,i]):e(o,s,i);l>n&&(n=l,a=o)}return{value:n,ele:a}},min:function(e,t){for(var a,n=1/0,i=this,s=0;s<i.length;s++){var o=i[s],l=t?e.apply(t,[o,s,i]):e(o,s,i);l<n&&(n=l,a=o)}return{value:n,ele:a}}},kt=rd;kt.u=kt["|"]=kt["+"]=kt.union=kt.or=kt.add,kt["\\"]=kt["!"]=kt["-"]=kt.difference=kt.relativeComplement=kt.subtract=kt.not,kt.n=kt["&"]=kt["."]=kt.and=kt.intersection=kt.intersect,kt["^"]=kt["(+)"]=kt["(-)"]=kt.symmetricDifference=kt.symdiff=kt.xor,kt.fnFilter=kt.filterFn=kt.stdFilter=kt.filter,kt.complement=kt.abscomp=kt.absoluteComplement;var e,nd=function(e,t){var a=e.cy().hasCompoundNodes();function i(c){var d=c.pstyle("z-compound-depth");return"auto"===d.value?a?c.zDepth():0:"bottom"===d.value?-1:"top"===d.value?ds:0}var s=i(e)-i(t);if(0!==s)return s;function o(c){return"auto"===c.pstyle("z-index-compare").value&&c.isNode()?1:0}var l=o(e)-o(t);if(0!==l)return l;var u=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==u?u:e.poolIndex()-t.poolIndex()},mi={forEach:function(e,t){if(Be(e))for(var n=this.length,a=0;a<n;a++){var i=this[a];if(!1===(t?e.apply(t,[i,a,this]):e(i,a,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],a=this.length;null==t&&(t=a),null==e&&(e=0),e<0&&(e=a+e),t<0&&(t=a+t);for(var i=e;i>=0&&i<t&&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 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!Be(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(nd)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var a=t.data.parent?e.parents().size():0;return e.isParent()?a:ds-1}var s=t.target,o=t.source.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}};mi.each=mi.forEach,e="undefined",(typeof Symbol>"u"?"undefined":pe(Symbol))!=e&&pe(Symbol.iterator)!=e&&(mi[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return ae({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})});var Fp=ir({nodeDimensionsIncludeLabels:!1}),bi={layoutDimensions:function(e){var t;if(e=Fp(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return(0===t.w||0===t.h)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var a=this.nodes().filter(function(z){return!z.isParent()}),i=this.cy(),s=t.eles,o=function(V){return V.id()},l=Mn(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=t.spacingFactor&&1!==t.spacingFactor,f=function(){if(!c)return null;for(var V=gr(),F=0;F<a.length;F++){var W=l(a[F],F);Ql(V,W.x,W.y)}return V}(),h=Mn(function(z,V){var F=l(z,V);return c&&(F=function(V,F,U){var W_x=F.x1+F.w/2,W_y=F.y1+F.h/2;return{x:W_x+(U.x-W_x)*V,y:W_y+(U.y-W_y)*V}}(Math.abs(t.spacingFactor),f,F)),null!=t.transform&&(F=t.transform(z,F)),F},o);if(t.animate){for(var v=0;v<a.length;v++){var m=a[v],p=h(m,v);if(null==t.animateFilter||t.animateFilter(m,v)){var w=m.animation({position:p,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}else m.position(p)}if(t.fit){var C=i.animation({fit:{boundingBox:s.boundingBoxAt(h),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(C)}else if(void 0!==t.zoom&&void 0!==t.pan){var N=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(N)}e.animations.forEach(function(z){return z.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Vn.all(e.animations.map(function(z){return z.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(h),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(mt({},e,{eles:this}))}};function ad(r,e,t){var i,n=t._private,a=n.styleCache=n.styleCache||[];return null!=(i=a[r])||(i=a[r]=e(t)),i}function wi(r,e){return r=yn(r),function(n){return ad(r,e,n)}}function xi(r,e){r=yn(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return ad(r,t,a)}}bi.createLayout=bi.makeLayout=bi.layout;var sr={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),a=t.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var n,e=this.cy(),t=function(i){return i._private.styleCache=null};return e.hasCompoundNodes()?((n=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(n.connectedEdges()),n.forEach(t)):this.forEach(function(a){t(a),a.connectedEdges().forEach(t)}),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var i=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(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 t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],a=n.cy();if(a.styleEnabled()&&n)return n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n)),n._private.style[e]??(t?a.style().getDefaultProperty(e):null)},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Oe(e))i.applyBypass(this,e,a),this.emitAndNotify("style");else if(oe(e)){if(void 0===t){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,a),this.emitAndNotify("style")}else if(void 0===e){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,a=t.style(),i=this;if(void 0===e)for(var s=0;s<i.length;s++)a.removeAllBypasses(i[s],n);else{e=e.split(/\s+/);for(var l=0;l<i.length;l++)a.removeBypasses(i[l],e,n)}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!t)return i;var s=a.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++)i*=s[o].pstyle("opacity").value;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();return t?n?0===t.effectiveOpacity():0===t.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function _o(r,e){var n=r._private.data.parent?r.parents():null;if(n)for(var a=0;a<n.length;a++)if(!e(n[a]))return!1;return!0}function Fo(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,n=r.parentOk||r.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||_o(i,n);var l=o.source,u=o.target;return t(l)&&(!s||_o(l,t))&&(l===u||t(u)&&(!s||_o(u,t)))}}}var qn=wi("eleTakesUpSpace",function(r){return"element"===r.pstyle("display").value&&0!==r.width()&&(!r.isNode()||0!==r.height())});sr.takesUpSpace=xi("takesUpSpace",Fo({ok:qn}));var Gp=wi("eleInteractive",function(r){return"yes"===r.pstyle("events").value&&"visible"===r.pstyle("visibility").value&&qn(r)}),zp=wi("parentInteractive",function(r){return"visible"===r.pstyle("visibility").value&&qn(r)});sr.interactive=xi("interactive",Fo({ok:Gp,parentOk:zp,edgeOkViaNode:qn})),sr.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var Vp=wi("eleVisible",function(r){return"visible"===r.pstyle("visibility").value&&0!==r.pstyle("opacity").pfValue&&qn(r)});sr.visible=xi("visible",Fo({ok:Vp,edgeOkViaNode:qn})),sr.hidden=function(){var r=this[0];if(r)return!r.visible()},sr.isBundledBezier=xi("isBundledBezier",function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()}),sr.bypass=sr.css=sr.style,sr.renderedCss=sr.renderedStyle,sr.removeBypass=sr.removeCss=sr.removeStyle,sr.pstyle=sr.parsedStyle;var cn={};function id(r){return function(){var e=arguments,t=[];if(2===e.length)this.on(r.event,e[0],e[1]);else if(1===e.length&&Be(e[0]))this.on(r.event,e[0]);else if(0===e.length||1===e.length&&Ye(e[0])){for(var s=1===e.length?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!r.ableField||l._private[r.ableField],c=l._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(l);if(void 0!==d&&(u=d,!d))return this}u&&(l._private[r.field]=r.value,c&&t.push(l))}var f=this.spawn(t);f.updateStyle(),f.emit(r.event),s&&f.emit(s)}return this}}function $n(r){cn[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(void 0!==t)return t}return e._private[r.field]}},cn[r.on]=id({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),cn[r.off]=id({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}$n({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),$n({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),$n({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),$n({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),cn.deselect=cn.unselect,cn.grabbed=function(){var r=this[0];if(r)return r._private.grabbed},$n({field:"active",on:"activate",off:"unactivate"}),$n({field:"pannable",on:"panify",off:"unpanify"}),cn.inactive=function(){var r=this[0];if(r)return!r._private.active};var cr={},sd=function(e){return function(n){for(var i=[],s=0;s<this.length;s++){var o=this[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),c=0;c<u.length;c++){var d=u[c],f=d.source(),h=d.target();if(e.noIncomingEdges&&h===o&&f!==o||e.noOutgoingEdges&&f===o&&h!==o){l=!0;break}}l||i.push(o)}}return this.spawn(i,!0).filter(n)}},od=function(e){return function(t){for(var a=[],i=0;i<this.length;i++){var s=this[i];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],c=u.source(),d=u.target();e.outgoing&&c===s?(a.push(u),a.push(d)):e.incoming&&d===s&&(a.push(u),a.push(c))}}return this.spawn(a,!0).filter(t)}},ld=function(e){return function(t){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(0===s.length)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],c=u.id();i[c]||(i[c]=!0,a.push(u),o=!0)}if(!o)break;n=s}return this.spawn(a,!0).filter(t)}};function ud(r){return function(t){for(var n=[],a=0;a<this.length;a++){var s=this[a]._private[r.attr];s&&n.push(s)}return this.spawn(n,!0).filter(t)}}function cd(r){return function(t){var n=[],a=this._private.cy,i=r||{};oe(t)&&(t=a.$(t));for(var s=0;s<t.length;s++)for(var o=t[s]._private.edges,l=0;l<o.length;l++){var u=o[l],c=u._private.data,d=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),f=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target);(d||f)&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}function dd(r){return r=mt({},{codirected:!1},r),function(n){for(var a=[],i=this.edges(),s=r,o=0;o<i.length;o++)for(var u=i[o]._private,c=u.source,d=c._private.data.id,f=u.data.target,h=c._private.edges,v=0;v<h.length;v++){var m=h[v],p=m._private.data,g=p.target,w=p.source,C=g===f&&w===d;(s.codirected&&C||!s.codirected&&(C||d===g&&f===w))&&a.push(m)}return this.spawn(a,!0).filter(n)}}cr.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null},mt(cr,{roots:sd({noIncomingEdges:!0}),leaves:sd({noOutgoingEdges:!0}),outgoers:Er(od({outgoing:!0}),"outgoers"),successors:ld({outgoing:!0}),incomers:Er(od({incoming:!0}),"incomers"),predecessors:ld({})}),mt(cr,{neighborhood:Er(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var a=t[n],i=a.connectedEdges(),s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),c=a===l?u:l;c.length>0&&e.push(c[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),cr.neighbourhood=cr.neighborhood,cr.closedNeighbourhood=cr.closedNeighborhood,cr.openNeighbourhood=cr.openNeighborhood,mt(cr,{source:Er(function(e){var n,t=this[0];return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:Er(function(e){var n,t=this[0];return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:ud({attr:"source"}),targets:ud({attr:"target"})}),mt(cr,{edgesWith:Er(cd(),"edgesWith"),edgesTo:Er(cd({thisIsSrc:!0}),"edgesTo")}),mt(cr,{connectedEdges:Er(function(r){for(var e=[],n=0;n<this.length;n++){var a=this[n];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++)e.push(i[s])}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:Er(function(r){for(var e=[],n=0;n<this.length;n++){var a=this[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:Er(dd(),"parallelEdges"),codirectedEdges:Er(dd({codirected:!0}),"codirectedEdges")}),mt(cr,{components:function(e){var t=this,n=t.cy(),a=n.collection(),i=null==e?t.nodes():e.nodes(),s=[];null!=e&&i.empty()&&(i=e.sources());var o=function(c,d){a.merge(c),i.unmerge(c),d.merge(c)};if(i.empty())return t.spawn();var l=function(){var c=n.collection();s.push(c);var d=i[0];o(d,c),t.bfs({directed:!1,roots:d,visit:function(h){return o(h,c)}}),c.forEach(function(f){f.connectedEdges().forEach(function(h){t.has(h)&&c.has(h.source())&&c.has(h.target())&&c.merge(h)})})};do{l()}while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),cr.componentsOf=cr.components;var or=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new Xr,s=!1;if(t){if(t.length>0&&Oe(t[0])&&!It(t[0])){s=!0;for(var o=[],l=new Pn,u=0,c=t.length;u<c;u++){var d=t[u];null==d.data&&(d.data={});var f=d.data;if(null==f.id)f.id=Wl();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var h=new $a(e,d,!1);o.push(h),l.add(f.id)}t=o}}else t=[];this.length=0;for(var v=0,m=t.length;v<m;v++){var p=t[v][0];if(null!=p){var g=p._private.data.id;(!n||!i.has(g))&&(n&&i.set(g,{index:this.length,ele:p}),this[this.length]=p,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:function(){for(var C=this.lazyMap=new Xr,N=this.eles,z=0;z<N.length;z++){var V=N[z];C.set(V.id(),{index:z,ele:V})}}},n&&(this._private.map=i),s&&!a&&this.restore()}else Xt("A collection must have a reference to the core")},Vt=$a.prototype=or.prototype=Object.create(Array.prototype);Vt.instanceString=function(){return"collection"},Vt.spawn=function(r,e){return new or(this.cy(),r,e)},Vt.spawnSelf=function(){return this.spawn(this)},Vt.cy=function(){return this._private.cy},Vt.renderer=function(){return this._private.cy.renderer()},Vt.element=function(){return this[0]},Vt.collection=function(){return $t(this)?this:new or(this._private.cy,[this])},Vt.unique=function(){return new or(this._private.cy,this,!0)},Vt.hasElementWithId=function(r){return this._private.map.has(r=""+r)},Vt.getElementById=function(r){var e=this._private.cy,t=this._private.map.get(r=""+r);return t?t.ele:new or(e)},Vt.$id=Vt.getElementById,Vt.poolIndex=function(){return this._private.cy._private.elements._private.map.get(this[0]._private.data.id).index},Vt.indexOf=function(r){return this._private.map.get(r[0]._private.data.id).index},Vt.indexOfId=function(r){return this._private.map.get(r=""+r).index},Vt.json=function(r){var e=this.element(),t=this.cy();if(null==e&&r)return this;if(null!=e){var n=e._private;if(Oe(r)){if(t.startBatch(),r.data){e.data(r.data);var a=n.data;if(e.isEdge()){var i=!1,s={},o=r.data.source,l=r.data.target;null!=o&&o!=a.source&&(s.source=""+o,i=!0),null!=l&&l!=a.target&&(s.target=""+l,i=!0),i&&(e=e.move(s))}else{var c=r.data.parent;"parent"in r.data&&(null!=c||null!=a.parent)&&c!=a.parent&&(void 0===c&&(c=null),null!=c&&(c=""+c),e=e.move({parent:c}))}}r.position&&e.position(r.position);var d=function(m,p,g){var w=r[m];null!=w&&w!==n[m]&&(w?e[p]():e[g]())};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"),null!=r.classes&&e.classes(r.classes),t.endBatch(),this}if(void 0===r){var f={data:Pr(n.data),position:Pr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:""},h=0;return n.classes.forEach(function(v){return f.classes+=0===h++?v:" "+v}),f}}},Vt.jsons=function(){for(var r=[],e=0;e<this.length;e++){var n=this[e].json();r.push(n)}return r},Vt.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var a=this[t].json(),i=new $a(r,a,!1);e.push(i)}return new or(r,e)},Vt.copy=Vt.clone,Vt.restore=function(){for(var o,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=this,n=t.cy(),a=n._private,i=[],s=[],l=0,u=t.length;l<u;l++){var c=t[l];e&&!c.removed()||(c.isNode()?i.push(c):s.push(c))}o=i.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var h=o[d],v=h._private,m=v.data;if(h.clearTraversalCache(),e||v.removed)if(void 0===m.id)m.id=Wl();else if(_e(m.id))m.id=""+m.id;else{if(Sr(m.id)||!oe(m.id)){Xt("Can not create element with invalid string ID `"+m.id+"`"),f();continue}if(n.hasElementWithId(m.id)){Xt("Can not create second element with ID `"+m.id+"`"),f();continue}}var p=m.id;if(h.isNode()){var g=v.position;null==g.x&&(g.x=0),null==g.y&&(g.y=0)}if(h.isEdge()){for(var w=h,C=["source","target"],N=C.length,z=!1,V=0;V<N;V++){var F=C[V],U=m[F];_e(U)&&(U=m[F]=""+m[F]),null==U||""===U?(Xt("Can not create edge `"+p+"` with unspecified "+F),z=!0):n.hasElementWithId(U)||(Xt("Can not create edge `"+p+"` with nonexistent "+F+" `"+U+"`"),z=!0)}if(z){f();continue}var W=n.getElementById(m.source),Z=n.getElementById(m.target);W.same(Z)?W._private.edges.push(w):(W._private.edges.push(w),Z._private.edges.push(w)),w._private.source=W,w._private.target=Z}v.map=new Xr,v.map.set(p,{ele:h,index:0}),v.removed=!1,e&&n.addToPool(h)}for(var K=0;K<i.length;K++){var J=i[K],Q=J._private.data;_e(Q.parent)&&(Q.parent=""+Q.parent);var le=Q.parent;if(null!=le||J._private.parent){var he=J._private.parent?n.collection().merge(J._private.parent):n.getElementById(le);if(he.empty())Q.parent=void 0;else if(he[0].removed())_t("Node added with missing parent, reference to parent removed"),Q.parent=void 0,J._private.parent=null;else{for(var ue=!1,ge=he;!ge.empty();){if(J.same(ge)){ue=!0,Q.parent=void 0;break}ge=ge.parent()}ue||(he[0]._private.children.push(J),J._private.parent=he[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Se=o.length===t.length?t:new or(n,o),Le=0;Le<Se.length;Le++){var ye=Se[Le];ye.isNode()||(ye.parallelEdges().clearTraversalCache(),ye.source().clearTraversalCache(),ye.target().clearTraversalCache())}(a.hasCompoundNodes?n.collection().merge(Se).merge(Se.connectedNodes()).merge(Se.parent()):Se).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?Se.emitAndNotify("add"):e&&Se.emit("add")}return t},Vt.removed=function(){var r=this[0];return r&&r._private.removed},Vt.inside=function(){var r=this[0];return r&&!r._private.removed},Vt.remove=function(){var r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=this,n=[],a={},i=t._private.cy;function l(le){var de=a[le.id()];e&&le.removed()||de||(a[le.id()]=!0,le.isNode()?(n.push(le),function s(le){for(var de=le._private.edges,he=0;he<de.length;he++)l(de[he])}(le),function o(le){for(var de=le._private.children,he=0;he<de.length;he++)l(de[he])}(le)):n.unshift(le))}for(var u=0,c=t.length;u<c;u++)l(t[u]);function f(le,de){Jr(le._private.edges,de),le.clearTraversalCache()}function h(le){le.clearTraversalCache()}var v=[];function m(le,de){de=de[0];var he=(le=le[0])._private.children,ue=le.id();Jr(he,de),de._private.parent=null,v.ids[ue]||(v.ids[ue]=!0,v.push(le))}v.ids={},t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var p=0;p<n.length;p++){var g=n[p];if(g.isEdge()){var w=g.source()[0],C=g.target()[0];f(w,g),f(C,g);for(var N=g.parallelEdges(),z=0;z<N.length;z++){var V=N[z];h(V),V.isBundledBezier()&&V.dirtyBoundingBoxCache()}}else{var F=g.parent();0!==F.length&&m(F,g)}e&&(g._private.removed=!0)}var U=i._private.elements;i._private.hasCompoundNodes=!1;for(var W=0;W<U.length;W++)if(U[W].isParent()){i._private.hasCompoundNodes=!0;break}var K=new or(this.cy(),n);K.size()>0&&(r?K.emitAndNotify("remove"):e&&K.emit("remove"));for(var J=0;J<v.length;J++){var Q=v[J];(!e||!Q.removed())&&Q.updateStyle()}return K},Vt.move=function(r){var e=this._private.cy,t=this,n=!1,a=!1,i=function(v){return null==v?v:""+v};if(void 0!==r.source||void 0!==r.target){var s=i(r.source),o=i(r.target),l=null!=s&&e.hasElementWithId(s),u=null!=o&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){t.remove(n,a),t.emitAndNotify("moveout");for(var h=0;h<t.length;h++){var v=t[h],m=v._private.data;v.isEdge()&&(l&&(m.source=s),u&&(m.target=o))}t.restore(n,a)}),t.emitAndNotify("move"))}else if(void 0!==r.parent){var c=i(r.parent);if(null===c||e.hasElementWithId(c)){var f=null===c?void 0:c;e.batch(function(){var h=t.remove(n,a);h.emitAndNotify("moveout");for(var v=0;v<t.length;v++){var m=t[v],p=m._private.data;m.isNode()&&(p.parent=f)}h.restore(n,a)}),t.emitAndNotify("move")}}return this},[Eu,Jg,fi,sn,Un,vp,hi,Rp,td,rd,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},mi,bi,sr,cn,cr].forEach(function(r){mt(Vt,r)});var Up={add:function(e){var t,n=this;if(vt(e)){var a=e;if(a._private.cy===n)t=a.restore();else{for(var i=[],s=0;s<a.length;s++)i.push(a[s].json());t=new or(n,i)}}else if(Ye(e))t=new or(n,e);else if(Oe(e)&&(Ye(e.nodes)||Ye(e.edges))){for(var u=e,c=[],d=["nodes","edges"],f=0,h=d.length;f<h;f++){var v=d[f],m=u[v];if(Ye(m))for(var p=0,g=m.length;p<g;p++){var w=mt({group:v},m[p]);c.push(w)}}t=new or(n,c)}else t=new $a(n,e).collection();return t},remove:function(e){return vt(e)||oe(e)&&(e=this.$(e)),e.remove()}};function Xp(r,e,t,n){var u=.1,c=typeof Float32Array<"u";if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var f=c?new Float32Array(11):new Array(11);function h(Z,K){return 1-3*K+3*Z}function v(Z,K){return 3*K-6*Z}function m(Z){return 3*Z}function p(Z,K,J){return((h(K,J)*Z+v(K,J))*Z+m(K))*Z}function g(Z,K,J){return 3*h(K,J)*Z*Z+2*v(K,J)*Z+m(K)}var V=!1;var U=function(K){return V||function F(){V=!0,(r!==e||t!==n)&&function C(){for(var Z=0;Z<11;++Z)f[Z]=p(Z*u,r,t)}()}(),r===e&&t===n?K:0===K?0:1===K?1:p(function z(Z){for(var K=0,J=1;10!==J&&f[J]<=Z;++J)K+=u;--J;var de=K+(Z-f[J])/(f[J+1]-f[J])*u,he=g(de,r,t);return he>=.001?function w(Z,K){for(var J=0;J<4;++J){var Q=g(K,r,t);if(0===Q)return K;K-=(p(K,r,t)-Z)/Q}return K}(Z,de):0===he?de:function N(Z,K,J){var Q,le,de=0;do{(Q=p(le=K+(J-K)/2,r,t)-Z)>0?J=le:K=le}while(Math.abs(Q)>1e-7&&++de<10);return le}(Z,K,K+u)}(K),e,n)};U.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var W="generateBezier("+[r,e,t,n]+")";return U.toString=function(){return W},U}var jp=function(){function r(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:r(s)}}function t(n,a){var i={dx:n.v,dv:r(n)},s=e(n,.5*a,i),o=e(n,.5*a,s),l=e(n,a,o),c=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+1/6*(i.dx+2*(s.dx+o.dx)+l.dx)*a,n.v=n.v+c*a,n}return function n(a,i,s){var f,h,v,o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1e-4;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,o.tension=a,o.friction=i,h=(f=null!==s)?(u=n(a,i))/s*.016:.016;v=t(v||o,h),l.push(1+v.x),u+=16,Math.abs(v.x)>c&&Math.abs(v.v)>c;);return f?function(m){return l[m*(l.length-1)|0]}:u}}(),Ht=function(e,t,n,a){var i=Xp(e,t,n,a);return function(s,o,l){return s+(o-s)*i(l)}},Ei={linear:function(e,t,n){return e+(t-e)*n},ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-out":Ht(0,0,.58,1),"ease-in-out":Ht(.42,0,.58,1),"ease-in-sine":Ht(.47,0,.745,.715),"ease-out-sine":Ht(.39,.575,.565,1),"ease-in-out-sine":Ht(.445,.05,.55,.95),"ease-in-quad":Ht(.55,.085,.68,.53),"ease-out-quad":Ht(.25,.46,.45,.94),"ease-in-out-quad":Ht(.455,.03,.515,.955),"ease-in-cubic":Ht(.55,.055,.675,.19),"ease-out-cubic":Ht(.215,.61,.355,1),"ease-in-out-cubic":Ht(.645,.045,.355,1),"ease-in-quart":Ht(.895,.03,.685,.22),"ease-out-quart":Ht(.165,.84,.44,1),"ease-in-out-quart":Ht(.77,0,.175,1),"ease-in-quint":Ht(.755,.05,.855,.06),"ease-out-quint":Ht(.23,1,.32,1),"ease-in-out-quint":Ht(.86,0,.07,1),"ease-in-expo":Ht(.95,.05,.795,.035),"ease-out-expo":Ht(.19,1,.22,1),"ease-in-out-expo":Ht(1,0,0,1),"ease-in-circ":Ht(.6,.04,.98,.335),"ease-out-circ":Ht(.075,.82,.165,1),"ease-in-out-circ":Ht(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ei.linear;var a=jp(e,t,n);return function(i,s,o){return i+(s-i)*a(o)}},"cubic-bezier":Ht};function fd(r,e,t,n,a){if(1===n||e===t)return t;var i=a(e,t,n);return null==r||((r.roundValue||r.color)&&(i=Math.round(i)),void 0!==r.min&&(i=Math.max(i,r.min)),void 0!==r.max&&(i=Math.min(i,r.max))),i}function hd(r,e){return null!=r.pfValue||null!=r.value?null==r.pfValue||null!=e&&"%"===e.type.units?r.value:r.pfValue:r}function Kn(r,e,t,n,a){var i=null!=a?a.type:null;t<0?t=0:t>1&&(t=1);var s=hd(r,a),o=hd(e,a);if(_e(s)&&_e(o))return fd(i,s,o,t,n);if(Ye(s)&&Ye(o)){for(var l=[],u=0;u<o.length;u++){var c=s[u],d=o[u];if(null!=c&&null!=d){var f=fd(i,c,d,t,n);l.push(f)}else l.push(d)}return l}}function Yp(r,e,t,n){var a=!n,i=r._private,s=e._private,o=s.easing,l=s.startTime,c=(n?r:r.cy()).style();if(!s.easingImpl)if(null==o)s.easingImpl=Ei.linear;else{var d,h,v;d=oe(o)?c.parse("transition-timing-function",o).value:o,oe(d)?(h=d,v=[]):(h=d[1],v=d.slice(2).map(function(Se){return+Se})),v.length>0?("spring"===h&&v.push(s.duration),s.easingImpl=Ei[h].apply(null,v)):s.easingImpl=Ei[h]}var p,m=s.easingImpl;if(p=0===s.duration?1:(t-l)/s.duration,s.applying&&(p=s.progress),p<0?p=0:p>1&&(p=1),null==s.delay){var g=s.startPosition,w=s.position;if(w&&a&&!r.locked()){var C={};Da(g.x,w.x)&&(C.x=Kn(g.x,w.x,p,m)),Da(g.y,w.y)&&(C.y=Kn(g.y,w.y,p,m)),r.position(C)}var N=s.startPan,z=s.pan,V=i.pan,F=null!=z&&n;F&&(Da(N.x,z.x)&&(V.x=Kn(N.x,z.x,p,m)),Da(N.y,z.y)&&(V.y=Kn(N.y,z.y,p,m)),r.emit("pan"));var U=s.startZoom,W=s.zoom,Z=null!=W&&n;Z&&(Da(U,W)&&(i.zoom=ga(i.minZoom,Kn(U,W,p,m),i.maxZoom)),r.emit("zoom")),(F||Z)&&r.emit("viewport");var K=s.style;if(K&&K.length>0&&a){for(var J=0;J<K.length;J++){var Q=K[J],le=Q.name,he=s.startStyle[le],ge=Kn(he,Q,p,m,c.properties[he.name]);c.overrideBypass(r,le,ge)}r.emit("style")}}return s.progress=p,p}function Da(r,e){return!!(null!=r&&null!=e&&(_e(r)&&_e(e)||r&&e))}function Wp(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function vd(r,e){var t=e._private.aniEles,n=[];function a(c,d){var f=c._private,h=f.animation.current,v=f.animation.queue,m=!1;if(0===h.length){var p=v.shift();p&&h.push(p)}for(var g=function(V){for(var F=V.length-1;F>=0;F--)(0,V[F])();V.splice(0,V.length)},w=h.length-1;w>=0;w--){var C=h[w],N=C._private;N.stopped?(h.splice(w,1),N.hooked=!1,N.playing=!1,N.started=!1,g(N.frames)):!N.playing&&!N.applying||(N.playing&&N.applying&&(N.applying=!1),N.started||Wp(0,C,r),Yp(c,C,r,d),N.applying&&(N.applying=!1),g(N.frames),null!=N.step&&N.step(r),C.completed()&&(h.splice(w,1),N.hooked=!1,N.playing=!1,N.started=!1,g(N.completes)),m=!0)}return!d&&0===h.length&&0===v.length&&n.push(c),m}for(var i=!1,s=0;s<t.length;s++){var l=a(t[s]);i=i||l}var u=a(e,!0);(i||u)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var qp={animate:Ft.animate(),animation:Ft.animation(),animated:Ft.animated(),clearQueue:Ft.clearQueue(),delay:Ft.delay(),delayAnimation:Ft.delayAnimation(),stop:Ft.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){vd(s,e)},n.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ya(function(i){vd(i,e),t()})}()}}},$p={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return null==a||e!==n.target&&It(n.target)&&a.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Ti=function(e){return oe(e)?new nn(e):e},gd={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new pi($p,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Ti(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Ti(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Ti(t),n),this},once:function(e,t,n){return this.emitter().one(e,Ti(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Ft.eventAliasesOn(gd);var Go={png:function(e){return this._private.renderer.png(e=e||{})},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Go.jpeg=Go.jpg;var Ci={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var i,n=e.name,a=t.extension("layout",n);if(null!=a)return i=oe(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new a(mt({},e,{cy:t,eles:i}));Xt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Xt("A `name` must be specified to make a layout");else Xt("Layout options must be specified to make a layout")}};Ci.createLayout=Ci.makeLayout=Ci.layout;var Kp={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&a.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?t.notify(n):t.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i];t.getElementById(i).data(s)}})}},Zp=ir({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:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),zo={renderTo:function(e,t,n,a){return this._private.renderer.renderTo(e,t,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 t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&_t("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=Zp(e);a.cy=t,t._private.renderer=new n(a),this.notify("init")}else Xt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var 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)}};zo.invalidateDimensions=zo.resize;var Di={collection:function(e,t){return oe(e)?this.$(e):vt(e)?e.collection():Ye(e)?(t||(t={}),new or(this,e,t.unique,t.removed)):new or(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Di.elements=Di.filter=Di.$;var rr={apply:function(r){for(var e=this,a=e._private.cy.collection(),i=0;i<r.length;i++){var s=r[i],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0,e.updateStyleHints(s)&&a.push(s)}}return a},getPropertiesDiff:function(r,e){var t=this,n=t._private.propDiffs=t._private.propDiffs||{},a=r+"-"+e,i=n[a];if(i)return i;for(var s=[],o={},l=0;l<t.length;l++){var u=t[l],d="t"===e[l],f="t"===r[l]!==d,h=u.mappedProperties.length>0;if(f||d&&h){var v=void 0;f&&h||f?v=u.properties:h&&(v=u.mappedProperties);for(var m=0;m<v.length;m++){for(var p=v[m],g=p.name,w=!1,C=l+1;C<t.length&&("t"!==e[C]||!(w=null!=t[C].properties[p.name]));C++);!o[g]&&!w&&(o[g]=!0,s.push(g))}}}return n[a]=s,s},getContextMeta:function(r){for(var n,e=this,t="",a=r._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i];t+=s.selector&&s.selector.matches(r)?"t":"f"}return n=e.getPropertiesDiff(a,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:0===n.length}},getContextStyle:function(r){var e=r.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<this.length;i++){var s=this[i];if("t"===e[i])for(var l=0;l<s.properties.length;l++){var u=s.properties[l];a[u.name]=u}}return n[e]=a,a},applyContextStyle:function(r,e,t){for(var a=r.diffPropNames,i={},s=this.types,o=0;o<a.length;o++){var l=a[o],u=e[l],c=t.pstyle(l);if(!u){if(!c)continue;u=c.bypass?{name:l,deleteBypassed:!0}:{name:l,delete:!0}}if(c!==u){if(u.mapped===s.fn&&null!=c&&null!=c.mapping&&c.mapping.value===u.value){var d=c.mapping;if((d.fnValue=u.value(t))===d.prevFnValue)continue}var h=i[l]={prev:c};this.applyParsedProperty(t,u),h.next=t.pstyle(l),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}},updateStyleHints:function(r){var n,e=r._private,t=this,a=t.propertyGroupKeys,i=function(Pe,ze,rt){return t.getPropertiesHash(Pe,ze,rt)},s=e.styleKey;if(r.removed())return!1;var o="nodes"===e.group,l=r._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++)e.styleKeys[a[u]]=[pn,On];for(var d=function(Pe,ze){return e.styleKeys[ze][0]=da(Pe,e.styleKeys[ze][0])},f=function(Pe,ze){return e.styleKeys[ze][1]=fa(Pe,e.styleKeys[ze][1])},h=function(Pe,ze){d(Pe,ze),f(Pe,ze)},v=function(Pe,ze){for(var rt=0;rt<Pe.length;rt++){var ct=Pe.charCodeAt(rt);d(ct,ze),f(ct,ze)}},p=function(Pe){return-128<Pe&&Pe<128&&Math.floor(Pe)!==Pe?2e9-(1024*Pe|0):Pe},g=0;g<n.length;g++){var w=n[g],C=l[w];if(null!=C){var N=this.properties[w],z=N.type,V=N.groupKey,F=void 0;null!=N.hashOverride?F=N.hashOverride(r,C):null!=C.pfValue&&(F=C.pfValue);var U=null==N.enums?C.value:null,W=null!=F,J=C.units;!z.number||!W&&null==U||z.multiple?v(C.strValue,V):(h(p(W?F:U),V),!W&&null!=J&&v(J,V))}}for(var le=[pn,On],de=0;de<a.length;de++){var ue=e.styleKeys[a[de]];le[0]=da(ue[0],le[0]),le[1]=fa(ue[1],le[1])}e.styleKey=function(e,t){return 2097152*e+t}(le[0],le[1]);var ge=e.styleKeys;e.labelDimsKey=Zr(ge.labelDimensions);var Se=i(r,["label"],ge.labelDimensions);if(e.labelKey=Zr(Se),e.labelStyleKey=Zr(Wa(ge.commonLabel,Se)),!o){var Le=i(r,["source-label"],ge.labelDimensions);e.sourceLabelKey=Zr(Le),e.sourceLabelStyleKey=Zr(Wa(ge.commonLabel,Le));var ye=i(r,["target-label"],ge.labelDimensions);e.targetLabelKey=Zr(ye),e.targetLabelStyleKey=Zr(Wa(ge.commonLabel,ye))}if(o){var De=e.styleKeys,at=De.pie,He=De.stripe,Te=[De.nodeBody,De.nodeBorder,De.nodeOutline,De.backgroundImage,De.compound,at,He].filter(function(Ie){return null!=Ie}).reduce(Wa,[pn,On]);e.nodeKey=Zr(Te),e.hasPie=null!=at&&at[0]!==pn&&at[1]!==On,e.hasStripe=null!=He&&He[0]!==pn&&He[1]!==On}return s!==e.styleKey},clearStyleHints:function(r){var e=r._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,e.hasStripe=null},applyParsedProperty:function(r,e){var i,t=this,n=e,a=r._private.style,s=t.types,o=t.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=r._private,f="mapping",h=function(Ue){return null==Ue?null:null!=Ue.pfValue?Ue.pfValue:Ue.value},v=function(){var Ue=h(u),$e=h(n);t.checkTriggers(r,n.name,Ue,$e)};if("curve-style"===e.name&&r.isEdge()&&("bezier"!==e.value&&r.isLoop()||"haystack"===e.value&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,v(),!0;if(n.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,v(),!0):(v(),!0);if(n.deleteBypass)return u?!!u.bypass&&(a[n.name]=u.bypassed,v(),!0):(v(),!0);var m=function(){_t("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.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 p=n.field.split("."),g=d.data,w=0;w<p.length&&g;w++)g=g[p[w]];if(null==g)return m(),!1;var N;if(!_e(g))return _t("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+g+"` for `"+r.id()+"` is non-numeric)"),!1;var z=n.fieldMax-n.fieldMin;if((N=0===z?0:(g-n.fieldMin)/z)<0?N=0:N>1&&(N=1),o.color){var V=n.valueMin[0],U=n.valueMin[1],W=n.valueMax[1],Z=n.valueMin[2],K=n.valueMax[2],J=null==n.valueMin[3]?1:n.valueMin[3],Q=null==n.valueMax[3]?1:n.valueMax[3],le=[Math.round(V+(n.valueMax[0]-V)*N),Math.round(U+(W-U)*N),Math.round(Z+(K-Z)*N),Math.round(J+(Q-J)*N)];i={bypass:n.bypass,name:n.name,value:le,strValue:"rgb("+le[0]+", "+le[1]+", "+le[2]+")"}}else{if(!o.number)return!1;i=this.parse(n.name,n.valueMin+(n.valueMax-n.valueMin)*N,n.bypass,f)}if(!i)return m(),!1;i.mapping=n,n=i;break;case s.data:for(var he=n.field.split("."),ue=d.data,ge=0;ge<he.length&&ue;ge++)ue=ue[he[ge]];if(null!=ue&&(i=this.parse(n.name,ue,n.bypass,f)),!i)return m(),!1;i.mapping=n,n=i;break;case s.fn:var ye=null!=n.fnValue?n.fnValue:(0,n.value)(r);if(n.prevFnValue=ye,null==ye)return _t("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(!(i=this.parse(n.name,ye,n.bypass,f)))return _t("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=Pr(n),n=i;break;case void 0:break;default:return!1}return l?(n.bypassed=c?u.bypassed:u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,v(),!0},cleanElements:function(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),e)for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],l=a[o];null!=l&&(l.bypass?l.bypassed=null:a[o]=null)}else n._private.style={}}},update:function(){this._private.cy.mutableElements().updateStyle()},updateTransitions:function(r,e){var t=this,n=r._private,a=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,s=r.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},l=!1,u=0;u<a.length;u++){var c=a[u],d=r.pstyle(c),f=e[c];if(f){var v=f.prev,m=null!=f.next?f.next:d,p=!1,g=void 0,w=1e-6;v&&(_e(v.pfValue)&&_e(m.pfValue)?g=v.pfValue+w*(p=m.pfValue-v.pfValue):_e(v.value)&&_e(m.value)?g=v.value+w*(p=m.value-v.value):Ye(v.value)&&Ye(m.value)&&(p=v.value[0]!==m.value[0]||v.value[1]!==m.value[1]||v.value[2]!==m.value[2],g=v.strValue),p&&(o[c]=m.strValue,this.applyBypass(r,c,g),l=!0))}}if(!l)return;n.transitioning=!0,new Vn(function(C){s>0?r.delayAnimation(s).play().promise().then(C):C()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1)},checkTrigger:function(r,e,t,n,a,i){var s=this.properties[e],o=a(s);r.removed()||null!=o&&o(t,n,r)&&i(s)},checkZOrderTrigger:function(r,e,t,n){var a=this;this.checkTrigger(r,e,t,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",r)})},checkBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBounds},function(a){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})},checkConnectedEdgesBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},checkParallelEdgesBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},checkTriggers:function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)}},La={applyBypass:function(r,e,t,n){var i=[];if("*"===e||"**"===e){if(void 0!==t)for(var o=0;o<this.properties.length;o++){var c=this.parse(this.properties[o].name,t,!0);c&&i.push(c)}}else if(oe(e)){var d=this.parse(e,t,!0);d&&i.push(d)}else{if(!Oe(e))return!1;var f=e;n=t;for(var h=Object.keys(f),v=0;v<h.length;v++){var m=h[v],p=f[m];if(void 0===p&&(p=f[Ua(m)]),void 0!==p){var g=this.parse(m,p,!0);g&&i.push(g)}}}if(0===i.length)return!1;for(var w=!1,C=0;C<r.length;C++){for(var N=r[C],z={},V=void 0,F=0;F<i.length;F++){var U=i[F];if(n){var W=N.pstyle(U.name);V=z[U.name]={prev:W}}w=this.applyParsedProperty(N,Pr(U))||w,n&&(V.next=N.pstyle(U.name))}w&&this.updateStyleHints(N),n&&this.updateTransitions(N,z,!0)}return w},overrideBypass:function(r,e,t){e=qi(e);for(var n=0;n<r.length;n++){var a=r[n],i=a._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=i?null!=i.pfValue?i.pfValue:i.value:null;i&&i.bypass?(i.value=t,null!=i.pfValue&&(i.pfValue=t),i.strValue=o?"rgb("+t.join(",")+")":l?t.join(" "):""+t,this.updateStyleHints(a)):this.applyBypass(a,e,t),this.checkTriggers(a,e,u,t)}},removeAllBypasses:function(r,e){return this.removeBypasses(r,this.propertyNames,e)},removeBypasses:function(r,e,t){for(var a=0;a<r.length;a++){for(var i=r[a],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],c=i.pstyle(u.name);if(c&&c.bypass){var f=this.parse(l,"",!0),h=s[u.name]={prev:c};this.applyParsedProperty(i,f),h.next=i.pstyle(u.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,s,!0)}}},Vo={getEmSizeInPixels:function(){var r=this.containerCss("font-size");return null!=r?parseFloat(r):1},containerCss:function(r){var e=this._private.cy,t=e.container(),n=e.window();if(n&&t&&n.getComputedStyle)return n.getComputedStyle(t).getPropertyValue(r)}},Br={getRenderedStyle:function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)},getRawStyle:function(r,e){var t=this;if(r=r[0]){for(var n={},a=0;a<t.properties.length;a++){var i=t.properties[a],s=t.getStylePropertyValue(r,i.name,e);null!=s&&(n[i.name]=s,n[Ua(i.name)]=s)}return n}},getIndexedStyle:function(r,e,t,n){return r.pstyle(e)[t][n]??r.cy().style().getDefaultProperty(e)[t][0]},getStylePropertyValue:function(r,e,t){if(r=r[0]){var a=this.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=r.pstyle(a.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(t&&i.number&&null!=o&&_e(o)){var c=r.cy().zoom(),d=function(p){return p*c},f=function(p,g){return d(p)+g},h=Ye(o);return(h?l.every(function(m){return null!=m}):null!=l)?h?o.map(function(m,p){return f(m,l[p])}).join(" "):f(o,l):h?o.map(function(m){return oe(m)?m:""+d(m)}).join(" "):""+d(o)}if(null!=u)return u}return null}},getAnimationStartStyle:function(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n].name,s=r.pstyle(i);void 0!==s&&(s=Oe(s)?this.parse(i,s.strValue):this.parse(i,s)),s&&(t[i]=s)}return t},getPropsList:function(r){var t=[],n=r,a=this.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],l=n[o],u=a[o]||a[qi(o)],c=this.parse(u.name,l);c&&t.push(c)}return t},getNonDefaultPropertiesHash:function(r,e,t){var i,s,o,l,u,n=t.slice();for(l=0;l<e.length;l++)if(null!=(i=r.pstyle(e[l],!1)))if(null!=i.pfValue)n[0]=da(o,n[0]),n[1]=fa(o,n[1]);else for(s=i.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=da(o,n[0]),n[1]=fa(o,n[1]);return n}};Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var Si={appendFromJson:function(r){for(var e=this,t=0;t<r.length;t++){var n=r[t],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var o=0;o<s.length;o++){var l=s[o];e.css(l,i[l])}}return e},fromJson:function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e},json:function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,a=t.properties,i={},s=0;s<a.length;s++){var o=a[s];i[o.name]=o.strValue}r.push({selector:n?n.toString():"core",style:i})}return r}},Ho={appendFromString:function(r){var a,i,s,t=this,n=""+r;function o(){n=n.length>a.length?n.substr(a.length):""}function l(){i=i.length>s.length?i.substr(s.length):""}for(n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");!n.match(/^\s*$/);){var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){_t("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=c[0];var d=c[1];if("core"!==d&&new nn(d).invalid)_t("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();else{var h=c[2],v=!1;i=h;for(var m=[];!i.match(/^\s*$/);){var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){_t("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),v=!0;break}s=g[0];var w=g[1],C=g[2];this.properties[w]?t.parse(w,C)?(m.push({name:w,val:C}),l()):(_t("Skipping property: Invalid property definition in: "+s),l()):(_t("Skipping property: Invalid property name in: "+s),l())}if(v){o();break}t.selector(d);for(var V=0;V<m.length;V++){var F=m[V];t.css(F.name,F.val)}o()}}return t},fromString:function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e}},Kt={};(function(){var r=Jt,e=jf,t=Wf,i=function(Ie){return"^"+Ie+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(Ie){var Pe=r+"|\\w+|"+e+"|"+t+"|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+Ie+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+Pe+")\\s*\\,\\s*("+Pe+")\\)$"},o=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Kt.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"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},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},boxSelection:{enums:["contain","overlap","none"]},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","circle"]},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","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},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(Ie,Pe){switch(Ie.length){case 2:return"deg"!==Pe[0]&&"rad"!==Pe[0]&&"deg"!==Pe[1]&&"rad"!==Pe[1];case 1:return oe(Ie[0])||"deg"===Pe[0]||"rad"===Pe[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\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(Ie){var Pe=Ie.length;return 1===Pe||2===Pe||4===Pe}}};var l={zeroNonZero:function(Ie,Pe){return(null==Ie||null==Pe)&&Ie!==Pe||0==Ie&&0!=Pe||0!=Ie&&0==Pe},any:function(Ie,Pe){return Ie!=Pe},emptyNonEmpty:function(Ie,Pe){var ze=Sr(Ie),rt=Sr(Pe);return ze&&!rt||!ze&&rt}},u=Kt.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],v=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"text-metrics",type:u.textMetrics},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],m=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],p=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(Ie,Pe,ze){return Ie!==Pe&&"bezier"===ze.pstyle("curve-style").value}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],g=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],w=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],C=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],N=function(Ie,Pe){return"label"===Pe.value?-Ie.poolIndex():Pe.pfValue},z=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:N},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:N},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],V=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],F=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],U=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],W=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],Z=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(Ie,Pe){return Ie!==Pe&&("bezier"===Ie||"bezier"===Pe)}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],K=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],J=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],Q=[];Kt.pieBackgroundN=16,Q.push({name:"pie-size",type:u.sizeMaybePercent}),Q.push({name:"pie-hole",type:u.sizeMaybePercent}),Q.push({name:"pie-start-angle",type:u.angle});for(var le=1;le<=Kt.pieBackgroundN;le++)Q.push({name:"pie-"+le+"-background-color",type:u.color}),Q.push({name:"pie-"+le+"-background-size",type:u.percent}),Q.push({name:"pie-"+le+"-background-opacity",type:u.zeroOneNumber});var de=[];Kt.stripeBackgroundN=16,de.push({name:"stripe-size",type:u.sizeMaybePercent}),de.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var he=1;he<=Kt.stripeBackgroundN;he++)de.push({name:"stripe-"+he+"-background-color",type:u.color}),de.push({name:"stripe-"+he+"-background-size",type:u.percent}),de.push({name:"stripe-"+he+"-background-opacity",type:u.zeroOneNumber});var ue=[],ge=Kt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Te){ge.forEach(function(Ie){ue.push({name:Ie+"-"+Te.name,type:Te.type,triggersBounds:Te.triggersBounds})})},{});var Se=Kt.properties=[].concat(m,C,p,g,w,K,v,h,c,d,f,z,V,F,U,Q,de,W,Z,ue,J),Le=Kt.propertyGroups={behavior:m,transition:C,visibility:p,overlay:g,underlay:w,ghost:K,commonLabel:v,labelDimensions:h,mainLabel:c,sourceLabel:d,targetLabel:f,nodeBody:z,nodeBorder:V,nodeOutline:F,backgroundImage:U,pie:Q,stripe:de,compound:W,edgeLine:Z,edgeArrow:ue,core:J},ye=Kt.propertyGroupNames={};(Kt.propertyGroupKeys=Object.keys(Le)).forEach(function(Te){ye[Te]=Le[Te].map(function(Ie){return Ie.name}),Le[Te].forEach(function(Ie){return Ie.groupKey=Te})});var Ue=Kt.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"}];Kt.propertyNames=Se.map(function(Te){return Te.name});for(var $e=0;$e<Se.length;$e++){var Xe=Se[$e];Se[Xe.name]=Xe}for(var Qe=0;Qe<Ue.length;Qe++){var tt=Ue[Qe],He={name:tt.name,alias:!0,pointsTo:Se[tt.pointsTo]};Se.push(He),Se[tt.name]=He}})(),Kt.getDefaultProperty=function(r){return this.getDefaultProperties()[r]},Kt.getDefaultProperties=function(){var r=this._private;if(null!=r.defaultProperties)return r.defaultProperties;for(var e=mt({"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","box-selection":"contain","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","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","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%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Kt.pieBackgroundN;c++)l[u.name.replace("{{i}}",c)]=u.value;return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Kt.stripeBackgroundN;c++)l[u.name.replace("{{i}}",c)]=u.value;return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return Kt.arrowPrefixes.forEach(function(c){l[c+"-"+u.name]=u.value}),l},{})),t={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=this.parse(i,e[i]);t[i]=o}}return r.defaultProperties=t,r.defaultProperties},Kt.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 Li={parse:function(r,e,t,n){var a=this;if(Be(e))return a.parseImplWarn(r,e,t,n);var c,l=Hl(r,""+e,t?"t":"f","mapping"===n||!0===n||!1===n||null==n?"dontcare":n),u=a.propCache=a.propCache||[];return(c=u[l])||(c=u[l]=a.parseImplWarn(r,e,t,n)),(t||"mapping"===n)&&(c=Pr(c))&&(c.value=Pr(c.value)),c},parseImplWarn:function(r,e,t,n){var a=this.parseImpl(r,e,t,n);return!a&&null!=e&&_t("The style property `".concat(r,": ").concat(e,"` is invalid")),a&&("width"===a.name||"height"===a.name)&&"label"===e&&_t("The style value of `label` is deprecated for `"+a.name+"`"),a},parseImpl:function(r,e,t,n){var a=this;r=qi(r);var i=a.properties[r],s=e,o=a.types;if(!i||void 0===e)return null;i.alias&&(r=(i=i.pointsTo).name);var l=oe(e);l&&(e=e.trim());var c,d,u=i.type;if(!u)return null;if(t&&(""===e||null===e))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(Be(e))return{name:r,value:e,strValue:"fn",mapped:o.fn,bypass:t};if(!(!l||n||e.length<7||"a"!==e[1])){if(e.length>=7&&"d"===e[0]&&(c=new RegExp(o.data.regex).exec(e)))return!t&&{name:r,value:c,strValue:""+e,mapped:o.data,field:c[1],bypass:t};if(e.length>=10&&"m"===e[0]&&(d=new RegExp(o.mapData.regex).exec(e))){if(t||u.multiple)return!1;var h=o.mapData;if(!u.color&&!u.number)return!1;var v=this.parse(r,d[4]);if(!v||v.mapped)return!1;var m=this.parse(r,d[5]);if(!m||m.mapped)return!1;if(v.pfValue===m.pfValue||v.strValue===m.strValue)return _t("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+v.strValue+"`"),this.parse(r,v.strValue);if(u.color){var p=v.value,g=m.value;if(!(p[0]!==g[0]||p[1]!==g[1]||p[2]!==g[2]||p[3]!==g[3]&&(null!=p[3]&&1!==p[3]||null!=g[3]&&1!==g[3])))return!1}return{name:r,value:d,strValue:""+e,mapped:h,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:v.value,valueMax:m.value,bypass:t}}}if(u.multiple&&"multiple"!==n){var C;if(C=l?e.split(/\s+/):Ye(e)?e:[e],u.evenMultiple&&C.length%2!=0)return null;for(var N=[],z=[],V=[],F="",U=!1,W=0;W<C.length;W++){var Z=a.parse(r,C[W],t,"multiple");U=U||oe(Z.value),N.push(Z.value),V.push(null!=Z.pfValue?Z.pfValue:Z.value),z.push(Z.units),F+=(W>0?" ":"")+Z.strValue}return u.validate&&!u.validate(N,z)?null:u.singleEnum&&U?1===N.length&&oe(N[0])?{name:r,value:N[0],strValue:N[0],bypass:t}:null:{name:r,value:N,pfValue:V,strValue:F,bypass:t,units:z}}var K=function(){for(var He=0;He<u.enums.length;He++)if(u.enums[He]===e)return{name:r,value:e,strValue:""+e,bypass:t};return null};if(u.number){var J,Q="px";if(u.units&&(J=u.units),u.implicitUnits&&(Q=u.implicitUnits),!u.unitless)if(l){var le="px|em"+(u.allowPercent?"|\\%":"");J&&(le=J);var de=e.match("^("+Jt+")("+le+")?$");de&&(e=de[1],J=de[2]||Q)}else(!J||u.implicitUnits)&&(J=Q);if(e=parseFloat(e),isNaN(e)&&void 0===u.enums)return null;if(isNaN(e)&&void 0!==u.enums)return e=s,K();if(u.integer&&!function(e){return _e(e)&&Math.floor(e)===e}(e)||void 0!==u.min&&(e<u.min||u.strictMin&&e===u.min)||void 0!==u.max&&(e>u.max||u.strictMax&&e===u.max))return null;var he={name:r,value:e,strValue:""+e+(J||""),units:J,bypass:t};return he.pfValue=u.unitless||"px"!==J&&"em"!==J?e:"px"!==J&&J?this.getEmSizeInPixels()*e:e,("ms"===J||"s"===J)&&(he.pfValue="ms"===J?e:1e3*e),("deg"===J||"rad"===J)&&(he.pfValue="rad"===J?e:function(e){return Math.PI*e/180}(e)),"%"===J&&(he.pfValue=e/100),he}if(u.propList){var ue=[],ge=""+e;if("none"!==ge){for(var Se=ge.split(/\s*,\s*|\s+/),Le=0;Le<Se.length;Le++){var ye=Se[Le].trim();a.properties[ye]?ue.push(ye):_t("`"+ye+"` is not a valid property name")}if(0===ue.length)return null}return{name:r,value:ue,strValue:0===ue.length?"none":ue.join(" "),bypass:t}}if(u.color){var De=wl(e);return De?{name:r,value:De,pfValue:De,strValue:"rgb("+De[0]+","+De[1]+","+De[2]+")",bypass:t}:null}if(u.regex||u.regexes){if(u.enums){var Ue=K();if(Ue)return Ue}for(var $e=u.regexes?u.regexes:[u.regex],Xe=0;Xe<$e.length;Xe++){var tt=new RegExp($e[Xe]).exec(e);if(tt)return{name:r,value:u.singleRegexMatchValue?tt[1]:tt,strValue:""+e,bypass:t}}return null}return u.string?{name:r,value:""+e,strValue:""+e,bypass:t}:u.enums?K():null}},nr=function(e){if(!(this instanceof nr))return new nr(e);xr(e)?(this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()):Xt("A style must have a core reference")},dr=nr.prototype;dr.instanceString=function(){return"style"},dr.clear=function(){for(var r=this._private,t=r.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},dr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},dr.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)},dr.selector=function(r){var e="core"===r?null:new nn(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this},dr.css=function(){var e=arguments;if(1===e.length)for(var t=e[0],n=0;n<this.properties.length;n++){var a=this.properties[n],i=t[a.name];void 0===i&&(i=t[Ua(a.name)]),void 0!==i&&this.cssRule(a.name,i)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},dr.style=dr.css,dr.cssRule=function(r,e){var t=this.parse(r,e);if(t){var n=this.length-1;this[n].properties.push(t),this[n].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[n].mappedProperties.push(t),!this[n].selector&&(this._private.coreStyle[t.name]=t)}return this},dr.append=function(r){return gn(r)?r.appendToStyle(this):Ye(r)?this.appendFromJson(r):oe(r)&&this.appendFromString(r),this},nr.fromJson=function(r,e){var t=new nr(r);return t.fromJson(e),t},nr.fromString=function(r,e){return new nr(r).fromString(e)},[rr,La,Vo,Br,Si,Ho,Kt,Li].forEach(function(r){mt(dr,r)}),nr.types=dr.types,nr.properties=dr.properties,nr.propertyGroups=dr.propertyGroups,nr.propertyGroupNames=dr.propertyGroupNames,nr.propertyGroupKeys=dr.propertyGroupKeys;var Qp={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=gn(e)?e.generateStyle(this):Ye(e)?nr.fromJson(this,e):oe(e)?nr.fromString(this,e):nr(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},En={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:(("additive"===e||"single"===e)&&(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var n,a,i,s,o,e=arguments,t=this._private.pan;switch(e.length){case 0:return t;case 1:if(oe(e[0]))return t[n=e[0]];if(Oe(e[0])){if(!this._private.panningEnabled)return this;o=(i=e[0]).y,_e(s=i.x)&&(t.x=s),_e(o)&&(t.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[1],("x"===(n=e[0])||"y"===n)&&_e(a)&&(t[n]=a),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var i,s,o,l,u,n=arguments,a=this._private.pan;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Oe(e)&&(u=(o=n[0]).y,_e(l=o.x)&&(a.x+=l),_e(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:s=t,("x"===(i=e)||"y"===i)&&_e(s)&&(a[i]+=s),this.emit("pan viewport")}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var n=this.getFitViewport(e,t);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,t){var n;if((_e(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled)&&(oe(e)?e=this.$(e):!function(e){return Oe(e)&&_e(e.x1)&&_e(e.x2)&&_e(e.y1)&&_e(e.y2)}(e)?vt(e)||(e=this.mutableElements()):((n={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1),!vt(e)||!e.empty())){n=n||e.boundingBox();var l,s=this.width(),o=this.height();if(t=_e(t)?t:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:l=(l=(l=Math.min((s-2*t)/n.w,(o-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:l)<this._private.minZoom?this._private.minZoom:l,pan:{x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var a=e;e=a.min,t=a.max}return _e(e)&&_e(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):_e(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:_e(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var i,s,t=this._private,n=t.pan,a=t.zoom,o=!1;return t.zoomingEnabled||(o=!0),_e(e)?s=e:Oe(e)&&(s=e.level,null!=e.position?i=Za(e.position,a,n):null!=e.renderedPosition&&(i=e.renderedPosition),null!=i&&!t.panningEnabled&&(o=!0)),s=(s=s>t.maxZoom?t.maxZoom:s)<t.minZoom?t.minZoom:s,!o&&_e(s)&&s!==a&&(null==i||_e(i.x)&&_e(i.y))?null!=i?{zoomed:!0,panned:!0,zoom:s,pan:{x:-s/a*(i.x-n.x)+i.x,y:-s/a*(i.y-n.y)+i.y}}:{zoomed:!0,panned:!1,zoom:s,pan:n}:null},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,a=!0,i=[],s=!1,o=!1;if(!e)return this;if(_e(e.zoom)||(n=!1),Oe(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=l,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;_e(u.x)&&(t.pan.x=u.x,o=!1),_e(u.y)&&(t.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(oe(e)){var n=e;e=this.mutableElements().filter(n)}else vt(e)||(e=this.mutableElements());if(0!==e.length){var a=e.boundingBox(),i=this.width(),s=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(a.x1+a.x2))/2,y:(s-t*(a.y1+a.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var a,i,e=this._private,t=e.container;return e.sizeCache=e.sizeCache||(t?(a=this.window().getComputedStyle(t),{width:t.clientWidth-(i=function(o){return parseFloat(a.getPropertyValue(o))})("padding-left")-i("padding-right"),height:t.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,t=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};En.centre=En.center,En.autolockNodes=En.autolock,En.autoungrabifyNodes=En.autoungrabify;var Aa={data:Ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Aa.attr=Aa.data,Aa.removeAttr=Aa.removeData;var Ia=function(e){var t=this,n=(e=mt({},e)).container;n&&!nt(n)&&nt(n[0])&&(n=n[0]);var a=n?n._cyreg:null;(a=a||{})&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=t;var s=void 0!==Ne&&void 0!==n&&!e.headless,o=e;o.layout=mt({name:s?"grid":"null"},o.layout),o.renderer=mt({name:s?"canvas":"null"},o.renderer);var l=function(v,m,p){return void 0!==m?m:void 0!==p?p:v},u=this._private={container:n,ready:!1,options:o,elements:new or(this),listeners:[],aniEles:new or(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?s:o.styleEnabled,zoom:_e(o.zoom)?o.zoom:1,pan:{x:Oe(o.pan)&&_e(o.pan.x)?o.pan.x:0,y:Oe(o.pan)&&_e(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom}),u.styleEnabled&&t.setStyle([]);var d=mt({},o,o.renderer);t.initRenderer(d),function(v,m){if(v.some(Hf))return Vn.all(v).then(m);m(v)}([o.style,o.elements],function(h){var v=h[0],m=h[1];u.styleEnabled&&t.style().append(v),function(v,m,p){t.notifications(!1);var g=t.mutableElements();g.length>0&&g.remove(),null!=v&&(Oe(v)||Ye(v))&&t.add(v),t.one("layoutready",function(C){t.notifications(!0),t.emit(C),t.one("load",m),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",p),t.emit("done")});var w=mt({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()}(m,function(){t.startAnimationLoop(),u.ready=!0,Be(o.ready)&&t.on("ready",o.ready);for(var p=0;p<i.length;p++)t.on("ready",i[p]);a&&(a.readies=[]),t.emit("ready")},o.done)})},Ai=Ia.prototype;mt(Ai,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(null==this._private.container)return Ne;var t=this._private.container.ownerDocument;return void 0===t||null==t?Ne:t.defaultView||Ne},mount:function(e){if(null!=e){var t=this,n=t._private,a=n.options;return!nt(e)&&nt(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(mt({},a,a.renderer,{name:"null"===a.renderer.name?"canvas":a.renderer.name})),t.startAnimationLoop(),t.style(a.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Pr(this._private.options)},json:function(e){var t=this,n=t._private,a=t.mutableElements();if(Oe(e)){if(t.startBatch(),e.elements){var s={},o=function(N,z){for(var V=[],F=[],U=0;U<N.length;U++){var W=N[U];if(W.data.id){var Z=""+W.data.id,K=t.getElementById(Z);s[Z]=!0,0!==K.length?F.push({ele:K,json:W}):(z&&(W.group=z),V.push(W))}else _t("cy.json() cannot handle elements without an ID attribute")}t.add(V);for(var J=0;J<F.length;J++){var Q=F[J];Q.ele.json(Q.json)}};if(Ye(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];Ye(d)&&o(d,c)}var f=t.collection();a.filter(function(C){return!s[C.id()]}).forEach(function(C){C.isParent()?f.merge(C):C.remove()}),f.forEach(function(C){return C.children().move({parent:null})}),f.forEach(function(C){return(N=C,t.getElementById(N.id())).remove();var N})}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],v=0;v<h.length;v++){var m=h[v];null!=e[m]&&t[m](e[m])}return t.endBatch(),this}var g={};e?g.elements=this.elements().map(function(C){return C.json()}):(g.elements={},a.forEach(function(C){var N=C.group();g.elements[N]||(g.elements[N]=[]),g.elements[N].push(C.json())})),this._private.styleEnabled&&(g.style=t.style().json()),g.data=Pr(t.data());var w=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=Pr(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=Pr(w.renderer),g.hideEdgesOnViewport=w.hideEdgesOnViewport,g.textureOnViewport=w.textureOnViewport,g.wheelSensitivity=w.wheelSensitivity,g.motionBlur=w.motionBlur,g.multiClickDebounceTime=w.multiClickDebounceTime,g}}),Ai.$id=Ai.getElementById,[Up,qp,gd,Go,Ci,Kp,zo,Di,Qp,En,Aa].forEach(function(r){mt(Ai,r)});var ty={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},ry={maximal:!1,acyclic:!1},Zn=function(e){return e.scratch("breadthfirst")},pd=function(e,t){return e.scratch("breadthfirst",t)};function yd(r){this.options=mt({},ty,ry,r)}yd.prototype.run=function(){var u,r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(pt){return pt.isChildless()}),a=t,i=r.directed,s=r.acyclic||r.maximal||r.maximalAdjustments>0,o=!!r.boundingBox,l=gr(o?r.boundingBox:structuredClone(e.extent()));if(vt(r.roots))u=r.roots;else if(Ye(r.roots)){for(var c=[],d=0;d<r.roots.length;d++){var h=e.getElementById(r.roots[d]);c.push(h)}u=e.collection(c)}else if(oe(r.roots))u=e.$(r.roots);else if(i)u=n.roots();else{var v=t.components();u=e.collection();for(var m=function(){var ot=v[p],gt=ot.maxDegree(!1),ht=ot.filter(function(Tt){return Tt.degree(!1)===gt});u=u.add(ht)},p=0;p<v.length;p++)m()}var g=[],w={},C=function(ot,gt){null==g[gt]&&(g[gt]=[]);var ht=g[gt].length;g[gt].push(ot),pd(ot,{index:ht,depth:gt})};a.bfs({roots:u,directed:r.directed,visit:function(ot,gt,ht,Tt,wt){var Lt=ot[0],Rt=Lt.id();Lt.isChildless()&&C(Lt,wt),w[Rt]=!0}});for(var z=[],V=0;V<n.length;V++){var F=n[V];w[F.id()]||z.push(F)}var U=function(ot){for(var gt=g[ot],ht=0;ht<gt.length;ht++){var Tt=gt[ht];null!=Tt?pd(Tt,{depth:ot,index:ht}):(gt.splice(ht,1),ht--)}},W=function(ot,gt){for(var ht=Zn(ot),Tt=ot.incomers().filter(function(je){return je.isNode()&&t.has(je)}),wt=-1,Lt=ot.id(),Rt=0;Rt<Tt.length;Rt++){var Bt=Zn(Tt[Rt]);wt=Math.max(wt,Bt.depth)}if(ht.depth<=wt){if(!r.acyclic&>[Lt])return null;var Pt=wt+1;return function(ot,gt){var ht=Zn(ot);g[ht.depth][ht.index]=null,ot.isChildless()&&C(ot,gt)}(ot,Pt),gt[Lt]=Pt,!0}return!1};if(i&&s){var Z=[],K={},J=function(ot){return Z.push(ot)},Q=function(){return Z.shift()};for(n.forEach(function(pt){return Z.push(pt)});Z.length>0;){var le=Q(),de=W(le,K);if(de)le.outgoers().filter(function(pt){return pt.isNode()&&t.has(pt)}).forEach(J);else if(null===de){_t("Detected double maximal shift for node `"+le.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var he=0;if(r.avoidOverlap)for(var ue=0;ue<n.length;ue++){var Se=n[ue].layoutDimensions(r);he=Math.max(he,Se.w,Se.h)}var De={},Ue=function(ot){if(De[ot.id()])return De[ot.id()];for(var gt=Zn(ot).depth,ht=ot.neighborhood(),Tt=0,wt=0,Lt=0;Lt<ht.length;Lt++){var Rt=ht[Lt];if(!Rt.isEdge()&&!Rt.isParent()&&n.has(Rt)){var Gt=Zn(Rt);if(null!=Gt){var Bt=Gt.index,Pt=Gt.depth;null!=Bt&&null!=Pt&&Pt<gt&&(Tt+=Bt/g[Pt].length,wt++)}}}return Tt/=wt=Math.max(1,wt),0===wt&&(Tt=0),De[ot.id()]=Tt,Tt},$e=function(ot,gt){var wt=Ue(ot)-Ue(gt);return 0===wt?bl(ot.id(),gt.id()):wt};void 0!==r.depthSort&&($e=r.depthSort);for(var Xe=g.length,Qe=0;Qe<Xe;Qe++)g[Qe].sort($e),U(Qe);for(var tt=[],at=0;at<z.length;at++)tt.push(z[at]);tt.length&&(g.unshift(tt),Xe=g.length,function(){for(var ot=0;ot<Xe;ot++)U(ot)}());for(var Te=0,Ie=0;Ie<Xe;Ie++)Te=Math.max(g[Ie].length,Te);var Pe_x=l.x1+l.w/2,Pe_y=l.y1+l.h/2,ze=n.reduce(function(pt,ot){return gt=ot.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}),{w:-1===pt.w?gt.w:(pt.w+gt.w)/2,h:-1===pt.h?gt.h:(pt.h+gt.h)/2};var gt},{w:-1,h:-1}),rt=Math.max(1===Xe?0:o?(l.h-2*r.padding-ze.h)/(Xe-1):(l.h-2*r.padding-ze.h)/(Xe+1),he),ct=g.reduce(function(pt,ot){return Math.max(pt,ot.length)},0),Et={downward:0,leftward:90,upward:180,rightward:-90};return-1===Object.keys(Et).indexOf(r.direction)&&Xt("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Et).join(", "))),t.nodes().layoutPositions(this,r,function(ot){return function yh(r,e,t){if(0===t)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=function gh(r,e,t,n,a){var i=a*Math.PI/180;return{x:Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,y:Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n}}(r.x,r.y,n,a,t),l=function(e,t,n,a,i,s){return{x:(e-n)*i+n,y:(t-a)*s+a}}(o.x,o.y,n,a,i,s);return{x:l.x,y:l.y}}(function(ot){var gt=Zn(ot),ht=gt.depth,Tt=gt.index;if(r.circle){var wt=Math.min(l.w/2/Xe,l.h/2/Xe),Lt=(wt=Math.max(wt,he))*ht+wt-(Xe>0&&g[0].length<=3?wt/2:0),Rt=2*Math.PI/g[ht].length*Tt;return 0===ht&&1===g[0].length&&(Lt=1),{x:Pe_x+Lt*Math.cos(Rt),y:Pe_y+Lt*Math.sin(Rt)}}var Gt=g[ht].length,Bt=Math.max(1===Gt?0:o?(l.w-2*r.padding-ze.w)/((r.grid?ct:Gt)-1):(l.w-2*r.padding-ze.w)/((r.grid?ct:Gt)+1),he);return{x:Pe_x+(Tt+1-(Gt+1)/2)*Bt,y:Pe_y+(ht+1-(Xe+1)/2)*rt}}(ot),l,Et[r.direction])}),this};var ny={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function md(r){this.options=mt({},ny,r)}md.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var c,s=gr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=(void 0===e.sweep?2*Math.PI-2*Math.PI/i.length:e.sweep)/Math.max(1,i.length-1),d=0,f=0;f<i.length;f++){var v=i[f].layoutDimensions(e);d=Math.max(d,v.w,v.h)}if(c=_e(e.radius)?e.radius:i.length<=1?0:Math.min(s.h,s.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var g=Math.cos(u)-Math.cos(0),w=Math.sin(u)-Math.sin(0),C=Math.sqrt(d*d/(g*g+w*w));c=Math.max(C,c)}return n.nodes().layoutPositions(this,e,function(V,F){var U=e.startAngle+F*u*(a?1:-1),W=c*Math.cos(U),Z=c*Math.sin(U);return{x:o.x+W,y:o.y+Z}}),this};var ay={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function bd(r){this.options=mt({},ay,r)}bd.prototype.run=function(){for(var r=this.options,e=r,t=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=r.cy,a=e.eles,i=a.nodes().not(":parent"),s=gr(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},l=[],u=0,c=0;c<i.length;c++){var f,d=i[c];f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}i.updateStyle();for(var h=0;h<i.length;h++){var m=i[h].layoutDimensions(e);u=Math.max(u,m.w,m.h)}l.sort(function(rt,ct){return ct.value-rt.value});for(var p=e.levelWidth(i),g=[[]],w=g[0],C=0;C<l.length;C++){var N=l[C];w.length>0&&Math.abs(w[0].value-N.value)>=p&&g.push(w=[]),w.push(N)}var V=u+e.minNodeSpacing;if(!e.avoidOverlap){var F=g.length>0&&g[0].length>1,U=Math.min(s.w,s.h)/2-V;V=Math.min(V,U/(g.length+F?1:0))}for(var Z=0,K=0;K<g.length;K++){var J=g[K],Q=void 0===e.sweep?2*Math.PI-2*Math.PI/J.length:e.sweep,le=J.dTheta=Q/Math.max(1,J.length-1);if(J.length>1&&e.avoidOverlap){var de=Math.cos(le)-Math.cos(0),he=Math.sin(le)-Math.sin(0),ue=Math.sqrt(V*V/(de*de+he*he));Z=Math.max(ue,Z)}J.r=Z,Z+=V}if(e.equidistant){for(var ge=0,Se=0,Le=0;Le<g.length;Le++)ge=Math.max(ge,g[Le].r-Se);Se=0;for(var Ue=0;Ue<g.length;Ue++){var $e=g[Ue];0===Ue&&(Se=$e.r),$e.r=Se,Se+=ge}}for(var Xe={},Qe=0;Qe<g.length;Qe++)for(var tt=g[Qe],at=tt.dTheta,He=tt.r,Te=0;Te<tt.length;Te++){var Ie=tt[Te],Pe=e.startAngle+(t?1:-1)*at*Te,ze={x:o.x+He*Math.cos(Pe),y:o.y+He*Math.sin(Pe)};Xe[Ie.node.id()]=ze}return a.nodes().layoutPositions(this,e,function(rt){var ct=rt.id();return Xe[ct]}),this};var Uo,iy={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Ii(r){this.options=mt({},iy,r),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}Ii.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(!0===r.animate||!1===r.animate)&&t.emit({type:"layoutstart",layout:t}),Uo=!0===r.debug;var n=sy(e,t,r);Uo&&(void 0)(n),r.randomize&&uy(n);var a=Ur(),i=function(){cy(n,e,r),!0===r.fit&&e.fit(r.padding)},s=function(f){return!(t.stopped||f>=r.numIter||(dy(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},o=function(){if(!0===r.animate||!1===r.animate)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var f=r.eles.nodes(),h=xd(n,r,f);f.layoutPositions(t,r,h)}},l=0,u=!0;if(!0===r.animate){var c=function(){for(var f=0;u&&f<r.refresh;)u=s(l),l++,f++;u?(Ur()-a>=r.animationThreshold&&i(),Ya(c)):(Cd(n,r),o())};c()}else{for(;u;)u=s(l),l++;Cd(n,r),o()}return this},Ii.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Ii.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var sy=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=gr(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},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],f=0;f<d.length;f++)u[d[f].id()]=c;for(c=0;c<o.nodeSize;c++){var m=(v=i[c]).layoutDimensions(n);(p={}).isLocked=v.locked(),p.id=v.data("id"),p.parentId=v.data("parent"),p.cmptId=u[v.id()],p.children=[],p.positionX=v.position("x"),p.positionY=v.position("y"),p.offsetX=0,p.offsetY=0,p.height=m.w,p.width=m.h,p.maxX=p.positionX+p.width/2,p.minX=p.positionX-p.width/2,p.maxY=p.positionY+p.height/2,p.minY=p.positionY-p.height/2,p.padLeft=parseFloat(v.style("padding")),p.padRight=parseFloat(v.style("padding")),p.padTop=parseFloat(v.style("padding")),p.padBottom=parseFloat(v.style("padding")),p.nodeRepulsion=Be(n.nodeRepulsion)?n.nodeRepulsion(v):n.nodeRepulsion,o.layoutNodes.push(p),o.idToIndex[p.id]=c}var g=[],w=0,C=-1,N=[];for(c=0;c<o.nodeSize;c++){var v,z=(v=o.layoutNodes[c]).parentId;null!=z?o.layoutNodes[o.idToIndex[z]].children.push(v.id):(g[++C]=v.id,N.push(v.id))}for(o.graphSet.push(N);w<=C;){var V=g[w++],U=o.layoutNodes[o.idToIndex[V]].children;if(U.length>0)for(o.graphSet.push(U),c=0;c<U.length;c++)g[++C]=U[c]}for(c=0;c<o.graphSet.length;c++){var W=o.graphSet[c];for(f=0;f<W.length;f++)o.indexToGraph[o.idToIndex[W[f]]]=c}for(c=0;c<o.edgeSize;c++){var K=a[c],J={};J.id=K.data("id"),J.sourceId=K.data("source"),J.targetId=K.data("target");var Q=Be(n.idealEdgeLength)?n.idealEdgeLength(K):n.idealEdgeLength,le=Be(n.edgeElasticity)?n.edgeElasticity(K):n.edgeElasticity,de=o.idToIndex[J.sourceId],he=o.idToIndex[J.targetId];if(o.indexToGraph[de]!=o.indexToGraph[he]){for(var Se=oy(J.sourceId,J.targetId,o),Le=o.graphSet[Se],ye=0,p=o.layoutNodes[de];-1===Le.indexOf(p.id);)p=o.layoutNodes[o.idToIndex[p.parentId]],ye++;for(p=o.layoutNodes[he];-1===Le.indexOf(p.id);)p=o.layoutNodes[o.idToIndex[p.parentId]],ye++;Q*=ye*n.nestingFactor}J.idealLength=Q,J.elasticity=le,o.layoutEdges.push(J)}return o},oy=function(e,t,n){var a=wd(e,t,0,n);return 2>a.count?0:a.graph},wd=function(e,t,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var s=0,o=0;o<i.length;o++){var c=a.layoutNodes[a.idToIndex[i[o]]].children;if(0!==c.length){var f=wd(e,t,a.indexToGraph[a.idToIndex[c[0]]],a);if(0!==f.count){if(1!==f.count)return f;if(2===++s)break}}}return{count:s,graph:n}},uy=function(e,t){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];0===s.children.length&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*a)}},xd=function(e,t,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.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 l=e.layoutNodes[e.idToIndex[s.data("id")]];return t.boundingBox?{x:a.x1+(0===i.w?.5:(l.positionX-i.x1)/i.w)*a.w,y:a.y1+(0===i.h?.5:(l.positionY-i.y1)/i.h)*a.h}:{x:l.positionX,y:l.positionY}}},cy=function(e,t,n){var a=n.layout,i=n.eles.nodes(),s=xd(e,n,i);i.positions(s),!0!==e.ready&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},dy=function(e,t,n){fy(e,t),gy(e),py(e,t),yy(e),my(e)},fy=function(e,t){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]]],l=s+1;l<i;l++)hy(o,e.layoutNodes[e.idToIndex[a[l]]],e,t)},Ed=function(e){return-e+2*e*Math.random()},hy=function(e,t,n,a){if(e.cmptId===t.cmptId||n.isCompound){var o=t.positionX-e.positionX,l=t.positionY-e.positionY;0===o&&0===l&&(o=Ed(1),l=Ed(1));var c=vy(e,t,o,l);if(c>0)var h=(d=a.nodeOverlap*c)*o/(f=Math.sqrt(o*o+l*l)),v=d*l/f;else{var d,m=Ni(e,o,l),p=Ni(t,-1*o,-1*l),g=p.x-m.x,w=p.y-m.y,C=g*g+w*w,f=Math.sqrt(C);h=(d=(e.nodeRepulsion+t.nodeRepulsion)/C)*g/f,v=d*w/f}e.isLocked||(e.offsetX-=h,e.offsetY-=v),t.isLocked||(t.offsetX+=h,t.offsetY+=v)}},vy=function(e,t,n,a){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(a>0)var s=e.maxY-t.minY;else s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Ni=function(e,t,n){var a=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=n/t,u=s/o,c={};return 0===t&&0<n||0===t&&0>n?(c.x=a,c.y=i+s/2,c):0<t&&-1*u<=l&&l<=u?(c.x=a+o/2,c.y=i+o*n/2/t,c):0>t&&-1*u<=l&&l<=u?(c.x=a-o/2,c.y=i-o*n/2/t,c):0<n&&(l<=-1*u||l>=u)?(c.x=a+s*t/2/n,c.y=i+s/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=a-s*t/2/n,c.y=i-s/2),c)},gy=function(e,t){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],s=e.layoutNodes[e.idToIndex[a.sourceId]],l=e.layoutNodes[e.idToIndex[a.targetId]],u=l.positionX-s.positionX,c=l.positionY-s.positionY;if(0!==u||0!==c){var d=Ni(s,u,c),f=Ni(l,-1*u,-1*c),h=f.x-d.x,v=f.y-d.y,m=Math.sqrt(h*h+v*v),p=Math.pow(a.idealLength-m,2)/a.elasticity;if(0!==m)var g=p*h/m,w=p*v/m;else g=0,w=0;s.isLocked||(s.offsetX+=g,s.offsetY+=w),l.isLocked||(l.offsetX-=g,l.offsetY-=w)}}},py=function(e,t){if(0!==t.gravity)for(var a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(0===a)var o=e.clientHeight/2,l=e.clientWidth/2;else{var c=e.layoutNodes[e.idToIndex[e.layoutNodes[e.idToIndex[i[0]]].parentId]];o=c.positionX,l=c.positionY}for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[i[d]]];if(!f.isLocked){var h=o-f.positionX,v=l-f.positionY,m=Math.sqrt(h*h+v*v);if(m>1){var g=t.gravity*v/m;f.offsetX+=t.gravity*h/m,f.offsetY+=g}}}}},yy=function(e,t){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++],l=e.layoutNodes[e.idToIndex[s]],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var h=e.layoutNodes[e.idToIndex[u[f]]];h.offsetX+=c,h.offsetY+=d,n[++i]=u[f]}l.offsetX=0,l.offsetY=0}}},my=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(a=e.layoutNodes[n]).children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(a=e.layoutNodes[n]).children.length||a.isLocked)){var i=by(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,Td(a,e)}for(n=0;n<e.nodeSize;n++){var a;0<(a=e.layoutNodes[n]).children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},by=function(e,t,n){var a=Math.sqrt(e*e+t*t);if(a>n)var i={x:n*e/a,y:n*t/a};else i={x:e,y:t};return i},Td=function(e,t){var n=e.parentId;if(null!=n){var a=t.layoutNodes[t.idToIndex[n]],i=!1;if((null==a.maxX||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(null==a.minX||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(null==a.maxY||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(null==a.minY||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return Td(a,t)}},Cd=function(e,t){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],o=s.cmptId;(a[o]=a[o]||[]).push(s)}var u=0;for(i=0;i<a.length;i++)if(c=a[i]){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var d=0;d<c.length;d++){var f=c[d];c.x1=Math.min(c.x1,f.positionX-f.width/2),c.x2=Math.max(c.x2,f.positionX+f.width/2),c.y1=Math.min(c.y1,f.positionY-f.height/2),c.y2=Math.max(c.y2,f.positionY+f.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}a.sort(function(w,C){return C.w*C.h-w.w*w.h});var h=0,v=0,m=0,p=0,g=Math.sqrt(u)*e.clientWidth/e.clientHeight;for(i=0;i<a.length;i++){var c;if(c=a[i]){for(d=0;d<c.length;d++)(f=c[d]).isLocked||(f.positionX+=h-c.x1,f.positionY+=v-c.y1);h+=c.w+t.componentSpacing,m+=c.w+t.componentSpacing,p=Math.max(p,c.h),m>g&&(v+=p+t.componentSpacing,h=0,m=0,p=0)}}},wy={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Dd(r){this.options=mt({},wy,r)}Dd.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=gr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(0===i.h||0===i.w)n.nodes().layoutPositions(this,e,function(Ue){return{x:i.x1,y:i.y1}});else{var s=a.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),c=function($e){if(null==$e)return Math.min(l,u);Math.min(l,u)==l?l=$e:u=$e},d=function($e){if(null==$e)return Math.max(l,u);Math.max(l,u)==l?l=$e:u=$e},f=e.rows,h=null!=e.cols?e.cols:e.columns;if(null!=f&&null!=h)l=f,u=h;else if(null!=f&&null==h)l=f,u=Math.ceil(s/l);else if(null==f&&null!=h)u=h,l=Math.ceil(s/u);else if(u*l>s){var v=c(),m=d();(v-1)*m>=s?c(v-1):(m-1)*v>=s&&d(m-1)}else for(;u*l<s;){var p=c(),g=d();(g+1)*p>=s?d(g+1):c(p+1)}var w=i.w/u,C=i.h/l;if(e.condense&&(w=0,C=0),e.avoidOverlap)for(var N=0;N<a.length;N++){var z=a[N],V=z._private.position;(null==V.x||null==V.y)&&(V.x=0,V.y=0);var F=z.layoutDimensions(e),U=e.avoidOverlapPadding,Z=F.h+U;w=Math.max(w,F.w+U),C=Math.max(C,Z)}for(var K={},J=function($e,Xe){return!!K["c-"+$e+"-"+Xe]},Q=function($e,Xe){K["c-"+$e+"-"+Xe]=!0},le=0,de=0,he=function(){++de>=u&&(de=0,le++)},ue={},ge=0;ge<a.length;ge++){var Se=a[ge],Le=e.position(Se);if(Le&&(void 0!==Le.row||void 0!==Le.col)){var ye={row:Le.row,col:Le.col};if(void 0===ye.col)for(ye.col=0;J(ye.row,ye.col);)ye.col++;else if(void 0===ye.row)for(ye.row=0;J(ye.row,ye.col);)ye.row++;ue[Se.id()]=ye,Q(ye.row,ye.col)}}a.layoutPositions(this,e,function($e,Xe){var Qe,tt;if($e.locked()||$e.isParent())return!1;var at=ue[$e.id()];if(at)Qe=at.col*w+w/2+i.x1,tt=at.row*C+C/2+i.y1;else{for(;J(le,de);)he();Qe=de*w+w/2+i.x1,tt=le*C+C/2+i.y1,Q(le,de),he()}return{x:Qe,y:tt}})}return this};var xy={ready:function(){},stop:function(){}};function Xo(r){this.options=mt({},xy,r)}Xo.prototype.run=function(){var r=this.options,e=r.eles,t=this;return t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this},Xo.prototype.stop=function(){return this};var Ey={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Sd(r){this.options=mt({},Ey,r)}Sd.prototype.run=function(){var r=this.options,t=r.eles.nodes(),n=Be(r.positions);return t.layoutPositions(this,r,function(i,s){var o=function a(i){return null==r.positions?function(e){return{x:e.x,y:e.y}}(i.position()):n?r.positions(i):r.positions[i._private.data.id]??null}(i);return!i.locked()&&null!=o&&o}),this};var Ty={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ld(r){this.options=mt({},Ty,r)}Ld.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=gr(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()});return t.nodes().layoutPositions(this,r,function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}}),this};var Cy=[{name:"breadthfirst",impl:yd},{name:"circle",impl:md},{name:"concentric",impl:bd},{name:"cose",impl:Ii},{name:"grid",impl:Dd},{name:"null",impl:Xo},{name:"preset",impl:Sd},{name:"random",impl:Ld}];function Ad(r){this.options=r,this.notifications=0}var Id=function(){},Nd=function(){throw new Error("A headless instance can not render images")};Ad.prototype={recalculateRenderedStyle:Id,notify:function(){this.notifications++},init:Id,isHeadless:function(){return!0},png:Nd,jpg:Nd};var jo={arrowShapeWidth:.3,registerArrowShapes:function(){var r=this.arrowShapes={},e=this,t=function(u,c,d,f,h,v,m){return h.x-d/2-m<=u&&u<=h.x+d/2+m&&h.y-d/2-m<=c&&c<=h.y+d/2+m},n=function(u,c,d,f,h){var v=u*Math.cos(f)-c*Math.sin(f),m=u*Math.sin(f)+c*Math.cos(f);return{x:v*d+h.x,y:m*d+h.y}},a=function(u,c,d,f){for(var h=[],v=0;v<u.length;v+=2)h.push(n(u[v],u[v+1],c,d,f));return h},i=function(u){for(var c=[],d=0;d<u.length;d++){var f=u[d];c.push(f.x,f.y)}return c},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,c){oe(c)&&(c=r[c]),r[u]=mt({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,h,v,m,p,g){var w=i(a(this.points,v+2*g,m,p));return mr(f,h,w)},roughCollide:t,draw:function(f,h,v,m){var p=a(this.points,h,v,m);e.arrowShapeImpl("polygon")(f,p)},spacing:function(f){return 0},gap:s},c)};o("none",{collide:qa,roughCollide:qa,draw:fs,spacing:jl,gap:jl}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),m=this.controlPoint,p=n(m[0],m[1],c,d,f);e.arrowShapeImpl(this.name)(u,v,p)},gap:function(u){return.8*s(u)}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,c,d,f,h,v,m){var p=i(a(this.points,d+2*m,f,h)),g=i(a(this.pointsTee,d+2*m,f,h));return mr(u,c,p)||mr(u,c,g)},draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),m=a(this.pointsTee,c,d,f);e.arrowShapeImpl(this.name)(u,v,m)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,f,h,v,m){var p=h,g=Math.pow(p.x-u,2)+Math.pow(p.y-c,2)<=Math.pow((d+2*m)*this.radius,2),w=i(a(this.points,d+2*m,f,h));return mr(u,c,w)||g},draw:function(u,c,d,f,h){var v=a(this.pointsTr,c,d,f);e.arrowShapeImpl(this.name)(u,v,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.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(u,c){var d=this.baseCrossLinePts.slice(),f=c/u;return d[3]=d[3]-f,d[5]=d[5]-f,d},collide:function(u,c,d,f,h,v,m){var p=i(a(this.points,d+2*m,f,h)),g=i(a(this.crossLinePts(d,v),d+2*m,f,h));return mr(u,c,p)||mr(u,c,g)},draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),m=a(this.crossLinePts(c,h),c,d,f);e.arrowShapeImpl(this.name)(u,v,m)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return.525*s(u)}}),o("circle",{radius:.15,collide:function(u,c,d,f,h,v,m){var p=h;return Math.pow(p.x-u,2)+Math.pow(p.y-c,2)<=Math.pow((d+2*m)*this.radius,2)},draw:function(u,c,d,f,h){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){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(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return.95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})}},Tn={projectIntoViewport:function(r,e){var t=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],o=t.pan(),l=t.zoom();return[((r-a)/s-o.x)/l,((e-i)/s-o.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(g){return parseFloat(t.getPropertyValue(g))},a_left=n("padding-left"),a_right=n("padding-right"),a_top=n("padding-top"),a_bottom=n("padding-bottom"),i_left=n("border-left-width"),i_right=n("border-right-width"),i_top=n("border-top-width"),s=(n("border-bottom-width"),r.clientWidth);return this.containerBB=[e.left+a_left+i_left,e.top+a_top+i_top,s-(a_left+a_right),r.clientHeight-(a_top+a_bottom),e.width/(s+(i_left+i_right))]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]},findNearestElements:function(r,e,t,n){var v,m,a=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,h=1/0;function p(F,U){if(F.isNode()){if(m)return;m=F,o.push(F)}if(F.isEdge()&&(null==U||U<h))if(v){if(v.pstyle("z-compound-depth").value===F.pstyle("z-compound-depth").value&&v.pstyle("z-compound-depth").value===F.pstyle("z-compound-depth").value)for(var W=0;W<o.length;W++)if(o[W].isEdge()){o[W]=F,v=F,h=U??h;break}}else o.push(F),v=F,h=U??h}function g(F){var U=F.outerWidth()+2*d,W=F.outerHeight()+2*d,Z=U/2,K=W/2,J=F.position(),Q="auto"===F.pstyle("corner-radius").value?"auto":F.pstyle("corner-radius").pfValue,le=F._private.rscratch;if(J.x-Z<=r&&r<=J.x+Z&&J.y-K<=e&&e<=J.y+K&&i.nodeShapes[a.getNodeShape(F)].checkPoint(r,e,0,U,W,J.x,J.y,Q,le))return p(F,0),!0}function w(F){var de,U=F._private,W=U.rscratch,Z=F.pstyle("width").pfValue,K=F.pstyle("arrow-scale").value,J=Z/2+c,Q=J*J,le=2*J,ge=U.source,Se=U.target;if("segments"===W.edgeType||"straight"===W.edgeType||"haystack"===W.edgeType){for(var he=W.allpts,ue=0;ue+3<he.length;ue+=2)if(nv(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3],le)&&Q>(de=lv(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3])))return p(F,de),!0}else if("bezier"===W.edgeType||"multibezier"===W.edgeType||"self"===W.edgeType||"compound"===W.edgeType)for(he=W.allpts,ue=0;ue+5<W.allpts.length;ue+=4)if(av(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3],he[ue+4],he[ue+5],le)&&Q>(de=ov(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3],he[ue+4],he[ue+5])))return p(F,de),!0;ge=ge||U.source,Se=Se||U.target;var Le=a.getArrowWidth(Z,K),ye=[{name:"source",x:W.arrowStartX,y:W.arrowStartY,angle:W.srcArrowAngle},{name:"target",x:W.arrowEndX,y:W.arrowEndY,angle:W.tgtArrowAngle},{name:"mid-source",x:W.midX,y:W.midY,angle:W.midsrcArrowAngle},{name:"mid-target",x:W.midX,y:W.midY,angle:W.midtgtArrowAngle}];for(ue=0;ue<ye.length;ue++){var De=ye[ue],Ue=i.arrowShapes[F.pstyle(De.name+"-arrow-shape").value],$e=F.pstyle("width").pfValue;if(Ue.roughCollide(r,e,Le,De.angle,{x:De.x,y:De.y},$e,c)&&Ue.collide(r,e,Le,De.angle,{x:De.x,y:De.y},$e,c))return p(F),!0}u&&o.length>0&&(g(ge),g(Se))}function C(F,U,W){return vr(F,U,W)}function N(F,U){var K,W=F._private,Z=f;K=U?U+"-":"",F.boundingBox();var J=W.labelBounds[U||"main"],Q=F.pstyle(K+"label").value;if("yes"===F.pstyle("text-events").strValue&&Q){var de=C(W.rscratch,"labelX",U),he=C(W.rscratch,"labelY",U),ue=C(W.rscratch,"labelAngle",U),ge=F.pstyle(K+"text-margin-x").pfValue,Se=F.pstyle(K+"text-margin-y").pfValue,Le=J.x1-Z-ge,ye=J.x2+Z-ge,De=J.y1-Z-Se,Ue=J.y2+Z-Se;if(ue){var $e=Math.cos(ue),Xe=Math.sin(ue),Qe=function(ze,rt){return{x:(ze-=de)*$e-(rt-=he)*Xe+de,y:ze*Xe+rt*$e+he}},tt=Qe(Le,De),at=Qe(Le,Ue),He=Qe(ye,De),Te=Qe(ye,Ue);if(mr(r,e,[tt.x+ge,tt.y+Se,He.x+ge,He.y+Se,Te.x+ge,Te.y+Se,at.x+ge,at.y+Se]))return p(F),!0}else if(Qr(J,r,e))return p(F),!0}}t&&(s=s.interactive);for(var z=s.length-1;z>=0;z--){var V=s[z];V.isNode()?g(V)||N(V):w(V)||N(V)||N(V,"source")||N(V,"target")}return o},getAllInBox:function(r,e,t,n){var a=this.getCachedZSortedEles().interactive,s=2/this.cy.zoom(),o=[],l=Math.min(r,t),u=Math.max(r,t),c=Math.min(e,n),d=Math.max(e,n),f=gr({x1:r=l,y1:e=c,x2:t=u,y2:n=d}),h=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],v=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function m(ze,rt,ct){return vr(ze,rt,ct)}function p(ze,rt){var ct=ze._private,Nt=s;ze.boundingBox();var bt=ct.labelBounds.main;if(!bt)return null;var pt=m(ct.rscratch,"labelX",rt),ot=m(ct.rscratch,"labelY",rt),gt=m(ct.rscratch,"labelAngle",rt),ht=ze.pstyle("text-margin-x").pfValue,Tt=ze.pstyle("text-margin-y").pfValue,wt=bt.x1-Nt-ht,Lt=bt.x2+Nt-ht,Rt=bt.y1-Nt-Tt,Gt=bt.y2+Nt-Tt;if(gt){var Bt=Math.cos(gt),Pt=Math.sin(gt),je=function(be,Ae){return{x:(be-=pt)*Bt-(Ae-=ot)*Pt+pt,y:be*Pt+Ae*Bt+ot}};return[je(wt,Rt),je(Lt,Rt),je(Lt,Gt),je(wt,Gt)]}return[{x:wt,y:Rt},{x:Lt,y:Rt},{x:Lt,y:Gt},{x:wt,y:Gt}]}function g(ze,rt,ct,Nt){function Et(bt,pt,ot){return(ot.y-bt.y)*(pt.x-bt.x)>(pt.y-bt.y)*(ot.x-bt.x)}return Et(ze,ct,Nt)!==Et(rt,ct,Nt)&&Et(ze,rt,ct)!==Et(ze,rt,Nt)}for(var w=0;w<a.length;w++){var C=a[w];if(C.isNode()){var N=C,z="yes"===N.pstyle("text-events").strValue,V=N.pstyle("box-selection").strValue,F="yes"===N.pstyle("box-select-labels").strValue;if("none"===V)continue;var W=N.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:("overlap"===V||F)&&z});if("contain"===V){var Z=!1;if(F&&z){var K=p(N);K&&Cs(K,h)&&(o.push(N),Z=!0)}!Z&&ru(f,W)&&o.push(N)}else if("overlap"===V&&bs(f,W)){var J=N.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(Cs([{x:J.x1,y:J.y1},{x:J.x2,y:J.y1},{x:J.x2,y:J.y2},{x:J.x1,y:J.y2}],h))o.push(N);else{var le=p(N);le&&Cs(le,h)&&o.push(N)}}}else{var de=C,he=de._private,ue=he.rscratch,ge=de.pstyle("box-selection").strValue;if("none"===ge)continue;if("contain"===ge){if(null!=ue.startX&&null!=ue.startY&&!Qr(f,ue.startX,ue.startY)||null!=ue.endX&&null!=ue.endY&&!Qr(f,ue.endX,ue.endY))continue;if("bezier"===ue.edgeType||"multibezier"===ue.edgeType||"self"===ue.edgeType||"compound"===ue.edgeType||"segments"===ue.edgeType||"haystack"===ue.edgeType){for(var Se=he.rstyle.bezierPts||he.rstyle.linePts||he.rstyle.haystackPts,Le=!0,ye=0;ye<Se.length;ye++)if(!tu(f,Se[ye])){Le=!1;break}Le&&o.push(de)}else"straight"===ue.edgeType&&o.push(de)}else if("overlap"===ge){var De=!1;if(null!=ue.startX&&null!=ue.startY&&null!=ue.endX&&null!=ue.endY&&(Qr(f,ue.startX,ue.startY)||Qr(f,ue.endX,ue.endY)))o.push(de),De=!0;else if(!De&&"haystack"===ue.edgeType)for(var Ue=he.rstyle.haystackPts,$e=0;$e<Ue.length;$e++)if(tu(f,Ue[$e])){o.push(de),De=!0;break}if(!De){var Xe=he.rstyle.bezierPts||he.rstyle.linePts||he.rstyle.haystackPts;if((!Xe||Xe.length<2)&&"straight"===ue.edgeType&&null!=ue.startX&&null!=ue.startY&&null!=ue.endX&&null!=ue.endY&&(Xe=[{x:ue.startX,y:ue.startY},{x:ue.endX,y:ue.endY}]),!Xe||Xe.length<2)continue;for(var Qe=0;Qe<Xe.length-1;Qe++){for(var tt=Xe[Qe],at=Xe[Qe+1],He=0;He<v.length;He++){var Te=fe(v[He],2);if(g(tt,at,Te[0],Te[1])){o.push(de),De=!0;break}}if(De)break}}}}}return o}},Ri={calculateArrowAngles:function(r){var l,u,c,d,f,h,e=r._private.rscratch,t="haystack"===e.edgeType,n="bezier"===e.edgeType,a="multibezier"===e.edgeType,i="segments"===e.edgeType,s="compound"===e.edgeType,o="self"===e.edgeType;t?(c=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],h=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,h=e.arrowEndY),g=e.midX,w=e.midY,i?(l=c-e.segpts[0],u=d-e.segpts[1]):a||s||o||n?(l=c-tr((v=e.allpts)[0],v[2],v[4],.1),u=d-tr(v[1],v[3],v[5],.1)):(l=c-g,u=d-w),e.srcArrowAngle=Ja(l,u);var g=e.midX,w=e.midY;if(t&&(g=(c+f)/2,w=(d+h)/2),l=f-c,u=h-d,i)if((v=e.allpts).length/2%2==0)l=v[C=v.length/2]-v[N=C-2],u=v[C+1]-v[N+1];else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var N;l=v[C=v.length/2-1]-v[N=C-2],u=v[C+1]-v[N+1]}else if(a||s||o){var V,F,U,W,K,Z,J,v=e.allpts;e.ctrlpts.length/2%2==0?(V=tr(v[Z=v.length/2-1],v[K=Z+2],v[J=K+2],0),F=tr(v[Z+1],v[K+1],v[J+1],0),U=tr(v[Z],v[K],v[J],1e-4),W=tr(v[Z+1],v[K+1],v[J+1],1e-4)):(V=tr(v[Z=(K=v.length/2-1)-2],v[K],v[J=K+2],.4999),F=tr(v[Z+1],v[K+1],v[J+1],.4999),U=tr(v[Z],v[K],v[J],.5),W=tr(v[Z+1],v[K+1],v[J+1],.5)),l=U-V,u=W-F}if(e.midtgtArrowAngle=Ja(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i&&(v=e.allpts).length/2%2!=0&&!e.isRound){var C,Q=2+(C=v.length/2-1);l=-(v[Q]-v[C]),u=-(v[Q+1]-v[C+1])}if(e.midsrcArrowAngle=Ja(l,u),i)l=f-e.segpts[e.segpts.length-2],u=h-e.segpts[e.segpts.length-1];else if(a||s||o||n){var le=(v=e.allpts).length;l=f-tr(v[le-6],v[le-4],v[le-2],.9),u=h-tr(v[le-5],v[le-3],v[le-1],.9)}else l=f-g,u=h-w;e.tgtArrowAngle=Ja(l,u)}};Ri.getArrowWidth=Ri.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(13.37*r,.9),29)*e,t[r+", "+e]=n,n)};var Yo,Wo,Md,Cn,Mi,Yr,Dn,Sn,Fr,Jn,Oi,Od,Pd,qo,$o,kd,_r={},Cr={},Bd=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)};function _d(r,e){0===e.radius?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Ko(r,e,t,n){return 0===n||0===e.radius?{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}:(function(e,t,n,a,i){if(e!==kd?Bd(t,e,_r):function(e,t){t.x=-1*e.x,t.y=-1*e.y,t.nx=-1*e.nx,t.ny=-1*e.ny,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang}(Cr,_r),Bd(t,n,Cr),Md=_r.nx*Cr.nx-_r.ny*-Cr.ny,Yr=Math.asin(Math.max(-1,Math.min(1,_r.nx*Cr.ny-_r.ny*Cr.nx))),Math.abs(Yr)<1e-6)return Yo=t.x,Wo=t.y,void(Sn=Jn=0);Cn=1,Mi=!1,Md<0?Yr<0?Yr=Math.PI+Yr:(Yr=Math.PI-Yr,Cn=-1,Mi=!0):Yr>0&&(Cn=-1,Mi=!0),Jn=void 0!==t.radius?t.radius:a,Dn=Yr/2,Oi=Math.min(_r.len/2,Cr.len/2),i?(Fr=Math.abs(Math.cos(Dn)*Jn/Math.sin(Dn)))>Oi?(Fr=Oi,Sn=Math.abs(Fr*Math.sin(Dn)/Math.cos(Dn))):Sn=Jn:(Fr=Math.min(Oi,Jn),Sn=Math.abs(Fr*Math.sin(Dn)/Math.cos(Dn))),Yo=(qo=t.x+Cr.nx*Fr)-Cr.ny*Sn*Cn,Wo=($o=t.y+Cr.ny*Fr)+Cr.nx*Sn*Cn,Od=t.x+_r.nx*Fr,Pd=t.y+_r.ny*Fr,kd=t}(r,e,t,n,!(arguments.length>4&&void 0!==arguments[4])||arguments[4]),{cx:Yo,cy:Wo,radius:Sn,startX:Od,startY:Pd,stopX:qo,stopY:$o,startAngle:_r.ang+Math.PI/2*Cn,endAngle:Cr.ang-Math.PI/2*Cn,counterClockwise:Mi})}var Ly=Math.sqrt(.02),fr={};function Fd(r){var e=[];if(null!=r){for(var t=0;t<r.length;t+=2)e.push({x:r[t],y:r[t+1]});return e}}fr.findMidptPtsEtc=function(r,e){var i,W,Z,K,t=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),l=null!=s.units&&null!=o.units;switch(r.pstyle("edge-distances").value){case"node-position":i=t;break;case"intersection":i=n;break;case"endpoints":if(l){var f=fe(this.manualEndptToPx(r.source()[0],s),2),h=f[0],v=f[1],p=fe(this.manualEndptToPx(r.target()[0],o),2),g=p[0],w=p[1],C={x1:h,y1:v,x2:g,y2:w};Z=g-h,a={x:-(W=w-v)/(K=Math.sqrt(Z*Z+W*W)),y:Z/K},i=C}else _t("Edge ".concat(r.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}return{midptPts:i,vectorNormInverse:a}},fr.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],n=t._private,a=n.rscratch;if(!a.haystack){var i=2*Math.random()*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=2*Math.random()*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),c=s.width(),d=o.width(),f=s.height(),h=o.height(),m=t.pstyle("haystack-radius").value/2;a.haystackPts=a.allpts=[a.source.x*c*m+l.x,a.source.y*f*m+l.y,a.target.x*d*m+u.x,a.target.y*h*m+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}},fr.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),a=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),s=r.pstyle("radius-type"),o=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var c=0;c<o;c++){var d=n.pfValue[c],f=a.pfValue[c],h=1-d,v=d,m=this.findMidptPtsEtc(r,e),p=m.midptPts,g=m.vectorNormInverse,w={x:p.x1*h+p.x2*v,y:p.y1*h+p.y2*v};t.segpts.push(w.x+g.x*f,w.y+g.y*f),t.radii.push(void 0!==i.pfValue[c]?i.pfValue[c]:l),t.isArcRadius.push("arc-radius"===(void 0!==s.pfValue[c]?s.pfValue[c]:u))}},fr.findLoopPoints=function(r,e,t,n){var a=r._private.rscratch,i=e.dirCounts,s=e.srcPos,o=r.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=r.pstyle("loop-direction").pfValue,c=r.pstyle("loop-sweep").pfValue,d=r.pstyle("control-point-step-size").pfValue;a.edgeType="self";var f=t,h=d;n&&(f=0,h=l);var v=u-Math.PI/2,m=v-c/2,p=v+c/2,g=u+"_"+c;f=void 0===i[g]?i[g]=0:++i[g],a.ctrlpts=[s.x+1.4*Math.cos(m)*h*(f/3+1),s.y+1.4*Math.sin(m)*h*(f/3+1),s.x+1.4*Math.cos(p)*h*(f/3+1),s.y+1.4*Math.sin(p)*h*(f/3+1)]},fr.findCompoundLoopPoints=function(r,e,t,n){var a=r._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,f=r.pstyle("control-point-distances"),v=t,m=d;n&&(v=0,m=f?f.pfValue[0]:void 0);var g={x:i.x-o/2,y:i.y-l/2},w={x:s.x-u/2,y:s.y-c/2},C={x:Math.min(g.x,w.x),y:Math.min(g.y,w.y)},z=Math.max(.5,Math.log(.01*o)),V=Math.max(.5,Math.log(.01*u));a.ctrlpts=[C.x,C.y-(1+Math.pow(50,1.12)/100)*m*(v/3+1)*z,C.x-(1+Math.pow(50,1.12)/100)*m*(v/3+1)*V,C.y]},fr.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"},fr.findBezierPoints=function(r,e,t,n,a){var i=r._private.rscratch,s=r.pstyle("control-point-step-size").pfValue,o=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,c=o?o.pfValue[0]:void 0,d=l.value[0],f=n;i.edgeType=f?"multibezier":"bezier",i.ctrlpts=[];for(var h=0;h<u;h++){var m,v=(.5-e.eles.length/2+t)*s*(a?-1:1),p=ms(v);f&&(c=o?o.pfValue[h]:s,d=l.value[h]);var g=void 0!==(m=n?c:void 0!==c?p*c:void 0)?m:v,w=1-d,C=d,N=this.findMidptPtsEtc(r,e),z=N.midptPts,V=N.vectorNormInverse,F={x:z.x1*w+z.x2*C,y:z.y1*w+z.y2*C};i.ctrlpts.push(F.x+V.x*g,F.y+V.y*g)}},fr.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",o="downward",l="upward",c=e.posPts,d=e.srcW,f=e.srcH,h=e.tgtW,v=e.tgtH,p="node-position"!==r.pstyle("edge-distances").value,g=r.pstyle("taxi-direction").value,w=g,C=r.pstyle("taxi-turn"),N="%"===C.units,z=C.pfValue,V=z<0,F=r.pstyle("taxi-turn-min-distance").pfValue,W=p?(f+v)/2:0,Z=c.x2-c.x1,K=c.y2-c.y1,J=function(Ae,Fe){return Ae>0?Math.max(Ae-Fe,0):Math.min(Ae+Fe,0)},Q=J(Z,p?(d+h)/2:0),le=J(K,W),de=!1;"auto"===w?g=Math.abs(Q)>Math.abs(le)?a:n:w===l||w===o?(g=n,de=!0):(w===i||w===s)&&(g=a,de=!0);var ye,he=g===n,ue=he?le:Q,ge=he?K:Z,Se=ms(ge),Le=!1;(!de||!N&&!V)&&(w===o&&ge<0||w===l&&ge>0||w===i&&ge>0||w===s&&ge<0)&&(ue=(Se*=-1)*Math.abs(ue),Le=!0);var $e=function(Ae){return Math.abs(Ae)<F||Math.abs(Ae)>=Math.abs(ue)},Xe=$e(ye=N?(z<0?1+z:z)*ue:(z<0?ue:0)+z*Se),Qe=$e(Math.abs(ue)-Math.abs(ye));if(!Xe&&!Qe||Le)if(he){var wt=c.y1+ye+(p?f/2*Se:0);t.segpts=[c.x1,wt,c.x2,wt]}else{var Gt=c.x1+ye+(p?d/2*Se:0);t.segpts=[Gt,c.y1,Gt,c.y2]}else if(he){var at=Math.abs(ge)<=f/2,He=Math.abs(Z)<=h/2;if(at){var Te=(c.x1+c.x2)/2;t.segpts=[Te,c.y1,Te,c.y2]}else if(He){var ze=(c.y1+c.y2)/2;t.segpts=[c.x1,ze,c.x2,ze]}else t.segpts=[c.x1,c.y2]}else{var Nt=Math.abs(ge)<=d/2,Et=Math.abs(K)<=v/2;if(Nt){var bt=(c.y1+c.y2)/2;t.segpts=[c.x1,bt,c.x2,bt]}else if(Et){var gt=(c.x1+c.x2)/2;t.segpts=[gt,c.y1,gt,c.y2]}else t.segpts=[c.x2,c.y1]}if(t.isRound){var je=r.pstyle("taxi-radius").value,X="arc-radius"===r.pstyle("radius-type").value[0];t.radii=new Array(t.segpts.length/2).fill(je),t.isArcRadius=new Array(t.segpts.length/2).fill(X)}},fr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if("bezier"===t.edgeType){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,h=e.srcRs,v=e.tgtRs,m=!_e(t.startX)||!_e(t.startY),p=!_e(t.arrowStartX)||!_e(t.arrowStartY),g=!_e(t.endX)||!_e(t.endY),w=!_e(t.arrowEndX)||!_e(t.arrowEndY),z=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,V=mn({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),F=V<z,U=mn({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),W=U<z,Z=!1;if(m||p||F){Z=!0;var K={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},J=Math.sqrt(K.x*K.x+K.y*K.y),Q={x:K.x/J,y:K.y/J},le=Math.max(i,s),de={x:t.ctrlpts[0]+2*Q.x*le,y:t.ctrlpts[1]+2*Q.y*le},he=u.intersectLine(n.x,n.y,i,s,de.x,de.y,0,d,h);F?(t.ctrlpts[0]=t.ctrlpts[0]+Q.x*(z-V),t.ctrlpts[1]=t.ctrlpts[1]+Q.y*(z-V)):(t.ctrlpts[0]=he[0]+Q.x*z,t.ctrlpts[1]=he[1]+Q.y*z)}if(g||w||W){Z=!0;var ue={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},ge=Math.sqrt(ue.x*ue.x+ue.y*ue.y),Se={x:ue.x/ge,y:ue.y/ge},Le=Math.max(i,s),ye={x:t.ctrlpts[0]+2*Se.x*Le,y:t.ctrlpts[1]+2*Se.y*Le},De=c.intersectLine(a.x,a.y,o,l,ye.x,ye.y,0,f,v);W?(t.ctrlpts[0]=t.ctrlpts[0]+Se.x*(z-U),t.ctrlpts[1]=t.ctrlpts[1]+Se.y*(z-U)):(t.ctrlpts[0]=De[0]+Se.x*z,t.ctrlpts[1]=De[1]+Se.y*z)}Z&&this.findEndpoints(r)}},fr.storeAllpts=function(r){var e=r._private.rscratch;if("multibezier"===e.edgeType||"bezier"===e.edgeType||"self"===e.edgeType||"compound"===e.edgeType){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);var n;e.allpts.push(e.endX,e.endY),e.ctrlpts.length/2%2==0?(e.midX=e.allpts[n=e.allpts.length/2-1],e.midY=e.allpts[n+1]):(e.midX=tr(e.allpts[n=e.allpts.length/2-3],e.allpts[n+2],e.allpts[n+4],.5),e.midY=tr(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],.5))}else if("straight"===e.edgeType)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("segments"===e.edgeType){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];e.roundCorners.push(Ko({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,e.isArcRadius[i/2-1]))}}if(e.segpts.length%4==0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var c=e.segpts.length/2-1;if(e.isRound){var d={x:e.segpts[c],y:e.segpts[c+1]},f=e.roundCorners[c/2];if(0===f.radius){var h={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-h.y,h.x-d.x]}else{var v=[d.x-f.cx,d.y-f.cy],m=f.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(p){return p*m}),e.midX=f.cx+v[0],e.midY=f.cy+v[1],e.midVector=v}}else e.midX=e.segpts[c],e.midY=e.segpts[c+1]}}},fr.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||_e(e.startX)&&_e(e.startY)&&_e(e.endX)&&_e(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,_t("Edge `"+r.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."))},fr.findEdgeControlPoints=function(r){var e=this;if(r&&0!==r.length){for(var t=this,a=t.cy.hasCompoundNodes(),i=new Xr,s=function(W,Z){return[].concat(te(W),[Z?1:0]).join("-")},o=[],l=[],u=0;u<r.length;u++){var c=r[u],d=c._private,f=c.pstyle("curve-style").value;if(!c.removed()&&c.takesUpSpace()){if("haystack"===f){l.push(c);continue}var h="unbundled-bezier"===f||Kr(f,"segments")||"straight"===f||"straight-triangle"===f||Kr(f,"taxi"),v="unbundled-bezier"===f||"bezier"===f,p=d.target,C=[d.source.poolIndex(),p.poolIndex()].sort(),N=s(C,h),z=i.get(N);null==z&&(z={eles:[]},o.push({pairId:C,edgeIsUnbundled:h}),i.set(N,z)),z.eles.push(c),h&&(z.hasUnbundled=!0),v&&(z.hasBezier=!0)}}for(var V=function(){var le,W=o[F],J=s(W.pairId,W.edgeIsUnbundled),Q=i.get(J);if(!Q.hasUnbundled){var de=Q.eles[0].parallelEdges().filter(function(X){return X.isBundledBezier()});hs(Q.eles),de.forEach(function(X){return Q.eles.push(X)}),Q.eles.sort(function(X,be){return X.poolIndex()-be.poolIndex()})}var he=Q.eles[0],ue=he.source(),ge=he.target();if(ue.poolIndex()>ge.poolIndex()){var Se=ue;ue=ge,ge=Se}var Le=Q.srcPos=ue.position(),ye=Q.tgtPos=ge.position(),De=Q.srcW=ue.outerWidth(),Ue=Q.srcH=ue.outerHeight(),$e=Q.tgtW=ge.outerWidth(),Xe=Q.tgtH=ge.outerHeight(),Qe=Q.srcShape=t.nodeShapes[e.getNodeShape(ue)],tt=Q.tgtShape=t.nodeShapes[e.getNodeShape(ge)],at=Q.srcCornerRadius="auto"===ue.pstyle("corner-radius").value?"auto":ue.pstyle("corner-radius").pfValue,He=Q.tgtCornerRadius="auto"===ge.pstyle("corner-radius").value?"auto":ge.pstyle("corner-radius").pfValue,Te=Q.tgtRs=ge._private.rscratch,Ie=Q.srcRs=ue._private.rscratch;Q.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Pe=0;Pe<Q.eles.length;Pe++){var ze=Q.eles[Pe],rt=ze[0]._private.rscratch,ct=ze.pstyle("curve-style").value,Nt="unbundled-bezier"===ct||Kr(ct,"segments")||Kr(ct,"taxi"),Et=!ue.same(ze.source());if(!Q.calculatedIntersection&&ue!==ge&&(Q.hasBezier||Q.hasUnbundled)){Q.calculatedIntersection=!0;var bt=Qe.intersectLine(Le.x,Le.y,De,Ue,ye.x,ye.y,0,at,Ie),pt=Q.srcIntn=bt,ot=tt.intersectLine(ye.x,ye.y,$e,Xe,Le.x,Le.y,0,He,Te),gt=Q.tgtIntn=ot,ht=Q.intersectionPts={x1:bt[0],x2:ot[0],y1:bt[1],y2:ot[1]},Tt=Q.posPts={x1:Le.x,x2:ye.x,y1:Le.y,y2:ye.y},wt=ot[1]-bt[1],Lt=ot[0]-bt[0],Rt=Math.sqrt(Lt*Lt+wt*wt);_e(Rt)&&Rt>=Ly||(Rt=Math.sqrt(Math.max(Lt*Lt,.01)+Math.max(wt*wt,.01)));var Gt=Q.vector={x:Lt,y:wt},Bt=Q.vectorNorm={x:Gt.x/Rt,y:Gt.y/Rt},Pt={x:-Bt.y,y:Bt.x};Q.nodesOverlap=!_e(Rt)||tt.checkPoint(bt[0],bt[1],0,$e,Xe,ye.x,ye.y,He,Te)||Qe.checkPoint(ot[0],ot[1],0,De,Ue,Le.x,Le.y,at,Ie),Q.vectorNormInverse=Pt,le={nodesOverlap:Q.nodesOverlap,dirCounts:Q.dirCounts,calculatedIntersection:!0,hasBezier:Q.hasBezier,hasUnbundled:Q.hasUnbundled,eles:Q.eles,srcPos:ye,srcRs:Te,tgtPos:Le,tgtRs:Ie,srcW:$e,srcH:Xe,tgtW:De,tgtH:Ue,srcIntn:gt,tgtIntn:pt,srcShape:tt,tgtShape:Qe,posPts:{x1:Tt.x2,y1:Tt.y2,x2:Tt.x1,y2:Tt.y1},intersectionPts:{x1:ht.x2,y1:ht.y2,x2:ht.x1,y2:ht.y1},vector:{x:-Gt.x,y:-Gt.y},vectorNorm:{x:-Bt.x,y:-Bt.y},vectorNormInverse:{x:-Pt.x,y:-Pt.y}}}var je=Et?le:Q;rt.nodesOverlap=je.nodesOverlap,rt.srcIntn=je.srcIntn,rt.tgtIntn=je.tgtIntn,rt.isRound=ct.startsWith("round"),a&&(ue.isParent()||ue.isChild()||ge.isParent()||ge.isChild())&&(ue.parents().anySame(ge)||ge.parents().anySame(ue)||ue.same(ge)&&ue.isParent())?e.findCompoundLoopPoints(ze,je,Pe,Nt):ue===ge?e.findLoopPoints(ze,je,Pe,Nt):ct.endsWith("segments")?e.findSegmentsPoints(ze,je):ct.endsWith("taxi")?e.findTaxiPoints(ze,je):"straight"===ct||!Nt&&Q.eles.length%2==1&&Pe===Math.floor(Q.eles.length/2)?e.findStraightEdgePoints(ze):e.findBezierPoints(ze,je,Pe,Nt,Et),e.findEndpoints(ze),e.tryToCorrectInvalidPoints(ze,je),e.checkForInvalidEdgeWarning(ze),e.storeAllpts(ze),e.storeEdgeProjections(ze),e.calculateArrowAngles(ze),e.recalculateEdgeLabelProjections(ze),e.calculateLabelAngles(ze)}},F=0;F<o.length;F++)V();this.findHaystackPoints(l)}},fr.getSegmentPoints=function(r){var e=r[0]._private.rscratch;if(this.recalculateRenderedStyle(r),"segments"===e.edgeType)return Fd(e.segpts)},fr.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if("bezier"===t||"multibezier"===t||"self"===t||"compound"===t)return Fd(e.ctrlpts)},fr.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Ra={manualEndptToPx:function(r,e){var n=r.position(),a=r.outerWidth(),i=r.outerHeight(),s=r._private.rscratch;if(2===e.value.length){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}var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(a,i),c=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return this.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,"auto"===r.pstyle("corner-radius").value?"auto":r.pstyle("corner-radius").pfValue,s)},findEndpoints:function(r){var e,t,n,a,s,i=this,o=r.source()[0],l=r.target()[0],u=o.position(),c=l.position(),d=r.pstyle("target-arrow-shape").value,f=r.pstyle("source-arrow-shape").value,h=r.pstyle("target-distance-from-node").pfValue,v=r.pstyle("source-distance-from-node").pfValue,m=o._private.rscratch,p=l._private.rscratch,g=r.pstyle("curve-style").value,w=r._private.rscratch,C=w.edgeType,N=Kr(g,"taxi"),z="self"===C||"compound"===C,V="bezier"===C||"multibezier"===C||z,F="bezier"!==C,U="straight"===C||"segments"===C,W="segments"===C,Z=V||F||U,K=z||N,J=r.pstyle("source-endpoint"),Q=K?"outside-to-node":J.value,le="auto"===o.pstyle("corner-radius").value?"auto":o.pstyle("corner-radius").pfValue,de=r.pstyle("target-endpoint"),he=K?"outside-to-node":de.value,ue="auto"===l.pstyle("corner-radius").value?"auto":l.pstyle("corner-radius").pfValue;w.srcManEndpt=J,w.tgtManEndpt=de;var ge,Se,Le,ye,De=null!==(e=2===(null==de||null===(t=de.pfValue)||void 0===t?void 0:t.length)?de.pfValue:null)&&void 0!==e?e:[0,0],Ue=null!==(n=2===(null==J||null===(a=J.pfValue)||void 0===a?void 0:a.length)?J.pfValue:null)&&void 0!==n?n:[0,0];if(V){var $e=[w.ctrlpts[0],w.ctrlpts[1]];ge=F?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:$e,Se=$e}else if(U){var Qe=W?w.segpts.slice(0,2):[c.x+De[0],c.y+De[1]];ge=W?w.segpts.slice(w.segpts.length-2):[u.x+Ue[0],u.y+Ue[1]],Se=Qe}if("inside-to-node"===he)s=[c.x,c.y];else if(de.units)s=this.manualEndptToPx(l,de);else if("outside-to-line"===he)s=w.tgtIntn;else if("outside-to-node"===he||"outside-to-node-or-label"===he?Le=ge:("outside-to-line"===he||"outside-to-line-or-label"===he)&&(Le=[u.x,u.y]),s=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),Le[0],Le[1],0,ue,p),"outside-to-node-or-label"===he||"outside-to-line-or-label"===he){var at=l._private.rscratch,Ie=at.labelX,Pe=at.labelY,ze=at.labelWidth/2,rt=at.labelHeight/2,ct=l.pstyle("text-valign").value;"top"===(ct=Yn(ct))?Pe-=rt:"bottom"===ct&&(Pe+=rt);var Nt=l.pstyle("text-halign").value;"left"===(Nt=jn(Nt))?Ie-=ze:"right"===Nt&&(Ie+=ze);var Et=ya(Le[0],Le[1],[Ie-ze,Pe-rt,Ie+ze,Pe-rt,Ie+ze,Pe+rt,Ie-ze,Pe+rt],c.x,c.y);if(Et.length>0){var bt=u,pt=bn(bt,kn(s)),ot=bn(bt,kn(Et)),gt=pt;ot<pt&&(s=Et,gt=ot),Et.length>2&&bn(bt,{x:Et[2],y:Et[3]})<gt&&(s=[Et[2],Et[3]])}}var Tt=ni(s,ge,i.arrowShapes[d].spacing(r)+h),wt=ni(s,ge,i.arrowShapes[d].gap(r)+h);if(w.endX=wt[0],w.endY=wt[1],w.arrowEndX=Tt[0],w.arrowEndY=Tt[1],"inside-to-node"===Q)s=[u.x,u.y];else if(J.units)s=this.manualEndptToPx(o,J);else if("outside-to-line"===Q)s=w.srcIntn;else if("outside-to-node"===Q||"outside-to-node-or-label"===Q?ye=Se:("outside-to-line"===Q||"outside-to-line-or-label"===Q)&&(ye=[c.x,c.y]),s=i.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),ye[0],ye[1],0,le,m),"outside-to-node-or-label"===Q||"outside-to-line-or-label"===Q){var Lt=o._private.rscratch,Bt=Lt.labelX,Pt=Lt.labelY,je=Lt.labelWidth/2,X=Lt.labelHeight/2,be=o.pstyle("text-valign").value;"top"===(be=Yn(be))?Pt-=X:"bottom"===be&&(Pt+=X);var Ae=o.pstyle("text-halign").value;"left"===(Ae=jn(Ae))?Bt-=je:"right"===Ae&&(Bt+=je);var Fe=ya(ye[0],ye[1],[Bt-je,Pt-X,Bt+je,Pt-X,Bt+je,Pt+X,Bt-je,Pt+X],u.x,u.y);if(Fe.length>0){var Ve=c,dt=bn(Ve,kn(s)),Ke=bn(Ve,kn(Fe)),st=dt;Ke<dt&&(s=[Fe[0],Fe[1]],st=Ke),Fe.length>2&&bn(Ve,{x:Fe[2],y:Fe[3]})<st&&(s=[Fe[2],Fe[3]])}}var yt=ni(s,Se,i.arrowShapes[f].spacing(r)+v),Ct=ni(s,Se,i.arrowShapes[f].gap(r)+v);w.startX=Ct[0],w.startY=Ct[1],w.arrowStartX=yt[0],w.arrowStartY=yt[1],Z&&(w.badLine=!(_e(w.startX)&&_e(w.startY)&&_e(w.endX)&&_e(w.endY)))},getSourceEndpoint:function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),"haystack"===e.edgeType?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}},getTargetEndpoint:function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),"haystack"===e.edgeType?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}}},Zo={};function Ay(r,e,t){for(var n=function(u,c,d,f){return tr(u,c,d,f)},i=e._private.rstyle.bezierPts,s=0;s<r.bezierProjPcts.length;s++){var o=r.bezierProjPcts[s];i.push({x:n(t[0],t[2],t[4],o),y:n(t[1],t[3],t[5],o)})}}Zo.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,n=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,"multibezier"===n||"bezier"===n||"self"===n||"compound"===n){e.rstyle.bezierPts=[];for(var a=0;a+5<t.allpts.length;a+=4)Ay(this,r,t.allpts.slice(a,a+6))}else if("segments"===n){var i=e.rstyle.linePts=[];for(a=0;a+1<t.allpts.length;a+=2)i.push({x:t.allpts[a],y:t.allpts[a+1]})}else if("haystack"===n){var s=t.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth},Zo.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Gr={recalculateNodeLabelProjection:function(r){var e=r.pstyle("label").strValue;if(!Sr(e)){var t,n,a=r._private,i=r.width(),s=r.height(),o=r.padding(),l=r.position(),u=r.pstyle("text-halign").strValue,c=r.pstyle("text-valign").strValue,d=a.rscratch,f=a.rstyle;switch(u){case"left":t=l.x-i/2-o;break;case"left-inside":t=l.x-i/2+o;break;case"right":t=l.x+i/2+o;break;case"right-inside":t=l.x+i/2-o;break;default:t=l.x}switch(c){case"top":n=l.y-s/2-o;break;case"top-inside":n=l.y-s/2+o;break;case"bottom":n=l.y+s/2+o;break;case"bottom-inside":n=l.y+s/2-o;break;default:n=l.y}d.labelX=t,d.labelY=n,f.labelX=t,f.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}}},Gd=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},zd=function(e,t){return Gd(t.x-e.x,t.y-e.y)};Gr.recalculateEdgeLabelProjections=function(r){var e,t=r._private,n=t.rscratch,a=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(i.mid||i.source||i.target){var s=function(d,f,h){kr(t.rscratch,d,f,h),kr(t.rstyle,d,f,h)};s("labelX",null,(e={x:n.midX,y:n.midY}).x),s("labelY",null,e.y);var o=Gd(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4)d.push({p0:{x:n.allpts[f],y:n.allpts[f+1]},p1:{x:n.allpts[f+2],y:n.allpts[f+3]},p2:{x:n.allpts[f+4],y:n.allpts[f+5]},startDist:0,length:0,segments:[]});var p=t.rstyle.bezierPts,g=a.bezierProjPcts.length;function w(F,U,W,Z,K){var J=mn(U,W),Q=F.segments[F.segments.length-1];F.segments.push({p0:U,p1:W,t0:Z,t1:K,startDist:Q?Q.startDist+Q.length:0,length:J}),F.length+=J}for(var C=0;C<d.length;C++){var N=d[C],z=d[C-1];z&&(N.startDist=z.startDist+z.length),w(N,N.p0,p[C*g],0,a.bezierProjPcts[0]);for(var V=0;V<g-1;V++)w(N,p[C*g+V],p[C*g+V+1],a.bezierProjPcts[V],a.bezierProjPcts[V+1]);w(N,p[C*g+g-1],N.p2,a.bezierProjPcts[g-1],1)}return l.cache=d},u=function(d){var f,h="source"===d;if(i[d]){var v=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var p,m=l(),g=0,w=0,C=0;C<m.length;C++){for(var N=m[h?C:m.length-1-C],z=0;z<N.segments.length;z++){var V=N.segments[h?z:N.segments.length-1-z];if(g=w,(w+=V.length)>=v||C===m.length-1&&z===N.segments.length-1){p={cp:N,segment:V};break}}if(p)break}var U=p.cp,W=p.segment,Z=(v-g)/W.length,K=W.t1-W.t0,J=h?W.t0+K*Z:W.t1-K*Z;J=ga(0,J,1),e=Bn(U.p0,U.p1,U.p2,J),f=function(e,t,n,a){var i=ga(0,a-.001,1),s=ga(0,a+.001,1),o=Bn(e,t,n,i),l=Bn(e,t,n,s);return zd(o,l)}(U.p0,U.p1,U.p2,J);break;case"straight":case"segments":case"haystack":for(var le,de,he,ue,Q=0,ge=n.allpts.length,Se=0;Se+3<ge&&(h?(he={x:n.allpts[Se],y:n.allpts[Se+1]},ue={x:n.allpts[Se+2],y:n.allpts[Se+3]}):(he={x:n.allpts[ge-2-Se],y:n.allpts[ge-1-Se]},ue={x:n.allpts[ge-4-Se],y:n.allpts[ge-3-Se]}),de=Q,!((Q+=le=mn(he,ue))>=v));Se+=2);var ye=(v-de)/le;ye=ga(0,ye,1),e=function(e,t,n,a){var i_x=t.x-e.x,i_y=t.y-e.y,s=mn(e,t);return n=n??0,{x:e.x+i_x/s*(a=a??n*s),y:e.y+i_y/s*a}}(he,ue,ye),f=zd(he,ue)}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(r)}},Gr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))},Gr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=yn(n,r._private.labelDimsKey);if(vr(t.rscratch,"prefixedLabelDimsKey",e)!==a){kr(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),s=r.pstyle("line-height").pfValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("text-wrap").strValue,u=vr(t.rscratch,"labelWrapCachedLines",e)||[],c="wrap"!==l?1:Math.max(u.length,1),d=o*s,f=i.width,h=i.height+(c-1)*(s-1)*o;kr(t.rstyle,"labelWidth",e,f),kr(t.rscratch,"labelWidth",e,f),kr(t.rstyle,"labelHeight",e,h),kr(t.rscratch,"labelHeight",e,h),kr(t.rscratch,"labelLineHeight",e,d),kr(t.rscratch,"labelActualDescent",e,i.labelActualDescent)}},Gr.getLabelText=function(r,e){var t=r._private,a=r.pstyle((e?e+"-":"")+"label").strValue,i=r.pstyle("text-transform").value,s=function(Ue,$e){return $e?(kr(t.rscratch,Ue,e,$e),$e):vr(t.rscratch,Ue,e)};if(!a)return"";"none"==i||("uppercase"==i?a=a.toUpperCase():"lowercase"==i&&(a=a.toLowerCase()));var o=r.pstyle("text-wrap").value;if("wrap"===o){var l=s("labelKey");if(null!=l&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var c=a.split("\n"),d=r.pstyle("text-max-width").pfValue,h="anywhere"===r.pstyle("text-overflow-wrap").value,v=[],m=/[\s\u200b]+|$/g,p=0;p<c.length;p++){var g=c[p],C=this.calculateLabelDimensions(r,g).width;if(h){var N=g.split("").join("\u200b");g=N}if(C>d){var W,V="",F=0,U=H(g.matchAll(m));try{for(U.s();!(W=U.n()).done;){var Z=W.value,K=Z[0],J=g.substring(F,Z.index);F=Z.index+K.length,this.calculateLabelDimensions(r,0===V.length?J:V+J+K).width<=d?V+=J+K:(V&&v.push(V),V=J+K)}}catch(De){U.e(De)}finally{U.f()}V.match(/^[\s\u200b]+$/)||v.push(V)}else v.push(g)}s("labelWrapCachedLines",v),a=s("labelWrapCachedText",v.join("\n")),s("labelWrapKey",l)}else if("ellipsis"===o){var he=r.pstyle("text-max-width").pfValue,ue="",Se=!1;if(this.calculateLabelDimensions(r,a).width<he)return a;for(var Le=0;Le<a.length&&!(this.calculateLabelDimensions(r,ue+a[Le]+"\u2026").width>he);Le++)ue+=a[Le],Le===a.length-1&&(Se=!0);return Se||(ue+="\u2026"),ue}return a},Gr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return"auto"===e?r.isNode()?function(e){switch(e){case"left":case"right-inside":return"right";case"right":case"left-inside":return"left";default:return"center"}}(t):"center":e},Gr.calculateLabelDimensions=function(r,e){var a=this.cy.window().document,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,u=r.pstyle("font-weight").strValue,c=r.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=a.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var h=d.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var v=0,m=0,p=e.split("\n"),g=p.length,w=0,C=0,N=0;N<g;N++){var V=f.measureText(p[N]),F=Math.ceil(V.width),U=o;"glyph"===c&&(0===N&&(C=V.actualBoundingBoxAscent),N===g-1&&(w=V.actualBoundingBoxDescent)),v=Math.max(F,v),m+=U}return"glyph"===c&&(m-=o-C-w),{width:v+=0,height:m+=0,labelActualAscent:C,labelActualDescent:w}},Gr.calculateLabelAngle=function(r,e){var n=r._private.rscratch,a=r.isEdge(),s=r.pstyle((e?e+"-":"")+"text-rotation"),o=s.strValue;return"none"===o?0:a&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:s.pfValue},Gr.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private.rscratch;a.labelAngle=e.calculateLabelAngle(r),t&&(a.sourceLabelAngle=e.calculateLabelAngle(r,"source"),a.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var Vd={},Ud=!1;Vd.getNodeShape=function(r){var t=r.pstyle("shape").value;if("cutrectangle"===t&&(r.width()<28||r.height()<28))return Ud||(_t("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ud=!0),"rectangle";if(r.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=r.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var ki={updateCachedGrabbedEles:function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=(n=r[t])._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(t=0;t<e.length;t++){var n;r.drag.push(n=e[t])}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(nd),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e}},Xd={};[Tn,Ri,fr,Ra,Zo,Gr,Vd,{registerCalculationListeners:function(){var r=this.cy,e=r.collection(),t=this,n=function(s){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.merge(s),o)for(var l=0;l<s.length;l++){var d=s[l]._private.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(s){n(s.target)}).on("style.* background.*",function(s){n(s.target,!1)});var a=function(s){if(s){var o=t.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(n(u.connectedEdges()),c.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++)(0,o[d])(s,e);t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){a(!0)},t.beforeRender(a,t.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(r){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(r)},recalculateRenderedStyle:function(r,e){var t=function(N){return N._private.rstyle.cleanConnected};if(0!==r.length){var n=[],a=[];if(!this.destroyed){void 0===e&&(e=!0);for(var i=0;i<r.length;i++){var s=r[i],o=s._private,l=o.rstyle;s.isEdge()&&(!t(s.source())||!t(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(C){return!C._private.rstyle.clean&&C.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&"none"!==s.pstyle("display").value&&("nodes"===o.group?a.push(s):n.push(s),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],f=c._private.rstyle,h=c.position();this.recalculateNodeLabelProjection(c),f.nodeX=h.x,f.nodeY=h.y,f.nodeW=c.pstyle("width").pfValue,f.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var v=0;v<n.length;v++){var p=n[v]._private,g=p.rstyle,w=p.rscratch;g.srcX=w.arrowStartX,g.srcY=w.arrowStartY,g.tgtX=w.arrowEndX,g.tgtY=w.arrowEndY,g.midX=w.midX,g.midY=w.midY,g.labelAngle=w.labelAngle,g.sourceLabelAngle=w.sourceLabelAngle,g.targetLabelAngle=w.targetLabelAngle}}}}},ki].forEach(function(r){mt(Xd,r)});var jd={getCachedImage:function(r,e,t){var a=this.imageCache=this.imageCache||{},i=a[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;var s=(i=a[r]=a[r]||{}).image=new Image;s.addEventListener("load",t),s.addEventListener("error",function(){s.error=!0});return"data:"===r.substring(0,5).toLowerCase()||(s.crossOrigin=e="null"===e?null:e),s.src=r,s}},Yd=function(e,t){var n=e[0];!n||n._private.grabbed===t||(n._private.grabbed=t,e.updateStyle(!1))},Qn={registerBinding:function(r,e,t,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],s=0;s<r.length;s++){var o=r[s];if(void 0!==o){var l=this.binder(o);i.push(l.on.apply(l,a))}}return i}return(l=this.binder(r)).on.apply(l,a)},binder:function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||function(e){return!(typeof HTMLElement>"u")&&e instanceof HTMLElement}(r);if(null==e.supportsPassiveEvents){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});t.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(l,u,c){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:d}),(r.addEventListener||r.on).apply(r,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}},nodeIsDraggable:function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()},nodeIsGrabbable:function(r){return this.nodeIsDraggable(r)&&r.interactive()}};Qn.load=function(){var r=this,e=r.cy.window(),t=function(X){return X.selected()},a=function(X,be,Ae,Fe){null==X&&(X=r.cy);for(var Ve=0;Ve<be.length;Ve++)X.emit({originalEvent:Ae,type:be[Ve],position:Fe})},i=function(X){return X.shiftKey||X.metaKey||X.ctrlKey},s=function(X,be){var Ae=!0;if(r.cy.hasCompoundNodes()&&X&&X.pannable()){for(var Fe=0;be&&Fe<be.length;Fe++)if((X=be[Fe]).isNode()&&X.isParent()&&!X.pannable()){Ae=!1;break}}else Ae=!0;return Ae},o=function(X){X[0]._private.rscratch.inDragLayer=!0},u=function(X){X[0]._private.rscratch.isGrabTarget=!0},d=function(X,be){var Ae=be.addToList;!Ae.has(X)&&X.grabbable()&&!X.locked()&&(Ae.merge(X),function(e){Yd(e,!0)}(X))},h=function(X,be){be=be||{};var Ae=X.cy().hasCompoundNodes();be.inDragLayer&&(X.forEach(o),X.neighborhood().stdFilter(function(Fe){return!Ae||Fe.isEdge()}).forEach(o)),be.addToList&&X.forEach(function(Fe){d(Fe,be)}),function(X,be){if(X.cy().hasCompoundNodes()&&(null!=be.inDragLayer||null!=be.addToList)){var Ae=X.descendants();be.inDragLayer&&(Ae.forEach(o),Ae.connectedEdges().forEach(o)),be.addToList&&d(Ae,be)}}(X,be),p(X,{inDragLayer:be.inDragLayer}),r.updateCachedGrabbedEles()},v=h,m=function(X){X&&(r.getCachedZSortedEles().forEach(function(be){(function(e){Yd(e,!1)})(be),function(X){X[0]._private.rscratch.inDragLayer=!1}(be),function(X){X[0]._private.rscratch.isGrabTarget=!1}(be)}),r.updateCachedGrabbedEles())},p=function(X,be){if((null!=be.inDragLayer||null!=be.addToList)&&X.cy().hasCompoundNodes()){var Ae=X.ancestors().orphans();if(!Ae.same(X)){var Fe=Ae.descendants().spawnSelf().merge(Ae).unmerge(X).unmerge(X.descendants()),Ve=Fe.connectedEdges();be.inDragLayer&&(Ve.forEach(o),Fe.forEach(o)),be.addToList&&Fe.forEach(function(dt){d(dt,be)})}}},g=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(r.removeObserver=new MutationObserver(function(je){for(var X=0;X<je.length;X++){var Ae=je[X].removedNodes;if(Ae)for(var Fe=0;Fe<Ae.length;Fe++)if(Ae[Fe]===r.container){r.destroy();break}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(je){r.destroy()});var N=ca(function(){r.cy.resize()},100);w&&(r.styleObserver=new MutationObserver(N),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",N),C&&(r.resizeObserver=new ResizeObserver(N),r.resizeObserver.observe(r.container));var V=function(){r.invalidateContainerClientCoordsCache()};(function(X,be){for(;null!=X;)be(X),X=X.parentNode})(r.container,function(je){r.registerBinding(je,"transitionend",V),r.registerBinding(je,"animationend",V),r.registerBinding(je,"scroll",V)}),r.registerBinding(r.container,"contextmenu",function(je){je.preventDefault()});var U=function(X){for(var be=r.findContainerClientCoords(),Ae=be[0],Fe=be[1],Ve=be[2],dt=be[3],Ke=X.touches?X.touches:[X],st=!1,lt=0;lt<Ke.length;lt++){var yt=Ke[lt];if(Ae<=yt.clientX&&yt.clientX<=Ae+Ve&&Fe<=yt.clientY&&yt.clientY<=Fe+dt){st=!0;break}}if(!st)return!1;for(var Ct=r.container,ft=X.target.parentNode,At=!1;ft;){if(ft===Ct){At=!0;break}ft=ft.parentNode}return!!At};r.registerBinding(r.container,"mousedown",function(X){if(U(X)&&(1!==r.hoverData.which||1===X.which)){X.preventDefault(),g(),r.hoverData.capture=!0,r.hoverData.which=X.which;var be=r.cy,Ae=[X.clientX,X.clientY],Fe=r.projectIntoViewport(Ae[0],Ae[1]),Ve=r.selection,dt=r.findNearestElements(Fe[0],Fe[1],!0,!1),Ke=dt[0],st=r.dragData.possibleDragElements;r.hoverData.mdownPos=Fe,r.hoverData.mdownGPos=Ae;var lt=function(Mt){return{originalEvent:X,type:Mt,position:{x:Fe[0],y:Fe[1]}}};if(3==X.which){r.hoverData.cxtStarted=!0;var Ct={originalEvent:X,type:"cxttapstart",position:{x:Fe[0],y:Fe[1]}};Ke?(Ke.activate(),Ke.emit(Ct),r.hoverData.down=Ke):be.emit(Ct),r.hoverData.downTime=(new Date).getTime(),r.hoverData.cxtDragged=!1}else if(1==X.which){if(Ke&&Ke.activate(),null!=Ke&&r.nodeIsGrabbable(Ke)){if(u(Ke),Ke.selected()){st=r.dragData.possibleDragElements=be.collection();var ft=be.$(function(At){return At.isNode()&&At.selected()&&r.nodeIsGrabbable(At)});h(ft,{addToList:st}),Ke.emit(lt("grabon")),ft.forEach(function(Mt){Mt.emit(lt("grab"))})}else st=r.dragData.possibleDragElements=be.collection(),v(Ke,{addToList:st}),Ke.emit(lt("grabon")).emit(lt("grab"));r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Ke,r.hoverData.downs=dt,r.hoverData.downTime=(new Date).getTime(),a(Ke,["mousedown","tapstart","vmousedown"],X,{x:Fe[0],y:Fe[1]}),null==Ke?(Ve[4]=1,r.data.bgActivePosistion={x:Fe[0],y:Fe[1]},r.redrawHint("select",!0),r.redraw()):Ke.pannable()&&(Ve[4]=1),r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var Mt=r.hoverData.down;Mt?Mt.emit(lt("taphold")):be.emit(lt("taphold"))}},r.tapholdDuration)}Ve[0]=Ve[2]=Fe[0],Ve[1]=Ve[3]=Fe[1]}},!1);var Z,K,J,W=function(X){var be=X.getRootNode();if(be&&11===be.nodeType&&void 0!==be.host)return be}(r.container);r.registerBinding([e,W],"mousemove",function(X){var Dr;if(r.hoverData.capture||U(X)){var Ae=!1,Fe=r.cy,Ve=Fe.zoom(),dt=[X.clientX,X.clientY],Ke=r.projectIntoViewport(dt[0],dt[1]),st=r.hoverData.mdownPos,lt=r.hoverData.mdownGPos,yt=r.selection,Ct=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(Ct=r.findNearestElement(Ke[0],Ke[1],!0,!1));var ar,Dt=r.hoverData.last,ft=r.hoverData.down,At=[Ke[0]-yt[2],Ke[1]-yt[3]],Mt=r.dragData.possibleDragElements;if(lt){var Wt=dt[0]-lt[0],qt=dt[1]-lt[1];r.hoverData.isOverThresholdDrag=ar=Wt*Wt+qt*qt>=r.desktopTapThreshold2}var ur=i(X);ar&&(r.hoverData.tapholdCancelled=!0),Ae=!0,a(Ct,["mousemove","vmousemove","tapdrag"],X,{x:Ke[0],y:Ke[1]});var jt=function(Dr){return{originalEvent:X,type:Dr,position:{x:Ke[0],y:Ke[1]}}},$r=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||Fe.emit(jt("boxstart")),yt[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(3===r.hoverData.which){if(ar){var Rr=jt("cxtdrag");ft?ft.emit(Rr):Fe.emit(Rr),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ct!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(jt("cxtdragout")),r.hoverData.cxtOver=Ct,Ct&&Ct.emit(jt("cxtdragover")))}}else if(r.hoverData.dragging){if(Ae=!0,Fe.panningEnabled()&&Fe.userPanningEnabled()){var vn;if(r.hoverData.justStartedPan){var ji=r.hoverData.mdownPos;vn={x:(Ke[0]-ji[0])*Ve,y:(Ke[1]-ji[1])*Ve},r.hoverData.justStartedPan=!1}else vn={x:At[0]*Ve,y:At[1]*Ve};Fe.panBy(vn),Fe.emit(jt("dragpan")),r.hoverData.dragged=!0}Ke=r.projectIntoViewport(X.clientX,X.clientY)}else if(1!=yt[4]||null!=ft&&!ft.pannable()){if(ft&&ft.pannable()&&ft.active()&&ft.unactivate(),(!ft||!ft.grabbed())&&Ct!=Dt&&(Dt&&a(Dt,["mouseout","tapdragout"],X,{x:Ke[0],y:Ke[1]}),Ct&&a(Ct,["mouseover","tapdragover"],X,{x:Ke[0],y:Ke[1]}),r.hoverData.last=Ct),ft)if(ar){if(Fe.boxSelectionEnabled()&&ur)ft&&ft.grabbed()&&(m(Mt),ft.emit(jt("freeon")),Mt.emit(jt("free")),r.dragData.didDrag&&(ft.emit(jt("dragfreeon")),Mt.emit(jt("dragfree")))),$r();else if(ft&&ft.grabbed()&&r.nodeIsDraggable(ft)){var br=!r.dragData.didDrag;br&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||h(Mt,{inDragLayer:!0});var hr={x:0,y:0};if(_e(At[0])&&_e(At[1])&&(hr.x+=At[0],hr.y+=At[1],br)){var wr=r.hoverData.dragDelta;wr&&_e(wr[0])&&_e(wr[1])&&(hr.x+=wr[0],hr.y+=wr[1])}r.hoverData.draggingEles=!0,Mt.silentShift(hr).emit(jt("position")).emit(jt("drag")),r.redrawHint("drag",!0),r.redraw()}}else 0===(Dr=r.hoverData.dragDelta=r.hoverData.dragDelta||[]).length?(Dr.push(At[0]),Dr.push(At[1])):(Dr[0]+=At[0],Dr[1]+=At[1]);Ae=!0}else ar&&(r.hoverData.dragging||!Fe.boxSelectionEnabled()||!ur&&Fe.panningEnabled()&&Fe.userPanningEnabled()?!r.hoverData.selecting&&Fe.panningEnabled()&&Fe.userPanningEnabled()&&s(ft,r.hoverData.downs)&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,yt[4]=0,r.data.bgActivePosistion=kn(st),r.redrawHint("select",!0),r.redraw()):$r(),ft&&ft.pannable()&&ft.active()&&ft.unactivate());if(yt[2]=Ke[0],yt[3]=Ke[1],Ae)return X.stopPropagation&&X.stopPropagation(),X.preventDefault&&X.preventDefault(),!1}},!1),r.registerBinding(e,"mouseup",function(X){if((1!==r.hoverData.which||1===X.which||!r.hoverData.capture)&&r.hoverData.capture){r.hoverData.capture=!1;var Ae=r.cy,Fe=r.projectIntoViewport(X.clientX,X.clientY),Ve=r.selection,dt=r.findNearestElement(Fe[0],Fe[1],!0,!1),Ke=r.dragData.possibleDragElements,st=r.hoverData.down,lt=i(X);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,st&&st.unactivate();var yt=function(Wt){return{originalEvent:X,type:Wt,position:{x:Fe[0],y:Fe[1]}}};if(3===r.hoverData.which){var Ct=yt("cxttapend");if(st?st.emit(Ct):Ae.emit(Ct),!r.hoverData.cxtDragged){var Dt=yt("cxttap");st?st.emit(Dt):Ae.emit(Dt)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(1===r.hoverData.which){if(a(dt,["mouseup","tapend","vmouseup"],X,{x:Fe[0],y:Fe[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(st,["click","tap","vclick"],X,{x:Fe[0],y:Fe[1]}),K=!1,X.timeStamp-J<=Ae.multiClickDebounceTime()?(Z&&clearTimeout(Z),K=!0,J=null,a(st,["dblclick","dbltap","vdblclick"],X,{x:Fe[0],y:Fe[1]})):(Z=setTimeout(function(){K||a(st,["oneclick","onetap","voneclick"],X,{x:Fe[0],y:Fe[1]})},Ae.multiClickDebounceTime()),J=X.timeStamp)),null==st&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(X)&&(Ae.$(t).unselect(["tapunselect"]),Ke.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Ke=Ae.collection()),dt==st&&!r.dragData.didDrag&&!r.hoverData.selecting&&null!=dt&&dt._private.selectable&&(r.hoverData.dragging||("additive"===Ae.selectionType()||lt?dt.selected()?dt.unselect(["tapunselect"]):dt.select(["tapselect"]):lt||(Ae.$(t).unmerge(dt).unselect(["tapunselect"]),dt.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var ft=Ae.collection(r.getAllInBox(Ve[0],Ve[1],Ve[2],Ve[3]));r.redrawHint("select",!0),ft.length>0&&r.redrawHint("eles",!0),Ae.emit(yt("boxend")),"additive"===Ae.selectionType()||lt||Ae.$(t).unmerge(ft).unselect(),ft.emit(yt("box")).stdFilter(function(Wt){return Wt.selectable()&&!Wt.selected()}).select().emit(yt("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!Ve[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Mt=st&&st.grabbed();m(Ke),Mt&&(st.emit(yt("freeon")),Ke.emit(yt("free")),r.dragData.didDrag&&(st.emit(yt("dragfreeon")),Ke.emit(yt("dragfree"))))}}Ve[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}},!1);var de,Q=[],he=1e5,Se=function(X){var be=!1,Ae=X.deltaY;if(null==Ae&&(null!=X.wheelDeltaY?Ae=X.wheelDeltaY/4:null!=X.wheelDelta&&(Ae=X.wheelDelta/4)),0!==Ae){if(null==de)if(Q.length>=4){var Fe=Q;if(de=function(X){for(var Ae=0;Ae<X.length;Ae++)if(X[Ae]%5!=0)return!1;return!0}(Fe),!de){var Ve=Math.abs(Fe[0]);de=function(X){for(var be=Math.abs(X[0]),Ae=1;Ae<X.length;Ae++)if(Math.abs(X[Ae])!==be)return!1;return!0}(Fe)&&Ve>5}if(de)for(var dt=0;dt<Fe.length;dt++)he=Math.min(Math.abs(Fe[dt]),he)}else Q.push(Ae),be=!0;else de&&(he=Math.min(Math.abs(Ae),he));if(!r.scrollingPage){var Ke=r.cy,st=Ke.zoom(),lt=Ke.pan(),yt=r.projectIntoViewport(X.clientX,X.clientY),Ct=[yt[0]*st+lt.x,yt[1]*st+lt.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||0!==r.selection[4])return void X.preventDefault();if(Ke.panningEnabled()&&Ke.userPanningEnabled()&&Ke.zoomingEnabled()&&Ke.userZoomingEnabled()){var Dt;X.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150),be&&Math.abs(Ae)>5&&(Ae=5*ms(Ae)),Dt=Ae/-250,de&&(Dt/=he,Dt*=3),Dt*=r.wheelSensitivity,1===X.deltaMode&&(Dt*=33);var At=Ke.zoom()*Math.pow(10,Dt);"gesturechange"===X.type&&(At=r.gestureStartZoom*X.scale),Ke.zoom({level:At,renderedPosition:{x:Ct[0],y:Ct[1]}}),Ke.emit({type:"gesturechange"===X.type?"pinchzoom":"scrollzoom",originalEvent:X,position:{x:yt[0],y:yt[1]}})}}}};r.registerBinding(r.container,"wheel",Se,!0),r.registerBinding(e,"scroll",function(X){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(X){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||X.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(je){r.hasTouchStarted||Se(je)},!0),r.registerBinding(r.container,"mouseout",function(X){var be=r.projectIntoViewport(X.clientX,X.clientY);r.cy.emit({originalEvent:X,type:"mouseout",position:{x:be[0],y:be[1]}})},!1),r.registerBinding(r.container,"mouseover",function(X){var be=r.projectIntoViewport(X.clientX,X.clientY);r.cy.emit({originalEvent:X,type:"mouseover",position:{x:be[0],y:be[1]}})},!1);var Le,ye,De,Ue,$e,Xe,Qe,tt,at,He,Te,Ie,Pe,ct,Nt,Et,bt,pt,ot,gt,ze=function(X,be,Ae,Fe){return Math.sqrt((Ae-X)*(Ae-X)+(Fe-be)*(Fe-be))},rt=function(X,be,Ae,Fe){return(Ae-X)*(Ae-X)+(Fe-be)*(Fe-be)};if(r.registerBinding(r.container,"touchstart",ct=function(X){if(r.hasTouchStarted=!0,U(X)){g(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var be=r.cy,Ae=r.touchData.now,Fe=r.touchData.earlier;if(X.touches[0]){var Ve=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY);Ae[0]=Ve[0],Ae[1]=Ve[1]}X.touches[1]&&(Ve=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ae[2]=Ve[0],Ae[3]=Ve[1]),X.touches[2]&&(Ve=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ae[4]=Ve[0],Ae[5]=Ve[1]);var dt=function(ur){return{originalEvent:X,type:ur,position:{x:Ae[0],y:Ae[1]}}};if(X.touches[1]){r.touchData.singleTouchMoved=!0,m(r.dragData.touchDragEles);var Ke=r.findContainerClientCoords();Te=Ke[2],Ie=Ke[3],ye=X.touches[0].clientY-(He=Ke[1]),De=X.touches[1].clientX-(at=Ke[0]),Ue=X.touches[1].clientY-He,Pe=0<=(Le=X.touches[0].clientX-at)&&Le<=Te&&0<=De&&De<=Te&&0<=ye&&ye<=Ie&&0<=Ue&&Ue<=Ie;var st=be.pan(),lt=be.zoom();if($e=ze(Le,ye,De,Ue),Xe=rt(Le,ye,De,Ue),tt=[((Qe=[(Le+De)/2,(ye+Ue)/2])[0]-st.x)/lt,(Qe[1]-st.y)/lt],Xe<4e4&&!X.touches[2]){var Dt=r.findNearestElement(Ae[0],Ae[1],!0,!0),ft=r.findNearestElement(Ae[2],Ae[3],!0,!0);return Dt&&Dt.isNode()?(Dt.activate().emit(dt("cxttapstart")),r.touchData.start=Dt):ft&&ft.isNode()?(ft.activate().emit(dt("cxttapstart")),r.touchData.start=ft):be.emit(dt("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,void r.redraw()}}if(X.touches[2])be.boxSelectionEnabled()&&X.preventDefault();else if(!X.touches[1]&&X.touches[0]){var At=r.findNearestElements(Ae[0],Ae[1],!0,!0),Mt=At[0];if(null!=Mt&&(Mt.activate(),r.touchData.start=Mt,r.touchData.starts=At,r.nodeIsGrabbable(Mt))){var ar=r.dragData.touchDragEles=be.collection(),Wt=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),Mt.selected()?(Wt=be.$(function(er){return er.selected()&&r.nodeIsGrabbable(er)}),h(Wt,{addToList:ar})):v(Mt,{addToList:ar}),u(Mt),Mt.emit(dt("grabon")),Wt?Wt.forEach(function(er){er.emit(dt("grab"))}):Mt.emit(dt("grab"))}a(Mt,["touchstart","tapstart","vmousedown"],X,{x:Ae[0],y:Ae[1]}),null==Mt&&(r.data.bgActivePosistion={x:Ve[0],y:Ve[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){!1===r.touchData.singleTouchMoved&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],X,{x:Ae[0],y:Ae[1]})},r.tapholdDuration)}if(X.touches.length>=1){for(var Nr=r.touchData.startPosition=[null,null,null,null,null,null],qt=0;qt<Ae.length;qt++)Nr[qt]=Fe[qt]=Ae[qt];var Zt=X.touches[0];r.touchData.startGPosition=[Zt.clientX,Zt.clientY]}}},!1),r.registerBinding(e,"touchmove",Nt=function(X){var be=r.touchData.capture;if(be||U(X)){var Ae=r.selection,Fe=r.cy,Ve=r.touchData.now,dt=r.touchData.earlier,Ke=Fe.zoom();if(X.touches[0]){var st=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY);Ve[0]=st[0],Ve[1]=st[1]}X.touches[1]&&(st=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ve[2]=st[0],Ve[3]=st[1]),X.touches[2]&&(st=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ve[4]=st[0],Ve[5]=st[1]);var Ct,lt=function(H0){return{originalEvent:X,type:H0,position:{x:Ve[0],y:Ve[1]}}},yt=r.touchData.startGPosition;if(be&&X.touches[0]&&yt){for(var Dt=[],ft=0;ft<Ve.length;ft++)Dt[ft]=Ve[ft]-dt[ft];var At=X.touches[0].clientX-yt[0],ar=X.touches[0].clientY-yt[1];Ct=At*At+ar*ar>=r.touchTapThreshold2}if(be&&r.touchData.cxt){X.preventDefault();var Hr=rt(qt=X.touches[0].clientX-at,Zt=X.touches[0].clientY-He,er=X.touches[1].clientX-at,ur=X.touches[1].clientY-He);if(Hr/Xe>=2.25||Hr>=22500){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Rn=lt("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(Rn),r.touchData.start=null):Fe.emit(Rn)}}if(be&&r.touchData.cxt){Rn=lt("cxtdrag"),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Rn):Fe.emit(Rn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var br=r.findNearestElement(Ve[0],Ve[1],!0,!0);(!r.touchData.cxtOver||br!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(lt("cxtdragout")),r.touchData.cxtOver=br,br&&br.emit(lt("cxtdragover")))}else if(be&&X.touches[2]&&Fe.boxSelectionEnabled())X.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||Fe.emit(lt("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,Ae[4]=1,Ae&&0!==Ae.length&&void 0!==Ae[0]?(Ae[2]=(Ve[0]+Ve[2]+Ve[4])/3,Ae[3]=(Ve[1]+Ve[3]+Ve[5])/3):(Ae[0]=(Ve[0]+Ve[2]+Ve[4])/3,Ae[1]=(Ve[1]+Ve[3]+Ve[5])/3,Ae[2]=(Ve[0]+Ve[2]+Ve[4])/3+1,Ae[3]=(Ve[1]+Ve[3]+Ve[5])/3+1),r.redrawHint("select",!0),r.redraw();else if(be&&X.touches[1]&&!r.touchData.didSelect&&Fe.zoomingEnabled()&&Fe.panningEnabled()&&Fe.userZoomingEnabled()&&Fe.userPanningEnabled()){if(X.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),hr=r.dragData.touchDragEles){r.redrawHint("drag",!0);for(var wr=0;wr<hr.length;wr++){var za=hr[wr]._private;za.grabbed=!1,za.rscratch.inDragLayer=!1}}var qt,Zt,er,ur,Dr=r.touchData.start,Bf=ze(qt=X.touches[0].clientX-at,Zt=X.touches[0].clientY-He,er=X.touches[1].clientX-at,ur=X.touches[1].clientY-He),O0=Bf/$e;if(Pe){var F0=(qt-Le+(er-De))/2,G0=(Zt-ye+(ur-Ue))/2,Va=Fe.zoom(),gl=Va*O0,Yi=Fe.pan(),_f=tt[0]*Va+Yi.x,Ff=tt[1]*Va+Yi.y,z0={x:-gl/Va*(_f-Yi.x-F0)+_f,y:-gl/Va*(Ff-Yi.y-G0)+Ff};Dr&&Dr.active()&&(m(hr=r.dragData.touchDragEles),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Dr.unactivate().emit(lt("freeon")),hr.emit(lt("free")),r.dragData.didDrag&&(Dr.emit(lt("dragfreeon")),hr.emit(lt("dragfree")))),Fe.viewport({zoom:gl,pan:z0,cancelOnFailedZoom:!0}),Fe.emit(lt("pinchzoom")),$e=Bf,Le=qt,ye=Zt,De=er,Ue=ur,r.pinching=!0}X.touches[0]&&(st=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY),Ve[0]=st[0],Ve[1]=st[1]),X.touches[1]&&(st=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ve[2]=st[0],Ve[3]=st[1]),X.touches[2]&&(st=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ve[4]=st[0],Ve[5]=st[1])}else if(X.touches[0]&&!r.touchData.didSelect){var Mr=r.touchData.start,pl=r.touchData.last;if(!r.hoverData.draggingEles&&!r.swipePanning&&(br=r.findNearestElement(Ve[0],Ve[1],!0,!0)),be&&null!=Mr&&X.preventDefault(),be&&null!=Mr&&r.nodeIsDraggable(Mr))if(Ct){var hr=r.dragData.touchDragEles,Gf=!r.dragData.didDrag;Gf&&h(hr,{inDragLayer:!0}),r.dragData.didDrag=!0;var Ha={x:0,y:0};_e(Dt[0])&&_e(Dt[1])&&(Ha.x+=Dt[0],Ha.y+=Dt[1],Gf)&&(r.redrawHint("eles",!0),(Or=r.touchData.dragDelta)&&_e(Or[0])&&_e(Or[1])&&(Ha.x+=Or[0],Ha.y+=Or[1])),r.hoverData.draggingEles=!0,hr.silentShift(Ha).emit(lt("position")).emit(lt("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==dt[0]&&r.touchData.startPosition[1]==dt[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Or;0===(Or=r.touchData.dragDelta=r.touchData.dragDelta||[]).length?(Or.push(Dt[0]),Or.push(Dt[1])):(Or[0]+=Dt[0],Or[1]+=Dt[1])}if(a(Mr||br,["touchmove","tapdrag","vmousemove"],X,{x:Ve[0],y:Ve[1]}),(!Mr||!Mr.grabbed())&&br!=pl&&(pl&&pl.emit(lt("tapdragout")),br&&br.emit(lt("tapdragover"))),r.touchData.last=br,be)for(wr=0;wr<Ve.length;wr++)Ve[wr]&&r.touchData.startPosition[wr]&&Ct&&(r.touchData.singleTouchMoved=!0);be&&(null==Mr||Mr.pannable())&&Fe.panningEnabled()&&Fe.userPanningEnabled()&&(s(Mr,r.touchData.starts)&&(X.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=kn(r.touchData.startPosition)),r.swipePanning?(Fe.panBy({x:Dt[0]*Ke,y:Dt[1]*Ke}),Fe.emit(lt("dragpan"))):Ct&&(r.swipePanning=!0,Fe.panBy({x:At*Ke,y:ar*Ke}),Fe.emit(lt("dragpan")),Mr&&(Mr.unactivate(),r.redrawHint("select",!0),r.touchData.start=null))),st=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY),Ve[0]=st[0],Ve[1]=st[1])}for(ft=0;ft<Ve.length;ft++)dt[ft]=Ve[ft];be&&X.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&null!=r.data.bgActivePosistion&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1),r.registerBinding(e,"touchcancel",Et=function(X){var be=r.touchData.start;r.touchData.capture=!1,be&&be.unactivate()}),r.registerBinding(e,"touchend",bt=function(X){var be=r.touchData.start;if(r.touchData.capture){0===X.touches.length&&(r.touchData.capture=!1),X.preventDefault();var Fe=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var Ve=r.cy,dt=Ve.zoom(),Ke=r.touchData.now,st=r.touchData.earlier;if(X.touches[0]){var lt=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY);Ke[0]=lt[0],Ke[1]=lt[1]}X.touches[1]&&(lt=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ke[2]=lt[0],Ke[3]=lt[1]),X.touches[2]&&(lt=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ke[4]=lt[0],Ke[5]=lt[1]);var Ct,yt=function(Rr){return{originalEvent:X,type:Rr,position:{x:Ke[0],y:Ke[1]}}};if(be&&be.unactivate(),r.touchData.cxt){if(Ct=yt("cxttapend"),be?be.emit(Ct):Ve.emit(Ct),!r.touchData.cxtDragged){var Dt=yt("cxttap");be?be.emit(Dt):Ve.emit(Dt)}return r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,void r.redraw()}if(!X.touches[2]&&Ve.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var ft=Ve.collection(r.getAllInBox(Fe[0],Fe[1],Fe[2],Fe[3]));Fe[0]=void 0,Fe[1]=void 0,Fe[2]=void 0,Fe[3]=void 0,Fe[4]=0,r.redrawHint("select",!0),Ve.emit(yt("boxend")),ft.emit(yt("box")).stdFilter(function(Rr){return Rr.selectable()&&!Rr.selected()}).select().emit(yt("boxselect")),ft.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(be?.unactivate(),X.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!X.touches[1]&&!X.touches[0]&&!X.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Mt=r.dragData.touchDragEles;if(null!=be){var ar=be._private.grabbed;m(Mt),r.redrawHint("drag",!0),r.redrawHint("eles",!0),ar&&(be.emit(yt("freeon")),Mt.emit(yt("free")),r.dragData.didDrag&&(be.emit(yt("dragfreeon")),Mt.emit(yt("dragfree")))),a(be,["touchend","tapend","vmouseup","tapdragout"],X,{x:Ke[0],y:Ke[1]}),be.unactivate(),r.touchData.start=null}else{var Wt=r.findNearestElement(Ke[0],Ke[1],!0,!0);a(Wt,["touchend","tapend","vmouseup","tapdragout"],X,{x:Ke[0],y:Ke[1]})}var Nr=r.touchData.startPosition[0]-Ke[0],Zt=r.touchData.startPosition[1]-Ke[1],Hr=(Nr*Nr+Zt*Zt)*dt*dt;r.touchData.singleTouchMoved||(be||Ve.$(":selected").unselect(["tapunselect"]),a(be,["tap","vclick"],X,{x:Ke[0],y:Ke[1]}),pt=!1,X.timeStamp-gt<=Ve.multiClickDebounceTime()?(ot&&clearTimeout(ot),pt=!0,gt=null,a(be,["dbltap","vdblclick"],X,{x:Ke[0],y:Ke[1]})):(ot=setTimeout(function(){pt||a(be,["onetap","voneclick"],X,{x:Ke[0],y:Ke[1]})},Ve.multiClickDebounceTime()),gt=X.timeStamp)),null!=be&&!r.dragData.didDrag&&be._private.selectable&&Hr<r.touchTapThreshold2&&!r.pinching&&("single"===Ve.selectionType()?(Ve.$(t).unmerge(be).unselect(["tapunselect"]),be.select(["tapselect"])):be.selected()?be.unselect(["tapunselect"]):be.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}for(var jt=0;jt<Ke.length;jt++)st[jt]=Ke[jt];r.dragData.didDrag=!1,0===X.touches.length&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),X.touches.length<2&&(1===X.touches.length&&(r.touchData.startGPosition=[X.touches[0].clientX,X.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())}},!1),typeof TouchEvent>"u"){var ht=[],Tt=function(X){return{clientX:X.clientX,clientY:X.clientY,force:1,identifier:X.pointerId,pageX:X.pageX,pageY:X.pageY,radiusX:X.width/2,radiusY:X.height/2,screenX:X.screenX,screenY:X.screenY,target:X.target}},Rt=function(X){for(var be=0;be<ht.length;be++)if(ht[be].event.pointerId===X.pointerId)return void ht.splice(be,1)},Bt=function(X){X.touches=ht.map(function(be){return be.touch})},Pt=function(X){return"mouse"===X.pointerType||4===X.pointerType};r.registerBinding(r.container,"pointerdown",function(je){Pt(je)||(je.preventDefault(),ht.push(function(X){return{event:X,touch:Tt(X)}}(je)),Bt(je),ct(je))}),r.registerBinding(r.container,"pointerup",function(je){Pt(je)||(Rt(je),Bt(je),bt(je))}),r.registerBinding(r.container,"pointercancel",function(je){Pt(je)||(Rt(je),Bt(je),Et())}),r.registerBinding(r.container,"pointermove",function(je){var X,be;Pt(je)||(je.preventDefault(),X=je,(be=ht.filter(function(Ae){return Ae.event.pointerId===X.pointerId})[0]).event=X,be.touch=Tt(X),Bt(je),Nt(je))})}};var Wr={generatePolygon:function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,a,i,s,o,l){this.renderer.nodeShapeImpl("polygon",n,a,i,s,o,this.points)},intersectLine:function(n,a,i,s,o,l,u,c){return ya(o,l,this.points,n,a,i/2,s/2,u)},checkPoint:function(n,a,i,s,o,l,u,c){return jr(n,a,this.points,l,u,s,o,[0,-1],i)},hasMiterBounds:"rectangle"!==r,miterBounds:function(n,a,i,s,o,l){return function rv(r,e,t,n,a,i){var o=function tv(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(U,W){return{x:U.x+W.x,y:U.y+W.y}},n=function(U,W){return{x:U.x-W.x,y:U.y-W.y}},a=function(U,W){return{x:U.x*W,y:U.y*W}},i=function(U,W){return U.x*W.y-U.y*W.x},s=function(U){var W=ev(U.x,U.y);return 0===W?{x:0,y:0}:{x:U.x/W,y:U.y/W}},l=function(U,W,Z,K){var J=n(W,U),Q=n(K,Z),le=i(J,Q);if(Math.abs(le)<1e-9)return t(U,a(J,.5));var de=i(n(Z,U),Q)/le;return t(U,a(J,de))},u=r.map(function(F){return{x:F.x,y:F.y}});(function(U){for(var W=0,Z=0;Z<U.length;Z++){var K=U[Z],J=U[(Z+1)%U.length];W+=K.x*J.y-J.x*K.y}return W/2})(u)<0&&u.reverse();for(var c=u.length,d=[],f=0;f<c;f++){var m=n(u[(f+1)%c],u[f]),p=s({x:m.y,y:-m.x});d.push(p)}for(var g=d.map(function(F,U){return{p1:t(u[U],a(F,e)),p2:t(u[(U+1)%c],a(F,e))}}),w=[],C=0;C<c;C++){var N=g[(C-1+c)%c],z=g[C],V=l(N.p1,N.p2,z.p1,z.p2);w.push(V)}return w}(dv(r,e,t,n,a),i),l=gr();return o.forEach(function(u){return Ql(l,u.x,u.y)}),l}(this.points,n,a,i,s,o)}}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,s,o,l){return function(e,t,n,a,i,s){var o=n-e,l=a-t;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-t)*d+t]}(i,s,e,t,n/2+o,a/2+o)},checkPoint:function(e,t,n,a,i,s,o,l){return wn(e,t,a,i,s,o,n)}}},generateRoundPolygon:function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,a,i,s,o,l,u){if(void 0!==l[u]&&l[u+"-cx"]===n&&l[u+"-cy"]===a)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=a;var c=i/2,d=s/2;o="auto"===o?iu(i,s):o;for(var f=new Array(e.length/2),h=0;h<e.length/2;h++)f[h]={x:n+c*e[2*h],y:a+d*e[2*h+1]};var v,m,p,g,w=f.length;for(m=f[w-1],v=0;v<w;v++)l[u][v]=Ko(m,p=f[v%w],g=f[(v+1)%w],o),m=p,p=g;return l[u]},draw:function(n,a,i,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,o,this.points,this.getOrCreateCorners(a,i,s,o,l,u,"drawCorners"))},intersectLine:function(n,a,i,s,o,l,u,c,d){return function(e,t,n,a,i,s,o,l,u){var d,c=[],f=new Array(2*n.length);u.forEach(function(w,C){0===C?(f[f.length-2]=w.startX,f[f.length-1]=w.startY):(f[4*C-2]=w.startX,f[4*C-1]=w.startY),f[4*C]=w.stopX,f[4*C+1]=w.stopY,0!==(d=pa(e,t,a,i,w.cx,w.cy,w.radius)).length&&c.push(d[0],d[1])});for(var h=0;h<f.length/4;h++)0!==(d=en(e,t,a,i,f[4*h],f[4*h+1],f[4*h+2],f[4*h+3],!1)).length&&c.push(d[0],d[1]);if(c.length>2){for(var v=[c[0],c[1]],m=Math.pow(v[0]-e,2)+Math.pow(v[1]-t,2),p=1;p<c.length/2;p++){var g=Math.pow(c[2*p]-e,2)+Math.pow(c[2*p+1]-t,2);g<=m&&(v[0]=c[2*p],v[1]=c[2*p+1],m=g)}return v}return c}(o,l,this.points,n,a,0,0,0,this.getOrCreateCorners(n,a,i,s,c,d,"corners"))},checkPoint:function(n,a,i,s,o,l,u,c,d){return function(e,t,n,a,i,s,o,l){for(var u=new Array(2*n.length),c=0;c<l.length;c++){var d=l[c];if(u[4*c+0]=d.startX,u[4*c+1]=d.startY,u[4*c+2]=d.stopX,u[4*c+3]=d.stopY,Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2)<=Math.pow(d.radius,2))return!0}return mr(e,t,u)}(n,a,this.points,0,0,0,0,this.getOrCreateCorners(l,u,s,o,c,d,"corners"))}}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,s)},intersectLine:function(e,t,n,a,i,s,o,l){return nu(i,s,e,t,n,a,o,l)},checkPoint:function(e,t,n,a,i,s,o,l){var u=a/2,c=i/2;l="auto"===l?tn(a,i):l;var d=2*(l=Math.min(u,c,l));return!!(jr(e,t,this.points,s,o,a,i-d,[0,-1],n)||jr(e,t,this.points,s,o,a-d,i,[0,-1],n)||wn(e,t,d,d,s-u+l,o-c+l,n)||wn(e,t,d,d,s+u-l,o-c+l,n)||wn(e,t,d,d,s+u-l,o+c-l,n)||wn(e,t,d,d,s-u+l,o+c-l,n))}}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,null,s)},generateCutTrianglePts:function(e,t,n,a,i){var s="auto"===i?this.cornerLength:i,o=t/2,l=e/2,u=n-l,c=n+l,d=a-o,f=a+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[c-s,d,c,d+s,c-s,d+s],bottomRight:[c,f-s,c-s,f,c-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,t,n,a,i,s,o,l){var u=this.generateCutTrianglePts(n+2*o,a+2*o,e,t,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ya(i,s,c,e,t)},checkPoint:function(e,t,n,a,i,s,o,l){var u="auto"===l?this.cornerLength:l;if(jr(e,t,this.points,s,o,a,i-2*u,[0,-1],n)||jr(e,t,this.points,s,o,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,s,o);return mr(e,t,c.topLeft)||mr(e,t,c.topRight)||mr(e,t,c.bottomRight)||mr(e,t,c.bottomLeft)}}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,s,o,l){var f=this.generateBarrelBezierPts(n+2*o,a+2*o,e,t),h=function(p){var g=Bn({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},.15),w=Bn({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},.5),C=Bn({x:p[0],y:p[1]},{x:p[2],y:p[3]},{x:p[4],y:p[5]},.85);return[p[0],p[1],g.x,g.y,w.x,w.y,C.x,C.y,p[4],p[5]]},v=[].concat(h(f.topLeft),h(f.topRight),h(f.bottomRight),h(f.bottomLeft));return ya(i,s,v,e,t)},generateBarrelBezierPts:function(e,t,n,a){var i=t/2,s=e/2,o=n-s,l=n+s,u=a-i,c=a+i,d=Ts(e,t),f=d.heightOffset,h=d.widthOffset,v=d.ctrlPtOffsetPct*e,m={topLeft:[o,u+f,o+v,u,o+h,u],topRight:[l-h,u,l-v,u,l,u+f],bottomRight:[l,c-f,l-v,c,l-h,c],bottomLeft:[o+h,c,o+v,c,o,c-f]};return m.topLeft.isTop=!0,m.topRight.isTop=!0,m.bottomLeft.isBottom=!0,m.bottomRight.isBottom=!0,m},checkPoint:function(e,t,n,a,i,s,o,l){var u=Ts(a,i),d=u.widthOffset;if(jr(e,t,this.points,s,o,a,i-2*u.heightOffset,[0,-1],n)||jr(e,t,this.points,s,o,a-2*d,i,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(a,i,s,o),h=function(U,W,Z){var K=Z[4],J=Z[2],Q=Z[0],le=Z[5],de=Z[1],he=Math.min(K,Q),ue=Math.max(K,Q),ge=Math.min(le,de),Se=Math.max(le,de);if(he<=U&&U<=ue&&ge<=W&&W<=Se){var Le=function(e,t,n){return[e-2*t+n,2*(t-e),e]}(K,J,Q),ye=function(e,t,n,a){var i=t*t-4*e*(n-=a);if(i<0)return[];var s=Math.sqrt(i),o=2*e;return[(-t+s)/o,(-t-s)/o]}(Le[0],Le[1],Le[2],U),De=ye.filter(function(Ue){return 0<=Ue&&Ue<=1});if(De.length>0)return De[0]}return null},v=Object.keys(f),m=0;m<v.length;m++){var g=f[v[m]],w=h(e,t,g);if(null!=w){var V=tr(g[5],g[3],g[1],w);if(g.isTop&&V<=t||g.isBottom&&t<=V)return!0}}return!1}}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,s)},intersectLine:function(e,t,n,a,i,s,o,l){var c=t-(a/2+o),h=en(i,s,e,t,e-(n/2+o),c,e+(n/2+o),c,!1);return h.length>0?h:nu(i,s,e,t,n,a,o,l)},checkPoint:function(e,t,n,a,i,s,o,l){var u=2*(l="auto"===l?tn(a,i):l);if(jr(e,t,this.points,s,o,a,i-u,[0,-1],n)||jr(e,t,this.points,s,o,a-u,i,[0,-1],n))return!0;var c=a/2+2*n,d=i/2+2*n;return!!(mr(e,t,[s-c,o-d,s-c,o,s+c,o,s+c,o-d])||wn(e,t,u,u,s+a/2-l,o+i/2-l,n)||wn(e,t,u,u,s-a/2+l,o+i/2-l,n))}}},registerNodeShapes:function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t),this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var n=new Array(20),a=xs(5,0),i=xs(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[2*o]*=s,i[2*o+1]*=s;for(o=0;o<5;o++)n[4*o]=a[2*o],n[4*o+1]=a[2*o+1],n[4*o+2]=i[2*o],n[4*o+3]=i[2*o+1];n=au(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 l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),r.makePolygon=function(u){var f,d="polygon-"+u.join("$");return(f=this[d])?f:e.generatePolygon(d,u)}}},Ma={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(r){r=r||ql();var e=this;void 0===e.averageRedrawTime&&(e.averageRedrawTime=0),void 0===e.lastRedrawTime&&(e.lastRedrawTime=0),void 0===e.lastDrawTime&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r},beforeRender:function(r,e){if(!this.destroyed){null==e&&Xt("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(n,a){return a.priority-n.priority})}}},Wd=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};Ma.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(a){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){Wd(r,!0,a);var i=Ur();r.render(r.renderOptions);var s=r.lastDrawTime=Ur();void 0===r.averageRedrawTime&&(r.averageRedrawTime=s-i),void 0===r.redrawCount&&(r.redrawCount=0),r.redrawCount++,void 0===r.redrawTotalTime&&(r.redrawTotalTime=0);var o=s-i;r.redrawTotalTime+=o,r.lastRedrawTime=o,r.averageRedrawTime=r.averageRedrawTime/2+o/2,r.requestedFrame=!1}else Wd(r,!1,a);r.skipFrame=!1,Ya(t)}};Ya(t)}};var qd=function(e){this.init(e)},ea=qd.prototype;ea.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ea.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=null!=a.getElementById(s);if(t.className.indexOf(o)<0&&(t.className=(t.className||"")+" "+o),!l){var u=a.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",i.insertBefore(u,i.children[0])}"static"===n.getComputedStyle(t).getPropertyValue("position")&&_t("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=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=_e(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.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()},ea.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if("init"===r)return void t.load();if("destroy"===r)return void t.destroy();("add"===r||"remove"===r||"move"===r&&n.hasCompoundNodes()||"load"===r||"zorder"===r||"mount"===r)&&t.invalidateCachedZSortedEles(),"viewport"===r&&t.redrawHint("select",!0),"gc"===r&&t.redrawHint("gc",!0),("load"===r||"resize"===r||"mount"===r)&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},ea.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],a=t.target;(a.off||a.removeEventListener).apply(a,t.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}},ea.isHeadless=function(){return!1},[jo,Xd,jd,Qn,Wr,Ma].forEach(function(r){mt(ea,r)});var Jo=1e3/60,$d_setupDequeueing=function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=ca(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold);a.beforeRender(function(u,c){var d=Ur(),f=a.averageRedrawTime,h=a.lastRedrawTime,v=[],m=a.cy.extent(),p=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var g=Ur(),w=g-d,C=g-c;if(h<Jo){if(C>=e.deqFastCost*(Jo-(u?f:0)))break}else if(u){if(w>=e.deqCost*h||w>=e.deqAvgCost*f)break}else if(C>=e.deqNoDrawCost*Jo)break;var z=e.deq(n,p,m);if(!(z.length>0))break;for(var V=0;V<z.length;V++)v.push(z[V])}v.length>0&&(e.onDeqd(n,v),!u&&e.shouldRedraw(n,v,p,m)&&i())},(e.priority||fs)(n))}}},Oy=function(){return ie(function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa;_(this,r),this.idsByKey=new Xr,this.keyForId=new Xr,this.cachesByLvl=new Xr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t},[{key:"getIdsFor",value:function(t){null==t&&Xt("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new Pn,n.set(t,a)),a}},{key:"addIdForKey",value:function(t,n){null!=t&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){null!=t&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return null==t?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n),i=this.getKey(t);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id();return this.keyForId.get(n)!==this.getKey(t)}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,a=this.lvls,i=n.get(t);return i||(i=new Xr,n.set(t,i),a.push(t)),i}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var a=this.getKey(t),i=this.getCache(a,n);return null!=i&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,n){var a=this.keyForId.get(t.id());return this.getCache(a,n)}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var a=this.getKey(t);return this.hasCache(a,n)}},{key:"setCache",value:function(t,n,a){a.key=t,this.getCachesAt(n).set(t,a)}},{key:"set",value:function(t,n,a){var i=this.getKey(t);this.setCache(i,n,a),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var a=this.getKey(t);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(a){return n.deleteCache(t,a)})}},{key:"invalidate",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(a),i||0===this.getNumberOfIdsForKey(a)}}])}(),ta={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Wy=ir({getKey:null,doesEleInvalidateKey:qa,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Xl,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Oa=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=Wy(t);mt(n,a),n.lookup=new Oy(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},Qt=Oa.prototype;Qt.reasons=ta,Qt.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]},Qt.getRetiredTextureQueue=function(r){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[r]=t[r]||[]},Qt.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new va(function(t,n){return n.reqs-t.reqs})},Qt.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Qt.getElement=function(r,e,t,n,a){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||0===e.w||0===e.h||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(null==n&&(n=Math.ceil(ys(o*t))),n<-4)n=-4;else if(o>=7.99||n>3)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,f))return null;var v,h=l.get(r,n);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;if(v=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var m=i.getTextureQueue(v),p=m[m.length-2],g=function(){return i.recycleTexture(v,d)||i.addTexture(v,d)};p||(p=m[m.length-1]),p||(p=g()),p.width-p.usedWidth<d&&(p=g());for(var V,w=function(he){return he&&he.scaledLabelShown===f},C=a&&a===ta.dequeue,N=a&&a===ta.highQuality,z=a&&a===ta.downscale,F=n+1;F<=3;F++){var U=l.get(r,F);if(U){V=U;break}}var W=V&&V.level===n+1?V:null,Z=function(){p.context.drawImage(W.texture.canvas,W.x,0,W.width,W.height,p.usedWidth,0,d,c)};if(p.context.setTransform(1,0,0,1,0,0),p.context.clearRect(p.usedWidth,0,d,v),w(W))Z();else if(w(V)){if(!N)return i.queueElement(r,V.level-1),V;for(var K=V.level;K>n;K--)W=i.getElement(r,e,t,K,ta.downscale);Z()}else{var J;if(!C&&!N&&!z)for(var Q=n-1;Q>=-4;Q--){var le=l.get(r,Q);if(le){J=le;break}}if(w(J))return i.queueElement(r,n),J;p.context.translate(p.usedWidth,0),p.context.scale(u,u),this.drawElement(p.context,r,e,f,!1),p.context.scale(1/u,1/u),p.context.translate(-p.usedWidth,0)}return h={x:p.usedWidth,texture:p,level:n,scale:u,width:d,height:c,scaledLabelShown:f},p.usedWidth+=Math.ceil(d+8),p.eleCaches.push(h),l.set(r,n,h),i.checkTextureFullness(p),h},Qt.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])},Qt.invalidateElement=function(r){var e=this,t=e.lookup,n=[];if(t.isInvalid(r)){for(var i=-4;i<=3;i++){var s=t.getForCachedKey(r,i);s&&n.push(s)}if(t.invalidate(r))for(var l=0;l<n.length;l++){var u=n[l],c=u.texture;c.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(r)}},Qt.checkTextureUtility=function(r){r.invalidatedWidth>=.2*r.width&&this.retireTexture(r)},Qt.checkTextureFullness=function(r){var t=this.getTextureQueue(r.height);r.usedWidth/r.width>.8&&r.fullnessChecks>=10?Jr(t,r):r.fullnessChecks++},Qt.retireTexture=function(r){var t=r.height,n=this.getTextureQueue(t),a=this.lookup;Jr(n,r),r.retired=!0;for(var i=r.eleCaches,s=0;s<i.length;s++){var o=i[s];a.deleteCache(o.key,o.level)}hs(i),this.getRetiredTextureQueue(t).push(r)},Qt.addTexture=function(r,e){var a={};return this.getTextureQueue(r).push(a),a.eleCaches=[],a.height=r,a.width=Math.max(1024,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=this.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},Qt.recycleTexture=function(r,e){for(var n=this.getTextureQueue(r),a=this.getRetiredTextureQueue(r),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,hs(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Jr(a,s),n.push(s),s}},Qt.queueElement=function(r,e){var n=this.getElementQueue(),a=this.getElementKeyToQueue(),i=this.getKey(r),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,n.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};n.push(o),a[i]=o}},Qt.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<1&&t.size()>0;s++){var o=t.pop(),l=o.key,u=o.eles[0],c=i.hasCache(u,o.level);if(n[l]=null,!c){a.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,r,o.level,ta.dequeue)}}return a},Qt.removeFromQueue=function(r){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),a=this.getKey(r),i=n[a];null!=i&&(1===i.eles.length?(i.reqs=ds,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))},Qt.onDequeue=function(r){this.onDequeues.push(r)},Qt.offDequeue=function(r){Jr(this.onDequeues,r)},Qt.setupDequeueing=$d_setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,a){for(var i=0;i<t.length;i++)for(var s=t[i].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(bs(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var ef=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Ur()-500,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=ca(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},50),n.beforeRender(function(s,o){t.skipping=o-t.lastInvalidationTime<=250},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new va(function(o,l){return l.reqs-o.reqs}),t.setupDequeueing()},lr=ef.prototype,tf=0,im=Math.pow(2,53)-1;lr.makeLayer=function(r,e){var t=Math.pow(2,e),n=Math.ceil(r.w*t),a=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(n,a),s={id:tf=++tf%im,bb:r,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(t,t),o.translate(l,u),s},lr.getLayers=function(r,e,t){var n=this,s=n.renderer.cy.zoom(),o=n.firstGet;if(n.firstGet=!1,null==t)if((t=Math.ceil(ys(s*e)))<-4)t=-4;else if(s>=3.99||t>2)return null;n.validateLayersElesOrdering(t,r);var d,h,l=n.layersByLevel,u=Math.pow(2,t),c=l[t]=l[t]||[];if(n.levelIsComplete(t,r))return c;!function(){var Z=function(de){if(n.validateLayersElesOrdering(de,r),n.levelIsComplete(de,r))return h=l[de],!0},K=function(de){if(!h)for(var he=t+de;-4<=he&&he<=2&&!Z(he);he+=de);};K(1),K(-1);for(var J=c.length-1;J>=0;J--){var Q=c[J];Q.invalid&&Jr(c,Q)}}();var p=function(Z){var K=(Z=Z||{}).after;!function(){if(!d){d=gr();for(var Z=0;Z<r.length;Z++)Qh(d,r[Z].boundingBox())}}();var J=Math.ceil(d.w*u),Q=Math.ceil(d.h*u);if(J>32767||Q>32767)return null;if(J*Q>16e6)return null;var de=n.makeLayer(d,t);if(null!=K){var he=c.indexOf(K)+1;c.splice(he,0,de)}else(void 0===Z.insert||Z.insert)&&c.unshift(de);return de};if(n.skipping&&!o)return null;for(var g=null,w=r.length/1,C=!o,N=0;N<r.length;N++){var z=r[N],V=z._private.rscratch,F=V.imgLayerCaches=V.imgLayerCaches||{},U=F[t];if(U)g=U;else{if((!g||g.eles.length>=w||!ru(g.bb,z.boundingBox()))&&!(g=p({insert:!0,after:g})))return null;h||C?n.queueLayer(g,z):n.drawEleInLayer(g,z,t,e),g.eles.push(z),F[t]=g}}return h||(C?null:c)},lr.getEleLevelForLayerLevel=function(r,e){return r},lr.drawEleInLayer=function(r,e,t,n){var i=this.renderer,s=r.context,o=e.boundingBox();0===o.w||0===o.h||!e.visible()||(t=this.getEleLevelForLayerLevel(t,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,!0),i.setImgSmoothing(s,!0))},lr.levelIsComplete=function(r,e){var n=this.layersByLevel[r];if(!n||0===n.length)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},lr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n<t.length;n++){for(var a=t[n],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0)this.invalidateLayer(a);else{var o=i;for(s=0;s<a.eles.length;s++)if(a.eles[s]!==e[o+s]){this.invalidateLayer(a);break}}}},lr.updateElementsInLayers=function(r,e){for(var n=It(r[0]),a=0;a<r.length;a++)for(var i=n?null:r[a],s=n?r[a]:r[a].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=-4;u<=2;u++){var c=l[u];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||e(c,s,i))}},lr.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},lr.invalidateElements=function(r){var e=this;0!==r.length&&(e.lastInvalidationTime=Ur(),0!==r.length&&e.haveLayers()&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))},lr.invalidateLayer=function(r){if(this.lastInvalidationTime=Ur(),!r.invalid){var e=r.level,t=r.eles;Jr(this.layersByLevel[e],r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var a=0;a<t.length;a++){var i=t[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},lr.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,a,i){var s=n.replacement;if(s||((s=n.replacement=e.makeLayer(n.bb,n.level)).replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})},lr.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()},lr.queueLayer=function(r,e){var n=this.layersQueue,a=r.elesQueue,i=a.hasId=a.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,n.updateItem(r)):(r.reqs=1,n.push(r))}},lr.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],a=0;a<1&&0!==t.size();){var i=t.peek();if(i.replacement)t.pop();else if(i.replaces&&i!==i.replaces.replacement)t.pop();else if(i.invalid)t.pop();else{var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,r),a++),0===n.length&&n.push(!0),0===i.elesQueue.length&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}}return n},lr.applyLayerReplacement=function(r){var t=this.layersByLevel[r.level],n=r.replaces,a=t.indexOf(n);if(!(a<0||n.invalid)){t[a]=r;for(var i=0;i<r.eles.length;i++){var s=r.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[r.level]=r)}this.requestRedraw()}},lr.requestRedraw=ca(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100),lr.setupDequeueing=$d_setupDequeueing({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:fs,shouldRedraw:Xl,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var nf,rf={};function sm(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function om(r,e,t){for(var n,a=0;a<e.length;a++){var i=e[a];0===a&&(n=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function af(r,e,t){r.beginPath&&r.beginPath();for(var n=e,a=0;a<n.length;a++)r.lineTo((i=n[a]).x,i.y);var s=t,o=t[0];for(r.moveTo(o.x,o.y),a=1;a<s.length;a++){var i;r.lineTo((i=s[a]).x,i.y)}r.closePath&&r.closePath()}function lm(r,e,t,n,a){r.beginPath&&r.beginPath(),r.arc(t,n,a,0,2*Math.PI,!1);var i=e,s=i[0];r.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var l=i[o];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function um(r,e,t,n){r.arc(e,t,n,0,2*Math.PI,!1)}rf.arrowShapeImpl=function(r){return(nf||(nf={polygon:sm,"triangle-backcurve":om,"triangle-tee":af,"circle-triangle":lm,"triangle-cross":af,circle:um}))[r]};var zr={drawElement:function(r,e,t,n,a,i){e.isNode()?this.drawNode(r,e,t,n,a,i):this.drawEdge(r,e,t,n,a,i)},drawElementOverlay:function(r,e){e.isNode()?this.drawNodeOverlay(r,e):this.drawEdgeOverlay(r,e)},drawElementUnderlay:function(r,e){e.isNode()?this.drawNodeUnderlay(r,e):this.drawEdgeUnderlay(r,e)},drawCachedElementPortion:function(r,e,t,n,a,i,s,o){var l=this,u=t.getBoundingBox(e);if(0!==u.w&&0!==u.h){var c=t.getElement(e,u,n,a,i);if(null!=c){var d=o(l,e);if(0===d)return;var g,w,C,N,z,U,f=s(l,e),h=u.x1,v=u.y1,m=u.w,p=u.h;if(0!==f){var V=t.getRotationPoint(e);r.translate(C=V.x,N=V.y),r.rotate(f),(z=l.getImgSmoothing(r))||l.setImgSmoothing(r,!0);var F=t.getRotationOffset(e);g=F.x,w=F.y}else g=h,w=v;1!==d&&(r.globalAlpha=(U=r.globalAlpha)*d),r.drawImage(c.texture.canvas,c.x,0,c.width,c.height,g,w,m,p),1!==d&&(r.globalAlpha=U),0!==f&&(r.rotate(-f),r.translate(-C,-N),z||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}}},cm=function(){return 0},dm=function(e,t){return e.getTextAngle(t,null)},fm=function(e,t){return e.getTextAngle(t,"source")},hm=function(e,t){return e.getTextAngle(t,"target")},vm=function(e,t){return t.effectiveOpacity()},el=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};zr.drawCachedElement=function(r,e,t,n,a,i){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,c=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),h=!0===i?l.reasons.highQuality:null;if(0!==f.w&&0!==f.h&&e.visible()&&(!n||bs(f,n))){var v=e.isEdge(),m=e.element()._private.rscratch.badLine;s.drawElementUnderlay(r,e),s.drawCachedElementPortion(r,e,l,t,a,h,cm,vm),(!v||!m)&&s.drawCachedElementPortion(r,e,u,t,a,h,dm,el),v&&!m&&(s.drawCachedElementPortion(r,e,c,t,a,h,fm,el),s.drawCachedElementPortion(r,e,d,t,a,h,hm,el)),s.drawElementOverlay(r,e)}},zr.drawElements=function(r,e){for(var n=0;n<e.length;n++)this.drawElement(r,e[n])},zr.drawCachedElements=function(r,e,t,n){for(var i=0;i<e.length;i++)this.drawCachedElement(r,e[i],t,n)},zr.drawCachedNodes=function(r,e,t,n){for(var i=0;i<e.length;i++){var s=e[i];s.isNode()&&this.drawCachedElement(r,s,t,n)}},zr.drawLayeredElements=function(r,e,t,n){var i=this.data.lyrTxrCache.getLayers(e,t);if(i)for(var s=0;s<i.length;s++){var o=i[s],l=o.bb;0===l.w||0===l.h||r.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else this.drawCachedElements(r,e,t,n)};var qr={drawEdge:function(r,e,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this,o=e._private.rscratch;if((!i||e.visible())&&!o.badLine&&null!=o.allpts&&!isNaN(o.allpts[0])){var l;t&&r.translate(-(l=t).x1,-l.y1);var u=i?e.pstyle("opacity").value:1,c=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,v=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,p=e.pstyle("line-outline-color").value,g=u*c,w=u*c,C=function(){var de=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;"straight-triangle"===d?(s.eleStrokeStyle(r,e,de),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=v,s.eleStrokeStyle(r,e,de),s.drawEdgePath(e,r,o.allpts,f),r.lineCap="butt")},F=function(){s.drawArrowheads(r,e,arguments.length>0&&void 0!==arguments[0]?arguments[0]:w)};if(r.lineJoin="round","yes"===e.pstyle("ghost").value){var Z=e.pstyle("ghost-offset-x").pfValue,K=e.pstyle("ghost-offset-y").pfValue,J=e.pstyle("ghost-opacity").value,Q=g*J;r.translate(Z,K),C(Q),F(Q),r.translate(-Z,-K)}else!function(){var de=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;r.lineWidth=h+m,r.lineCap=v,m>0?(s.colorStrokeStyle(r,p[0],p[1],p[2],de),"straight-triangle"===d?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,f),r.lineCap="butt")):r.lineCap="butt"}();a&&s.drawEdgeUnderlay(r,e),C(),F(),a&&s.drawEdgeOverlay(r,e),s.drawElementText(r,e,null,n),t&&r.translate(l.x1,l.y1)}}},sf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(0!==a){var i=this,s=i.usePaths(),o=n._private.rscratch,u=2*n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=u,t.lineCap="self"!==o.edgeType||s?"round":"butt",i.colorStrokeStyle(t,c[0],c[1],c[2],a),i.drawEdgePath(n,t,o.allpts,"solid")}}}};qr.drawEdgeOverlay=sf("overlay"),qr.drawEdgeUnderlay=sf("underlay"),qr.drawEdgePath=function(r,e,t,n){var s,a=r._private.rscratch,i=e,o=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,c=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$");a.pathCacheKey&&a.pathCacheKey===d?(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(u),i.lineDashOffset=c;break;case"solid":i.setLineDash([])}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<t.length;h+=4)e.quadraticCurveTo(t[h],t[h+1],t[h+2],t[h+3]);break;case"straight":case"haystack":for(var v=2;v+1<t.length;v+=2)e.lineTo(t[v],t[v+1]);break;case"segments":if(a.isRound){var p,m=H(a.roundCorners);try{for(m.s();!(p=m.n()).done;)_d(e,p.value)}catch(C){m.e(C)}finally{m.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var w=2;w+1<t.length;w+=2)e.lineTo(t[w],t[w+1])}e=i,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},qr.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var n=r.pstyle("width").pfValue,a=0;a+1<t.length;a+=2){var i=[t[a+2]-t[a],t[a+3]-t[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(t[a]-l[0],t[a+1]-l[1]),e.lineTo(t[a]+l[0],t[a+1]+l[1]),e.lineTo(t[a+2],t[a+3]),e.closePath(),e.fill()}},qr.drawArrowheads=function(r,e,t){var n=e._private.rscratch,a="haystack"===n.edgeType;a||this.drawArrowhead(r,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,t),a||this.drawArrowhead(r,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,t)},qr.drawArrowhead=function(r,e,t,n,a,i,s){if(!(isNaN(n)||null==n||isNaN(a)||null==a||isNaN(i)||null==i)){var o=this,l=e.pstyle(t+"-arrow-shape").value;if("none"!==l){var u="hollow"===e.pstyle(t+"-arrow-fill").value?"both":"filled",c=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(t+"-arrow-width"),h="match-line"===f.value?d:f.pfValue;"%"===f.units&&(h*=d);var v=e.pstyle("opacity").value;void 0===s&&(s=v);var m=r.globalCompositeOperation;(1!==s||"hollow"===c)&&(r.globalCompositeOperation="destination-out",o.colorFillStyle(r,255,255,255,1),o.colorStrokeStyle(r,255,255,255,1),o.drawArrowShape(e,r,u,d,l,h,n,a,i),r.globalCompositeOperation=m);var p=e.pstyle(t+"-arrow-color").value;o.colorFillStyle(r,p[0],p[1],p[2],s),o.colorStrokeStyle(r,p[0],p[1],p[2],s),o.drawArrowShape(e,r,c,d,l,h,n,a,i)}}},qr.drawArrowShape=function(r,e,t,n,a,i,s,o,l){var f,u=this,c=this.usePaths()&&"triangle-cross"!==a,d=!1,h=e,v={x:s,y:o},m=r.pstyle("arrow-scale").value,p=this.getArrowWidth(n,m),g=u.arrowShapes[a];if(c){var w=u.arrowPathCache=u.arrowPathCache||[],C=yn(a),N=w[C];null!=N?(f=e=N,d=!0):(f=e=new Path2D,w[C]=f)}d||(e.beginPath&&e.beginPath(),c?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,p,l,v,n),e.closePath&&e.closePath()),e=h,c&&(e.translate(s,o),e.rotate(l),e.scale(p,p)),("filled"===t||"both"===t)&&(c?e.fill(f):e.fill()),("hollow"===t||"both"===t)&&(e.lineWidth=i/(c?p:1),e.lineJoin="miter",c?e.stroke(f):e.stroke()),c&&(e.scale(1/p,1/p),e.rotate(-l),e.translate(-s,-o))};var tl={safeDrawImage:function(r,e,t,n,a,i,s,o,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{r.drawImage(e,t,n,a,i,s,o,l,u)}catch(c){_t(c)}},drawInscribedImage:function(r,e,t,n,a){var i=this,s=t.position(),o=s.x,l=s.y,u=t.cy().style(),c=u.getIndexedStyle.bind(u),d=c(t,"background-fit","value",n),f=c(t,"background-repeat","value",n),h=t.width(),v=t.height(),m=2*t.padding(),p=h+("inner"===c(t,"background-width-relative-to","value",n)?0:m),g=v+("inner"===c(t,"background-height-relative-to","value",n)?0:m),w=t._private.rscratch,N="node"===c(t,"background-clip","value",n),z=c(t,"background-image-opacity","value",n)*a,V=c(t,"background-image-smoothing","value",n),F=t.pstyle("corner-radius").value;"auto"!==F&&(F=t.pstyle("corner-radius").pfValue);var U=e.width||e.cachedW,W=e.height||e.cachedH;(null==U||null==W)&&(document.body.appendChild(e),U=e.cachedW=e.width||e.offsetWidth,W=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var Z=U,K=W;if("auto"!==c(t,"background-width","value",n)&&(Z="%"===c(t,"background-width","units",n)?c(t,"background-width","pfValue",n)*p:c(t,"background-width","pfValue",n)),"auto"!==c(t,"background-height","value",n)&&(K="%"===c(t,"background-height","units",n)?c(t,"background-height","pfValue",n)*g:c(t,"background-height","pfValue",n)),0!==Z&&0!==K){if("contain"===d)Z*=J=Math.min(p/Z,g/K),K*=J;else if("cover"===d){var J;Z*=J=Math.max(p/Z,g/K),K*=J}var Q=o-p/2,le=c(t,"background-position-x","units",n),de=c(t,"background-position-x","pfValue",n);Q+="%"===le?(p-Z)*de:de;var he=c(t,"background-offset-x","units",n),ue=c(t,"background-offset-x","pfValue",n);Q+="%"===he?(p-Z)*ue:ue;var ge=l-g/2,Se=c(t,"background-position-y","units",n),Le=c(t,"background-position-y","pfValue",n);ge+="%"===Se?(g-K)*Le:Le;var ye=c(t,"background-offset-y","units",n),De=c(t,"background-offset-y","pfValue",n);ge+="%"===ye?(g-K)*De:De,w.pathCache&&(Q-=o,ge-=l,o=0,l=0);var Ue=r.globalAlpha;r.globalAlpha=z;var $e=i.getImgSmoothing(r),Xe=!1;if("no"===V&&$e?(i.setImgSmoothing(r,!1),Xe=!0):"yes"===V&&!$e&&(i.setImgSmoothing(r,!0),Xe=!0),"no-repeat"===f)N&&(r.save(),w.pathCache?r.clip(w.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,o,l,p,g,F,w),r.clip())),i.safeDrawImage(r,e,0,0,U,W,Q,ge,Z,K),N&&r.restore();else{var Qe=r.createPattern(e,f);r.fillStyle=Qe,i.nodeShapes[i.getNodeShape(t)].draw(r,o,l,p,g,F,w),r.translate(Q,ge),r.fill(),r.translate(-Q,-ge)}r.globalAlpha=Ue,Xe&&i.setImgSmoothing(r,$e)}}},Ln={};function of(r,e,t,n,a){var s=Math.min(arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,n/2,a/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+n-s,t),r.quadraticCurveTo(e+n,t,e+n,t+s),r.lineTo(e+n,t+a-s),r.quadraticCurveTo(e+n,t+a,e+n-s,t+a),r.lineTo(e+s,t+a),r.quadraticCurveTo(e,t+a,e,t+a-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Ln.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(ys(t*n));e=Math.pow(2,a)}return!(r.pstyle("font-size").pfValue*e<r.pstyle("min-zoomed-font-size").pfValue)},Ln.drawElementText=function(r,e,t,n,a){var i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this;if(null==n){if(i&&!s.eleTextBiggerThanMin(e))return}else if(!1===n)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u="glyph"===e.pstyle("text-metrics").strValue;r.textAlign=l,r.textBaseline=u?"alphabetic":"bottom"}else{var c=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),h=e.pstyle("target-label");if(c||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var m,v=!t;t&&r.translate(-(m=t).x1,-m.y1),null==a?(s.drawText(r,e,null,v,i),e.isEdge()&&(s.drawText(r,e,"source",v,i),s.drawText(r,e,"target",v,i))):s.drawText(r,e,a,v,i),t&&r.translate(m.x1,m.y1)},Ln.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if((e=this.fontCaches[t]).context===r)return e;return this.fontCaches.push(e={context:r}),e},Ln.setupTextStyle=function(r,e){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],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=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;r.font=n+" "+s+" "+a+" "+i,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],o),this.colorStrokeStyle(r,c[0],c[1],c[2],l)},Ln.getTextAngle=function(r,e){var t,a=r._private.rscratch,s=r.pstyle((e?e+"-":"")+"text-rotation");if("autorotate"===s.strValue){var o=vr(a,"labelAngle",e);t=r.isEdge()?o:0}else t="none"===s.strValue?0:s.pfValue;return t},Ln.drawText=function(r,e,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=e._private.rscratch,o=a?e.effectiveOpacity():1;if(!a||0!==o&&0!==e.pstyle("text-opacity").value){"main"===t&&(t=null);var c,d,l=vr(s,"labelX",t),u=vr(s,"labelY",t),f=this.getLabelText(e,t);if(null!=f&&""!==f&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,a);var V,h=t?t+"-":"",v=vr(s,"labelWidth",t),m=vr(s,"labelHeight",t),p=vr(s,"labelActualDescent",t),g=e.pstyle(h+"text-margin-x").pfValue,w=e.pstyle(h+"text-margin-y").pfValue,C=e.isEdge(),N=e.pstyle("text-halign").value,z=e.pstyle("text-valign").value;C&&(N="center",z="center"),l+=g,u+=w,0!==(V=n?this.getTextAngle(e,t):0)&&(r.translate(c=l,d=u),r.rotate(V),l=0,u=0);var F=jn(N),U=Yn(z);switch(U){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m}var W=e.pstyle("text-background-opacity").value,Z=e.pstyle("text-border-opacity").value,K=e.pstyle("text-border-width").pfValue,J=e.pstyle("text-background-padding").pfValue,Q=e.pstyle("text-background-shape").strValue,le="round-rectangle"===Q||"roundrectangle"===Q,de="circle"===Q;if(W>0||K>0&&Z>0){var ue=r.fillStyle,ge=r.strokeStyle,Se=r.lineWidth,Le=e.pstyle("text-background-color").value,ye=e.pstyle("text-border-color").value,De=e.pstyle("text-border-style").value,Ue=W>0,$e=K>0&&Z>0,Xe=l-J;switch(F){case"left":Xe-=v;break;case"center":Xe-=v/2}var Qe=u-m-J,tt=v+2*J,at=m+2*J;if(Ue&&(r.fillStyle="rgba(".concat(Le[0],",").concat(Le[1],",").concat(Le[2],",").concat(W*o,")")),$e&&(r.strokeStyle="rgba(".concat(ye[0],",").concat(ye[1],",").concat(ye[2],",").concat(Z*o,")"),r.lineWidth=K,r.setLineDash))switch(De){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=K/4,r.setLineDash([]);break;default:r.setLineDash([])}if(le?(r.beginPath(),of(r,Xe,Qe,tt,at,2)):de?(r.beginPath(),function gm(r,e,t,n,a){var s=Math.min(n,a)/2,o=e+n/2,l=t+a/2;r.beginPath(),r.arc(o,l,s,0,2*Math.PI),r.closePath()}(r,Xe,Qe,tt,at)):(r.beginPath(),r.rect(Xe,Qe,tt,at)),Ue&&r.fill(),$e&&r.stroke(),$e&&"double"===De){var He=K/2;r.beginPath(),le?of(r,Xe+He,Qe+He,tt-2*He,at-2*He,2):r.rect(Xe+He,Qe+He,tt-2*He,at-2*He),r.stroke()}r.fillStyle=ue,r.strokeStyle=ge,r.lineWidth=Se,r.setLineDash&&r.setLineDash([])}var Te=2*e.pstyle("text-outline-width").pfValue;if(Te>0&&(r.lineWidth=Te),u-=p,"wrap"===e.pstyle("text-wrap").value){var Ie=vr(s,"labelWrapCachedLines",t),Pe=vr(s,"labelLineHeight",t),ze=v/2,rt=this.getLabelJustification(e);switch("auto"===rt||("left"===F?"left"===rt?l+=-v:"center"===rt&&(l+=-ze):"center"===F?"left"===rt?l+=-ze:"right"===rt&&(l+=ze):"right"===F&&("center"===rt?l+=ze:"right"===rt&&(l+=v))),U){case"top":case"center":case"bottom":u-=(Ie.length-1)*Pe}for(var ct=0;ct<Ie.length;ct++)Te>0&&r.strokeText(Ie[ct],l,u),r.fillText(Ie[ct],l,u),u+=Pe}else Te>0&&r.strokeText(f,l,u),r.fillText(f,l,u);0!==V&&(r.rotate(-V),r.translate(-c,-d))}}};var dn={drawNode:function(r,e,t){var o,l,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this,u=e._private,c=u.rscratch,d=e.position();if(_e(d.x)&&_e(d.y)&&(!i||e.visible())){var v,g,f=i?e.effectiveOpacity():1,h=s.usePaths(),m=!1,p=e.padding();o=e.width()+2*p,l=e.height()+2*p,t&&r.translate(-(g=t).x1,-g.y1);for(var C=e.pstyle("background-image").value,N=new Array(C.length),z=new Array(C.length),V=0,F=0;F<C.length;F++){var U=C[F];if(N[F]=null!=U&&"none"!==U){var Z=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",F);V++,z[F]=s.getCachedImage(U,Z,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var K=e.pstyle("background-blacken").value,J=e.pstyle("border-width").pfValue,Q=e.pstyle("background-opacity").value*f,le=e.pstyle("border-color").value,de=e.pstyle("border-style").value,he=e.pstyle("border-join").value,ue=e.pstyle("border-cap").value,ge=e.pstyle("border-position").value,Se=e.pstyle("border-dash-pattern").pfValue,Le=e.pstyle("border-dash-offset").pfValue,ye=e.pstyle("border-opacity").value*f,De=e.pstyle("outline-width").pfValue,Ue=e.pstyle("outline-color").value,$e=e.pstyle("outline-style").value,Xe=e.pstyle("outline-opacity").value*f,Qe=e.pstyle("outline-offset").value,tt=e.pstyle("corner-radius").value;"auto"!==tt&&(tt=e.pstyle("corner-radius").pfValue);var at=function(){s.eleFillStyle(r,e,arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q)},He=function(){s.colorStrokeStyle(r,le[0],le[1],le[2],arguments.length>0&&void 0!==arguments[0]?arguments[0]:ye)},Te=function(){s.colorStrokeStyle(r,Ue[0],Ue[1],Ue[2],arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xe)},Ie=function(X,be,Ae,Fe){var st,Ve=s.nodePathCache=s.nodePathCache||[],dt=Hl("polygon"===Ae?Ae+","+Fe.join(","):Ae,""+be,""+X,""+tt),Ke=Ve[dt],lt=!1;return null!=Ke?(lt=!0,c.pathCache=st=Ke):(st=new Path2D,Ve[dt]=c.pathCache=st),{path:st,cacheHit:lt}},Pe=e.pstyle("shape").strValue,ze=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(d.x,d.y);var rt=Ie(o,l,Pe,ze);v=rt.path,m=rt.cacheHit}var ct=function(){if(!m){var X=d;h&&(X={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(v||r,X.x,X.y,o,l,tt,c)}h?r.fill(v):r.fill()},Nt=function(){for(var X=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,be=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Ae=u.backgrounding,Fe=0,Ve=0;Ve<z.length;Ve++){var dt=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ve);be&&"over"===dt||!be&&"inside"===dt?Fe++:N[Ve]&&z[Ve].complete&&!z[Ve].error&&(Fe++,s.drawInscribedImage(r,z[Ve],e,Ve,X))}u.backgrounding=Fe!==V,Ae!==u.backgrounding&&e.updateStyle(!1)},Et=function(){var X=arguments.length>0&&void 0!==arguments[0]&&arguments[0],be=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;s.hasPie(e)&&(s.drawPie(r,e,be),X&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,tt,c)))},bt=function(){var X=arguments.length>0&&void 0!==arguments[0]&&arguments[0],be=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;s.hasStripe(e)&&(r.save(),h?r.clip(c.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,tt,c),r.clip()),s.drawStripe(r,e,be),r.restore(),X&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,tt,c)))},pt=function(){var Ae=K>0?0:255;0!==K&&(s.colorFillStyle(r,Ae,Ae,Ae,(K>0?K:-K)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f)),h?r.fill(v):r.fill())},ot=function(){if(J>0){if(r.lineWidth=J,r.lineCap=ue,r.lineJoin=he,r.setLineDash)switch(de){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(Se),r.lineDashOffset=Le;break;case"solid":case"double":r.setLineDash([])}if("center"!==ge){if(r.save(),r.lineWidth*=2,"inside"===ge)h?r.clip(v):r.clip();else{var X=new Path2D;X.rect(-o/2-J,-l/2-J,o+2*J,l+2*J),X.addPath(v),r.clip(X,"evenodd")}h?r.stroke(v):r.stroke(),r.restore()}else h?r.stroke(v):r.stroke();if("double"===de){r.lineWidth=J/3;var be=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(v):r.stroke(),r.globalCompositeOperation=be}r.setLineDash&&r.setLineDash([])}},gt=function(){if(De>0){if(r.lineWidth=De,r.lineCap="butt",r.setLineDash)switch($e){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([])}var X=d;h&&(X={x:0,y:0});var be=s.getNodeShape(e),Ae=J;"inside"===ge&&(Ae=0),"outside"===ge&&(Ae*=2);var lt,Fe=(o+Ae+(De+Qe))/o,Ve=(l+Ae+(De+Qe))/l,dt=o*Fe,Ke=l*Ve,st=s.nodeShapes[be].points;if(h&&(lt=Ie(dt,Ke,be,st).path),"ellipse"===be)s.drawEllipsePath(lt||r,X.x,X.y,dt,Ke);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(be)){var Ct=0,Dt=0,ft=0;"round-diamond"===be?Ct=1.4*(Ae+Qe+De):"round-heptagon"===be?(Ct=1.075*(Ae+Qe+De),ft=-(Ae/2+Qe+De)/35):"round-hexagon"===be?Ct=1.12*(Ae+Qe+De):"round-pentagon"===be?(Ct=1.13*(Ae+Qe+De),ft=-(Ae/2+Qe+De)/15):"round-tag"===be?(Ct=1.12*(Ae+Qe+De),Dt=.07*(Ae/2+De+Qe)):"round-triangle"===be&&(Ct=(Ae+Qe+De)*(Math.PI/2),ft=-(Ae+Qe/2+De)/Math.PI),0!==Ct&&(dt=o*(Fe=(o+Ct)/o),["round-hexagon","round-tag"].includes(be)||(Ke=l*(Ve=(l+Ct)/l)));for(var At=dt/2,Mt=Ke/2,ar=(tt="auto"===tt?iu(dt,Ke):tt)+(Ae+De+Qe)/2,Wt=new Array(st.length/2),Nr=new Array(st.length/2),qt=0;qt<st.length/2;qt++)Wt[qt]={x:X.x+Dt+At*st[2*qt],y:X.y+ft+Mt*st[2*qt+1]};var Zt,er,ur,Hr,jt=Wt.length;for(er=Wt[jt-1],Zt=0;Zt<jt;Zt++)Nr[Zt]=Ko(er,ur=Wt[Zt%jt],Hr=Wt[(Zt+1)%jt],ar),er=ur,ur=Hr;s.drawRoundPolygonPath(lt||r,X.x+Dt,X.y+ft,o*Fe,l*Ve,st,Nr)}else["roundrectangle","round-rectangle"].includes(be)?(tt="auto"===tt?tn(dt,Ke):tt,s.drawRoundRectanglePath(lt||r,X.x,X.y,dt,Ke,tt+(Ae+De+Qe)/2)):["cutrectangle","cut-rectangle"].includes(be)?s.drawCutRectanglePath(lt||r,X.x,X.y,dt,Ke,null,(tt="auto"===tt?8:tt)+(Ae+De+Qe)/4):["bottomroundrectangle","bottom-round-rectangle"].includes(be)?(tt="auto"===tt?tn(dt,Ke):tt,s.drawBottomRoundRectanglePath(lt||r,X.x,X.y,dt,Ke,tt+(Ae+De+Qe)/2)):"barrel"===be?s.drawBarrelPath(lt||r,X.x,X.y,dt,Ke):be.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(be)?(st=ti(ri(st,(Ae+De+Qe)/o)),s.drawPolygonPath(lt||r,X.x,X.y,o,l,st)):(st=ti(ri(st,-(Ae+De+Qe)/o)),s.drawPolygonPath(lt||r,X.x,X.y,o,l,st));if(h?r.stroke(lt):r.stroke(),"double"===$e){r.lineWidth=Ae/3;var vn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(lt):r.stroke(),r.globalCompositeOperation=vn}r.setLineDash&&r.setLineDash([])}};if("yes"===e.pstyle("ghost").value){var Rt=e.pstyle("ghost-offset-x").pfValue,Gt=e.pstyle("ghost-offset-y").pfValue,Bt=e.pstyle("ghost-opacity").value,Pt=Bt*f;r.translate(Rt,Gt),Te(),gt(),at(Bt*Q),ct(),Nt(Pt,!0),He(Bt*ye),ot(),Et(0!==K||0!==J),bt(0!==K||0!==J),Nt(Pt,!1),pt(Pt),r.translate(-Rt,-Gt)}h&&r.translate(-d.x,-d.y),a&&s.drawNodeUnderlay(r,e,d,o,l),h&&r.translate(d.x,d.y),Te(),gt(),at(),ct(),Nt(f,!0),He(),ot(),Et(0!==K||0!==J),bt(0!==K||0!==J),Nt(f,!1),pt(),h&&r.translate(-d.x,-d.y),s.drawElementText(r,e,null,n),a&&s.drawNodeOverlay(r,e,d,o,l),t&&r.translate(g.x1,g.y1)}}},lf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,a,i,s){if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),null==i||null==s){var h=n.padding();i=n.width()+2*h,s=n.height()+2*h}this.colorFillStyle(t,c[0],c[1],c[2],u),this.nodeShapes[d].draw(t,a.x,a.y,i+2*l,s+2*l,f),t.fill()}}}};dn.drawNodeOverlay=lf("overlay"),dn.drawNodeUnderlay=lf("underlay"),dn.hasPie=function(r){return(r=r[0])._private.hasPie},dn.hasStripe=function(r){return(r=r[0])._private.hasStripe},dn.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var h,a=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),f=Math.min(c,d)/2,v=0;if(this.usePaths()&&(l=0,u=0),"%"===i.units?f*=i.pfValue:void 0!==i.pfValue&&(f=i.pfValue/2),"%"===s.units?h=f*s.pfValue:void 0!==s.pfValue&&(h=s.pfValue/2),!(h>=f))for(var p=1;p<=a.pieBackgroundN;p++){var g=e.pstyle("pie-"+p+"-background-size").value,w=e.pstyle("pie-"+p+"-background-color").value,C=e.pstyle("pie-"+p+"-background-opacity").value*t,N=g/100;N+v>1&&(N=1-v);var z=1.5*Math.PI+2*Math.PI*v,F=(z+=o)+2*Math.PI*N;0===g||v>=1||v+N>1||(0===h?(r.beginPath(),r.moveTo(l,u),r.arc(l,u,f,z,F),r.closePath()):(r.beginPath(),r.arc(l,u,f,z,F),r.arc(l,u,h,F,z,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],C),r.fill(),v+=N)}},dn.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,s=n.y,o=e.width(),l=e.height(),u=0,c=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2)}var h=o,v=l;"%"===f.units?(h*=f.pfValue,v*=f.pfValue):void 0!==f.pfValue&&(h=f.pfValue,v=f.pfValue),c&&(i=0,s=0),s-=h/2,i-=v/2;for(var m=1;m<=a.stripeBackgroundN;m++){var p=e.pstyle("stripe-"+m+"-background-size").value,g=e.pstyle("stripe-"+m+"-background-color").value,w=e.pstyle("stripe-"+m+"-background-opacity").value*t,C=p/100;C+u>1&&(C=1-u),!(0===p||u>=1||u+C>1)&&(r.beginPath(),r.rect(i,s+v*u,h,v*C),r.closePath(),this.colorFillStyle(r,g[0],g[1],g[2],w),r.fill(),u+=C)}r.restore()};var ka,yr={};function uf(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function mm(r,e,t){void 0===t&&(t=e);var n=r.makeOffscreenCanvas(e,t),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function rl(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function xm(r,e){return!!e.picking||"solid"===r.pstyle("background-fill").value&&"none"===r.pstyle("background-image").strValue&&(0===r.pstyle("border-width").value||0===r.pstyle("border-opacity").value||"solid"===r.pstyle("border-style").value)}function Em(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function An(r,e,t){var n=r[0]/255,a=r[1]/255,i=r[2]/255,s=e,o=t||new Array(4);return o[0]=n*s,o[1]=a*s,o[2]=i*s,o[3]=s,o}function ra(r,e){var t=e||new Array(4);return t[0]=(255&r)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Tm(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function cf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function df(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function Dm(r,e,t,n,a,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*n,a);case r.INT:return new Int32Array(t.buffer,i*n,a)}}function Vr(r,e,t,n){var i=fe(cf(r,t),3),s=i[0],o=i[1],l=i[2],u=df(r,o,e*s),c=s*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*c,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),o===r.FLOAT?r.vertexAttribPointer(n,s,o,!1,c,0):o===r.INT&&r.vertexAttribIPointer(n,s,o,c,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var f=new Array(e),h=0;h<e;h++)f[h]=Dm(r,o,u,c,s,h);return d.dataArray=u,d.stride=c,d.size=s,d.getView=function(v){return f[v]},d.setPoint=function(v,m,p){var g=f[v];g[0]=m,g[1]=p},d.bufferSubData=function(v){r.bindBuffer(r.ARRAY_BUFFER,d),v?r.bufferSubData(r.ARRAY_BUFFER,0,u,0,v*s):r.bufferSubData(r.ARRAY_BUFFER,0,u)},d}yr.getPixelRatio=function(){var r=this.data.contexts[0];return null!=this.forcedPixelRatio?this.forcedPixelRatio:(this.cy.window().devicePixelRatio||1)/(r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1)},yr.paintCache=function(r){for(var n,e=this.paintCaches=this.paintCaches||[],t=!0,a=0;a<e.length;a++)if((n=e[a]).context===r){t=!1;break}return t&&e.push(n={context:r}),n},yr.createGradientStyleFor=function(r,e,t,n,a){var i,s=this.usePaths(),o=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if("radial-gradient"===n)if(t.isEdge()){var u=t.sourceEndpoint(),c=t.targetEndpoint(),d=t.midpoint(),f=mn(u,d),h=mn(c,d);i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,h))}else{var v=s?{x:0,y:0}:t.position(),m=t.paddedWidth(),p=t.paddedHeight();i=r.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(m,p))}else if(t.isEdge()){var g=t.sourceEndpoint(),w=t.targetEndpoint();i=r.createLinearGradient(g.x,g.y,w.x,w.y)}else{var C=s?{x:0,y:0}:t.position(),V=t.paddedWidth()/2,F=t.paddedHeight()/2;switch(t.pstyle("background-gradient-direction").value){case"to-bottom":i=r.createLinearGradient(C.x,C.y-F,C.x,C.y+F);break;case"to-top":i=r.createLinearGradient(C.x,C.y+F,C.x,C.y-F);break;case"to-left":i=r.createLinearGradient(C.x+V,C.y,C.x-V,C.y);break;case"to-right":i=r.createLinearGradient(C.x-V,C.y,C.x+V,C.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(C.x-V,C.y-F,C.x+V,C.y+F);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(C.x-V,C.y+F,C.x+V,C.y-F);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(C.x+V,C.y-F,C.x-V,C.y+F);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(C.x+V,C.y+F,C.x-V,C.y-F)}}if(!i)return null;for(var W=l.length===o.length,Z=o.length,K=0;K<Z;K++)i.addColorStop(W?l[K]:K/(Z-1),"rgba("+o[K][0]+","+o[K][1]+","+o[K][2]+","+a+")");return i},yr.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a},yr.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"},yr.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientFillStyle(r,e,n,t);else{var a=e.pstyle("background-color").value;this.colorFillStyle(r,a[0],a[1],a[2],t)}},yr.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a},yr.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"},yr.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientStrokeStyle(r,e,n,t);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(r,a[0],a[1],a[2],t)}},yr.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],s=e.getPixelRatio();(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=e.motionBlurPxRatio);var c,l=a*s,u=i*s;if(l!==e.canvasWidth||u!==e.canvasHeight){e.fontCaches=null;var d=t.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)(c=t.canvases[f]).width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";for(f=0;f<e.BUFFER_COUNT;f++)(c=t.bufferCanvases[f]).width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,s<=1&&(c=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=l*e.textureMult,c.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}},yr.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})},yr.clearCanvas=function(){var r=this,e=r.data;function t(n){n.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])},yr.render=function(r){var e=this;r=r||ql();var t=e.cy,n=r.forcedContext,a=r.drawAllLayers,i=r.drawOnlyNodeLayer,s=r.forcedZoom,o=r.forcedPan,l=void 0===r.forcedPxRatio?this.getPixelRatio():r.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=void 0!==r.motionBlur?r.motionBlur:e.motionBlur,h=e.motionBlurPxRatio,v=t.hasCompoundNodes(),m=e.hoverData.draggingEles,g=f=f&&!n&&e.motionBlurEnabled&&!(e.hoverData.selecting||e.touchData.selecting);n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(null==e.mbFrames&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(g=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var w=t.style(),C=t.zoom(),N=void 0!==s?s:C,z=t.pan(),V={x:z.x,y:z.y},F={zoom:C,pan:{x:z.x,y:z.y}},U=e.prevViewport;!(void 0===U||F.zoom!==U.zoom||F.pan.x!==U.pan.x||F.pan.y!==U.pan.y)&&!(m&&!v)&&(e.motionBlurPxRatio=1),o&&(V=o),N*=l,V.x*=l,V.y*=l;var Z=e.getCachedZSortedEles();function K(He,Te,Ie,Pe,ze){var rt=He.globalCompositeOperation;He.globalCompositeOperation="destination-out",e.colorFillStyle(He,255,255,255,e.motionBlurTransparency),He.fillRect(Te,Ie,Pe,ze),He.globalCompositeOperation=rt}function J(He,Te){var Ie,Pe,ze,rt;e.clearingMotionBlur||He!==u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]&&He!==u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]?(Ie=V,Pe=N,ze=e.canvasWidth,rt=e.canvasHeight):(Ie={x:z.x*h,y:z.y*h},Pe=C*h,ze=e.canvasWidth*h,rt=e.canvasHeight*h),He.setTransform(1,0,0,1,0,0),"motionBlur"===Te?K(He,0,0,ze,rt):!n&&(void 0===Te||Te)&&He.clearRect(0,0,ze,rt),a||(He.translate(Ie.x,Ie.y),He.scale(Pe,Pe)),o&&He.translate(o.x,o.y),s&&He.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var Q=e.data.bufferContexts[e.TEXTURE_BUFFER];Q.setTransform(1,0,0,1,0,0),Q.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:Q,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult}),(F=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight}).mpan={x:(0-F.pan.x)/F.zoom,y:(0-F.pan.y)/F.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var de=e.textureCache.texture;F=e.textureCache.viewport,(le=u.contexts[e.NODE]).setTransform(1,0,0,1,0,0),f?K(le,0,0,F.width,F.height):le.clearRect(0,0,F.width,F.height);var he=w.core("outside-texture-bg-color").value,ue=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(le,he[0],he[1],he[2],ue),le.fillRect(0,0,F.width,F.height),C=t.zoom(),J(le,!1),le.clearRect(F.mpan.x,F.mpan.y,F.width/F.zoom/l,F.height/F.zoom/l),le.drawImage(de,F.mpan.x,F.mpan.y,F.width/F.zoom/l,F.height/F.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var le,ge=t.extent(),Se=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),Le=e.hideEdgesOnViewport&&Se,ye=[];if(ye[e.NODE]=!c[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,ye[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),ye[e.DRAG]=!c[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,ye[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||ye[e.NODE]){var De=f&&!ye[e.NODE]&&1!==h;J(le=n||(De?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),f&&!De?"motionBlur":void 0),Le?e.drawCachedNodes(le,Z.nondrag,l,ge):e.drawLayeredElements(le,Z.nondrag,l,ge),e.debug&&e.drawDebugPoints(le,Z.nondrag),!a&&!f&&(c[e.NODE]=!1)}!i&&(c[e.DRAG]||a||ye[e.DRAG])&&(De=f&&!ye[e.DRAG]&&1!==h,J(le=n||(De?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]),f&&!De?"motionBlur":void 0),Le?e.drawCachedNodes(le,Z.drag,l,ge):e.drawCachedElements(le,Z.drag,l,ge),e.debug&&e.drawDebugPoints(le,Z.drag),!a&&!f&&(c[e.DRAG]=!1));if(this.drawSelectionRectangle(r,J),f&&1!==h){var Qe=u.contexts[e.DRAG],tt=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],at=function(Te,Ie,Pe){Te.setTransform(1,0,0,1,0,0),Pe||!g?Te.clearRect(0,0,e.canvasWidth,e.canvasHeight):K(Te,0,0,e.canvasWidth,e.canvasHeight),Te.drawImage(Ie,0,0,e.canvasWidth*h,e.canvasHeight*h,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||ye[e.NODE])&&(at(u.contexts[e.NODE],e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ye[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||ye[e.DRAG])&&(at(Qe,tt,ye[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=F,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(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,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},100)),n||t.emit("render")},yr.drawSelectionRectangle=function(r,e){var t=this,a=t.data,i=t.cy.style(),o=r.drawAllLayers,l=a.canvasNeedsRedraw;if(t.showFps||!r.drawOnlyNodeLayer&&l[t.SELECT_BOX]&&!o){var c=r.forcedContext||a.contexts[t.SELECT_BOX];if(e(c),1==t.selection[4]&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),f=i.core("selection-box-border-width").value/d;c.lineWidth=f,c.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+")",c.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),f>0&&(c.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+")",c.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(a.bgActivePosistion&&!t.hoverData.selecting){d=t.cy.zoom();var h=a.bgActivePosistion;c.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+")",c.beginPath(),c.arc(h.x,h.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var v=t.lastRedrawTime;if(t.showFps&&v){v=Math.round(v);var m=Math.round(1e3/v),p="1 frame = "+v+" ms = "+m+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!ka){var g=c.measureText(p);ka=g.actualBoundingBoxAscent}c.fillText(p,0,ka),c.strokeRect(0,ka+10,250,20),c.fillRect(0,ka+10,250*Math.min(m/60,1),20)}o||(l[t.SELECT_BOX]=!1)}};var ff=typeof Float32Array<"u"?Float32Array:Array;function nl(){var r=new ff(9);return ff!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function hf(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Gi(r,e,t){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=t[0],h=t[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=s,r[4]=o,r[5]=l,r[6]=f*n+h*s+u,r[7]=f*a+h*o+c,r[8]=f*i+h*l+d,r}function vf(r,e,t){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=Math.sin(t),h=Math.cos(t);return r[0]=h*n+f*s,r[1]=h*a+f*o,r[2]=h*i+f*l,r[3]=h*s-f*n,r[4]=h*o-f*a,r[5]=h*l-f*i,r[6]=u,r[7]=c,r[8]=d,r}function al(r,e,t){var n=t[0],a=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=a*e[3],r[4]=a*e[4],r[5]=a*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});var Rm=function(){return ie(function r(e,t,n,a){_(this,r),this.debugID=Math.floor(1e4*Math.random()),this.r=e,this.texSize=t,this.texRows=n,this.texHeight=Math.floor(t/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(e,t,t),this.scratch=a(e,t,this.texHeight,"scratch")},[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var n=t.w,a=t.h,s=this.texSize,o=this.texHeight/a,l=n*o,u=a*o;return l>s&&(l=n*(o=s/n),u=a*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(t,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,f=u.texH,h=function(C,N){if(a&&N){var z=N.context,U=C.x,W=l*C.row;z.save(),z.translate(U,W),z.scale(c,c),a(z,n),z.restore()}},v=[null,null],m=function(){h(i.freePointer,i.canvas),v[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:d,h:f},v[1]={x:i.freePointer.x+d,y:i.freePointer.row*l,w:0,h:f},i.freePointer.x+=d,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=s)m();else{if(this.freePointer.row>=o-1)return!1;this.freePointer.x===s?(g(),m()):this.enableWrapping?function(){var C=i.scratch,N=i.canvas;C.clear(),h({x:0,row:0},C);var z=s-i.freePointer.x,V=d-z,F=l,U=i.freePointer.x,W=i.freePointer.row*l,Z=z;N.context.drawImage(C,0,0,Z,F,U,W,Z,F),v[0]={x:U,y:W,w:Z,h:f};var J=(i.freePointer.row+1)*l,Q=V;N&&N.context.drawImage(C,z,0,Q,F,0,J,Q,F),v[1]={x:0,y:J,w:Q,h:f},i.freePointer.x=V,i.freePointer.row++}():(g(),m())}return this.keyToLocation.set(t,v),this.needsBuffer=!0,v}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return 0===this.freePointer.x&&0===this.freePointer.row}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(t);return!(this.freePointer.x+i.texW>n)||this.freePointer.row<a-1}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=function Cm(r){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}(t)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),Mm=function(){return ie(function r(e,t,n,a){_(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set},[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){return new Rm(this.r,this.texSize,this.texRows,this.createTextureCanvas)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,i=this.createTextureCanvas,s=Math.floor(n/this.texRows);this.scratch=i(t,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(t,n,a){var i=this.styleKeyToAtlas.get(t);return i||((!(i=this.atlases[this.atlases.length-1])||!i.canFit(n))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(t,n,a),this.styleKeyToAtlas.set(t,i)),i}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,n=this.markedKeys;if(0!==n.size){var l,a=[],i=new Map,s=null,o=H(this.atlases);try{var u=function(){var d=l.value,f=d.getKeys(),h=function Om(r,e){return r.intersection?r.intersection(e):new Set(te(r).filter(function(t){return e.has(t)}))}(n,f);if(0===h.size)return a.push(d),f.forEach(function(z){return i.set(z,d)}),1;s||(s=t._createAtlas(),a.push(s));var m,v=H(f);try{for(v.s();!(m=v.n()).done;){var p=m.value;if(!h.has(p)){var w=fe(d.getOffsets(p),2),C=w[0];s.canFit({w:C.w+w[1].w,h:C.h})||(s.lock(),s=t._createAtlas(),a.push(s)),d.canvas&&(t._copyTextureToNewAtlas(p,d,s),i.set(p,s))}}}catch(z){v.e(z)}finally{v.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(c){o.e(c)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}else console.log("nothing to garbage collect")}},{key:"_copyTextureToNewAtlas",value:function(t,n,a){var s=fe(n.getOffsets(t),2),o=s[0],l=s[1];if(0===l.w)a.draw(t,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var c=o.w+l.w,d=o.h;a.draw(t,{w:c,h:d},function(f){f.drawImage(u,0,0,c,d,0,0,c,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}(),Pm=function(){return ie(function r(e,t){_(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map},[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var a=this.globalOptions,i=a.webglTexSize,o=n.texRows,l=this._cacheScratchCanvas(a.createTextureCanvas),u=new Mm(this.r,i,o,l);this.collections.set(t,u)}},{key:"addRenderType",value:function(t,n){var a=n.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),s=mt({type:t,atlasCollection:i},n);this.renderTypes.set(t,s)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var n=-1,a=-1,i=null;return function(s,o,l,u){return u?((!i||o!=n||l!=a)&&(n=o,a=l,i=t(s,o,l)),i):t(s,o,l)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var v,n=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=a.forceRedraw,s=void 0!==i&&i,o=a.filterEle,l=void 0===o?function(){return!0}:o,u=a.filterType,c=void 0===u?function(){return!0}:u,d=!1,f=!1,h=H(t);try{for(h.s();!(v=h.n()).done;){var m=v.value;if(l(m)){var g,p=H(this.renderTypes.values());try{var w=function(){var N=g.value,z=N.type;if(c(z)){var V=n.collections.get(N.collection),F=N.getKey(m),U=Array.isArray(F)?F:[F];if(s)U.forEach(function(J){return V.markKeyForGC(J)}),f=!0;else{var W=N.getID?N.getID(m):m.id(),Z=n._key(z,W),K=n.typeAndIdToKey.get(Z);void 0!==K&&!Em(U,K)&&(d=!0,n.typeAndIdToKey.delete(Z),K.forEach(function(J){return V.markKeyForGC(J)}))}}};for(p.s();!(g=p.n()).done;)w()}catch(C){p.e(C)}finally{p.f()}}}}catch(C){h.e(C)}finally{h.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var n,t=H(this.collections.values());try{for(t.s();!(n=t.n()).done;)n.value.gc()}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,a,i){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(i,a,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,a.w,a.h),f.clip(),s.drawElement(f,t,a,!0,!0),f.restore()):s.drawElement(f,t,a,!0,!0),l=!0});if(l){var c=s.getID?s.getID(t):t.id(),d=this._key(n,c);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(i):this.typeAndIdToKey.set(d,[i])}return u}},{key:"getAtlasInfo",value:function(t,n){var a=this,i=this.renderTypes.get(n),s=i.getKey(t);return(Array.isArray(s)?s:[s]).map(function(l){var u=i.getBoundingBox(t,l),c=a.getOrCreateAtlas(t,n,u,l),f=fe(c.getOffsets(l),2),h=f[0];return{atlas:c,tex:h,tex1:h,tex2:f[1],bb:u}})}},{key:"getDebugInfo",value:function(){var a,t=[],n=H(this.collections);try{for(n.s();!(a=n.n()).done;){var i=fe(a.value,2),s=i[0],l=i[1].getCounts();t.push({type:s,keyCount:l.keyCount,atlasCount:l.atlasCount})}}catch(d){n.e(d)}finally{n.f()}return t}}])}(),km=function(){return ie(function r(e){_(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]},[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(t)}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])}(),Ba={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},zm=function(){return ie(function r(e,t,n){_(this,r),this.r=e,this.gl=t,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=mm,this.atlasManager=new Pm(e,n),this.batchManager=new km(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ba.SCREEN),this.pickingProgram=this._createShaderProgram(Ba.PICKING),this.vao=this._createVAO()},[{key:"addAtlasCollection",value:function(t,n){this.atlasManager.addAtlasCollection(t,n)}},{key:"addTextureAtlasRenderType",value:function(t,n){this.atlasManager.addRenderType(t,n)}},{key:"addSimpleShapeRenderType",value:function(t,n){this.simpleShapeOptions.set(t,n)}},{key:"invalidate",value:function(t){var a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).type,i=this.atlasManager;return a?i.invalidate(t,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var n=this.gl,a="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat(0,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(4," || aVertType == ").concat(7," \n || aVertType == ").concat(5," || aVertType == ").concat(6,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(1,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(2,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n "),i=this.batchManager.getIndexArray(),o=function ym(r,e,t){var n=uf(r,r.VERTEX_SHADER,e),a=uf(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,n),r.attachShader(i,a),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}(n,a,"#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join("\n\t"),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat("\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n","\n ").concat("\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n","\n ").concat("\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n","\n ").concat("\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x<q.y)? 1.570796327 : 0.0;\n for( int i=0; i<5; i++ ) {\n vec2 cs = vec2(cos(w),sin(w));\n vec2 u = ab*vec2( cs.x,cs.y);\n vec2 v = ab*vec2(-cs.y,cs.x);\n w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));\n }\n \n // compute final point and distance\n float d = length(p-ab*vec2(cos(w),sin(w)));\n \n // return signed distance\n return (dot(p/ab,p/ab)>1.0) ? d : -d;\n }\n","\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n // look up the texel from the texture unit\n ").concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join("\n\telse "),"\n } \n else if(vVertType == ").concat(3,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(4," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(4," || vVertType == ").concat(7," \n || vVertType == ").concat(5," || vVertType == ").concat(6,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(4,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(7," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(7,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(t.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "));o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,a=this.gl,i=this.program,s=a.createVertexArray();return a.bindVertexArray(s),function Sm(r,e,t,n){var i=fe(cf(r,e),2),s=i[0],o=i[1],l=df(r,o,n),u=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null)}(a,"vec2",i.aPosition,t),this.transformBuffer=function Lm(r,e,t){for(var a=new Float32Array(9*e),i=new Array(e),s=0;s<e;s++)i[s]=new Float32Array(a.buffer,9*s*4,9);var l=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,a.byteLength,r.DYNAMIC_DRAW);for(var u=0;u<3;u++){var c=t+u;r.enableVertexAttribArray(c),r.vertexAttribPointer(c,3,r.FLOAT,!1,36,12*u),r.vertexAttribDivisor(c,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),l.getMatrixView=function(d){return i[d]},l.setData=function(d,f){i[f].set(d,0)},l.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferSubData(r.ARRAY_BUFFER,0,a)},l}(a,n,i.aTransform),this.indexBuffer=Vr(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Vr(a,n,"int",i.aVertType),this.atlasIdBuffer=Vr(a,n,"int",i.aAtlasId),this.texBuffer=Vr(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Vr(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Vr(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Vr(a,n,"vec2",i.aLineWidth),this.colorBuffer=Vr(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Vr(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Vr(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),s}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Kr(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ba.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return!!t.visible()&&(!n||!n.isVisible||n.isVisible(t))}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(t,o)&&(!t.isEdge()||this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(t);if(1===l)return;if(2==l)return void this.drawPickingRectangle(t,n,a)}var d,c=H(i.getAtlasInfo(t,a));try{for(c.s();!(d=c.n()).done;){var f=d.value,h=f.atlas,v=f.tex1,m=f.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var p=s.getAtlasIndexForBatch(h),g=0,w=[[v,!0],[m,!1]];g<w.length;g++){var C=fe(w[g],2),N=C[0],z=C[1];if(0!=N.w){var V=this.instanceCount;this.vertTypeBuffer.getView(V)[0]=0,ra(n,this.indexBuffer.getView(V)),this.atlasIdBuffer.getView(V)[0]=p;var W=this.texBuffer.getView(V);W[0]=N.x,W[1]=N.y,W[2]=N.w,W[3]=N.h;var Z=this.transformBuffer.getMatrixView(V);this.setTransformMatrix(t,Z,o,f,z),this.instanceCount++,z||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(K){c.e(K)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=t.pstyle(a.shapeProps.padding).pfValue),i){var u=i.tex1,d=u.w/(u.w+i.tex2.w);s||(d=1-d);var f=this._getAdjustedBB(i.bb,o,s,d);this._applyTransformMatrix(n,f,a,t)}else{var h=a.getBoundingBox(t),v=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(n,v,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var s,o;hf(t);var l=a.getRotation?a.getRotation(i):0;if(0!==l){var u=a.getRotationPoint(i);Gi(t,t,[u.x,u.y]),vf(t,t,l);var f=a.getRotationOffset(i);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;Gi(t,t,[s,o]),al(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var s=t.x1,o=t.y1,l=t.w,u=t.h;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*i;return a&&i<1?l=f:!a&&i<1&&(s+=d=l-f,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:t.yOffset}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=4,ra(n,this.indexBuffer.getView(s)),An([0,0,0],1,this.colorBuffer.getView(s));var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(void 0===o||i.isSimple&&!i.isSimple(t,this.renderTarget))return void this.drawTexture(t,n,a);var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,5===o||6===o){var u=i.getBoundingBox(t),c=this._getCornerRadius(t,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,6===o&&(d[0]=0,d[2]=0)}ra(n,this.indexBuffer.getView(l));var h=this.renderTarget.picking?1:"node-body"===a?t.effectiveOpacity():1,v=this.renderTarget.picking?1:t.pstyle(s.opacity).value*h;An(t.pstyle(s.color).value,v,this.colorBuffer.getView(l));var g=this.lineWidthBuffer.getView(l);if(g[0]=0,g[1]=0,s.border){var w=t.pstyle("border-width").value;if(w>0){An(t.pstyle("border-color").value,h*t.pstyle("border-opacity").value,this.borderColorBuffer.getView(l));var V=t.pstyle("border-position").value;if("inside"===V)g[0]=0,g[1]=-w;else if("outside"===V)g[0]=w,g[1]=0;else{var F=w/2;g[0]=F,g[1]=-F}}}var U=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,U,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){switch(t.pstyle(n).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,s=a.h;if("auto"===t.pstyle(n).value)return tn(i,s);var o=t.pstyle(n).pfValue;return Math.min(o,s/2,i/2)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var s,o,l,i=t._private.rscratch;if(!("source"===a?(s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle),isNaN(s)||null==s||isNaN(o)||null==o||isNaN(l)||null==l||"none"===t.pstyle(a+"-arrow-shape").value)){var c=t.pstyle(a+"-arrow-color").value,h=t.pstyle("opacity").value*t.pstyle("line-opacity").value,v=t.pstyle("width").pfValue,m=t.pstyle("arrow-scale").value,p=this.r.getArrowWidth(v,m),g=this.instanceCount,w=this.transformBuffer.getMatrixView(g);hf(w),Gi(w,w,[s,o]),al(w,w,[p,p]),vf(w,w,l),this.vertTypeBuffer.getView(g)[0]=3,ra(n,this.indexBuffer.getView(g)),An(c,h,this.colorBuffer.getView(g)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var a=this._getEdgePoints(t);if(a){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*s;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==a.length){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=1,ra(n,this.indexBuffer.getView(c)),An(l,u,this.colorBuffer.getView(c)),this.lineWidthBuffer.getView(c)[0]=o;var v=this.pointAPointBBuffer.getView(c);v[0]=a[0],v[1]=a[1],v[2]=a[2],v[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var m=0;m<a.length-2;m+=2){var p=this.instanceCount;this.vertTypeBuffer.getView(p)[0]=2,ra(n,this.indexBuffer.getView(p)),An(l,u,this.colorBuffer.getView(p)),this.lineWidthBuffer.getView(p)[0]=o;var N=a[m-2],z=a[m-1],V=a[m],F=a[m+1],U=a[m+2],W=a[m+3],Z=a[m+4],K=a[m+5];0==m&&(N=2*V-U+.001,z=2*F-W+.001),m==a.length-4&&(Z=2*U-V+.001,K=2*W-F+.001);var J=this.pointAPointBBuffer.getView(p);J[0]=N,J[1]=z,J[2]=V,J[3]=F;var Q=this.pointCPointDBuffer.getView(p);Q[0]=U,Q[1]=W,Q[2]=Z,Q[3]=K,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||null==n.allpts||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(4==a.length)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){return Math.min(Math.max(15,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(4==t.length)return t;for(var a=Array(2*(n+1)),i=0;i<=n;i++)0==i?(a[0]=t[0],a[1]=t[1]):i==n?(a[2*i]=t[t.length-2],a[2*i+1]=t[t.length-1]):this._setCurvePoint(t,i/n,a,2*i);return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(!(t.length<=2)){for(var s=Array(t.length-2),o=0;o<s.length;o+=2){var u=(1-n)*t[o+1]+n*t[o+3];s[o]=(1-n)*t[o]+n*t[o+2],s[o+1]=u}return this._setCurvePoint(s,n,a,i)}a[i]=t[0],a[i+1]=t[1]}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(0!==i){var s=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(s),t.bindVertexArray(n);var l,o=H(this.buffers);try{for(o.s();!(l=o.n()).done;)l.value.bufferSubData(i)}catch(v){o.e(v)}finally{o.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var f=0;f<c.length;f++)t.activeTexture(t.TEXTURE0+f),t.bindTexture(t.TEXTURE_2D,c[f].texture),t.uniform1i(s.uTextures[f],f);t.uniform1f(s.uZoom,function bm(r){var e=r.pixelRatio;return r.cy.zoom()*e}(this.r)),t.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var h=An(this.bgColor,1);t.uniform4fv(s.uBGColor,h),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(s,o){return s+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(s,o){return s+o.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])}(),yf={};function mf(r,e){return vr(r._private.rscratch,"labelWrapCachedLines",e)||[]}yf.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=function Vm(r){var e=r.cy.container();return wl(e&&e.style&&e.style.backgroundColor||"white")}(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=function Am(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,a,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new zm(t,n,r);var a=function(d){return function(f){return t.getTextAngle(f,d)}},i=function(d){return function(f){var h=f.pstyle(d);return h&&h.value}},s=function(d){return function(f){return f.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){return"yes"===d.pstyle("text-events").strValue?2:1},l=function(d){var f=d.position(),h=f.x,v=f.y,m=d.outerWidth(),p=d.outerHeight();return{w:m,h:p,x1:h-m/2,y1:v-p/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:xm,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:ol(e.getLabelKey,null),getBoundingBox:ll(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:ol(e.getSourceLabelKey,"source"),getBoundingBox:ll(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:ol(e.getTargetLabelKey,"target"),getBoundingBox:ll(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ca(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var f=!1;d&&d.length>0&&(f|=t.drawing.invalidate(d)),f&&u()}),function Hm(r){var e=r.render;r.render=function(i){i=i||{},r.webgl&&(r.cy.zoom()>7.99?(function Um(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}(r),e.call(r,i)):(function Xm(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}(r),wf(r,i,Ba.SCREEN)))};var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0},r.findNearestElements=function(i,s,o,l){return function Km(r,e,t){var i,s,l,n=function $m(r,e,t){var i,s,u=rl(r),f=function wm(r,e,t,n,a){var s=a*t+e.y;return[n*t+e.x,s=Math.round(r.canvasHeight-s)]}(r,u.pan,u.zoom,e,t),h=fe(f,2);i=h[0]-3,s=h[1]-3;var g=r.data.contexts[r.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),wf(r,null,Ba.PICKING),r.pickingFrameBuffer.needsDraw=!1);var C=new Uint8Array(144);g.readPixels(i,s,6,6,g.RGBA,g.UNSIGNED_BYTE,C),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var N=new Set,z=0;z<36;z++){var F=Tm(C.slice(4*z,4*z+4))-1;F>=0&&N.add(F)}return N}(r,e,t),a=r.getCachedZSortedEles(),o=H(n);try{for(o.s();!(l=o.n()).done;){var c=a[l.value];if(!i&&c.isNode()&&(i=c),!s&&c.isEdge()&&(s=c),i&&s)break}}catch(d){o.e(d)}finally{o.f()}return[i,s].filter(Boolean)}(r,i,s)};var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0};var a=r.notify;r.notify=function(i,s){a.call(r,i,s),"viewport"===i||"bounds"===i?r.pickingFrameBuffer.needsDraw=!0:"background"===i&&r.drawing.invalidate(s,{type:"node-body"})}}(t)};var ol=function(e,t){return function(n){var a=e(n),i=mf(n,t);return i.length>1?i.map(function(s,o){return"".concat(a,"_").concat(o)}):a}},ll=function(e,t){return function(n,a){var i=e(n);if("string"==typeof a){var s=a.indexOf("_");if(s>0){var o=Number(a.substring(s+1)),l=mf(n,t),u=i.h/l.length,c=u*o;return{x1:i.x1,w:i.w,y1:i.y1+c,h:u,yOffset:c}}}return i}};function bf(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=rl(r),i=a.pan,s=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(s,s)}function ul(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function wf(r,e,t){var n;r.webglDebug&&(n=performance.now());var a=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&function Ym(r,e){r.drawSelectionRectangle(e,function(t){return bf(r,t)})}(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=function jm(r){var e=r.canvasWidth,t=r.canvasHeight,n=rl(r),a=n.pan,i=n.zoom,s=nl();Gi(s,s,[a.x,a.y]),al(s,s,[i,i]);var o=nl();!function Nm(r,e,t){r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1}(o,e,t);var l=nl();return function Im(r,e,t){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=t[0],h=t[1],v=t[2],m=t[3],p=t[4],g=t[5],w=t[6],C=t[7],N=t[8];r[0]=f*n+h*s+v*u,r[1]=f*a+h*o+v*c,r[2]=f*i+h*l+v*d,r[3]=m*n+p*s+g*u,r[4]=m*a+p*o+g*c,r[5]=m*i+p*l+g*d,r[6]=w*n+C*s+N*u,r[7]=w*a+C*o+N*c,r[8]=w*i+C*l+N*d}(l,o,s),l}(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(o,t),t.screen){for(var u=0;u<l.nondrag.length;u++)ul(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)ul(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)ul(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(function Wm(r){var e=r.data.contexts[r.NODE];e.save(),bf(r,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()}(r),function qm(r){var e=function(a,i,s){for(var o=a.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=o.atlases,c=0;c<u.length;c++){var f=u[c].canvas;if(f){var h=f.width,v=f.height,m=h*c,p=f.height*s;l.save(),l.scale(.4,.4),l.drawImage(f,m,p),l.strokeStyle="black",l.rect(m,p,h,v),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var f=performance.now(),v=Math.ceil(f-n),m=a.getDebugInfo(),p=["".concat(i," elements"),"".concat(m.totalInstances," instances"),"".concat(m.batchCount," batches"),"".concat(m.totalAtlases," atlases"),"".concat(m.wrappedCount," wrapped textures"),"".concat(m.simpleCount," simple shapes")].join(", ");console.log("WebGL (".concat(t.name,") - frame time ").concat(v,"ms")),console.log("Totals:"),console.log(" ".concat(p)),console.log("Texture Atlases Used:");var C,w=H(m.atlasInfo);try{for(w.s();!(C=w.n()).done;){var N=C.value;console.log(" ".concat(N.type,": ").concat(N.keyCount," keys, ").concat(N.atlasCount," atlases"))}}catch(z){w.e(z)}finally{w.f()}console.log("")}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}for(var fn={drawPolygonPath:function(r,e,t,n,a,i){var s=n/2,o=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+s*i[0],t+o*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+s*i[2*l],t+o*i[2*l+1]);r.closePath()},drawRoundPolygonPath:function(r,e,t,n,a,i,s){s.forEach(function(o){return _d(r,o)}),r.closePath()},drawRoundRectanglePath:function(r,e,t,n,a,i){var s=n/2,o=a/2,l="auto"===i?tn(n,a):Math.min(i,o,s);r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.arcTo(e+s,t-o,e+s,t,l),r.arcTo(e+s,t+o,e,t+o,l),r.arcTo(e-s,t+o,e-s,t,l),r.arcTo(e-s,t-o,e,t-o,l),r.lineTo(e,t-o),r.closePath()},drawBottomRoundRectanglePath:function(r,e,t,n,a,i){var s=n/2,o=a/2,l="auto"===i?tn(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.lineTo(e+s,t-o),r.lineTo(e+s,t),r.arcTo(e+s,t+o,e,t+o,l),r.arcTo(e-s,t+o,e-s,t,l),r.lineTo(e-s,t-o),r.lineTo(e,t-o),r.closePath()},drawCutRectanglePath:function(r,e,t,n,a,i,s){var o=n/2,l=a/2,u="auto"===s?8:s;r.beginPath&&r.beginPath(),r.moveTo(e-o+u,t-l),r.lineTo(e+o-u,t-l),r.lineTo(e+o,t-l+u),r.lineTo(e+o,t+l-u),r.lineTo(e+o-u,t+l),r.lineTo(e-o+u,t+l),r.lineTo(e-o,t+l-u),r.lineTo(e-o,t-l+u),r.closePath()},drawBarrelPath:function(r,e,t,n,a){var i=n/2,s=a/2,o=e-i,l=e+i,u=t-s,c=t+s,d=Ts(n,a),f=d.widthOffset,h=d.heightOffset,v=d.ctrlPtOffsetPct*f;r.beginPath&&r.beginPath(),r.moveTo(o,u+h),r.lineTo(o,c-h),r.quadraticCurveTo(o+v,c,o+f,c),r.lineTo(l-f,c),r.quadraticCurveTo(l-v,c,l,c-h),r.lineTo(l,u+h),r.quadraticCurveTo(l-v,u,l-f,u),r.lineTo(o+f,u),r.quadraticCurveTo(o+v,u,o,u+h),r.closePath()}},xf=Math.sin(0),Ef=Math.cos(0),cl={},dl={},Tf=Math.PI/40,aa=0*Math.PI;aa<2*Math.PI;aa+=Tf)cl[aa]=Math.sin(aa),dl[aa]=Math.cos(aa);fn.drawEllipsePath=function(r,e,t,n,a){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,a/2,0,0,2*Math.PI);else for(var i,s,o=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=Tf)i=e-o*cl[u]*xf+o*dl[u]*Ef,s=t+l*dl[u]*xf+l*cl[u]*Ef,0===u?r.moveTo(i,s):r.lineTo(i,s);r.closePath()};var Ga={};function Cf(r){var e=r.indexOf(",");return r.substr(e+1)}function Df(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new Vn(function(a,i){try{e.toBlob(function(s){null!=s?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(s){i(s)}});case"blob":return function Zm(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),a=new Uint8Array(n),i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return new Blob([n],{type:e})}(Cf(n()),t);case"base64":return Cf(n());default:return n()}}Ga.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]},Ga.bufferCanvasImage=function(r){var e=this.cy,n=e.mutableElements().boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],s=r.full?Math.ceil(n.h):a[3],o=_e(r.maxWidth)||_e(r.maxHeight),l=this.getPixelRatio(),u=1;if(void 0!==r.scale)i*=r.scale,s*=r.scale,u=r.scale;else if(o){var c=1/0,d=1/0;_e(r.maxWidth)&&(c=u*r.maxWidth/i),_e(r.maxHeight)&&(d=u*r.maxHeight/s),i*=u=Math.min(c,d),s*=u}o||(i*=l,s*=l,u*=l);var f=document.createElement("canvas");f.width=i,f.height=s,f.style.width=i+"px",f.style.height=s+"px";var h=f.getContext("2d");if(i>0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(r.full)h.translate(-n.x1*u,-n.y1*u),h.scale(u,u),this.drawElements(h,v),h.scale(1/u,1/u),h.translate(n.x1*u,n.y1*u);else{var m=e.pan(),p={x:m.x*u,y:m.y*u};u*=e.zoom(),h.translate(p.x,p.y),h.scale(u,u),this.drawElements(h,v),h.scale(1/u,1/u),h.translate(-p.x,-p.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return f},Ga.png=function(r){return Df(r,this.bufferCanvasImage(r),"image/png")},Ga.jpg=function(r){return Df(r,this.bufferCanvasImage(r),"image/jpeg")};var Jm=Lf,St=Lf.prototype;function Lf(r){var e=this,n=e.cy.window().document;r.webgl&&(St.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(St.CANVAS_LAYERS),contexts:new Array(St.CANVAS_LAYERS),canvasNeedsRedraw:new Array(St.CANVAS_LAYERS),bufferCanvases:new Array(St.BUFFER_COUNT),bufferContexts:new Array(St.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=r.cy.container();o.appendChild(e.data.canvasContainer),o.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Je&&Je.userAgent.match(/msie|trident|edge/i)&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<St.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=St.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Xt("Could not create canvas of type "+d),Object.keys(l).forEach(function(He){c.style[He]=l[He]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(St.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}for(e.data.topCanvas=e.data.canvases[0],e.data.canvases[St.NODE].setAttribute("data-id","layer"+St.NODE+"-node"),e.data.canvases[St.SELECT_BOX].setAttribute("data-id","layer"+St.SELECT_BOX+"-selectbox"),e.data.canvases[St.DRAG].setAttribute("data-id","layer"+St.DRAG+"-drag"),e.data.canvases[St.WEBGL]&&e.data.canvases[St.WEBGL].setAttribute("data-id","layer"+St.WEBGL+"-webgl"),u=0;u<St.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=gr(),v=function(Te){return{x:-Te.w/2,y:-Te.h/2}},p=function(Te){return Te[0]._private.nodeKey},g=function(Te){return Te[0]._private.labelStyleKey},w=function(Te){return Te[0]._private.sourceLabelStyleKey},C=function(Te){return Te[0]._private.targetLabelStyleKey},N=function(Te,Ie,Pe,ze,rt){return e.drawElement(Te,Ie,Pe,!1,!1,rt)},z=function(Te,Ie,Pe,ze,rt){return e.drawElementText(Te,Ie,Pe,ze,"main",rt)},V=function(Te,Ie,Pe,ze,rt){return e.drawElementText(Te,Ie,Pe,ze,"source",rt)},F=function(Te,Ie,Pe,ze,rt){return e.drawElementText(Te,Ie,Pe,ze,"target",rt)},U=function(Te){return Te.boundingBox(),Te[0]._private.bodyBounds},W=function(Te){return Te.boundingBox(),Te[0]._private.labelBounds.main||f},Z=function(Te){return Te.boundingBox(),Te[0]._private.labelBounds.source||f},K=function(Te){return Te.boundingBox(),Te[0]._private.labelBounds.target||f},J=function(Te,Ie){return Ie},Q=function(Te){return function(Te){return{x:(Te.x1+Te.x2)/2,y:(Te.y1+Te.y2)/2}}(U(Te))},le=function(Te,Ie,Pe){var ze=Te?Te+"-":"";return{x:Ie.x+Pe.pstyle(ze+"text-margin-x").pfValue,y:Ie.y+Pe.pstyle(ze+"text-margin-y").pfValue}},de=function(Te,Ie,Pe){var ze=Te[0]._private.rscratch;return{x:ze[Ie],y:ze[Pe]}},he=function(Te){return le("",de(Te,"labelX","labelY"),Te)},ue=function(Te){return le("source",de(Te,"sourceLabelX","sourceLabelY"),Te)},ge=function(Te){return le("target",de(Te,"targetLabelX","targetLabelY"),Te)},Se=function(Te){return v(U(Te))},Le=function(Te){return v(Z(Te))},ye=function(Te){return v(K(Te))},De=function(Te){var Ie=W(Te),Pe=v(W(Te));if(Te.isNode()){switch(jn(Te.pstyle("text-halign").value)){case"left":Pe.x=-Ie.w-(Ie.leftPad||0);break;case"right":Pe.x=-(Ie.rightPad||0)}switch(Yn(Te.pstyle("text-valign").value)){case"top":Pe.y=-Ie.h-(Ie.topPad||0);break;case"bottom":Pe.y=-(Ie.botPad||0)}}return Pe},Ue=e.data.eleTxrCache=new Oa(e,{getKey:p,doesEleInvalidateKey:function(Te){var Ie=Te[0]._private;return!(Ie.oldBackgroundTimestamp===Ie.backgroundTimestamp)},drawElement:N,getBoundingBox:U,getRotationPoint:Q,getRotationOffset:Se,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),$e=e.data.lblTxrCache=new Oa(e,{getKey:g,drawElement:z,getBoundingBox:W,getRotationPoint:he,getRotationOffset:De,isVisible:J}),Xe=e.data.slbTxrCache=new Oa(e,{getKey:w,drawElement:V,getBoundingBox:Z,getRotationPoint:ue,getRotationOffset:Le,isVisible:J}),Qe=e.data.tlbTxrCache=new Oa(e,{getKey:C,drawElement:F,getBoundingBox:K,getRotationPoint:ge,getRotationOffset:ye,isVisible:J}),tt=e.data.lyrTxrCache=new ef(e);e.onUpdateEleCalcs(function(Te,Ie){Ue.invalidateElements(Ie),$e.invalidateElements(Ie),Xe.invalidateElements(Ie),Qe.invalidateElements(Ie),tt.invalidateElements(Ie);for(var Pe=0;Pe<Ie.length;Pe++){var ze=Ie[Pe]._private;ze.oldBackgroundTimestamp=ze.backgroundTimestamp}});var at=function(Te){for(var Ie=0;Ie<Te.length;Ie++)tt.enqueueElementRefinement(Te[Ie].ele)};Ue.onDequeue(at),$e.onDequeue(at),Xe.onDequeue(at),Qe.onDequeue(at),r.webgl&&e.initWebgl(r,{getStyleKey:p,getLabelKey:g,getSourceLabelKey:w,getTargetLabelKey:C,drawElement:N,drawLabel:z,drawSourceLabel:V,drawTargetLabel:F,getElementBox:U,getLabelBox:W,getSourceLabelBox:Z,getTargetLabelBox:K,getElementRotationPoint:Q,getElementRotationOffset:Se,getLabelRotationPoint:he,getSourceLabelRotationPoint:ue,getTargetLabelRotationPoint:ge,getLabelRotationOffset:De,getSourceLabelRotationOffset:Le,getTargetLabelRotationOffset:ye})}St.CANVAS_LAYERS=3,St.SELECT_BOX=0,St.DRAG=1,St.NODE=2,St.WEBGL=3,St.CANVAS_TYPES=["2d","2d","2d","webgl2"],St.BUFFER_COUNT=3,St.TEXTURE_BUFFER=0,St.MOTIONBLUR_BUFFER_NODE=1,St.MOTIONBLUR_BUFFER_DRAG=2,St.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[St.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[St.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[St.SELECT_BOX]=e;break;case"gc":t.data.gc=!0}};var Qm=typeof Path2D<"u";St.path2dEnabled=function(r){if(void 0===r)return this.pathsEnabled;this.pathsEnabled=!!r},St.usePaths=function(){return Qm&&this.pathsEnabled},St.setImgSmoothing=function(r,e){null!=r.imageSmoothingEnabled?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)},St.getImgSmoothing=function(r){return null!=r.imageSmoothingEnabled?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled},St.makeOffscreenCanvas=function(r,e){var t;return"undefined"!==(typeof OffscreenCanvas>"u"?"undefined":pe(OffscreenCanvas))?t=new OffscreenCanvas(r,e):((t=this.cy.window().document.createElement("canvas")).width=r,t.height=e),t},[rf,zr,qr,tl,Ln,dn,yr,yf,fn,Ga,{nodeShapeImpl:function(r,e,t,n,a,i,s,o){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,o);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}}}].forEach(function(r){mt(St,r)});var t0=[{type:"layout",extensions:Cy},{type:"renderer",extensions:[{name:"null",impl:Ad},{name:"base",impl:qd},{name:"canvas",impl:Jm}]}],Af={},If={};function Nf(r,e,t){var n=t,a=function(U){_t("Can not register `"+e+"` for `"+r+"` since `"+U+"` already exists in the prototype and can not be overridden")};if("core"===r){if(Ia.prototype[e])return a(e);Ia.prototype[e]=t}else if("collection"===r){if(or.prototype[e])return a(e);or.prototype[e]=t}else if("layout"===r){for(var i=function(U){this.options=U,t.call(this,U),Oe(this._private)||(this._private={}),this._private.cy=U.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||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 c=t.prototype.stop;s.stop=function(){var F=this.options;if(F&&F.animate){var U=this.animations;if(U)for(var W=0;W<U.length;W++)U[W].stop()}return c?c.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(U){return U._private.cy},f={addEventFields:function(U,W){W.layout=U,W.cy=d(U),W.target=U},bubble:function(){return!0},parent:function(U){return d(U)}};mt(s,{createEmitter:function(){return this._private.emitter=new pi(f,this),this},emitter:function(){return this._private.emitter},on:function(U,W){return this.emitter().on(U,W),this},one:function(U,W){return this.emitter().one(U,W),this},once:function(U,W){return this.emitter().one(U,W),this},removeListener:function(U,W){return this.emitter().removeListener(U,W),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(U,W){return this.emitter().emit(U,W),this}}),Ft.eventAliasesOn(s),n=i}else if("renderer"===r&&"null"!==e&&"base"!==e){var h=Rf("renderer","base"),v=h.prototype,m=t,p=t.prototype,g=function(){h.apply(this,arguments),m.apply(this,arguments)},w=g.prototype;for(var C in v){var N=v[C];if(null!=p[C])return a(C);w[C]=N}for(var V in p)w[V]=p[V];v.clientFunctions.forEach(function(F){w[F]=w[F]||function(){Xt("Renderer does not implement `renderer."+F+"()` on its prototype")}}),n=g}else if("__proto__"===r||"constructor"===r||"prototype"===r)return Xt(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return xl({map:Af,keys:[r,e],value:n})}function Rf(r,e){return El({map:Af,keys:[r,e]})}function r0(r,e,t,n,a){return xl({map:If,keys:[r,e,t,n],value:a})}function n0(r,e,t,n){return El({map:If,keys:[r,e,t,n]})}var fl=function(){return 2===arguments.length?Rf.apply(null,arguments):3===arguments.length?Nf.apply(null,arguments):4===arguments.length?n0.apply(null,arguments):5===arguments.length?r0.apply(null,arguments):void Xt("Invalid extension access syntax")};Ia.prototype.extension=fl,t0.forEach(function(r){r.extensions.forEach(function(e){Nf(r.type,e.name,e.impl)})});var Hi=function(){if(!(this instanceof Hi))return new Hi;this.length=0},In=Hi.prototype;In.instanceString=function(){return"stylesheet"},In.selector=function(r){return this[this.length++]={selector:r,properties:[]},this},In.css=function(r,e){var t=this.length-1;if(oe(r))this[t].properties.push({name:r,value:e});else if(Oe(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],o=n[s];if(null!=o){var l=nr.properties[s]||nr.properties[Ua(s)];null!=l&&this[t].properties.push({name:l.name,value:o})}}return this},In.style=In.css,In.generateStyle=function(r){var e=new nr(r);return this.appendToStyle(e)},In.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],a=t.properties;r.selector(t.selector);for(var i=0;i<a.length;i++){var s=a[i];r.css(s.name,s.value)}}return r};var hn=function(e){return void 0===e&&(e={}),Oe(e)?new Ia(e):oe(e)?fl.apply(fl,arguments):void 0};hn.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(hn),r.apply(null,e),this},hn.warnings=function(r){return Yl(r)},hn.version="3.34.0",hn.stylesheet=hn.Stylesheet=Hi;var i0=Y(5970),Ce=Y(5547);const s0=["graphContainer"],o0=(r,e)=>e.key,Mf=(r,e)=>e.id;function l0(r,e){if(1&r&&(Ce.j41(0,"div",5)(1,"span",6),Ce.EFF(2),Ce.k0s(),Ce.j41(3,"span",7),Ce.EFF(4),Ce.k0s()()),2&r){const t=e.$implicit;Ce.R7$(2),Ce.JRh(t.key),Ce.R7$(2),Ce.JRh(t.value)}}function u0(r,e){if(1&r&&(Ce.j41(0,"div",4),Ce.Z7z(1,l0,5,2,"div",5,o0),Ce.k0s()),2&r){const t=e;Ce.xc7("left",t.x,"px")("top",t.y,"px"),Ce.R7$(),Ce.Dyx(t.entries)}}function c0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"button",10),Ce.bIt("mousedown",function(a){return a.stopPropagation()})("click",function(){const a=E.eBV(t).$implicit,i=Ce.XpG(2);return E.Njj(i._onContextMenuAction(a.id))}),Ce.EFF(1),Ce.k0s()}if(2&r){const t=e.$implicit;Ce.R7$(),Ce.SpI(" ",t.label," ")}}function d0(r,e){if(1&r&&(Ce.j41(0,"div",8),Ce.Z7z(1,c0,2,1,"button",9,Mf),Ce.k0s()),2&r){const t=Ce.XpG();Ce.xc7("left",t.contextMenuPos().x,"px")("top",t.contextMenuPos().y,"px"),Ce.R7$(),Ce.Dyx(t.contextMenuItems())}}function f0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"button",10),Ce.bIt("mousedown",function(a){return a.stopPropagation()})("click",function(){const a=E.eBV(t).$implicit,i=Ce.XpG(2);return E.Njj(i._onEdgeContextMenuAction(a.id))}),Ce.EFF(1),Ce.k0s()}if(2&r){const t=e.$implicit;Ce.R7$(),Ce.SpI(" ",t.label," ")}}function h0(r,e){if(1&r&&(Ce.j41(0,"div",8),Ce.Z7z(1,f0,2,1,"button",9,Mf),Ce.k0s()),2&r){const t=Ce.XpG();Ce.xc7("left",t.edgeContextMenuPos().x,"px")("top",t.edgeContextMenuPos().y,"px"),Ce.R7$(),Ce.Dyx(t.edgeContextMenuItems())}}try{hn.use(ne())}catch{}let hl=(()=>{class r{elements=M.hFB.required();animate=(0,M.hFB)(!1);stopAnimationAfterFirstNodeHover=(0,M.hFB)(!0);layout=(0,M.hFB)("cose-bilkent");highlightNeighborsOnHover=(0,M.hFB)(!0);userZoomingEnabled=(0,M.hFB)(!0);userPanningEnabled=(0,M.hFB)(!0);appendHTMLLabels=(0,M.hFB)(!0);directed=(0,M.hFB)(!0);labelPropsSettings=(0,M.hFB)(new G);contextMenuItems=(0,M.hFB)([]);edgeContextMenuItems=(0,M.hFB)([]);nodeHover=(0,M.CGW)();nodeClick=(0,M.CGW)();canvasClick=(0,M.CGW)();contextMenuAction=(0,M.CGW)();edgeContextMenuAction=(0,M.CGW)();_cy=(0,E.vPA)(void 0);_container=(0,E.vPA)(void 0);_animate;_positionCache=new Map;hoverNodeOverlay=(0,E.vPA)(null);contextMenuVisible=(0,E.vPA)(!1);contextMenuPos=(0,E.vPA)({x:0,y:0});_contextMenuNode=null;edgeContextMenuVisible=(0,E.vPA)(!1);edgeContextMenuPos=(0,E.vPA)({x:0,y:0});_edgeContextMenuLabel="";_edgeContextMenuEdge={source:"",target:""};graphContainer;handleElements=(0,E.QZP)(()=>{const t=this.elements();if(void 0===this._container())return;const n=this._cy();n?this._patch(n,t):this._build(),this._setupClickHoverEvents()});handleAnimate=(0,E.QZP)(()=>{const t=this._cy();void 0!==t&&(this.animate()?this._setAnimation(t):this._stopAnimation())});handleHTMLLabels=(0,E.QZP)(()=>{const t=this._cy(),n=this._container();if(void 0===t||void 0===n)return;const a=this.labelPropsSettings(),i=new G;i.boxLabels={...a.boxLabels},i.props={display:!1,displayOnlyOnHover:a.props.displayOnlyOnHover},P(t,n,i)});_bodyObserver;_resizeDebounce;_startBodyObserver(){this._bodyObserver=new MutationObserver(()=>{this._reapplyStyles()}),this._bodyObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]})}_reapplyStyles(){const t=this._cy(),n=this._container();if(!t||!n)return;const a=this._resolveParentBg(n),i={...$,directed:this.directed(),backgroundColor:a};t.style(B(i)).update()}_resolveParentBg(t){let n=t.parentElement;for(;n;){const a=window.getComputedStyle(n).backgroundColor;if(a&&"rgba(0, 0, 0, 0)"!==a&&"transparent"!==a)return a;n=n.parentElement}return"#ffffff"}ngAfterViewInit(){const t=this.graphContainer.nativeElement;void 0!==t&&this._container.update(()=>t)}ngOnDestroy(){this._bodyObserver?.disconnect(),clearTimeout(this._resizeDebounce),this._cy()?.destroy()}onResize(){const t=this._cy();t&&(t.resize(),clearTimeout(this._resizeDebounce),this._resizeDebounce=setTimeout(()=>{t.resize(),this._nodesHavePosition()||t.fit(void 0,60),t.center()},250))}_setAnimation(t){this._stopAnimation(),this._animate=new j(t,this.stopAnimationAfterFirstNodeHover(),1e-4,.02)}_stopAnimation(){this._animate?.stop()}_patch(t,n){const a=new Set(n.nodes.map(g=>g.data.id)),i=new Set(n.edges.map(g=>g.data.id??""));t.nodes().filter(g=>!a.has(g.id())).forEach(g=>{this._positionCache.set(g.id(),{...g.position()})}),t.remove(t.nodes().filter(g=>!a.has(g.id()))),t.remove(t.edges().filter(g=>!i.has(g.id())));const s=new Set(t.nodes().map(g=>g.id())),o=new Set(t.edges().map(g=>g.id()));for(const g of n.nodes)if(s.has(g.data.id)){const w=t.getElementById(g.data.id);w.data(g.data),w.classes(g.classes??"")}const l=n.nodes.filter(g=>!s.has(g.data.id)),u=n.edges.filter(g=>!o.has(g.data.id??""));if(0===l.length&&0===u.length)return;t.nodes().lock();const c=new Set(l.map(g=>g.data.id)),d=t.nodes();t.add([...l.map(g=>({group:"nodes",data:g.data,classes:g.classes??""})),...u.map(g=>({group:"edges",data:g.data,classes:g.classes??""}))]);const f=new Map;for(const g of u){const w=c.has(g.data.source),C=c.has(g.data.target??"");if(w&&!C){const N=t.getElementById(g.data.target??"");N.length>0&&!f.has(g.data.source)&&f.set(g.data.source,{...N.position()})}if(C&&!w){const N=t.getElementById(g.data.source);N.length>0&&!f.has(g.data.target)&&f.set(g.data.target,{...N.position()})}}const h=[];let v=0;if(t.nodes().filter(g=>c.has(g.id())).forEach(g=>{const w=this._positionCache.get(g.id());if(w)g.position(w),g.lock(),this._positionCache.delete(g.id());else{const C=f.get(g.id());if(C){const N=v++*(2*Math.PI/Math.max(l.length,1)),z=100+60*Math.random();g.position({x:C.x+z*Math.cos(N),y:C.y+z*Math.sin(N)})}else h.push(g)}}),h.length>0&&d.length>0){const g=d.boundingBox({}),w=(g.x1+g.x2)/2,C=(g.y1+g.y2)/2,N=Math.max(g.x2-g.x1,g.y2-g.y1)/2+180,z=2*Math.PI/Math.max(h.length,1);h.forEach((V,F)=>{V.position({x:w+N*Math.cos(z*F),y:C+N*Math.sin(z*F)})})}const m=this._container();if(m&&this.appendHTMLLabels()){const g=new G,w=this.labelPropsSettings();g.boxLabels={...w.boxLabels},g.props={display:!1,displayOnlyOnHover:w.props.displayOnlyOnHover},P(t,m,g)}const p=t.layout({...this._layoutOptions(),randomize:!1,fit:!1,animate:!0});p.on("layoutstop",()=>t.nodes().unlock()),p.run()}_build(){this._bodyObserver?.disconnect(),this._bodyObserver=void 0;const t=this._container(),n=t?this._resolveParentBg(t):$.backgroundColor,a={...$,directed:this.directed(),backgroundColor:n},i=B(a),s=this._nodesHavePosition()?{name:"preset",padding:100,animate:!1}:{...this._layoutOptions(),padding:80,animate:!1},o=hn({container:this._container(),style:i,layout:s,elements:this.elements(),userZoomingEnabled:this.userZoomingEnabled(),userPanningEnabled:this.userPanningEnabled(),minZoom:.2,maxZoom:3});o.one("layoutstop",()=>{o.resize(),this._nodesHavePosition()||o.fit(void 0,60),o.center()}),this._cy.update(()=>o),this._startBodyObserver()}_setupClickHoverEvents(){const t=this._cy();if(null==t)return;let n=t.collection();t.nodes().unbind("tapstart"),t.nodes().bind("tapstart",a=>{const i=a.target.data();!i.isCollapser&&!i.isChainExpander&&this.contextMenuItems().length>0&&(a.originalEvent?.preventDefault(),a.originalEvent?.stopPropagation())}),t.nodes().unbind("click"),t.nodes().bind("click",a=>{const i=a.target,s=i.data();if(s.isCollapser||s.isChainExpander)return this.contextMenuVisible.set(!1),this.nodeClick.emit(s),void(n=n.union(i));if(this.contextMenuItems().length>0){const o=i.renderedPosition();return this._contextMenuNode=s,this.contextMenuPos.set({x:o.x,y:o.y}),void this.contextMenuVisible.set(!0)}this.nodeClick.emit(s),n=n.union(i)}),t.nodes().unbind("cxttap"),t.nodes().bind("cxttap",a=>{if(!this.contextMenuItems().length)return;const i=a.target,s=i.data(),o=i.renderedPosition();this._contextMenuNode=s,this.contextMenuPos.set({x:o.x,y:o.y}),this.contextMenuVisible.set(!0),this.edgeContextMenuVisible.set(!1),this.nodeHover.emit(s)}),t.nodes().unbind("mouseover"),t.nodes().bind("mouseover",a=>{this._dimAllButNeighbors(a.target);const i=a.target.data();this.nodeHover.emit(i);const s=i.properties;if(this.labelPropsSettings().props.display&&s){const o=Object.entries(s).map(([l,u])=>({key:l,value:String(u)}));if(o.length>0){const l=a.target.renderedBoundingBox();this.hoverNodeOverlay.set({x:(l.x1+l.x2)/2,y:l.y2,entries:o})}}}),t.nodes().unbind("mouseout"),t.nodes().bind("mouseout",()=>{this._unDimAll(),this.nodeHover.emit(void 0),this.hoverNodeOverlay.set(null)}),t.nodes().unbind("drag"),t.nodes().bind("drag",a=>{if(null===this.hoverNodeOverlay())return;const i=a.target.renderedBoundingBox(),s=this.hoverNodeOverlay();this.hoverNodeOverlay.set({...s,x:(i.x1+i.x2)/2,y:i.y2})}),t.nodes().unbind("dragfree"),t.nodes().bind("dragfree",()=>{this.hoverNodeOverlay.set(null)}),t.edges().unbind("mouseover"),t.edges().bind("mouseover",a=>{a.target.addClass("edge-hover")}),t.edges().unbind("mouseout"),t.edges().bind("mouseout",a=>{a.target.removeClass("edge-hover")}),t.edges().unbind("tap"),t.edges().bind("tap",a=>{if(!this.edgeContextMenuItems().length)return;const i=a.target,s=i.renderedMidpoint();this._edgeContextMenuLabel=i.data("label")??"",this._edgeContextMenuEdge={id:i.data("id"),iri:i.data("iri"),label:i.data("label"),source:i.data("source"),target:i.data("target"),color:i.data("color"),width:i.data("width")},this.edgeContextMenuPos.set({x:s.x,y:s.y}),this.edgeContextMenuVisible.set(!0),this.contextMenuVisible.set(!1)}),t.off("click"),t.on("click",a=>{0===Object.keys(a.target.data()).length&&(this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1),this.canvasClick.emit())}),t.off("viewport"),t.on("viewport",()=>{this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1)})}_onContextMenuAction(t){this.contextMenuVisible.set(!1),this._contextMenuNode&&this.contextMenuAction.emit({actionId:t,node:this._contextMenuNode})}_onEdgeContextMenuAction(t){this.edgeContextMenuVisible.set(!1),this.edgeContextMenuAction.emit({actionId:t,edgeLabel:this._edgeContextMenuLabel,edge:this._edgeContextMenuEdge})}_layoutOptions(){const t=this.layout();if("cose-bilkent"!==t)return{name:t};const n=this.elements().nodes,a=this.elements().edges,i=n.length>0?2*a.length/n.length:1,s=n.map(m=>{const w=[m.data.label||"",...m.data.boxLabels||[]].filter(Boolean);return Math.max(...w.map(C=>C.length),0)}),o=s.length>0?s.reduce((m,p)=>m+p,0)/s.length:0,l=s.length>0?Math.max(...s):0,c=1.5*o,d=.8*Math.max(0,l-20),f=7.2*i;return{name:"cose-bilkent",nodeDimensionsIncludeLabels:!0,randomize:!0,nodeRepulsion:Math.round(4500+500*i),idealEdgeLength:Math.round(48+c+d+f),edgeElasticity:.45,gravity:.25,gravityRange:3.8,numIter:2500}}_nodesHavePosition(){return void 0!==this.elements().nodes.find(n=>void 0!==n.position)}fitTo(t,n=80){const a=this._cy();if(!a||0===t.length)return;let i=a.collection();for(const s of t){const o=a.getElementById(s);o.length>0&&(i=i.union(o))}0!==i.length&&a.animate({fit:{eles:i,padding:n},duration:400,easing:"ease-in-out-cubic"})}_unDimAll(){const t=this._cy();t?.elements().forEach(n=>{n.removeClass("faded")})}_dimAllButNeighbors(t){const n=this._cy();if(null==n)return;const a=t.neighborhood().map(i=>i.id());n.elements().forEach(i=>{a.includes(i.id())||i.id()===t.id()?i.removeClass("faded"):i.addClass("faded")})}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=Ce.VBU({type:r,selectors:[["cue-simple-graph"]],viewQuery:function(n,a){if(1&n&&Ce.GBs(s0,5),2&n){let i;Ce.mGM(i=Ce.lsd())&&(a.graphContainer=i.first)}},inputs:{elements:[1,"elements"],animate:[1,"animate"],stopAnimationAfterFirstNodeHover:[1,"stopAnimationAfterFirstNodeHover"],layout:[1,"layout"],highlightNeighborsOnHover:[1,"highlightNeighborsOnHover"],userZoomingEnabled:[1,"userZoomingEnabled"],userPanningEnabled:[1,"userPanningEnabled"],appendHTMLLabels:[1,"appendHTMLLabels"],directed:[1,"directed"],labelPropsSettings:[1,"labelPropsSettings"],contextMenuItems:[1,"contextMenuItems"],edgeContextMenuItems:[1,"edgeContextMenuItems"]},outputs:{nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick",contextMenuAction:"contextMenuAction",edgeContextMenuAction:"edgeContextMenuAction"},decls:5,vars:3,consts:[["graphContainer",""],["id","graph","cueResized","",3,"resized"],[1,"node-props-overlay",3,"left","top"],[1,"cy-context-menu",3,"left","top"],[1,"node-props-overlay"],[1,"prop-row"],[1,"prop-key"],[1,"prop-value"],[1,"cy-context-menu"],[1,"cy-context-item"],[1,"cy-context-item",3,"mousedown","click"]],template:function(n,a){if(1&n&&(Ce.j41(0,"div",1,0),Ce.bIt("resized",function(){return a.onResize()}),Ce.nVh(2,u0,3,4,"div",2),Ce.nVh(3,d0,3,4,"div",3),Ce.nVh(4,h0,3,4,"div",3),Ce.k0s()),2&n){let i;Ce.R7$(2),Ce.vxM((i=a.hoverNodeOverlay())?2:-1,i),Ce.R7$(),Ce.vxM(a.contextMenuVisible()&&a.contextMenuItems().length>0?3:-1),Ce.R7$(),Ce.vxM(a.edgeContextMenuVisible()&&a.edgeContextMenuItems().length>0?4:-1)}},dependencies:[i0.C],styles:["[_nghost-%COMP%]{display:contents}#graph[_ngcontent-%COMP%]{display:block!important;text-align:left!important;margin:0!important;min-height:100px;flex:1 1;width:100%;position:relative;overflow:hidden} .box-label{position:absolute;pointer-events:none;display:flex;flex-direction:column;align-items:flex-start;gap:4px}.node-props-overlay[_ngcontent-%COMP%]{position:absolute;transform:translate(-50%,8px);z-index:20;pointer-events:none;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:var(--cue-menu-padding-y) var(--cue-menu-padding-x);display:flex;flex-direction:column;gap:8px;min-width:140px;max-width:260px}.prop-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.prop-key[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.6rem;font-weight:600;color:var(--cue-neutral);text-transform:uppercase;letter-spacing:.05em}.prop-value[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.72rem;color:var(--cue-menu-foreground-color);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.cy-context-menu[_ngcontent-%COMP%]{position:absolute;z-index:30;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:4px 0;min-width:160px;display:flex;flex-direction:column}.cy-context-item[_ngcontent-%COMP%]{background:none;border:none;padding:8px 16px;text-align:left;font-family:Poppins,sans-serif;font-size:.8rem;color:var(--cue-menu-foreground-color);cursor:pointer}.cy-context-item[_ngcontent-%COMP%]:hover{background:var(--cue-menu-hover-color, rgba(0, 0, 0, .06))}"],changeDetection:0})}return r})();const Of=["#2859e1","#4caf50","#fc2626","#f59e0b","#8b5cf6","#06b6d4","#f97316","#14b8a6","#ec4899","#6366f1"],vl="__collapser__",Xi="__chain__";var m0=Y(9134),b0=Y(6034),w0=Y(7517),x0=Y(6455),E0=Y(8334),Nn=Y(9352),T0=Y(5971),C0=Y(5448);function D0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-simple-graph",3),Ce.bIt("nodeHover",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onNodeHover(a))})("nodeClick",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onNodeClick(a))})("canvasClick",function(){E.eBV(t);const a=Ce.XpG();return E.Njj(a._onCanvasClick())})("contextMenuAction",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onContextMenuAction(a))})("edgeContextMenuAction",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onEdgeContextMenuAction(a))}),Ce.k0s()}if(2&r){const t=Ce.XpG();Ce.Y8G("elements",e)("labelPropsSettings",t.labelPropsSettings())("contextMenuItems",t._nodeMenuItems())("edgeContextMenuItems",t._edgeMenuItems())}}function S0(r,e){1&r&&Ce.EFF(0," No elements ")}function L0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-draggable-card",4),Ce.nI1(1,"transloco"),Ce.bIt("clickedClose",function(){E.eBV(t);const a=Ce.XpG();return E.Njj(a._tabbedLegendClosed.set(!0))}),Ce.j41(2,"cue-tabs",5)(3,"cue-tab",6),Ce.nI1(4,"transloco"),Ce.j41(5,"div",7)(6,"cue-layer-legend",8),Ce.bIt("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onCategoryVisibilityAll(a))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onCategoryLayerChange(a))}),Ce.k0s()()(),Ce.j41(7,"cue-tab",6),Ce.nI1(8,"transloco"),Ce.j41(9,"div",7)(10,"cue-layer-legend",8),Ce.bIt("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onPredicateVisibilityAll(a))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onPredicateLayerChange(a))}),Ce.k0s()()()()()}if(2&r){const t=Ce.XpG();Ce.Y8G("label",Ce.bMT(1,7,"components.graph.rdf.legendTitle"))("padded",!1)("position",t.legendPosition()),Ce.R7$(3),Ce.Y8G("label",Ce.bMT(4,9,"components.graph.rdf.legendEntities")),Ce.R7$(3),Ce.Y8G("layers",t._categoryLayers()),Ce.R7$(),Ce.Y8G("label",Ce.bMT(8,11,"components.graph.rdf.legendRelationships")),Ce.R7$(3),Ce.Y8G("layers",t._predicateLayers())}}function A0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-color-legend-panel",10),Ce.nI1(1,"transloco"),Ce.bIt("close",function(){E.eBV(t);const a=Ce.XpG(2);return E.Njj(a._legendClosed.set(!0))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onCategoryLayerChange(a))})("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onCategoryVisibilityAll(a))}),Ce.k0s()}if(2&r){const t=Ce.XpG(2);Ce.Y8G("title",Ce.bMT(1,2,"components.graph.rdf.legendCategories"))("layers",t._categoryLayers())}}function I0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-button",13),Ce.bIt("click",function(){E.eBV(t);const a=Ce.XpG(3);return E.Njj(a._unhideAllPredicates())}),Ce.j41(1,"cue-button-label"),Ce.EFF(2),Ce.nI1(3,"transloco"),Ce.k0s()()}2&r&&(Ce.xc7("position","absolute")("top","2.5rem")("right","0.5rem"),Ce.R7$(2),Ce.JRh(Ce.bMT(3,7,"components.graph.rdf.labelUnhideEdges")))}function N0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-color-legend-panel",11),Ce.nI1(1,"transloco"),Ce.bIt("close",function(){E.eBV(t);const a=Ce.XpG(2);return E.Njj(a._predicateLegendClosed.set(!0))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onPredicateLayerChange(a))})("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onPredicateVisibilityAll(a))}),Ce.k0s(),Ce.nVh(2,I0,4,9,"cue-button",12)}if(2&r){const t=Ce.XpG(2);Ce.Y8G("title",Ce.bMT(1,4,"components.graph.rdf.legendRelationships"))("layers",t._predicateLayers())("position",t.legendPosition()),Ce.R7$(2),Ce.vxM(t._anyPredicateHidden()?2:-1)}}function R0(r,e){if(1&r&&(Ce.nVh(0,A0,2,4,"cue-color-legend-panel",9),Ce.nVh(1,N0,3,6)),2&r){const t=Ce.XpG();Ce.vxM(t.colorByCategory()&&t._categoryLayers().length>0&&!t._legendClosed()?0:-1),Ce.R7$(),Ce.vxM(t.showRelationshipLegend()&&t._predicateLayers().length>0&&!t._predicateLegendClosed()?1:-1)}}let M0=(()=>{class r{_graph=(0,M.ebz)(hl);doc=(0,M.hFB)();collapseClasses=(0,M.hFB)(!0);collapseAttributes=(0,M.hFB)(!0);collapseRelationships=(0,M.hFB)(!0);classPredicates=(0,M.hFB)([]);focusNodes=(0,M.hFB)([]);focusNodeColor=(0,M.hFB)("red");zoomToFocusNodes=(0,M.hFB)(!1);colorByCategory=(0,M.hFB)(!1);showRelationshipLegend=(0,M.hFB)(!1);legendPosition=(0,M.hFB)("top-left");tabbedLegend=(0,M.hFB)(!1);categoryLabelsOnHover=(0,M.hFB)(!0);nodeMenuItems=(0,M.hFB)(void 0);edgeMenuItems=(0,M.hFB)(void 0);nodeHover=(0,M.CGW)();nodeClick=(0,M.CGW)();canvasClick=(0,M.CGW)();_fullElements=null;_collapserGroups=[];_chainGroups=[];_focusedNodeId=void 0;_hiddenNodeIds=new Set;_categoryColors=new Map;_labelFocusOnNeighbours=(0,Nn.Xx)("components.graph.rdf.labelFocusOnNeighbours");_labelUnhideEdges=(0,Nn.Xx)("components.graph.rdf.labelUnhideEdges");_labelHideEdgeType=(0,Nn.Xx)("components.graph.rdf.labelHideEdgeType");_labelCollapseRelationship=(0,Nn.Xx)("components.graph.rdf.labelCollapseRelationship");_labelExpandMore=(0,Nn.Xx)("components.graph.rdf.labelExpandMore");_labelCollapseExpanded=(0,Nn.Xx)("components.graph.rdf.labelCollapseExpanded");_hoveredNode=(0,E.vPA)(null);_nodeMenuItems=(0,T.EW)(()=>{const t=this.nodeMenuItems();if(void 0!==t)return t;const n=this._hoveredNode()?.id,a=!!n&&this._collapserGroups.some(d=>d.allTargetNodeIds.includes(n)),i=n?this._collapserGroups.find(d=>d.id===n):void 0,s=!!i&&i.visibleCount>0,o=!!i&&i.visibleCount<i.allTargetNodeIds.length,l=n?this._chainGroups.find(d=>d.id===n):void 0,u=!!l&&l.visibleCount>0,c=!!l&&l.visibleCount<l.hiddenNodeIds.length;return[{id:"focus",label:this._labelFocusOnNeighbours()},{id:"unhide-edges",label:this._labelUnhideEdges()},...o||c?[{id:"expand-more",label:this._labelExpandMore()}]:[],...s||u?[{id:"collapse-expanded",label:this._labelCollapseExpanded()}]:[],...a?[{id:"collapse-relationship",label:this._labelCollapseRelationship()}]:[]]});_edgeMenuItems=(0,T.EW)(()=>{const t=this.edgeMenuItems();return void 0!==t?t:[{id:"hide-edge-type",label:this._labelHideEdgeType()}]});elements=(0,E.vPA)(void 0);_categoryLayers=(0,E.vPA)([]);_legendClosed=(0,E.vPA)(!1);_predicateLayers=(0,E.vPA)([]);_predicateLegendClosed=(0,E.vPA)(!1);_nodeLayers=(0,E.vPA)([]);_tabbedLegendClosed=(0,E.vPA)(!1);_anyPredicateHidden=(0,T.EW)(()=>this._predicateLayers().some(t=>!t.visible));_unhideAllPredicates(){this._predicateLayers.update(t=>t.map(n=>({...n,visible:!0}))),this.elements.set(this._display())}onDoc=(0,E.QZP)((()=>{var t=this;return(0,q.A)(function*(){const n=t.doc();if(void 0===n)return;const a=new I;a.hideClassAssignmentTriples=t.collapseClasses(),a.hideDatatypePropertyTriples=t.collapseAttributes(),a.collapseIntoClassificationLabels=t.classPredicates();const i=new D(n,a);let s;try{s=yield i.init(),console.log("[rdf-graph onDoc] elements:",s.nodes.length,"nodes,",s.edges.length,"edges")}catch(l){return void console.error("[rdf-graph onDoc] CytoscapeJSONLD.init() threw:",l)}t._fullElements=s,t._collapserGroups=t.collapseRelationships()?function g0(r){const e=new Map,t=new Map;for(const i of r.edges)i.data.target&&e.set(i.data.target,(e.get(i.data.target)??0)+1),i.data.source&&t.set(i.data.source,(t.get(i.data.source)??0)+1);const n=new Map;for(const i of r.edges){const s=`${i.data.source}\0${i.data.label}`;n.has(s)||n.set(s,[]),n.get(s).push(i)}const a=[];for(const[i,s]of n){if(s.length<4)continue;const o=i.indexOf("\0"),l=i.slice(0,o),u=i.slice(o+1),c=s.map(d=>d.data.target).filter(d=>d&&1===(e.get(d)??0)&&0===(t.get(d)??0));c.length<4||a.push({id:`${vl}${l}\0${u}`,sourceId:l,predicateLabel:u,allTargetNodeIds:c,visibleCount:0})}return a}(s):[],t._chainGroups=function p0(r){const e=new Map,t=new Map;for(const u of r.nodes)e.set(u.data.id,[]),t.set(u.data.id,[]);for(const u of r.edges)e.get(u.data.source)?.push(u),u.data.target&&t.get(u.data.target)?.push(u);const n=new Map,a=(u,c=new Set)=>{if(n.has(u))return n.get(u);if(c.has(u))return 0;c.add(u);const h=1+(e.get(u)??[]).reduce((v,m)=>Math.max(v,m.data.target?a(m.data.target,c):0),0);return n.set(u,h),h};for(const u of r.nodes)a(u.data.id);const i=new Set,s=[...r.nodes].sort((u,c)=>(n.get(c.data.id)??0)-(n.get(u.data.id)??0));for(const u of s){if(i.size>=20)break;let c=u.data.id;for(;c&&!i.has(c)&&i.size<20;)i.add(c),c=(e.get(c)??[]).filter(f=>f.data.target&&!i.has(f.data.target)).sort((f,h)=>(n.get(h.data.target)??0)-(n.get(f.data.target)??0))[0]?.data.target}const o=new Set(r.nodes.map(u=>u.data.id).filter(u=>!i.has(u)));if(0===o.size)return[];const l=new Map;for(const u of i)for(const c of e.get(u)??[]){if(!c.data.target||!o.has(c.data.target))continue;const d=`${u}\0${c.data.label??""}`;l.has(d)||l.set(d,{id:`${Xi}${u}\0${c.data.label??""}`,sourceId:u,predicateLabel:c.data.label??"",hiddenNodeIds:[],visibleCount:0});const f=l.get(d);let h=c.data.target;for(;h&&o.has(h)&&!f.hiddenNodeIds.includes(h);)f.hiddenNodeIds.push(h),o.delete(h),h=(e.get(h)??[]).filter(m=>m.data.target&&o.has(m.data.target)).sort((m,p)=>(n.get(p.data.target)??0)-(n.get(m.data.target)??0))[0]?.data.target}return o.size>0&&l.set("__orphan__",{id:`${Xi}__orphan__`,sourceId:s[0]?.data.id??"",predicateLabel:"",hiddenNodeIds:[...o],visibleCount:0}),[...l.values()].filter(u=>u.hiddenNodeIds.length>0)}(s),t._categoryLayers.set(t._buildCategoryLayers(s)),t._predicateLayers.set(t._buildPredicateLayers(s)),t._nodeLayers.set(t._buildNodeLayers(s)),t._hiddenNodeIds.clear(),t._legendClosed.set(!1),t._predicateLegendClosed.set(!1),t._tabbedLegendClosed.set(!1),t.elements.set(t._display());const o=t.focusNodes();o.length>0&&t.zoomToFocusNodes()&&setTimeout(()=>t._graph()?.fitTo(o),450)})})());focusEffect=(0,E.QZP)(()=>{const t=this.focusNodes();this._fullElements&&(this.elements.set(this._display()),t.length>0&&this.zoomToFocusNodes()&&setTimeout(()=>this._graph()?.fitTo(t),200))});triggerResize(){const t=this._graph();if(t){const n=t._cy();n.resize(),setTimeout(()=>{const a=n.container(),i=a?.offsetWidth||0,s=a?.offsetHeight||0;if(i>=100&&s>=100){n.resize();const o=n.elements();if(o.length>0){const l=o.nodes();if(!(l.length>0&&l.every(Z=>{const K=Z.position();return 0!==K.x||0!==K.y}))){const Z=this._graph();return void(Z&&Z._build?.())}const c=Math.min(i,s),d=Math.min(Math.max(.15*c,40),120),f=o.boundingBox(),C=Math.min((i-2*d)/(f.w||1),(s-2*d)/(f.h||1)),N=o.nodes().length,z=o.edges().length,V=N>0?2*z/N:1;let F=2.5;V>10?F=1:V>6?F=1.5:V>3&&(F=2);const W=Math.min(Math.max(C,.2),F);n.animate(W!==C?{zoom:W,center:{eles:o},duration:300}:{fit:{eles:o,padding:d},duration:300})}}else console.warn("\u{1f3af} RDFGraph: container too small or invalid dimensions, skipping fit")},150)}}colorByCategoryEffect=(0,E.QZP)(()=>{this.colorByCategory()&&this._legendClosed.set(!1),this._fullElements&&this.elements.set(this._display())});showRelationshipLegendEffect=(0,E.QZP)(()=>{this.showRelationshipLegend()&&this._predicateLegendClosed.set(!1)});labelPropsSettings=(0,T.EW)(()=>{const t=new G;return t.boxLabels.display=this.collapseClasses(),t.props.display=this.collapseAttributes(),t.boxLabels.displayOnlyOnHover=this.colorByCategory()||this.categoryLabelsOnHover(),t});_onNodeHover(t){t&&this._hoveredNode.set(t),this.nodeHover.emit(t)}_onNodeClick(t){const n=t;if(n.isCollapser&&n.collapserGroupId){const a=this._collapserGroups.find(i=>i.id===n.collapserGroupId);if(a){const i=Math.min(a.visibleCount+5,a.allTargetNodeIds.length);return void(i!==a.visibleCount&&(a.visibleCount=i,this.elements.set(this._display())))}}if(n.isChainExpander&&n.chainGroupId){const a=this._chainGroups.find(i=>i.id===n.chainGroupId);if(a){const i=Math.min(a.visibleCount+5,a.hiddenNodeIds.length);return void(i!==a.visibleCount&&(a.visibleCount=i,this.elements.set(this._display())))}}this.nodeClick.emit(t)}_onCanvasClick(){this.canvasClick.emit(),this._focusedNodeId&&(this._focusedNodeId=void 0,this.elements.set(this._display()))}_onContextMenuAction(t){const n=this.nodeMenuItems();if(void 0===n){if("focus"===t.actionId){const a=t.node.id;this._focusedNodeId=this._focusedNodeId===a?void 0:a,this.elements.set(this._display())}else if("unhide-edges"===t.actionId)this._unhideAllPredicates();else if("expand-more"===t.actionId){const a=t.node.id,i=this._collapserGroups.find(o=>o.id===a);i&&(i.visibleCount=Math.min(i.visibleCount+5,i.allTargetNodeIds.length));const s=this._chainGroups.find(o=>o.id===a);s&&(s.visibleCount=Math.min(s.visibleCount+5,s.hiddenNodeIds.length)),this.elements.set(this._display())}else if("collapse-expanded"===t.actionId){const a=t.node.id,i=this._collapserGroups.find(o=>o.id===a);i&&(i.visibleCount=0);const s=this._chainGroups.find(o=>o.id===a);s&&(s.visibleCount=0),this.elements.set(this._display())}else if("collapse-relationship"===t.actionId){const a=t.node.id;for(const i of this._collapserGroups)i.allTargetNodeIds.includes(a)&&(i.visibleCount=0);this.elements.set(this._display())}}else n.find(a=>a.id===t.actionId)?.action(t.node)}_onEdgeContextMenuAction(t){const n=this.edgeMenuItems();void 0===n?"hide-edge-type"===t.actionId&&(this._predicateLayers.update(a=>a.map(i=>i.label===t.edgeLabel?{...i,visible:!1}:i)),this.elements.set(this._display())):n.find(a=>a.id===t.actionId)?.action(t.edge)}_onCategoryLayerChange(t){this._categoryLayers.update(n=>[...n]),this.elements.set(this._display())}_onCategoryVisibilityAll(t){this._categoryLayers.update(n=>[...n]),this.elements.set(this._display())}_onPredicateLayerChange(t){this._predicateLayers.update(n=>[...n]),this.elements.set(this._display())}_onPredicateVisibilityAll(t){this._predicateLayers.update(n=>[...n]),this.elements.set(this._display())}_onNodeLayerChange(t){this._syncHiddenNodeIds(),this._nodeLayers.update(n=>[...n]),this.elements.set(this._display())}_onNodeVisibilityAll(t){this._syncHiddenNodeIds(),this._nodeLayers.update(n=>[...n]),this.elements.set(this._display())}_syncHiddenNodeIds(){this._hiddenNodeIds.clear();for(const t of this._nodeLayers())t.visible||this._hiddenNodeIds.add(t.label)}static _PREDICATE_COLOR="#4a90d9";_buildPredicateLayers(t){const n=new Set,a=[];for(const i of t.edges){const s=i.data.label??"";s&&!n.has(s)&&(n.add(s),a.push(s))}return a.map(i=>({label:i,color:r._PREDICATE_COLOR,visible:!0}))}_buildCategoryLayers(t){const n=new Set,a=[];for(const i of t.nodes){if(i.data.id.startsWith(vl)||i.data.id.startsWith(Xi))continue;const s=i.data.boxLabels?.[0];s&&!n.has(s)&&(n.add(s),a.push(s))}return this._categoryColors=function v0(r){const e=new Map;return r.forEach((t,n)=>{e.set(t,Of[n%Of.length])}),e}(a),a.map(i=>({label:i,color:this._categoryColors.get(i),visible:!0}))}_buildNodeLayers(t){const n=new Set,a=[];for(const i of t.nodes){if(i.data.id.startsWith(vl)||i.data.id.startsWith(Xi))continue;const s=i.data.label||i.data.id,o=i.data.boxLabels?.[0],l=o?this._categoryColors.get(o):void 0;s&&!n.has(s)&&(n.add(s),a.push({label:s,color:l,visible:!0}))}return a.sort((i,s)=>i.label.localeCompare(s.label))}_display(){if(!this._fullElements)return{nodes:[],edges:[]};let t=function y0(r,e,t){const n=new Set,a=new Set,i=[],s=[];for(const l of t){const u=l.hiddenNodeIds.length-l.visibleCount;if(u<=0)continue;for(const f of l.hiddenNodeIds.slice(l.visibleCount))n.add(f);const c=l.visibleCount>0,d=c?l.hiddenNodeIds[l.visibleCount-1]:l.sourceId;i.push({data:{id:l.id,label:`+${u}`,size:28,isChainExpander:!0,isExpanded:c,chainGroupId:l.id},classes:c?"collapser collapser-expanded":"collapser"}),s.push({data:{id:`edge_${l.id}`,source:d,target:l.id,label:l.predicateLabel}})}for(const l of e){const u=l.allTargetNodeIds.length-l.visibleCount;if(u<=0)continue;for(const f of l.allTargetNodeIds.slice(l.visibleCount))n.add(f);const c=r.edges.filter(f=>f.data.source===l.sourceId&&f.data.label===l.predicateLabel&&l.allTargetNodeIds.includes(f.data.target));for(const f of c)a.add(f.data.id??"");for(const f of c)l.allTargetNodeIds.indexOf(f.data.target)<l.visibleCount&&s.push(f);const d=l.visibleCount>0;i.push({data:{id:l.id,label:`+${u}`,size:28,isCollapser:!0,isExpanded:d,collapserGroupId:l.id},classes:d?"collapser collapser-expanded":"collapser"}),s.push({data:{id:`edge_${l.id}`,source:l.sourceId,target:l.id,label:l.predicateLabel}})}const o=new Set(i.map(l=>l.data.id));return{nodes:[...r.nodes.filter(l=>!n.has(l.data.id)),...i],edges:[...r.edges.filter(l=>!(a.has(l.data.id??"")||n.has(l.data.source)||n.has(l.data.target??"")||o.has(l.data.source)||o.has(l.data.target??""))),...s]}}(this._fullElements,this._collapserGroups,this._chainGroups);const n=new Set(this._predicateLayers().filter(s=>!s.visible).map(s=>s.label));if(n.size>0){const s=t.edges.filter(l=>!n.has(l.data.label??"")),o=new Set;for(const l of s)o.add(l.data.source),o.add(l.data.target);t={nodes:t.nodes.filter(l=>o.has(l.data.id)),edges:s}}if(this._hiddenNodeIds.size>0){const s=new Set(t.nodes.filter(o=>this._hiddenNodeIds.has(o.data.label||o.data.id)).map(o=>o.data.id));s.size>0&&(t={nodes:t.nodes.filter(o=>!s.has(o.data.id)),edges:t.edges.filter(o=>!s.has(o.data.source)&&!s.has(o.data.target))})}if(this.colorByCategory()){const s=new Set(this._categoryLayers().filter(o=>!o.visible).map(o=>o.label));if(s.size>0){const o=new Map(this._fullElements.nodes.map(c=>[c.data.id,c.data.boxLabels?.[0]])),l=c=>{const d=o.get(c);return void 0!==d&&s.has(d)},u=new Set(t.nodes.filter(c=>{const d=c.data.boxLabels?.[0];return void 0!==d&&s.has(d)}).map(c=>c.data.id));for(const c of this._collapserGroups)c.allTargetNodeIds.every(l)&&u.add(c.id);for(const c of this._chainGroups){const d=c.hiddenNodeIds.slice(c.visibleCount);d.length>0&&d.every(l)&&u.add(c.id)}t={nodes:t.nodes.filter(c=>!u.has(c.data.id)),edges:t.edges.filter(c=>!u.has(c.data.source)&&!u.has(c.data.target))}}t={...t,nodes:t.nodes.map(o=>{const l=o.data.boxLabels?.[0],u=l?this._categoryColors.get(l):void 0;return u?{...o,data:{...o.data,color:u}}:o})}}this._focusedNodeId&&(t=this._applyFocus(t,this._focusedNodeId));const a=new Set(this.focusNodes()),i=this.focusNodeColor();return a.size>0&&(t={...t,nodes:t.nodes.map(s=>{if(!a.has(s.data.id))return s;const o=s.classes?s.classes.trim():"";return{...s,data:{...s.data,color:i},classes:o?`${o} focused`:"focused"}})}),t}_applyFocus(t,n){return{...t,nodes:t.nodes.map(a=>{if(a.data.id!==n)return a;const i=a.classes?a.classes.trim():"";return{...a,classes:i?`${i} focused`:"focused"}})}}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=Ce.VBU({type:r,selectors:[["cue-rdf-graph"]],viewQuery:function(n,a){1&n&&Ce.wEZ(a._graph,hl,5),2&n&&Ce.NyB()},inputs:{doc:[1,"doc"],collapseClasses:[1,"collapseClasses"],collapseAttributes:[1,"collapseAttributes"],collapseRelationships:[1,"collapseRelationships"],classPredicates:[1,"classPredicates"],focusNodes:[1,"focusNodes"],focusNodeColor:[1,"focusNodeColor"],zoomToFocusNodes:[1,"zoomToFocusNodes"],colorByCategory:[1,"colorByCategory"],showRelationshipLegend:[1,"showRelationshipLegend"],legendPosition:[1,"legendPosition"],tabbedLegend:[1,"tabbedLegend"],categoryLabelsOnHover:[1,"categoryLabelsOnHover"],nodeMenuItems:[1,"nodeMenuItems"],edgeMenuItems:[1,"edgeMenuItems"]},outputs:{nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick"},decls:5,vars:2,consts:[[2,"display","flex","flex-direction","column","position","relative","width","100%","flex","1","min-height","0"],[3,"elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems"],[3,"label","padded","position"],[3,"nodeHover","nodeClick","canvasClick","contextMenuAction","edgeContextMenuAction","elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems"],[3,"clickedClose","label","padded","position"],[1,"legend-tabs"],[3,"label"],[1,"legend-content"],[3,"visibilityAll","layerChange","layers"],["position","top-right",3,"title","layers"],["position","top-right",3,"close","layerChange","visibilityAll","title","layers"],[3,"close","layerChange","visibilityAll","title","layers","position"],["variant","ghost","size","s",1,"unhide-btn",3,"position","top","right"],["variant","ghost","size","s",1,"unhide-btn",3,"click"]],template:function(n,a){if(1&n&&(Ce.j41(0,"div",0),Ce.nVh(1,D0,1,4,"cue-simple-graph",1)(2,S0,1,0),Ce.nVh(3,L0,11,13,"cue-draggable-card",2)(4,R0,2,2),Ce.k0s()),2&n){let i;Ce.R7$(),Ce.vxM((i=a.elements())?1:2,i),Ce.R7$(2),Ce.vxM(a.tabbedLegend()&&!a._tabbedLegendClosed()?3:4)}},dependencies:[hl,m0.v,b0.y,w0.P,x0.t,E0.o,T0.Button,C0.ButtonLabel,Nn.Kj],styles:["[_nghost-%COMP%]{display:contents}.legend-tabs[_ngcontent-%COMP%]{width:180px}.legend-content[_ngcontent-%COMP%]{padding:4px 10px 24px;font-size:.8em;max-height:200px;overflow:auto}"],changeDetection:0})}return r})()},7573(Ze,Re,Y){"use strict";Y.d(Re,{E:()=>q});const q={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}},8846(Ze){"use strict";Ze.exports=function Re(Y){return null===Y||"object"!=typeof Y||null!=Y.toJSON?JSON.stringify(Y):Array.isArray(Y)?"["+Y.reduce((q,M,E)=>q+(0===E?"":",")+Re(void 0===M||"symbol"==typeof M?null:M),"")+"]":"{"+Object.keys(Y).sort().reduce((q,M,E)=>void 0===Y[M]||"symbol"==typeof Y[M]?q:q+(0===q.length?"":",")+Re(M)+":"+Re(Y[M]),"")+"}"}},1692(Ze,Re,Y){var q;Ze.exports=(q=Y(6556),function(M){var E={};function T(I){if(E[I])return E[I].exports;var y=E[I]={i:I,l:!1,exports:{}};return M[I].call(y.exports,y,y.exports,T),y.l=!0,y.exports}return T.m=M,T.c=E,T.i=function(I){return I},T.d=function(I,y,x){T.o(I,y)||Object.defineProperty(I,y,{configurable:!1,enumerable:!0,get:x})},T.n=function(I){var y=I&&I.__esModule?function(){return I.default}:function(){return I};return T.d(y,"a",y),y},T.o=function(I,y){return Object.prototype.hasOwnProperty.call(I,y)},T.p="",T(T.s=7)}([function(M,E){M.exports=q},function(M,E,T){"use strict";var I=T(0).FDLayoutConstants;function y(){}for(var x in I)y[x]=I[x];y.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,y.DEFAULT_RADIAL_SEPARATION=I.DEFAULT_EDGE_LENGTH,y.DEFAULT_COMPONENT_SEPERATION=60,y.TILE=!0,y.TILING_PADDING_VERTICAL=10,y.TILING_PADDING_HORIZONTAL=10,y.TREE_REDUCTION_ON_INCREMENTAL=!1,M.exports=y},function(M,E,T){"use strict";var I=T(0).FDLayoutEdge;function y(b,A,D){I.call(this,b,A,D)}for(var x in y.prototype=Object.create(I.prototype),I)y[x]=I[x];M.exports=y},function(M,E,T){"use strict";var I=T(0).LGraph;function y(b,A,D){I.call(this,b,A,D)}for(var x in y.prototype=Object.create(I.prototype),I)y[x]=I[x];M.exports=y},function(M,E,T){"use strict";var I=T(0).LGraphManager;function y(b){I.call(this,b)}for(var x in y.prototype=Object.create(I.prototype),I)y[x]=I[x];M.exports=y},function(M,E,T){"use strict";var I=T(0).FDLayoutNode,y=T(0).IMath;function x(A,D,k,G){I.call(this,A,D,k,G)}for(var b in x.prototype=Object.create(I.prototype),I)x[b]=I[b];x.prototype.move=function(){var A=this.graphManager.getLayout();this.displacementX=A.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=A.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>A.coolingFactor*A.maxNodeDisplacement&&(this.displacementX=A.coolingFactor*A.maxNodeDisplacement*y.sign(this.displacementX)),Math.abs(this.displacementY)>A.coolingFactor*A.maxNodeDisplacement&&(this.displacementY=A.coolingFactor*A.maxNodeDisplacement*y.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),A.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},x.prototype.propogateDisplacementToChildren=function(A,D){for(var G,k=this.getChild().getNodes(),P=0;P<k.length;P++)null==(G=k[P]).getChild()?(G.moveBy(A,D),G.displacementX+=A,G.displacementY+=D):G.propogateDisplacementToChildren(A,D)},x.prototype.setPred1=function(A){this.pred1=A},x.prototype.getPred1=function(){return pred1},x.prototype.getPred2=function(){return pred2},x.prototype.setNext=function(A){this.next=A},x.prototype.getNext=function(){return next},x.prototype.setProcessed=function(A){this.processed=A},x.prototype.isProcessed=function(){return processed},M.exports=x},function(M,E,T){"use strict";var I=T(0).FDLayout,y=T(4),x=T(3),b=T(5),A=T(2),D=T(1),k=T(0).FDLayoutConstants,G=T(0).LayoutConstants,P=T(0).Point,O=T(0).PointD,$=T(0).Layout,B=T(0).Integer,re=T(0).IGeometry,j=T(0).LGraph,xe=T(0).Transform;function ne(){I.call(this),this.toBeTiled={}}for(var R in ne.prototype=Object.create(I.prototype),I)ne[R]=I[R];ne.prototype.newGraphManager=function(){var S=new y(this);return this.graphManager=S,S},ne.prototype.newGraph=function(S){return new x(null,this.graphManager,S)},ne.prototype.newNode=function(S){return new b(this.graphManager,S)},ne.prototype.newEdge=function(S){return new A(null,null,S)},ne.prototype.initParameters=function(){I.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=D.DEFAULT_EDGE_LENGTH<10?10:D.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=D.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=k.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=k.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=k.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=k.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=k.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=k.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/k.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=k.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},ne.prototype.layout=function(){return G.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},ne.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(D.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(H){return L.has(H)});this.graphManager.setAllNodesToApplyGravitation(_)}}else{var S=this.getFlatForest();S.length>0?this.positionNodesRadially(S):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),L=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(ee){return L.has(ee)}),this.graphManager.setAllNodesToApplyGravitation(_),this.positionNodesRandomly())}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},ne.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%k.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(ie){return S.has(ie)});this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var _=!this.isTreeGrowing&&!this.isGrowthFinished,ee=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(_,ee),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},ne.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),L={},_=0;_<S.length;_++){var ee=S[_].rect,ie=S[_].id;L[ie]={id:ie,x:ee.getCenterX(),y:ee.getCenterY(),w:ee.width,h:ee.height}}return L},ne.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var S=!1;if("during"===k.ANIMATE)this.emit("layoutstarted");else{for(;!S;)S=this.tick();this.graphManager.updateBounds()}},ne.prototype.calculateNodesToApplyGravitationTo=function(){var L,ie,S=[],_=this.graphManager.getGraphs(),ee=_.length;for(ie=0;ie<ee;ie++)(L=_[ie]).updateConnected(),L.isConnected||(S=S.concat(L.getNodes()));return S},ne.prototype.createBendpoints=function(){var S=[];S=S.concat(this.graphManager.getAllEdges());var _,L=new Set;for(_=0;_<S.length;_++){var ee=S[_];if(!L.has(ee)){var ie=ee.getSource(),H=ee.getTarget();if(ie==H)ee.getBendpoints().push(new O),ee.getBendpoints().push(new O),this.createDummyNodesForBendpoints(ee),L.add(ee);else{var ae=[];if(ae=(ae=ae.concat(ie.getEdgeListToNode(H))).concat(H.getEdgeListToNode(ie)),!L.has(ae[0])){var me;if(ae.length>1)for(me=0;me<ae.length;me++){var ve=ae[me];ve.getBendpoints().push(new O),this.createDummyNodesForBendpoints(ve)}ae.forEach(function(Ee){L.add(Ee)})}}}if(L.size==S.length)break}},ne.prototype.positionNodesRadially=function(S){for(var L=new P(0,0),_=Math.ceil(Math.sqrt(S.length)),ee=0,ie=0,H=0,ae=new O(0,0),me=0;me<S.length;me++){me%_==0&&(H=0,ie=ee,0!=me&&(ie+=D.DEFAULT_COMPONENT_SEPERATION),ee=0);var ve=S[me],Ee=$.findCenterOfTree(ve);L.x=H,L.y=ie,(ae=ne.radialLayout(ve,Ee,L)).y>ee&&(ee=Math.floor(ae.y)),H=Math.floor(ae.x+D.DEFAULT_COMPONENT_SEPERATION)}this.transform(new O(G.WORLD_CENTER_X-ae.x/2,G.WORLD_CENTER_Y-ae.y/2))},ne.radialLayout=function(S,L,_){var ee=Math.max(this.maxDiagonalInTree(S),D.DEFAULT_RADIAL_SEPARATION);ne.branchRadialLayout(L,null,0,359,0,ee);var ie=j.calculateBounds(S),H=new xe;H.setDeviceOrgX(ie.getMinX()),H.setDeviceOrgY(ie.getMinY()),H.setWorldOrgX(_.x),H.setWorldOrgY(_.y);for(var ae=0;ae<S.length;ae++)S[ae].transform(H);var ve=new O(ie.getMaxX(),ie.getMaxY());return H.inverseTransformPoint(ve)},ne.branchRadialLayout=function(S,L,_,ee,ie,H){var ae=(ee-_+1)/2;ae<0&&(ae+=180);var ve=(ae+_)%360*re.TWO_PI/360,Ge=(Math.cos(ve),ie*Math.cos(ve)),fe=ie*Math.sin(ve);S.setCenter(Ge,fe);var te=[],ce=(te=te.concat(S.getEdges())).length;null!=L&&ce--;for(var se,Me=0,pe=te.length,Ne=S.getEdgesBetween(L);Ne.length>1;){var Je=Ne[0];Ne.splice(0,1);var qe=te.indexOf(Je);qe>=0&&te.splice(qe,1),pe--,ce--}se=null!=L?(te.indexOf(Ne[0])+1)%pe:0;for(var et=Math.abs(ee-_)/ce,ke=se;Me!=ce;ke=++ke%pe){var We=te[ke].getOtherEnd(S);if(We!=L){var we=(_+Me*et)%360;ne.branchRadialLayout(We,S,we,(we+et)%360,ie+H,H),Me++}}},ne.maxDiagonalInTree=function(S){for(var L=B.MIN_VALUE,_=0;_<S.length;_++){var ie=S[_].getDiagonal();ie>L&&(L=ie)}return L},ne.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},ne.prototype.groupZeroDegreeMembers=function(){var S=this,L={};this.memberGroups={},this.idToDummyNode={};for(var _=[],ee=this.graphManager.getAllNodes(),ie=0;ie<ee.length;ie++){var ae=(H=ee[ie]).getParent();0===this.getNodeDegreeWithChildren(H)&&(null==ae.id||!this.getToBeTiled(ae))&&_.push(H)}for(ie=0;ie<_.length;ie++){var H,me=(H=_[ie]).getParent().id;typeof L[me]>"u"&&(L[me]=[]),L[me]=L[me].concat(H)}Object.keys(L).forEach(function(ve){if(L[ve].length>1){var Ee="DummyCompound_"+ve;S.memberGroups[Ee]=L[ve];var Ge=L[ve][0].getParent(),fe=new b(S.graphManager);fe.id=Ee,fe.paddingLeft=Ge.paddingLeft||0,fe.paddingRight=Ge.paddingRight||0,fe.paddingBottom=Ge.paddingBottom||0,fe.paddingTop=Ge.paddingTop||0,S.idToDummyNode[Ee]=fe;var te=S.getGraphManager().add(S.newGraph(),fe),ce=Ge.getChild();ce.add(fe);for(var Me=0;Me<L[ve].length;Me++){var pe=L[ve][Me];ce.remove(pe),te.add(pe)}}})},ne.prototype.clearCompounds=function(){var S={},L={};this.performDFSOnCompounds();for(var _=0;_<this.compoundOrder.length;_++)L[this.compoundOrder[_].id]=this.compoundOrder[_],S[this.compoundOrder[_].id]=[].concat(this.compoundOrder[_].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[_].getChild()),this.compoundOrder[_].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(S,L)},ne.prototype.clearZeroDegreeMembers=function(){var S=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(_){var ee=S.idToDummyNode[_];L[_]=S.tileNodes(S.memberGroups[_],ee.paddingLeft+ee.paddingRight),ee.rect.width=L[_].width,ee.rect.height=L[_].height})},ne.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var L=this.compoundOrder[S];this.adjustLocations(this.tiledMemberPack[L.id],L.rect.x,L.rect.y,L.paddingLeft,L.paddingTop)}},ne.prototype.repopulateZeroDegreeMembers=function(){var S=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(_){var ee=S.idToDummyNode[_];S.adjustLocations(L[_],ee.rect.x,ee.rect.y,ee.paddingLeft,ee.paddingTop)})},ne.prototype.getToBeTiled=function(S){var L=S.id;if(null!=this.toBeTiled[L])return this.toBeTiled[L];var _=S.getChild();if(null==_)return this.toBeTiled[L]=!1,!1;for(var ee=_.getNodes(),ie=0;ie<ee.length;ie++){var H=ee[ie];if(this.getNodeDegree(H)>0)return this.toBeTiled[L]=!1,!1;if(null!=H.getChild()){if(!this.getToBeTiled(H))return this.toBeTiled[L]=!1,!1}else this.toBeTiled[H.id]=!1}return this.toBeTiled[L]=!0,!0},ne.prototype.getNodeDegree=function(S){for(var _=S.getEdges(),ee=0,ie=0;ie<_.length;ie++){var H=_[ie];H.getSource().id!==H.getTarget().id&&(ee+=1)}return ee},ne.prototype.getNodeDegreeWithChildren=function(S){var L=this.getNodeDegree(S);if(null==S.getChild())return L;for(var _=S.getChild().getNodes(),ee=0;ee<_.length;ee++)L+=this.getNodeDegreeWithChildren(_[ee]);return L},ne.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},ne.prototype.fillCompexOrderByDFS=function(S){for(var L=0;L<S.length;L++){var _=S[L];null!=_.getChild()&&this.fillCompexOrderByDFS(_.getChild().getNodes()),this.getToBeTiled(_)&&this.compoundOrder.push(_)}},ne.prototype.adjustLocations=function(S,L,_,ee,ie){_+=ie;for(var H=L+=ee,ae=0;ae<S.rows.length;ae++){var me=S.rows[ae];L=H;for(var ve=0,Ee=0;Ee<me.length;Ee++){var Ge=me[Ee];Ge.rect.x=L,Ge.rect.y=_,L+=Ge.rect.width+S.horizontalPadding,Ge.rect.height>ve&&(ve=Ge.rect.height)}_+=ve+S.verticalPadding}},ne.prototype.tileCompoundMembers=function(S,L){var _=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(ee){var ie=L[ee];_.tiledMemberPack[ee]=_.tileNodes(S[ee],ie.paddingLeft+ie.paddingRight),ie.rect.width=_.tiledMemberPack[ee].width,ie.rect.height=_.tiledMemberPack[ee].height})},ne.prototype.tileNodes=function(S,L){var ie={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:D.TILING_PADDING_VERTICAL,horizontalPadding:D.TILING_PADDING_HORIZONTAL};S.sort(function(me,ve){return me.rect.width*me.rect.height>ve.rect.width*ve.rect.height?-1:me.rect.width*me.rect.height<ve.rect.width*ve.rect.height?1:0});for(var H=0;H<S.length;H++){var ae=S[H];0==ie.rows.length?this.insertNodeToRow(ie,ae,0,L):this.canAddHorizontal(ie,ae.rect.width,ae.rect.height)?this.insertNodeToRow(ie,ae,this.getShortestRowIndex(ie),L):this.insertNodeToRow(ie,ae,ie.rows.length,L),this.shiftToLastRow(ie)}return ie},ne.prototype.insertNodeToRow=function(S,L,_,ee){var ie=ee;_==S.rows.length&&(S.rows.push([]),S.rowWidth.push(ie),S.rowHeight.push(0));var ae=S.rowWidth[_]+L.rect.width;S.rows[_].length>0&&(ae+=S.horizontalPadding),S.rowWidth[_]=ae,S.width<ae&&(S.width=ae);var me=L.rect.height;_>0&&(me+=S.verticalPadding);var ve=0;me>S.rowHeight[_]&&(ve=S.rowHeight[_],S.rowHeight[_]=me,ve=S.rowHeight[_]-ve),S.height+=ve,S.rows[_].push(L)},ne.prototype.getShortestRowIndex=function(S){for(var L=-1,_=Number.MAX_VALUE,ee=0;ee<S.rows.length;ee++)S.rowWidth[ee]<_&&(L=ee,_=S.rowWidth[ee]);return L},ne.prototype.getLongestRowIndex=function(S){for(var L=-1,_=Number.MIN_VALUE,ee=0;ee<S.rows.length;ee++)S.rowWidth[ee]>_&&(L=ee,_=S.rowWidth[ee]);return L},ne.prototype.canAddHorizontal=function(S,L,_){var ee=this.getShortestRowIndex(S);if(ee<0)return!0;var ie=S.rowWidth[ee];if(ie+S.horizontalPadding+L<=S.width)return!0;var ae,me,H=0;return S.rowHeight[ee]<_&&ee>0&&(H=_+S.verticalPadding-S.rowHeight[ee]),ae=S.width-ie>=L+S.horizontalPadding?(S.height+H)/(ie+L+S.horizontalPadding):(S.height+H)/S.width,H=_+S.verticalPadding,(me=S.width<L?(S.height+H)/L:(S.height+H)/S.width)<1&&(me=1/me),ae<1&&(ae=1/ae),ae<me},ne.prototype.shiftToLastRow=function(S){var L=this.getLongestRowIndex(S),_=S.rowWidth.length-1,ee=S.rows[L],ie=ee[ee.length-1],H=ie.width+S.horizontalPadding;if(S.width-S.rowWidth[_]>H&&L!=_){ee.splice(-1,1),S.rows[_].push(ie),S.rowWidth[L]=S.rowWidth[L]-H,S.rowWidth[_]=S.rowWidth[_]+H,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var ae=Number.MIN_VALUE,me=0;me<ee.length;me++)ee[me].height>ae&&(ae=ee[me].height);L>0&&(ae+=S.verticalPadding);var ve=S.rowHeight[L]+S.rowHeight[_];S.rowHeight[L]=ae,S.rowHeight[_]<ie.height+S.verticalPadding&&(S.rowHeight[_]=ie.height+S.verticalPadding),S.height+=S.rowHeight[L]+S.rowHeight[_]-ve,this.shiftToLastRow(S)}},ne.prototype.tilingPreLayout=function(){D.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},ne.prototype.tilingPostLayout=function(){D.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},ne.prototype.reduceTrees=function(){for(var _,S=[],L=!0;L;){var ee=this.graphManager.getAllNodes(),ie=[];L=!1;for(var H=0;H<ee.length;H++)1==(_=ee[H]).getEdges().length&&!_.getEdges()[0].isInterGraph&&null==_.getChild()&&(ie.push([_,_.getEdges()[0],_.getOwner()]),L=!0);if(1==L){for(var ae=[],me=0;me<ie.length;me++)1==ie[me][0].getEdges().length&&(ae.push(ie[me]),ie[me][0].getOwner().remove(ie[me][0]));S.push(ae),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=S},ne.prototype.growTree=function(S){for(var ee,_=S[S.length-1],ie=0;ie<_.length;ie++)this.findPlaceforPrunedNode(ee=_[ie]),ee[2].add(ee[0]),ee[2].add(ee[1],ee[1].source,ee[1].target);S.splice(S.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},ne.prototype.findPlaceforPrunedNode=function(S){var L,_,ee=S[0],ie=(_=ee==S[1].source?S[1].target:S[1].source).startX,H=_.finishX,ae=_.startY,me=_.finishY,te=[0,0,0,0];if(ae>0)for(var ce=ie;ce<=H;ce++)te[0]+=this.grid[ce][ae-1].length+this.grid[ce][ae].length-1;if(H<this.grid.length-1)for(ce=ae;ce<=me;ce++)te[1]+=this.grid[H+1][ce].length+this.grid[H][ce].length-1;if(me<this.grid[0].length-1)for(ce=ie;ce<=H;ce++)te[2]+=this.grid[ce][me+1].length+this.grid[ce][me].length-1;if(ie>0)for(ce=ae;ce<=me;ce++)te[3]+=this.grid[ie-1][ce].length+this.grid[ie][ce].length-1;for(var pe,se,Me=B.MAX_VALUE,Ne=0;Ne<te.length;Ne++)te[Ne]<Me?(Me=te[Ne],pe=1,se=Ne):te[Ne]==Me&&pe++;if(3==pe&&0==Me)0==te[0]&&0==te[1]&&0==te[2]?L=1:0==te[0]&&0==te[1]&&0==te[3]?L=0:0==te[0]&&0==te[2]&&0==te[3]?L=3:0==te[1]&&0==te[2]&&0==te[3]&&(L=2);else if(2==pe&&0==Me){var Je=Math.floor(2*Math.random());L=0==te[0]&&0==te[1]?0==Je?0:1:0==te[0]&&0==te[2]?0==Je?0:2:0==te[0]&&0==te[3]?0==Je?0:3:0==te[1]&&0==te[2]?0==Je?1:2:0==te[1]&&0==te[3]?0==Je?1:3:0==Je?2:3}else L=4==pe&&0==Me?Je=Math.floor(4*Math.random()):se;0==L?ee.setCenter(_.getCenterX(),_.getCenterY()-_.getHeight()/2-k.DEFAULT_EDGE_LENGTH-ee.getHeight()/2):1==L?ee.setCenter(_.getCenterX()+_.getWidth()/2+k.DEFAULT_EDGE_LENGTH+ee.getWidth()/2,_.getCenterY()):2==L?ee.setCenter(_.getCenterX(),_.getCenterY()+_.getHeight()/2+k.DEFAULT_EDGE_LENGTH+ee.getHeight()/2):ee.setCenter(_.getCenterX()-_.getWidth()/2-k.DEFAULT_EDGE_LENGTH-ee.getWidth()/2,_.getCenterY())},M.exports=ne},function(M,E,T){"use strict";var I={};I.layoutBase=T(0),I.CoSEConstants=T(1),I.CoSEEdge=T(2),I.CoSEGraph=T(3),I.CoSEGraphManager=T(4),I.CoSELayout=T(6),I.CoSENode=T(5),M.exports=I}]))},6894(Ze,Re,Y){var q;Ze.exports=(q=Y(1692),function(M){var E={};function T(I){if(E[I])return E[I].exports;var y=E[I]={i:I,l:!1,exports:{}};return M[I].call(y.exports,y,y.exports,T),y.l=!0,y.exports}return T.m=M,T.c=E,T.i=function(I){return I},T.d=function(I,y,x){T.o(I,y)||Object.defineProperty(I,y,{configurable:!1,enumerable:!0,get:x})},T.n=function(I){var y=I&&I.__esModule?function(){return I.default}:function(){return I};return T.d(y,"a",y),y},T.o=function(I,y){return Object.prototype.hasOwnProperty.call(I,y)},T.p="",T(T.s=1)}([function(M,E){M.exports=q},function(M,E,T){"use strict";var I=T(0).layoutBase.LayoutConstants,y=T(0).layoutBase.FDLayoutConstants,x=T(0).CoSEConstants,b=T(0).CoSELayout,A=T(0).CoSENode,D=T(0).layoutBase.PointD,k=T(0).layoutBase.DimensionD,G={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function O(re){this.options=function P(re,j){var xe={};for(var ne in re)xe[ne]=re[ne];for(var ne in j)xe[ne]=j[ne];return xe}(G,re),$(this.options)}var $=function(j){null!=j.nodeRepulsion&&(x.DEFAULT_REPULSION_STRENGTH=y.DEFAULT_REPULSION_STRENGTH=j.nodeRepulsion),null!=j.idealEdgeLength&&(x.DEFAULT_EDGE_LENGTH=y.DEFAULT_EDGE_LENGTH=j.idealEdgeLength),null!=j.edgeElasticity&&(x.DEFAULT_SPRING_STRENGTH=y.DEFAULT_SPRING_STRENGTH=j.edgeElasticity),null!=j.nestingFactor&&(x.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=j.nestingFactor),null!=j.gravity&&(x.DEFAULT_GRAVITY_STRENGTH=y.DEFAULT_GRAVITY_STRENGTH=j.gravity),null!=j.numIter&&(x.MAX_ITERATIONS=y.MAX_ITERATIONS=j.numIter),null!=j.gravityRange&&(x.DEFAULT_GRAVITY_RANGE_FACTOR=y.DEFAULT_GRAVITY_RANGE_FACTOR=j.gravityRange),null!=j.gravityCompound&&(x.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.DEFAULT_COMPOUND_GRAVITY_STRENGTH=j.gravityCompound),null!=j.gravityRangeCompound&&(x.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=j.gravityRangeCompound),null!=j.initialEnergyOnIncremental&&(x.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.DEFAULT_COOLING_FACTOR_INCREMENTAL=j.initialEnergyOnIncremental),I.QUALITY="draft"==j.quality?0:"proof"==j.quality?2:1,x.NODE_DIMENSIONS_INCLUDE_LABELS=y.NODE_DIMENSIONS_INCLUDE_LABELS=I.NODE_DIMENSIONS_INCLUDE_LABELS=j.nodeDimensionsIncludeLabels,x.DEFAULT_INCREMENTAL=y.DEFAULT_INCREMENTAL=I.DEFAULT_INCREMENTAL=!j.randomize,x.ANIMATE=y.ANIMATE=I.ANIMATE=j.animate,x.TILE=j.tile,x.TILING_PADDING_VERTICAL="function"==typeof j.tilingPaddingVertical?j.tilingPaddingVertical.call():j.tilingPaddingVertical,x.TILING_PADDING_HORIZONTAL="function"==typeof j.tilingPaddingHorizontal?j.tilingPaddingHorizontal.call():j.tilingPaddingHorizontal};O.prototype.run=function(){var re,j,xe=this.options,R=(this.idToLNode={},this.layout=new b),S=this;S.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var L=R.newGraphManager();this.gm=L;var _=this.options.eles.nodes(),ee=this.options.eles.edges();this.root=L.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(_),R);for(var ie=0;ie<ee.length;ie++){var H=ee[ie],ae=this.idToLNode[H.data("source")],me=this.idToLNode[H.data("target")];ae!==me&&0==ae.getEdgesBetween(me).length&&(L.add(R.newEdge(),ae,me).id=H.id())}var Ee=function(te,ce){"number"==typeof te&&(te=ce);var Me=te.data("id"),pe=S.idToLNode[Me];return{x:pe.getRect().getCenterX(),y:pe.getRect().getCenterY()}},Ge=function fe(){for(var Me,te=function(){xe.fit&&xe.cy.fit(xe.eles,xe.padding),re||(re=!0,S.cy.one("layoutready",xe.ready),S.cy.trigger({type:"layoutready",layout:S}))},ce=S.options.refresh,pe=0;pe<ce&&!Me;pe++)Me=S.stopped||S.layout.tick();if(Me)return R.checkLayoutSuccess()&&!R.isSubLayout&&R.doPostLayout(),R.tilingPostLayout&&R.tilingPostLayout(),R.isLayoutFinished=!0,S.options.eles.nodes().positions(Ee),te(),S.cy.one("layoutstop",S.options.stop),S.cy.trigger({type:"layoutstop",layout:S}),j&&cancelAnimationFrame(j),void(re=!1);var se=S.layout.getPositionsData();xe.eles.nodes().positions(function(Ne,Je){if("number"==typeof Ne&&(Ne=Je),!Ne.isParent()){for(var qe=Ne.id(),et=se[qe],ke=Ne;null==et&&(et=se[ke.data("parent")]||se["DummyCompound_"+ke.data("parent")],se[qe]=et,null!=(ke=ke.parent()[0])););return null!=et?{x:et.x,y:et.y}:{x:Ne.position("x"),y:Ne.position("y")}}}),te(),j=requestAnimationFrame(fe)};return R.addListener("layoutstarted",function(){"during"===S.options.animate&&(j=requestAnimationFrame(Ge))}),R.runLayout(),"during"!==this.options.animate&&(S.options.eles.nodes().not(":parent").layoutPositions(S,S.options,Ee),re=!1),this},O.prototype.getTopMostNodes=function(re){for(var j={},xe=0;xe<re.length;xe++)j[re[xe].id()]=!0;return re.filter(function(R,S){"number"==typeof R&&(R=S);for(var L=R.parent()[0];null!=L;){if(j[L.id()])return!1;L=L.parent()[0]}return!0})},O.prototype.processChildrenList=function(re,j,xe){for(var ne=j.length,R=0;R<ne;R++){var _,me,S=j[R],L=S.children(),ee=S.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((_=null!=S.outerWidth()&&null!=S.outerHeight()?re.add(new A(xe.graphManager,new D(S.position("x")-ee.w/2,S.position("y")-ee.h/2),new k(parseFloat(ee.w),parseFloat(ee.h)))):re.add(new A(this.graphManager))).id=S.data("id"),_.paddingLeft=parseInt(S.css("padding")),_.paddingTop=parseInt(S.css("padding")),_.paddingRight=parseInt(S.css("padding")),_.paddingBottom=parseInt(S.css("padding")),this.options.nodeDimensionsIncludeLabels&&S.isParent()){var ie=S.boundingBox({includeLabels:!0,includeNodes:!1}).w,H=S.boundingBox({includeLabels:!0,includeNodes:!1}).h,ae=S.css("text-halign");_.labelWidth=ie,_.labelHeight=H,_.labelPos=ae}this.idToLNode[S.data("id")]=_,isNaN(_.rect.x)&&(_.rect.x=0),isNaN(_.rect.y)&&(_.rect.y=0),null!=L&&L.length>0&&(me=xe.getGraphManager().add(xe.newGraph(),_),this.processChildrenList(me,L,xe))}},O.prototype.stop=function(){return this.stopped=!0,this};var B=function(j){j("layout","cose-bilkent",O)};typeof cytoscape<"u"&&B(cytoscape),M.exports=B}]))},7839(Ze,Re,Y){"use strict";var q=Y(9293).default;const{isArray:M,isObject:E,isString:T}=Y(2831),{asArray:I}=Y(9420),{prependBase:y}=Y(2051),x=Y(262),b=Y(6181);function D(G){throw new x("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:G})}function k({context:G,base:P}){if(!G)return;const O=G["@context"];if(T(O))G["@context"]=y(P,O);else if(M(O))for(let $=0;$<O.length;++$){const B=O[$];T(B)?O[$]=y(P,B):E(B)&&k({context:{"@context":B},base:P})}else if(E(O))for(const $ in O)k({context:O[$],base:P})}Ze.exports=class{constructor({sharedCache:P}){this.perOpCache=new Map,this.sharedCache=P}resolve(P){var O=this;return q(function*({activeCtx:$,context:B,documentLoader:re,base:j,cycles:xe=new Set}){B&&E(B)&&B["@context"]&&(B=B["@context"]),B=I(B);const ne=[];for(const R of B){if(T(R)){let _=O._get(R);_||(_=yield O._resolveRemoteContext({activeCtx:$,url:R,documentLoader:re,base:j,cycles:xe})),M(_)?ne.push(..._):ne.push(_);continue}if(null===R){ne.push(new b({document:null}));continue}E(R)||D(B);const S=JSON.stringify(R);let L=O._get(S);L||(L=new b({document:R}),O._cacheResolvedContext({key:S,resolved:L,tag:"static"})),ne.push(L)}return ne}).apply(this,arguments)}_get(P){let O=this.perOpCache.get(P);if(!O){const $=this.sharedCache.get(P);$&&(O=$.get("static"),O&&this.perOpCache.set(P,O))}return O}_cacheResolvedContext({key:P,resolved:O,tag:$}){if(this.perOpCache.set(P,O),void 0!==$){let B=this.sharedCache.get(P);B||(B=new Map,this.sharedCache.set(P,B)),B.set($,O)}return O}_resolveRemoteContext(P){var O=this;return q(function*({activeCtx:$,url:B,documentLoader:re,base:j,cycles:xe}){B=y(j,B);const{context:ne,remoteDoc:R}=yield O._fetchContext({activeCtx:$,url:B,documentLoader:re,cycles:xe});k({context:ne,base:j=R.documentUrl||B});const S=yield O.resolve({activeCtx:$,context:ne,documentLoader:re,base:j,cycles:xe});return O._cacheResolvedContext({key:B,resolved:S,tag:R.tag}),S}).apply(this,arguments)}_fetchContext(P){return q(function*({activeCtx:O,url:$,documentLoader:B,cycles:re}){if(re.size>10)throw new x("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===O.processingMode?"loading remote context failed":"context overflow",max:10});if(re.has($))throw new x("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===O.processingMode?"recursive context inclusion":"context overflow",url:$});let j,xe;re.add($);try{xe=yield B($),j=xe.document||null,T(j)&&(j=JSON.parse(j))}catch(ne){throw new x(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${$}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:$,cause:ne})}if(!E(j))throw new x(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${$}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:$});return j="@context"in j?{"@context":j["@context"]}:{"@context":{}},xe.contextUrl&&(M(j["@context"])||(j["@context"]=[j["@context"]]),j["@context"].push(xe.contextUrl)),{context:j,remoteDoc:xe}}).apply(this,arguments)}}},262(Ze){"use strict";Ze.exports=class extends Error{constructor(Y="An unspecified JSON-LD error occurred.",q="jsonld.Error",M={}){super(Y),this.name=q,this.message=Y,this.details=M}}},1328(Ze){"use strict";Ze.exports=Re=>{class Y{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(Y,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(Y.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:Y}),Y.compact=function(q,M){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):Re.compact(q,M)},Y.expand=function(q){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):Re.expand(q)},Y.flatten=function(q){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):Re.flatten(q)},Y}},5426(Ze,Re,Y){"use strict";Ze.exports=Y(1224).NQuads},4808(Ze,Re,Y){"use strict";var q=Y(9293).default;Ze.exports=class{constructor(){this._requests={}}wrapLoader(E){const T=this;return T._loader=E,function(){return T.add.apply(T,arguments)}}add(E){var T=this;return q(function*(){let I=T._requests[E];if(I)return Promise.resolve(I);I=T._requests[E]=T._loader(E);try{return yield I}finally{delete T._requests[E]}})()}}},6181(Ze,Re,Y){"use strict";const q=Y(3052);Ze.exports=class{constructor({document:T}){this.document=T,this.cache=new q({max:10})}getProcessed(T){return this.cache.get(T)}setProcessed(T,I){this.cache.set(T,I)}}},3763(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(262),{isArray:E,isObject:T,isString:I,isUndefined:y}=Y(2831),{isList:x,isValue:b,isGraph:A,isSimpleGraph:D,isSubjectReference:k}=Y(4209),{expandIri:G,getContextValue:P,isKeyword:O,process:$,processingMode:B}=Y(429),{removeBase:re,prependBase:j}=Y(2051),{REGEX_KEYWORD:xe,addValue:ne,asArray:R,compareShortestLeast:S}=Y(9420),L={};function ee(ie,H,ae){if("@nest"!==G(ie,H,{vocab:!0},ae))throw new M("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ze.exports=L,L.compact=function(){var ie=q(function*({activeCtx:H,activeProperty:ae=null,element:me,options:ve={}}){if(E(me)){let Ge=[];for(let fe=0;fe<me.length;++fe){const te=yield L.compact({activeCtx:H,activeProperty:ae,element:me[fe],options:ve});null!==te&&Ge.push(te)}return ve.compactArrays&&1===Ge.length&&0===(P(H,ae,"@container")||[]).length&&(Ge=Ge[0]),Ge}const Ee=P(H,ae,"@context");if(y(Ee)||(H=yield $({activeCtx:H,localCtx:Ee,propagate:!0,overrideProtected:!0,options:ve})),T(me)){if(ve.link&&"@id"in me&&ve.link.hasOwnProperty(me["@id"])){const Ne=ve.link[me["@id"]];for(let Je=0;Je<Ne.length;++Je)if(Ne[Je].expanded===me)return Ne[Je].compacted}if(b(me)||k(me)){const Ne=L.compactValue({activeCtx:H,activeProperty:ae,value:me,options:ve});return ve.link&&k(me)&&(ve.link.hasOwnProperty(me["@id"])||(ve.link[me["@id"]]=[]),ve.link[me["@id"]].push({expanded:me,compacted:Ne})),Ne}if(x(me)&&(P(H,ae,"@container")||[]).includes("@list"))return L.compact({activeCtx:H,activeProperty:ae,element:me["@list"],options:ve});const Ge="@reverse"===ae,fe={},te=H;!b(me)&&!k(me)&&(H=H.revertToPreviousContext());const ce=P(te,ae,"@context");y(ce)||(H=yield $({activeCtx:H,localCtx:ce,propagate:!0,overrideProtected:!0,options:ve})),ve.link&&"@id"in me&&(ve.link.hasOwnProperty(me["@id"])||(ve.link[me["@id"]]=[]),ve.link[me["@id"]].push({expanded:me,compacted:fe}));let Me=me["@type"]||[];Me.length>1&&(Me=Array.from(Me).sort());const pe=H;for(const Ne of Me){const Je=L.compactIri({activeCtx:pe,iri:Ne,relativeTo:{vocab:!0}}),qe=P(te,Je,"@context");y(qe)||(H=yield $({activeCtx:H,localCtx:qe,options:ve,propagate:!1}))}const se=Object.keys(me).sort();for(const Ne of se){const Je=me[Ne];if("@id"===Ne){let qe=R(Je).map(ke=>L.compactIri({activeCtx:H,iri:ke,relativeTo:{vocab:!1},base:ve.base}));1===qe.length&&(qe=qe[0]),fe[L.compactIri({activeCtx:H,iri:"@id",relativeTo:{vocab:!0}})]=qe;continue}if("@type"===Ne){let qe=R(Je).map(oe=>L.compactIri({activeCtx:te,iri:oe,relativeTo:{vocab:!0}}));1===qe.length&&(qe=qe[0]);const et=L.compactIri({activeCtx:H,iri:"@type",relativeTo:{vocab:!0}}),we=(P(H,et,"@container")||[]).includes("@set")&&B(H,1.1)||E(qe)&&0===Je.length;ne(fe,et,qe,{propertyIsArray:we});continue}if("@reverse"===Ne){const qe=yield L.compact({activeCtx:H,activeProperty:"@reverse",element:Je,options:ve});for(const et in qe)if(H.mappings.has(et)&&H.mappings.get(et).reverse){const ke=qe[et],we=(P(H,et,"@container")||[]).includes("@set")||!ve.compactArrays;ne(fe,et,ke,{propertyIsArray:we}),delete qe[et]}if(Object.keys(qe).length>0){const et=L.compactIri({activeCtx:H,iri:Ne,relativeTo:{vocab:!0}});ne(fe,et,qe)}continue}if("@preserve"===Ne){const qe=yield L.compact({activeCtx:H,activeProperty:ae,element:Je,options:ve});E(qe)&&0===qe.length||ne(fe,Ne,qe);continue}if("@index"===Ne){if((P(H,ae,"@container")||[]).includes("@index"))continue;const et=L.compactIri({activeCtx:H,iri:Ne,relativeTo:{vocab:!0}});ne(fe,et,Je);continue}if("@graph"!==Ne&&"@list"!==Ne&&"@included"!==Ne&&O(Ne)){const qe=L.compactIri({activeCtx:H,iri:Ne,relativeTo:{vocab:!0}});ne(fe,qe,Je);continue}if(!E(Je))throw new M("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Je.length){const qe=L.compactIri({activeCtx:H,iri:Ne,value:Je,relativeTo:{vocab:!0},reverse:Ge}),et=H.mappings.has(qe)?H.mappings.get(qe)["@nest"]:null;let ke=fe;et&&(ee(H,et,ve),T(fe[et])||(fe[et]={}),ke=fe[et]),ne(ke,qe,Je,{propertyIsArray:!0})}for(const qe of Je){const et=L.compactIri({activeCtx:H,iri:Ne,value:qe,relativeTo:{vocab:!0},reverse:Ge}),ke=H.mappings.has(et)?H.mappings.get(et)["@nest"]:null;let We=fe;ke&&(ee(H,ke,ve),T(fe[ke])||(fe[ke]={}),We=fe[ke]);const we=P(H,et,"@container")||[],oe=A(qe),Be=x(qe);let Ye;Be?Ye=qe["@list"]:oe&&(Ye=qe["@graph"]);let Oe=yield L.compact({activeCtx:H,activeProperty:et,element:Be||oe?Ye:qe,options:ve});if(Be){if(E(Oe)||(Oe=[Oe]),we.includes("@list")){ne(We,et,Oe,{valueIsArray:!0,allowDuplicate:!0});continue}Oe={[L.compactIri({activeCtx:H,iri:"@list",relativeTo:{vocab:!0}})]:Oe},"@index"in qe&&(Oe[L.compactIri({activeCtx:H,iri:"@index",relativeTo:{vocab:!0}})]=qe["@index"])}if(oe)if(we.includes("@graph")&&(we.includes("@id")||we.includes("@index")&&D(qe))){let it;We.hasOwnProperty(et)?it=We[et]:We[et]=it={};const _e=(we.includes("@id")?qe["@id"]:qe["@index"])||L.compactIri({activeCtx:H,iri:"@none",relativeTo:{vocab:!0}});ne(it,_e,Oe,{propertyIsArray:!ve.compactArrays||we.includes("@set")})}else we.includes("@graph")&&D(qe)?(E(Oe)&&Oe.length>1&&(Oe={"@included":Oe}),ne(We,et,Oe,{propertyIsArray:!ve.compactArrays||we.includes("@set")})):(E(Oe)&&1===Oe.length&&ve.compactArrays&&(Oe=Oe[0]),Oe={[L.compactIri({activeCtx:H,iri:"@graph",relativeTo:{vocab:!0}})]:Oe},"@id"in qe&&(Oe[L.compactIri({activeCtx:H,iri:"@id",relativeTo:{vocab:!0}})]=qe["@id"]),"@index"in qe&&(Oe[L.compactIri({activeCtx:H,iri:"@index",relativeTo:{vocab:!0}})]=qe["@index"]),ne(We,et,Oe,{propertyIsArray:!ve.compactArrays||we.includes("@set")}));else if(we.includes("@language")||we.includes("@index")||we.includes("@id")||we.includes("@type")){let it,_e;if(We.hasOwnProperty(et)?it=We[et]:We[et]=it={},we.includes("@language"))b(Oe)&&(Oe=Oe["@value"]),_e=qe["@language"];else if(we.includes("@index")){const xt=P(H,et,"@index")||"@index",nt=L.compactIri({activeCtx:H,iri:xt,relativeTo:{vocab:!0}});if("@index"===xt)_e=qe["@index"],delete Oe[nt];else{let vt;if([_e,...vt]=R(Oe[xt]||[]),I(_e))switch(vt.length){case 0:delete Oe[xt];break;case 1:Oe[xt]=vt[0];break;default:Oe[xt]=vt}else _e=null}}else if(we.includes("@id")){const xt=L.compactIri({activeCtx:H,iri:"@id",relativeTo:{vocab:!0}});_e=Oe[xt],delete Oe[xt]}else if(we.includes("@type")){const xt=L.compactIri({activeCtx:H,iri:"@type",relativeTo:{vocab:!0}});let nt;switch([_e,...nt]=R(Oe[xt]||[]),nt.length){case 0:delete Oe[xt];break;case 1:Oe[xt]=nt[0];break;default:Oe[xt]=nt}1===Object.keys(Oe).length&&"@id"in qe&&(Oe=yield L.compact({activeCtx:H,activeProperty:et,element:{"@id":qe["@id"]},options:ve}))}_e||(_e=L.compactIri({activeCtx:H,iri:"@none",relativeTo:{vocab:!0}})),ne(it,_e,Oe,{propertyIsArray:we.includes("@set")})}else{const it=!ve.compactArrays||we.includes("@set")||we.includes("@list")||E(Oe)&&0===Oe.length||"@list"===Ne||"@graph"===Ne;ne(We,et,Oe,{propertyIsArray:it})}}}return fe}return me});return function(H){return ie.apply(this,arguments)}}(),L.compactIri=({activeCtx:ie,iri:H,value:ae=null,relativeTo:me={vocab:!1},reverse:ve=!1,base:Ee=null})=>{if(null===H)return H;ie.isPropertyTermScoped&&ie.previousContext&&(ie=ie.previousContext);const Ge=ie.getInverse();if(O(H)&&H in Ge&&"@none"in Ge[H]&&"@type"in Ge[H]["@none"]&&"@none"in Ge[H]["@none"]["@type"])return Ge[H]["@none"]["@type"]["@none"];if(me.vocab&&H in Ge){const pe=ie["@language"]||"@none",se=[];T(ae)&&"@index"in ae&&!("@graph"in ae)&&se.push("@index","@index@set"),T(ae)&&"@preserve"in ae&&(ae=ae["@preserve"][0]),A(ae)?("@index"in ae&&se.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in ae&&se.push("@graph@id","@graph@id@set"),se.push("@graph","@graph@set","@set"),"@index"in ae||se.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in ae||se.push("@graph@id","@graph@id@set")):T(ae)&&!b(ae)&&se.push("@id","@id@set","@type","@set@type");let Ne="@language",Je="@null";if(ve)Ne="@type",Je="@reverse",se.push("@set");else if(x(ae)){"@index"in ae||se.push("@list");const et=ae["@list"];if(0===et.length)Ne="@any",Je="@none";else{let ke=0===et.length?pe:null,We=null;for(let we=0;we<et.length;++we){const oe=et[we];let Be="@none",Ye="@none";if(b(oe)?"@direction"in oe?Be=`${(oe["@language"]||"").toLowerCase()}_${oe["@direction"]}`:"@language"in oe?Be=oe["@language"].toLowerCase():"@type"in oe?Ye=oe["@type"]:Be="@null":Ye="@id",null===ke?ke=Be:Be!==ke&&b(oe)&&(ke="@none"),null===We?We=Ye:Ye!==We&&(We="@none"),"@none"===ke&&"@none"===We)break}ke=ke||"@none",We=We||"@none","@none"!==We?(Ne="@type",Je=We):Je=ke}}else{if(b(ae))if("@language"in ae&&!("@index"in ae)){se.push("@language","@language@set"),Je=ae["@language"];const et=ae["@direction"];et&&(Je=`${Je}_${et}`)}else"@direction"in ae&&!("@index"in ae)?Je=`_${ae["@direction"]}`:"@type"in ae&&(Ne="@type",Je=ae["@type"]);else Ne="@type",Je="@id";se.push("@set")}se.push("@none"),T(ae)&&!("@index"in ae)&&se.push("@index","@index@set"),b(ae)&&1===Object.keys(ae).length&&se.push("@language","@language@set");const qe=function _(ie,H,ae,me,ve,Ee){null===Ee&&(Ee="@null");const Ge=[];if(("@id"===Ee||"@reverse"===Ee)&&T(ae)&&"@id"in ae){"@reverse"===Ee&&Ge.push("@reverse");const te=L.compactIri({activeCtx:ie,iri:ae["@id"],relativeTo:{vocab:!0}});ie.mappings.has(te)&&ie.mappings.get(te)&&ie.mappings.get(te)["@id"]===ae["@id"]?Ge.push.apply(Ge,["@vocab","@id"]):Ge.push.apply(Ge,["@id","@vocab"])}else{Ge.push(Ee);const te=Ge.find(ce=>ce.includes("_"));te&&Ge.push(te.replace(/^[^_]+_/,"_"))}Ge.push("@none");const fe=ie.inverse[H];for(const te of me){if(!(te in fe))continue;const ce=fe[te][ve];for(const Me of Ge)if(Me in ce)return ce[Me]}return null}(ie,H,ae,se,Ne,Je);if(null!==qe)return qe}if(me.vocab&&"@vocab"in ie){const pe=ie["@vocab"];if(0===H.indexOf(pe)&&H!==pe){const se=H.substr(pe.length);if(!ie.mappings.has(se))return se}}let fe=null;const te=[];let ce=ie.fastCurieMap;const Me=H.length-1;for(let pe=0;pe<Me&&H[pe]in ce;++pe)ce=ce[H[pe]],""in ce&&te.push(ce[""][0]);for(let pe=te.length-1;pe>=0;--pe){const se=te[pe],Ne=se.terms;for(const Je of Ne){const qe=Je+":"+H.substr(se.iri.length);ie.mappings.get(Je)._prefix&&(!ie.mappings.has(qe)||null===ae&&ie.mappings.get(qe)["@id"]===H)&&(null===fe||S(qe,fe)<0)&&(fe=qe)}}if(null!==fe)return fe;for(const[pe,se]of ie.mappings)if(se&&se._prefix&&H.startsWith(pe+":"))throw new M(`Absolute IRI "${H}" confused with prefix "${pe}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ie});if(!me.vocab){if("@base"in ie){if(ie["@base"]){const pe=re(j(Ee,ie["@base"]),H);return xe.test(pe)?`./${pe}`:pe}return H}return re(Ee,H)}return H},L.compactValue=({activeCtx:ie,activeProperty:H,value:ae,options:me})=>{if(b(ae)){const fe=P(ie,H,"@type"),te=P(ie,H,"@language"),ce=P(ie,H,"@direction"),Me=P(ie,H,"@container")||[],pe="@index"in ae&&!Me.includes("@index");if(!pe&&"@none"!==fe&&(ae["@type"]===fe||"@language"in ae&&ae["@language"]===te&&"@direction"in ae&&ae["@direction"]===ce||"@language"in ae&&ae["@language"]===te||"@direction"in ae&&ae["@direction"]===ce))return ae["@value"];const se=Object.keys(ae).length,Ne=1===se||2===se&&"@index"in ae&&!pe,Je="@language"in ie,qe=I(ae["@value"]),et=ie.mappings.has(H)&&null===ie.mappings.get(H)["@language"];if(Ne&&"@none"!==fe&&(!Je||!qe||et))return ae["@value"];const ke={};return pe&&(ke[L.compactIri({activeCtx:ie,iri:"@index",relativeTo:{vocab:!0}})]=ae["@index"]),"@type"in ae?ke[L.compactIri({activeCtx:ie,iri:"@type",relativeTo:{vocab:!0}})]=L.compactIri({activeCtx:ie,iri:ae["@type"],relativeTo:{vocab:!0}}):"@language"in ae&&(ke[L.compactIri({activeCtx:ie,iri:"@language",relativeTo:{vocab:!0}})]=ae["@language"]),"@direction"in ae&&(ke[L.compactIri({activeCtx:ie,iri:"@direction",relativeTo:{vocab:!0}})]=ae["@direction"]),ke[L.compactIri({activeCtx:ie,iri:"@value",relativeTo:{vocab:!0}})]=ae["@value"],ke}const ve=G(ie,H,{vocab:!0},me),Ee=P(ie,H,"@type"),Ge=L.compactIri({activeCtx:ie,iri:ae["@id"],relativeTo:{vocab:"@vocab"===Ee},base:me.base});return"@id"===Ee||"@vocab"===Ee||"@graph"===ve?Ge:{[L.compactIri({activeCtx:ie,iri:"@id",relativeTo:{vocab:!0}})]:Ge}}},5315(Ze){"use strict";const Re="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Y="http://www.w3.org/2001/XMLSchema#";Ze.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:Re,RDF_LIST:Re+"List",RDF_FIRST:Re+"first",RDF_REST:Re+"rest",RDF_NIL:Re+"nil",RDF_TYPE:Re+"type",RDF_PLAIN_LITERAL:Re+"PlainLiteral",RDF_XML_LITERAL:Re+"XMLLiteral",RDF_JSON_LITERAL:Re+"JSON",RDF_OBJECT:Re+"object",RDF_LANGSTRING:Re+"langString",XSD:Y,XSD_BOOLEAN:Y+"boolean",XSD_DOUBLE:Y+"double",XSD_INTEGER:Y+"integer",XSD_STRING:Y+"string"}},429(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(9420),E=Y(262),{isArray:T,isObject:I,isString:y,isUndefined:x}=Y(2831),{isAbsolute:b,isRelative:A,prependBase:D}=Y(2051),{handleEvent:k}=Y(2585),{REGEX_BCP47:G,REGEX_KEYWORD:P,asArray:O,compareShortestLeast:$}=Y(9420),B=new Map,j={};function xe(R,S,L,_,ee,ie){if(null===S||!y(S)||j.isKeyword(S))return S;if(S.match(P))return null;if(_&&_.hasOwnProperty(S)&&!0!==ee.get(S)&&j.createTermDefinition({activeCtx:R,localCtx:_,term:S,defined:ee,options:ie}),(L=L||{}).vocab){const ae=R.mappings.get(S);if(null===ae)return null;if(I(ae)&&"@id"in ae)return ae["@id"]}const H=S.indexOf(":");if(H>0){const ae=S.substr(0,H),me=S.substr(H+1);if("_"===ae||0===me.indexOf("//"))return S;_&&_.hasOwnProperty(ae)&&j.createTermDefinition({activeCtx:R,localCtx:_,term:ae,defined:ee,options:ie});const ve=R.mappings.get(ae);if(ve&&ve._prefix)return ve["@id"]+me;if(b(S))return S}if(L.vocab&&"@vocab"in R)S=R["@vocab"]+S;else if(L.base){let ae,me;"@base"in R?R["@base"]?(me=D(ie.base,R["@base"]),ae=D(me,S)):(me=R["@base"],ae=S):(me=ie.base,ae=D(ie.base,S)),S=ae}return S}function ne(R,S){if(!R||"object"!=typeof R||!S||"object"!=typeof S)return R===S;const L=Array.isArray(R);if(L!==Array.isArray(S))return!1;if(L){if(R.length!==S.length)return!1;for(let ie=0;ie<R.length;++ie)if(!ne(R[ie],S[ie]))return!1;return!0}const _=Object.keys(R),ee=Object.keys(S);if(_.length!==ee.length)return!1;for(const ie in R){let H=R[ie],ae=S[ie];if("@container"===ie&&Array.isArray(H)&&Array.isArray(ae)&&(H=H.slice().sort(),ae=ae.slice().sort()),!ne(H,ae))return!1}return!0}Ze.exports=j,j.process=function(){var R=q(function*({activeCtx:S,localCtx:L,options:_,propagate:ee=!0,overrideProtected:ie=!1,cycles:H=new Set}){if(I(L)&&"@context"in L&&T(L["@context"])&&(L=L["@context"]),0===O(L).length)return S;const me=[],ve=[({event:te,next:ce})=>{me.push(te),ce()}];_.eventHandler&&ve.push(_.eventHandler);const Ee=_;_={..._,eventHandler:ve};const Ge=yield _.contextResolver.resolve({activeCtx:S,context:L,documentLoader:_.documentLoader,base:_.base});I(Ge[0].document)&&"boolean"==typeof Ge[0].document["@propagate"]&&(ee=Ge[0].document["@propagate"]);let fe=S;!ee&&!fe.previousContext&&(fe=fe.clone(),fe.previousContext=S);for(const te of Ge){let{document:ce}=te;if(S=fe,null===ce){if(!ie&&0!==Object.keys(S.protected).length)throw new E("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});fe=S=j.getInitialContext(_).clone();continue}const Me=te.getProcessed(S);if(Me){if(Ee.eventHandler)for(const se of Me.events)k({event:se,options:Ee});fe=S=Me.context;continue}if(I(ce)&&"@context"in ce&&(ce=ce["@context"]),!I(ce))throw new E("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:ce});fe=fe.clone();const pe=new Map;if("@version"in ce){if(1.1!==ce["@version"])throw new E("Unsupported JSON-LD version: "+ce["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:ce});if(S.processingMode&&"json-ld-1.0"===S.processingMode)throw new E("@version: "+ce["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:ce});fe.processingMode="json-ld-1.1",fe["@version"]=ce["@version"],pe.set("@version",!0)}if(fe.processingMode=fe.processingMode||S.processingMode,"@base"in ce){let se=ce["@base"];if(null!==se&&!b(se)){if(!A(se))throw new E('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:ce});se=D(fe["@base"],se)}fe["@base"]=se,pe.set("@base",!0)}if("@vocab"in ce){const se=ce["@vocab"];if(null===se)delete fe["@vocab"];else{if(!y(se))throw new E('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:ce});if(!b(se)&&j.processingMode(fe,1))throw new E('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:ce});{const Ne=xe(fe,se,{vocab:!0,base:!0},void 0,void 0,_);b(Ne)||_.eventHandler&&k({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:Ne}},options:_}),fe["@vocab"]=Ne}}pe.set("@vocab",!0)}if("@language"in ce){const se=ce["@language"];if(null===se)delete fe["@language"];else{if(!y(se))throw new E('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:ce});se.match(G)||_.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:se}},options:_}),fe["@language"]=se.toLowerCase()}pe.set("@language",!0)}if("@direction"in ce){const se=ce["@direction"];if("json-ld-1.0"===S.processingMode)throw new E("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:ce});if(null===se)delete fe["@direction"];else{if("ltr"!==se&&"rtl"!==se)throw new E('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:ce});fe["@direction"]=se}pe.set("@direction",!0)}if("@propagate"in ce){const se=ce["@propagate"];if("json-ld-1.0"===S.processingMode)throw new E("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:ce});if("boolean"!=typeof se)throw new E("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:L});pe.set("@propagate",!0)}if("@import"in ce){const se=ce["@import"];if("json-ld-1.0"===S.processingMode)throw new E("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:ce});if(!y(se))throw new E("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:L});const Ne=yield _.contextResolver.resolve({activeCtx:S,context:se,documentLoader:_.documentLoader,base:_.base});if(1!==Ne.length)throw new E("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:L});const Je=Ne[0].getProcessed(S);if(Je)ce=Je;else{const qe=Ne[0].document;if("@import"in qe)throw new E("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:L});for(const et in qe)ce.hasOwnProperty(et)||(ce[et]=qe[et]);Ne[0].setProcessed(S,ce)}pe.set("@import",!0)}pe.set("@protected",ce["@protected"]||!1);for(const se in ce)if(j.createTermDefinition({activeCtx:fe,localCtx:ce,term:se,defined:pe,options:_,overrideProtected:ie}),I(ce[se])&&"@context"in ce[se]){const Ne=ce[se]["@context"];let Je=!0;if(y(Ne)){const qe=D(_.base,Ne);H.has(qe)?Je=!1:H.add(qe)}if(Je)try{yield j.process({activeCtx:fe.clone(),localCtx:ce[se]["@context"],overrideProtected:!0,options:_,cycles:H})}catch{throw new E("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:ce[se]["@context"],term:se})}}te.setProcessed(S,{context:fe,events:me})}return fe});return function(S){return R.apply(this,arguments)}}(),j.createTermDefinition=({activeCtx:R,localCtx:S,term:L,defined:_,options:ee,overrideProtected:ie=!1})=>{if(_.has(L)){if(_.get(L))return;throw new E("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:S,term:L})}let H;if(_.set(L,!1),S.hasOwnProperty(L)&&(H=S[L]),"@type"===L&&I(H)&&"@set"===(H["@container"]||"@set")&&j.processingMode(R,1.1)){const te=["@container","@id","@protected"],ce=Object.keys(H);if(0===ce.length||ce.some(Me=>!te.includes(Me)))throw new E("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:S,term:L})}else{if(j.isKeyword(L))throw new E("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:S,term:L});if(L.match(P))return void(ee.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:L}},options:ee}));if(""===L)throw new E("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:S})}const ae=R.mappings.get(L);R.mappings.has(L)&&R.mappings.delete(L);let me=!1;if((y(H)||null===H)&&(me=!0,H={"@id":H}),!I(H))throw new E("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:S});const ve={};R.mappings.set(L,ve),ve.reverse=!1;const Ee=["@container","@id","@language","@reverse","@type"];j.processingMode(R,1.1)&&Ee.push("@context","@direction","@index","@nest","@prefix","@protected");for(const te in H)if(!Ee.includes(te))throw new E("Invalid JSON-LD syntax; a term definition must not contain "+te,"jsonld.SyntaxError",{code:"invalid term definition",context:S});const Ge=L.indexOf(":");if(ve._termHasColon=Ge>0,"@reverse"in H){if("@id"in H)throw new E("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:S});if("@nest"in H)throw new E("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:S});const te=H["@reverse"];if(!y(te))throw new E("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});if(te.match(P))return ee.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:te}},options:ee}),void(ae?R.mappings.set(L,ae):R.mappings.delete(L));const ce=xe(R,te,{vocab:!0,base:!1},S,_,ee);if(!b(ce))throw new E("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});ve["@id"]=ce,ve.reverse=!0}else if("@id"in H){let te=H["@id"];if(te&&!y(te))throw new E("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});if(null===te)ve["@id"]=null;else{if(!j.isKeyword(te)&&te.match(P))return ee.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:te}},options:ee}),void(ae?R.mappings.set(L,ae):R.mappings.delete(L));if(te!==L){if(te=xe(R,te,{vocab:!0,base:!1},S,_,ee),!b(te)&&!j.isKeyword(te))throw new E("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});if(L.match(/(?::[^:])|\//)&&xe(R,L,{vocab:!0,base:!1},S,new Map(_).set(L,!0),ee)!==te)throw new E("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});ve["@id"]=te,ve._prefix=me&&!ve._termHasColon&&null!==te.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in ve))if(ve._termHasColon){const te=L.substr(0,Ge);if(S.hasOwnProperty(te)&&j.createTermDefinition({activeCtx:R,localCtx:S,term:te,defined:_,options:ee}),R.mappings.has(te)){const ce=L.substr(Ge+1);ve["@id"]=R.mappings.get(te)["@id"]+ce}else ve["@id"]=L}else if("@type"===L)ve["@id"]=L;else{if(!("@vocab"in R))throw new E("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S,term:L});ve["@id"]=R["@vocab"]+L}if((!0===H["@protected"]||!0===_.get("@protected")&&!1!==H["@protected"])&&(R.protected[L]=!0,ve.protected=!0),_.set(L,!0),"@type"in H){let te=H["@type"];if(!y(te))throw new E("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:S});if("@json"===te||"@none"===te){if(j.processingMode(R,1))throw new E(`Invalid JSON-LD syntax; an @context @type value must not be "${te}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:S})}else if("@id"!==te&&"@vocab"!==te){if(te=xe(R,te,{vocab:!0,base:!1},S,_,ee),!b(te))throw new E("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:S});if(0===te.indexOf("_:"))throw new E("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:S})}ve["@type"]=te}if("@container"in H){const te=y(H["@container"])?[H["@container"]]:H["@container"]||[],ce=["@list","@set","@index","@language"];let Me=!0;const pe=te.includes("@set");if(j.processingMode(R,1.1)){if(ce.push("@graph","@id","@type"),te.includes("@list")){if(1!==te.length)throw new E("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:S})}else if(te.includes("@graph")){if(te.some(se=>"@graph"!==se&&"@id"!==se&&"@index"!==se&&"@set"!==se))throw new E("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:S})}else Me&=te.length<=(pe?2:1);if(te.includes("@type")&&(ve["@type"]=ve["@type"]||"@id",!["@id","@vocab"].includes(ve["@type"])))throw new E("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:S})}else Me&=!T(H["@container"]),Me&=te.length<=1;if(Me&=te.every(se=>ce.includes(se)),Me&=!(pe&&te.includes("@list")),!Me)throw new E("Invalid JSON-LD syntax; @context @container value must be one of the following: "+ce.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:S});if(ve.reverse&&!te.every(se=>["@index","@set"].includes(se)))throw new E("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:S});ve["@container"]=te}if("@index"in H){if(!("@container"in H)||!ve["@container"].includes("@index"))throw new E(`Invalid JSON-LD syntax; @index without @index in @container: "${H["@index"]}" on term "${L}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:S});if(!y(H["@index"])||0===H["@index"].indexOf("@"))throw new E(`Invalid JSON-LD syntax; @index must expand to an IRI: "${H["@index"]}" on term "${L}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:S});ve["@index"]=H["@index"]}if("@context"in H&&(ve["@context"]=H["@context"]),"@language"in H&&!("@type"in H)){let te=H["@language"];if(null!==te&&!y(te))throw new E("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:S});null!==te&&(te=te.toLowerCase()),ve["@language"]=te}if("@prefix"in H){if(L.match(/:|\//))throw new E("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:S});if(j.isKeyword(ve["@id"]))throw new E("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:S});if("boolean"!=typeof H["@prefix"])throw new E("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:S});ve._prefix=!0===H["@prefix"]}if("@direction"in H){const te=H["@direction"];if(null!==te&&"ltr"!==te&&"rtl"!==te)throw new E('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:S});ve["@direction"]=te}if("@nest"in H){const te=H["@nest"];if(!y(te)||"@nest"!==te&&0===te.indexOf("@"))throw new E("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:S});ve["@nest"]=te}const fe=ve["@id"];if("@context"===fe||"@preserve"===fe)throw new E("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:S});if(ae&&ae.protected&&!ie&&(R.protected[L]=!0,ve.protected=!0,!ne(ae,ve)))throw new E("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:S,term:L})},j.expandIri=(R,S,L,_)=>xe(R,S,L,void 0,void 0,_),j.getInitialContext=R=>{const S=JSON.stringify({processingMode:R.processingMode}),L=B.get(S);if(L)return L;const _={processingMode:R.processingMode,mappings:new Map,inverse:null,getInverse:function ee(){const ve=this;if(ve.inverse)return ve.inverse;const Ee=ve.inverse={},Ge=ve.fastCurieMap={},fe={},te=(ve["@language"]||"@none").toLowerCase(),ce=ve["@direction"],Me=ve.mappings,pe=[...Me.keys()].sort($);for(const se of pe){const Ne=Me.get(se);if(null===Ne)continue;let Je=Ne["@container"]||"@none";if(Je=[].concat(Je).sort().join(""),null===Ne["@id"])continue;const qe=O(Ne["@id"]);for(const et of qe){let ke=Ee[et];const We=j.isKeyword(et);if(ke)!We&&!Ne._termHasColon&&fe[et].push(se);else if(Ee[et]=ke={},!We&&!Ne._termHasColon){fe[et]=[se];const we={iri:et,terms:fe[et]};et[0]in Ge?Ge[et[0]].push(we):Ge[et[0]]=[we]}if(ke[Je]||(ke[Je]={"@language":{},"@type":{},"@any":{}}),ke=ke[Je],H(se,ke["@any"],"@none"),Ne.reverse)H(se,ke["@type"],"@reverse");else if("@none"===Ne["@type"])H(se,ke["@any"],"@none"),H(se,ke["@language"],"@none"),H(se,ke["@type"],"@none");else if("@type"in Ne)H(se,ke["@type"],Ne["@type"]);else if("@language"in Ne&&"@direction"in Ne){const we=Ne["@language"],oe=Ne["@direction"];H(se,ke["@language"],we&&oe?`${we}_${oe}`.toLowerCase():we?we.toLowerCase():oe?`_${oe}`:"@null")}else"@language"in Ne?H(se,ke["@language"],(Ne["@language"]||"@null").toLowerCase()):"@direction"in Ne?H(se,ke["@language"],Ne["@direction"]?`_${Ne["@direction"]}`:"@none"):ce?(H(se,ke["@language"],`_${ce}`),H(se,ke["@language"],"@none"),H(se,ke["@type"],"@none")):(H(se,ke["@language"],te),H(se,ke["@language"],"@none"),H(se,ke["@type"],"@none"))}}for(const se in Ge)ie(Ge,se,1);return Ee},clone:function ae(){const ve={};return ve.mappings=M.clone(this.mappings),ve.clone=this.clone,ve.inverse=null,ve.getInverse=this.getInverse,ve.protected=M.clone(this.protected),this.previousContext&&(ve.previousContext=this.previousContext.clone()),ve.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(ve["@base"]=this["@base"]),"@language"in this&&(ve["@language"]=this["@language"]),"@vocab"in this&&(ve["@vocab"]=this["@vocab"]),ve},revertToPreviousContext:function me(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===B.size&&B.clear(),B.set(S,_),_;function ie(ve,Ee,Ge){const fe=ve[Ee],te=ve[Ee]={};let ce,Me;for(const pe of fe)ce=pe.iri,Me=Ge>=ce.length?"":ce[Ge],Me in te?te[Me].push(pe):te[Me]=[pe];for(const pe in te)""!==pe&&ie(te,pe,Ge+1)}function H(ve,Ee,Ge){Ee.hasOwnProperty(Ge)||(Ee[Ge]=ve)}},j.getContextValue=(R,S,L)=>{if(null===S)return"@context"===L?void 0:null;if(R.mappings.has(S)){const _=R.mappings.get(S);if(x(L))return _;if(_.hasOwnProperty(L))return _[L]}return"@language"===L&&L in R||"@direction"===L&&L in R?R[L]:"@context"!==L?null:void 0},j.processingMode=(R,S)=>S.toString()>="1.1"?!R.processingMode||R.processingMode>="json-ld-"+S.toString():"json-ld-1.0"===R.processingMode,j.isKeyword=R=>{if(!y(R)||"@"!==R[0])return!1;switch(R){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},3120(Ze,Re,Y){"use strict";var q=Y(9293).default;const{parseLinkHeader:M,buildHeaders:E}=Y(9420),{LINK_HEADER_CONTEXT:T}=Y(5315),I=Y(262),y=Y(4808),{prependBase:x}=Y(2051),b=/(^|(\r\n))link:/i;Ze.exports=({secure:D,headers:k={},xhr:G}={headers:{}})=>{return k=E(k),(new y).wrapLoader(O);function O(B){return $.apply(this,arguments)}function $(){return $=q(function*(B){if(0!==B.indexOf("http:")&&0!==B.indexOf("https:"))throw new I('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:B});if(D&&0!==B.indexOf("https"))throw new I('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:B});let re;try{re=yield function A(D,k,G){const P=new(D=D||XMLHttpRequest);return new Promise((O,$)=>{P.onload=()=>O(P),P.onerror=B=>$(B),P.open("GET",k,!0);for(const B in G)P.setRequestHeader(B,G[B]);P.send()})}(G,B,k)}catch(S){throw new I("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:B,cause:S})}if(re.status>=400)throw new I("URL could not be dereferenced: "+re.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:B,httpStatusCode:re.status});let j={contextUrl:null,documentUrl:B,document:re.response},xe=null;const ne=re.getResponseHeader("Content-Type");let R;if(b.test(re.getAllResponseHeaders())&&(R=re.getResponseHeader("Link")),R&&"application/ld+json"!==ne){const S=M(R),L=S[T];if(Array.isArray(L))throw new I("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:B});L&&(j.contextUrl=L.target),xe=S.alternate,xe&&"application/ld+json"==xe.type&&!(ne||"").match(/^application\/(\w*\+)?json$/)&&(j=yield O(x(B,xe.target)))}return j}),$.apply(this,arguments)}}},2585(Ze,Re,Y){"use strict";const q=Y(262),{isArray:M}=Y(2831),{asArray:E}=Y(9420),T={};function I({event:x,handlers:b}){let A=!0;for(let D=0;A&&D<b.length;++D){A=!1;const k=b[D];if(M(k))A=I({event:x,handlers:k});else if("function"==typeof k)k({event:x,next:()=>{A=!0}});else{if("object"!=typeof k)throw new q("Invalid event handler.","jsonld.InvalidEventHandler",{event:x});x.code in k?k[x.code]({event:x,next:()=>{A=!0}}):A=!0}}return A}Ze.exports=T,T.defaultEventHandler=null,T.setupEventHandler=({options:x={}})=>{const b=[].concat(x.safe?T.safeEventHandler:[],x.eventHandler?E(x.eventHandler):[],T.defaultEventHandler?T.defaultEventHandler:[]);return 0===b.length?null:b},T.handleEvent=({event:x,options:b})=>{I({event:x,handlers:b.eventHandler})};const y=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);T.safeEventHandler=function({event:b,next:A}){if("warning"===b.level&&y.has(b.code))throw new q("Safe mode validation error.","jsonld.ValidationError",{event:b});A()},T.logEventHandler=function({event:b,next:A}){console.log(`EVENT: ${b.message}`,{event:b}),A()},T.logWarningEventHandler=function({event:b,next:A}){"warning"===b.level&&console.warn(`WARNING: ${b.message}`,{event:b}),A()},T.unhandledEventHandler=function({event:b}){throw new q("No handler for event.","jsonld.UnhandledEvent",{event:b})},T.setDefaultEventHandler=function({eventHandler:x}={}){T.defaultEventHandler=x?E(x):null}},7336(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(262),{isArray:E,isObject:T,isEmptyObject:I,isString:y,isUndefined:x}=Y(2831),{isList:b,isValue:A,isGraph:D,isSubject:k}=Y(4209),{expandIri:G,getContextValue:P,isKeyword:O,process:$,processingMode:B}=Y(429),{isAbsolute:re}=Y(2051),{REGEX_BCP47:j,REGEX_KEYWORD:xe,addValue:ne,asArray:R,getValues:S,validateTypeValue:L}=Y(9420),{handleEvent:_}=Y(2585),ee={};function ie({value:fe,count:te,options:ce}){if(0===te||"@value"in fe||"@list"in fe||1===te&&"@id"in fe){if(ce.eventHandler){let Me,pe;0===te?(Me="empty object",pe="Dropping empty object."):"@value"in fe?(Me="object with only @value",pe="Dropping object with only @value."):"@list"in fe?(Me="object with only @list",pe="Dropping object with only @list."):1===te&&"@id"in fe&&(Me="object with only @id",pe="Dropping object with only @id."),_({event:{type:["JsonLdEvent"],code:Me,level:"warning",message:pe,details:{value:fe}},options:ce})}return null}return fe}function H(fe){return ae.apply(this,arguments)}function ae(){return(ae=q(function*({activeCtx:fe,activeProperty:te,expandedActiveProperty:ce,element:Me,expandedParent:pe,options:se={},insideList:Ne,typeKey:Je,typeScopedContext:qe}){const et=Object.keys(Me).sort(),ke=[];let We;const we=Me[Je]&&"@json"===G(fe,E(Me[Je])?Me[Je][0]:Me[Je],{vocab:!0},{...se,typeExpansion:!0});for(const oe of et){let Ye,Be=Me[oe];if("@context"===oe)continue;const Oe=G(fe,oe,{vocab:!0},se);if(null===Oe||!re(Oe)&&!O(Oe)){se.eventHandler&&_({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:oe,expandedProperty:Oe}},options:se});continue}if(O(Oe)){if("@reverse"===ce)throw new M("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:Be});if(Oe in pe&&"@included"!==Oe&&"@type"!==Oe)throw new M("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:Oe})}if("@id"===Oe){if(!y(Be)){if(!se.isFrame)throw new M('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:Be});if(T(Be)){if(!I(Be))throw new M('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Be})}else{if(!E(Be))throw new M('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Be});if(!Be.every(nt=>y(nt)))throw new M('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Be})}}ne(pe,"@id",R(Be).map(nt=>{if(y(nt)){const vt=G(fe,nt,{base:!0},se);return se.eventHandler&&(null===vt?_(null===nt?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:nt}},options:se}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:nt}},options:se}):re(vt)||_({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:nt,expandedId:vt}},options:se})),vt}return nt}),{propertyIsArray:se.isFrame});continue}if("@type"===Oe){T(Be)&&(Be=Object.fromEntries(Object.entries(Be).map(([nt,vt])=>[G(qe,nt,{vocab:!0}),R(vt).map(It=>G(qe,It,{base:!0,vocab:!0},{...se,typeExpansion:!0}))]))),L(Be,se.isFrame),ne(pe,"@type",R(Be).map(nt=>{if(y(nt)){const vt=G(qe,nt,{base:!0,vocab:!0},{...se,typeExpansion:!0});return"@json"!==vt&&!re(vt)&&se.eventHandler&&_({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:nt}},options:se}),vt}return nt}),{propertyIsArray:!!se.isFrame});continue}if("@included"===Oe&&B(fe,1.1)){const nt=R(yield ee.expand({activeCtx:fe,activeProperty:te,element:Be,options:se}));if(!nt.every(vt=>k(vt)))throw new M("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:Be});ne(pe,"@included",nt,{propertyIsArray:!0});continue}if("@graph"===Oe&&!T(Be)&&!E(Be))throw new M('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:Be});if("@value"===Oe){We=Be,we&&B(fe,1.1)?pe["@value"]=Be:ne(pe,"@value",Be,{propertyIsArray:se.isFrame});continue}if("@language"===Oe){if(null===Be)continue;if(!y(Be)&&!se.isFrame)throw new M('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:Be});Be=R(Be).map(nt=>y(nt)?nt.toLowerCase():nt);for(const nt of Be)y(nt)&&!nt.match(j)&&se.eventHandler&&_({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:nt}},options:se});ne(pe,"@language",Be,{propertyIsArray:se.isFrame});continue}if("@direction"===Oe){if(!y(Be)&&!se.isFrame)throw new M('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:Be});Be=R(Be);for(const nt of Be)if(y(nt)&&"ltr"!==nt&&"rtl"!==nt)throw new M('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:Be});ne(pe,"@direction",Be,{propertyIsArray:se.isFrame});continue}if("@index"===Oe){if(!y(Be))throw new M('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:Be});ne(pe,"@index",Be);continue}if("@reverse"===Oe){if(!T(Be))throw new M('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:Be});if(Ye=yield ee.expand({activeCtx:fe,activeProperty:"@reverse",element:Be,options:se}),"@reverse"in Ye)for(const vt in Ye["@reverse"])ne(pe,vt,Ye["@reverse"][vt],{propertyIsArray:!0});let nt=pe["@reverse"]||null;for(const vt in Ye){if("@reverse"===vt)continue;null===nt&&(nt=pe["@reverse"]={}),ne(nt,vt,[],{propertyIsArray:!0});const It=Ye[vt];for(let $t=0;$t<It.length;++$t){const xr=It[$t];if(A(xr)||b(xr))throw new M('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:Ye});ne(nt,vt,xr,{propertyIsArray:!0})}}continue}if("@nest"===Oe){ke.push(oe);continue}let it=fe;const _e=P(fe,oe,"@context");x(_e)||(it=yield $({activeCtx:fe,localCtx:_e,propagate:!0,overrideProtected:!0,options:se}));const xt=P(fe,oe,"@container")||[];if(xt.includes("@language")&&T(Be))Ye=ve(it,Be,P(it,oe,"@direction"),se);else if(xt.includes("@index")&&T(Be)){const nt=xt.includes("@graph"),vt=P(it,oe,"@index")||"@index",It="@index"!==vt&&G(fe,vt,{vocab:!0},se);Ye=yield Ee({activeCtx:it,options:se,activeProperty:oe,value:Be,asGraph:nt,indexKey:vt,propertyIndex:It})}else if(xt.includes("@id")&&T(Be)){const nt=xt.includes("@graph");Ye=yield Ee({activeCtx:it,options:se,activeProperty:oe,value:Be,asGraph:nt,indexKey:"@id"})}else if(xt.includes("@type")&&T(Be))Ye=yield Ee({activeCtx:it.revertToPreviousContext(),options:se,activeProperty:oe,value:Be,asGraph:!1,indexKey:"@type"});else{const nt="@list"===Oe;if(nt||"@set"===Oe){let vt=te;nt&&"@graph"===ce&&(vt=null),Ye=yield ee.expand({activeCtx:it,activeProperty:vt,element:Be,options:se,insideList:nt})}else Ye="@json"===P(fe,oe,"@type")?{"@type":"@json","@value":Be}:yield ee.expand({activeCtx:it,activeProperty:oe,element:Be,options:se,insideList:!1})}if(null!==Ye||"@value"===Oe){if("@list"!==Oe&&!b(Ye)&&xt.includes("@list")&&(Ye={"@list":R(Ye)}),xt.includes("@graph")&&!xt.some(nt=>"@id"===nt||"@index"===nt)){if(Ye=R(Ye),se.isFrame||(Ye=Ye.filter(nt=>null!==ie({value:nt,count:Object.keys(nt).length,options:se}))),0===Ye.length)continue;Ye=Ye.map(nt=>({"@graph":R(nt)}))}if(it.mappings.has(oe)&&it.mappings.get(oe).reverse){const nt=pe["@reverse"]=pe["@reverse"]||{};Ye=R(Ye);for(let vt=0;vt<Ye.length;++vt){const It=Ye[vt];if(A(It)||b(It))throw new M('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:Ye});ne(nt,Oe,It,{propertyIsArray:!0})}continue}ne(pe,Oe,Ye,{propertyIsArray:!0})}}if("@value"in pe&&("@json"!==pe["@type"]||!B(fe,1.1))&&(T(We)||E(We))&&!se.isFrame)throw new M('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:We});for(const oe of ke){const Be=E(Me[oe])?Me[oe]:[Me[oe]];for(const Ye of Be){if(!T(Ye)||Object.keys(Ye).some(Oe=>"@value"===G(fe,Oe,{vocab:!0},se)))throw new M("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:Ye});yield H({activeCtx:fe,activeProperty:te,expandedActiveProperty:ce,element:Ye,expandedParent:pe,options:se,insideList:Ne,typeScopedContext:qe,typeKey:Je})}}})).apply(this,arguments)}function me({activeCtx:fe,activeProperty:te,value:ce,options:Me}){if(null==ce)return null;const pe=G(fe,te,{vocab:!0},Me);if("@id"===pe)return G(fe,ce,{base:!0},Me);if("@type"===pe)return G(fe,ce,{vocab:!0,base:!0},{...Me,typeExpansion:!0});const se=P(fe,te,"@type");if(("@id"===se||"@graph"===pe)&&y(ce)){const Je=G(fe,ce,{base:!0},Me);return null===Je&&ce.match(xe)&&Me.eventHandler&&_({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:te}},options:Me}),{"@id":Je}}if("@vocab"===se&&y(ce))return{"@id":G(fe,ce,{vocab:!0,base:!0},Me)};if(O(pe))return ce;const Ne={};if(se&&!["@id","@vocab","@none"].includes(se))Ne["@type"]=se;else if(y(ce)){const Je=P(fe,te,"@language");null!==Je&&(Ne["@language"]=Je);const qe=P(fe,te,"@direction");null!==qe&&(Ne["@direction"]=qe)}return["boolean","number","string"].includes(typeof ce)||(ce=ce.toString()),Ne["@value"]=ce,Ne}function ve(fe,te,ce,Me){const pe=[],se=Object.keys(te).sort();for(const Ne of se){const Je=G(fe,Ne,{vocab:!0},Me);let qe=te[Ne];E(qe)||(qe=[qe]);for(const et of qe){if(null===et)continue;if(!y(et))throw new M("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:te});const ke={"@value":et};"@none"!==Je&&(Ne.match(j)||Me.eventHandler&&_({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:Ne}},options:Me}),ke["@language"]=Ne.toLowerCase()),ce&&(ke["@direction"]=ce),pe.push(ke)}}return pe}function Ee(fe){return Ge.apply(this,arguments)}function Ge(){return(Ge=q(function*({activeCtx:fe,options:te,activeProperty:ce,value:Me,asGraph:pe,indexKey:se,propertyIndex:Ne}){const Je=[],qe=Object.keys(Me).sort(),et="@type"===se;for(let ke of qe){if(et){const oe=P(fe,ke,"@context");x(oe)||(fe=yield $({activeCtx:fe,localCtx:oe,propagate:!1,options:te}))}let we,We=Me[ke];E(We)||(We=[We]),We=yield ee.expand({activeCtx:fe,activeProperty:ce,element:We,options:te,insideList:!1,insideIndex:!0}),we=Ne?"@none"===ke?"@none":me({activeCtx:fe,activeProperty:se,value:ke,options:te}):G(fe,ke,{vocab:!0},te),"@id"===se?ke=G(fe,ke,{base:!0},te):et&&(ke=we);for(let oe of We){if(pe&&!D(oe)&&(oe={"@graph":[oe]}),"@type"===se)"@none"===we||(oe["@type"]=oe["@type"]?[ke].concat(oe["@type"]):[ke]);else{if(A(oe)&&!["@language","@type","@index"].includes(se))throw new M(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${se}".`,"jsonld.SyntaxError",{code:"invalid value object",value:oe});Ne?"@none"!==we&&ne(oe,Ne,we,{propertyIsArray:!0,prependValue:!0}):"@none"!==we&&!(se in oe)&&(oe[se]=ke)}Je.push(oe)}}return Je})).apply(this,arguments)}Ze.exports=ee,ee.expand=function(){var fe=q(function*({activeCtx:te,activeProperty:ce=null,element:Me,options:pe={},insideList:se=!1,insideIndex:Ne=!1,typeScopedContext:Je=null}){if(null==Me)return null;if("@default"===ce&&(pe=Object.assign({},pe,{isFrame:!1})),!E(Me)&&!T(Me))return se||null!==ce&&"@graph"!==G(te,ce,{vocab:!0},pe)?me({activeCtx:te,activeProperty:ce,value:Me,options:pe}):(pe.eventHandler&&_({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Me}},options:pe}),null);if(E(Me)){let Ye=[];const Oe=P(te,ce,"@container")||[];se=se||Oe.includes("@list");for(let it=0;it<Me.length;++it){let _e=yield ee.expand({activeCtx:te,activeProperty:ce,element:Me[it],options:pe,insideIndex:Ne,typeScopedContext:Je});se&&E(_e)&&(_e={"@list":_e}),null!==_e&&(E(_e)?Ye=Ye.concat(_e):Ye.push(_e))}return Ye}const qe=G(te,ce,{vocab:!0},pe),et=P(te,ce,"@context");Je=Je||(te.previousContext?te:null);let ke=Object.keys(Me).sort(),We=!Ne;if(We&&Je&&ke.length<=2&&!ke.includes("@context"))for(const Ye of ke){const Oe=G(Je,Ye,{vocab:!0},pe);if("@value"===Oe){We=!1,te=Je;break}if("@id"===Oe&&1===ke.length){We=!1;break}}We&&(te=te.revertToPreviousContext()),x(et)||(te=yield $({activeCtx:te,localCtx:et,propagate:!0,overrideProtected:!0,options:pe})),"@context"in Me&&(te=yield $({activeCtx:te,localCtx:Me["@context"],options:pe})),Je=te;let we=null;for(const Ye of ke)if("@type"===G(te,Ye,{vocab:!0},pe)){we=we||Ye;const it=Me[Ye],_e=Array.isArray(it)?it.length>1?it.slice().sort():it:[it];for(const xt of _e){const nt=P(Je,xt,"@context");x(nt)||(te=yield $({activeCtx:te,localCtx:nt,options:pe,propagate:!1}))}}let oe={};yield H({activeCtx:te,activeProperty:ce,expandedActiveProperty:qe,element:Me,expandedParent:oe,options:pe,insideList:se,typeKey:we,typeScopedContext:Je}),ke=Object.keys(oe);let Be=ke.length;if("@value"in oe){if("@type"in oe&&("@language"in oe||"@direction"in oe))throw new M('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:oe});let Ye=Be-1;if("@type"in oe&&(Ye-=1),"@index"in oe&&(Ye-=1),"@language"in oe&&(Ye-=1),"@direction"in oe&&(Ye-=1),0!==Ye)throw new M('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:oe});const Oe=null===oe["@value"]?[]:R(oe["@value"]),it=S(oe,"@type");if(!B(te,1.1)||!it.includes("@json")||1!==it.length)if(0===Oe.length)pe.eventHandler&&_({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:oe}},options:pe}),oe=null;else{if(!Oe.every(_e=>y(_e)||I(_e))&&"@language"in oe)throw new M("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:oe});if(!it.every(_e=>re(_e)&&!(y(_e)&&0===_e.indexOf("_:"))||I(_e)))throw new M('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:oe})}}else if("@type"in oe&&!E(oe["@type"]))oe["@type"]=[oe["@type"]];else if("@set"in oe||"@list"in oe){if(Be>1&&(2!==Be||!("@index"in oe)))throw new M('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:oe});"@set"in oe&&(oe=oe["@set"],ke=Object.keys(oe),Be=ke.length)}else 1===Be&&"@language"in oe&&(pe.eventHandler&&_({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:oe}},options:pe}),oe=null);return T(oe)&&!pe.keepFreeFloatingNodes&&!se&&(null===ce||"@graph"===qe||(P(te,ce,"@container")||[]).includes("@graph"))&&(oe=ie({value:oe,count:Be,options:pe})),oe});return function(te){return fe.apply(this,arguments)}}()},9392(Ze,Re,Y){"use strict";const{isSubjectReference:q}=Y(4209),{createMergedNodeMap:M}=Y(5096),E={};Ze.exports=E,E.flatten=T=>{const I=M(T),y=[],x=Object.keys(I).sort();for(let b=0;b<x.length;++b){const A=I[x[b]];q(A)||y.push(A)}return y}},7031(Ze,Re,Y){"use strict";const{isKeyword:q}=Y(429),M=Y(4209),E=Y(2831),T=Y(9420),I=Y(2051),y=Y(262),{createNodeMap:x,mergeNodeMapGraphs:b}=Y(5096),A={};function D(R){const S={};for(const L in R)void 0!==R[L]&&(S["@"+L]=[R[L]]);return[S]}function k(R,S,L){for(let _=L.length-1;_>=0;--_){const ee=L[_];if(ee.graph===S&&ee.subject["@id"]===R["@id"])return!0}return!1}function G(R,S,L){const _="@"+L;let ee=_ in R?R[_][0]:S[L];if("embed"===L)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new y("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:R});return ee}function P(R){if(!E.isArray(R)||1!==R.length||!E.isObject(R[0]))throw new y("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:R});if("@id"in R[0])for(const S of T.asArray(R[0]["@id"]))if(!E.isObject(S)&&!I.isAbsolute(S)||E.isString(S)&&0===S.indexOf("_:"))throw new y("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:R});if("@type"in R[0])for(const S of T.asArray(R[0]["@type"]))if(!E.isObject(S)&&!I.isAbsolute(S)&&"@json"!==S||E.isString(S)&&0===S.indexOf("_:"))throw new y("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:R})}function $(R,S,L,_){let ee=!0,ie=!1;for(const H in L){let ae=!1;const me=T.getValues(S,H),ve=0===T.getValues(L,H).length;if("@id"===H){if(E.isEmptyObject(L["@id"][0]||{})?ae=!0:L["@id"].length>=0&&(ae=L["@id"].includes(me[0])),!_.requireAll)return ae}else if("@type"===H){if(ee=!1,ve){if(me.length>0)return!1;ae=!0}else if(1===L["@type"].length&&E.isEmptyObject(L["@type"][0]))ae=me.length>0;else for(const Ee of L["@type"])ae=!(!E.isObject(Ee)||!("@default"in Ee))||ae||me.some(Ge=>Ge===Ee);if(!_.requireAll)return ae}else{if(q(H))continue;{const Ee=T.getValues(L,H)[0];let Ge=!1;if(Ee&&(P([Ee]),Ge="@default"in Ee),ee=!1,0===me.length&&Ge)continue;if(me.length>0&&ve)return!1;if(void 0===Ee){if(me.length>0)return!1;ae=!0}else if(M.isList(Ee)){const fe=Ee["@list"][0];if(M.isList(me[0])){const te=me[0]["@list"];M.isValue(fe)?ae=te.some(ce=>ne(fe,ce)):(M.isSubject(fe)||M.isSubjectReference(fe))&&(ae=te.some(ce=>xe(R,fe,ce,_)))}}else ae=M.isValue(Ee)?me.some(fe=>ne(Ee,fe)):M.isSubjectReference(Ee)?me.some(fe=>xe(R,Ee,fe,_)):!!E.isObject(Ee)&&me.length>0}}if(!ae&&_.requireAll)return!1;ie=ie||ae}return ee||ie}function B(R,S){const L=R.uniqueEmbeds[R.graph],_=L[S],ee=_.parent,ie=_.property,H={"@id":S};if(E.isArray(ee)){for(let me=0;me<ee.length;++me)if(T.compareValues(ee[me],H)){ee[me]=H;break}}else{const me=E.isArray(ee[ie]);T.removeValue(ee,ie,H,{propertyIsArray:me}),T.addValue(ee,ie,H,{propertyIsArray:me})}const ae=me=>{const ve=Object.keys(L);for(const Ee of ve)Ee in L&&E.isObject(L[Ee].parent)&&L[Ee].parent["@id"]===me&&(delete L[Ee],ae(Ee))};ae(S)}function re(R,S){if(E.isArray(R))return R.map(L=>re(L,S));if(E.isObject(R)){if("@preserve"in R)return R["@preserve"][0];if(M.isValue(R))return R;if(M.isList(R))return R["@list"]=re(R["@list"],S),R;if("@id"in R){const L=R["@id"];if(S.link.hasOwnProperty(L)){const _=S.link[L].indexOf(R);if(-1!==_)return S.link[L][_];S.link[L].push(R)}else S.link[L]=[R]}for(const L in R)"@id"===L&&S.bnodesToClear.includes(R[L])?delete R["@id"]:R[L]=re(R[L],S)}return R}function j(R,S,L){E.isObject(R)?T.addValue(R,S,L,{propertyIsArray:!0}):R.push(L)}function xe(R,S,L,_){if(!("@id"in L))return!1;const ee=R.subjects[L["@id"]];return ee&&$(R,ee,S,_)}function ne(R,S){const L=S["@value"],_=S["@type"],ee=S["@language"],ie=R["@value"]?E.isArray(R["@value"])?R["@value"]:[R["@value"]]:[],H=R["@type"]?E.isArray(R["@type"])?R["@type"]:[R["@type"]]:[],ae=R["@language"]?E.isArray(R["@language"])?R["@language"]:[R["@language"]]:[];return 0===ie.length&&0===H.length&&0===ae.length||!(!ie.includes(L)&&!E.isEmptyObject(ie[0])||!(!_&&0===H.length||H.includes(_)||_&&E.isEmptyObject(H[0]))||!(!ee&&0===ae.length||ae.includes(ee)||ee&&E.isEmptyObject(ae[0])))}Ze.exports=A,A.frameMergedOrDefault=(R,S,L)=>{const _={options:L,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new T.IdentifierIssuer("_:b");x(R,_.graphMap,"@default",ee),L.merged&&(_.graphMap["@merged"]=b(_.graphMap),_.graph="@merged"),_.subjects=_.graphMap[_.graph];const ie=[];return A.frame(_,Object.keys(_.subjects).sort(),S,ie),L.pruneBlankNodeIdentifiers&&(L.bnodesToClear=Object.keys(_.bnodeMap).filter(H=>1===_.bnodeMap[H].length)),L.link={},re(ie,L)},A.frame=(R,S,L,_,ee=null)=>{P(L);const ie=R.options,H={embed:G(L=L[0],ie,"embed"),explicit:G(L,ie,"explicit"),requireAll:G(L,ie,"requireAll")};R.link.hasOwnProperty(R.graph)||(R.link[R.graph]={});const ae=R.link[R.graph],me=function O(R,S,L,_){const ee={};for(const ie of S){const H=R.graphMap[R.graph][ie];$(R,H,L,_)&&(ee[ie]=H)}return ee}(R,S,L,H),ve=Object.keys(me).sort();for(const Ee of ve){const Ge=me[Ee];if(null===ee?R.uniqueEmbeds={[R.graph]:{}}:R.uniqueEmbeds[R.graph]=R.uniqueEmbeds[R.graph]||{},"@link"===H.embed&&Ee in ae){j(_,ee,ae[Ee]);continue}const fe={"@id":Ee};if(0===Ee.indexOf("_:")&&T.addValue(R.bnodeMap,Ee,fe,{propertyIsArray:!0}),ae[Ee]=fe,("@first"===H.embed||"@last"===H.embed)&&R.is11)throw new y("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:L});if(R.embedded||!R.uniqueEmbeds[R.graph].hasOwnProperty(Ee)){if(R.embedded&&("@never"===H.embed||k(Ge,R.graph,R.subjectStack))){j(_,ee,fe);continue}if(R.embedded&&("@first"==H.embed||"@once"==H.embed)&&R.uniqueEmbeds[R.graph].hasOwnProperty(Ee)){j(_,ee,fe);continue}if("@last"===H.embed&&Ee in R.uniqueEmbeds[R.graph]&&B(R,Ee),R.uniqueEmbeds[R.graph][Ee]={parent:_,property:ee},R.subjectStack.push({subject:Ge,graph:R.graph}),Ee in R.graphMap){let te=!1,ce=null;"@graph"in L?(ce=L["@graph"][0],te=!("@merged"===Ee||"@default"===Ee),E.isObject(ce)||(ce={})):(te="@merged"!==R.graph,ce={}),te&&A.frame({...R,graph:Ee,embedded:!1},Object.keys(R.graphMap[Ee]).sort(),[ce],fe,"@graph")}"@included"in L&&A.frame({...R,embedded:!1},S,L["@included"],fe,"@included");for(const te of Object.keys(Ge).sort())if(q(te)){if(fe[te]=T.clone(Ge[te]),"@type"===te)for(const ce of Ge["@type"])0===ce.indexOf("_:")&&T.addValue(R.bnodeMap,ce,fe,{propertyIsArray:!0})}else if(!H.explicit||te in L)for(const ce of Ge[te]){const Me=te in L?L[te]:D(H);if(M.isList(ce)){const pe=L[te]&&L[te][0]&&L[te][0]["@list"]?L[te][0]["@list"]:D(H),se={"@list":[]};j(fe,te,se);const Ne=ce["@list"];for(const Je of Ne)M.isSubjectReference(Je)?A.frame({...R,embedded:!0},[Je["@id"]],pe,se,"@list"):j(se,"@list",T.clone(Je))}else M.isSubjectReference(ce)?A.frame({...R,embedded:!0},[ce["@id"]],Me,fe,te):ne(Me[0],ce)&&j(fe,te,T.clone(ce))}for(const te of Object.keys(L).sort()){if("@type"===te){if(!E.isObject(L[te][0])||!("@default"in L[te][0]))continue}else if(q(te))continue;const ce=L[te][0]||{};if(!G(ce,ie,"omitDefault")&&!(te in fe)){let pe="@null";"@default"in ce&&(pe=T.clone(ce["@default"])),E.isArray(pe)||(pe=[pe]),fe[te]=[{"@preserve":pe}]}}for(const te of Object.keys(L["@reverse"]||{}).sort()){const ce=L["@reverse"][te];for(const Me of Object.keys(R.subjects))T.getValues(R.subjects[Me],te).some(se=>se["@id"]===Ee)&&(fe["@reverse"]=fe["@reverse"]||{},T.addValue(fe["@reverse"],te,[],{propertyIsArray:!0}),A.frame({...R,embedded:!0},[Me],ce,fe["@reverse"][te],ee))}j(_,ee,fe),R.subjectStack.pop()}}},A.cleanupNull=(R,S)=>{if(E.isArray(R))return R.map(_=>A.cleanupNull(_,S)).filter(_=>_);if("@null"===R)return null;if(E.isObject(R)){if("@id"in R){const L=R["@id"];if(S.link.hasOwnProperty(L)){const _=S.link[L].indexOf(R);if(-1!==_)return S.link[L][_];S.link[L].push(R)}else S.link[L]=[R]}for(const L in R)R[L]=A.cleanupNull(R[L],S)}return R}},4814(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(262),E=Y(4209),T=Y(2831),{REGEX_BCP47:I,addValue:y}=Y(9420),{handleEvent:x}=Y(2585),{RDF_LIST:b,RDF_FIRST:A,RDF_REST:D,RDF_NIL:k,RDF_TYPE:G,RDF_JSON_LITERAL:P,XSD_BOOLEAN:O,XSD_DOUBLE:$,XSD_INTEGER:B,XSD_STRING:re}=Y(5315),j={};function xe(ne,R,S,L){if(ne.termType.endsWith("Node"))return{"@id":ne.value};const _={"@value":ne.value};if(ne.language)ne.language.match(I)||L.eventHandler&&x({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ne.language}},options:L}),_["@language"]=ne.language;else{let ee=ne.datatype.value;if(ee||(ee=re),ee===P){ee="@json";try{_["@value"]=JSON.parse(_["@value"])}catch(ie){throw new M("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:_["@value"],cause:ie})}}if(R){if(ee===O)"true"===_["@value"]?_["@value"]=!0:"false"===_["@value"]&&(_["@value"]=!1);else if(T.isNumeric(_["@value"]))if(ee===B){const ie=parseInt(_["@value"],10);ie.toFixed(0)===_["@value"]&&(_["@value"]=ie)}else ee===$&&(_["@value"]=parseFloat(_["@value"]));[O,B,$,re].includes(ee)||(_["@type"]=ee)}else if("i18n-datatype"===S&&ee.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,H]=ee.split(/[#_]/);ie.length>0&&(_["@language"]=ie,ie.match(I)||L.eventHandler&&x({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ie}},options:L})),_["@direction"]=H}else ee!==re&&(_["@type"]=ee)}return _}Ze.exports=j,j.fromRDF=function(){var ne=q(function*(R,S){const{useRdfType:L=!1,useNativeTypes:_=!1,rdfDirection:ee=null}=S,ie={},H={"@default":ie},ae={};if(ee){if("compound-literal"===ee)throw new M("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:ee});if("i18n-datatype"!==ee)throw new M("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:ee})}for(const Ee of R){const Ge="DefaultGraph"===Ee.graph.termType?"@default":Ee.graph.value;Ge in H||(H[Ge]={}),"@default"!==Ge&&!(Ge in ie)&&(ie[Ge]={"@id":Ge});const fe=H[Ge],te=Ee.subject.value,ce=Ee.predicate.value,Me=Ee.object;te in fe||(fe[te]={"@id":te});const pe=fe[te],se=Me.termType.endsWith("Node");if(se&&!(Me.value in fe)&&(fe[Me.value]={"@id":Me.value}),ce===G&&!L&&se){y(pe,"@type",Me.value,{propertyIsArray:!0});continue}const Ne=xe(Me,_,ee,S);if(y(pe,ce,Ne,{propertyIsArray:!0}),se)if(Me.value===k){const Je=fe[Me.value];"usages"in Je||(Je.usages=[]),Je.usages.push({node:pe,property:ce,value:Ne})}else ae[Me.value]=!(Me.value in ae)&&{node:pe,property:ce,value:Ne}}for(const Ee in H){const Ge=H[Ee];if(!(k in Ge))continue;const fe=Ge[k];if(fe.usages){for(let te of fe.usages){let ce=te.node,Me=te.property,pe=te.value;const se=[],Ne=[];let Je=Object.keys(ce).length;for(;Me===D&&T.isObject(ae[ce["@id"]])&&T.isArray(ce[A])&&1===ce[A].length&&T.isArray(ce[D])&&1===ce[D].length&&(3===Je||4===Je&&T.isArray(ce["@type"])&&1===ce["@type"].length&&ce["@type"][0]===b)&&(se.push(ce[A][0]),Ne.push(ce["@id"]),te=ae[ce["@id"]],ce=te.node,Me=te.property,pe=te.value,Je=Object.keys(ce).length,E.isBlankNode(ce)););delete pe["@id"],pe["@list"]=se.reverse();for(const qe of Ne)delete Ge[qe]}delete fe.usages}}const me=[],ve=Object.keys(ie).sort();for(const Ee of ve){const Ge=ie[Ee];if(Ee in H){const fe=Ge["@graph"]=[],te=H[Ee],ce=Object.keys(te).sort();for(const Me of ce){const pe=te[Me];E.isSubjectReference(pe)||fe.push(pe)}}E.isSubjectReference(Ge)||me.push(Ge)}return me});return function(R,S){return ne.apply(this,arguments)}}()},4209(Ze,Re,Y){"use strict";const q=Y(2831),M={};Ze.exports=M,M.isSubject=E=>!(!q.isObject(E)||"@value"in E||"@set"in E||"@list"in E)&&(Object.keys(E).length>1||!("@id"in E)),M.isSubjectReference=E=>q.isObject(E)&&1===Object.keys(E).length&&"@id"in E,M.isValue=E=>q.isObject(E)&&"@value"in E,M.isList=E=>q.isObject(E)&&"@list"in E,M.isGraph=E=>q.isObject(E)&&"@graph"in E&&1===Object.keys(E).filter(T=>"@id"!==T&&"@index"!==T).length,M.isSimpleGraph=E=>M.isGraph(E)&&!("@id"in E),M.isBlankNode=E=>{if(q.isObject(E)){if("@id"in E){const T=E["@id"];return!q.isString(T)||0===T.indexOf("_:")}return 0===Object.keys(E).length||!("@value"in E||"@set"in E||"@list"in E)}return!1}},2130(Ze,Re,Y){var q=Y(9293).default;const M=Y(1224),E=Y(8666),T=Y(9420),I=Y(7839),y=T.IdentifierIssuer,x=Y(262),b=Y(3052),A=Y(5426),{expand:D}=Y(7336),{flatten:k}=Y(9392),{fromRDF:G}=Y(4814),{toRDF:P}=Y(6397),{frameMergedOrDefault:O,cleanupNull:$}=Y(7031),{isArray:B,isObject:re,isString:j}=Y(2831),{isSubjectReference:xe}=Y(4209),{expandIri:ne,getInitialContext:R,process:S,processingMode:L}=Y(429),{compact:_,compactIri:ee}=Y(3763),{createNodeMap:ie,createMergedNodeMap:H,mergeNodeMaps:ae}=Y(5096),{logEventHandler:me,logWarningEventHandler:ve,safeEventHandler:Ee,setDefaultEventHandler:Ge,setupEventHandler:fe,strictEventHandler:te,unhandledEventHandler:ce}=Y(2585),Me=function(se){const Ne={},qe=new b({max:100});function et(ke,{documentLoader:We=se.documentLoader,...we}){if(ke&&"compactionMap"in ke)throw new x('"compactionMap" not supported.',"jsonld.OptionsError");if(ke&&"expansionMap"in ke)throw new x('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:We},we,ke,{eventHandler:fe({options:ke})})}return se.compact=function(){var ke=q(function*(We,we,oe){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===we)throw new x("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===We)return null;let Be;(oe=et(oe,{base:j(We)?We:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new y("_:b"),contextResolver:new I({sharedCache:qe})})).link&&(oe.skipExpansion=!0),oe.compactToRelative||delete oe.base,Be=oe.skipExpansion?We:yield se.expand(We,oe);const Ye=yield se.processContext(R(oe),we,oe);let Oe=yield _({activeCtx:Ye,element:Be,options:oe});oe.compactArrays&&!oe.graph&&B(Oe)?1===Oe.length?Oe=Oe[0]:0===Oe.length&&(Oe={}):oe.graph&&re(Oe)&&(Oe=[Oe]),re(we)&&"@context"in we&&(we=we["@context"]),we=T.clone(we),B(we)||(we=[we]);const it=we;we=[];for(let xt=0;xt<it.length;++xt)(!re(it[xt])||Object.keys(it[xt]).length>0)&&we.push(it[xt]);const _e=we.length>0;if(1===we.length&&(we=we[0]),B(Oe)){const xt=ee({activeCtx:Ye,iri:"@graph",relativeTo:{vocab:!0}}),nt=Oe;Oe={},_e&&(Oe["@context"]=we),Oe[xt]=nt}else if(re(Oe)&&_e){const xt=Oe;Oe={"@context":we};for(const nt in xt)Oe[nt]=xt[nt]}return Oe});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.expand=function(){var ke=q(function*(We,we){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const oe={},Be=[];if("expandContext"in(we=et(we,{keepFreeFloatingNodes:!1,contextResolver:new I({sharedCache:qe})}))){const _e=T.clone(we.expandContext);oe.expandContext=re(_e)&&"@context"in _e?_e:{"@context":_e},Be.push(oe.expandContext)}let Ye;if(j(We)){const _e=yield se.get(We,we);Ye=_e.documentUrl,oe.input=_e.document,_e.contextUrl&&(oe.remoteContext={"@context":_e.contextUrl},Be.push(oe.remoteContext))}else oe.input=T.clone(We);"base"in we||(we.base=Ye||"");let Oe=R(we);for(const _e of Be)Oe=yield S({activeCtx:Oe,localCtx:_e,options:we});let it=yield D({activeCtx:Oe,element:oe.input,options:we});return re(it)&&"@graph"in it&&1===Object.keys(it).length?it=it["@graph"]:null===it&&(it=[]),B(it)||(it=[it]),it});return function(We,we){return ke.apply(this,arguments)}}(),se.flatten=function(){var ke=q(function*(We,we,oe){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");we="function"==typeof we?null:we||null,oe=et(oe,{base:j(We)?We:"",contextResolver:new I({sharedCache:qe})});const Be=yield se.expand(We,oe),Ye=k(Be);return null===we?Ye:(oe.graph=!0,oe.skipExpansion=!0,yield se.compact(Ye,we,oe))});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.frame=function(){var ke=q(function*(We,we,oe){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(oe=et(oe,{base:j(We)?We:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new I({sharedCache:qe})}),j(we)){const It=yield se.get(we,oe);if(we=It.document,It.contextUrl){let $t=we["@context"];$t?B($t)?$t.push(It.contextUrl):$t=[$t,It.contextUrl]:$t=It.contextUrl,we["@context"]=$t}}const Be=we&&we["@context"]||{},Ye=yield se.processContext(R(oe),Be,oe);oe.hasOwnProperty("omitGraph")||(oe.omitGraph=L(Ye,1.1)),oe.hasOwnProperty("pruneBlankNodeIdentifiers")||(oe.pruneBlankNodeIdentifiers=L(Ye,1.1));const Oe=yield se.expand(We,oe),it={...oe};it.isFrame=!0,it.keepFreeFloatingNodes=!0;const _e=yield se.expand(we,it),xt=Object.keys(we).map(It=>ne(Ye,It,{vocab:!0}));it.merged=!xt.includes("@graph"),it.is11=L(Ye,1.1);const nt=O(Oe,_e,it);it.graph=!oe.omitGraph,it.skipExpansion=!0,it.link={},it.framing=!0;let vt=yield se.compact(nt,Be,it);return it.link={},vt=$(vt,it),vt});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.link=function(){var ke=q(function*(We,we,oe){const Be={};return we&&(Be["@context"]=we),Be["@embed"]="@link",se.frame(We,Be,oe)});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.normalize=se.canonize=function(){var ke=q(function*(We,we){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(we=et(we,{base:j(We)?We:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new I({sharedCache:qe})}))){if("application/n-quads"!==we.inputFormat&&"application/nquads"!==we.inputFormat)throw new x("Unknown canonicalization input format.","jsonld.CanonizeError");const Ye=A.parse(We);return M.canonize(Ye,we)}const oe={...we};delete oe.format,oe.produceGeneralizedRdf=!1;const Be=yield se.toRDF(We,oe);return M.canonize(Be,we)});return function(We,we){return ke.apply(this,arguments)}}(),se.fromRDF=function(){var ke=q(function*(We,we){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");we=et(we,{format:j(We)?"application/n-quads":void 0});const{format:oe}=we;let{rdfParser:Be}=we;if(oe){if(Be=Be||Ne[oe],!Be)throw new x("Unknown input format.","jsonld.UnknownFormat",{format:oe})}else Be=()=>We;const Ye=yield Be(We);return G(Ye,we)});return function(We,we){return ke.apply(this,arguments)}}(),se.toRDF=function(){var ke=q(function*(We,we){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let oe;oe=(we=et(we,{base:j(We)?We:"",skipExpansion:!1,contextResolver:new I({sharedCache:qe})})).skipExpansion?We:yield se.expand(We,we);const Be=P(oe,we);if(we.format){if("application/n-quads"===we.format||"application/nquads"===we.format)return A.serialize(Be);throw new x("Unknown output format.","jsonld.UnknownFormat",{format:we.format})}return Be});return function(We,we){return ke.apply(this,arguments)}}(),se.createNodeMap=function(){var ke=q(function*(We,we){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");we=et(we,{base:j(We)?We:"",contextResolver:new I({sharedCache:qe})});const oe=yield se.expand(We,we);return H(oe,we)});return function(We,we){return ke.apply(this,arguments)}}(),se.merge=function(){var ke=q(function*(We,we,oe){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!B(We))throw new TypeError('Could not merge, "docs" must be an array.');we="function"==typeof we?null:we||null,oe=et(oe,{contextResolver:new I({sharedCache:qe})});const Be=yield Promise.all(We.map(It=>{const $t={...oe};return se.expand(It,$t)}));let Ye=!0;"mergeNodes"in oe&&(Ye=oe.mergeNodes);const Oe=oe.issuer||new y("_:b"),it={"@default":{}};for(let It=0;It<Be.length;++It){const $t=T.relabelBlankNodes(Be[It],{issuer:new y("_:b"+It+"-")}),xr=Ye||0===It?it:{"@default":{}};if(ie($t,xr,"@default",Oe),xr!==it)for(const gn in xr){const ia=xr[gn];if(!(gn in it)){it[gn]=ia;continue}const Sr=it[gn];for(const sa in ia)sa in Sr||(Sr[sa]=ia[sa])}}const _e=ae(it),xt=[],nt=Object.keys(_e).sort();for(let It=0;It<nt.length;++It){const $t=_e[nt[It]];xe($t)||xt.push($t)}return null===we?xt:(oe.graph=!0,oe.skipExpansion=!0,yield se.compact(xt,we,oe))});return function(We,we,oe){return ke.apply(this,arguments)}}(),Object.defineProperty(se,"documentLoader",{get:()=>se._documentLoader,set:ke=>se._documentLoader=ke}),se.documentLoader=function(){var ke=q(function*(We){throw new x("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:We})});return function(We){return ke.apply(this,arguments)}}(),se.get=function(){var ke=q(function*(We,we){let oe;oe="function"==typeof we.documentLoader?we.documentLoader:se.documentLoader;const Be=yield oe(We);try{if(!Be.document)throw new x("No remote document found at the given URL.","jsonld.NullRemoteDocument");j(Be.document)&&(Be.document=JSON.parse(Be.document))}catch(Ye){throw new x("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Ye,remoteDoc:Be})}return Be});return function(We,we){return ke.apply(this,arguments)}}(),se.processContext=function(){var ke=q(function*(We,we,oe){return oe=et(oe,{base:"",contextResolver:new I({sharedCache:qe})}),null===we?R(oe):(we=T.clone(we),re(we)&&"@context"in we||(we={"@context":we}),S({activeCtx:We,localCtx:we,options:oe}))});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.getContextValue=Y(429).getContextValue,se.documentLoaders={},se.useDocumentLoader=function(ke){if(!(ke in se.documentLoaders))throw new x('Unknown document loader type: "'+ke+'"',"jsonld.UnknownDocumentLoader",{type:ke});se.documentLoader=se.documentLoaders[ke].apply(se,Array.prototype.slice.call(arguments,1))},se.registerRDFParser=function(ke,We){Ne[ke]=We},se.unregisterRDFParser=function(ke){delete Ne[ke]},se.registerRDFParser("application/n-quads",A.parse),se.registerRDFParser("application/nquads",A.parse),se.url=Y(2051),se.logEventHandler=me,se.logWarningEventHandler=ve,se.safeEventHandler=Ee,se.setDefaultEventHandler=Ge,se.strictEventHandler=te,se.unhandledEventHandler=ce,se.util=T,Object.assign(se,T),se.promises=se,se.RequestQueue=Y(4808),se.JsonLdProcessor=Y(1328)(se),E.setupGlobals(se),E.setupDocumentLoaders(se),se},pe=function(){return Me(function(){return pe()})};Me(pe),Ze.exports=pe},5096(Ze,Re,Y){"use strict";const{isKeyword:q}=Y(429),M=Y(4209),E=Y(2831),T=Y(9420),I=Y(262),y={};Ze.exports=y,y.createMergedNodeMap=(x,b)=>{const A=(b=b||{}).issuer||new T.IdentifierIssuer("_:b"),D={"@default":{}};return y.createNodeMap(x,D,"@default",A),y.mergeNodeMaps(D)},y.createNodeMap=(x,b,A,D,k,G)=>{if(E.isArray(x)){for(const B of x)y.createNodeMap(B,b,A,D,void 0,G);return}if(!E.isObject(x))return void(G&&G.push(x));if(M.isValue(x)){if("@type"in x){let B=x["@type"];0===B.indexOf("_:")&&(x["@type"]=B=D.getId(B))}return void(G&&G.push(x))}if(G&&M.isList(x)){const B=[];return y.createNodeMap(x["@list"],b,A,D,k,B),void G.push({"@list":B})}if("@type"in x){const B=x["@type"];for(const re of B)0===re.indexOf("_:")&&D.getId(re)}E.isUndefined(k)&&(k=M.isBlankNode(x)?D.getId(x["@id"]):x["@id"]),G&&G.push({"@id":k});const P=b[A],O=P[k]=P[k]||{};O["@id"]=k;const $=Object.keys(x).sort();for(let B of $){if("@id"===B)continue;if("@reverse"===B){const j={"@id":k},xe=x["@reverse"];for(const ne in xe){const R=xe[ne];for(const S of R){let L=S["@id"];M.isBlankNode(S)&&(L=D.getId(L)),y.createNodeMap(S,b,A,D,L),T.addValue(P[L],ne,j,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===B){k in b||(b[k]={}),y.createNodeMap(x[B],b,k,D);continue}if("@included"===B){y.createNodeMap(x[B],b,A,D);continue}if("@type"!==B&&q(B)){if("@index"===B&&B in O&&(x[B]!==O[B]||x[B]["@id"]!==O[B]["@id"]))throw new I("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:O});O[B]=x[B];continue}const re=x[B];if(0===B.indexOf("_:")&&(B=D.getId(B)),0!==re.length)for(let j of re)if("@type"===B&&(j=0===j.indexOf("_:")?D.getId(j):j),M.isSubject(j)||M.isSubjectReference(j)){if("@id"in j&&!j["@id"])continue;const xe=M.isBlankNode(j)?D.getId(j["@id"]):j["@id"];T.addValue(O,B,{"@id":xe},{propertyIsArray:!0,allowDuplicate:!1}),y.createNodeMap(j,b,A,D,xe)}else if(M.isValue(j))T.addValue(O,B,j,{propertyIsArray:!0,allowDuplicate:!1});else if(M.isList(j)){const xe=[];y.createNodeMap(j["@list"],b,A,D,k,xe),j={"@list":xe},T.addValue(O,B,j,{propertyIsArray:!0,allowDuplicate:!1})}else y.createNodeMap(j,b,A,D,k),T.addValue(O,B,j,{propertyIsArray:!0,allowDuplicate:!1});else T.addValue(O,B,[],{propertyIsArray:!0})}},y.mergeNodeMapGraphs=x=>{const b={};for(const A of Object.keys(x).sort())for(const D of Object.keys(x[A]).sort()){const k=x[A][D];D in b||(b[D]={"@id":D});const G=b[D];for(const P of Object.keys(k).sort())if(q(P)&&"@type"!==P)G[P]=T.clone(k[P]);else for(const O of k[P])T.addValue(G,P,T.clone(O),{propertyIsArray:!0,allowDuplicate:!1})}return b},y.mergeNodeMaps=x=>{const b=x["@default"],A=Object.keys(x).sort();for(const D of A){if("@default"===D)continue;const k=x[D];let G=b[D];G?"@graph"in G||(G["@graph"]=[]):b[D]=G={"@id":D,"@graph":[]};const P=G["@graph"];for(const O of Object.keys(k).sort()){const $=k[O];M.isSubjectReference($)||P.push($)}}return b}},8666(Ze,Re,Y){"use strict";const q=Y(3120),M={};Ze.exports=M,M.setupDocumentLoaders=function(E){typeof XMLHttpRequest<"u"&&(E.documentLoaders.xhr=q,E.useDocumentLoader("xhr"))},M.setupGlobals=function(E){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:E.JsonLdProcessor})}},6397(Ze,Re,Y){"use strict";const{createNodeMap:q}=Y(5096),{isKeyword:M}=Y(429),E=Y(4209),T=Y(8846),I=Y(262),y=Y(2831),x=Y(9420),{handleEvent:b}=Y(2585),{RDF_FIRST:A,RDF_REST:D,RDF_NIL:k,RDF_TYPE:G,RDF_JSON_LITERAL:P,RDF_LANGSTRING:O,XSD_BOOLEAN:$,XSD_DOUBLE:B,XSD_INTEGER:re,XSD_STRING:j}=Y(5315),{isAbsolute:xe}=Y(2051),ne={};function R(_,ee,ie,H,ae){const me=Object.keys(ee).sort();for(const ve of me){const Ee=ee[ve],Ge=Object.keys(Ee).sort();for(let fe of Ge){const te=Ee[fe];if("@type"===fe)fe=G;else if(M(fe))continue;for(const ce of te){const Me={termType:ve.startsWith("_:")?"BlankNode":"NamedNode",value:ve};if(!xe(ve)){ae.eventHandler&&b({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:ve}},options:ae});continue}const pe={termType:fe.startsWith("_:")?"BlankNode":"NamedNode",value:fe};if(!xe(fe)){ae.eventHandler&&b({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:fe}},options:ae});continue}if("BlankNode"===pe.termType&&!ae.produceGeneralizedRdf){ae.eventHandler&&b({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:H.getOldIds().find(Ne=>H.getId(Ne)===fe)}},options:ae});continue}const se=L(ce,H,_,ie,ae.rdfDirection,ae);se&&_.push({subject:Me,predicate:pe,object:se,graph:ie})}}}}function L(_,ee,ie,H,ae,me){const ve={};if(E.isValue(_)){ve.termType="Literal",ve.value=void 0,ve.datatype={termType:"NamedNode"};let Ee=_["@value"];const Ge=_["@type"]||null;if("@json"===Ge)ve.value=T(Ee),ve.datatype.value=P;else if(y.isBoolean(Ee))ve.value=Ee.toString(),ve.datatype.value=Ge||$;else if(y.isDouble(Ee)||Ge===B)y.isDouble(Ee)||(Ee=parseFloat(Ee)),ve.value=Ee.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),ve.datatype.value=Ge||B;else if(y.isNumber(Ee))ve.value=Ee.toFixed(0),ve.datatype.value=Ge||re;else if("@direction"in _&&"i18n-datatype"===ae){const fe=(_["@language"]||"").toLowerCase();ve.datatype.value=`https://www.w3.org/ns/i18n#${fe}_${_["@direction"]}`,ve.value=Ee}else{if("@direction"in _&&"compound-literal"===ae)throw new I("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:ae});if("@direction"in _&&ae)throw new I("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:ae});"@language"in _?("@direction"in _&&!ae&&me.eventHandler&&b({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:ve.value}},options:me}),ve.value=Ee,ve.datatype.value=Ge||O,ve.language=_["@language"]):("@direction"in _&&!ae&&me.eventHandler&&b({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:ve.value}},options:me}),ve.value=Ee,ve.datatype.value=Ge||j)}}else if(E.isList(_)){const Ee=function S(_,ee,ie,H,ae,me){const ve={termType:"NamedNode",value:A},Ee={termType:"NamedNode",value:D},Ge={termType:"NamedNode",value:k},fe=_.pop(),te=fe?{termType:"BlankNode",value:ee.getId()}:Ge;let ce=te;for(const Me of _){const pe=L(Me,ee,ie,H,ae,me),se={termType:"BlankNode",value:ee.getId()};ie.push({subject:ce,predicate:ve,object:pe,graph:H}),ie.push({subject:ce,predicate:Ee,object:se,graph:H}),ce=se}if(fe){const Me=L(fe,ee,ie,H,ae,me);ie.push({subject:ce,predicate:ve,object:Me,graph:H}),ie.push({subject:ce,predicate:Ee,object:Ge,graph:H})}return te}(_["@list"],ee,ie,H,ae,me);ve.termType=Ee.termType,ve.value=Ee.value}else{const Ee=y.isObject(_)?_["@id"]:_;ve.termType=Ee.startsWith("_:")?"BlankNode":"NamedNode",ve.value=Ee}return"NamedNode"!==ve.termType||xe(ve.value)?ve:(me.eventHandler&&b({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:ve.value}},options:me}),null)}Ze.exports=ne,ne.toRDF=(_,ee)=>{const ie=new x.IdentifierIssuer("_:b"),H={"@default":{}};q(_,H,"@default",ie);const ae=[],me=Object.keys(H).sort();for(const ve of me){let Ee;if("@default"===ve)Ee={termType:"DefaultGraph",value:""};else{if(!xe(ve)){ee.eventHandler&&b({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:ve}},options:ee});continue}Ee=ve.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},Ee.value=ve}R(ae,H[ve],Ee,ie,ee)}return ae}},2831(Ze){"use strict";const Re={};Ze.exports=Re,Re.isArray=Array.isArray,Re.isBoolean=Y=>"boolean"==typeof Y||"[object Boolean]"===Object.prototype.toString.call(Y),Re.isDouble=Y=>Re.isNumber(Y)&&(-1!==String(Y).indexOf(".")||Math.abs(Y)>=1e21),Re.isEmptyObject=Y=>Re.isObject(Y)&&0===Object.keys(Y).length,Re.isNumber=Y=>"number"==typeof Y||"[object Number]"===Object.prototype.toString.call(Y),Re.isNumeric=Y=>!isNaN(parseFloat(Y))&&isFinite(Y),Re.isObject=Y=>"[object Object]"===Object.prototype.toString.call(Y),Re.isString=Y=>"string"==typeof Y||"[object String]"===Object.prototype.toString.call(Y),Re.isUndefined=Y=>typeof Y>"u"},2051(Ze,Re,Y){"use strict";const q=Y(2831),M={};Ze.exports=M,M.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},M.parse=(T,I)=>{const y={},x=M.parsers[I||"full"],b=x.regex.exec(T);let A=x.keys.length;for(;A--;)y[x.keys[A]]=void 0===b[A]?null:b[A];return("https"===y.scheme&&"443"===y.port||"http"===y.scheme&&"80"===y.port)&&(y.href=y.href.replace(":"+y.port,""),y.authority=y.authority.replace(":"+y.port,""),y.port=null),y.normalizedPath=M.removeDotSegments(y.path),y},M.prependBase=(T,I)=>{if(null===T||M.isAbsolute(I))return I;(!T||q.isString(T))&&(T=M.parse(T||""));const y=M.parse(I),x={protocol:T.protocol||""};if(null!==y.authority)x.authority=y.authority,x.path=y.path,x.query=y.query;else if(x.authority=T.authority,""===y.path)x.path=T.path,x.query=null!==y.query?y.query:T.query;else{if(0===y.path.indexOf("/"))x.path=y.path;else{let A=T.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||T.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=y.path,x.path=A}x.query=y.query}""!==y.path&&(x.path=M.removeDotSegments(x.path));let b=x.protocol;return null!==x.authority&&(b+="//"+x.authority),b+=x.path,null!==x.query&&(b+="?"+x.query),null!==y.fragment&&(b+="#"+y.fragment),""===b&&(b="./"),b},M.removeBase=(T,I)=>{if(null===T)return I;(!T||q.isString(T))&&(T=M.parse(T||""));let y="";if(""!==T.href?y+=(T.protocol||"")+"//"+(T.authority||""):I.indexOf("//")&&(y+="//"),0!==I.indexOf(y))return I;const x=M.parse(I.substr(y.length)),b=T.normalizedPath.split("/"),A=x.normalizedPath.split("/"),D=x.fragment||x.query?0:1;for(;b.length>0&&A.length>D&&b[0]===A[0];)b.shift(),A.shift();let k="";if(b.length>0){b.pop();for(let G=0;G<b.length;++G)k+="../"}return k+=A.join("/"),null!==x.query&&(k+="?"+x.query),null!==x.fragment&&(k+="#"+x.fragment),""===k&&(k="./"),k},M.removeDotSegments=T=>{if(0===T.length)return"";const I=T.split("/"),y=[];for(;I.length>0;){const x=I.shift(),b=0===I.length;"."!==x?".."!==x?y.push(x):(y.pop(),b&&y.push("")):b&&y.push("")}return"/"===T[0]&&y.length>0&&""!==y[0]&&y.unshift(""),1===y.length&&""===y[0]?"/":y.join("/")};const E=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;M.isAbsolute=T=>q.isString(T)&&E.test(T),M.isRelative=T=>q.isString(T)},9420(Ze,Re,Y){"use strict";const q=Y(4209),M=Y(2831),E=Y(1224).IdentifierIssuer,T=Y(262),y=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,x=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,b=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,D_headers_accept="application/ld+json, application/json",k={};function G(P,O){if(M.isArray(O))for(let $=0;$<O.length;++$)O[$]=G(P,O[$]);else if(q.isList(O))O["@list"]=G(P,O["@list"]);else if(M.isObject(O)){q.isBlankNode(O)&&(O["@id"]=P.getId(O["@id"]));const $=Object.keys(O).sort();for(let B=0;B<$.length;++B){const re=$[B];"@id"!==re&&(O[re]=G(P,O[re]))}}return O}Ze.exports=k,k.IdentifierIssuer=E,k.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,k.REGEX_KEYWORD=/^@[a-zA-Z]+$/,k.clone=function(P){if(P&&"object"==typeof P){let O;if(M.isArray(P)){O=[];for(let $=0;$<P.length;++$)O[$]=k.clone(P[$])}else if(P instanceof Map){O=new Map;for(const[$,B]of P)O.set($,k.clone(B))}else if(P instanceof Set){O=new Set;for(const $ of P)O.add(k.clone($))}else if(M.isObject(P)){O={};for(const $ in P)O[$]=k.clone(P[$])}else O=P.toString();return O}return P},k.asArray=function(P){return Array.isArray(P)?P:[P]},k.buildHeaders=(P={})=>{if(Object.keys(P).some($=>"accept"===$.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+D_headers_accept+'" is supported.');return Object.assign({Accept:D_headers_accept},P)},k.parseLinkHeader=P=>{const O={},$=P.match(y);for(let B=0;B<$.length;++B){let re=$[B].match(x);if(!re)continue;const j={target:re[1]},xe=re[2];for(;re=b.exec(xe);)j[re[1]]=void 0===re[2]?re[3]:re[2];const ne=j.rel||"";Array.isArray(O[ne])?O[ne].push(j):O[ne]=O.hasOwnProperty(ne)?[O[ne],j]:j}return O},k.validateTypeValue=(P,O)=>{if(!(M.isString(P)||M.isArray(P)&&P.every($=>M.isString($)))){if(O&&M.isObject(P))switch(Object.keys(P).length){case 0:return;case 1:if("@default"in P&&k.asArray(P["@default"]).every($=>M.isString($)))return}throw new T('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:P})}},k.hasProperty=(P,O)=>{if(P.hasOwnProperty(O)){const $=P[O];return!M.isArray($)||$.length>0}return!1},k.hasValue=(P,O,$)=>{if(k.hasProperty(P,O)){let B=P[O];const re=q.isList(B);if(M.isArray(B)||re){re&&(B=B["@list"]);for(let j=0;j<B.length;++j)if(k.compareValues($,B[j]))return!0}else if(!M.isArray($))return k.compareValues($,B)}return!1},k.addValue=(P,O,$,B)=>{if("propertyIsArray"in(B=B||{})||(B.propertyIsArray=!1),"valueIsArray"in B||(B.valueIsArray=!1),"allowDuplicate"in B||(B.allowDuplicate=!0),"prependValue"in B||(B.prependValue=!1),B.valueIsArray)P[O]=$;else if(M.isArray($)){0===$.length&&B.propertyIsArray&&!P.hasOwnProperty(O)&&(P[O]=[]),B.prependValue&&($=$.concat(P[O]),P[O]=[]);for(let re=0;re<$.length;++re)k.addValue(P,O,$[re],B)}else if(P.hasOwnProperty(O)){const re=!B.allowDuplicate&&k.hasValue(P,O,$);!M.isArray(P[O])&&(!re||B.propertyIsArray)&&(P[O]=[P[O]]),re||(B.prependValue?P[O].unshift($):P[O].push($))}else P[O]=B.propertyIsArray?[$]:$},k.getValues=(P,O)=>[].concat(P[O]||[]),k.removeProperty=(P,O)=>{delete P[O]},k.removeValue=(P,O,$,B)=>{"propertyIsArray"in(B=B||{})||(B.propertyIsArray=!1);const re=k.getValues(P,O).filter(j=>!k.compareValues(j,$));0===re.length?k.removeProperty(P,O):P[O]=1!==re.length||B.propertyIsArray?re:re[0]},k.relabelBlankNodes=(P,O)=>G((O=O||{}).issuer||new E("_:b"),P),k.compareValues=(P,O)=>!!(P===O||q.isValue(P)&&q.isValue(O)&&P["@value"]===O["@value"]&&P["@type"]===O["@type"]&&P["@language"]===O["@language"]&&P["@index"]===O["@index"])||!!(M.isObject(P)&&"@id"in P&&M.isObject(O)&&"@id"in O)&&P["@id"]===O["@id"],k.compareShortestLeast=(P,O)=>P.length<O.length?-1:O.length<P.length?1:P===O?0:P<O?-1:1},3052(Ze,Re,Y){"use strict";const q=Y(4842),M=Symbol("max"),E=Symbol("length"),T=Symbol("lengthCalculator"),I=Symbol("allowStale"),y=Symbol("maxAge"),x=Symbol("dispose"),b=Symbol("noDisposeOnSet"),A=Symbol("lruList"),D=Symbol("cache"),k=Symbol("updateAgeOnGet"),G=()=>1,O=(ne,R,S)=>{const L=ne[D].get(R);if(L){const _=L.value;if($(ne,_)){if(re(ne,L),!ne[I])return}else S&&(ne[k]&&(L.value.now=Date.now()),ne[A].unshiftNode(L));return _.value}},$=(ne,R)=>{if(!R||!R.maxAge&&!ne[y])return!1;const S=Date.now()-R.now;return R.maxAge?S>R.maxAge:ne[y]&&S>ne[y]},B=ne=>{if(ne[E]>ne[M])for(let R=ne[A].tail;ne[E]>ne[M]&&null!==R;){const S=R.prev;re(ne,R),R=S}},re=(ne,R)=>{if(R){const S=R.value;ne[x]&&ne[x](S.key,S.value),ne[E]-=S.length,ne[D].delete(S.key),ne[A].removeNode(R)}};class j{constructor(R,S,L,_,ee){this.key=R,this.value=S,this.length=L,this.now=_,this.maxAge=ee||0}}const xe=(ne,R,S,L)=>{let _=S.value;$(ne,_)&&(re(ne,S),ne[I]||(_=void 0)),_&&R.call(L,_.value,_.key,ne)};Ze.exports=class P{constructor(R){if("number"==typeof R&&(R={max:R}),R||(R={}),R.max&&("number"!=typeof R.max||R.max<0))throw new TypeError("max must be a non-negative number");this[M]=R.max||1/0;const L=R.length||G;if(this[T]="function"!=typeof L?G:L,this[I]=R.stale||!1,R.maxAge&&"number"!=typeof R.maxAge)throw new TypeError("maxAge must be a number");this[y]=R.maxAge||0,this[x]=R.dispose,this[b]=R.noDisposeOnSet||!1,this[k]=R.updateAgeOnGet||!1,this.reset()}set max(R){if("number"!=typeof R||R<0)throw new TypeError("max must be a non-negative number");this[M]=R||1/0,B(this)}get max(){return this[M]}set allowStale(R){this[I]=!!R}get allowStale(){return this[I]}set maxAge(R){if("number"!=typeof R)throw new TypeError("maxAge must be a non-negative number");this[y]=R,B(this)}get maxAge(){return this[y]}set lengthCalculator(R){"function"!=typeof R&&(R=G),R!==this[T]&&(this[T]=R,this[E]=0,this[A].forEach(S=>{S.length=this[T](S.value,S.key),this[E]+=S.length})),B(this)}get lengthCalculator(){return this[T]}get length(){return this[E]}get itemCount(){return this[A].length}rforEach(R,S){S=S||this;for(let L=this[A].tail;null!==L;){const _=L.prev;xe(this,R,L,S),L=_}}forEach(R,S){S=S||this;for(let L=this[A].head;null!==L;){const _=L.next;xe(this,R,L,S),L=_}}keys(){return this[A].toArray().map(R=>R.key)}values(){return this[A].toArray().map(R=>R.value)}reset(){this[x]&&this[A]&&this[A].length&&this[A].forEach(R=>this[x](R.key,R.value)),this[D]=new Map,this[A]=new q,this[E]=0}dump(){return this[A].map(R=>!$(this,R)&&{k:R.key,v:R.value,e:R.now+(R.maxAge||0)}).toArray().filter(R=>R)}dumpLru(){return this[A]}set(R,S,L){if((L=L||this[y])&&"number"!=typeof L)throw new TypeError("maxAge must be a number");const _=L?Date.now():0,ee=this[T](S,R);if(this[D].has(R)){if(ee>this[M])return re(this,this[D].get(R)),!1;const ae=this[D].get(R).value;return this[x]&&(this[b]||this[x](R,ae.value)),ae.now=_,ae.maxAge=L,ae.value=S,this[E]+=ee-ae.length,ae.length=ee,this.get(R),B(this),!0}const ie=new j(R,S,ee,_,L);return ie.length>this[M]?(this[x]&&this[x](R,S),!1):(this[E]+=ie.length,this[A].unshift(ie),this[D].set(R,this[A].head),B(this),!0)}has(R){if(!this[D].has(R))return!1;const S=this[D].get(R).value;return!$(this,S)}get(R){return O(this,R,!0)}peek(R){return O(this,R,!1)}pop(){const R=this[A].tail;return R?(re(this,R),R.value):null}del(R){re(this,this[D].get(R))}load(R){this.reset();const S=Date.now();for(let L=R.length-1;L>=0;L--){const _=R[L],ee=_.e||0;if(0===ee)this.set(_.k,_.v);else{const ie=ee-S;ie>0&&this.set(_.k,_.v,ie)}}}prune(){this[D].forEach((R,S)=>O(this,S,!1))}}},7568(Ze){"use strict";Ze.exports=function(Re){Re.prototype[Symbol.iterator]=function*(){for(let Y=this.head;Y;Y=Y.next)yield Y.value}}},4842(Ze,Re,Y){"use strict";function q(y){var x=this;if(x instanceof q||(x=new q),x.tail=null,x.head=null,x.length=0,y&&"function"==typeof y.forEach)y.forEach(function(D){x.push(D)});else if(arguments.length>0)for(var b=0,A=arguments.length;b<A;b++)x.push(arguments[b]);return x}function M(y,x,b){var A=x===y.head?new I(b,null,x,y):new I(b,x,x.next,y);return null===A.next&&(y.tail=A),null===A.prev&&(y.head=A),y.length++,A}function E(y,x){y.tail=new I(x,y.tail,null,y),y.head||(y.head=y.tail),y.length++}function T(y,x){y.head=new I(x,null,y.head,y),y.tail||(y.tail=y.head),y.length++}function I(y,x,b,A){if(!(this instanceof I))return new I(y,x,b,A);this.list=A,this.value=y,x?(x.next=this,this.prev=x):this.prev=null,b?(b.prev=this,this.next=b):this.next=null}Ze.exports=q,q.Node=I,q.create=q,q.prototype.removeNode=function(y){if(y.list!==this)throw new Error("removing node which does not belong to this list");var x=y.next,b=y.prev;return x&&(x.prev=b),b&&(b.next=x),y===this.head&&(this.head=x),y===this.tail&&(this.tail=b),y.list.length--,y.next=null,y.prev=null,y.list=null,x},q.prototype.unshiftNode=function(y){if(y!==this.head){y.list&&y.list.removeNode(y);var x=this.head;y.list=this,y.next=x,x&&(x.prev=y),this.head=y,this.tail||(this.tail=y),this.length++}},q.prototype.pushNode=function(y){if(y!==this.tail){y.list&&y.list.removeNode(y);var x=this.tail;y.list=this,y.prev=x,x&&(x.next=y),this.tail=y,this.head||(this.head=y),this.length++}},q.prototype.push=function(){for(var y=0,x=arguments.length;y<x;y++)E(this,arguments[y]);return this.length},q.prototype.unshift=function(){for(var y=0,x=arguments.length;y<x;y++)T(this,arguments[y]);return this.length},q.prototype.pop=function(){if(this.tail){var y=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,y}},q.prototype.shift=function(){if(this.head){var y=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,y}},q.prototype.forEach=function(y,x){x=x||this;for(var b=this.head,A=0;null!==b;A++)y.call(x,b.value,A,this),b=b.next},q.prototype.forEachReverse=function(y,x){x=x||this;for(var b=this.tail,A=this.length-1;null!==b;A--)y.call(x,b.value,A,this),b=b.prev},q.prototype.get=function(y){for(var x=0,b=this.head;null!==b&&x<y;x++)b=b.next;if(x===y&&null!==b)return b.value},q.prototype.getReverse=function(y){for(var x=0,b=this.tail;null!==b&&x<y;x++)b=b.prev;if(x===y&&null!==b)return b.value},q.prototype.map=function(y,x){x=x||this;for(var b=new q,A=this.head;null!==A;)b.push(y.call(x,A.value,this)),A=A.next;return b},q.prototype.mapReverse=function(y,x){x=x||this;for(var b=new q,A=this.tail;null!==A;)b.push(y.call(x,A.value,this)),A=A.prev;return b},q.prototype.reduce=function(y,x){var b,A=this.head;if(arguments.length>1)b=x;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,b=this.head.value}for(var D=0;null!==A;D++)b=y(b,A.value,D),A=A.next;return b},q.prototype.reduceReverse=function(y,x){var b,A=this.tail;if(arguments.length>1)b=x;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,b=this.tail.value}for(var D=this.length-1;null!==A;D--)b=y(b,A.value,D),A=A.prev;return b},q.prototype.toArray=function(){for(var y=new Array(this.length),x=0,b=this.head;null!==b;x++)y[x]=b.value,b=b.next;return y},q.prototype.toArrayReverse=function(){for(var y=new Array(this.length),x=0,b=this.tail;null!==b;x++)y[x]=b.value,b=b.prev;return y},q.prototype.slice=function(y,x){(x=x||this.length)<0&&(x+=this.length),(y=y||0)<0&&(y+=this.length);var b=new q;if(x<y||x<0)return b;y<0&&(y=0),x>this.length&&(x=this.length);for(var A=0,D=this.head;null!==D&&A<y;A++)D=D.next;for(;null!==D&&A<x;A++,D=D.next)b.push(D.value);return b},q.prototype.sliceReverse=function(y,x){(x=x||this.length)<0&&(x+=this.length),(y=y||0)<0&&(y+=this.length);var b=new q;if(x<y||x<0)return b;y<0&&(y=0),x>this.length&&(x=this.length);for(var A=this.length,D=this.tail;null!==D&&A>x;A--)D=D.prev;for(;null!==D&&A>y;A--,D=D.prev)b.push(D.value);return b},q.prototype.splice=function(y,x,...b){y>this.length&&(y=this.length-1),y<0&&(y=this.length+y);for(var A=0,D=this.head;null!==D&&A<y;A++)D=D.next;var k=[];for(A=0;D&&A<x;A++)k.push(D.value),D=this.removeNode(D);for(null===D&&(D=this.tail),D!==this.head&&D!==this.tail&&(D=D.prev),A=0;A<b.length;A++)D=M(this,D,b[A]);return k},q.prototype.reverse=function(){for(var y=this.head,x=this.tail,b=y;null!==b;b=b.prev){var A=b.prev;b.prev=b.next,b.next=A}return this.head=x,this.tail=y,this};try{Y(7568)(q)}catch{}},6556(Ze){Ze.exports=function(Re){var Y={};function q(M){if(Y[M])return Y[M].exports;var E=Y[M]={i:M,l:!1,exports:{}};return Re[M].call(E.exports,E,E.exports,q),E.l=!0,E.exports}return q.m=Re,q.c=Y,q.i=function(M){return M},q.d=function(M,E,T){q.o(M,E)||Object.defineProperty(M,E,{configurable:!1,enumerable:!0,get:T})},q.n=function(M){var E=M&&M.__esModule?function(){return M.default}:function(){return M};return q.d(E,"a",E),E},q.o=function(M,E){return Object.prototype.hasOwnProperty.call(M,E)},q.p="",q(q.s=26)}([function(Re,Y,q){"use strict";function M(){}M.QUALITY=1,M.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,M.DEFAULT_INCREMENTAL=!1,M.DEFAULT_ANIMATION_ON_LAYOUT=!0,M.DEFAULT_ANIMATION_DURING_LAYOUT=!1,M.DEFAULT_ANIMATION_PERIOD=50,M.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,M.DEFAULT_GRAPH_MARGIN=15,M.NODE_DIMENSIONS_INCLUDE_LABELS=!1,M.SIMPLE_NODE_HALF_SIZE=(M.SIMPLE_NODE_SIZE=40)/2,M.EMPTY_COMPOUND_NODE_SIZE=40,M.MIN_EDGE_LENGTH=1,M.INITIAL_WORLD_BOUNDARY=(M.WORLD_BOUNDARY=1e6)/1e3,M.WORLD_CENTER_X=1200,M.WORLD_CENTER_Y=900,Re.exports=M},function(Re,Y,q){"use strict";var M=q(2),E=q(8),T=q(9);function I(x,b,A){M.call(this,A),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=A,this.bendpoints=[],this.source=x,this.target=b}for(var y in I.prototype=Object.create(M.prototype),M)I[y]=M[y];I.prototype.getSource=function(){return this.source},I.prototype.getTarget=function(){return this.target},I.prototype.isInterGraph=function(){return this.isInterGraph},I.prototype.getLength=function(){return this.length},I.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},I.prototype.getBendpoints=function(){return this.bendpoints},I.prototype.getLca=function(){return this.lca},I.prototype.getSourceInLca=function(){return this.sourceInLca},I.prototype.getTargetInLca=function(){return this.targetInLca},I.prototype.getOtherEnd=function(x){if(this.source===x)return this.target;if(this.target===x)return this.source;throw"Node is not incident with this edge"},I.prototype.getOtherEndInGraph=function(x,b){for(var A=this.getOtherEnd(x),D=b.getGraphManager().getRoot();;){if(A.getOwner()==b)return A;if(A.getOwner()==D)break;A=A.getOwner().getParent()}return null},I.prototype.updateLength=function(){var x=new Array(4);this.isOverlapingSourceAndTarget=E.getIntersection(this.target.getRect(),this.source.getRect(),x),this.isOverlapingSourceAndTarget||(this.lengthX=x[0]-x[2],this.lengthY=x[1]-x[3],Math.abs(this.lengthX)<1&&(this.lengthX=T.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=T.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},I.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=T.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=T.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},Re.exports=I},function(Re,Y,q){"use strict";Re.exports=function M(E){this.vGraphObject=E}},function(Re,Y,q){"use strict";var M=q(2),E=q(10),T=q(13),I=q(0),y=q(16),x=q(4);function b(D,k,G,P){null==G&&null==P&&(P=k),M.call(this,P),null!=D.graphManager&&(D=D.graphManager),this.estimatedSize=E.MIN_VALUE,this.inclusionTreeDepth=E.MAX_VALUE,this.vGraphObject=P,this.edges=[],this.graphManager=D,this.rect=null!=G&&null!=k?new T(k.x,k.y,G.width,G.height):new T}for(var A in b.prototype=Object.create(M.prototype),M)b[A]=M[A];b.prototype.getEdges=function(){return this.edges},b.prototype.getChild=function(){return this.child},b.prototype.getOwner=function(){return this.owner},b.prototype.getWidth=function(){return this.rect.width},b.prototype.setWidth=function(D){this.rect.width=D},b.prototype.getHeight=function(){return this.rect.height},b.prototype.setHeight=function(D){this.rect.height=D},b.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},b.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},b.prototype.getCenter=function(){return new x(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},b.prototype.getLocation=function(){return new x(this.rect.x,this.rect.y)},b.prototype.getRect=function(){return this.rect},b.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},b.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},b.prototype.setRect=function(D,k){this.rect.x=D.x,this.rect.y=D.y,this.rect.width=k.width,this.rect.height=k.height},b.prototype.setCenter=function(D,k){this.rect.x=D-this.rect.width/2,this.rect.y=k-this.rect.height/2},b.prototype.setLocation=function(D,k){this.rect.x=D,this.rect.y=k},b.prototype.moveBy=function(D,k){this.rect.x+=D,this.rect.y+=k},b.prototype.getEdgeListToNode=function(D){var k=[],P=this;return P.edges.forEach(function(O){if(O.target==D){if(O.source!=P)throw"Incorrect edge source!";k.push(O)}}),k},b.prototype.getEdgesBetween=function(D){var k=[],P=this;return P.edges.forEach(function(O){if(O.source!=P&&O.target!=P)throw"Incorrect edge source and/or target";(O.target==D||O.source==D)&&k.push(O)}),k},b.prototype.getNeighborsList=function(){var D=new Set,k=this;return k.edges.forEach(function(G){if(G.source==k)D.add(G.target);else{if(G.target!=k)throw"Incorrect incidency!";D.add(G.source)}}),D},b.prototype.withChildren=function(){var D=new Set;if(D.add(this),null!=this.child)for(var P=this.child.getNodes(),O=0;O<P.length;O++)P[O].withChildren().forEach(function($){D.add($)});return D},b.prototype.getNoOfChildren=function(){var D=0;if(null==this.child)D=1;else for(var G=this.child.getNodes(),P=0;P<G.length;P++)D+=G[P].getNoOfChildren();return 0==D&&(D=1),D},b.prototype.getEstimatedSize=function(){if(this.estimatedSize==E.MIN_VALUE)throw"assert failed";return this.estimatedSize},b.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},b.prototype.scatter=function(){var D,k,G=-I.INITIAL_WORLD_BOUNDARY,P=I.INITIAL_WORLD_BOUNDARY;D=I.WORLD_CENTER_X+y.nextDouble()*(P-G)+G;var O=-I.INITIAL_WORLD_BOUNDARY,$=I.INITIAL_WORLD_BOUNDARY;k=I.WORLD_CENTER_Y+y.nextDouble()*($-O)+O,this.rect.x=D,this.rect.y=k},b.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var D=this.getChild();if(D.updateBounds(!0),this.rect.x=D.getLeft(),this.rect.y=D.getTop(),this.setWidth(D.getRight()-D.getLeft()),this.setHeight(D.getBottom()-D.getTop()),I.NODE_DIMENSIONS_INCLUDE_LABELS){var k=D.getRight()-D.getLeft(),G=D.getBottom()-D.getTop();this.labelWidth>k&&(this.rect.x-=(this.labelWidth-k)/2,this.setWidth(this.labelWidth)),this.labelHeight>G&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-G)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-G),this.setHeight(this.labelHeight))}}},b.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==E.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},b.prototype.transform=function(D){var k=this.rect.x;k>I.WORLD_BOUNDARY?k=I.WORLD_BOUNDARY:k<-I.WORLD_BOUNDARY&&(k=-I.WORLD_BOUNDARY);var G=this.rect.y;G>I.WORLD_BOUNDARY?G=I.WORLD_BOUNDARY:G<-I.WORLD_BOUNDARY&&(G=-I.WORLD_BOUNDARY);var P=new x(k,G),O=D.inverseTransformPoint(P);this.setLocation(O.x,O.y)},b.prototype.getLeft=function(){return this.rect.x},b.prototype.getRight=function(){return this.rect.x+this.rect.width},b.prototype.getTop=function(){return this.rect.y},b.prototype.getBottom=function(){return this.rect.y+this.rect.height},b.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},Re.exports=b},function(Re,Y,q){"use strict";function M(E,T){null==E&&null==T?(this.x=0,this.y=0):(this.x=E,this.y=T)}M.prototype.getX=function(){return this.x},M.prototype.getY=function(){return this.y},M.prototype.setX=function(E){this.x=E},M.prototype.setY=function(E){this.y=E},M.prototype.getDifference=function(E){return new DimensionD(this.x-E.x,this.y-E.y)},M.prototype.getCopy=function(){return new M(this.x,this.y)},M.prototype.translate=function(E){return this.x+=E.width,this.y+=E.height,this},Re.exports=M},function(Re,Y,q){"use strict";var M=q(2),E=q(10),T=q(0),I=q(6),y=q(3),x=q(1),b=q(13),A=q(12),D=q(11);function k(P,O,$){M.call(this,$),this.estimatedSize=E.MIN_VALUE,this.margin=T.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=P,null!=O&&O instanceof I?this.graphManager=O:null!=O&&O instanceof Layout&&(this.graphManager=O.graphManager)}for(var G in k.prototype=Object.create(M.prototype),M)k[G]=M[G];k.prototype.getNodes=function(){return this.nodes},k.prototype.getEdges=function(){return this.edges},k.prototype.getGraphManager=function(){return this.graphManager},k.prototype.getParent=function(){return this.parent},k.prototype.getLeft=function(){return this.left},k.prototype.getRight=function(){return this.right},k.prototype.getTop=function(){return this.top},k.prototype.getBottom=function(){return this.bottom},k.prototype.isConnected=function(){return this.isConnected},k.prototype.add=function(P,O,$){if(null==O&&null==$){var B=P;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(B)>-1)throw"Node already in graph!";return B.owner=this,this.getNodes().push(B),B}var re=P;if(!(this.getNodes().indexOf(O)>-1&&this.getNodes().indexOf($)>-1))throw"Source or target not in graph!";if(O.owner!=$.owner||O.owner!=this)throw"Both owners must be this graph!";return O.owner!=$.owner?null:(re.source=O,re.target=$,re.isInterGraph=!1,this.getEdges().push(re),O.edges.push(re),$!=O&&$.edges.push(re),re)},k.prototype.remove=function(P){var O=P;if(P instanceof y){if(null==O)throw"Node is null!";if(null==O.owner||O.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var $=O.edges.slice(),re=$.length,j=0;j<re;j++)(B=$[j]).isInterGraph?this.graphManager.remove(B):B.source.owner.remove(B);if(-1==(xe=this.nodes.indexOf(O)))throw"Node not in owner node list!";this.nodes.splice(xe,1)}else if(P instanceof x){var B;if(null==(B=P))throw"Edge is null!";if(null==B.source||null==B.target)throw"Source and/or target is null!";if(null==B.source.owner||null==B.target.owner||B.source.owner!=this||B.target.owner!=this)throw"Source and/or target owner is invalid!";var xe,ne=B.source.edges.indexOf(B),R=B.target.edges.indexOf(B);if(!(ne>-1&&R>-1))throw"Source and/or target doesn't know this edge!";if(B.source.edges.splice(ne,1),B.target!=B.source&&B.target.edges.splice(R,1),-1==(xe=B.source.owner.getEdges().indexOf(B)))throw"Not in owner's edge list!";B.source.owner.getEdges().splice(xe,1)}},k.prototype.updateLeftTop=function(){for(var $,B,re,P=E.MAX_VALUE,O=E.MAX_VALUE,j=this.getNodes(),xe=j.length,ne=0;ne<xe;ne++){var R=j[ne];P>($=R.getTop())&&(P=$),O>(B=R.getLeft())&&(O=B)}return P==E.MAX_VALUE?null:(re=null!=j[0].getParent().paddingLeft?j[0].getParent().paddingLeft:this.margin,this.left=O-re,this.top=P-re,new A(this.left,this.top))},k.prototype.updateBounds=function(P){for(var j,xe,ne,R,S,O=E.MAX_VALUE,$=-E.MAX_VALUE,B=E.MAX_VALUE,re=-E.MAX_VALUE,L=this.nodes,_=L.length,ee=0;ee<_;ee++){var ie=L[ee];P&&null!=ie.child&&ie.updateBounds(),O>(j=ie.getLeft())&&(O=j),$<(xe=ie.getRight())&&($=xe),B>(ne=ie.getTop())&&(B=ne),re<(R=ie.getBottom())&&(re=R)}var H=new b(O,B,$-O,re-B);O==E.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),S=null!=L[0].getParent().paddingLeft?L[0].getParent().paddingLeft:this.margin,this.left=H.x-S,this.right=H.x+H.width+S,this.top=H.y-S,this.bottom=H.y+H.height+S},k.calculateBounds=function(P){for(var j,xe,ne,R,O=E.MAX_VALUE,$=-E.MAX_VALUE,B=E.MAX_VALUE,re=-E.MAX_VALUE,S=P.length,L=0;L<S;L++){var _=P[L];O>(j=_.getLeft())&&(O=j),$<(xe=_.getRight())&&($=xe),B>(ne=_.getTop())&&(B=ne),re<(R=_.getBottom())&&(re=R)}return new b(O,B,$-O,re-B)},k.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},k.prototype.getEstimatedSize=function(){if(this.estimatedSize==E.MIN_VALUE)throw"assert failed";return this.estimatedSize},k.prototype.calcEstimatedSize=function(){for(var P=0,O=this.nodes,$=O.length,B=0;B<$;B++)P+=O[B].calcEstimatedSize();return this.estimatedSize=0==P?T.EMPTY_COMPOUND_NODE_SIZE:P/Math.sqrt(this.nodes.length),this.estimatedSize},k.prototype.updateConnected=function(){var P=this;if(0!=this.nodes.length){var re,j,O=new D,$=new Set,B=this.nodes[0];for(B.withChildren().forEach(function(ee){O.push(ee),$.add(ee)});0!==O.length;)for(var ne=(re=(B=O.shift()).getEdges()).length,R=0;R<ne;R++)null==(j=re[R].getOtherEndInGraph(B,this))||$.has(j)||j.withChildren().forEach(function(ee){O.push(ee),$.add(ee)});if(this.isConnected=!1,$.size>=this.nodes.length){var _=0;$.forEach(function(ee){ee.owner==P&&_++}),_==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},Re.exports=k},function(Re,Y,q){"use strict";var M,E=q(1);function T(I){M=q(5),this.layout=I,this.graphs=[],this.edges=[]}T.prototype.addRoot=function(){var I=this.layout.newGraph(),y=this.layout.newNode(null),x=this.add(I,y);return this.setRootGraph(x),this.rootGraph},T.prototype.add=function(I,y,x,b,A){if(null==x&&null==b&&null==A){if(null==I)throw"Graph is null!";if(null==y)throw"Parent node is null!";if(this.graphs.indexOf(I)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(I),null!=I.parent)throw"Already has a parent!";if(null!=y.child)throw"Already has a child!";return I.parent=y,y.child=I,I}A=x,x=I;var D=(b=y).getOwner(),k=A.getOwner();if(null==D||D.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==k||k.getGraphManager()!=this)throw"Target not in this graph mgr!";if(D==k)return x.isInterGraph=!1,D.add(x,b,A);if(x.isInterGraph=!0,x.source=b,x.target=A,this.edges.indexOf(x)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(x),null==x.source||null==x.target)throw"Edge source and/or target is null!";if(-1!=x.source.edges.indexOf(x)||-1!=x.target.edges.indexOf(x))throw"Edge already in source and/or target incidency list!";return x.source.edges.push(x),x.target.edges.push(x),x},T.prototype.remove=function(I){if(I instanceof M){var y=I;if(y.getGraphManager()!=this)throw"Graph not in this graph mgr";if(y!=this.rootGraph&&(null==y.parent||y.parent.graphManager!=this))throw"Invalid parent node!";for(var b,x=[],A=(x=x.concat(y.getEdges())).length,D=0;D<A;D++)y.remove(b=x[D]);var k=[];for(A=(k=k.concat(y.getNodes())).length,D=0;D<A;D++)y.remove(k[D]);y==this.rootGraph&&this.setRootGraph(null);var P=this.graphs.indexOf(y);this.graphs.splice(P,1),y.parent=null}else if(I instanceof E){if(null==(b=I))throw"Edge is null!";if(!b.isInterGraph)throw"Not an inter-graph edge!";if(null==b.source||null==b.target)throw"Source and/or target is null!";if(-1==b.source.edges.indexOf(b)||-1==b.target.edges.indexOf(b))throw"Source and/or target doesn't know this edge!";if(P=b.source.edges.indexOf(b),b.source.edges.splice(P,1),P=b.target.edges.indexOf(b),b.target.edges.splice(P,1),null==b.source.owner||null==b.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==b.source.owner.getGraphManager().edges.indexOf(b))throw"Not in owner graph manager's edge list!";P=b.source.owner.getGraphManager().edges.indexOf(b),b.source.owner.getGraphManager().edges.splice(P,1)}},T.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},T.prototype.getGraphs=function(){return this.graphs},T.prototype.getAllNodes=function(){if(null==this.allNodes){for(var I=[],y=this.getGraphs(),x=y.length,b=0;b<x;b++)I=I.concat(y[b].getNodes());this.allNodes=I}return this.allNodes},T.prototype.resetAllNodes=function(){this.allNodes=null},T.prototype.resetAllEdges=function(){this.allEdges=null},T.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},T.prototype.getAllEdges=function(){if(null==this.allEdges){for(var I=[],y=this.getGraphs(),b=0;b<y.length;b++)I=I.concat(y[b].getEdges());I=I.concat(this.edges),this.allEdges=I}return this.allEdges},T.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},T.prototype.setAllNodesToApplyGravitation=function(I){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=I},T.prototype.getRoot=function(){return this.rootGraph},T.prototype.setRootGraph=function(I){if(I.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=I,null==I.parent&&(I.parent=this.layout.newNode("Root node"))},T.prototype.getLayout=function(){return this.layout},T.prototype.isOneAncestorOfOther=function(I,y){if(null==I||null==y)throw"assert failed";if(I==y)return!0;for(var b,x=I.getOwner();null!=(b=x.getParent());){if(b==y)return!0;if(null==(x=b.getOwner()))break}for(x=y.getOwner();null!=(b=x.getParent());){if(b==I)return!0;if(null==(x=b.getOwner()))break}return!1},T.prototype.calcLowestCommonAncestors=function(){for(var I,y,x,b,A,D=this.getAllEdges(),k=D.length,G=0;G<k;G++)if(y=(I=D[G]).source,x=I.target,I.lca=null,I.sourceInLca=y,I.targetInLca=x,y!=x){for(b=y.getOwner();null==I.lca;){for(I.targetInLca=x,A=x.getOwner();null==I.lca;){if(A==b){I.lca=A;break}if(A==this.rootGraph)break;if(null!=I.lca)throw"assert failed";I.targetInLca=A.getParent(),A=I.targetInLca.getOwner()}if(b==this.rootGraph)break;null==I.lca&&(I.sourceInLca=b.getParent(),b=I.sourceInLca.getOwner())}if(null==I.lca)throw"assert failed"}else I.lca=y.getOwner()},T.prototype.calcLowestCommonAncestor=function(I,y){if(I==y)return I.getOwner();for(var x=I.getOwner();null!=x;){for(var b=y.getOwner();null!=b;){if(b==x)return b;b=b.getParent().getOwner()}x=x.getParent().getOwner()}return x},T.prototype.calcInclusionTreeDepths=function(I,y){null==I&&null==y&&(I=this.rootGraph,y=1);for(var x,b=I.getNodes(),A=b.length,D=0;D<A;D++)(x=b[D]).inclusionTreeDepth=y,null!=x.child&&this.calcInclusionTreeDepths(x.child,y+1)},T.prototype.includesInvalidEdge=function(){for(var I,y=this.edges.length,x=0;x<y;x++)if(this.isOneAncestorOfOther((I=this.edges[x]).source,I.target))return!0;return!1},Re.exports=T},function(Re,Y,q){"use strict";var M=q(0);function E(){}for(var T in M)E[T]=M[T];E.MAX_ITERATIONS=2500,E.DEFAULT_EDGE_LENGTH=50,E.DEFAULT_SPRING_STRENGTH=.45,E.DEFAULT_REPULSION_STRENGTH=4500,E.DEFAULT_GRAVITY_STRENGTH=.4,E.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,E.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,E.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,E.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,E.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,E.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,E.COOLING_ADAPTATION_FACTOR=.33,E.ADAPTATION_LOWER_NODE_LIMIT=1e3,E.ADAPTATION_UPPER_NODE_LIMIT=5e3,E.MAX_NODE_DISPLACEMENT=3*(E.MAX_NODE_DISPLACEMENT_INCREMENTAL=100),E.MIN_REPULSION_DIST=E.DEFAULT_EDGE_LENGTH/10,E.CONVERGENCE_CHECK_PERIOD=100,E.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,E.MIN_EDGE_LENGTH=1,E.GRID_CALCULATION_CHECK_PERIOD=10,Re.exports=E},function(Re,Y,q){"use strict";var M=q(12);function E(){}E.calcSeparationAmount=function(T,I,y,x){if(!T.intersects(I))throw"assert failed";var b=new Array(2);this.decideDirectionsForOverlappingNodes(T,I,b),y[0]=Math.min(T.getRight(),I.getRight())-Math.max(T.x,I.x),y[1]=Math.min(T.getBottom(),I.getBottom())-Math.max(T.y,I.y),T.getX()<=I.getX()&&T.getRight()>=I.getRight()?y[0]+=Math.min(I.getX()-T.getX(),T.getRight()-I.getRight()):I.getX()<=T.getX()&&I.getRight()>=T.getRight()&&(y[0]+=Math.min(T.getX()-I.getX(),I.getRight()-T.getRight())),T.getY()<=I.getY()&&T.getBottom()>=I.getBottom()?y[1]+=Math.min(I.getY()-T.getY(),T.getBottom()-I.getBottom()):I.getY()<=T.getY()&&I.getBottom()>=T.getBottom()&&(y[1]+=Math.min(T.getY()-I.getY(),I.getBottom()-T.getBottom()));var A=Math.abs((I.getCenterY()-T.getCenterY())/(I.getCenterX()-T.getCenterX()));I.getCenterY()===T.getCenterY()&&I.getCenterX()===T.getCenterX()&&(A=1);var D=A*y[0],k=y[1]/A;y[0]<k?k=y[0]:D=y[1],y[0]=-1*b[0]*(k/2+x),y[1]=-1*b[1]*(D/2+x)},E.decideDirectionsForOverlappingNodes=function(T,I,y){y[0]=T.getCenterX()<I.getCenterX()?-1:1,y[1]=T.getCenterY()<I.getCenterY()?-1:1},E.getIntersection2=function(T,I,y){var x=T.getCenterX(),b=T.getCenterY(),A=I.getCenterX(),D=I.getCenterY();if(T.intersects(I))return y[0]=x,y[1]=b,y[2]=A,y[3]=D,!0;var k=T.getX(),G=T.getY(),P=T.getRight(),O=T.getX(),$=T.getBottom(),B=T.getRight(),re=T.getWidthHalf(),j=T.getHeightHalf(),xe=I.getX(),ne=I.getY(),R=I.getRight(),S=I.getX(),L=I.getBottom(),_=I.getRight(),ee=I.getWidthHalf(),ie=I.getHeightHalf(),H=!1,ae=!1;if(x===A){if(b>D)return y[0]=x,y[1]=G,y[2]=A,y[3]=L,!1;if(b<D)return y[0]=x,y[1]=$,y[2]=A,y[3]=ne,!1}else if(b===D){if(x>A)return y[0]=k,y[1]=b,y[2]=R,y[3]=D,!1;if(x<A)return y[0]=P,y[1]=b,y[2]=xe,y[3]=D,!1}else{var me=T.height/T.width,ve=I.height/I.width,Ee=(D-b)/(A-x),Ge=void 0,fe=void 0,ce=void 0,pe=void 0;if(-me===Ee?x>A?(y[0]=O,y[1]=$,H=!0):(y[0]=P,y[1]=G,H=!0):me===Ee&&(x>A?(y[0]=k,y[1]=G,H=!0):(y[0]=B,y[1]=$,H=!0)),-ve===Ee?A>x?(y[2]=S,y[3]=L,ae=!0):(y[2]=R,y[3]=ne,ae=!0):ve===Ee&&(A>x?(y[2]=xe,y[3]=ne,ae=!0):(y[2]=_,y[3]=L,ae=!0)),H&&ae)return!1;if(x>A?b>D?(Ge=this.getCardinalDirection(me,Ee,4),fe=this.getCardinalDirection(ve,Ee,2)):(Ge=this.getCardinalDirection(-me,Ee,3),fe=this.getCardinalDirection(-ve,Ee,1)):b>D?(Ge=this.getCardinalDirection(-me,Ee,1),fe=this.getCardinalDirection(-ve,Ee,3)):(Ge=this.getCardinalDirection(me,Ee,2),fe=this.getCardinalDirection(ve,Ee,4)),!H)switch(Ge){case 1:ce=G,y[0]=x+-j/Ee,y[1]=ce;break;case 2:ce=b+re*Ee,y[0]=B,y[1]=ce;break;case 3:ce=$,y[0]=x+j/Ee,y[1]=ce;break;case 4:ce=b+-re*Ee,y[0]=O,y[1]=ce}if(!ae)switch(fe){case 1:pe=ne,y[2]=A+-ie/Ee,y[3]=pe;break;case 2:pe=D+ee*Ee,y[2]=_,y[3]=pe;break;case 3:pe=L,y[2]=A+ie/Ee,y[3]=pe;break;case 4:pe=D+-ee*Ee,y[2]=S,y[3]=pe}}return!1},E.getCardinalDirection=function(T,I,y){return T>I?y:1+y%4},E.getIntersection=function(T,I,y,x){if(null==x)return this.getIntersection2(T,I,y);var j,xe,ne,R,S,L,_,b=T.x,A=T.y,D=I.x,k=I.y,G=y.x,P=y.y,O=x.x,$=x.y;return S=D*A-b*k,L=O*P-G*$,0===(_=(j=k-A)*(R=G-O)-(xe=$-P)*(ne=b-D))?null:new M((ne*L-R*S)/_,(xe*S-j*L)/_)},E.angleOfVector=function(T,I,y,x){var b=void 0;return T!==y?(b=Math.atan((x-I)/(y-T)),y<T?b+=Math.PI:x<I&&(b+=this.TWO_PI)):b=x<I?this.ONE_AND_HALF_PI:this.HALF_PI,b},E.doIntersect=function(T,I,y,x){var b=T.x,A=T.y,D=I.x,k=I.y,G=y.x,P=y.y,O=x.x,$=x.y,B=(D-b)*($-P)-(O-G)*(k-A);if(0===B)return!1;var re=(($-P)*(O-b)+(G-O)*($-A))/B,j=((A-k)*(O-b)+(D-b)*($-A))/B;return 0<re&&re<1&&0<j&&j<1},E.HALF_PI=.5*Math.PI,E.ONE_AND_HALF_PI=1.5*Math.PI,E.TWO_PI=2*Math.PI,E.THREE_PI=3*Math.PI,Re.exports=E},function(Re,Y,q){"use strict";function M(){}M.sign=function(E){return E>0?1:E<0?-1:0},M.floor=function(E){return E<0?Math.ceil(E):Math.floor(E)},M.ceil=function(E){return E<0?Math.floor(E):Math.ceil(E)},Re.exports=M},function(Re,Y,q){"use strict";function M(){}M.MAX_VALUE=2147483647,M.MIN_VALUE=-2147483648,Re.exports=M},function(Re,Y,q){"use strict";var M=function(){function b(A,D){for(var k=0;k<D.length;k++){var G=D[k];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(A,G.key,G)}}return function(A,D,k){return D&&b(A.prototype,D),k&&b(A,k),A}}();var T=function(A){return{value:A,next:null,prev:null}},I=function(A,D,k,G){return null!==A?A.next=D:G.head=D,null!==k?k.prev=D:G.tail=D,D.prev=A,D.next=k,G.length++,D},y=function(A,D){var k=A.prev,G=A.next;return null!==k?k.next=G:D.head=G,null!==G?G.prev=k:D.tail=k,A.prev=A.next=null,D.length--,A},x=function(){function b(A){var D=this;(function E(b,A){if(!(b instanceof A))throw new TypeError("Cannot call a class as a function")})(this,b),this.length=0,this.head=null,this.tail=null,A?.forEach(function(k){return D.push(k)})}return M(b,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(D,k){return I(k.prev,T(D),k,this)}},{key:"insertAfter",value:function(D,k){return I(k,T(D),k.next,this)}},{key:"insertNodeBefore",value:function(D,k){return I(k.prev,D,k,this)}},{key:"insertNodeAfter",value:function(D,k){return I(k,D,k.next,this)}},{key:"push",value:function(D){return I(this.tail,T(D),null,this)}},{key:"unshift",value:function(D){return I(null,T(D),this.head,this)}},{key:"remove",value:function(D){return y(D,this)}},{key:"pop",value:function(){return y(this.tail,this).value}},{key:"popNode",value:function(){return y(this.tail,this)}},{key:"shift",value:function(){return y(this.head,this).value}},{key:"shiftNode",value:function(){return y(this.head,this)}},{key:"get_object_at",value:function(D){if(D<=this.length()){for(var k=1,G=this.head;k<D;)G=G.next,k++;return G.value}}},{key:"set_object_at",value:function(D,k){if(D<=this.length()){for(var G=1,P=this.head;G<D;)P=P.next,G++;P.value=k}}}]),b}();Re.exports=x},function(Re,Y,q){"use strict";function M(E,T,I){this.x=null,this.y=null,null==E&&null==T&&null==I?(this.x=0,this.y=0):"number"==typeof E&&"number"==typeof T&&null==I?(this.x=E,this.y=T):"Point"==E.constructor.name&&null==T&&null==I&&(this.x=(I=E).x,this.y=I.y)}M.prototype.getX=function(){return this.x},M.prototype.getY=function(){return this.y},M.prototype.getLocation=function(){return new M(this.x,this.y)},M.prototype.setLocation=function(E,T,I){"Point"==E.constructor.name&&null==T&&null==I?this.setLocation((I=E).x,I.y):"number"==typeof E&&"number"==typeof T&&null==I&&(parseInt(E)==E&&parseInt(T)==T?this.move(E,T):(this.x=Math.floor(E+.5),this.y=Math.floor(T+.5)))},M.prototype.move=function(E,T){this.x=E,this.y=T},M.prototype.translate=function(E,T){this.x+=E,this.y+=T},M.prototype.equals=function(E){return"Point"==E.constructor.name?this.x==E.x&&this.y==E.y:this==E},M.prototype.toString=function(){return(new M).constructor.name+"[x="+this.x+",y="+this.y+"]"},Re.exports=M},function(Re,Y,q){"use strict";function M(E,T,I,y){this.x=0,this.y=0,this.width=0,this.height=0,null!=E&&null!=T&&null!=I&&null!=y&&(this.x=E,this.y=T,this.width=I,this.height=y)}M.prototype.getX=function(){return this.x},M.prototype.setX=function(E){this.x=E},M.prototype.getY=function(){return this.y},M.prototype.setY=function(E){this.y=E},M.prototype.getWidth=function(){return this.width},M.prototype.setWidth=function(E){this.width=E},M.prototype.getHeight=function(){return this.height},M.prototype.setHeight=function(E){this.height=E},M.prototype.getRight=function(){return this.x+this.width},M.prototype.getBottom=function(){return this.y+this.height},M.prototype.intersects=function(E){return!(this.getRight()<E.x||this.getBottom()<E.y||E.getRight()<this.x||E.getBottom()<this.y)},M.prototype.getCenterX=function(){return this.x+this.width/2},M.prototype.getMinX=function(){return this.getX()},M.prototype.getMaxX=function(){return this.getX()+this.width},M.prototype.getCenterY=function(){return this.y+this.height/2},M.prototype.getMinY=function(){return this.getY()},M.prototype.getMaxY=function(){return this.getY()+this.height},M.prototype.getWidthHalf=function(){return this.width/2},M.prototype.getHeightHalf=function(){return this.height/2},Re.exports=M},function(Re,Y,q){"use strict";var M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T};function E(){}E.lastID=0,E.createID=function(T){return E.isPrimitive(T)?T:(null!=T.uniqueID||(T.uniqueID=E.getString(),E.lastID++),T.uniqueID)},E.getString=function(T){return null==T&&(T=E.lastID),"Object#"+T},E.isPrimitive=function(T){var I=typeof T>"u"?"undefined":M(T);return null==T||"object"!=I&&"function"!=I},Re.exports=E},function(Re,Y,q){"use strict";function M(G){if(Array.isArray(G)){for(var P=0,O=Array(G.length);P<G.length;P++)O[P]=G[P];return O}return Array.from(G)}var E=q(0),T=q(6),I=q(3),y=q(1),x=q(5),b=q(4),A=q(17),D=q(27);function k(G){D.call(this),this.layoutQuality=E.QUALITY,this.createBendsAsNeeded=E.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=E.DEFAULT_INCREMENTAL,this.animationOnLayout=E.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=E.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=E.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=E.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new T(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=G&&(this.isRemoteUse=G)}k.RANDOM_SEED=1,(k.prototype=Object.create(D.prototype)).getGraphManager=function(){return this.graphManager},k.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},k.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},k.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},k.prototype.newGraphManager=function(){var G=new T(this);return this.graphManager=G,G},k.prototype.newGraph=function(G){return new x(null,this.graphManager,G)},k.prototype.newNode=function(G){return new I(this.graphManager,G)},k.prototype.newEdge=function(G){return new y(null,null,G)},k.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},k.prototype.runLayout=function(){var G;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),G=!this.checkLayoutSuccess()&&this.layout(),"during"!==E.ANIMATE&&(G&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,G)},k.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},k.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var P=this.graphManager.getAllEdges(),O=0;O<P.length;O++);var B=this.graphManager.getRoot().getNodes();for(O=0;O<B.length;O++);this.update(this.graphManager.getRoot())}},k.prototype.update=function(G){if(null==G)this.update2();else if(G instanceof I){var P=G;if(null!=P.getChild())for(var O=P.getChild().getNodes(),$=0;$<O.length;$++)update(O[$]);null!=P.vGraphObject&&P.vGraphObject.update(P)}else G instanceof y?null!=G.vGraphObject&&G.vGraphObject.update(G):G instanceof x&&null!=G.vGraphObject&&G.vGraphObject.update(G)},k.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=E.QUALITY,this.animationDuringLayout=E.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=E.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=E.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=E.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=E.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=E.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},k.prototype.transform=function(G){if(null==G)this.transform(new b(0,0));else{var P=new A,O=this.graphManager.getRoot().updateLeftTop();if(null!=O){P.setWorldOrgX(G.x),P.setWorldOrgY(G.y),P.setDeviceOrgX(O.x),P.setDeviceOrgY(O.y);for(var $=this.getAllNodes(),re=0;re<$.length;re++)$[re].transform(P)}}},k.prototype.positionNodesRandomly=function(G){if(null==G)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var P,O,$=G.getNodes(),B=0;B<$.length;B++)null==(O=(P=$[B]).getChild())||0==O.getNodes().length?P.scatter():(this.positionNodesRandomly(O),P.updateBounds())},k.prototype.getFlatForest=function(){for(var G=[],P=!0,O=this.graphManager.getRoot().getNodes(),$=!0,B=0;B<O.length;B++)null!=O[B].getChild()&&($=!1);if(!$)return G;var re=new Set,j=[],xe=new Map,ne=[];for(ne=ne.concat(O);ne.length>0&&P;){for(j.push(ne[0]);j.length>0&&P;){var R=j[0];j.splice(0,1),re.add(R);var S=R.getEdges();for(B=0;B<S.length;B++){var L=S[B].getOtherEnd(R);if(xe.get(R)!=L){if(re.has(L)){P=!1;break}j.push(L),xe.set(L,R)}}}if(P){var _=[].concat(M(re));for(G.push(_),B=0;B<_.length;B++){var ie=ne.indexOf(_[B]);ie>-1&&ne.splice(ie,1)}re=new Set,xe=new Map}else G=[]}return G},k.prototype.createDummyNodesForBendpoints=function(G){for(var P=[],O=G.source,$=this.graphManager.calcLowestCommonAncestor(G.source,G.target),B=0;B<G.bendpoints.length;B++){var re=this.newNode(null);re.setRect(new Point(0,0),new Dimension(1,1)),$.add(re);var j=this.newEdge(null);this.graphManager.add(j,O,re),P.add(re),O=re}return j=this.newEdge(null),this.graphManager.add(j,O,G.target),this.edgeToDummyNodes.set(G,P),G.isInterGraph()?this.graphManager.remove(G):$.remove(G),P},k.prototype.createBendpointsFromDummyNodes=function(){var G=[];G=G.concat(this.graphManager.getAllEdges()),G=[].concat(M(this.edgeToDummyNodes.keys())).concat(G);for(var P=0;P<G.length;P++){var O=G[P];if(O.bendpoints.length>0){for(var $=this.edgeToDummyNodes.get(O),B=0;B<$.length;B++){var re=$[B],j=new b(re.getCenterX(),re.getCenterY()),xe=O.bendpoints.get(B);xe.x=j.x,xe.y=j.y,re.getOwner().remove(re)}this.graphManager.add(O,O.source,O.target)}}},k.transform=function(G,P,O,$){if(null!=O&&null!=$){var B=P;return G<=50?B-=(P-P/O)/50*(50-G):B+=(P*$-P)/50*(G-50),B}var xe,ne;return G<=50?(xe=9*P/500,ne=P/10):(xe=9*P/50,ne=-8*P),xe*G+ne},k.findCenterOfTree=function(G){var P=[];P=P.concat(G);var O=[],$=new Map,B=!1,re=null;(1==P.length||2==P.length)&&(B=!0,re=P[0]);for(var j=0;j<P.length;j++){var ne=(xe=P[j]).getNeighborsList().size;$.set(xe,xe.getNeighborsList().size),1==ne&&O.push(xe)}var R=[];for(R=R.concat(O);!B;){var S=[];for(S=S.concat(R),R=[],j=0;j<P.length;j++){var xe,L=P.indexOf(xe=P[j]);L>=0&&P.splice(L,1),xe.getNeighborsList().forEach(function(H){if(O.indexOf(H)<0){var me=$.get(H)-1;1==me&&R.push(H),$.set(H,me)}})}O=O.concat(R),(1==P.length||2==P.length)&&(B=!0,re=P[0])}return re},k.prototype.setGraphManager=function(G){this.graphManager=G},Re.exports=k},function(Re,Y,q){"use strict";function M(){}M.seed=1,M.x=0,M.nextDouble=function(){return(M.x=1e4*Math.sin(M.seed++))-Math.floor(M.x)},Re.exports=M},function(Re,Y,q){"use strict";var M=q(4);function E(T,I){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}E.prototype.getWorldOrgX=function(){return this.lworldOrgX},E.prototype.setWorldOrgX=function(T){this.lworldOrgX=T},E.prototype.getWorldOrgY=function(){return this.lworldOrgY},E.prototype.setWorldOrgY=function(T){this.lworldOrgY=T},E.prototype.getWorldExtX=function(){return this.lworldExtX},E.prototype.setWorldExtX=function(T){this.lworldExtX=T},E.prototype.getWorldExtY=function(){return this.lworldExtY},E.prototype.setWorldExtY=function(T){this.lworldExtY=T},E.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},E.prototype.setDeviceOrgX=function(T){this.ldeviceOrgX=T},E.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},E.prototype.setDeviceOrgY=function(T){this.ldeviceOrgY=T},E.prototype.getDeviceExtX=function(){return this.ldeviceExtX},E.prototype.setDeviceExtX=function(T){this.ldeviceExtX=T},E.prototype.getDeviceExtY=function(){return this.ldeviceExtY},E.prototype.setDeviceExtY=function(T){this.ldeviceExtY=T},E.prototype.transformX=function(T){var I=0,y=this.lworldExtX;return 0!=y&&(I=this.ldeviceOrgX+(T-this.lworldOrgX)*this.ldeviceExtX/y),I},E.prototype.transformY=function(T){var I=0,y=this.lworldExtY;return 0!=y&&(I=this.ldeviceOrgY+(T-this.lworldOrgY)*this.ldeviceExtY/y),I},E.prototype.inverseTransformX=function(T){var I=0,y=this.ldeviceExtX;return 0!=y&&(I=this.lworldOrgX+(T-this.ldeviceOrgX)*this.lworldExtX/y),I},E.prototype.inverseTransformY=function(T){var I=0,y=this.ldeviceExtY;return 0!=y&&(I=this.lworldOrgY+(T-this.ldeviceOrgY)*this.lworldExtY/y),I},E.prototype.inverseTransformPoint=function(T){return new M(this.inverseTransformX(T.x),this.inverseTransformY(T.y))},Re.exports=E},function(Re,Y,q){"use strict";var E=q(15),T=q(7),I=q(0),y=q(8),x=q(9);function b(){E.call(this),this.useSmartIdealEdgeLengthCalculation=T.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=T.DEFAULT_EDGE_LENGTH,this.springConstant=T.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=T.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=T.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=T.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=T.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*T.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=T.MAX_ITERATIONS}for(var A in b.prototype=Object.create(E.prototype),E)b[A]=E[A];b.prototype.initParameters=function(){E.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=T.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},b.prototype.calcIdealEdgeLengths=function(){for(var D,k,G,P,O,$,B=this.getGraphManager().getAllEdges(),re=0;re<B.length;re++)(D=B[re]).idealLength=this.idealEdgeLength,D.isInterGraph&&(G=D.getSource(),P=D.getTarget(),O=D.getSourceInLca().getEstimatedSize(),$=D.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(D.idealLength+=O+$-2*I.SIMPLE_NODE_SIZE),k=D.getLca().getInclusionTreeDepth(),D.idealLength+=T.DEFAULT_EDGE_LENGTH*T.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(G.getInclusionTreeDepth()+P.getInclusionTreeDepth()-2*k))},b.prototype.initSpringEmbedder=function(){var D=this.getAllNodes().length;this.incremental?(D>T.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*T.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(D-T.ADAPTATION_LOWER_NODE_LIMIT)/(T.ADAPTATION_UPPER_NODE_LIMIT-T.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-T.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=T.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=D>T.ADAPTATION_LOWER_NODE_LIMIT?Math.max(T.COOLING_ADAPTATION_FACTOR,1-(D-T.ADAPTATION_LOWER_NODE_LIMIT)/(T.ADAPTATION_UPPER_NODE_LIMIT-T.ADAPTATION_LOWER_NODE_LIMIT)*(1-T.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=T.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},b.prototype.calcSpringForces=function(){for(var k,D=this.getAllEdges(),G=0;G<D.length;G++)this.calcSpringForce(k=D[G],k.idealLength)},b.prototype.calcRepulsionForces=function(){var G,P,O,$,re,D=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],B=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%T.GRID_CALCULATION_CHECK_PERIOD==1&&D&&this.updateGrid(),re=new Set,G=0;G<B.length;G++)this.calculateRepulsionForceOfANode(O=B[G],re,D,k),re.add(O);else for(G=0;G<B.length;G++)for(O=B[G],P=G+1;P<B.length;P++)$=B[P],O.getOwner()==$.getOwner()&&this.calcRepulsionForce(O,$)},b.prototype.calcGravitationalForces=function(){for(var k=this.getAllNodesToApplyGravitation(),G=0;G<k.length;G++)this.calcGravitationalForce(k[G])},b.prototype.moveNodes=function(){for(var D=this.getAllNodes(),G=0;G<D.length;G++)D[G].move()},b.prototype.calcSpringForce=function(D,k){var O,$,B,re,G=D.getSource(),P=D.getTarget();if(this.uniformLeafNodeSizes&&null==G.getChild()&&null==P.getChild())D.updateLengthSimple();else if(D.updateLength(),D.isOverlapingSourceAndTarget)return;0!=(O=D.getLength())&&(re=($=this.springConstant*(O-k))*(D.lengthY/O),G.springForceX+=B=$*(D.lengthX/O),G.springForceY+=re,P.springForceX-=B,P.springForceY-=re)},b.prototype.calcRepulsionForce=function(D,k){var B,re,j,xe,ne,R,S,G=D.getRect(),P=k.getRect(),O=new Array(2),$=new Array(4);if(G.intersects(P)){y.calcSeparationAmount(G,P,O,T.DEFAULT_EDGE_LENGTH/2),S=2*O[1];var L=D.noOfChildren*k.noOfChildren/(D.noOfChildren+k.noOfChildren);D.repulsionForceX-=L*(R=2*O[0]),D.repulsionForceY-=L*S,k.repulsionForceX+=L*R,k.repulsionForceY+=L*S}else this.uniformLeafNodeSizes&&null==D.getChild()&&null==k.getChild()?(B=P.getCenterX()-G.getCenterX(),re=P.getCenterY()-G.getCenterY()):(y.getIntersection(G,P,$),B=$[2]-$[0],re=$[3]-$[1]),Math.abs(B)<T.MIN_REPULSION_DIST&&(B=x.sign(B)*T.MIN_REPULSION_DIST),Math.abs(re)<T.MIN_REPULSION_DIST&&(re=x.sign(re)*T.MIN_REPULSION_DIST),j=B*B+re*re,xe=Math.sqrt(j),S=(ne=this.repulsionConstant*D.noOfChildren*k.noOfChildren/j)*re/xe,D.repulsionForceX-=R=ne*B/xe,D.repulsionForceY-=S,k.repulsionForceX+=R,k.repulsionForceY+=S},b.prototype.calcGravitationalForce=function(D){var k,G,P,O,$,B,re,j;G=((k=D.getOwner()).getRight()+k.getLeft())/2,P=(k.getTop()+k.getBottom())/2,O=D.getCenterX()-G,$=D.getCenterY()-P,B=Math.abs(O)+D.getWidth()/2,re=Math.abs($)+D.getHeight()/2,D.getOwner()==this.graphManager.getRoot()?(B>(j=k.getEstimatedSize()*this.gravityRangeFactor)||re>j)&&(D.gravitationForceX=-this.gravityConstant*O,D.gravitationForceY=-this.gravityConstant*$):(B>(j=k.getEstimatedSize()*this.compoundGravityRangeFactor)||re>j)&&(D.gravitationForceX=-this.gravityConstant*O*this.compoundGravityConstant,D.gravitationForceY=-this.gravityConstant*$*this.compoundGravityConstant)},b.prototype.isConverged=function(){var D,k=!1;return this.totalIterations>this.maxIterations/3&&(k=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),D=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,D||k},b.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},b.prototype.calcNoOfChildrenForAllNodes=function(){for(var D,k=this.graphManager.getAllNodes(),G=0;G<k.length;G++)(D=k[G]).noOfChildren=D.getNoOfChildren()},b.prototype.calcGrid=function(D){var k,G;k=parseInt(Math.ceil((D.getRight()-D.getLeft())/this.repulsionRange)),G=parseInt(Math.ceil((D.getBottom()-D.getTop())/this.repulsionRange));for(var P=new Array(k),O=0;O<k;O++)P[O]=new Array(G);for(O=0;O<k;O++)for(var $=0;$<G;$++)P[O][$]=new Array;return P},b.prototype.addNodeToGrid=function(D,k,G){var P,O,$,B;P=parseInt(Math.floor((D.getRect().x-k)/this.repulsionRange)),O=parseInt(Math.floor((D.getRect().width+D.getRect().x-k)/this.repulsionRange)),$=parseInt(Math.floor((D.getRect().y-G)/this.repulsionRange)),B=parseInt(Math.floor((D.getRect().height+D.getRect().y-G)/this.repulsionRange));for(var re=P;re<=O;re++)for(var j=$;j<=B;j++)this.grid[re][j].push(D),D.setGridCoordinates(P,O,$,B)},b.prototype.updateGrid=function(){var D,G=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),D=0;D<G.length;D++)this.addNodeToGrid(G[D],this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},b.prototype.calculateRepulsionForceOfANode=function(D,k,G,P){if(this.totalIterations%T.GRID_CALCULATION_CHECK_PERIOD==1&&G||P){var O=new Set;D.surrounding=new Array;for(var $,B=this.grid,re=D.startX-1;re<D.finishX+2;re++)for(var j=D.startY-1;j<D.finishY+2;j++)if(!(re<0||j<0||re>=B.length||j>=B[0].length))for(var xe=0;xe<B[re][j].length;xe++)if($=B[re][j][xe],D.getOwner()==$.getOwner()&&D!=$&&!k.has($)&&!O.has($)){var ne=Math.abs(D.getCenterX()-$.getCenterX())-(D.getWidth()/2+$.getWidth()/2),R=Math.abs(D.getCenterY()-$.getCenterY())-(D.getHeight()/2+$.getHeight()/2);ne<=this.repulsionRange&&R<=this.repulsionRange&&O.add($)}D.surrounding=[].concat(function M(D){if(Array.isArray(D)){for(var k=0,G=Array(D.length);k<D.length;k++)G[k]=D[k];return G}return Array.from(D)}(O))}for(re=0;re<D.surrounding.length;re++)this.calcRepulsionForce(D,D.surrounding[re])},b.prototype.calcRepulsionRange=function(){return 0},Re.exports=b},function(Re,Y,q){"use strict";var M=q(1),E=q(7);function T(y,x,b){M.call(this,y,x,b),this.idealLength=E.DEFAULT_EDGE_LENGTH}for(var I in T.prototype=Object.create(M.prototype),M)T[I]=M[I];Re.exports=T},function(Re,Y,q){"use strict";var M=q(3);function E(I,y,x,b){M.call(this,I,y,x,b),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var T in E.prototype=Object.create(M.prototype),M)E[T]=M[T];E.prototype.setGridCoordinates=function(I,y,x,b){this.startX=I,this.finishX=y,this.startY=x,this.finishY=b},Re.exports=E},function(Re,Y,q){"use strict";function M(E,T){this.width=0,this.height=0,null!==E&&null!==T&&(this.height=T,this.width=E)}M.prototype.getWidth=function(){return this.width},M.prototype.setWidth=function(E){this.width=E},M.prototype.getHeight=function(){return this.height},M.prototype.setHeight=function(E){this.height=E},Re.exports=M},function(Re,Y,q){"use strict";var M=q(14);function E(){this.map={},this.keys=[]}E.prototype.put=function(T,I){var y=M.createID(T);this.contains(y)||(this.map[y]=I,this.keys.push(T))},E.prototype.contains=function(T){return M.createID(T),null!=this.map[T]},E.prototype.get=function(T){var I=M.createID(T);return this.map[I]},E.prototype.keySet=function(){return this.keys},Re.exports=E},function(Re,Y,q){"use strict";var M=q(14);function E(){this.set={}}E.prototype.add=function(T){var I=M.createID(T);this.contains(I)||(this.set[I]=T)},E.prototype.remove=function(T){delete this.set[M.createID(T)]},E.prototype.clear=function(){this.set={}},E.prototype.contains=function(T){return this.set[M.createID(T)]==T},E.prototype.isEmpty=function(){return 0===this.size()},E.prototype.size=function(){return Object.keys(this.set).length},E.prototype.addAllTo=function(T){for(var I=Object.keys(this.set),y=I.length,x=0;x<y;x++)T.push(this.set[I[x]])},E.prototype.size=function(){return Object.keys(this.set).length},E.prototype.addAll=function(T){for(var I=T.length,y=0;y<I;y++)this.add(T[y])},Re.exports=E},function(Re,Y,q){"use strict";var M=function(){function y(x,b){for(var A=0;A<b.length;A++){var D=b[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}return function(x,b,A){return b&&y(x.prototype,b),A&&y(x,A),x}}();var T=q(11),I=function(){function y(x,b){(function E(y,x){if(!(y instanceof x))throw new TypeError("Cannot call a class as a function")})(this,y),(null!==b||void 0!==b)&&(this.compareFunction=this._defaultCompareFunction);var A;A=x instanceof T?x.size():x.length,this._quicksort(x,0,A-1)}return M(y,[{key:"_quicksort",value:function(b,A,D){if(A<D){var k=this._partition(b,A,D);this._quicksort(b,A,k),this._quicksort(b,k+1,D)}}},{key:"_partition",value:function(b,A,D){for(var k=this._get(b,A),G=A,P=D;;){for(;this.compareFunction(k,this._get(b,P));)P--;for(;this.compareFunction(this._get(b,G),k);)G++;if(!(G<P))return P;this._swap(b,G,P),G++,P--}}},{key:"_get",value:function(b,A){return b instanceof T?b.get_object_at(A):b[A]}},{key:"_set",value:function(b,A,D){b instanceof T?b.set_object_at(A,D):b[A]=D}},{key:"_swap",value:function(b,A,D){var k=this._get(b,A);this._set(b,A,this._get(b,D)),this._set(b,D,k)}},{key:"_defaultCompareFunction",value:function(b,A){return A>b}}]),y}();Re.exports=I},function(Re,Y,q){"use strict";var M=function(){function I(y,x){for(var b=0;b<x.length;b++){var A=x[b];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(y,A.key,A)}}return function(y,x,b){return x&&I(y.prototype,x),b&&I(y,b),y}}();var T=function(){function I(y,x){var b=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,D=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;(function E(I,y){if(!(I instanceof y))throw new TypeError("Cannot call a class as a function")})(this,I),this.sequence1=y,this.sequence2=x,this.match_score=b,this.mismatch_penalty=A,this.gap_penalty=D,this.iMax=y.length+1,this.jMax=x.length+1,this.grid=new Array(this.iMax);for(var k=0;k<this.iMax;k++){this.grid[k]=new Array(this.jMax);for(var G=0;G<this.jMax;G++)this.grid[k][G]=0}this.tracebackGrid=new Array(this.iMax);for(var P=0;P<this.iMax;P++){this.tracebackGrid[P]=new Array(this.jMax);for(var O=0;O<this.jMax;O++)this.tracebackGrid[P][O]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return M(I,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var x=1;x<this.jMax;x++)this.grid[0][x]=this.grid[0][x-1]+this.gap_penalty,this.tracebackGrid[0][x]=[!1,!1,!0];for(var b=1;b<this.iMax;b++)this.grid[b][0]=this.grid[b-1][0]+this.gap_penalty,this.tracebackGrid[b][0]=[!1,!0,!1];for(var A=1;A<this.iMax;A++)for(var D=1;D<this.jMax;D++){var O=[this.sequence1[A-1]===this.sequence2[D-1]?this.grid[A-1][D-1]+this.match_score:this.grid[A-1][D-1]+this.mismatch_penalty,this.grid[A-1][D]+this.gap_penalty,this.grid[A][D-1]+this.gap_penalty],$=this.arrayAllMaxIndexes(O);this.grid[A][D]=O[$[0]],this.tracebackGrid[A][D]=[$.includes(0),$.includes(1),$.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var x=[];for(x.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});x[0];){var b=x[0],A=this.tracebackGrid[b.pos[0]][b.pos[1]];A[0]&&x.push({pos:[b.pos[0]-1,b.pos[1]-1],seq1:this.sequence1[b.pos[0]-1]+b.seq1,seq2:this.sequence2[b.pos[1]-1]+b.seq2}),A[1]&&x.push({pos:[b.pos[0]-1,b.pos[1]],seq1:this.sequence1[b.pos[0]-1]+b.seq1,seq2:"-"+b.seq2}),A[2]&&x.push({pos:[b.pos[0],b.pos[1]-1],seq1:"-"+b.seq1,seq2:this.sequence2[b.pos[1]-1]+b.seq2}),0===b.pos[0]&&0===b.pos[1]&&this.alignments.push({sequence1:b.seq1,sequence2:b.seq2}),x.shift()}return this.alignments}},{key:"getAllIndexes",value:function(x,b){for(var A=[],D=-1;-1!==(D=x.indexOf(b,D+1));)A.push(D);return A}},{key:"arrayAllMaxIndexes",value:function(x){return this.getAllIndexes(x,Math.max.apply(null,x))}}]),I}();Re.exports=T},function(Re,Y,q){"use strict";var M=function(){};M.FDLayout=q(18),M.FDLayoutConstants=q(7),M.FDLayoutEdge=q(19),M.FDLayoutNode=q(20),M.DimensionD=q(21),M.HashMap=q(22),M.HashSet=q(23),M.IGeometry=q(8),M.IMath=q(9),M.Integer=q(10),M.Point=q(12),M.PointD=q(4),M.RandomSeed=q(16),M.RectangleD=q(13),M.Transform=q(17),M.UniqueIDGeneretor=q(14),M.Quicksort=q(24),M.LinkedList=q(11),M.LGraphObject=q(2),M.LGraph=q(5),M.LEdge=q(1),M.LGraphManager=q(6),M.LNode=q(3),M.Layout=q(15),M.LayoutConstants=q(0),M.NeedlemanWunsch=q(25),Re.exports=M},function(Re,Y,q){"use strict";function M(){this.listeners=[]}var E=M.prototype;E.addListener=function(T,I){this.listeners.push({event:T,callback:I})},E.removeListener=function(T,I){for(var y=this.listeners.length;y>=0;y--){var x=this.listeners[y];x.event===T&&x.callback===I&&this.listeners.splice(y,1)}},E.emit=function(T,I){for(var y=0;y<this.listeners.length;y++){var x=this.listeners[y];T===x.event&&x.callback(I)}},Re.exports=M}])},1224(Ze,Re,Y){Ze.exports=Y(4548)},250(Ze){"use strict";Ze.exports=class zf{constructor(Y,q=new Map,M=0){this.prefix=Y,this._existing=q,this.counter=M}clone(){const{prefix:Y,_existing:q,counter:M}=this;return new zf(Y,new Map(q),M)}getId(Y){const q=Y&&this._existing.get(Y);if(q)return q;const M=this.prefix+this.counter;return this.counter++,Y&&this._existing.set(Y,M),M}hasId(Y){return this._existing.has(Y)}getOldIds(){return[...this._existing.keys()]}}},1126(Ze,Re,Y){"use strict";var q=Y(9293).default;Y(7140);const M=self.crypto||self.msCrypto;Ze.exports=class{constructor(T){if(!M||!M.subtle)throw new Error("crypto.subtle not found.");if("sha256"===T)this.algorithm={name:"SHA-256"};else{if("sha1"!==T)throw new Error(`Unsupported algorithm "${T}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(T){this._content+=T}digest(){var T=this;return q(function*(){const I=(new TextEncoder).encode(T._content),y=new Uint8Array(yield M.subtle.digest(T.algorithm,I));let x="";for(let b=0;b<y.length;++b)x+=y[b].toString(16).padStart(2,"0");return x})()}}},8276(Ze){"use strict";const q="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",M="http://www.w3.org/2001/XMLSchema#string",E="NamedNode",T="BlankNode",I="Literal",y="DefaultGraph",x={};function b(P,O){return P.subject.termType===O.subject.termType&&P.object.termType===O.object.termType&&P.subject.value===O.subject.value&&P.predicate.value===O.predicate.value&&P.object.value===O.object.value&&(P.object.termType!==I||P.object.datatype.termType===O.object.datatype.termType&&P.object.language===O.object.language&&P.object.datatype.value===O.object.datatype.value)}(()=>{const P="(?:<([^:]+:[^>]*)>)",$="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_",B=$+"0-9-\xb7\u0300-\u036f\u203f-\u2040",j="(_:(?:["+$+"0-9])(?:(?:["+B+".])*(?:["+B+"]))?)",L="[ \\t]+",_="[ \\t]*",ee="(?:"+P+"|"+j+")"+L,ie=P+L,H="(?:"+P+"|"+j+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+P+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+_,ae="(?:\\.|(?:(?:"+P+"|"+j+")"+_+"\\.))";x.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,x.empty=new RegExp("^"+_+"$"),x.quad=new RegExp("^"+_+ee+ie+H+ae+_+"$")})(),Ze.exports=class Wi{static parse(O){const $=[],B={},re=O.split(x.eoln);let j=0;for(const xe of re){if(j++,x.empty.test(xe))continue;const ne=xe.match(x.quad);if(null===ne)throw new Error("N-Quads parse error on line "+j+".");const R={subject:null,predicate:null,object:null,graph:null};if(R.subject=void 0!==ne[1]?{termType:E,value:ne[1]}:{termType:T,value:ne[2]},R.predicate={termType:E,value:ne[3]},void 0!==ne[4]?R.object={termType:E,value:ne[4]}:void 0!==ne[5]?R.object={termType:T,value:ne[5]}:(R.object={termType:I,value:void 0,datatype:{termType:E}},void 0!==ne[7]?R.object.datatype.value=ne[7]:void 0!==ne[8]?(R.object.datatype.value=q,R.object.language=ne[8]):R.object.datatype.value=M,R.object.value=G(ne[6])),R.graph=void 0!==ne[9]?{termType:E,value:ne[9]}:void 0!==ne[10]?{termType:T,value:ne[10]}:{termType:y,value:""},R.graph.value in B){let S=!0;const L=B[R.graph.value];for(const _ of L)if(b(_,R)){S=!1;break}S&&(L.push(R),$.push(R))}else B[R.graph.value]=[R],$.push(R)}return $}static serialize(O){Array.isArray(O)||(O=Wi.legacyDatasetToQuads(O));const $=[];for(const B of O)$.push(Wi.serializeQuad(B));return $.sort().join("")}static serializeQuadComponents(O,$,B,re){let j="";return j+=O.termType===E?`<${O.value}>`:`${O.value}`,j+=` <${$.value}> `,B.termType===E?j+=`<${B.value}>`:B.termType===T?j+=B.value:(j+=`"${function D(P){return P.replace(A,function(O){switch(O){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}(B.value)}"`,B.datatype.value===q?B.language&&(j+=`@${B.language}`):B.datatype.value!==M&&(j+=`^^<${B.datatype.value}>`)),re.termType===E?j+=` <${re.value}>`:re.termType===T&&(j+=` ${re.value}`),j+=" .\n",j}static serializeQuad(O){return Wi.serializeQuadComponents(O.subject,O.predicate,O.object,O.graph)}static legacyDatasetToQuads(O){const $=[],B={"blank node":T,IRI:E,literal:I};for(const re in O)O[re].forEach(xe=>{const ne={};for(const R in xe){const S=xe[R],L={termType:B[S.type],value:S.value};L.termType===I&&(L.datatype={termType:E},"datatype"in S&&(L.datatype.value=S.datatype),"language"in S?("datatype"in S||(L.datatype.value=q),L.language=S.language):"datatype"in S||(L.datatype.value=M)),ne[R]=L}ne.graph="@default"===re?{termType:y,value:""}:{termType:re.startsWith("_:")?T:E,value:re},$.push(ne)});return $}};const A=/["\\\n\r]/g,k=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function G(P){return P.replace(k,function(O,$,B,re){if($)switch($){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(B)return String.fromCharCode(parseInt(B,16));if(re)throw new Error("Unsupported U escape")})}},7794(Ze){"use strict";Ze.exports=class{constructor(Y){this.current=Y.sort(),this.done=!1,this.dir=new Map;for(let q=0;q<Y.length;++q)this.dir.set(Y[q],!0)}hasNext(){return!this.done}next(){const{current:Y,dir:q}=this,M=Y.slice();let E=null,T=0;const I=Y.length;for(let y=0;y<I;++y){const x=Y[y],b=q.get(x);(null===E||x>E)&&(b&&y>0&&x>Y[y-1]||!b&&y<I-1&&x>Y[y+1])&&(E=x,T=y)}if(null===E)this.done=!0;else{const y=q.get(E)?T-1:T+1;Y[T]=Y[y],Y[y]=E;for(const x of Y)x>E&&q.set(x,!q.get(x))}return M}}},624(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(250),E=Y(1126),T=Y(7794),I=Y(8276);function y(x,b){return x.hash<b.hash?-1:x.hash>b.hash?1:0}Ze.exports=class{constructor({createMessageDigest:b=()=>new E("sha256"),canonicalIdMap:A=new Map,maxDeepIterations:D=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new M("_:c14n",A),this.createMessageDigest=b,this.maxDeepIterations=D,this.quads=null,this.deepIterations=null}main(b){var A=this;return q(function*(){A.deepIterations=new Map,A.quads=b;for(const B of b)A._addBlankNodeQuadInfo({quad:B,component:B.subject}),A._addBlankNodeQuadInfo({quad:B,component:B.object}),A._addBlankNodeQuadInfo({quad:B,component:B.graph});const D=new Map,k=[...A.blankNodeInfo.keys()];let G=0;for(const B of k)++G%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:B,hashToBlankNodes:D});const P=[...D.keys()].sort(),O=[];for(const B of P){const re=D.get(B);re.length>1?O.push(re):A.canonicalIssuer.getId(re[0])}for(const B of O){const re=[];for(const j of B){if(A.canonicalIssuer.hasId(j))continue;const xe=new M("_:b");xe.getId(j);const ne=yield A.hashNDegreeQuads(j,xe);re.push(ne)}re.sort(y);for(const j of re){const xe=j.issuer.getOldIds();for(const ne of xe)A.canonicalIssuer.getId(ne)}}const $=[];for(const B of A.quads){const re=I.serializeQuadComponents(A._componentWithCanonicalId(B.subject),B.predicate,A._componentWithCanonicalId(B.object),A._componentWithCanonicalId(B.graph));$.push(re)}return $.sort(),$.join("")})()}hashFirstDegreeQuads(b){var A=this;return q(function*(){const D=[],k=A.blankNodeInfo.get(b),G=k.quads;for(const O of G){const $={subject:null,predicate:O.predicate,object:null,graph:null};$.subject=A.modifyFirstDegreeComponent(b,O.subject,"subject"),$.object=A.modifyFirstDegreeComponent(b,O.object,"object"),$.graph=A.modifyFirstDegreeComponent(b,O.graph,"graph"),D.push(I.serializeQuad($))}D.sort();const P=A.createMessageDigest();for(const O of D)P.update(O);return k.hash=yield P.digest(),k.hash})()}hashRelatedBlankNode(b,A,D,k){var G=this;return q(function*(){let P;P=G.canonicalIssuer.hasId(b)?G.canonicalIssuer.getId(b):D.hasId(b)?D.getId(b):G.blankNodeInfo.get(b).hash;const O=G.createMessageDigest();return O.update(k),"g"!==k&&O.update(G.getRelatedPredicate(A)),O.update(P),O.digest()})()}hashNDegreeQuads(b,A){var D=this;return q(function*(){const k=D.deepIterations.get(b)||0;if(k>D.maxDeepIterations)throw new Error(`Maximum deep iterations (${D.maxDeepIterations}) exceeded.`);D.deepIterations.set(b,k+1);const G=D.createMessageDigest(),P=yield D.createHashToRelated(b,A),O=[...P.keys()].sort();for(const $ of O){G.update($);let re,B="";const j=new T(P.get($));let xe=0;for(;j.hasNext();){const ne=j.next();++xe%3==0&&(yield D._yield());let R=A.clone(),S="";const L=[];let _=!1;for(const ee of ne)if(D.canonicalIssuer.hasId(ee)?S+=D.canonicalIssuer.getId(ee):(R.hasId(ee)||L.push(ee),S+=R.getId(ee)),0!==B.length&&S>B){_=!0;break}if(!_){for(const ee of L){const ie=yield D.hashNDegreeQuads(ee,R);if(S+=R.getId(ee),S+=`<${ie.hash}>`,R=ie.issuer,0!==B.length&&S>B){_=!0;break}}_||(0===B.length||S<B)&&(B=S,re=R)}}G.update(B),A=re}return{hash:yield G.digest(),issuer:A}})()}modifyFirstDegreeComponent(b,A){return"BlankNode"!==A.termType?A:{termType:"BlankNode",value:A.value===b?"_:a":"_:z"}}getRelatedPredicate(b){return`<${b.predicate.value}>`}createHashToRelated(b,A){var D=this;return q(function*(){const k=new Map,G=D.blankNodeInfo.get(b).quads;let P=0;for(const O of G)++P%100==0&&(yield D._yield()),yield Promise.all([D._addRelatedBlankNodeHash({quad:O,component:O.subject,position:"s",id:b,issuer:A,hashToRelated:k}),D._addRelatedBlankNodeHash({quad:O,component:O.object,position:"o",id:b,issuer:A,hashToRelated:k}),D._addRelatedBlankNodeHash({quad:O,component:O.graph,position:"g",id:b,issuer:A,hashToRelated:k})]);return k})()}_hashAndTrackBlankNode(b){var A=this;return q(function*({id:D,hashToBlankNodes:k}){const G=yield A.hashFirstDegreeQuads(D),P=k.get(G);P?P.push(D):k.set(G,[D])}).apply(this,arguments)}_addBlankNodeQuadInfo({quad:b,component:A}){if("BlankNode"!==A.termType)return;const D=A.value,k=this.blankNodeInfo.get(D);k?k.quads.add(b):this.blankNodeInfo.set(D,{quads:new Set([b]),hash:null})}_addRelatedBlankNodeHash(b){var A=this;return q(function*({quad:D,component:k,position:G,id:P,issuer:O,hashToRelated:$}){if("BlankNode"!==k.termType||k.value===P)return;const B=k.value,re=yield A.hashRelatedBlankNode(B,D,O,G),j=$.get(re);j?j.push(B):$.set(re,[B])}).apply(this,arguments)}_componentWithCanonicalId(b){return"BlankNode"!==b.termType||b.value.startsWith(this.canonicalIssuer.prefix)?b:{termType:"BlankNode",value:this.canonicalIssuer.getId(b.value)}}_yield(){return q(function*(){return new Promise(b=>setImmediate(b))})()}}},203(Ze,Re,Y){"use strict";const q=Y(250),M=Y(1126),E=Y(7794),T=Y(8276);function I(y,x){return y.hash<x.hash?-1:y.hash>x.hash?1:0}Ze.exports=class{constructor({createMessageDigest:x=()=>new M("sha256"),canonicalIdMap:b=new Map,maxDeepIterations:A=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new q("_:c14n",b),this.createMessageDigest=x,this.maxDeepIterations=A,this.quads=null,this.deepIterations=null}main(x){this.deepIterations=new Map,this.quads=x;for(const P of x)this._addBlankNodeQuadInfo({quad:P,component:P.subject}),this._addBlankNodeQuadInfo({quad:P,component:P.object}),this._addBlankNodeQuadInfo({quad:P,component:P.graph});const b=new Map,A=[...this.blankNodeInfo.keys()];for(const P of A)this._hashAndTrackBlankNode({id:P,hashToBlankNodes:b});const D=[...b.keys()].sort(),k=[];for(const P of D){const O=b.get(P);O.length>1?k.push(O):this.canonicalIssuer.getId(O[0])}for(const P of k){const O=[];for(const $ of P){if(this.canonicalIssuer.hasId($))continue;const B=new q("_:b");B.getId($);const re=this.hashNDegreeQuads($,B);O.push(re)}O.sort(I);for(const $ of O){const B=$.issuer.getOldIds();for(const re of B)this.canonicalIssuer.getId(re)}}const G=[];for(const P of this.quads){const O=T.serializeQuadComponents(this._componentWithCanonicalId({component:P.subject}),P.predicate,this._componentWithCanonicalId({component:P.object}),this._componentWithCanonicalId({component:P.graph}));G.push(O)}return G.sort(),G.join("")}hashFirstDegreeQuads(x){const b=[],A=this.blankNodeInfo.get(x),D=A.quads;for(const G of D){const P={subject:null,predicate:G.predicate,object:null,graph:null};P.subject=this.modifyFirstDegreeComponent(x,G.subject,"subject"),P.object=this.modifyFirstDegreeComponent(x,G.object,"object"),P.graph=this.modifyFirstDegreeComponent(x,G.graph,"graph"),b.push(T.serializeQuad(P))}b.sort();const k=this.createMessageDigest();for(const G of b)k.update(G);return A.hash=k.digest(),A.hash}hashRelatedBlankNode(x,b,A,D){let k;k=this.canonicalIssuer.hasId(x)?this.canonicalIssuer.getId(x):A.hasId(x)?A.getId(x):this.blankNodeInfo.get(x).hash;const G=this.createMessageDigest();return G.update(D),"g"!==D&&G.update(this.getRelatedPredicate(b)),G.update(k),G.digest()}hashNDegreeQuads(x,b){const A=this.deepIterations.get(x)||0;if(A>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(x,A+1);const D=this.createMessageDigest(),k=this.createHashToRelated(x,b),G=[...k.keys()].sort();for(const P of G){D.update(P);let $,O="";const B=new E(k.get(P));for(;B.hasNext();){const re=B.next();let j=b.clone(),xe="";const ne=[];let R=!1;for(const S of re)if(this.canonicalIssuer.hasId(S)?xe+=this.canonicalIssuer.getId(S):(j.hasId(S)||ne.push(S),xe+=j.getId(S)),0!==O.length&&xe>O){R=!0;break}if(!R){for(const S of ne){const L=this.hashNDegreeQuads(S,j);if(xe+=j.getId(S),xe+=`<${L.hash}>`,j=L.issuer,0!==O.length&&xe>O){R=!0;break}}R||(0===O.length||xe<O)&&(O=xe,$=j)}}D.update(O),b=$}return{hash:D.digest(),issuer:b}}modifyFirstDegreeComponent(x,b){return"BlankNode"!==b.termType?b:{termType:"BlankNode",value:b.value===x?"_:a":"_:z"}}getRelatedPredicate(x){return`<${x.predicate.value}>`}createHashToRelated(x,b){const A=new Map,D=this.blankNodeInfo.get(x).quads;for(const k of D)this._addRelatedBlankNodeHash({quad:k,component:k.subject,position:"s",id:x,issuer:b,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:k,component:k.object,position:"o",id:x,issuer:b,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:k,component:k.graph,position:"g",id:x,issuer:b,hashToRelated:A});return A}_hashAndTrackBlankNode({id:x,hashToBlankNodes:b}){const A=this.hashFirstDegreeQuads(x),D=b.get(A);D?D.push(x):b.set(A,[x])}_addBlankNodeQuadInfo({quad:x,component:b}){if("BlankNode"!==b.termType)return;const A=b.value,D=this.blankNodeInfo.get(A);D?D.quads.add(x):this.blankNodeInfo.set(A,{quads:new Set([x]),hash:null})}_addRelatedBlankNodeHash({quad:x,component:b,position:A,id:D,issuer:k,hashToRelated:G}){if("BlankNode"!==b.termType||b.value===D)return;const P=b.value,O=this.hashRelatedBlankNode(P,x,k,A),$=G.get(O);$?$.push(P):G.set(O,[P])}_componentWithCanonicalId({component:x}){return"BlankNode"!==x.termType||x.value.startsWith(this.canonicalIssuer.prefix)?x:{termType:"BlankNode",value:this.canonicalIssuer.getId(x.value)}}}},6268(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(1126),E=Y(624);Ze.exports=class extends E{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new M("sha1")}modifyFirstDegreeComponent(I,y,x){return"BlankNode"!==y.termType?y:"graph"===x?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:y.value===I?"_:a":"_:z"}}getRelatedPredicate(I){return I.predicate.value}createHashToRelated(I,y){var x=this;return q(function*(){const b=new Map,A=x.blankNodeInfo.get(I).quads;let D=0;for(const k of A){let G,P;if("BlankNode"===k.subject.termType&&k.subject.value!==I)P=k.subject.value,G="p";else{if("BlankNode"!==k.object.termType||k.object.value===I)continue;P=k.object.value,G="r"}++D%100==0&&(yield x._yield());const O=yield x.hashRelatedBlankNode(P,k,y,G),$=b.get(O);$?$.push(P):b.set(O,[P])}return b})()}}},8911(Ze,Re,Y){"use strict";const q=Y(1126),M=Y(203);Ze.exports=class extends M{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new q("sha1")}modifyFirstDegreeComponent(T,I,y){return"BlankNode"!==I.termType?I:"graph"===y?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:I.value===T?"_:a":"_:z"}}getRelatedPredicate(T){return T.predicate.value}createHashToRelated(T,I){const y=new Map,x=this.blankNodeInfo.get(T).quads;for(const b of x){let A,D;if("BlankNode"===b.subject.termType&&b.subject.value!==T)D=b.subject.value,A="p";else{if("BlankNode"!==b.object.termType||b.object.value===T)continue;D=b.object.value,A="r"}const k=this.hashRelatedBlankNode(D,b,I,A),G=y.get(k);G?G.push(D):y.set(k,[D])}return y}}},4548(Ze,Re,Y){"use strict";var q=Y(9293).default;const M=Y(624),E=Y(6268),T=Y(203),I=Y(8911);let y;try{y=Y(7789)}catch{}function x(b){return Array.isArray(b)?b:Re.NQuads.legacyDatasetToQuads(b)}Re.NQuads=Y(8276),Re.IdentifierIssuer=Y(250),Re._rdfCanonizeNative=function(b){return b&&(y=b),y},Re.canonize=function(){var b=q(function*(A,D){const k=x(A);if(D.useNative){if(!y)throw new Error("rdf-canonize-native not available");if(D.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((G,P)=>y.canonize(k,D,(O,$)=>O?P(O):G($)))}if("URDNA2015"===D.algorithm)return new M(D).main(k);if("URGNA2012"===D.algorithm){if(D.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new E(D).main(k)}throw"algorithm"in D?new Error("Invalid RDF Dataset Canonicalization algorithm: "+D.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(A,D){return b.apply(this,arguments)}}(),Re._canonizeSync=function(b,A){const D=x(b);if(A.useNative){if(!y)throw new Error("rdf-canonize-native not available");if(A.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return y.canonizeSync(D,A)}if("URDNA2015"===A.algorithm)return new T(A).main(D);if("URGNA2012"===A.algorithm){if(A.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new I(A).main(D)}throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},7140(){!function(Ze){"use strict";if(!Ze.setImmediate){var T,Y=1,q={},M=!1,E=Ze.document,$=Object.getPrototypeOf&&Object.getPrototypeOf(Ze);$=$&&$.setTimeout?$:Ze,"[object process]"==={}.toString.call(Ze.process)?function A(){T=function(B){process.nextTick(function(){b(B)})}}():function D(){if(Ze.postMessage&&!Ze.importScripts){var B=!0,re=Ze.onmessage;return Ze.onmessage=function(){B=!1},Ze.postMessage("","*"),Ze.onmessage=re,B}}()?function k(){var B="setImmediate$"+Math.random()+"$",re=function(j){j.source===Ze&&"string"==typeof j.data&&0===j.data.indexOf(B)&&b(+j.data.slice(B.length))};Ze.addEventListener?Ze.addEventListener("message",re,!1):Ze.attachEvent("onmessage",re),T=function(j){Ze.postMessage(B+j,"*")}}():Ze.MessageChannel?function G(){var B=new MessageChannel;B.port1.onmessage=function(re){b(re.data)},T=function(re){B.port2.postMessage(re)}}():E&&"onreadystatechange"in E.createElement("script")?function P(){var B=E.documentElement;T=function(re){var j=E.createElement("script");j.onreadystatechange=function(){b(re),j.onreadystatechange=null,B.removeChild(j),j=null},B.appendChild(j)}}():function O(){T=function(B){setTimeout(b,0,B)}}(),$.setImmediate=function I(B){"function"!=typeof B&&(B=new Function(""+B));for(var re=new Array(arguments.length-1),j=0;j<re.length;j++)re[j]=arguments[j+1];return q[Y]={callback:B,args:re},T(Y),Y++},$.clearImmediate=y}function y(B){delete q[B]}function b(B){if(M)setTimeout(b,0,B);else{var re=q[B];if(re){M=!0;try{!function x(B){var re=B.callback,j=B.args;switch(j.length){case 0:re();break;case 1:re(j[0]);break;case 2:re(j[0],j[1]);break;case 3:re(j[0],j[1],j[2]);break;default:re.apply(void 0,j)}}(re)}finally{y(B),M=!1}}}}}(typeof self>"u"?typeof global>"u"?this:global:self)},7789(){},9293(Ze){function Re(q,M,E,T,I,y,x){try{var b=q[y](x),A=b.value}catch(D){return void E(D)}b.done?M(A):Promise.resolve(A).then(T,I)}Ze.exports=function Y(q){return function(){var M=this,E=arguments;return new Promise(function(T,I){var y=q.apply(M,E);function x(A){Re(y,T,I,x,b,"next",A)}function b(A){Re(y,T,I,x,b,"throw",A)}x(void 0)})}},Ze.exports.__esModule=!0,Ze.exports.default=Ze.exports}}]);
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[1701],{6034(Ze,Ne,Y){"use strict";Y.d(Ne,{y:()=>$});var W=Y(7705),M=Y(7598),E=Y(9769),T=Y(5187),I=Y(2271),p=Y(5547);const x=["*"];let m=(()=>{class B{style=(0,W.hFB)("");gap=(0,W.hFB)("m");columns=(0,W.hFB)(1);getStyles=(0,I.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(xe){return new(xe||B)};static \u0275cmp=p.VBU({type:B,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(xe,ne){2&xe&&p.Aen(ne.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:x,decls:1,vars:0,template:function(xe,ne){1&xe&&(p.NAR(),p.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return B})();var A=Y(2245),D=Y(5381),k=Y(29);const G=["*"];function P(B,re){if(1&B&&(p.j41(0,"cue-typography",2),p.EFF(1),p.k0s()),2&B){const j=p.XpG();p.R7$(),p.SpI(" ",j.label()," ")}}let $=(()=>{class B{label=(0,W.hFB)("");variant=(0,W.hFB)("default");shadow=(0,W.hFB)(!1);padded=(0,W.hFB)(!0);showCloseBtn=(0,W.hFB)(!0);position=(0,W.hFB)("top-left");clickedClose=(0,W.CGW)();margin=(0,W.hFB)("0.5rem");close(j){j.stopPropagation(),j.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(xe){return new(xe||B)};static \u0275cmp=p.VBU({type:B,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:G,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(xe,ne){1&xe&&(p.NAR(),p.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),p.nVh(4,P,2,1,"cue-typography",2),p.nrm(5,"span",3),p.j41(6,"cue-svg-icon",4),p.bIt("click",function(S){return ne.close(S)}),p.k0s()(),p.SdG(7),p.k0s()()()),2&xe&&(p.xc7("top","top-left"===ne.position()||"top-right"===ne.position()?ne.margin():"null")("bottom","bottom-left"===ne.position()||"bottom-right"===ne.position()?ne.margin():"null")("left","top-left"===ne.position()||"bottom-left"===ne.position()?ne.margin():"null")("right","top-right"===ne.position()||"bottom-right"===ne.position()?ne.margin():"null"),p.Y8G("variant",ne.variant())("shadow",ne.shadow())("padded",ne.padded()),p.R7$(3),p.xc7("padding",ne.padded()?"0":"10px"),p.R7$(),p.vxM(ne.label()&&"undefined"!==ne.label()?4:-1))},dependencies:[E.MD,T.Card,m,A.Typography,D.FlexContainer,k.A,M.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content;z-index:100}"]})}return B})()},9134(Ze,Ne,Y){"use strict";Y.d(Ne,{v:()=>I});var W=Y(7705),M=Y(6034),E=Y(7517),T=Y(5547);let I=(()=>{class p{title=(0,W.hFB)("Legend");layers=(0,W.hFB)([]);position=(0,W.hFB)("top-left");close=(0,W.CGW)();visibilityChange=(0,W.CGW)();layerChange=(0,W.CGW)();visibilityAll=(0,W.CGW)();static \u0275fac=function(A){return new(A||p)};static \u0275cmp=T.VBU({type:p,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(A,D){1&A&&(T.j41(0,"cue-draggable-card",0),T.bIt("clickedClose",function(){return D.close.emit()}),T.j41(1,"div",1)(2,"cue-layer-legend",2),T.bIt("visibilityAll",function(G){return D.visibilityAll.emit(G)})("layerChange",function(G){return D.layerChange.emit(G)})("visibilityChange",function(G){return D.visibilityChange.emit(G)}),T.k0s()()()),2&A&&(T.Y8G("label",D.title())("padded",!1)("position",D.position()),T.R7$(2),T.Y8G("layers",D.layers()))},dependencies:[M.y,E.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return p})()},9937(Ze,Ne,Y){"use strict";Y.d(Ne,{t:()=>M0});var W=Y(467),M=Y(7705),E=Y(5802),T=Y(2271);class I{hideClassAssignmentTriples=!0;hideDatatypePropertyTriples=!0;collapseIntoClassificationLabels=[];preferredLabelLanguage="en";showClassLabelOnInstance=!0}var x=Y(2130),m=Y(8402);class A{_doc;_omitClassAssignments;_omitDatatypeProperties;_preferredLabelLanguage;_collapseIntoClassificationLabels;_context;_nodes=[];_edges=[];_seenNodes=[];_resourceLabels={};_resourceAltLabels={};_resolvedCollapsePredicates=new Set;_knownPrefixes={schema:"http://schema.org/"};constructor(e,t=!0,n=!0,a="en",i=[]){this._doc=e,this._omitClassAssignments=t,this._omitDatatypeProperties=n,this._preferredLabelLanguage=a,this._collapseIntoClassificationLabels=i}get elementData(){return{nodes:this._nodes,edges:this._edges}}init(){var e=this;return(0,W.A)(function*(){return"http://schema.org/"==e._doc["@context"]&&(e._doc["@context"]="https://schema.org/"),e._context={...e._doc["@context"],...e._knownPrefixes},e._nodes=[],e._edges=[],e._seenNodes=[],e._resourceLabels={},e._resourceAltLabels={},e._resolvedCollapsePredicates=new Set(e._collapseIntoClassificationLabels.map(n=>e._expandIRI(n))),(yield(0,x.toRDF)(e._doc)).forEach(n=>e._processQuad(n)),e._nodes=e._appendNames(e._nodes),e._edges=e._appendNames(e._edges),{nodes:e._nodes,edges:e._edges}})()}append(e){var t=this;return(0,W.A)(function*(){return(yield(0,x.toRDF)(e)).forEach(a=>t._processQuad(a)),t._nodes=t._appendNames(t._nodes),t._edges=t._appendNames(t._edges),{nodes:t._nodes,edges:t._edges}})()}_processQuad(e){const t=e.subject.value;let n=e.predicate.value,a=e.object.value;if("http://www.w3.org/2004/02/skos/core#prefLabel"===n||"http://www.w3.org/2000/01/rdf-schema#label"===n||"http://schema.org/name"===n)return void(Object.keys(this._resourceLabels).includes(t)?this._resourceLabels[t].push(e.object):this._resourceLabels[t]=[e.object]);if("http://www.w3.org/2004/02/skos/core#altLabel"===n)return void(Object.keys(this._resourceAltLabels).includes(t)?this._resourceAltLabels[t].push(e.object):this._resourceAltLabels[t]=[e.object]);if(this._appendNamedNode(t),this._resolvedCollapsePredicates.has(n)){const s=this._nodes.find(o=>o.data.id===t);return void(void 0!==s&&(void 0===s.data.boxLabels&&(s.data.boxLabels=[]),s.data.boxLabels.push(this._appendPrefix(a))))}if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===n&&(n="a",this._seenNodes.includes(t))){const s=this._nodes.find(o=>o.data.id===t);void 0!==s&&(void 0===s.data.boxLabels&&(s.data.boxLabels=[]),s.data.boxLabels.push(this._appendPrefix(a)))}const i=e.object.termType;if("Literal"===i){if(a=this._appendLiteralNode(a),this._seenNodes.includes(t)){const s=this._nodes.find(o=>o.data.id===t);if(void 0!==s){void 0===s.data.properties&&(s.data.properties={});const o=this._getIdFromIRI(n);s.data.properties[o]=e.object.value}}}else"BlankNode"===i?this._appendNamedNode(a,"individual"):"NamedNode"===i?this._appendNamedNode(a,"a"===n?"class":"individual"):console.warn("Unknown term type "+i);this._appendEdge(t,n,a,"Literal"===i)}_appendNames(e){return e.map(t=>{const n=t.data.iri,a=(void 0!==t.data.id?this._resourceLabels[t.data.id]:void 0)??(void 0!==n?this._resourceLabels[n]:void 0)??(void 0!==t.data.id?this._resourceAltLabels[t.data.id]:void 0)??(void 0!==n?this._resourceAltLabels[n]:void 0);if(Array.isArray(a))1===a.length?t.data.label=a[0].value:console.log("MORE THAN ONE LABEL NOT YET SUPPORTED");else{if("class"===t.classes){if(null==t.data.iri)return t;t.data.label=this._getIdFromIRI(t.data.iri)}if("edge"===t.classes){if(null==t.data.iri)return t;t.data.label=this._getIdFromIRI(t.data.iri)}}const i=t.data;return void 0!==i.size&&(""!=t.data.label&&(i.size=44),Array.isArray(i.boxLabels)&&(i.boxLabels=i.boxLabels.map(s=>{const o=this._expandIRI(s),l=this._resourceLabels[o]??this._resourceAltLabels[o];return Array.isArray(l)&&l.length>0?l[0].value:s}))),t})}_appendNamedNode(e,t="individual"){if(!this._omitClassAssignments||"class"!==t)if(this._seenNodes.includes(e)){if("class"===t){const n=this._nodes.find(a=>a.data.id===e);null!=n&&(n.classes=t)}}else this._nodes.push({data:{id:e,iri:e,label:"",size:24},classes:t}),this._seenNodes.push(e)}_appendLiteralNode(e){if(this._omitDatatypeProperties)return"";""===e&&(e="-");const t=this._camelize(e);return this._seenNodes.includes(t)||(this._nodes.push({data:{id:t,label:e,size:2*e.length},classes:"literal"}),this._seenNodes.push(t)),t}_appendEdge(e,t,n,a=!1){this._omitClassAssignments&&"a"===t||this._omitDatatypeProperties&&a||this._edges.push({data:{id:(0,m.A)(),source:e,target:n,label:this._appendPrefix(t),iri:t},classes:"edge"})}_expandIRI(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;const t=e.indexOf(":");if(t>0){const n=e.substring(0,t),a=e.substring(t+1),i=this._context?.[n];if(i)return i+a}return e}_appendPrefix(e){const t=Object.keys(this._context),n=Object.values(this._context);for(const a in n){const i=n[a];if(e.startsWith(i)){e=e.replace(i,`${t[a]}:`);break}}return e}_camelize(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(t,n){return 0===n?t.toLowerCase():t.toUpperCase()}).replace(/\s+/g,"")}_getIdFromIRI(e){return e.includes("#")?e.split("#")[1]:e.split("/").pop()??e}}class D{_doc;_settings;_elementDataHandler;_elementData;constructor(e,t=new I){this._doc=e,this._settings=t,this._elementDataHandler=new A(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels)}set settings(e){this._settings=e,this._elementDataHandler=new A(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels)}init(){var e=this;return(0,W.A)(function*(){return e._elementData=yield e._elementDataHandler.init(),e._elementData})()}appendElementData(e){var t=this;return(0,W.A)(function*(){return t._elementData=yield t._elementDataHandler.append(e),t._elementData})()}compact(){console.log("COMPACT")}expand(){console.log("EXPAND")}}class G{props={display:!0,displayOnlyOnHover:!0};boxLabels={display:!0,displayOnlyOnHover:!1}}function P(r,e,t=new G){function n(){r.nodes().forEach(s=>{const o=s.renderedHeight(),l=document.getElementById(`box-${s.id()}`);if(l){if(t.boxLabels.display){const u=s.data().boxLabels;if(void 0!==u){let c=document.getElementById(`labels-box-${s.id()}`);c?c.style.bottom=o/2-10+"px":(c=document.createElement("div"),c.id=`labels-box-${s.id()}`,c.className="box-label",c.style.bottom=o/2-10+"px",t.boxLabels.displayOnlyOnHover&&(c.style.display="none"),l.appendChild(c),u.forEach((d,f)=>{if(!c)return;const h=document.createElement("div");h.id=`labels-box-${s.id()}-${f}`,h.className="entry",h.innerHTML=d,c.appendChild(h)}))}}if(t.props.display){const u=s.data().properties;if(void 0!==u){let c=document.getElementById(`props-box-${s.id()}`);c?c.style.top=o/2-10+"px":(c=document.createElement("div"),c.id=`props-box-${s.id()}`,c.style.right="0px",c.className="property",c.style.top=o/2-10+"px",t.props.displayOnlyOnHover&&(c.style.display="none"),l.appendChild(c),Object.keys(u).forEach((d,f)=>{if(!c)return;const h=document.createElement("div");h.id=`props-box-${s.id()}-${f}`,h.className="entry",h.innerHTML=`<span class="key">${d}</span><span class="value">${u[d]}</span>`,c.appendChild(h)}))}}}})}!function k(r,e){function t(){r.nodes().forEach(a=>{const i=a.renderedPosition();let s=document.getElementById(`box-${a.id()}`);s||(s=document.createElement("div"),s.id=`box-${a.id()}`,s.style.position="absolute",e.appendChild(s)),s.style.left=`${i.x}px`,s.style.top=`${i.y}px`})}t(),r.on("position","node",t),r.on("pan zoom",t),r.on("remove","node",function n(a){const i=a.target.id(),s=document.getElementById(`box-${i}`);s&&s.remove()}),window.addEventListener("resize",t)}(r,e),n(),r.on("zoom",()=>{n(),function i(){if(!t.boxLabels.display)return;const o=r.zoom()>=.6;r.nodes().forEach(l=>{const u=document.getElementById(`labels-box-${l.id()}`);u&&(t.boxLabels.displayOnlyOnHover||(u.style.display=o?"flex":"none"))})}()}),r.on("mouseover","node",s=>{const o=s.target;if(t.props.displayOnlyOnHover){const l=document.getElementById(`props-box-${o.id()}`);l&&(l.style.display="flex")}if(t.boxLabels.displayOnlyOnHover){const l=document.getElementById(`labels-box-${o.id()}`);l&&(l.style.display="flex")}}),r.on("mouseout","node",s=>{const o=s.target;if(t.props.displayOnlyOnHover){const l=document.getElementById(`props-box-${o.id()}`);l&&(l.style.display="none")}if(t.boxLabels.displayOnlyOnHover){const l=document.getElementById(`labels-box-${o.id()}`);l&&(l.style.display="none")}})}function O(r){return getComputedStyle(document.documentElement).getPropertyValue(r).trim()}const $={get backgroundColor(){return O("--cue-main-background")||"#f5f6f9"},get edgeColor(){return O("--cue-primary")||"#2859e1"},edgeFontSize:"5rem",edgeWidth:"1.5rem",get nodeColor(){return O("--cue-primary")||"#2859e1"},nodeOpacity:"0.9",font:"Poppins",directed:!0,labelSelector:"label",showNodeLabels:!0,showEdgeLabels:!0,get hoverBorderColor(){return O("--cue-primary")||"#2859e1"},get textColor(){return O("--cue-primaryContrast")||"#ffffff"}},B=(r=$)=>{const e=O("--cue-primary")||"#2859e1",t=O("--cue-primaryContrast")||"#ffffff",n=O("--cue-accent")||"#e2f552",a=O("--cue-accentContrast")||"#121c2b",i=O("--cue-neutral")||"#8394b0",s=O("--cue-main-foreground")||"#121c2b",o=r.backgroundColor;return[{selector:"node",style:{label:l=>l.data(r.labelSelector)&&r.showNodeLabels?l.data(r.labelSelector):"",shape:"round-rectangle","text-valign":"bottom","text-margin-y":10,"font-family":r.font,"font-size":"6rem",opacity:r.nodeOpacity,color:s,"text-outline-width":0,"text-outline-color":l=>l.data("color")?l.data("color"):e,"background-color":l=>l.data("color")?l.data("color"):e,width:l=>l.data("size")?l.data("size"):"24",height:l=>l.data("size")?l.data("size"):"24","background-image":l=>l.data("imgPath")?l.data("imgPath"):"none","background-fit":"cover","background-width":"100%","background-height":"100%","background-image-opacity":.2}},{selector:"edge",style:{label:"","font-family":r.font,"font-size":r.edgeFontSize,color:e,"target-arrow-color":e,"curve-style":"bezier","target-arrow-shape":r.directed?"triangle":"none","arrow-scale":.8,"line-color":e,"line-opacity":.5,width:l=>l.data("width")?l.data("width"):r.edgeWidth}},{selector:"edge.edge-hover",style:{label:l=>l.data(r.labelSelector)&&r.showEdgeLabels?l.data(r.labelSelector):"","line-opacity":1,width:l=>l.data("width")?l.data("width"):r.edgeWidth,"text-valign":"center","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":o,"text-background-padding":4,"font-size":r.edgeFontSize,"font-weight":"600"}},{selector:".triple",style:{"background-color":o,"border-color":l=>l.data("color")?l.data("color"):e}},{selector:".literal",style:{label:l=>l.data(r.labelSelector)?l.data(r.labelSelector):"","text-valign":"center","font-size":"6rem","border-color":s,"background-color":o,"text-outline-width":0,"border-width":0,"background-opacity":0,color:s}},{selector:".loading",style:{shape:"ellipse","pie-size":"100%","pie-1-background-color":e,"pie-1-background-size":l=>`${l.data("pct")}%`,"pie-2-background-color":n,"pie-2-background-size":l=>100-parseInt(l.data("pct"))+"%",label:l=>void 0!==l.data("pct")&&100!==l.data("pct")?`${parseInt(l.data("pct"))}%`:"","font-size":"5rem","border-width":1,"border-opacity":1,"border-color":t}},{selector:".dropzone",style:{"border-color":e,"border-width":6,"border-opacity":1}},{selector:".collapser",style:{"background-color":i,"text-outline-color":i,"text-outline-width":0,"text-valign":"center",color:t,"border-width":0,"border-opacity":0,opacity:1}},{selector:".collapser-expanded",style:{opacity:.65}},{selector:".class",style:{"background-color":n,"text-outline-color":n,color:a}},{selector:".faded",style:{opacity:.12}},{selector:"node.focused",style:{"outline-color":l=>l.data("color")||e,"outline-width":"2px","outline-offset":"3px","outline-opacity":.5,"outline-style":"solid"}}]};class j{_requestId;_animationRunning=!1;constructor(e,t=!0,n=1e-4,a=.02){this._build(e,t,n,a)}stop(){void 0!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0,this._animationRunning=!1)}_build(e,t=!0,n=1e-4,a=.02){const i=()=>{this._animationRunning&&(e.nodes().forEach((s,o)=>{const l=s.position(),u=Math.sin(performance.now()*n+o)*a,c=Math.cos(performance.now()*n+o)*a;s.position({x:l.x+u,y:l.y+c})}),this._requestId=requestAnimationFrame(i))};this._animationRunning=!0,this._requestId=requestAnimationFrame(i),t&&e.on("mouseover","node",()=>{this.stop()})}}var xe=Y(6894),ne=Y.n(xe);function R(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function _(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ie(r,e,t){return e&&function ee(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,Me(n.key),n)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function H(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=se(r))||e){t&&(r=t);var n=0,a=function(){};return{s:a,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,o=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||null==t.return||t.return()}finally{if(o)throw i}}}}function ae(r,e,t){return(e=Me(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fe(r,e){return function S(r){if(Array.isArray(r))return r}(r)||function ve(r,e){var t=null==r?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,a,i,s,o=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(u)throw a}}return o}}(r,e)||se(r,e)||function Ee(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(r){return function L(r){if(Array.isArray(r))return R(r)}(r)||function me(r){if(typeof Symbol<"u"&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||se(r)||function Ge(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Me(r){var e=function ce(r,e){if("object"!=typeof r||!r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(r,"string");return"symbol"==typeof e?e:e+""}function pe(r){return(pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function se(r,e){if(r){if("string"==typeof r)return R(r,e);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?R(r,e):void 0}}var $i,Tl,Ki,Cl,Zi,Dl,Ji,Sl,Qi,Ll,es,Al,ts,Il,ns,Nl,as,Rl,is,Ml,ss,Pl,os,kl,ls,Bl,us,_l,Re=typeof window>"u"?null:window,Je=Re?Re.navigator:null,qe=pe(""),et=pe({}),ke=pe(function(){}),We=typeof HTMLElement>"u"?"undefined":pe(HTMLElement),we=function(e){return e&&e.instanceString&&Be(e.instanceString)?e.instanceString():null},oe=function(e){return null!=e&&pe(e)==qe},Be=function(e){return null!=e&&pe(e)===ke},Ye=function(e){return!vt(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},Oe=function(e){return null!=e&&pe(e)===et&&!Ye(e)&&e.constructor===Object},_e=function(e){return null!=e&&pe(e)===pe(1)&&!isNaN(e)},nt=function(e){if("undefined"!==We)return null!=e&&e instanceof HTMLElement},vt=function(e){return It(e)||$t(e)},It=function(e){return"collection"===we(e)&&e._private.single},$t=function(e){return"collection"===we(e)&&!e._private.single},xr=function(e){return"core"===we(e)},gn=function(e){return"stylesheet"===we(e)},Sr=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},Hf=function(e){return function(e){return null!=e&&pe(e)===et}(e)&&Be(e.then)},Mn=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var i=[],s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")});var n=function(){var o,s=arguments,l=t.apply(this,s),u=n.cache;return(o=u[l])||(o=u[l]=e.apply(this,s)),o};return n.cache={},n},qi=Mn(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Ua=Mn(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),yl=Mn(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),ml=function(e){return Sr(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Kr=function(e,t){return e.slice(-1*t.length)===t},Jt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Xf="rgb[a]?\\(("+Jt+"[%]?)\\s*,\\s*("+Jt+"[%]?)\\s*,\\s*("+Jt+"[%]?)(?:\\s*,\\s*("+Jt+"))?\\)",jf="rgb[a]?\\((?:"+Jt+"[%]?)\\s*,\\s*(?:"+Jt+"[%]?)\\s*,\\s*(?:"+Jt+"[%]?)(?:\\s*,\\s*(?:"+Jt+"))?\\)",Yf="hsl[a]?\\(("+Jt+")\\s*,\\s*("+Jt+"[%])\\s*,\\s*("+Jt+"[%])(?:\\s*,\\s*("+Jt+"))?\\)",Wf="hsl[a]?\\((?:"+Jt+")\\s*,\\s*(?:"+Jt+"[%])\\s*,\\s*(?:"+Jt+"[%])(?:\\s*,\\s*(?:"+Jt+"))?\\)",bl=function(e,t){return e<t?-1:e>t?1:0},mt=null!=Object.assign?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(null!=n)for(var a=Object.keys(n),i=0;i<a.length;i++){var s=a[i];r[s]=n[s]}}return r},wl=function(e){return(Ye(e)?e:null)||function(e){return th[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var n,a,i,s=16;return 4===e.length?(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]}}(e)||function(e){var t,n=new RegExp("^"+Xf+"$").exec(e);if(n){t=[];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;t.push(Math.floor(s))}if((a[1]||a[2]||a[3])&&!(a[1]&&a[2]&&a[3]))return;var u=n[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;t.push(u)}}return t}(e)||function(e){var t,n,a,i,s,o,l,u;function c(v,b,y){return y<0&&(y+=1),y>1&&(y-=1),y<1/6?v+6*(b-v)*y:y<.5?b:y<2/3?v+(b-v)*(2/3-y)*6:v}var d=new RegExp("^"+Yf+"$").exec(e);if(d){if((n=parseInt(d[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(a=parseFloat(d[2]))<0||a>100||(a/=100,(i=parseFloat(d[3]))<0||i>100)||(i/=100,void 0!==(s=d[4])&&((s=parseFloat(s))<0||s>1)))return;if(0===a)o=l=u=Math.round(255*i);else{var f=i<.5?i*(1+a):i+a-i*a,h=2*i-f;o=Math.round(255*c(h,f,n+1/3)),l=Math.round(255*c(h,f,n)),u=Math.round(255*c(h,f,n-1/3))}t=[o,l,u,s]}return t}(e)},th={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]},xl=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to set map with object key");i<n.length-1?(null==t[s]&&(t[s]={}),t=t[s]):t[s]=e.value}},El=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var s=n[i];if(Oe(s))throw Error("Tried to get map with object key");if(null==(t=t[s]))return t}return t},Xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oa(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function la(){return Tl?$i:(Tl=1,$i=function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)})}function ja(){if(Dl)return Zi;Dl=1;var r=function rh(){return Cl?Ki:(Cl=1,Ki="object"==typeof Xa&&Xa&&Xa.Object===Object&&Xa)}(),e="object"==typeof self&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Zi=t}function rs(){if(Il)return ts;Il=1;var r=ja();return ts=r.Symbol}function Ol(){if(Ml)return is;Ml=1;var r=rs(),e=function sh(){if(Nl)return ns;Nl=1;var r=rs(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;return ns=function i(s){var o=t.call(s,a),l=s[a];try{s[a]=void 0;var u=!0}catch{}var c=n.call(s);return u&&(o?s[a]=l:delete s[a]),c}}(),t=function oh(){if(Rl)return as;Rl=1;var e=Object.prototype.toString;return as=function t(n){return e.call(n)}}(),i=r?r.toStringTag:void 0;return is=function s(o){return null==o?void 0===o?"[object Undefined]":"[object Null]":i&&i in Object(o)?e(o):t(o)}}function ua(){if(kl)return os;kl=1;var r=Ol(),e=function lh(){return Pl?ss:(Pl=1,ss=function r(e){return null!=e&&"object"==typeof e})}();return os=function n(a){return"symbol"==typeof a||e(a)&&"[object Symbol]"==r(a)}}var dh=function ch(){if(_l)return us;_l=1;var r=la(),e=function nh(){if(Sl)return Ji;Sl=1;var r=ja();return Ji=function(){return r.Date.now()}}(),t=function uh(){if(Bl)return ls;Bl=1;var r=function ih(){if(Al)return es;Al=1;var r=function ah(){if(Ll)return Qi;Ll=1;var r=/\s/;return Qi=function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}}(),e=/^\s+/;return es=function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}}(),e=la(),t=ua(),a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;return ls=function l(u){if("number"==typeof u)return u;if(t(u))return NaN;if(e(u)){var c="function"==typeof u.valueOf?u.valueOf():u;u=e(c)?c+"":c}if("string"!=typeof u)return 0===u?u:+u;u=r(u);var d=i.test(u);return d||s.test(u)?o(u.slice(2),d?2:8):a.test(u)?NaN:+u}}(),a=Math.max,i=Math.min;return us=function s(o,l,u){var c,d,f,h,v,b,y=0,g=!1,w=!1,C=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function N(Q){var le=c,de=d;return c=d=void 0,y=Q,h=o.apply(de,le)}function F(Q){var le=Q-b;return void 0===b||le>=l||le<0||w&&Q-y>=f}function U(){var Q=e();if(F(Q))return q(Q);v=setTimeout(U,function V(Q){var he=l-(Q-b);return w?i(he,f-(Q-y)):he}(Q))}function q(Q){return v=void 0,C&&c?N(Q):(c=d=void 0,h)}function J(){var Q=e(),le=F(Q);if(c=arguments,d=this,b=Q,le){if(void 0===v)return function z(Q){return y=Q,v=setTimeout(U,l),g?N(Q):h}(b);if(w)return clearTimeout(v),v=setTimeout(U,l),N(b)}return void 0===v&&(v=setTimeout(U,l)),h}return l=t(l)||0,r(u)&&(g=!!u.leading,f=(w="maxWait"in u)?a(t(u.maxWait)||0,l):f,C="trailing"in u?!!u.trailing:C),J.cancel=function Z(){void 0!==v&&clearTimeout(v),y=0,c=b=d=v=void 0},J.flush=function K(){return void 0===v?h:q(e())},J},us}(),ca=oa(dh),cs=Re?Re.performance:null,Fl=cs&&cs.now?function(){return cs.now()}:function(){return Date.now()},fh=function(){if(Re){if(Re.requestAnimationFrame)return function(r){Re.requestAnimationFrame(r)};if(Re.mozRequestAnimationFrame)return function(r){Re.mozRequestAnimationFrame(r)};if(Re.webkitRequestAnimationFrame)return function(r){Re.webkitRequestAnimationFrame(r)};if(Re.msRequestAnimationFrame)return function(r){Re.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(Fl())},1e3/60)}}(),Ya=function(e){return fh(e)},Ur=Fl,pn=9261,On=5381,zl=function(e){for(var a,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn;!(a=e.next()).done;)n=65599*n+a.value|0;return n},da=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:pn)+e|0},fa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:On;return(t<<5)+t+e|0},Zr=function(e){return 2097152*e[0]+e[1]},Wa=function(e,t){return[da(e[0],t[0]),fa(e[1],t[1])]},Vl=function(e,t){var n={value:0,done:!1},a=0,i=e.length;return zl({next:function(){return a<i?n.value=e[a++]:n.done=!0,n}},t)},yn=function(e,t){var n={value:0,done:!1},a=0,i=e.length;return zl({next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}},t)},Hl=function(){return vh(arguments)},vh=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];t=0===n?yn(a):yn(a,t)}return t};var Ul=!0,mh=null!=console.warn,bh=null!=console.trace,ds=Number.MAX_SAFE_INTEGER||9007199254740991,Xl=function(){return!0},qa=function(){return!1},jl=function(){return 0},fs=function(){},Xt=function(e){throw new Error(e)},Yl=function(e){if(void 0===e)return Ul;Ul=!!e},_t=function(e){Yl()&&(mh?console.warn(e):(console.log(e),bh&&console.trace()))},Pr=function(e){return null==e?e:Ye(e)?e.slice():Oe(e)?function(e){return mt({},e)}(e):e},Wl=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},Eh={},ql=function(){return Eh},ir=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var s=t[i],o=n?.[s];a[s]=void 0===o?e[s]:o}return a}},Jr=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},hs=function(e){e.splice(0,e.length)},vr=function(e,t,n){return n&&(t=yl(n,t)),e[t]},kr=function(e,t,n,a){n&&(t=yl(n,t)),e[t]=a},Xr=typeof Map<"u"?Map:function(){return ie(function r(){_(this,r),this._obj={}},[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return void 0!==this._obj[t]}},{key:"get",value:function(t){return this._obj[t]}}])}(),Sh=function(){return ie(function r(e){if(_(this,r),this._obj=Object.create(null),this.size=0,null!=e){var t;t=null!=e.instanceString&&e.instanceString()===this.instanceString()?e.toArray():e;for(var n=0;n<t.length;n++)this.add(t[n])}},[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;1!==n[t]&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;1===n[t]&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return 1===this._obj[t]}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])}(),Pn="undefined"!==(typeof Set>"u"?"undefined":pe(Set))?Set:Sh,$a=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&xr(e)){var a=t.group;if(null==a&&(a=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===a||"edges"===a){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:a,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===a:!!t.pannable,active:!1,classes:new Pn,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var s=t.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Ye(t.classes)?u=t.classes:oe(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var f=u[c];!f||""===f||i.classes.add(f)}this.createEmitter(),(void 0===n||n)&&this.restore();var h=t.style||t.css;h&&(_t("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(h))}else Xt("An element must be of type `nodes` or `edges`; you specified `"+a+"`")}else Xt("An element must have a core reference and parameters set")},$l=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var s;Oe(n)&&!vt(n)&&(n=(s=n).roots||s.root,a=s.visit,i=s.directed),i=2!==arguments.length||Be(a)?i:a,a=Be(a)?a:function(){};for(var b,o=this._private.cy,l=n=oe(n)?this.filter(n):n,u=[],c=[],d={},f={},h={},v=0,y=this.byGroup(),g=y.nodes,w=y.edges,C=0;C<l.length;C++){var N=l[C],z=N.id();N.isNode()&&(u.unshift(N),e.bfs&&(h[z]=!0,c.push(N)),f[z]=0)}for(var F,V=function(){var Q=e.bfs?u.shift():u.pop(),le=Q.id();if(e.dfs){if(h[le])return 0;h[le]=!0,c.push(Q)}var Le,de=f[le],he=d[le],ue=null!=he?he.source():null,ge=null!=he?he.target():null,Se=null==he?void 0:Q.same(ue)?ge[0]:ue[0];if(!0===(Le=a(Q,he,Se,v++,de)))return b=Q,1;if(!1===Le)return 1;for(var ye=Q.connectedEdges().filter(function(Qe){return(!i||Qe.source().same(Q))&&w.has(Qe)}),De=0;De<ye.length;De++){var Ue=ye[De],$e=Ue.connectedNodes().filter(function(Qe){return!Qe.same(Q)&&g.has(Qe)}),Xe=$e.id();0!==$e.length&&!h[Xe]&&(u.push($e=$e[0]),e.bfs&&(h[Xe]=!0,c.push($e)),d[Xe]=Ue,f[Xe]=f[le]+1)}};0!==u.length&&(0===(F=V())||1!==F););for(var U=o.collection(),q=0;q<c.length;q++){var Z=c[q],K=d[Z.id()];null!=K&&U.push(K),U.push(Z)}return{path:o.collection(U),found:o.collection(b)}}},ha={breadthFirstSearch:$l({bfs:!0}),depthFirstSearch:$l({dfs:!0})};ha.bfs=ha.breadthFirstSearch,ha.dfs=ha.depthFirstSearch;var Kl,vs,Zl,Ka={exports:{}},Lh=Ka.exports;var ps,va=oa(function Ih(){return Zl||(Zl=1,vs=function Ah(){return Kl||(Kl=1,r=Ka,function(){var t,n,a,i,s,o,l,u,c,d,f,h,v,b,y;a=Math.floor,d=Math.min,n=function(g,w){return g<w?-1:g>w?1:0},c=function(g,w,C,N,z){var V;if(null==C&&(C=0),null==z&&(z=n),C<0)throw new Error("lo must be non-negative");for(null==N&&(N=g.length);C<N;)z(w,g[V=a((C+N)/2)])<0?N=V:C=V+1;return[].splice.apply(g,[C,C-C].concat(w)),w},o=function(g,w,C){return null==C&&(C=n),g.push(w),b(g,0,g.length-1,C)},s=function(g,w){var C,N;return null==w&&(w=n),C=g.pop(),g.length?(N=g[0],g[0]=C,y(g,0,w)):N=C,N},u=function(g,w,C){var N;return null==C&&(C=n),N=g[0],g[0]=w,y(g,0,C),N},l=function(g,w,C){var N;return null==C&&(C=n),g.length&&C(g[0],w)<0&&(w=(N=[g[0],w])[0],g[0]=N[1],y(g,0,C)),w},i=function(g,w){var N,z,V,F,U;for(null==w&&(w=n),F=[],N=0,z=(V=function(){U=[];for(var q=0,Z=a(g.length/2);0<=Z?q<Z:q>Z;0<=Z?q++:q--)U.push(q);return U}.apply(this).reverse()).length;N<z;N++)F.push(y(g,V[N],w));return F},v=function(g,w,C){var N;if(null==C&&(C=n),-1!==(N=g.indexOf(w)))return b(g,0,N,C),y(g,N,C)},f=function(g,w,C){var z,V,F,U;if(null==C&&(C=n),!(z=g.slice(0,w)).length)return z;for(i(z,C),V=0,F=(U=g.slice(w)).length;V<F;V++)l(z,U[V],C);return z.sort(C).reverse()},h=function(g,w,C){var N,z,V,F,U,q,Z,K,J;if(null==C&&(C=n),10*w<=g.length){if(!(V=g.slice(0,w).sort(C)).length)return V;for(z=V[V.length-1],F=0,q=(Z=g.slice(w)).length;F<q;F++)C(N=Z[F],z)<0&&(c(V,N,0,null,C),V.pop(),z=V[V.length-1]);return V}for(i(g,C),J=[],U=0,K=d(w,g.length);0<=K?U<K:U>K;0<=K?++U:--U)J.push(s(g,C));return J},b=function(g,w,C,N){var z,V,F;for(null==N&&(N=n),z=g[C];C>w&&N(z,V=g[F=C-1>>1])<0;)g[C]=V,C=F;return g[C]=z},y=function(g,w,C){var N,z,V,F,U;for(null==C&&(C=n),z=g.length,U=w,V=g[w],N=2*w+1;N<z;)(F=N+1)<z&&!(C(g[N],g[F])<0)&&(N=F),g[w]=g[N],N=2*(w=N)+1;return g[w]=V,b(g,U,w,C)},t=function(){function g(w){this.cmp=w??n,this.nodes=[]}return g.push=o,g.pop=s,g.replace=u,g.pushpop=l,g.heapify=i,g.updateItem=v,g.nlargest=f,g.nsmallest=h,g.prototype.push=function(w){return o(this.nodes,w,this.cmp)},g.prototype.pop=function(){return s(this.nodes,this.cmp)},g.prototype.peek=function(){return this.nodes[0]},g.prototype.contains=function(w){return-1!==this.nodes.indexOf(w)},g.prototype.replace=function(w){return u(this.nodes,w,this.cmp)},g.prototype.pushpop=function(w){return l(this.nodes,w,this.cmp)},g.prototype.heapify=function(){return i(this.nodes,this.cmp)},g.prototype.updateItem=function(w){return v(this.nodes,w,this.cmp)},g.prototype.clear=function(){return this.nodes=[]},g.prototype.empty=function(){return 0===this.nodes.length},g.prototype.size=function(){return this.nodes.length},g.prototype.clone=function(){var w;return(w=new g).nodes=this.nodes.slice(0),w},g.prototype.toArray=function(){return this.nodes.slice(0)},g.prototype.insert=g.prototype.push,g.prototype.top=g.prototype.peek,g.prototype.front=g.prototype.peek,g.prototype.has=g.prototype.contains,g.prototype.copy=g.prototype.clone,g}(),r.exports=t}.call(Lh)),Ka.exports;var r}()),vs}()),Rh=ir({root:null,weight:function(e){return 1},directed:!1}),Mh={dijkstra:function(e){if(!Oe(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=Rh(e),a=n.root,s=n.directed,o=this,l=n.weight,u=oe(a)?this.filter(a)[0]:a[0],c={},d={},f={},h=this.byGroup(),v=h.nodes,b=h.edges;b.unmergeBy(function(de){return de.isLoop()});for(var y=function(he){return c[he.id()]},g=function(he,ue){c[he.id()]=ue,w.updateItem(he)},w=new va(function(de,he){return y(de)-y(he)}),C=0;C<v.length;C++){var N=v[C];c[N.id()]=N.same(u)?0:1/0,w.push(N)}for(var z=function(he,ue){for(var Le,ge=(s?he.edgesTo(ue):he.edgesWith(ue)).intersect(b),Se=1/0,ye=0;ye<ge.length;ye++){var De=ge[ye],Ue=l(De);(Ue<Se||!Le)&&(Se=Ue,Le=De)}return{edge:Le,dist:Se}};w.size()>0;){var V=w.pop(),F=y(V),U=V.id();if(f[U]=F,F!==1/0)for(var q=V.neighborhood().intersect(v),Z=0;Z<q.length;Z++){var K=q[Z],J=K.id(),Q=z(V,K),le=F+Q.dist;le<y(K)&&(g(K,le),d[J]={node:V,edge:Q.edge})}}return{distanceTo:function(he){var ue=oe(he)?v.filter(he)[0]:he[0];return f[ue.id()]},pathTo:function(he){var ue=oe(he)?v.filter(he)[0]:he[0],ge=[],Se=ue,Le=Se.id();if(ue.length>0)for(ge.unshift(ue);d[Le];){var ye=d[Le];ge.unshift(ye.edge),ge.unshift(ye.node),Le=(Se=ye.node).id()}return o.spawn(ge)}}}},Oh={kruskal:function(e){e=e||function(C){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,s=new Array(i),o=n,l=function(N){for(var z=0;z<s.length;z++)if(s[z].has(N))return z},u=0;u<i;u++)s[u]=this.spawn(n[u]);for(var c=a.sort(function(C,N){return e(C)-e(N)}),d=0;d<c.length;d++){var f=c[d],h=f.source()[0],v=f.target()[0],b=l(h),y=l(v),g=s[b],w=s[y];b!==y&&(o.merge(f),g.merge(w),s.splice(y,1))}return o}},Ph=ir({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),kh={aStar:function(e){var t=this.cy(),n=Ph(e),a=n.root,i=n.goal,s=n.heuristic,o=n.directed,l=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var C,N,u=a.id(),c=i.id(),d={},f={},h={},v=new va(function(Le,ye){return f[Le.id()]-f[ye.id()]}),b=new Pn,y={},g={},w=function(ye,De){v.push(ye),b.add(De)},z=function(){C=v.pop(),N=C.id(),b.delete(N)},V=function(ye){return b.has(ye)};w(a,u),d[u]=0,f[u]=s(a);for(var F=0;v.size()>0;){if(z(),F++,N===c){for(var U=[],q=i,Z=c,K=g[Z];U.unshift(q),null!=K&&U.unshift(K),null!=(q=y[Z]);)K=g[Z=q.id()];return{found:!0,distance:d[N],path:this.spawn(U),steps:F}}h[N]=!0;for(var J=C._private.edges,Q=0;Q<J.length;Q++){var le=J[Q];if(this.hasElementWithId(le.id())&&(!o||le.data("source")===N)){var de=le.source(),he=le.target(),ue=de.id()!==N?de:he,ge=ue.id();if(this.hasElementWithId(ge)&&!h[ge]){var Se=d[N]+l(le);if(!V(ge)){d[ge]=Se,f[ge]=Se+s(ue),w(ue,ge),y[ge]=C,g[ge]=le;continue}Se<d[ge]&&(d[ge]=Se,f[ge]=Se+s(ue),y[ge]=C,g[ge]=le)}}}}return{found:!1,distance:void 0,path:void 0,steps:F}}},Bh=ir({weight:function(e){return 1},directed:!1}),_h={floydWarshall:function(e){for(var t=this.cy(),n=Bh(e),i=n.directed,s=n.weight,o=this.byGroup(),l=o.nodes,u=o.edges,c=l.length,d=c*c,f=function(Ue){return l.indexOf(Ue)},h=function(Ue){return l[Ue]},v=new Array(d),b=0;b<d;b++){var y=b%c;v[b]=(b-y)/c===y?0:1/0}for(var w=new Array(d),C=new Array(d),N=0;N<u.length;N++){var z=u[N],V=z.source()[0],F=z.target()[0];if(V!==F){var U=f(V),q=f(F),Z=U*c+q,K=s(z);if(v[Z]>K&&(v[Z]=K,w[Z]=q,C[Z]=z),!i){var J=q*c+U;!i&&v[J]>K&&(v[J]=K,w[J]=U,C[J]=z)}}}for(var Q=0;Q<c;Q++)for(var le=0;le<c;le++)for(var de=le*c+Q,he=0;he<c;he++){var ue=le*c+he,ge=Q*c+he;v[de]+v[ge]<v[ue]&&(v[ue]=v[de]+v[ge],w[ue]=w[de])}var Le=function(Ue){return f(function(Ue){return(oe(Ue)?t.filter(Ue):Ue)[0]}(Ue))};return{distance:function(Ue,$e){var Xe=Le(Ue),Qe=Le($e);return v[Xe*c+Qe]},path:function(Ue,$e){var Xe=Le(Ue),Qe=Le($e),tt=h(Xe);if(Xe===Qe)return tt.collection();if(null==w[Xe*c+Qe])return t.collection();var at=t.collection();for(at.merge(tt);Xe!==Qe;)at.merge(C[Xe*c+(Xe=w[Xe*c+Qe])]),at.merge(h(Xe));return at}}}},Fh=ir({weight:function(e){return 1},directed:!1,root:null}),Gh={bellmanFord:function(e){var t=this,n=Fh(e),i=n.directed,s=n.root,o=n.weight,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,f=c.nodes,h=f.length,v=new Xr,b=!1,y=[];s=u.collection(s)[0],d.unmergeBy(function(Et){return Et.isLoop()});for(var g=d.length,w=function(bt){var pt=v.get(bt.id());return pt||(pt={},v.set(bt.id(),pt)),pt},C=function(bt){return(oe(bt)?u.$(bt):bt)[0]},V=0;V<h;V++){var F=f[V],U=w(F);U.dist=F.same(s)?0:1/0,U.pred=null,U.edge=null}for(var q=!1,Z=function(bt,pt,ot,gt,ht,Tt){var wt=gt.dist+Tt;wt<ht.dist&&!ot.same(gt.edge)&&(ht.dist=wt,ht.pred=bt,ht.edge=ot,q=!0)},K=1;K<h;K++){q=!1;for(var J=0;J<g;J++){var Q=d[J],le=Q.source(),de=Q.target(),he=o(Q),ue=w(le),ge=w(de);Z(le,0,Q,ue,ge,he),i||Z(de,0,Q,ge,ue,he)}if(!q)break}if(q)for(var Se=[],Le=0;Le<g;Le++){var ye=d[Le],De=ye.source(),Ue=ye.target(),$e=o(ye),Xe=w(De).dist,Qe=w(Ue).dist;if(Xe+$e<Qe||!i&&Qe+$e<Xe){if(b||(_t("Graph contains a negative weight cycle for Bellman-Ford"),b=!0),!1===e.findNegativeWeightCycles)break;var tt=[];Xe+$e<Qe&&tt.push(De),!i&&Qe+$e<Xe&&tt.push(Ue);for(var at=tt.length,He=0;He<at;He++){var Te=tt[He],Ie=[Te];Ie.push(w(Te).edge);for(var Pe=w(Te).pred;-1===Ie.indexOf(Pe);)Ie.push(Pe),Ie.push(w(Pe).edge),Pe=w(Pe).pred;for(var ze=(Ie=Ie.slice(Ie.indexOf(Pe)))[0].id(),rt=0,ct=2;ct<Ie.length;ct+=2)Ie[ct].id()<ze&&(ze=Ie[ct].id(),rt=ct);(Ie=Ie.slice(rt).concat(Ie.slice(0,rt))).push(Ie[0]);var Nt=Ie.map(function(Et){return Et.id()}).join(",");-1===Se.indexOf(Nt)&&(y.push(l.spawn(Ie)),Se.push(Nt))}}}return{distanceTo:function(bt){return w(C(bt)).dist},pathTo:function(bt){for(var pt=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,gt=[],ht=C(bt);;){if(null==ht)return t.spawn();var Tt=w(ht),wt=Tt.edge,Lt=Tt.pred;if(gt.unshift(ht[0]),ht.same(pt)&>.length>0)break;null!=wt&>.unshift(wt),ht=Lt}return l.spawn(gt)},hasNegativeWeightCycle:b,negativeWeightCycles:y}}},zh=Math.sqrt(2),Vh=function(e,t,n){0===n.length&&Xt("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],o=t[a[1]],l=t[a[2]],u=n,c=u.length-1;c>=0;c--){var d=u[c],f=d[1],h=d[2];(t[f]===o&&t[h]===l||t[f]===l&&t[h]===o)&&u.splice(c,1)}for(var v=0;v<u.length;v++){var b=u[v];b[1]===l?(u[v]=b.slice(),u[v][1]=o):b[2]===l&&(u[v]=b.slice(),u[v][2]=o)}for(var y=0;y<t.length;y++)t[y]===l&&(t[y]=o);return u},gs=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=Vh(i,e,t),n--}return t},Hh={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function(ge){return ge.isLoop()});var i=n.length,s=a.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/zh);if(!(i<2)){for(var u=[],c=0;c<s;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var f=1/0,h=[],v=new Array(i),b=new Array(i),y=new Array(i),g=function(Se,Le){for(var ye=0;ye<i;ye++)Le[ye]=Se[ye]},w=0;w<=o;w++){for(var C=0;C<i;C++)b[C]=C;var N=gs(b,u.slice(),i,l),z=N.slice();g(b,y);var V=gs(b,N,l,2),F=gs(y,z,l,2);V.length<=F.length&&V.length<f?(f=V.length,h=V,g(b,v)):F.length<=V.length&&F.length<f&&(f=F.length,h=F,g(y,v))}for(var U=this.spawn(h.map(function(ge){return a[ge[0]]})),q=this.spawn(),Z=this.spawn(),K=v[0],J=0;J<v.length;J++){var le=n[J];v[J]===K?q.merge(le):Z.merge(le)}var de=function(Se){var Le=e.spawn();return Se.forEach(function(ye){Le.merge(ye),ye.connectedEdges().forEach(function(De){e.contains(De)&&!U.contains(De)&&Le.merge(De)})}),Le},he=[de(q),de(Z)];return{cut:U,components:he,partition1:q,partition2:Z}}Xt("At least 2 nodes are required for Karger-Stein algorithm")}},Za=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},Jl=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},kn=function(e){return{x:e[0],y:e[1]}},Ja=function(e,t){return Math.atan2(t,e)-Math.PI/2},ys=Math.log2||function(r){return Math.log(r)/Math.log(2)},ms=function(e){return e>0?1:e<0?-1:0},mn=function(e,t){return Math.sqrt(bn(e,t))},bn=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},$h=function(e){for(var t=e.length,n=0,a=0;a<t;a++)n+=e[a];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},tr=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},Bn=function(e,t,n,a){return{x:tr(e.x,t.x,n.x,a),y:tr(e.y,t.y,n.y,a)}},ga=function(e,t,n){return Math.max(e,Math.min(n,t))},gr=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Qh=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Ql=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Qa=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ei=function(e){var n,a,i,s,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===t.length)n=a=i=s=t[0];else if(2===t.length)n=i=t[0],s=a=t[1];else if(4===t.length){var o=fe(t,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},eu=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},bs=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Qr=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},tu=function(e,t){return Qr(e,t.x,t.y)},ru=function(e,t){return Qr(e,t.x1,t.y1)&&Qr(e,t.x2,t.y2)},ev=null!==(ps=Math.hypot)&&void 0!==ps?ps:function(r,e){return Math.sqrt(r*r+e*e)};var nu=function(e,t,n,a,i,s,o){var v,de,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",u="auto"===l?tn(i,s):l,c=i/2,d=s/2,f=(u=Math.min(u,c,d))!==c,h=u!==d;if(f){var y=a-d-o;if((v=en(e,t,n,a,n-c+u-o,y,n+c-u+o,y,!1)).length>0)return v}if(h){var C=n+c+o;if((v=en(e,t,n,a,C,a-d+u-o,C,a+d-u+o,!1)).length>0)return v}if(f){var U=a+d+o;if((v=en(e,t,n,a,n-c+u-o,U,n+c-u+o,U,!1)).length>0)return v}if(h){var K=n-c-o;if((v=en(e,t,n,a,K,a-d+u-o,K,a+d-u+o,!1)).length>0)return v}var he=n-c+u,ue=a-d+u;if((de=pa(e,t,n,a,he,ue,u+o)).length>0&&de[0]<=he&&de[1]<=ue)return[de[0],de[1]];var ge=n+c-u,Se=a-d+u;if((de=pa(e,t,n,a,ge,Se,u+o)).length>0&&de[0]>=ge&&de[1]<=Se)return[de[0],de[1]];var Le=n+c-u,ye=a+d-u;if((de=pa(e,t,n,a,Le,ye,u+o)).length>0&&de[0]>=Le&&de[1]>=ye)return[de[0],de[1]];var De=n-c+u,Ue=a+d-u;return(de=pa(e,t,n,a,De,Ue,u+o)).length>0&&de[0]<=De&&de[1]>=Ue?[de[0],de[1]]:[]},nv=function(e,t,n,a,i,s,o){var l=o,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,s),f=Math.max(a,s);return u-l<=e&&e<=c+l&&d-l<=t&&t<=f+l},av=function(e,t,n,a,i,s,o,l,u){var c_x1=Math.min(n,o,i)-u,c_x2=Math.max(n,o,i)+u,c_y1=Math.min(a,l,s)-u,c_y2=Math.max(a,l,s)+u;return!(e<c_x1||e>c_x2||t<c_y1||t>c_y2)},ov=function(e,t,n,a,i,s,o,l){var h=[];!function(e,t,n,a,i){var o,l,u,c,d,f,h,v;0===e&&(e=1e-5),u=-27*(a/=e)+(t/=e)*(9*(n/=e)-t*t*2),o=(l=(3*n-t*t)/9)*l*l+(u/=54)*u,i[1]=0,h=t/3,o>0?(d=(d=u+Math.sqrt(o))<0?-Math.pow(-d,1/3):Math.pow(d,1/3),f=(f=u-Math.sqrt(o))<0?-Math.pow(-f,1/3):Math.pow(f,1/3),i[0]=-h+d+f,i[4]=i[2]=-(h+=(d+f)/2),h=Math.sqrt(3)*(-f+d)/2,i[3]=h,i[5]=-h):(i[5]=i[3]=0,0===o?(v=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=2*v-h,i[4]=i[2]=-(v+h)):(c=(l=-l)*l*l,c=Math.acos(u/Math.sqrt(c)),v=2*Math.sqrt(l),i[0]=-h+v*Math.cos(c/3),i[2]=-h+v*Math.cos((c+2*Math.PI)/3),i[4]=-h+v*Math.cos((c+4*Math.PI)/3)))}(1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+a*a-4*a*s+2*a*l+4*s*s-4*s*l+l*l,9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*a*s-3*a*a-3*a*l-6*s*s+3*s*l,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*l-a*t+2*s*s+2*s*t-l*t,1*n*i-n*n+n*e-i*e+a*s-a*a+a*t-s*t,h);for(var b=[],y=0;y<6;y+=2)Math.abs(h[y+1])<1e-7&&h[y]>=0&&h[y]<=1&&b.push(h[y]);b.push(1),b.push(0);for(var w,C,N,g=-1,z=0;z<b.length;z++)w=Math.pow(1-b[z],2)*n+2*(1-b[z])*b[z]*i+b[z]*b[z]*o,C=Math.pow(1-b[z],2)*a+2*(1-b[z])*b[z]*s+b[z]*b[z]*l,N=Math.pow(w-e,2)+Math.pow(C-t,2),g>=0?N<g&&(g=N):g=N;return g},lv=function(e,t,n,a,i,s){var o=[e-n,t-a],l=[i-n,s-a],u=l[0]*l[0]+l[1]*l[1],c=o[0]*o[0]+o[1]*o[1],d=o[0]*l[0]+o[1]*l[1],f=d*d/u;return d<0?c:f>u?(e-i)*(e-i)+(t-s)*(t-s):c-f},mr=function(e,t,n){for(var a,i,s,o,u=0,c=0;c<n.length/2;c++)if(i=n[2*c+1],c+1<n.length/2?(s=n[2*(c+1)],o=n[2*(c+1)+1]):(s=n[2*(c+1-n.length/2)],o=n[2*(c+1-n.length/2)+1]),(a=n[2*c])!=e||s!=e){if(!(a>=e&&e>=s||a<=e&&e<=s))continue;(e-a)/(s-a)*(o-i)+i>t&&u++}return u%2!=0},jr=function(e,t,n,a,i,s,o,l,u){var d,b,c=new Array(n.length);null!=l[0]?(d=Math.atan(l[1]/l[0]),l[0]<0?d+=Math.PI/2:d=-d-Math.PI/2):d=l;for(var f=Math.cos(-d),h=Math.sin(-d),v=0;v<c.length/2;v++)c[2*v]=s/2*(n[2*v]*f-n[2*v+1]*h),c[2*v+1]=o/2*(n[2*v+1]*f+n[2*v]*h),c[2*v]+=a,c[2*v+1]+=i;if(u>0){var y=ri(c,-u);b=ti(y)}else b=c;return mr(e,t,b)},ti=function(e){for(var o,l,u,c,t=new Array(e.length/2),d=0;d<e.length/4;d++){d<e.length/4-1?(o=e[4*(d+1)],l=e[4*(d+1)+1],u=e[4*(d+1)+2],c=e[4*(d+1)+3]):(o=e[0],l=e[1],u=e[2],c=e[3]);var f=en(e[4*d],e[4*d+1],e[4*d+2],e[4*d+3],o,l,u,c,!0);t[2*d]=f[0],t[2*d+1]=f[1]}return t},ri=function(e,t){for(var a,i,s,o,n=new Array(2*e.length),l=0;l<e.length/2;l++){l<e.length/2-1?(s=e[2*(l+1)],o=e[2*(l+1)+1]):(s=e[0],o=e[1]);var u=o-(i=e[2*l+1]),c=-(s-(a=e[2*l])),d=Math.sqrt(u*u+c*c),f=u/d,h=c/d;n[4*l]=a+f*t,n[4*l+1]=i+h*t,n[4*l+2]=s+f*t,n[4*l+3]=o+h*t}return n},wn=function(e,t,n,a,i,s,o){return e-=i,t-=s,(e/=n/2+o)*e+(t/=a/2+o)*t<=1},pa=function(e,t,n,a,i,s,o){var l=[n-e,a-t],u=[e-i,t-s],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),h=d*d-4*c*(u[0]*u[0]+u[1]*u[1]-o*o);if(h<0)return[];var v=(-d+Math.sqrt(h))/(2*c),b=(-d-Math.sqrt(h))/(2*c),y=Math.min(v,b),g=Math.max(v,b),w=[];if(y>=0&&y<=1&&w.push(y),g>=0&&g<=1&&w.push(g),0===w.length)return[];var C=w[0]*l[0]+e,N=w[0]*l[1]+t;return w.length>1?w[0]==w[1]?[C,N]:[C,N,w[1]*l[0]+e,w[1]*l[1]+t]:[C,N]},ws=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,a,i,s,o,l,u){var c=e-i,d=n-e,f=o-i,h=t-s,v=a-t,b=l-s,y=f*h-b*c,g=d*h-v*c,w=b*d-f*v;if(0!==w){var C=y/w,N=g/w,V=-.001;return V<=C&&C<=1.001&&V<=N&&N<=1.001||u?[e+C*d,t+C*v]:[]}return 0===y||0===g?ws(e,n,o)===o?[o,l]:ws(e,n,i)===i?[i,s]:ws(i,o,n)===n?[n,a]:[]:[]},dv=function(e,t,n,a,i){var s=[],o=a/2,l=i/2,u=t,c=n;s.push({x:u+o*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)s.push({x:u+o*e[2*d],y:c+l*e[2*d+1]});return s},ya=function(e,t,n,a,i,s,o,l){var c,h,u=[],d=new Array(n.length),f=!0;if(null==s&&(f=!1),f){for(var v=0;v<d.length/2;v++)d[2*v]=n[2*v]*s+a,d[2*v+1]=n[2*v+1]*o+i;if(l>0){var b=ri(d,-l);h=ti(b)}else h=d}else h=n;for(var w,C,N=0;N<h.length/2;N++)N<h.length/2-1?(w=h[2*(N+1)],C=h[2*(N+1)+1]):(w=h[0],C=h[1]),0!==(c=en(e,t,a,i,h[2*N],h[2*N+1],w,C)).length&&u.push(c[0],c[1]);return u},ni=function(e,t,n){var a=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(a[0]*a[0]+a[1]*a[1]),s=(i-n)/i;return s<0&&(s=1e-5),[t[0]+s*a[0],t[1]+s*a[1]]},pr=function(e,t){var n=xs(e,t);return au(n)},au=function(e){for(var t,n,a=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0,u=0;u<a;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,n),l=Math.max(l,n);for(var c=2/(o-i),d=2/(l-s),f=0;f<a;f++)t=e[2*f]=e[2*f]*c,n=e[2*f+1]=e[2*f+1]*d,i=Math.min(i,t),o=Math.max(o,t),s=Math.min(s,n),l=Math.max(l,n);if(s<-1)for(var h=0;h<a;h++)n=e[2*h+1]=e[2*h+1]+(-1-s);return e},xs=function(e,t){var n=1/e*2*Math.PI,a=e%2==0?Math.PI/2+n/2:Math.PI/2;a+=t;for(var s,i=new Array(2*e),o=0;o<e;o++)s=o*n+a,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},tn=function(e,t){return Math.min(e/4,t/4,8)},iu=function(e,t){return Math.min(e/10,t/10,8)},Ts=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Cs(r,e){function t(d){for(var f=[],h=0;h<d.length;h++){var v=d[h],b=d[(h+1)%d.length],y={x:b.x-v.x,y:b.y-v.y},g={x:-y.y,y:y.x},w=Math.sqrt(g.x*g.x+g.y*g.y);f.push({x:g.x/w,y:g.y/w})}return f}function n(d,f){var y,h=1/0,v=-1/0,b=H(d);try{for(b.s();!(y=b.n()).done;){var g=y.value,w=g.x*f.x+g.y*f.y;h=Math.min(h,w),v=Math.max(v,w)}}catch(C){b.e(C)}finally{b.f()}return{min:h,max:v}}function a(d,f){return!(d.max<f.min||f.max<d.min)}var o,s=H([].concat(te(t(r)),te(t(e))));try{for(s.s();!(o=s.n()).done;){var l=o.value;if(!a(n(r,l),n(e,l)))return!1}}catch(d){s.e(d)}finally{s.f()}return!0}var vv=ir({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),gv={pageRank:function(e){for(var t=vv(e),n=t.dampingFactor,a=t.precision,i=t.iterations,s=t.weight,o=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,h=c.length,v=new Array(d*d),b=new Array(d),y=(1-n)/d,g=0;g<d;g++){for(var w=0;w<d;w++)v[g*d+w]=0;b[g]=0}for(var N=0;N<h;N++){var z=c[N],V=z.data("source"),F=z.data("target");if(V!==F){var U=u.indexOfId(V),q=u.indexOfId(F),Z=s(z);v[q*d+U]+=Z,b[U]+=Z}}for(var J=1/d+y,Q=0;Q<d;Q++)if(0===b[Q])for(var le=0;le<d;le++)v[le*d+Q]=J;else for(var he=0;he<d;he++){var ue=he*d+Q;v[ue]=v[ue]/b[Q]+y}for(var Le,ge=new Array(d),Se=new Array(d),ye=0;ye<d;ye++)ge[ye]=1;for(var De=0;De<i;De++){for(var Ue=0;Ue<d;Ue++)Se[Ue]=0;for(var $e=0;$e<d;$e++)for(var Xe=0;Xe<d;Xe++)Se[$e]+=v[$e*d+Xe]*ge[Xe];$h(Se),Le=ge,ge=Se,Se=Le;for(var tt=0,at=0;at<d;at++){var He=Le[at]-ge[at];tt+=He*He}if(tt<a)break}return{rank:function(Pe){return Pe=o.collection(Pe)[0],ge[u.indexOf(Pe)]}}}},su=ir({root:null,weight:function(e){return 1},directed:!1,alpha:0}),_n={degreeCentralityNormalized:function(e){e=su(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},f=0,h=0,v=0;v<a;v++){var b=n[v],y=b.id();e.root=b;var g=this.degreeCentrality(e);f<g.indegree&&(f=g.indegree),h<g.outdegree&&(h=g.outdegree),c[y]=g.indegree,d[y]=g.outdegree}return{indegree:function(C){return 0==f?0:(oe(C)&&(C=t.filter(C)),c[C.id()]/f)},outdegree:function(C){return 0===h?0:(oe(C)&&(C=t.filter(C)),d[C.id()]/h)}}}for(var i={},s=0,o=0;o<a;o++){var l=n[o];e.root=l;var u=this.degreeCentrality(e);s<u.degree&&(s=u.degree),i[l.id()]=u.degree}return{degree:function(C){return 0===s?0:(oe(C)&&(C=t.filter(C)),i[C.id()]/s)}}},degreeCentrality:function(e){e=su(e);var t=this.cy(),n=this,i=e.root,s=e.weight,o=e.directed,l=e.alpha;if(i=t.collection(i)[0],o){for(var h=i.connectedEdges(),v=h.filter(function(V){return V.target().same(i)&&n.has(V)}),b=h.filter(function(V){return V.source().same(i)&&n.has(V)}),y=v.length,g=b.length,w=0,C=0,N=0;N<v.length;N++)w+=s(v[N]);for(var z=0;z<b.length;z++)C+=s(b[z]);return{indegree:Math.pow(y,1-l)*Math.pow(w,l),outdegree:Math.pow(g,1-l)*Math.pow(C,l)}}for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,f=0;f<u.length;f++)d+=s(u[f]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}};_n.dc=_n.degreeCentrality,_n.dcn=_n.degreeCentralityNormalised=_n.degreeCentralityNormalized;var ou=ir({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Fn={closenessCentralityNormalized:function(e){for(var t=ou(e),n=t.harmonic,a=t.weight,i=t.directed,s=this.cy(),o={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var f=0,h=u[d],v=0;v<u.length;v++)if(d!==v){var b=c.distance(h,u[v]);f+=n?1/b:b}n||(f=1/f),l<f&&(l=f),o[h.id()]=f}return{closeness:function(g){return 0==l?0:(g=oe(g)?s.filter(g)[0].id():g.id(),o[g]/l)}}},closenessCentrality:function(e){var t=ou(e),n=t.root,a=t.weight,i=t.directed,s=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:a,directed:i}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var f=o.distanceTo(d);l+=s?1/f:f}}return s?l:1/l}};Fn.cc=Fn.closenessCentrality,Fn.ccn=Fn.closenessCentralityNormalised=Fn.closenessCentralityNormalized;var pv=ir({weight:null,directed:!1}),Ds={betweennessCentrality:function(e){for(var t=pv(e),n=t.directed,a=t.weight,i=null!=a,s=this.cy(),o=this.nodes(),l={},u={},c=0,d={set:function(C,N){u[C]=N,N>c&&(c=N)},get:function(C){return u[C]}},f=0;f<o.length;f++){var h=o[f],v=h.id();l[v]=n?h.outgoers().nodes():h.openNeighborhood().nodes(),d.set(v,0)}for(var b=function(){for(var C=o[y].id(),N=[],z={},V={},F={},U=new va(function($e,Xe){return F[$e]-F[Xe]}),q=0;q<o.length;q++){var Z=o[q].id();z[Z]=[],V[Z]=0,F[Z]=1/0}for(V[C]=1,F[C]=0,U.push(C);!U.empty();){var K=U.pop();if(N.push(K),i)for(var J=0;J<l[K].length;J++){var de,Q=l[K][J],le=s.getElementById(K);de=le.edgesTo(Q).length>0?le.edgesTo(Q)[0]:Q.edgesTo(le)[0];var he=a(de);Q=Q.id(),F[Q]>F[K]+he&&(F[Q]=F[K]+he,U.nodes.indexOf(Q)<0?U.push(Q):U.updateItem(Q),V[Q]=0,z[Q]=[]),F[Q]==F[K]+he&&(V[Q]=V[Q]+V[K],z[Q].push(K))}else for(var ue=0;ue<l[K].length;ue++){var ge=l[K][ue].id();F[ge]==1/0&&(U.push(ge),F[ge]=F[K]+1),F[ge]==F[K]+1&&(V[ge]=V[ge]+V[K],z[ge].push(K))}}for(var Se={},Le=0;Le<o.length;Le++)Se[o[Le].id()]=0;for(;N.length>0;){for(var ye=N.pop(),De=0;De<z[ye].length;De++){var Ue=z[ye][De];Se[Ue]=Se[Ue]+V[Ue]/V[ye]*(1+Se[ye])}ye!=o[y].id()&&d.set(ye,d.get(ye)+Se[ye])}},y=0;y<o.length;y++)b();var g={betweenness:function(C){var N=s.collection(C).id();return d.get(N)},betweennessNormalized:function(C){if(0==c)return 0;var N=s.collection(C).id();return d.get(N)/c}};return g.betweennessNormalised=g.betweennessNormalized,g}};Ds.bc=Ds.betweennessCentrality;var yv=ir({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),bv=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},lu=function(e,t){for(var n,a=0;a<t;a++){n=0;for(var i=0;i<t;i++)n+=e[i*t+a];for(var s=0;s<t;s++)e[s*t+a]=e[s*t+a]/n}},xv=function(e,t,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 l=0;l<n;l++)a[i*n+l]+=e[i*n+o]*t[o*n+l]}return a},Ev=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=xv(e,a,t);return e},Tv=function(e,t,n){for(var a=new Array(t*t),i=0;i<t*t;i++)a[i]=Math.pow(e[i],n);return lu(a,t),a},Cv=function(e,t,n,a){for(var i=0;i<n;i++)if(Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a)!==Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a))return!1;return!0},Sv=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},uu=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=function(e){return yv(e)}(e),s={},o=0;o<t.length;o++)s[t[o].id()]=o;for(var d,l=t.length,u=l*l,c=new Array(u),f=0;f<u;f++)c[f]=0;for(var h=0;h<n.length;h++){var v=n[h],b=s[v.source().id()],y=s[v.target().id()],g=bv(v,i.attributes);c[b*l+y]+=g,c[y*l+b]+=g}(function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n})(c,l,i.multFactor),lu(c,l);for(var w=!0,C=0;w&&C<i.maxIterations;)w=!1,d=Ev(c,l,i.expandFactor),c=Tv(d,l,i.inflateFactor),Cv(c,d,u,4)||(w=!0),C++;var N=function(e,t,n,a){for(var i=[],s=0;s<t;s++){for(var o=[],l=0;l<t;l++)Math.round(1e3*e[s*t+l])/1e3>0&&o.push(n[l]);0!==o.length&&i.push(a.collection(o))}return i}(c,l,t,a);return N=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Sv(e[t],e[n])&&e.splice(n,1);return e}(N),N},Av={markovClustering:uu,mcl:uu},Iv=function(e){return e},cu=function(e,t){return Math.abs(t-e)},du=function(e,t,n){return e+cu(t,n)},fu=function(e,t,n){return e+Math.pow(n-t,2)},Nv=function(e){return Math.sqrt(e)},Rv=function(e,t,n){return Math.max(e,cu(t,n))},ma=function(e,t,n,a,i){for(var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Iv,o=a,c=0;c<e;c++)o=i(o,t(c),n(c));return s(o)},Gn={euclidean:function(e,t,n){return e>=2?ma(e,t,n,0,fu,Nv):ma(e,t,n,0,du)},squaredEuclidean:function(e,t,n){return ma(e,t,n,0,fu)},manhattan:function(e,t,n){return ma(e,t,n,0,du)},max:function(e,t,n){return ma(e,t,n,-1/0,Rv)}};function ai(r,e,t,n,a,i){var s;return s=Be(r)?r:Gn[r]||Gn.euclidean,0===e&&Be(r)?s(a,i):s(e,t,n,a,i)}Gn["squared-euclidean"]=Gn.squaredEuclidean,Gn.squaredeuclidean=Gn.squaredEuclidean;var Mv=ir({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Ss=function(e){return Mv(e)},ii=function(e,t,n,a,i){var o="kMedoids"!==i?function(d){return n[d]}:function(d){return a[d](n)};return ai(e,a.length,o,function(f){return a[f](t)},n,t)},Ls=function(e,t,n){for(var a=n.length,i=new Array(a),s=new Array(a),o=new Array(t),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,s[u]=e.max(n[u]).value;for(var c=0;c<t;c++){l=[];for(var d=0;d<a;d++)l[d]=Math.random()*(s[d]-i[d])+i[d];o[c]=l}return o},hu=function(e,t,n,a,i){for(var s=1/0,o=0,l=0;l<t.length;l++){var u=ii(n,e,t[l],a,i);u<s&&(s=u,o=l)}return o},vu=function(e,t,n){for(var a=[],i=null,s=0;s<t.length;s++)n[(i=t[s]).id()]===e&&a.push(i);return a},Ov=function(e,t,n){return Math.abs(t-e)<=n},Pv=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++)if(Math.abs(e[a][i]-t[a][i])>n)return!1;return!0},kv=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},gu=function(e,t){var n=new Array(t);if(e.length<50)for(var a=0;a<t;a++){for(var i=e[Math.floor(Math.random()*e.length)];kv(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var s=0;s<t;s++)n[s]=e[Math.floor(Math.random()*e.length)];return n},pu=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=ii("manhattan",t[i],e,n,"kMedoids");return a},Fv=function(e,t,n,a,i){for(var s,o,l=0;l<t.length;l++)for(var u=0;u<e.length;u++)a[l][u]=Math.pow(n[l][u],i.m);for(var c=0;c<e.length;c++)for(var d=0;d<i.attributes.length;d++){s=0,o=0;for(var f=0;f<t.length;f++)s+=a[f][c]*i.attributes[d](t[f]),o+=a[f][c];e[c][d]=s/o}},Gv=function(e,t,n,a,i){for(var s=0;s<e.length;s++)t[s]=e[s].slice();for(var o,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var f=0;f<a.length;f++){o=0;for(var h=0;h<n.length;h++)l=ii(i.distance,a[f],n[d],i.attributes,"cmeans"),u=ii(i.distance,a[f],n[h],i.attributes,"cmeans"),o+=Math.pow(l/u,c);e[f][d]=1/o}},yu=function(e){var i,s,o,l,u,t=this.cy(),n=this.nodes(),a=Ss(e);l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=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 f=0;f<n.length;f++){for(var h=0,v=0;v<a.k;v++)o[f][v]=Math.random(),h+=o[f][v];for(var b=0;b<a.k;b++)o[f][b]=o[f][b]/h}s=new Array(a.k);for(var y=0;y<a.k;y++)s[y]=new Array(a.attributes.length);u=new Array(n.length);for(var g=0;g<n.length;g++)u[g]=new Array(a.k);for(var w=!0,C=0;w&&C<a.maxIterations;)w=!1,Fv(s,n,o,u,a),Gv(o,l,s,n,a),Pv(o,l,a.sensitivityThreshold)||(w=!0),C++;return i=function(e,t,n,a){for(var i=new Array(n.k),s=0;s<i.length;s++)i[s]=[];for(var o,l,u=0;u<t.length;u++){o=-1/0,l=-1;for(var c=0;c<t[0].length;c++)t[u][c]>o&&(o=t[u][c],l=c);i[l].push(e[u])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i}(n,o,a,t),{clusters:i,degreeOfMembership:o}},Vv={kMeans:function(e){var l,t=this.cy(),n=this.nodes(),a=null,i=Ss(e),s=new Array(i.k),o={};l=i.testMode?"number"==typeof i.testCentroids?Ls(n,i.k,i.attributes):"object"===pe(i.testCentroids)?i.testCentroids:Ls(n,i.k,i.attributes):Ls(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)o[(a=n[d]).id()]=hu(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var f=0;f<i.k;f++){var h=vu(f,n,o);if(0!==h.length){for(var v=i.attributes.length,b=l[f],y=new Array(v),g=new Array(v),w=0;w<v;w++){g[w]=0;for(var C=0;C<h.length;C++)g[w]+=i.attributes[w](a=h[C]);y[w]=g[w]/h.length,Ov(y[w],b[w],i.sensitivityThreshold)||(u=!0)}l[f]=y,s[f]=t.collection(h)}}c++}return s},kMedoids:function(e){var o,u,t=this.cy(),n=this.nodes(),a=null,i=Ss(e),s=new Array(i.k),l={},c=new Array(i.k);i.testMode?"number"==typeof i.testCentroids||(o="object"===pe(i.testCentroids)?i.testCentroids:gu(n,i.k)):o=gu(n,i.k);for(var d=!0,f=0;d&&f<i.maxIterations;){for(var h=0;h<n.length;h++)l[(a=n[h]).id()]=hu(a,o,i.distance,i.attributes,"kMedoids");d=!1;for(var v=0;v<o.length;v++){var b=vu(v,n,l);if(0!==b.length){c[v]=pu(o[v],b,i.attributes);for(var y=0;y<b.length;y++)(u=pu(b[y],b,i.attributes))<c[v]&&(c[v]=u,o[v]=b[y],d=!0);s[v]=t.collection(b)}}f++}return s},fuzzyCMeans:yu,fcm:yu},Hv=ir({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Uv={single:"min",complete:"max"},mu=function(e,t,n,a,i){for(var l,s=0,o=1/0,u=i.attributes,c=function(q,Z){return ai(i.distance,u.length,function(K){return u[K](q)},function(K){return u[K](Z)},q,Z)},d=0;d<e.length;d++){var f=e[d].key,h=n[f][a[f]];h<o&&(s=f,o=h)}if("threshold"===i.mode&&o>=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var y,v=t[s],b=t[a[s]];y="dendrogram"===i.mode?{left:v,right:b,key:v.key}:{value:v.value.concat(b.value),key:v.key},e[v.index]=y,e.splice(b.index,1),t[v.key]=y;for(var g=0;g<e.length;g++){var w=e[g];v.key===w.key?l=1/0:"min"===i.linkage?(l=n[v.key][w.key],n[v.key][w.key]>n[b.key][w.key]&&(l=n[b.key][w.key])):"max"===i.linkage?(l=n[v.key][w.key],n[v.key][w.key]<n[b.key][w.key]&&(l=n[b.key][w.key])):l="mean"===i.linkage?(n[v.key][w.key]*v.size+n[b.key][w.key]*b.size)/(v.size+b.size):"dendrogram"===i.mode?c(w.value,v.value):c(w.value[0],v.value[0]),n[v.key][w.key]=n[w.key][v.key]=l}for(var C=0;C<e.length;C++){var N=e[C].key;if(a[N]===v.key||a[N]===b.key){for(var z=N,V=0;V<e.length;V++){var F=e[V].key;n[N][F]<n[N][z]&&(z=F)}a[N]=z}e[C].index=C}return v.key=b.key=v.index=b.index=null,!0},zn=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&zn(e.left,t),e.right&&zn(e.right,t)))},As=function(e,t){if(!e)return"";if(e.left&&e.right){var n=As(e.left,t),a=As(e.right,t),i=t.add({group:"nodes",data:{id:n+","+a}});return t.add({group:"edges",data:{source:n,target:i.id()}}),t.add({group:"edges",data:{source:a,target:i.id()}}),i.id()}return e.value?e.value.id():void 0},Is=function(e,t,n){if(!e)return[];var a=[],i=[],s=[];return 0===t?(e.left&&zn(e.left,a),e.right&&zn(e.right,i),s=a.concat(i),[n.collection(s)]):1===t?e.value?[n.collection(e.value)]:(e.left&&zn(e.left,a),e.right&&zn(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=Is(e.left,t-1,n)),e.right&&(i=Is(e.right,t-1,n)),a.concat(i))},bu=function(e){for(var t=this.cy(),n=this.nodes(),a=function(e){var t=Hv(e),n=Uv[t.linkage];return null!=n&&(t.linkage=n),t}(e),i=a.attributes,s=function(C,N){return ai(a.distance,i.length,function(z){return i[z](C)},function(z){return i[z](N)},C,N)},o=[],l=[],u=[],c=[],d=0;d<n.length;d++){var f={value:"dendrogram"===a.mode?n[d]:[n[d]],key:d,index:d};o[d]=f,c[d]=f,l[d]=[],u[d]=0}for(var h=0;h<o.length;h++)for(var v=0;v<=h;v++){var b;b="dendrogram"===a.mode?h===v?1/0:s(o[h].value,o[v].value):h===v?1/0:s(o[h].value[0],o[v].value[0]),l[h][v]=b,l[v][h]=b,b<l[h][u[h]]&&(u[h]=v)}for(var y=mu(o,c,l,u,a);y;)y=mu(o,c,l,u,a);var g;return"dendrogram"===a.mode?(g=Is(o[0],a.dendrogramDepth,t),a.addDendrogram&&As(o[0],t)):(g=new Array(o.length),o.forEach(function(w,C){w.key=w.index=null,g[C]=t.collection(w.value)})),g},jv={hierarchicalClustering:bu,hca:bu},Yv=ir({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),qv=function(e,t,n,a){var i=function(o,l){return a[l](o)};return-ai(e,a.length,function(s){return i(t,s)},function(s){return i(n,s)},t,n)},wu=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var s=-1,o=-1/0,l=0;l<n.length;l++){var u=n[l];t[i*e+u]>o&&(s=u,o=t[i*e+u])}s>0&&a.push(s)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},xu=function(e){for(var t=this.cy(),n=this.nodes(),a=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Xt("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||_e(n)||Xt("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),Yv(e)}(e),i={},s=0;s<n.length;s++)i[n[s].id()]=s;var o,l,u,c,d,f,q;l=(o=n.length)*o,u=new Array(l);for(var h=0;h<l;h++)u[h]=-1/0;for(var v=0;v<o;v++)for(var b=0;b<o;b++)v!==b&&(u[v*o+b]=qv(a.distance,n[v],n[b],a.attributes));c=function(e,t){var n;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,l=e.length-1;l>=0;l--)s?isFinite(e[l])||(e[l]=-1/0,o++):e.splice(l,1);i&&e.sort(function(f,h){return f-h});var c=e.length,d=Math.floor(c/2);return c%2!=0?e[d+1+o]:(e[d-1+o]+e[d+o])/2}(e):"mean"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,a=0,i=0,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;s<n;s++){var o=e[s];isFinite(o)&&(a+=o,i++)}return a/i}(e):"min"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,a=1/0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.min(s,a))}return a}(e):"max"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,a=-1/0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i<n;i++){var s=e[i];isFinite(s)&&(a=Math.max(s,a))}return a}(e):t,n}(u,a.preference);for(var y=0;y<o;y++)u[y*o+y]=c;d=new Array(l);for(var g=0;g<l;g++)d[g]=0;f=new Array(l);for(var w=0;w<l;w++)f[w]=0;for(var C=new Array(o),N=new Array(o),z=new Array(o),V=0;V<o;V++)C[V]=0,N[V]=0,z[V]=0;for(var F=new Array(o*a.minIterations),U=0;U<F.length;U++)F[U]=0;for(q=0;q<a.maxIterations;q++){for(var Z=0;Z<o;Z++){for(var K=-1/0,J=-1/0,Q=-1,le=0,de=0;de<o;de++)C[de]=d[Z*o+de],(le=f[Z*o+de]+u[Z*o+de])>=K?(J=K,K=le,Q=de):le>J&&(J=le);for(var he=0;he<o;he++)d[Z*o+he]=(1-a.damping)*(u[Z*o+he]-K)+a.damping*C[he];d[Z*o+Q]=(1-a.damping)*(u[Z*o+Q]-J)+a.damping*C[Q]}for(var ue=0;ue<o;ue++){for(var ge=0,Se=0;Se<o;Se++)C[Se]=f[Se*o+ue],N[Se]=Math.max(0,d[Se*o+ue]),ge+=N[Se];ge-=N[ue],N[ue]=d[ue*o+ue],ge+=N[ue];for(var Le=0;Le<o;Le++)f[Le*o+ue]=(1-a.damping)*Math.min(0,ge-N[Le])+a.damping*C[Le];f[ue*o+ue]=(1-a.damping)*(ge-N[ue])+a.damping*C[ue]}for(var ye=0,De=0;De<o;De++){var Ue=f[De*o+De]+d[De*o+De]>0?1:0;F[q%a.minIterations*o+De]=Ue,ye+=Ue}if(ye>0&&(q>=a.minIterations-1||q==a.maxIterations-1)){for(var $e=0,Xe=0;Xe<o;Xe++){z[Xe]=0;for(var Qe=0;Qe<a.minIterations;Qe++)z[Xe]+=F[Qe*o+Xe];(0===z[Xe]||z[Xe]===a.minIterations)&&$e++}if($e===o)break}}for(var tt=function(e,t,n){for(var a=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&a.push(i);return a}(o,d,f),at=function(e,t,n){for(var a=wu(e,t,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 l=-1,u=-1/0,c=0;c<s.length;c++){for(var d=0,f=0;f<s.length;f++)d+=t[s[f]*e+s[c]];d>u&&(l=c,u=d)}n[i]=s[l]}return wu(e,t,n)}(o,u,tt),He={},Te=0;Te<tt.length;Te++)He[tt[Te]]=[];for(var Ie=0;Ie<n.length;Ie++){var ze=at[i[n[Ie].id()]];null!=ze&&He[ze].push(n[Ie])}for(var rt=new Array(tt.length),ct=0;ct<tt.length;ct++)rt[ct]=t.collection(He[tt[ct]]);return rt},Jv={affinityPropagation:xu,ap:xu},Qv=ir({root:void 0,directed:!1}),eg={hierholzer:function(e){if(!Oe(e)){var t=arguments;e={root:t[0],directed:t[1]}}var l,u,c,n=Qv(e),a=n.root,i=n.directed,s=this,o=!1;a&&(c=oe(a)?this.filter(a)[0].id():a[0].id());var d={},f={};s.forEach(i?function(w){var C=w.id();if(w.isNode()){var N=w.indegree(!0),z=w.outdegree(!0),V=N-z,F=z-N;1==V?l?o=!0:l=C:1==F?u?o=!0:u=C:(F>1||V>1)&&(o=!0),d[C]=[],w.outgoers().forEach(function(U){U.isEdge()&&d[C].push(U.id())})}else f[C]=[void 0,w.target().id()]}:function(w){var C=w.id();w.isNode()?(w.degree(!0)%2&&(l?u?o=!0:u=C:l=C),d[C]=[],w.connectedEdges().forEach(function(z){return d[C].push(z.id())})):f[C]=[w.source().id(),w.target().id()]});var h={found:!1,trail:void 0};if(o)return h;if(u&&l)if(i){if(c&&u!=c)return h;c=u}else{if(c&&u!=c&&l!=c)return h;c||(c=u)}else c||(c=s[0].id());var v=function(C){for(var V,F,U,N=C,z=[C];d[N].length;)V=d[N].shift(),F=f[V][0],N!=(U=f[V][1])?(d[U]=d[U].filter(function(q){return q!=V}),N=U):!i&&N!=F&&(d[F]=d[F].filter(function(q){return q!=V}),N=F),z.unshift(V),z.unshift(N);return z},b=[],y=[];for(y=v(c);1!=y.length;)0==d[y[0]].length?(b.unshift(s.getElementById(y.shift())),b.unshift(s.getElementById(y.shift()))):y=v(y.shift()).concat(y);for(var g in b.unshift(s.getElementById(y.shift())),d)if(d[g].length)return h;return h.found=!0,h.trail=this.spawn(b,!0),h}},si=function(){var e=this,t={},n=0,a=0,i=[],s=[],o={},u=function(f,h,v){f===v&&(a+=1),t[h]={id:n,low:n++,cutVertex:!1};var y,g,w,C,b=e.getElementById(h).connectedEdges().intersection(e);0===b.size()?i.push(e.spawn(e.getElementById(h))):b.forEach(function(N){y=N.source().id(),g=N.target().id(),(w=y===h?g:y)!==v&&(C=N.id(),o[C]||(o[C]=!0,s.push({x:h,y:w,edge:N})),w in t?t[h].low=Math.min(t[h].low,t[w].id):(u(f,w,h),t[h].low=Math.min(t[h].low,t[w].low),t[h].id<=t[w].low&&(t[h].cutVertex=!0,function(f,h){for(var v=s.length-1,b=[],y=e.spawn();s[v].x!=f||s[v].y!=h;)b.push(s.pop().edge),v--;b.push(s.pop().edge),b.forEach(function(g){var w=g.connectedNodes().intersection(e);y.merge(g),w.forEach(function(C){var N=C.id(),z=C.connectedEdges().intersection(e);y.merge(C),y.merge(t[N].cutVertex?z.filter(function(V){return V.isLoop()}):z)})}),i.push(y)}(h,w))))})};e.forEach(function(d){if(d.isNode()){var f=d.id();f in t||(a=0,u(f,f),t[f].cutVertex=a>1)}});var c=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:i}},oi=function(){var e=this,t={},n=0,a=[],i=[],s=e.spawn(e),o=function(u){if(i.push(u),t[u]={index:n,low:n++,explored:!1},e.getElementById(u).connectedEdges().intersection(e).forEach(function(b){var y=b.target().id();y!==u&&(y in t||o(y),t[y].explored||(t[u].low=Math.min(t[u].low,t[y].low)))}),t[u].index===t[u].low){for(var d=e.spawn();;){var f=i.pop();if(d.merge(e.getElementById(f)),t[f].low=t[u].index,t[f].explored=!0,f===u)break}var h=d.edgesWith(d),v=d.merge(h);a.push(v),s=s.difference(v)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||o(u)}}),{cut:s,components:a}},Eu={};[ha,Mh,Oh,kh,_h,Gh,Hh,gv,_n,Fn,Ds,Av,Vv,jv,Jv,eg,{hopcroftTarjanBiconnected:si,htbc:si,htb:si,hopcroftTarjanBiconnectedComponents:si},{tarjanStronglyConnected:oi,tsc:oi,tscc:oi,tarjanStronglyConnectedComponents:oi}].forEach(function(r){mt(Eu,r)});var Lr=function(e){if(!(this instanceof Lr))return new Lr(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Lr.prototype={fulfill:function(e){return Su(this,1,"fulfillValue",e)},reject:function(e){return Su(this,2,"rejectReason",e)},then:function(e,t){var n=this,a=new Lr;return n.onFulfilled.push(Iu(e,a,"fulfill")),n.onRejected.push(Iu(t,a,"reject")),Lu(n),a.proxy}};var Su=function(e,t,n,a){return 0===e.state&&(e.state=t,e[n]=a,Lu(e)),e},Lu=function(e){1===e.state?Au(e,"onFulfilled",e.fulfillValue):2===e.state&&Au(e,"onRejected",e.rejectReason)},Au=function(e,t,n){if(0!==e[t].length){var a=e[t];e[t]=[];var i=function(){for(var o=0;o<a.length;o++)a[o](n)};"function"==typeof setImmediate?setImmediate(i):setTimeout(i,0)}},Iu=function(e,t,n){return function(a){if("function"!=typeof e)t[n].call(t,a);else{var i;try{i=e(a)}catch(s){return void t.reject(s)}Nu(t,i)}}},Nu=function(e,t){if(e!==t&&e.proxy!==t){var n;if("object"===pe(t)&&null!==t||"function"==typeof t)try{n=t.then}catch(i){return void e.reject(i)}if("function"!=typeof n)e.fulfill(t);else{var a=!1;try{n.call(t,function(i){a||(a=!0,i===t?e.reject(new TypeError("circular thenable chain")):Nu(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}}}else e.reject(new TypeError("cannot resolve promise with itself"))};Lr.all=function(r){return new Lr(function(e,t){for(var n=new Array(r.length),a=0,i=function(l,u){n[l]=u,++a===r.length&&e(n)},s=0;s<r.length;s++)(function(o){var l=r[o];null!=l&&null!=l.then?l.then(function(d){i(o,d)},function(d){t(d)}):i(o,l)})(s)})},Lr.resolve=function(r){return new Lr(function(e,t){e(r)})},Lr.reject=function(r){return new Lr(function(e,t){t(r)})};var Vn=typeof Promise<"u"?Promise:Lr,Ns=function(e,t,n){var a=xr(e),i=!a,s=this._private=mt({duration:1e3},t,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&&Be(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 l=e.pan();s.startPan={x:l.x,y:l.y},s.startZoom=e.zoom()}this.length=1,this[0]=this},xn=Ns.prototype;mt(xn,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n=e.target._private.animation;(e.queue?n.queue:n.current).push(this),vt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];null!=d&&(e[u]=e[c],e[c]=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 t&&this.play(),this},promise:function(e){var n,t=this._private;return n="frame"===e?t.frames:t.completes,new Vn(function(a,i){n.push(function(){a()})})}}),xn.complete=xn.completed,xn.run=xn.play,xn.running=xn.playing;var Rs,Ru,Ms,Mu,Os,Ou,Ps,Pu,ks,ku,Bs,Bu,_s,_u,Fs,Fu,Gs,Gu,Vs,zu,Hs,Vu,Us,Hu,Xs,Uu,js,Xu,Ys,ju,Ws,Yu,qs,Wu,$s,qu,Ks,Ku,Zs,Zu,Js,Ju,Qs,Qu,eo,ec,to,tc,ro,rc,no,nc,ao,ac,io,ic,so,sc,oo,oc,lo,lc,uo,uc,co,cc,fo,dc,ho,fc,vo,hc,go,gc,po,yc,yo,mc,mo,wc,bo,Ec,xo,Tc,Eo,Cc,ng={animated:function(){return function(){var t=this,a=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return!1;var s=a[0];return s?s._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var t=this,a=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var s=0;s<a.length;s++)a[s]._private.animation.queue=[];return this}},delay:function(){return function(t,n){return(this._private.cy||this).styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){return(this._private.cy||this).styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var a=this,i=void 0!==a.length,s=i?a:[a],o=this._private.cy||this,l=!i,u=!l;if(!o.styleEnabled())return this;var c=o.style();if(t=mt({},t,n),0===Object.keys(t).length)return new Ns(s[0],t);switch(void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}if(u&&(t.style=c.getPropsList(t.style||t.css),t.css=void 0),u&&null!=t.renderedPosition){var f=t.renderedPosition,h=o.pan(),v=o.zoom();t.position=Jl(f,v,h)}if(l&&null!=t.panBy){var b=t.panBy,y=o.pan();t.pan={x:y.x+b.x,y:y.y+b.y}}var g=t.center||t.centre;if(l&&null!=g){var w=o.getCenterPan(g.eles,t.zoom);null!=w&&(t.pan=w)}if(l&&null!=t.fit){var C=t.fit,N=o.getFitViewport(C.eles||C.boundingBox,C.padding);null!=N&&(t.pan=N.pan,t.zoom=N.zoom)}if(l&&Oe(t.zoom)){var z=o.getZoomedViewport(t.zoom);null!=z?(z.zoomed&&(t.zoom=z.zoom),z.panned&&(t.pan=z.pan)):t.zoom=null}return new Ns(s[0],t)}},animate:function(){return function(t,n){var a=this,s=void 0!==a.length?a:[a];if(!(this._private.cy||this).styleEnabled())return this;n&&(t=mt({},t,n));for(var l=0;l<s.length;l++){var u=s[l],c=u.animated()&&(void 0===t.queue||t.queue);u.animation(t,c?{queue:!0}:void 0).play()}return this}},stop:function(){return function(t,n){var a=this,s=void 0!==a.length?a:[a],o=this._private.cy||this;if(!o.styleEnabled())return this;for(var l=0;l<s.length;l++){for(var c=s[l]._private,d=c.animation.current,f=0;f<d.length;f++)n&&(d[f]._private.duration=0);t&&(c.animation.queue=[]),n||(c.animation.current=[])}return o.notify("draw"),this}}};function li(){return Ru?Rs:(Ru=1,Rs=Array.isArray)}function ug(){if(_u)return _s;_u=1;var r=function ig(){if(Ou)return Os;Ou=1;var r=Ol(),e=la();return Os=function s(o){if(!e(o))return!1;var l=r(o);return"[object Function]"==l||"[object GeneratorFunction]"==l||"[object AsyncFunction]"==l||"[object Proxy]"==l}}(),e=function og(){if(ku)return ks;ku=1;var n,r=function sg(){if(Pu)return Ps;Pu=1;var r=ja();return Ps=r["__core-js_shared__"]}(),e=(n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return ks=function t(n){return!!e&&e in n},ks}(),t=la(),n=function lg(){if(Bu)return Bs;Bu=1;var e=Function.prototype.toString;return Bs=function t(n){if(null!=n){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}}(),i=/^\[object .+?Constructor\]$/,c=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return _s=function d(f){return!(!t(f)||e(f))&&(r(f)?c:i).test(n(f))}}function zs(){if(Gu)return Gs;Gu=1;var r=ug(),e=function cg(){return Fu?Fs:(Fu=1,Fs=function r(e,t){return e?.[t]})}();return Gs=function t(n,a){var i=e(n,a);return r(i)?i:void 0}}function ui(){if(zu)return Vs;zu=1;var e=zs()(Object,"create");return Vs=e}function $u(){return qu?$s:(qu=1,$s=function r(e,t){return e===t||e!=e&&t!=t})}function ci(){if(Ku)return Ks;Ku=1;var r=$u();return Ks=function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}}function Cg(){if(nc)return no;nc=1;var r=function pg(){if(Yu)return Ws;Yu=1;var r=function dg(){if(Vu)return Hs;Vu=1;var r=ui();return Hs=function e(){this.__data__=r?r(null):{},this.size=0}}(),e=function fg(){return Hu?Us:(Hu=1,Us=function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t})}(),t=function hg(){if(Uu)return Xs;Uu=1;var r=ui(),n=Object.prototype.hasOwnProperty;return Xs=function a(i){var s=this.__data__;if(r){var o=s[i];return"__lodash_hash_undefined__"===o?void 0:o}return n.call(s,i)?s[i]:void 0}}(),n=function vg(){if(Xu)return js;Xu=1;var r=ui(),t=Object.prototype.hasOwnProperty;return js=function n(a){var i=this.__data__;return r?void 0!==i[a]:t.call(i,a)}}(),a=function gg(){if(ju)return Ys;ju=1;var r=ui();return Ys=function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&void 0===a?"__lodash_hash_undefined__":a,this}}();function i(s){var o=-1,l=null==s?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Ws=i}(),e=function Eg(){if(tc)return to;tc=1;var r=function yg(){return Wu?qs:(Wu=1,qs=function r(){this.__data__=[],this.size=0})}(),e=function mg(){if(Zu)return Zs;Zu=1;var r=ci(),t=Array.prototype.splice;return Zs=function n(a){var i=this.__data__,s=r(i,a);return!(s<0||(s==i.length-1?i.pop():t.call(i,s,1),--this.size,0))}}(),t=function bg(){if(Ju)return Js;Ju=1;var r=ci();return Js=function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}}(),n=function wg(){if(Qu)return Qs;Qu=1;var r=ci();return Qs=function e(t){return r(this.__data__,t)>-1}}(),a=function xg(){if(ec)return eo;ec=1;var r=ci();return eo=function e(t,n){var a=this.__data__,i=r(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}}();function i(s){var o=-1,l=null==s?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,to=i}(),t=function Tg(){if(rc)return ro;rc=1;var t=zs()(ja(),"Map");return ro=t}();return no=function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}}function di(){if(ic)return io;ic=1;var r=function Dg(){return ac?ao:(ac=1,ao=function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e})}();return io=function e(t,n){var a=t.__data__;return r(n)?a["string"==typeof n?"string":"hash"]:a.map}}function Mg(){if(fc)return ho;fc=1;var r=function Rg(){if(dc)return fo;dc=1;var r=function Ng(){if(cc)return co;cc=1;var r=Cg(),e=function Sg(){if(sc)return so;sc=1;var r=di();return so=function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}(),t=function Lg(){if(oc)return oo;oc=1;var r=di();return oo=function e(t){return r(this,t).get(t)}}(),n=function Ag(){if(lc)return lo;lc=1;var r=di();return lo=function e(t){return r(this,t).has(t)}}(),a=function Ig(){if(uc)return uo;uc=1;var r=di();return uo=function e(t,n){var a=r(this,t),i=a.size;return a.set(t,n),this.size+=a.size==i?0:1,this}}();function i(s){var o=-1,l=null==s?0:s.length;for(this.clear();++o<l;){var u=s[o];this.set(u[0],u[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,co=i}();function t(n,a){if("function"!=typeof n||null!=a&&"function"!=typeof a)throw new TypeError("Expected a function");var i=function(){var s=arguments,o=a?a.apply(this,s):s[0],l=i.cache;if(l.has(o))return l.get(o);var u=n.apply(this,s);return i.cache=l.set(o,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,fo=t}();return ho=function t(n){var a=r(n,function(s){return 500===i.size&&i.clear(),s}),i=a.cache;return a}}function vc(){if(hc)return vo;hc=1;var r=Mg(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return 46===a.charCodeAt(0)&&i.push(""),a.replace(e,function(s,o,l,u){i.push(l?u.replace(t,"$1"):o||s)}),i});return vo=n}function pc(){return gc?go:(gc=1,go=function r(e,t){for(var n=-1,a=null==e?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i})}function bc(){if(mc)return yo;mc=1;var r=function Og(){if(yc)return po;yc=1;var r=rs(),e=pc(),t=li(),n=ua(),a=r?r.prototype:void 0,i=a?a.toString:void 0;return po=function s(o){if("string"==typeof o)return o;if(t(o))return e(o,s)+"";if(n(o))return i?i.call(o):"";var l=o+"";return"0"==l&&1/o==-1/0?"-0":l}}();return yo=function e(t){return null==t?"":r(t)}}function xc(){if(wc)return mo;wc=1;var r=li(),e=function ag(){if(Mu)return Ms;Mu=1;var r=li(),e=ua(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return Ms=function a(i,s){if(r(i))return!1;var o=typeof i;return!("number"!=o&&"symbol"!=o&&"boolean"!=o&&null!=i&&!e(i))||n.test(i)||!t.test(i)||null!=s&&i in Object(s)}}(),t=vc(),n=bc();return mo=function a(i,s){return r(i)?i:e(i,s)?[i]:t(n(i))}}function wo(){if(Ec)return bo;Ec=1;var r=ua();return bo=function e(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}}var To,Dc,Co,Sc,Do,Lc,So,Ac,Lo,Ic,Ao,Nc,Bg=function kg(){if(Cc)return Eo;Cc=1;var r=function Pg(){if(Tc)return xo;Tc=1;var r=xc(),e=wo();return xo=function t(n,a){for(var i=0,s=(a=r(a,n)).length;null!=n&&i<s;)n=n[e(a[i++])];return i&&i==s?n:void 0}}();return Eo=function e(t,n,a){var i=null==t?void 0:r(t,n);return void 0===i?a:i}}(),_g=oa(Bg);function Hg(){if(Ic)return Lo;Ic=1;var r=function zg(){if(Lc)return Do;Lc=1;var r=function Gg(){if(Sc)return Co;Sc=1;var r=function Fg(){if(Dc)return To;Dc=1;var r=zs(),e=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}}();return To=e}();return Co=function e(t,n,a){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}}(),e=$u(),n=Object.prototype.hasOwnProperty;return Do=function a(i,s,o){var l=i[s];(!n.call(i,s)||!e(l,o)||void 0===o&&!(s in i))&&r(i,s,o)}}(),e=xc(),t=function Vg(){if(Ac)return So;Ac=1;var e=/^(?:0|[1-9]\d*)$/;return So=function t(n,a){var i=typeof n;return!!(a=a??9007199254740991)&&("number"==i||"symbol"!=i&&e.test(n))&&n>-1&&n%1==0&&n<a}}(),n=la(),a=wo();return Lo=function i(s,o,l,u){if(!n(s))return s;for(var c=-1,d=(o=e(o,s)).length,f=d-1,h=s;null!=h&&++c<d;){var v=a(o[c]),b=l;if("__proto__"===v||"constructor"===v||"prototype"===v)return s;if(c!=f){var y=h[v];void 0===(b=u?u(y,v,h):void 0)&&(b=n(y)?y:t(o[c+1])?[]:{})}r(h,v,b),h=h[v]}return s}}var Io,Rc,No,Mc,jg=oa(function Ug(){if(Nc)return Ao;Nc=1;var r=Hg();return Ao=function e(t,n,a){return null==t?t:r(t,n,a)}}()),qg=function Wg(){if(Mc)return No;Mc=1;var r=pc(),e=function Yg(){return Rc?Io:(Rc=1,Io=function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t})}(),t=li(),n=ua(),a=vc(),i=wo(),s=bc();return No=function o(l){return t(l)?r(l,i):n(l)?[l]:e(a(s(l)))}}(),$g=oa(qg),Kg={data:function(e){return e=mt({},{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}},e),function(a,i){var s=e,o=this,l=void 0!==o.length,u=l?o:[o],c=l?o[0]:o;if(oe(a)){var h,f=-1!==a.indexOf(".")&&$g(a);if(s.allowGetting&&void 0===i)return c&&(s.beforeGet(c),h=f&&void 0===c._private[s.field][a]?_g(c._private[s.field],f):c._private[s.field][a]),h;if(s.allowSetting&&void 0!==i&&!s.immutableKeys[a]){var b=ae({},a,i);s.beforeSet(o,b);for(var y=0,g=u.length;y<g;y++){var w=u[y];s.canSet(w)&&(f&&void 0===c._private[s.field][a]?jg(w._private[s.field],f,i):w._private[s.field][a]=i)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}}else if(s.allowSetting&&Oe(a)){var N,z,C=a,V=Object.keys(C);s.beforeSet(o,C);for(var F=0;F<V.length;F++)if(z=C[N=V[F]],!s.immutableKeys[N])for(var q=0;q<u.length;q++){var Z=u[q];s.canSet(Z)&&(Z._private[s.field][N]=z)}s.updateStyle&&o.updateStyle(),s.onSet(o),s.settingTriggersEvent&&o[s.triggerFnName](s.settingEvent)}else if(s.allowBinding&&Be(a))o.on(s.bindingEvent,a);else if(s.allowGetting&&void 0===a){var J;return c&&(s.beforeGet(c),J=c._private[s.field]),J}return o}},removeData:function(e){return e=mt({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(a){var i=e,s=this,l=void 0!==s.length?s:[s];if(oe(a)){for(var u=a.split(/\s+/),c=u.length,d=0;d<c;d++){var f=u[d];if(!Sr(f)&&!i.immutableKeys[f])for(var v=0,b=l.length;v<b;v++)l[v]._private[i.field][f]=void 0}i.triggerEvent&&s[i.triggerFnName](i.event)}else if(void 0===a){for(var y=0,g=l.length;y<g;y++)for(var w=l[y]._private[i.field],C=Object.keys(w),N=0;N<C.length;N++){var z=C[N];!i.immutableKeys[z]&&(w[z]=void 0)}i.triggerEvent&&s[i.triggerFnName](i.event)}return s}}},Zg={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(n,a){var i=this,s=Array.prototype.slice.call(arguments,0);return new Vn(function(o,l){var c=s.concat([function(h){i.off.apply(i,d),o(h)}]),d=c.concat([]);i.on.apply(i,c)})}}},Ft={};[ng,Kg,Zg].forEach(function(r){mt(Ft,r)});var Jg={animate:Ft.animate(),animation:Ft.animation(),animated:Ft.animated(),clearQueue:Ft.clearQueue(),delay:Ft.delay(),delayAnimation:Ft.delayAnimation(),stop:Ft.stop()},fi={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach(function(v){return n.push(v)}),n}Ye(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new Pn(e),s=0;s<t.length;s++){for(var o=t[s],l=o._private,u=l.classes,c=!1,d=0;d<e.length;d++)if(!u.has(e[d])){c=!0;break}c||(c=u.size!==e.length),c&&(l.classes=i,a.push(o))}return a.length>0&&this.spawn(a).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){Ye(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=void 0===t,i=[],s=0,o=n.length;s<o;s++)for(var l=n[s],u=l._private.classes,c=!1,d=0;d<e.length;d++){var f=e[d],h=u.has(f),v=!1;t||a&&!h?(u.add(f),v=!0):(!t||a&&h)&&(u.delete(f),v=!0),!c&&v&&(i.push(l),c=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};fi.className=fi.classNames=fi.classes;var Ot={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:Jt,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 r,e,t;for(r=Ot.comparatorOp.split("|"),t=0;t<r.length;t++)Ot.comparatorOp+="|@"+(e=r[t]);for(r=Ot.comparatorOp.split("|"),t=0;t<r.length;t++)!((e=r[t]).indexOf("!")>=0)&&"="!==e&&(Ot.comparatorOp+="|\\!"+e)}();var Ro=[{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(r,e){return function(e,t){return-1*bl(e,t)}(r.selector,e.selector)}),Qg=function(){for(var e,r={},t=0;t<Ro.length;t++)r[(e=Ro[t]).selector]=e.matches;return r}(),tp="("+Ro.map(function(r){return r.selector}).join("|")+")",Hn=function(e){return e.replace(new RegExp("\\\\("+Ot.metaChar+")","g"),function(t,n){return n})},rn=function(e,t,n){e[e.length-1]=n},Mo=[{name:"group",query:!0,regex:"("+Ot.group+")",populate:function(e,t,n){var i=fe(n,1)[0];t.checks.push({type:0,value:"*"===i?i:i+"s"})}},{name:"state",query:!0,regex:tp,populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:7,value:a[0]})}},{name:"id",query:!0,regex:"\\#("+Ot.id+")",populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:8,value:Hn(a[0])})}},{name:"className",query:!0,regex:"\\.("+Ot.className+")",populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:9,value:Hn(a[0])})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+Ot.variable+")\\s*\\]",populate:function(e,t,n){var a=fe(n,1);t.checks.push({type:4,field:Hn(a[0])})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+Ot.variable+")\\s*("+Ot.comparatorOp+")\\s*("+Ot.value+")\\s*\\]",populate:function(e,t,n){var a=fe(n,3),i=a[0],s=a[1],o=a[2];o=null!=new RegExp("^"+Ot.string+"$").exec(o)?o.substring(1,o.length-1):parseFloat(o),t.checks.push({type:3,field:Hn(i),operator:s,value:o})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+Ot.boolOp+")\\s*("+Ot.variable+")\\s*\\]",populate:function(e,t,n){var a=fe(n,2),i=a[0];t.checks.push({type:5,field:Hn(a[1]),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+Ot.meta+")\\s*("+Ot.comparatorOp+")\\s*("+Ot.number+")\\s*\\]\\]",populate:function(e,t,n){var a=fe(n,3),s=a[1],o=a[2];t.checks.push({type:6,field:Hn(a[0]),operator:s,value:parseFloat(o)})}},{name:"nextQuery",separator:!0,regex:Ot.separator,populate:function(e,t){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,s=e[e.length-1];return null!=n&&(s.subject=n,e.currentSubject=null),s.edgeCount=a,s.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:Ot.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},i={checks:[]};return n.checks.push({type:11,source:t,target:i}),rn(e,0,n),e.edgeCount++,i}var s={checks:[]},l={checks:[]};return s.checks.push({type:12,source:t,target:l}),rn(e,0,s),e.edgeCount++,l}},{name:"undirectedEdge",separator:!0,regex:Ot.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},i={checks:[]};return n.checks.push({type:10,nodes:[t,i]}),rn(e,0,n),e.edgeCount++,i}var s={checks:[]},l={checks:[]};return s.checks.push({type:14,node:t,neighbor:l}),rn(e,0,s),l}},{name:"child",separator:!0,regex:Ot.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},a={checks:[]};return n.checks.push({type:15,parent:e[e.length-1],child:a}),rn(e,0,n),e.compoundCount++,a}if(e.currentSubject===t){var s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]},d={checks:[]};return s.checks.push({type:19,left:e[e.length-1],right:l,subject:u}),u.checks=t.checks,t.checks=[{type:20}],d.checks.push({type:20}),l.checks.push({type:17,parent:d,child:c}),rn(e,0,s),e.currentSubject=u,e.compoundCount++,c}var f={checks:[]},h={checks:[]},v=[{type:17,parent:f,child:h}];return f.checks=t.checks,t.checks=v,e.compoundCount++,h}},{name:"descendant",separator:!0,regex:Ot.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},a={checks:[]};return n.checks.push({type:16,ancestor:e[e.length-1],descendant:a}),rn(e,0,n),e.compoundCount++,a}if(e.currentSubject===t){var s={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]},d={checks:[]};return s.checks.push({type:19,left:e[e.length-1],right:l,subject:u}),u.checks=t.checks,t.checks=[{type:20}],d.checks.push({type:20}),l.checks.push({type:18,ancestor:d,descendant:c}),rn(e,0,s),e.currentSubject=u,e.compoundCount++,c}var f={checks:[]},h={checks:[]},v=[{type:18,ancestor:f,descendant:h}];return f.checks=t.checks,t.checks=v,e.compoundCount++,h}},{name:"subject",modifier:!0,regex:Ot.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return _t("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var a=e[e.length-1].checks[0],i=null==a?null:a.type;11===i?a.type=13:10===i&&(a.type=14,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];Mo.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var rp=function(e){for(var t,n,a,i=0;i<Mo.length;i++){var s=Mo[i],o=s.name,l=e.match(s.regexObj);if(null!=l){n=l,t=s,a=o,e=e.substring(l[0].length);break}}return{expr:t,match:n,name:a,remaining:e}},sp={parse:function(e){var t=this,n=t.inputText=e,a=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);return t&&(e=e.substring(t[0].length)),e}(n);;){var i=rp(n);if(null==i.expr)return _t("The selector `"+e+"`is invalid"),!1;var s=i.match.slice(1),o=i.expr.populate(t,a,s);if(!1===o)return!1;if(null!=o&&(a=o),(n=i.remaining).match(/^\s*$/))break}var l=t[t.length-1];null!=t.currentSubject&&(l.subject=t.currentSubject),l.edgeCount=t.edgeCount,l.compoundCount=t.compoundCount;for(var u=0;u<t.length;u++){var c=t[u];if(c.compoundCount>0&&c.edgeCount>0)return _t("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return _t("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&_t("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(c){return c??""},t=function(c){return oe(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},i=function(c,d){return c.checks.reduce(function(f,h,v){return f+(d===c&&0===v?"$":"")+function(c,d){var h=c.value;switch(c.type){case 0:var v=e(h);return v.substring(0,v.length-1);case 3:return"["+c.field+n(e(c.operator))+t(h)+"]";case 5:var w=c.field;return"["+e(c.operator)+w+"]";case 4:return"["+c.field+"]";case 6:return"[["+c.field+n(e(c.operator))+t(h)+"]]";case 7:return h;case 8:return"#"+h;case 9:return"."+h;case 17:case 15:return i(c.parent,d)+n(">")+i(c.child,d);case 18:case 16:return i(c.ancestor,d)+" "+i(c.descendant,d);case 19:var V=i(c.left,d),F=i(c.subject,d),U=i(c.right,d);return V+(V.length>0?" ":"")+F+U;case 20:return""}}(h,d)},"")},s="",o=0;o<this.length;o++){var l=this[o];s+=i(l,l.subject),this.length>1&&o<this.length-1&&(s+=", ")}return this.toStringCache=s,s}},Oc=function(e,t,n){var a,l,u,i=oe(e),s=_e(e),o=oe(n),c=!1,d=!1,f=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(i||o||c)&&(l=i||s?""+e:"",u=""+n),c&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),t){case"*=":a=l.indexOf(u)>=0;break;case"$=":a=l.indexOf(u,l.length-u.length)>=0;break;case"^=":a=0===l.indexOf(u);break;case"=":a=e===n;break;case">":f=!0,a=e>n;break;case">=":f=!0,a=e>=n;break;case"<":f=!0,a=e<n;break;case"<=":f=!0,a=e<=n;break;default:a=!1}return d&&(null!=e||!f)&&(a=!a),a},Oo=function(e,t){return e.data(t)},Yt=[],Ut=function(e,t){return e.checks.every(function(n){return Yt[n.type](n,t)})};Yt[0]=function(r,e){var t=r.value;return"*"===t||t===e.group()},Yt[7]=function(r,e){return function(e,t){return Qg[e](t)}(r.value,e)},Yt[8]=function(r,e){var t=r.value;return e.id()===t},Yt[9]=function(r,e){return e.hasClass(r.value)},Yt[6]=function(r,e){var n=r.operator,a=r.value;return Oc(function(e,t){return e[t]()}(e,r.field),n,a)},Yt[3]=function(r,e){var n=r.operator,a=r.value;return Oc(Oo(e,r.field),n,a)},Yt[5]=function(r,e){var n=r.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(Oo(e,r.field),n)},Yt[4]=function(r,e){return function(e){return void 0!==e}(Oo(e,r.field))},Yt[10]=function(r,e){var t=r.nodes[0],n=r.nodes[1],a=e.source(),i=e.target();return Ut(t,a)&&Ut(n,i)||Ut(n,a)&&Ut(t,i)},Yt[14]=function(r,e){return Ut(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Ut(r.neighbor,t)})},Yt[11]=function(r,e){return Ut(r.source,e.source())&&Ut(r.target,e.target())},Yt[12]=function(r,e){return Ut(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Ut(r.target,t)})},Yt[13]=function(r,e){return Ut(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Ut(r.source,t)})},Yt[15]=function(r,e){return Ut(r.child,e)&&Ut(r.parent,e.parent())},Yt[17]=function(r,e){return Ut(r.parent,e)&&e.children().some(function(t){return Ut(r.child,t)})},Yt[16]=function(r,e){return Ut(r.descendant,e)&&e.ancestors().some(function(t){return Ut(r.ancestor,t)})},Yt[18]=function(r,e){return Ut(r.ancestor,e)&&e.descendants().some(function(t){return Ut(r.descendant,t)})},Yt[19]=function(r,e){return Ut(r.subject,e)&&Ut(r.left,e)&&Ut(r.right,e)},Yt[20]=function(){return!0},Yt[1]=function(r,e){return r.value.has(e)},Yt[2]=function(r,e){return(0,r.value)(e)};var fp={matches:function(e){for(var n=0;n<this.length;n++)if(Ut(this[n],e))return!0;return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&8===t[0].checks[0].type)return e.getElementById(t[0].checks[0].value).collection();var n=function(i){for(var s=0;s<t.length;s++)if(Ut(t[s],i))return!0;return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},nn=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||oe(e)&&e.match(/^\s*$/)||(vt(e)?this.addQuery({checks:[{type:1,value:e.collection()}]}):Be(e)?this.addQuery({checks:[{type:2,value:e}]}):oe(e)?this.parse(e)||(this.invalid=!0):Xt("A selector must be created from a string; found "))},an=nn.prototype;[sp,fp].forEach(function(r){return mt(an,r)}),an.text=function(){return this.inputText},an.size=function(){return this.length},an.eq=function(r){return this[r]},an.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()},an.addQuery=function(r){this[this.length++]=r},an.selector=an.toString;var sn={allAre:function(e){var t=new nn(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new nn(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?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(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};sn.allAreNeighbours=sn.allAreNeighbors,sn.has=sn.contains,sn.equal=sn.equals=sn.same;var ba,Bc,Er=function(e,t){return function(a,i,s,o){var c,l=a,u=this;if(null==l?c="":vt(l)&&1===l.length&&(c=l.id()),1===u.length&&c){var d=u[0]._private,f=d.traversalCache=d.traversalCache||{},h=f[t]=f[t]||[],v=yn(c);return h[v]||(h[v]=e.call(u,a,i,s,o))}return e.call(u,a,i,s,o)}},Un={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var s=this[a]._private.parent;s&&t.push(s)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var a=0;a<n.length;a++)t.push(n[a]);n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var i=this[n].parents();t=(t=t||i).intersect(i)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:Er(function(r){for(var e=[],t=0;t<this.length;t++)for(var a=this[t]._private.children,i=0;i<a.length;i++)e.push(a[i]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function n(a){for(var i=0;i<a.length;i++){var s=a[i];t.push(s),s.children().nonempty()&&n(s.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function Po(r,e,t,n){for(var a=[],i=new Pn,o=r.cy().hasCompoundNodes(),l=0;l<r.length;l++){var u=r[l];t?a.push(u):o&&n(a,i,u)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),o&&n(a,i,c)}return r}function Pc(r,e,t){if(t.isParent())for(var n=t._private.children,a=0;a<n.length;a++){var i=n[a];e.has(i.id())||r.push(i)}}function kc(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}function hp(r,e,t){kc(r,e,t),Pc(r,e,t)}Un.forEachDown=function(r){return Po(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Pc)},Un.forEachUp=function(r){return Po(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],kc)},Un.forEachUpAndDown=function(r){return Po(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],hp)},Un.ancestors=Un.parents,ba=Bc={data:Ft.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:Ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Ft.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Ft.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},ba.attr=ba.data,ba.removeAttr=ba.removeData;var vp=Bc,hi={};function ko(r){return function(e){var t=this;if(void 0===e&&(e=!0),0===t.length);else if(t.isNode()&&!t.removed()){for(var n=0,a=t[0],i=a._private.edges,s=0;s<i.length;s++){var o=i[s];!e&&o.isLoop()||(n+=r(a,o))}return n}}}function Xn(r,e){return function(t){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i][r](t);void 0!==o&&(void 0===n||e(o,n))&&(n=o)}return n}}mt(hi,{degree:ko(function(r,e){return e.source().same(e.target())?2:1}),indegree:ko(function(r,e){return e.target().same(r)?1:0}),outdegree:ko(function(r,e){return e.source().same(r)?1:0})}),mt(hi,{minDegree:Xn("degree",function(r,e){return r<e}),maxDegree:Xn("degree",function(r,e){return r>e}),minIndegree:Xn("indegree",function(r,e){return r<e}),maxIndegree:Xn("indegree",function(r,e){return r>e}),minOutdegree:Xn("outdegree",function(r,e){return r<e}),maxOutdegree:Xn("outdegree",function(r,e){return r>e})}),mt(hi,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var Ar,_c,Fc=function(e,t,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var s=i._private.position,o={x:null!=t.x?t.x-s.x:0,y:null!=t.y?t.y-s.y:0};i.isParent()&&!(0===o.x&&0===o.y)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},Gc={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){Fc(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Ar=_c={position:Ft.data(Gc),silentPosition:Ft.data(mt({},Gc,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){Fc(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(Oe(e))t?this.silentPosition(e):this.position(e);else if(Be(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o,s=this[i];(o=n(s,i))&&(t?s.silentPosition(o):s.position(o))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var a;if(Oe(e)?(a={x:_e(e.x)?e.x:0,y:_e(e.y)?e.y:0},n=t):oe(e)&&_e(t)&&((a={x:0,y:0})[e]=t),null!=a){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 l=o.position(),u={x:l.x+a.x,y:l.y+a.y};n?o.silentPosition(u):o.position(u)}}i.endBatch()}return this},silentShift:function(e,t){return Oe(e)?this.shift(e,!0):oe(e)&&_e(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],a=this.cy(),i=a.zoom(),s=a.pan(),o=Oe(e)?e:void 0,l=void 0!==o||void 0!==t&&oe(e);if(n&&n.isNode()){if(!l){var d=n.position();return o=Za(d,i,s),void 0===e?o:o[e]}for(var u=0;u<this.length;u++){var c=this[u];void 0!==t?c.position(e,(t-s[e])/i):void 0!==o&&c.position(Jl(o,i,s))}}else if(!l)return;return this},relativePosition:function(e,t){var n=this[0],a=this.cy(),i=Oe(e)?e:void 0,s=void 0!==i||void 0!==t&&oe(e),o=a.hasCompoundNodes();if(n&&n.isNode()){if(!s){var v=n.position(),b=o?n.parent():null,y=b&&b.length>0;y&&(b=b[0]);var w=y?b.position():{x:0,y:0};return i={x:v.x-w.x,y:v.y-w.y},void 0===e?i:i[e]}for(var l=0;l<this.length;l++){var u=this[l],c=o?u.parent():null,d=c&&c.length>0;d&&(c=c[0]);var h=d?c.position():{x:0,y:0};void 0!==t?u.position(e,t+h[e]):void 0!==i&&u.position({x:i.x+h.x,y:i.y+h.y})}}else if(!s)return;return this}},Ar.modelPosition=Ar.point=Ar.position,Ar.modelPositions=Ar.points=Ar.positions,Ar.renderedPoint=Ar.renderedPosition,Ar.relativePoint=Ar.relativePosition;var Wn,on,gp=_c,jn=function(e){switch(e){case"left":case"right-inside":return"left";case"right":case"left-inside":return"right";default:return"center"}},Yn=function(e){switch(e){case"top":case"bottom-inside":return"top";case"bottom":case"top-inside":return"bottom";default:return"center"}};Wn=on={},on.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),a=t.pan(),i=e.x1*n+a.x,s=e.x2*n+a.x,o=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}},on.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this):this},on.updateCompoundBounds=function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(s){if(s.isParent()){var o=s._private,l=s.children(),u="include"===s.pstyle("compound-sizing-wrt-labels").value,c={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=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),f=o.position;(0===d.w||0===d.h)&&((d={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue}).x1=f.x-d.w/2,d.x2=f.x+d.w/2,d.y1=f.y-d.h/2,d.y2=f.y+d.h/2);var b=c.width.left.value;"px"===c.width.left.units&&c.width.val>0&&(b=100*b/c.width.val);var y=c.width.right.value;"px"===c.width.right.units&&c.width.val>0&&(y=100*y/c.width.val);var g=c.height.top.value;"px"===c.height.top.units&&c.height.val>0&&(g=100*g/c.height.val);var w=c.height.bottom.value;"px"===c.height.bottom.units&&c.height.val>0&&(w=100*w/c.height.val);var C=h(c.width.val-d.w,b,y),N=C.biasDiff,z=C.biasComplementDiff,V=h(c.height.val-d.h,g,w),F=V.biasDiff,U=V.biasComplementDiff;o.autoPadding=function v(q,Z,K,J){if("%"!==K.units)return"px"===K.units?K.pfValue:0;switch(J){case"width":return q>0?K.pfValue*q:0;case"height":return Z>0?K.pfValue*Z:0;case"average":return q>0&&Z>0?K.pfValue*(q+Z)/2:0;case"min":return q>0&&Z>0?q>Z?K.pfValue*Z:K.pfValue*q:0;case"max":return q>0&&Z>0?q>Z?K.pfValue*q:K.pfValue*Z:0;default:return 0}}(d.w,d.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(d.w,c.width.val),f.x=(-N+d.x1+d.x2+z)/2,o.autoHeight=Math.max(d.h,c.height.val),f.y=(-F+d.y1+d.y2+U)/2}function h(q,Z,K){var J=0,Q=0,le=Z+K;return q>0&&le>0&&(J=Z/le*q,Q=K/le*q),{biasDiff:J,biasComplementDiff:Q}}}for(var n=0;n<this.length;n++){var a=this[n],i=a._private;(!i.compoundBoundsClean||r)&&(t(a),e.batching()||(i.compoundBoundsClean=!0))}return this};var Tr=function(e){return e===1/0||e===-1/0?0:e},Ir=function(e,t,n,a,i){a-t===0||i-n===0||null==t||null==n||null==a||null==i||(e.x1=t<e.x1?t: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)},ln=function(e,t){return null==t?e:Ir(e,t.x1,t.y1,t.x2,t.y2)},wa=function(e,t,n){return vr(e,t,n)},vi=function(e,t,n){if(!t.cy().headless()){var l,u,a=t._private,i=a.rstyle,s=i.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(l=i.srcX,u=i.srcY):"target"===n?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var c=a.arrowBounds=a.arrowBounds||{},d=c[n]=c[n]||{};d.x1=l-s,d.y1=u-s,d.x2=l+s,d.y2=u+s,d.w=d.x2-d.x1,d.h=d.y2-d.y1,Qa(d,1),Ir(e,d.x1,d.y1,d.x2,d.y2)}}},Bo=function(e,t,n){if(!t.cy().headless()){var a,i=t._private,s=i.rstyle;if(t.pstyle((a=n?n+"-":"")+"label").strValue){var K,J,Q,le,l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),c=wa(s,"labelWidth",n),d=wa(s,"labelHeight",n),f=wa(s,"labelX",n),h=wa(s,"labelY",n),v=t.pstyle(a+"text-margin-x").pfValue,b=t.pstyle(a+"text-margin-y").pfValue,y=t.isEdge(),g=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,N=t.pstyle("text-border-width").pfValue/2,z=t.pstyle("text-background-padding").pfValue,F=d,U=c,q=U/2,Z=F/2;if(y)K=f-q,J=f+q,Q=h-Z,le=h+Z;else{switch(jn(l.value)){case"left":K=f-U,J=f;break;case"center":K=f-q,J=f+q;break;case"right":K=f,J=f+U}switch(Yn(u.value)){case"top":Q=h-F,le=h;break;case"center":Q=h-Z,le=h+Z;break;case"bottom":Q=h,le=h+F}}var de=v-Math.max(w,N)-z-2,he=v+Math.max(w,N)+z+2,ue=b-Math.max(w,N)-z-2,ge=b+Math.max(w,N)+z+2;K+=de,J+=he,Q+=ue,le+=ge;var Se=n||"main",Le=i.labelBounds,ye=Le[Se]=Le[Se]||{};ye.x1=K,ye.y1=Q,ye.x2=J,ye.y2=le,ye.w=J-K,ye.h=le-Q,ye.leftPad=de,ye.rightPad=he,ye.topPad=ue,ye.botPad=ge;var De=y&&"autorotate"===g.strValue;if(De||null!=g.pfValue&&0!==g.pfValue){var $e=De?wa(i.rstyle,"labelAngle",n):g.pfValue,Xe=Math.cos($e),Qe=Math.sin($e),tt=(K+J)/2,at=(Q+le)/2;if(!y){switch(jn(l.value)){case"left":tt=J;break;case"right":tt=K}switch(Yn(u.value)){case"top":at=le;break;case"bottom":at=Q}}var He=function(Et,bt){return{x:(Et-=tt)*Xe-(bt-=at)*Qe+tt,y:Et*Qe+bt*Xe+at}},Te=He(K,Q),Ie=He(K,le),Pe=He(J,Q),ze=He(J,le);K=Math.min(Te.x,Ie.x,Pe.x,ze.x),J=Math.max(Te.x,Ie.x,Pe.x,ze.x),Q=Math.min(Te.y,Ie.y,Pe.y,ze.y),le=Math.max(Te.y,Ie.y,Pe.y,ze.y)}var rt=Se+"Rot",ct=Le[rt]=Le[rt]||{};ct.x1=K,ct.y1=Q,ct.x2=J,ct.y2=le,ct.w=J-K,ct.h=le-Q,Ir(e,K,Q,J,le),Ir(i.labelBounds.all,K,Q,J,le)}return e}},zc=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,s=t.pstyle("outline-width").value+t.pstyle("outline-offset").value;Vc(e,t,n,s,"outside",s/2)}},Vc=function(e,t,n,a,i,s){if(!(0===n||a<=0||"inside"===i)){var l=t.cy().renderer(),u=l.nodeShapes[l.getNodeShape(t)];if(u){var c=t.position(),d=c.x,f=c.y,h=t.width(),v=t.height();if(u.hasMiterBounds){"center"===i&&(a/=2);var b=u.miterBounds(d,f,h,v,a);ln(e,b)}else null!=s&&s>0&&ei(e,[s,s,s,s])}}},Hc=function(e){var t=0,n=function(s){return(s?1:0)<<t++},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))+n(e.includeOutlines)},Uc=function(e){var t=function(o){return Math.round(o)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return Vl([t(n.x),t(n.y),t(a.x),t(a.y)])}var i=e.position();return Vl([t(i.x),t(i.y)])},Xc=function(e,t){var a,n=e._private,i=e.isEdge(),o=(null==t?jc:Hc(t))===jc;if(null==n.bbCache?(a=function(e,t){var c,d,f,h,v,b,n=e._private.cy,a=n.styleEnabled(),i=n.headless(),s=gr(),o=e._private,l=e.isNode(),u=e.isEdge(),y=o.rstyle,g=l&&a?e.pstyle("bounds-expansion").pfValue:[0],w=function(Nt){return"none"!==Nt.pstyle("display").value},C=!a||w(e)&&(!u||w(e.source())&&w(e.target()));if(C){var z=0;a&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(z=e.pstyle("overlay-padding").value);var F=0;a&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(F=e.pstyle("underlay-padding").value);var U=Math.max(z,F),Z=0;if(a&&(Z=e.pstyle("width").pfValue/2),l&&t.includeNodes){var K=e.position();v=K.x,b=K.y;var Q=e.outerWidth()/2,de=e.outerHeight()/2;Ir(s,c=v-Q,f=b-de,d=v+Q,h=b+de),a&&zc(s,e),a&&t.includeOutlines&&!i&&zc(s,e),a&&function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,a=t.pstyle("border-width").pfValue,i=t.pstyle("border-position").value;Vc(e,t,n,a,i)}}(s,e)}else if(u&&t.includeEdges)if(a&&!i){var he=e.pstyle("curve-style").strValue;if(c=Math.min(y.srcX,y.midX,y.tgtX),d=Math.max(y.srcX,y.midX,y.tgtX),f=Math.min(y.srcY,y.midY,y.tgtY),h=Math.max(y.srcY,y.midY,y.tgtY),Ir(s,c-=Z,f-=Z,d+=Z,h+=Z),"haystack"===he){var ue=y.haystackPts;if(ue&&2===ue.length){if((c=ue[0].x)>(d=ue[1].x)){var ge=c;c=d,d=ge}if((f=ue[0].y)>(h=ue[1].y)){var Se=f;f=h,h=Se}Ir(s,c-Z,f-Z,d+Z,h+Z)}}else if("bezier"===he||"unbundled-bezier"===he||Kr(he,"segments")||Kr(he,"taxi")){var Le;switch(he){case"bezier":case"unbundled-bezier":Le=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":Le=y.linePts}if(null!=Le)for(var ye=0;ye<Le.length;ye++){var De=Le[ye];Ir(s,c=De.x-Z,f=De.y-Z,d=De.x+Z,h=De.y+Z)}}}else{var $e=e.source().position(),Qe=e.target().position();if((c=$e.x)>(d=Qe.x)){var tt=c;c=d,d=tt}if((f=$e.y)>(h=Qe.y)){var at=f;f=h,h=at}Ir(s,c-=Z,f-=Z,d+=Z,h+=Z)}if(a&&t.includeEdges&&u&&(vi(s,e,"mid-source"),vi(s,e,"mid-target"),vi(s,e,"source"),vi(s,e,"target")),a&&"yes"===e.pstyle("ghost").value){var Te=e.pstyle("ghost-offset-x").pfValue,Ie=e.pstyle("ghost-offset-y").pfValue;Ir(s,s.x1+Te,s.y1+Ie,s.x2+Te,s.y2+Ie)}var Pe=o.bodyBounds=o.bodyBounds||{};eu(Pe,s),ei(Pe,g),Qa(Pe,1),a&&Ir(s,(c=s.x1)-U,(f=s.y1)-U,(d=s.x2)+U,(h=s.y2)+U);var ze=o.overlayBounds=o.overlayBounds||{};eu(ze,s),ei(ze,g),Qa(ze,1);var rt=o.labelBounds=o.labelBounds||{};null!=rt.all?function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0}(rt.all):rt.all=gr(),a&&t.includeLabels&&(t.includeMainLabels&&Bo(s,e,null),u&&(t.includeSourceLabels&&Bo(s,e,"source"),t.includeTargetLabels&&Bo(s,e,"target")))}return s.x1=Tr(s.x1),s.y1=Tr(s.y1),s.x2=Tr(s.x2),s.y2=Tr(s.y2),s.w=Tr(s.x2-s.x1),s.h=Tr(s.y2-s.y1),s.w>0&&s.h>0&&C&&(ei(s,g),Qa(s,1)),s}(e,xa),n.bbCache=a,n.bbCachePosKey=Uc(e)):a=n.bbCache,!o){var l=e.isNode();a=gr(),(t.includeNodes&&l||t.includeEdges&&!l)&&ln(a,t.includeOverlays?n.overlayBounds:n.bodyBounds),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ln(a,n.labelBounds.all):(t.includeMainLabels&&ln(a,n.labelBounds.mainRot),t.includeSourceLabels&&ln(a,n.labelBounds.sourceRot),t.includeTargetLabels&&ln(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},xa={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},jc=Hc(xa),Yc=ir(xa);on.boundingBox=function(r){var e,t=void 0===r||void 0===r.useCache||!0===r.useCache,n=Mn(function(c){var d=c._private;return null==d.bbCache||d.styleDirty||d.bbCachePosKey!==Uc(c)},function(c){return c.id()});if(t&&1===this.length&&!n(this[0]))r=void 0===r?xa:Yc(r),e=Xc(this[0],r);else{e=gr();var a=Yc(r=r||xa),i=this,o=i.cy().styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),o&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var l=0;l<i.length;l++){var u=i[l];n(u)&&u.dirtyBoundingBoxCache(),ln(e,Xc(u,a))}}return e.x1=Tr(e.x1),e.y1=Tr(e.y1),e.x2=Tr(e.x2),e.y2=Tr(e.y2),e.w=Tr(e.x2-e.x1),e.h=Tr(e.y2-e.y1),e},on.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._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},on.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),a=t.collection();if(n&&(a=e.filter(function(u){return u.isParent()}),e=e.not(a)),Oe(r)){var i=r;r=function(){return i}}t.startBatch(),e.forEach(function(c,d){return c._private.bbAtOldPos=r(c,d)}).silentPositions(r),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return e.silentPositions(function(c){return c._private.bbAtOldPos}),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),l},Wn.boundingbox=Wn.bb=Wn.boundingBox,Wn.renderedBoundingbox=Wn.renderedBoundingBox;var Ea,Ta,bp=on;Ea=Ta={};var Wc=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),Ea[e.name]=function(){var n=this[0],a=n._private;if(n){if(a.cy._private.styleEnabled){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var o=n.pstyle(e.name);return"label"===o.strValue?(n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0):o.pfValue}return 1}},Ea["outer"+e.uppercaseName]=function(){var n=this[0];if(n){if(n._private.cy._private.styleEnabled){var o=n[e.name](),l=n.pstyle("border-position").value;return o+("center"===l?n.pstyle("border-width").pfValue:"outside"===l?2*n.pstyle("border-width").pfValue:0)+2*n.padding()}return 1}},Ea["rendered"+e.uppercaseName]=function(){var n=this[0];if(n)return n[e.name]()*this.cy().zoom()},Ea["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n)return n[e.outerName]()*this.cy().zoom()}};Wc({name:"width"}),Wc({name:"height"}),Ta.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),void 0!==e.autoPadding?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue},Ta.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()},Ta.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var wp=Ta,qc={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},Np=Object.keys(qc).reduce(function(r,e){var t=qc[e],n=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(e);return r[e]=function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)}(this,t.get)},r[n]=t.mult?function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return t(e).map(function(s){return Za(s,i,a)})}}(this,t.get)}:function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return Za(t(e),n.zoom(),n.pan())}}(this,t.get)},r},{}),Rp=mt({},gp,bp,wp,Np),$c=function(e,t){this.recycle(e,t)};function Ca(){return!1}function gi(){return!0}$c.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Ca,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?gi:Ca):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,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=gi;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=gi;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=gi,this.stopPropagation()},isDefaultPrevented:Ca,isPropagationStopped:Ca,isImmediatePropagationStopped:Ca};var Kc=/^([^.]+)(\.(?:[^.]+))?$/,Zc={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},Jc=Object.keys(Zc),Op={};function pi(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Op,e=arguments.length>1?arguments[1]:void 0,t=0;t<Jc.length;t++){var n=Jc[t];this[n]=r[n]||Zc[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var un=pi.prototype,Qc=function(e,t,n,a,i,s,o){Be(a)&&(i=a,a=null),o&&(s=null==s?o:mt({},s,o));for(var l=Ye(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!Sr(c)){var d=c.match(Kc);if(d&&!1===t(e,c,d[1],d[2]?d[2]:null,a,i,s))break}}},ed=function(e,t){return e.addEventFields(e.context,t),new $c(t.type,t)};un.on=un.addListener=function(r,e,t,n,a){return Qc(this,function(i,s,o,l,u,c,d){Be(c)&&i.listeners.push({event:s,callback:c,type:o,namespace:l,qualifier:u,conf:d})},r,e,t,n,a),this},un.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})},un.removeListener=un.off=function(r,e,t,n){var a=this;0!==this.emitting&&(this.listeners=function(e){return e.slice()}(this.listeners));for(var i=this.listeners,s=function(u){var c=i[u];Qc(a,function(d,f,h,v,b,y){if((c.type===h||"*"===r)&&(!v&&".*"!==c.namespace||c.namespace===v)&&(!b||d.qualifierCompare(c.qualifier,b))&&(!y||c.callback===y))return i.splice(u,1),!1},r,e,t,n)},o=i.length-1;o>=0;o--)s(o);return this},un.removeAllListeners=function(){return this.removeListener("*")},un.emit=un.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Ye(e)||(e=[e]),function(e,t,n){if(function(e){return"event"===we(e)}(n))t(e,n);else if(Oe(n))t(e,ed(e,n));else for(var a=Ye(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var s=a[i];if(!Sr(s)){var o=s.match(Kc);o&&t(e,ed(e,{type:o[1],namespace:o[2]?o[2]:null,target:e.context}))}}}(this,function(i,s){null!=t&&(a=(n=[{event:s.event,type:s.type,namespace:s.namespace,callback:t}]).length);for(var o=function(){var c=n[l];if(c.type===s.type&&(!c.namespace||c.namespace===s.namespace||".*"===c.namespace)&&i.eventMatches(i.context,c,s)){var d=[s];null!=e&&function(e,t){for(var n=0;n<t.length;n++)e.push(t[n])}(d,e),i.beforeEmit(i.context,c,s),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(v){return v!==c}));var f=i.callbackContext(i.context,c,s),h=c.callback.apply(f,d);i.afterEmit(i.context,c,s),!1===h&&(s.stopPropagation(),s.preventDefault())}},l=0;l<a;l++)o();i.bubble(i.context)&&!s.isPropagationStopped()&&i.parent(i.context).emit(s,e)},r),this.emitting--,this};var kp={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return null==a||e!==n.target&&It(n.target)&&a.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},yi=function(e){return oe(e)?new nn(e):e},td={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new pi(kp,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().on(e,a,n);return this},removeListener:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,a,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().one(e,a,n);return this},once:function(e,t,n){for(var a=yi(t),i=0;i<this.length;i++)this[i].emitter().on(e,a,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Ft.eventAliasesOn(td);var rd={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var a=this[n];a.isNode()?e.push(a):t.push(a)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(oe(e)||vt(e))return new nn(e).filter(this);if(Be(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var s=a[i];(t?e.apply(t,[s,i,a]):e(s,i,a))&&n.push(s)}return n}return this.spawn()},not:function(e){if(e){oe(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var a=this[n];e.has(a)||t.push(a)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(oe(e))return this.filter(e);for(var n=this.spawn(),s=this.length<e.length,o=s?this:e,l=s?e:this,u=0;u<o.length;u++){var c=o[u];l.has(c)&&n.push(c)}return n},xor:function(e){var t=this._private.cy;oe(e)&&(e=t.$(e));var n=this.spawn(),i=e,s=function(l,u){for(var c=0;c<l.length;c++){var d=l[c];u.hasElementWithId(d._private.data.id)||n.push(d)}};return s(this,i),s(i,this),n},diff:function(e){var t=this._private.cy;oe(e)&&(e=t.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=e,l=function(c,d,f){for(var h=0;h<c.length;h++){var v=c[h];d.hasElementWithId(v._private.data.id)?i.merge(v):f.push(v)}};return l(this,o,n),l(o,this,a),{left:n,right:a,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(oe(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var s=e[i];!this.has(s)&&a.push(s)}return a},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&oe(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=t.map,s=0;s<e.length;s++){var o=e[s],l=o._private.data.id;if(!i.has(l)){var c=this.length++;this[c]=o,i.set(l,{ele:o,index:c})}}return this},unmergeAt:function(e){var n=this[e].id(),i=this._private.map;if(this[e]=void 0,i.delete(n),this.length>1&&e!==this.length-1){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){var i=this._private.map.get((e=e[0])._private.data.id);return i?(this.unmergeAt(i.index),this):this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&oe(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=0;a<e.length;a++)this.unmergeOne(e[a]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],a=this,i=0;i<a.length;i++){var s=a[i],o=t?e.apply(t,[s,i,a]):e(s,i,a);n.push(o)}return n},reduce:function(e,t){for(var n=t,a=this,i=0;i<a.length;i++)n=e(n,a[i],i,a);return n},max:function(e,t){for(var a,n=-1/0,i=this,s=0;s<i.length;s++){var o=i[s],l=t?e.apply(t,[o,s,i]):e(o,s,i);l>n&&(n=l,a=o)}return{value:n,ele:a}},min:function(e,t){for(var a,n=1/0,i=this,s=0;s<i.length;s++){var o=i[s],l=t?e.apply(t,[o,s,i]):e(o,s,i);l<n&&(n=l,a=o)}return{value:n,ele:a}}},kt=rd;kt.u=kt["|"]=kt["+"]=kt.union=kt.or=kt.add,kt["\\"]=kt["!"]=kt["-"]=kt.difference=kt.relativeComplement=kt.subtract=kt.not,kt.n=kt["&"]=kt["."]=kt.and=kt.intersection=kt.intersect,kt["^"]=kt["(+)"]=kt["(-)"]=kt.symmetricDifference=kt.symdiff=kt.xor,kt.fnFilter=kt.filterFn=kt.stdFilter=kt.filter,kt.complement=kt.abscomp=kt.absoluteComplement;var e,nd=function(e,t){var a=e.cy().hasCompoundNodes();function i(c){var d=c.pstyle("z-compound-depth");return"auto"===d.value?a?c.zDepth():0:"bottom"===d.value?-1:"top"===d.value?ds:0}var s=i(e)-i(t);if(0!==s)return s;function o(c){return"auto"===c.pstyle("z-index-compare").value&&c.isNode()?1:0}var l=o(e)-o(t);if(0!==l)return l;var u=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==u?u:e.poolIndex()-t.poolIndex()},mi={forEach:function(e,t){if(Be(e))for(var n=this.length,a=0;a<n;a++){var i=this[a];if(!1===(t?e.apply(t,[i,a,this]):e(i,a,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],a=this.length;null==t&&(t=a),null==e&&(e=0),e<0&&(e=a+e),t<0&&(t=a+t);for(var i=e;i>=0&&i<t&&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 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!Be(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(nd)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var a=t.data.parent?e.parents().size():0;return e.isParent()?a:ds-1}var s=t.target,o=t.source.zDepth(),l=s.zDepth();return Math.max(o,l,0)}}};mi.each=mi.forEach,e="undefined",(typeof Symbol>"u"?"undefined":pe(Symbol))!=e&&pe(Symbol.iterator)!=e&&(mi[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,s=this.length;return ae({next:function(){return i<s?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})});var Fp=ir({nodeDimensionsIncludeLabels:!1}),bi={layoutDimensions:function(e){var t;if(e=Fp(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return(0===t.w||0===t.h)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var a=this.nodes().filter(function(z){return!z.isParent()}),i=this.cy(),s=t.eles,o=function(V){return V.id()},l=Mn(n,o);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=t.spacingFactor&&1!==t.spacingFactor,f=function(){if(!c)return null;for(var V=gr(),F=0;F<a.length;F++){var q=l(a[F],F);Ql(V,q.x,q.y)}return V}(),h=Mn(function(z,V){var F=l(z,V);return c&&(F=function(V,F,U){var q_x=F.x1+F.w/2,q_y=F.y1+F.h/2;return{x:q_x+(U.x-q_x)*V,y:q_y+(U.y-q_y)*V}}(Math.abs(t.spacingFactor),f,F)),null!=t.transform&&(F=t.transform(z,F)),F},o);if(t.animate){for(var v=0;v<a.length;v++){var b=a[v],y=h(b,v);if(null==t.animateFilter||t.animateFilter(b,v)){var w=b.animation({position:y,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}else b.position(y)}if(t.fit){var C=i.animation({fit:{boundingBox:s.boundingBoxAt(h),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(C)}else if(void 0!==t.zoom&&void 0!==t.pan){var N=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(N)}e.animations.forEach(function(z){return z.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),Vn.all(e.animations.map(function(z){return z.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(h),t.fit&&i.fit(t.eles,t.padding),null!=t.zoom&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(mt({},e,{eles:this}))}};function ad(r,e,t){var i,n=t._private,a=n.styleCache=n.styleCache||[];return null!=(i=a[r])||(i=a[r]=e(t)),i}function wi(r,e){return r=yn(r),function(n){return ad(r,e,n)}}function xi(r,e){r=yn(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return ad(r,t,a)}}bi.createLayout=bi.makeLayout=bi.layout;var sr={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),a=t.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var n,e=this.cy(),t=function(i){return i._private.styleCache=null};return e.hasCompoundNodes()?((n=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(n.connectedEdges()),n.forEach(t)):this.forEach(function(a){t(a),a.connectedEdges().forEach(t)}),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var i=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(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 t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],a=n.cy();if(a.styleEnabled()&&n)return n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n)),n._private.style[e]??(t?a.style().getDefaultProperty(e):null)},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(Oe(e))i.applyBypass(this,e,a),this.emitAndNotify("style");else if(oe(e)){if(void 0===t){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}i.applyBypass(this,e,t,a),this.emitAndNotify("style")}else if(void 0===e){var l=this[0];return l?i.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,a=t.style(),i=this;if(void 0===e)for(var s=0;s<i.length;s++)a.removeAllBypasses(i[s],n);else{e=e.split(/\s+/);for(var l=0;l<i.length;l++)a.removeBypasses(i[l],e,n)}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!t)return i;var s=a.data.parent?n.parents():null;if(s)for(var o=0;o<s.length;o++)i*=s[o].pstyle("opacity").value;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();return t?n?0===t.effectiveOpacity():0===t.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function _o(r,e){var n=r._private.data.parent?r.parents():null;if(n)for(var a=0;a<n.length;a++)if(!e(n[a]))return!1;return!0}function Fo(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,n=r.parentOk||r.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||_o(i,n);var l=o.source,u=o.target;return t(l)&&(!s||_o(l,t))&&(l===u||t(u)&&(!s||_o(u,t)))}}}var qn=wi("eleTakesUpSpace",function(r){return"element"===r.pstyle("display").value&&0!==r.width()&&(!r.isNode()||0!==r.height())});sr.takesUpSpace=xi("takesUpSpace",Fo({ok:qn}));var Gp=wi("eleInteractive",function(r){return"yes"===r.pstyle("events").value&&"visible"===r.pstyle("visibility").value&&qn(r)}),zp=wi("parentInteractive",function(r){return"visible"===r.pstyle("visibility").value&&qn(r)});sr.interactive=xi("interactive",Fo({ok:Gp,parentOk:zp,edgeOkViaNode:qn})),sr.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var Vp=wi("eleVisible",function(r){return"visible"===r.pstyle("visibility").value&&0!==r.pstyle("opacity").pfValue&&qn(r)});sr.visible=xi("visible",Fo({ok:Vp,edgeOkViaNode:qn})),sr.hidden=function(){var r=this[0];if(r)return!r.visible()},sr.isBundledBezier=xi("isBundledBezier",function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()}),sr.bypass=sr.css=sr.style,sr.renderedCss=sr.renderedStyle,sr.removeBypass=sr.removeCss=sr.removeStyle,sr.pstyle=sr.parsedStyle;var cn={};function id(r){return function(){var e=arguments,t=[];if(2===e.length)this.on(r.event,e[0],e[1]);else if(1===e.length&&Be(e[0]))this.on(r.event,e[0]);else if(0===e.length||1===e.length&&Ye(e[0])){for(var s=1===e.length?e[0]:null,o=0;o<this.length;o++){var l=this[o],u=!r.ableField||l._private[r.ableField],c=l._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(l);if(void 0!==d&&(u=d,!d))return this}u&&(l._private[r.field]=r.value,c&&t.push(l))}var f=this.spawn(t);f.updateStyle(),f.emit(r.event),s&&f.emit(s)}return this}}function $n(r){cn[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(void 0!==t)return t}return e._private[r.field]}},cn[r.on]=id({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),cn[r.off]=id({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}$n({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),$n({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),$n({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),$n({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),cn.deselect=cn.unselect,cn.grabbed=function(){var r=this[0];if(r)return r._private.grabbed},$n({field:"active",on:"activate",off:"unactivate"}),$n({field:"pannable",on:"panify",off:"unpanify"}),cn.inactive=function(){var r=this[0];if(r)return!r._private.active};var cr={},sd=function(e){return function(n){for(var i=[],s=0;s<this.length;s++){var o=this[s];if(o.isNode()){for(var l=!1,u=o.connectedEdges(),c=0;c<u.length;c++){var d=u[c],f=d.source(),h=d.target();if(e.noIncomingEdges&&h===o&&f!==o||e.noOutgoingEdges&&f===o&&h!==o){l=!0;break}}l||i.push(o)}}return this.spawn(i,!0).filter(n)}},od=function(e){return function(t){for(var a=[],i=0;i<this.length;i++){var s=this[i];if(s.isNode())for(var o=s.connectedEdges(),l=0;l<o.length;l++){var u=o[l],c=u.source(),d=u.target();e.outgoing&&c===s?(a.push(u),a.push(d)):e.incoming&&d===s&&(a.push(u),a.push(c))}}return this.spawn(a,!0).filter(t)}},ld=function(e){return function(t){for(var n=this,a=[],i={};;){var s=e.outgoing?n.outgoers():n.incomers();if(0===s.length)break;for(var o=!1,l=0;l<s.length;l++){var u=s[l],c=u.id();i[c]||(i[c]=!0,a.push(u),o=!0)}if(!o)break;n=s}return this.spawn(a,!0).filter(t)}};function ud(r){return function(t){for(var n=[],a=0;a<this.length;a++){var s=this[a]._private[r.attr];s&&n.push(s)}return this.spawn(n,!0).filter(t)}}function cd(r){return function(t){var n=[],a=this._private.cy,i=r||{};oe(t)&&(t=a.$(t));for(var s=0;s<t.length;s++)for(var o=t[s]._private.edges,l=0;l<o.length;l++){var u=o[l],c=u._private.data,d=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),f=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target);(d||f)&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!f)||n.push(u))}return this.spawn(n,!0)}}function dd(r){return r=mt({},{codirected:!1},r),function(n){for(var a=[],i=this.edges(),s=r,o=0;o<i.length;o++)for(var u=i[o]._private,c=u.source,d=c._private.data.id,f=u.data.target,h=c._private.edges,v=0;v<h.length;v++){var b=h[v],y=b._private.data,g=y.target,w=y.source,C=g===f&&w===d;(s.codirected&&C||!s.codirected&&(C||d===g&&f===w))&&a.push(b)}return this.spawn(a,!0).filter(n)}}cr.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null},mt(cr,{roots:sd({noIncomingEdges:!0}),leaves:sd({noOutgoingEdges:!0}),outgoers:Er(od({outgoing:!0}),"outgoers"),successors:ld({outgoing:!0}),incomers:Er(od({incoming:!0}),"incomers"),predecessors:ld({})}),mt(cr,{neighborhood:Er(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var a=t[n],i=a.connectedEdges(),s=0;s<i.length;s++){var o=i[s],l=o.source(),u=o.target(),c=a===l?u:l;c.length>0&&e.push(c[0]),e.push(o[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),cr.neighbourhood=cr.neighborhood,cr.closedNeighbourhood=cr.closedNeighborhood,cr.openNeighbourhood=cr.openNeighborhood,mt(cr,{source:Er(function(e){var n,t=this[0];return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:Er(function(e){var n,t=this[0];return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:ud({attr:"source"}),targets:ud({attr:"target"})}),mt(cr,{edgesWith:Er(cd(),"edgesWith"),edgesTo:Er(cd({thisIsSrc:!0}),"edgesTo")}),mt(cr,{connectedEdges:Er(function(r){for(var e=[],n=0;n<this.length;n++){var a=this[n];if(a.isNode())for(var i=a._private.edges,s=0;s<i.length;s++)e.push(i[s])}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:Er(function(r){for(var e=[],n=0;n<this.length;n++){var a=this[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:Er(dd(),"parallelEdges"),codirectedEdges:Er(dd({codirected:!0}),"codirectedEdges")}),mt(cr,{components:function(e){var t=this,n=t.cy(),a=n.collection(),i=null==e?t.nodes():e.nodes(),s=[];null!=e&&i.empty()&&(i=e.sources());var o=function(c,d){a.merge(c),i.unmerge(c),d.merge(c)};if(i.empty())return t.spawn();var l=function(){var c=n.collection();s.push(c);var d=i[0];o(d,c),t.bfs({directed:!1,roots:d,visit:function(h){return o(h,c)}}),c.forEach(function(f){f.connectedEdges().forEach(function(h){t.has(h)&&c.has(h.source())&&c.has(h.target())&&c.merge(h)})})};do{l()}while(i.length>0);return s},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),cr.componentsOf=cr.components;var or=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new Xr,s=!1;if(t){if(t.length>0&&Oe(t[0])&&!It(t[0])){s=!0;for(var o=[],l=new Pn,u=0,c=t.length;u<c;u++){var d=t[u];null==d.data&&(d.data={});var f=d.data;if(null==f.id)f.id=Wl();else if(e.hasElementWithId(f.id)||l.has(f.id))continue;var h=new $a(e,d,!1);o.push(h),l.add(f.id)}t=o}}else t=[];this.length=0;for(var v=0,b=t.length;v<b;v++){var y=t[v][0];if(null!=y){var g=y._private.data.id;(!n||!i.has(g))&&(n&&i.set(g,{index:this.length,ele:y}),this[this.length]=y,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:function(){for(var C=this.lazyMap=new Xr,N=this.eles,z=0;z<N.length;z++){var V=N[z];C.set(V.id(),{index:z,ele:V})}}},n&&(this._private.map=i),s&&!a&&this.restore()}else Xt("A collection must have a reference to the core")},Vt=$a.prototype=or.prototype=Object.create(Array.prototype);Vt.instanceString=function(){return"collection"},Vt.spawn=function(r,e){return new or(this.cy(),r,e)},Vt.spawnSelf=function(){return this.spawn(this)},Vt.cy=function(){return this._private.cy},Vt.renderer=function(){return this._private.cy.renderer()},Vt.element=function(){return this[0]},Vt.collection=function(){return $t(this)?this:new or(this._private.cy,[this])},Vt.unique=function(){return new or(this._private.cy,this,!0)},Vt.hasElementWithId=function(r){return this._private.map.has(r=""+r)},Vt.getElementById=function(r){var e=this._private.cy,t=this._private.map.get(r=""+r);return t?t.ele:new or(e)},Vt.$id=Vt.getElementById,Vt.poolIndex=function(){return this._private.cy._private.elements._private.map.get(this[0]._private.data.id).index},Vt.indexOf=function(r){return this._private.map.get(r[0]._private.data.id).index},Vt.indexOfId=function(r){return this._private.map.get(r=""+r).index},Vt.json=function(r){var e=this.element(),t=this.cy();if(null==e&&r)return this;if(null!=e){var n=e._private;if(Oe(r)){if(t.startBatch(),r.data){e.data(r.data);var a=n.data;if(e.isEdge()){var i=!1,s={},o=r.data.source,l=r.data.target;null!=o&&o!=a.source&&(s.source=""+o,i=!0),null!=l&&l!=a.target&&(s.target=""+l,i=!0),i&&(e=e.move(s))}else{var c=r.data.parent;"parent"in r.data&&(null!=c||null!=a.parent)&&c!=a.parent&&(void 0===c&&(c=null),null!=c&&(c=""+c),e=e.move({parent:c}))}}r.position&&e.position(r.position);var d=function(b,y,g){var w=r[b];null!=w&&w!==n[b]&&(w?e[y]():e[g]())};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"),null!=r.classes&&e.classes(r.classes),t.endBatch(),this}if(void 0===r){var f={data:Pr(n.data),position:Pr(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:""},h=0;return n.classes.forEach(function(v){return f.classes+=0===h++?v:" "+v}),f}}},Vt.jsons=function(){for(var r=[],e=0;e<this.length;e++){var n=this[e].json();r.push(n)}return r},Vt.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var a=this[t].json(),i=new $a(r,a,!1);e.push(i)}return new or(r,e)},Vt.copy=Vt.clone,Vt.restore=function(){for(var o,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=this,n=t.cy(),a=n._private,i=[],s=[],l=0,u=t.length;l<u;l++){var c=t[l];e&&!c.removed()||(c.isNode()?i.push(c):s.push(c))}o=i.concat(s);var d,f=function(){o.splice(d,1),d--};for(d=0;d<o.length;d++){var h=o[d],v=h._private,b=v.data;if(h.clearTraversalCache(),e||v.removed)if(void 0===b.id)b.id=Wl();else if(_e(b.id))b.id=""+b.id;else{if(Sr(b.id)||!oe(b.id)){Xt("Can not create element with invalid string ID `"+b.id+"`"),f();continue}if(n.hasElementWithId(b.id)){Xt("Can not create second element with ID `"+b.id+"`"),f();continue}}var y=b.id;if(h.isNode()){var g=v.position;null==g.x&&(g.x=0),null==g.y&&(g.y=0)}if(h.isEdge()){for(var w=h,C=["source","target"],N=C.length,z=!1,V=0;V<N;V++){var F=C[V],U=b[F];_e(U)&&(U=b[F]=""+b[F]),null==U||""===U?(Xt("Can not create edge `"+y+"` with unspecified "+F),z=!0):n.hasElementWithId(U)||(Xt("Can not create edge `"+y+"` with nonexistent "+F+" `"+U+"`"),z=!0)}if(z){f();continue}var q=n.getElementById(b.source),Z=n.getElementById(b.target);q.same(Z)?q._private.edges.push(w):(q._private.edges.push(w),Z._private.edges.push(w)),w._private.source=q,w._private.target=Z}v.map=new Xr,v.map.set(y,{ele:h,index:0}),v.removed=!1,e&&n.addToPool(h)}for(var K=0;K<i.length;K++){var J=i[K],Q=J._private.data;_e(Q.parent)&&(Q.parent=""+Q.parent);var le=Q.parent;if(null!=le||J._private.parent){var he=J._private.parent?n.collection().merge(J._private.parent):n.getElementById(le);if(he.empty())Q.parent=void 0;else if(he[0].removed())_t("Node added with missing parent, reference to parent removed"),Q.parent=void 0,J._private.parent=null;else{for(var ue=!1,ge=he;!ge.empty();){if(J.same(ge)){ue=!0,Q.parent=void 0;break}ge=ge.parent()}ue||(he[0]._private.children.push(J),J._private.parent=he[0],a.hasCompoundNodes=!0)}}}if(o.length>0){for(var Se=o.length===t.length?t:new or(n,o),Le=0;Le<Se.length;Le++){var ye=Se[Le];ye.isNode()||(ye.parallelEdges().clearTraversalCache(),ye.source().clearTraversalCache(),ye.target().clearTraversalCache())}(a.hasCompoundNodes?n.collection().merge(Se).merge(Se.connectedNodes()).merge(Se.parent()):Se).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?Se.emitAndNotify("add"):e&&Se.emit("add")}return t},Vt.removed=function(){var r=this[0];return r&&r._private.removed},Vt.inside=function(){var r=this[0];return r&&!r._private.removed},Vt.remove=function(){var r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=this,n=[],a={},i=t._private.cy;function l(le){var de=a[le.id()];e&&le.removed()||de||(a[le.id()]=!0,le.isNode()?(n.push(le),function s(le){for(var de=le._private.edges,he=0;he<de.length;he++)l(de[he])}(le),function o(le){for(var de=le._private.children,he=0;he<de.length;he++)l(de[he])}(le)):n.unshift(le))}for(var u=0,c=t.length;u<c;u++)l(t[u]);function f(le,de){Jr(le._private.edges,de),le.clearTraversalCache()}function h(le){le.clearTraversalCache()}var v=[];function b(le,de){de=de[0];var he=(le=le[0])._private.children,ue=le.id();Jr(he,de),de._private.parent=null,v.ids[ue]||(v.ids[ue]=!0,v.push(le))}v.ids={},t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var y=0;y<n.length;y++){var g=n[y];if(g.isEdge()){var w=g.source()[0],C=g.target()[0];f(w,g),f(C,g);for(var N=g.parallelEdges(),z=0;z<N.length;z++){var V=N[z];h(V),V.isBundledBezier()&&V.dirtyBoundingBoxCache()}}else{var F=g.parent();0!==F.length&&b(F,g)}e&&(g._private.removed=!0)}var U=i._private.elements;i._private.hasCompoundNodes=!1;for(var q=0;q<U.length;q++)if(U[q].isParent()){i._private.hasCompoundNodes=!0;break}var K=new or(this.cy(),n);K.size()>0&&(r?K.emitAndNotify("remove"):e&&K.emit("remove"));for(var J=0;J<v.length;J++){var Q=v[J];(!e||!Q.removed())&&Q.updateStyle()}return K},Vt.move=function(r){var e=this._private.cy,t=this,n=!1,a=!1,i=function(v){return null==v?v:""+v};if(void 0!==r.source||void 0!==r.target){var s=i(r.source),o=i(r.target),l=null!=s&&e.hasElementWithId(s),u=null!=o&&e.hasElementWithId(o);(l||u)&&(e.batch(function(){t.remove(n,a),t.emitAndNotify("moveout");for(var h=0;h<t.length;h++){var v=t[h],b=v._private.data;v.isEdge()&&(l&&(b.source=s),u&&(b.target=o))}t.restore(n,a)}),t.emitAndNotify("move"))}else if(void 0!==r.parent){var c=i(r.parent);if(null===c||e.hasElementWithId(c)){var f=null===c?void 0:c;e.batch(function(){var h=t.remove(n,a);h.emitAndNotify("moveout");for(var v=0;v<t.length;v++){var b=t[v],y=b._private.data;b.isNode()&&(y.parent=f)}h.restore(n,a)}),t.emitAndNotify("move")}}return this},[Eu,Jg,fi,sn,Un,vp,hi,Rp,td,rd,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},mi,bi,sr,cn,cr].forEach(function(r){mt(Vt,r)});var Up={add:function(e){var t,n=this;if(vt(e)){var a=e;if(a._private.cy===n)t=a.restore();else{for(var i=[],s=0;s<a.length;s++)i.push(a[s].json());t=new or(n,i)}}else if(Ye(e))t=new or(n,e);else if(Oe(e)&&(Ye(e.nodes)||Ye(e.edges))){for(var u=e,c=[],d=["nodes","edges"],f=0,h=d.length;f<h;f++){var v=d[f],b=u[v];if(Ye(b))for(var y=0,g=b.length;y<g;y++){var w=mt({group:v},b[y]);c.push(w)}}t=new or(n,c)}else t=new $a(n,e).collection();return t},remove:function(e){return vt(e)||oe(e)&&(e=this.$(e)),e.remove()}};function Xp(r,e,t,n){var u=.1,c=typeof Float32Array<"u";if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var f=c?new Float32Array(11):new Array(11);function h(Z,K){return 1-3*K+3*Z}function v(Z,K){return 3*K-6*Z}function b(Z){return 3*Z}function y(Z,K,J){return((h(K,J)*Z+v(K,J))*Z+b(K))*Z}function g(Z,K,J){return 3*h(K,J)*Z*Z+2*v(K,J)*Z+b(K)}var V=!1;var U=function(K){return V||function F(){V=!0,(r!==e||t!==n)&&function C(){for(var Z=0;Z<11;++Z)f[Z]=y(Z*u,r,t)}()}(),r===e&&t===n?K:0===K?0:1===K?1:y(function z(Z){for(var K=0,J=1;10!==J&&f[J]<=Z;++J)K+=u;--J;var de=K+(Z-f[J])/(f[J+1]-f[J])*u,he=g(de,r,t);return he>=.001?function w(Z,K){for(var J=0;J<4;++J){var Q=g(K,r,t);if(0===Q)return K;K-=(y(K,r,t)-Z)/Q}return K}(Z,de):0===he?de:function N(Z,K,J){var Q,le,de=0;do{(Q=y(le=K+(J-K)/2,r,t)-Z)>0?J=le:K=le}while(Math.abs(Q)>1e-7&&++de<10);return le}(Z,K,K+u)}(K),e,n)};U.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var q="generateBezier("+[r,e,t,n]+")";return U.toString=function(){return q},U}var jp=function(){function r(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:r(s)}}function t(n,a){var i={dx:n.v,dv:r(n)},s=e(n,.5*a,i),o=e(n,.5*a,s),l=e(n,a,o),c=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return n.x=n.x+1/6*(i.dx+2*(s.dx+o.dx)+l.dx)*a,n.v=n.v+c*a,n}return function n(a,i,s){var f,h,v,o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1e-4;for(a=parseFloat(a)||500,i=parseFloat(i)||20,s=s||null,o.tension=a,o.friction=i,h=(f=null!==s)?(u=n(a,i))/s*.016:.016;v=t(v||o,h),l.push(1+v.x),u+=16,Math.abs(v.x)>c&&Math.abs(v.v)>c;);return f?function(b){return l[b*(l.length-1)|0]}:u}}(),Ht=function(e,t,n,a){var i=Xp(e,t,n,a);return function(s,o,l){return s+(o-s)*i(l)}},Ei={linear:function(e,t,n){return e+(t-e)*n},ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-out":Ht(0,0,.58,1),"ease-in-out":Ht(.42,0,.58,1),"ease-in-sine":Ht(.47,0,.745,.715),"ease-out-sine":Ht(.39,.575,.565,1),"ease-in-out-sine":Ht(.445,.05,.55,.95),"ease-in-quad":Ht(.55,.085,.68,.53),"ease-out-quad":Ht(.25,.46,.45,.94),"ease-in-out-quad":Ht(.455,.03,.515,.955),"ease-in-cubic":Ht(.55,.055,.675,.19),"ease-out-cubic":Ht(.215,.61,.355,1),"ease-in-out-cubic":Ht(.645,.045,.355,1),"ease-in-quart":Ht(.895,.03,.685,.22),"ease-out-quart":Ht(.165,.84,.44,1),"ease-in-out-quart":Ht(.77,0,.175,1),"ease-in-quint":Ht(.755,.05,.855,.06),"ease-out-quint":Ht(.23,1,.32,1),"ease-in-out-quint":Ht(.86,0,.07,1),"ease-in-expo":Ht(.95,.05,.795,.035),"ease-out-expo":Ht(.19,1,.22,1),"ease-in-out-expo":Ht(1,0,0,1),"ease-in-circ":Ht(.6,.04,.98,.335),"ease-out-circ":Ht(.075,.82,.165,1),"ease-in-out-circ":Ht(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ei.linear;var a=jp(e,t,n);return function(i,s,o){return i+(s-i)*a(o)}},"cubic-bezier":Ht};function fd(r,e,t,n,a){if(1===n||e===t)return t;var i=a(e,t,n);return null==r||((r.roundValue||r.color)&&(i=Math.round(i)),void 0!==r.min&&(i=Math.max(i,r.min)),void 0!==r.max&&(i=Math.min(i,r.max))),i}function hd(r,e){return null!=r.pfValue||null!=r.value?null==r.pfValue||null!=e&&"%"===e.type.units?r.value:r.pfValue:r}function Kn(r,e,t,n,a){var i=null!=a?a.type:null;t<0?t=0:t>1&&(t=1);var s=hd(r,a),o=hd(e,a);if(_e(s)&&_e(o))return fd(i,s,o,t,n);if(Ye(s)&&Ye(o)){for(var l=[],u=0;u<o.length;u++){var c=s[u],d=o[u];if(null!=c&&null!=d){var f=fd(i,c,d,t,n);l.push(f)}else l.push(d)}return l}}function Yp(r,e,t,n){var a=!n,i=r._private,s=e._private,o=s.easing,l=s.startTime,c=(n?r:r.cy()).style();if(!s.easingImpl)if(null==o)s.easingImpl=Ei.linear;else{var d,h,v;d=oe(o)?c.parse("transition-timing-function",o).value:o,oe(d)?(h=d,v=[]):(h=d[1],v=d.slice(2).map(function(Se){return+Se})),v.length>0?("spring"===h&&v.push(s.duration),s.easingImpl=Ei[h].apply(null,v)):s.easingImpl=Ei[h]}var y,b=s.easingImpl;if(y=0===s.duration?1:(t-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),null==s.delay){var g=s.startPosition,w=s.position;if(w&&a&&!r.locked()){var C={};Da(g.x,w.x)&&(C.x=Kn(g.x,w.x,y,b)),Da(g.y,w.y)&&(C.y=Kn(g.y,w.y,y,b)),r.position(C)}var N=s.startPan,z=s.pan,V=i.pan,F=null!=z&&n;F&&(Da(N.x,z.x)&&(V.x=Kn(N.x,z.x,y,b)),Da(N.y,z.y)&&(V.y=Kn(N.y,z.y,y,b)),r.emit("pan"));var U=s.startZoom,q=s.zoom,Z=null!=q&&n;Z&&(Da(U,q)&&(i.zoom=ga(i.minZoom,Kn(U,q,y,b),i.maxZoom)),r.emit("zoom")),(F||Z)&&r.emit("viewport");var K=s.style;if(K&&K.length>0&&a){for(var J=0;J<K.length;J++){var Q=K[J],le=Q.name,he=s.startStyle[le],ge=Kn(he,Q,y,b,c.properties[he.name]);c.overrideBypass(r,le,ge)}r.emit("style")}}return s.progress=y,y}function Da(r,e){return!!(null!=r&&null!=e&&(_e(r)&&_e(e)||r&&e))}function Wp(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function vd(r,e){var t=e._private.aniEles,n=[];function a(c,d){var f=c._private,h=f.animation.current,v=f.animation.queue,b=!1;if(0===h.length){var y=v.shift();y&&h.push(y)}for(var g=function(V){for(var F=V.length-1;F>=0;F--)(0,V[F])();V.splice(0,V.length)},w=h.length-1;w>=0;w--){var C=h[w],N=C._private;N.stopped?(h.splice(w,1),N.hooked=!1,N.playing=!1,N.started=!1,g(N.frames)):!N.playing&&!N.applying||(N.playing&&N.applying&&(N.applying=!1),N.started||Wp(0,C,r),Yp(c,C,r,d),N.applying&&(N.applying=!1),g(N.frames),null!=N.step&&N.step(r),C.completed()&&(h.splice(w,1),N.hooked=!1,N.playing=!1,N.started=!1,g(N.completes)),b=!0)}return!d&&0===h.length&&0===v.length&&n.push(c),b}for(var i=!1,s=0;s<t.length;s++){var l=a(t[s]);i=i||l}var u=a(e,!0);(i||u)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var qp={animate:Ft.animate(),animation:Ft.animation(),animated:Ft.animated(),clearQueue:Ft.clearQueue(),delay:Ft.delay(),delayAnimation:Ft.delayAnimation(),stop:Ft.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,s){vd(s,e)},n.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ya(function(i){vd(i,e),t()})}()}}},$p={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return null==a||e!==n.target&&It(n.target)&&a.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Ti=function(e){return oe(e)?new nn(e):e},gd={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new pi($p,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Ti(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Ti(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Ti(t),n),this},once:function(e,t,n){return this.emitter().one(e,Ti(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Ft.eventAliasesOn(gd);var Go={png:function(e){return this._private.renderer.png(e=e||{})},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Go.jpeg=Go.jpg;var Ci={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var i,n=e.name,a=t.extension("layout",n);if(null!=a)return i=oe(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new a(mt({},e,{cy:t,eles:i}));Xt("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Xt("A `name` must be specified to make a layout");else Xt("Layout options must be specified to make a layout")}};Ci.createLayout=Ci.makeLayout=Ci.layout;var Kp={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var a=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&a.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var a=e.batchNotifications[n];a.empty()?t.notify(n):t.notify(n,a)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),a=0;a<n.length;a++){var i=n[a],s=e[i];t.getElementById(i).data(s)}})}},Zp=ir({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:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),zo={renderTo:function(e,t,n,a){return this._private.renderer.renderTo(e,t,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 t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&_t("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=Zp(e);a.cy=t,t._private.renderer=new n(a),this.notify("init")}else Xt("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var 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)}};zo.invalidateDimensions=zo.resize;var Di={collection:function(e,t){return oe(e)?this.$(e):vt(e)?e.collection():Ye(e)?(t||(t={}),new or(this,e,t.unique,t.removed)):new or(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Di.elements=Di.filter=Di.$;var rr={apply:function(r){for(var e=this,a=e._private.cy.collection(),i=0;i<r.length;i++){var s=r[i],o=e.getContextMeta(s);if(!o.empty){var l=e.getContextStyle(o),u=e.applyContextStyle(o,l,s);s._private.appliedInitStyle?e.updateTransitions(s,u.diffProps):s._private.appliedInitStyle=!0,e.updateStyleHints(s)&&a.push(s)}}return a},getPropertiesDiff:function(r,e){var t=this,n=t._private.propDiffs=t._private.propDiffs||{},a=r+"-"+e,i=n[a];if(i)return i;for(var s=[],o={},l=0;l<t.length;l++){var u=t[l],d="t"===e[l],f="t"===r[l]!==d,h=u.mappedProperties.length>0;if(f||d&&h){var v=void 0;f&&h||f?v=u.properties:h&&(v=u.mappedProperties);for(var b=0;b<v.length;b++){for(var y=v[b],g=y.name,w=!1,C=l+1;C<t.length&&("t"!==e[C]||!(w=null!=t[C].properties[y.name]));C++);!o[g]&&!w&&(o[g]=!0,s.push(g))}}}return n[a]=s,s},getContextMeta:function(r){for(var n,e=this,t="",a=r._private.styleCxtKey||"",i=0;i<e.length;i++){var s=e[i];t+=s.selector&&s.selector.matches(r)?"t":"f"}return n=e.getPropertiesDiff(a,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:0===n.length}},getContextStyle:function(r){var e=r.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<this.length;i++){var s=this[i];if("t"===e[i])for(var l=0;l<s.properties.length;l++){var u=s.properties[l];a[u.name]=u}}return n[e]=a,a},applyContextStyle:function(r,e,t){for(var a=r.diffPropNames,i={},s=this.types,o=0;o<a.length;o++){var l=a[o],u=e[l],c=t.pstyle(l);if(!u){if(!c)continue;u=c.bypass?{name:l,deleteBypassed:!0}:{name:l,delete:!0}}if(c!==u){if(u.mapped===s.fn&&null!=c&&null!=c.mapping&&c.mapping.value===u.value){var d=c.mapping;if((d.fnValue=u.value(t))===d.prevFnValue)continue}var h=i[l]={prev:c};this.applyParsedProperty(t,u),h.next=t.pstyle(l),h.next&&h.next.bypass&&(h.next=h.next.bypassed)}}return{diffProps:i}},updateStyleHints:function(r){var n,e=r._private,t=this,a=t.propertyGroupKeys,i=function(Pe,ze,rt){return t.getPropertiesHash(Pe,ze,rt)},s=e.styleKey;if(r.removed())return!1;var o="nodes"===e.group,l=r._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++)e.styleKeys[a[u]]=[pn,On];for(var d=function(Pe,ze){return e.styleKeys[ze][0]=da(Pe,e.styleKeys[ze][0])},f=function(Pe,ze){return e.styleKeys[ze][1]=fa(Pe,e.styleKeys[ze][1])},h=function(Pe,ze){d(Pe,ze),f(Pe,ze)},v=function(Pe,ze){for(var rt=0;rt<Pe.length;rt++){var ct=Pe.charCodeAt(rt);d(ct,ze),f(ct,ze)}},y=function(Pe){return-128<Pe&&Pe<128&&Math.floor(Pe)!==Pe?2e9-(1024*Pe|0):Pe},g=0;g<n.length;g++){var w=n[g],C=l[w];if(null!=C){var N=this.properties[w],z=N.type,V=N.groupKey,F=void 0;null!=N.hashOverride?F=N.hashOverride(r,C):null!=C.pfValue&&(F=C.pfValue);var U=null==N.enums?C.value:null,q=null!=F,J=C.units;!z.number||!q&&null==U||z.multiple?v(C.strValue,V):(h(y(q?F:U),V),!q&&null!=J&&v(J,V))}}for(var le=[pn,On],de=0;de<a.length;de++){var ue=e.styleKeys[a[de]];le[0]=da(ue[0],le[0]),le[1]=fa(ue[1],le[1])}e.styleKey=function(e,t){return 2097152*e+t}(le[0],le[1]);var ge=e.styleKeys;e.labelDimsKey=Zr(ge.labelDimensions);var Se=i(r,["label"],ge.labelDimensions);if(e.labelKey=Zr(Se),e.labelStyleKey=Zr(Wa(ge.commonLabel,Se)),!o){var Le=i(r,["source-label"],ge.labelDimensions);e.sourceLabelKey=Zr(Le),e.sourceLabelStyleKey=Zr(Wa(ge.commonLabel,Le));var ye=i(r,["target-label"],ge.labelDimensions);e.targetLabelKey=Zr(ye),e.targetLabelStyleKey=Zr(Wa(ge.commonLabel,ye))}if(o){var De=e.styleKeys,at=De.pie,He=De.stripe,Te=[De.nodeBody,De.nodeBorder,De.nodeOutline,De.backgroundImage,De.compound,at,He].filter(function(Ie){return null!=Ie}).reduce(Wa,[pn,On]);e.nodeKey=Zr(Te),e.hasPie=null!=at&&at[0]!==pn&&at[1]!==On,e.hasStripe=null!=He&&He[0]!==pn&&He[1]!==On}return s!==e.styleKey},clearStyleHints:function(r){var e=r._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,e.hasStripe=null},applyParsedProperty:function(r,e){var i,t=this,n=e,a=r._private.style,s=t.types,o=t.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=r._private,f="mapping",h=function(Ue){return null==Ue?null:null!=Ue.pfValue?Ue.pfValue:Ue.value},v=function(){var Ue=h(u),$e=h(n);t.checkTriggers(r,n.name,Ue,$e)};if("curve-style"===e.name&&r.isEdge()&&("bezier"!==e.value&&r.isLoop()||"haystack"===e.value&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,v(),!0;if(n.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,v(),!0):(v(),!0);if(n.deleteBypass)return u?!!u.bypass&&(a[n.name]=u.bypassed,v(),!0):(v(),!0);var b=function(){_t("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.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 y=n.field.split("."),g=d.data,w=0;w<y.length&&g;w++)g=g[y[w]];if(null==g)return b(),!1;var N;if(!_e(g))return _t("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+g+"` for `"+r.id()+"` is non-numeric)"),!1;var z=n.fieldMax-n.fieldMin;if((N=0===z?0:(g-n.fieldMin)/z)<0?N=0:N>1&&(N=1),o.color){var V=n.valueMin[0],U=n.valueMin[1],q=n.valueMax[1],Z=n.valueMin[2],K=n.valueMax[2],J=null==n.valueMin[3]?1:n.valueMin[3],Q=null==n.valueMax[3]?1:n.valueMax[3],le=[Math.round(V+(n.valueMax[0]-V)*N),Math.round(U+(q-U)*N),Math.round(Z+(K-Z)*N),Math.round(J+(Q-J)*N)];i={bypass:n.bypass,name:n.name,value:le,strValue:"rgb("+le[0]+", "+le[1]+", "+le[2]+")"}}else{if(!o.number)return!1;i=this.parse(n.name,n.valueMin+(n.valueMax-n.valueMin)*N,n.bypass,f)}if(!i)return b(),!1;i.mapping=n,n=i;break;case s.data:for(var he=n.field.split("."),ue=d.data,ge=0;ge<he.length&&ue;ge++)ue=ue[he[ge]];if(null!=ue&&(i=this.parse(n.name,ue,n.bypass,f)),!i)return b(),!1;i.mapping=n,n=i;break;case s.fn:var ye=null!=n.fnValue?n.fnValue:(0,n.value)(r);if(n.prevFnValue=ye,null==ye)return _t("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(!(i=this.parse(n.name,ye,n.bypass,f)))return _t("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+r.id()+"` is invalid)"),!1;i.mapping=Pr(n),n=i;break;case void 0:break;default:return!1}return l?(n.bypassed=c?u.bypassed:u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,v(),!0},cleanElements:function(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),e)for(var a=n._private.style,i=Object.keys(a),s=0;s<i.length;s++){var o=i[s],l=a[o];null!=l&&(l.bypass?l.bypassed=null:a[o]=null)}else n._private.style={}}},update:function(){this._private.cy.mutableElements().updateStyle()},updateTransitions:function(r,e){var t=this,n=r._private,a=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,s=r.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var o={},l=!1,u=0;u<a.length;u++){var c=a[u],d=r.pstyle(c),f=e[c];if(f){var v=f.prev,b=null!=f.next?f.next:d,y=!1,g=void 0,w=1e-6;v&&(_e(v.pfValue)&&_e(b.pfValue)?g=v.pfValue+w*(y=b.pfValue-v.pfValue):_e(v.value)&&_e(b.value)?g=v.value+w*(y=b.value-v.value):Ye(v.value)&&Ye(b.value)&&(y=v.value[0]!==b.value[0]||v.value[1]!==b.value[1]||v.value[2]!==b.value[2],g=v.strValue),y&&(o[c]=b.strValue,this.applyBypass(r,c,g),l=!0))}}if(!l)return;n.transitioning=!0,new Vn(function(C){s>0?r.delayAnimation(s).play().promise().then(C):C()}).then(function(){return r.animation({style:o,duration:i,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,a),r.emitAndNotify("style"),n.transitioning=!1)},checkTrigger:function(r,e,t,n,a,i){var s=this.properties[e],o=a(s);r.removed()||null!=o&&o(t,n,r)&&i(s)},checkZOrderTrigger:function(r,e,t,n){var a=this;this.checkTrigger(r,e,t,n,function(i){return i.triggersZOrder},function(){a._private.cy.notify("zorder",r)})},checkBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBounds},function(a){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})},checkConnectedEdgesBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfConnectedEdges},function(a){r.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},checkParallelEdgesBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBoundsOfParallelEdges},function(a){r.parallelEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})},checkTriggers:function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)}},La={applyBypass:function(r,e,t,n){var i=[];if("*"===e||"**"===e){if(void 0!==t)for(var o=0;o<this.properties.length;o++){var c=this.parse(this.properties[o].name,t,!0);c&&i.push(c)}}else if(oe(e)){var d=this.parse(e,t,!0);d&&i.push(d)}else{if(!Oe(e))return!1;var f=e;n=t;for(var h=Object.keys(f),v=0;v<h.length;v++){var b=h[v],y=f[b];if(void 0===y&&(y=f[Ua(b)]),void 0!==y){var g=this.parse(b,y,!0);g&&i.push(g)}}}if(0===i.length)return!1;for(var w=!1,C=0;C<r.length;C++){for(var N=r[C],z={},V=void 0,F=0;F<i.length;F++){var U=i[F];if(n){var q=N.pstyle(U.name);V=z[U.name]={prev:q}}w=this.applyParsedProperty(N,Pr(U))||w,n&&(V.next=N.pstyle(U.name))}w&&this.updateStyleHints(N),n&&this.updateTransitions(N,z,!0)}return w},overrideBypass:function(r,e,t){e=qi(e);for(var n=0;n<r.length;n++){var a=r[n],i=a._private.style[e],s=this.properties[e].type,o=s.color,l=s.mutiple,u=i?null!=i.pfValue?i.pfValue:i.value:null;i&&i.bypass?(i.value=t,null!=i.pfValue&&(i.pfValue=t),i.strValue=o?"rgb("+t.join(",")+")":l?t.join(" "):""+t,this.updateStyleHints(a)):this.applyBypass(a,e,t),this.checkTriggers(a,e,u,t)}},removeAllBypasses:function(r,e){return this.removeBypasses(r,this.propertyNames,e)},removeBypasses:function(r,e,t){for(var a=0;a<r.length;a++){for(var i=r[a],s={},o=0;o<e.length;o++){var l=e[o],u=this.properties[l],c=i.pstyle(u.name);if(c&&c.bypass){var f=this.parse(l,"",!0),h=s[u.name]={prev:c};this.applyParsedProperty(i,f),h.next=i.pstyle(u.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,s,!0)}}},Vo={getEmSizeInPixels:function(){var r=this.containerCss("font-size");return null!=r?parseFloat(r):1},containerCss:function(r){var e=this._private.cy,t=e.container(),n=e.window();if(n&&t&&n.getComputedStyle)return n.getComputedStyle(t).getPropertyValue(r)}},Br={getRenderedStyle:function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)},getRawStyle:function(r,e){var t=this;if(r=r[0]){for(var n={},a=0;a<t.properties.length;a++){var i=t.properties[a],s=t.getStylePropertyValue(r,i.name,e);null!=s&&(n[i.name]=s,n[Ua(i.name)]=s)}return n}},getIndexedStyle:function(r,e,t,n){return r.pstyle(e)[t][n]??r.cy().style().getDefaultProperty(e)[t][0]},getStylePropertyValue:function(r,e,t){if(r=r[0]){var a=this.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,s=r.pstyle(a.name);if(s){var o=s.value,l=s.units,u=s.strValue;if(t&&i.number&&null!=o&&_e(o)){var c=r.cy().zoom(),d=function(y){return y*c},f=function(y,g){return d(y)+g},h=Ye(o);return(h?l.every(function(b){return null!=b}):null!=l)?h?o.map(function(b,y){return f(b,l[y])}).join(" "):f(o,l):h?o.map(function(b){return oe(b)?b:""+d(b)}).join(" "):""+d(o)}if(null!=u)return u}return null}},getAnimationStartStyle:function(r,e){for(var t={},n=0;n<e.length;n++){var i=e[n].name,s=r.pstyle(i);void 0!==s&&(s=Oe(s)?this.parse(i,s.strValue):this.parse(i,s)),s&&(t[i]=s)}return t},getPropsList:function(r){var t=[],n=r,a=this.properties;if(n)for(var i=Object.keys(n),s=0;s<i.length;s++){var o=i[s],l=n[o],u=a[o]||a[qi(o)],c=this.parse(u.name,l);c&&t.push(c)}return t},getNonDefaultPropertiesHash:function(r,e,t){var i,s,o,l,u,n=t.slice();for(l=0;l<e.length;l++)if(null!=(i=r.pstyle(e[l],!1)))if(null!=i.pfValue)n[0]=da(o,n[0]),n[1]=fa(o,n[1]);else for(s=i.strValue,u=0;u<s.length;u++)o=s.charCodeAt(u),n[0]=da(o,n[0]),n[1]=fa(o,n[1]);return n}};Br.getPropertiesHash=Br.getNonDefaultPropertiesHash;var Si={appendFromJson:function(r){for(var e=this,t=0;t<r.length;t++){var n=r[t],a=n.selector,i=n.style||n.css,s=Object.keys(i);e.selector(a);for(var o=0;o<s.length;o++){var l=s[o];e.css(l,i[l])}}return e},fromJson:function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e},json:function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,a=t.properties,i={},s=0;s<a.length;s++){var o=a[s];i[o.name]=o.strValue}r.push({selector:n?n.toString():"core",style:i})}return r}},Ho={appendFromString:function(r){var a,i,s,t=this,n=""+r;function o(){n=n.length>a.length?n.substr(a.length):""}function l(){i=i.length>s.length?i.substr(s.length):""}for(n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");!n.match(/^\s*$/);){var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){_t("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=c[0];var d=c[1];if("core"!==d&&new nn(d).invalid)_t("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),o();else{var h=c[2],v=!1;i=h;for(var b=[];!i.match(/^\s*$/);){var g=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!g){_t("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+h),v=!0;break}s=g[0];var w=g[1],C=g[2];this.properties[w]?t.parse(w,C)?(b.push({name:w,val:C}),l()):(_t("Skipping property: Invalid property definition in: "+s),l()):(_t("Skipping property: Invalid property name in: "+s),l())}if(v){o();break}t.selector(d);for(var V=0;V<b.length;V++){var F=b[V];t.css(F.name,F.val)}o()}}return t},fromString:function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e}},Kt={};(function(){var r=Jt,e=jf,t=Wf,i=function(Ie){return"^"+Ie+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},s=function(Ie){var Pe=r+"|\\w+|"+e+"|"+t+"|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+Ie+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+Pe+")\\s*\\,\\s*("+Pe+")\\)$"},o=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];Kt.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"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},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},boxSelection:{enums:["contain","overlap","none"]},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","circle"]},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","top-inside","center","bottom","bottom-inside"]},halign:{enums:["left","left-inside","center","right","right-inside"]},justification:{enums:["left","center","right","auto"]},textMetrics:{enums:["font","glyph"]},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(Ie,Pe){switch(Ie.length){case 2:return"deg"!==Pe[0]&&"rad"!==Pe[0]&&"deg"!==Pe[1]&&"rad"!==Pe[1];case 1:return oe(Ie[0])||"deg"===Pe[0]||"rad"===Pe[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\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(Ie){var Pe=Ie.length;return 1===Pe||2===Pe||4===Pe}}};var l={zeroNonZero:function(Ie,Pe){return(null==Ie||null==Pe)&&Ie!==Pe||0==Ie&&0!=Pe||0!=Ie&&0==Pe},any:function(Ie,Pe){return Ie!=Pe},emptyNonEmpty:function(Ie,Pe){var ze=Sr(Ie),rt=Sr(Pe);return ze&&!rt||!ze&&rt}},u=Kt.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],v=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"text-metrics",type:u.textMetrics},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],b=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],y=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(Ie,Pe,ze){return Ie!==Pe&&"bezier"===ze.pstyle("curve-style").value}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],g=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],w=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],C=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],N=function(Ie,Pe){return"label"===Pe.value?-Ie.poolIndex():Pe.pfValue},z=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:N},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:N},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],V=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],F=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],U=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],q=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],Z=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(Ie,Pe){return Ie!==Pe&&("bezier"===Ie||"bezier"===Pe)}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],K=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],J=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],Q=[];Kt.pieBackgroundN=16,Q.push({name:"pie-size",type:u.sizeMaybePercent}),Q.push({name:"pie-hole",type:u.sizeMaybePercent}),Q.push({name:"pie-start-angle",type:u.angle});for(var le=1;le<=Kt.pieBackgroundN;le++)Q.push({name:"pie-"+le+"-background-color",type:u.color}),Q.push({name:"pie-"+le+"-background-size",type:u.percent}),Q.push({name:"pie-"+le+"-background-opacity",type:u.zeroOneNumber});var de=[];Kt.stripeBackgroundN=16,de.push({name:"stripe-size",type:u.sizeMaybePercent}),de.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var he=1;he<=Kt.stripeBackgroundN;he++)de.push({name:"stripe-"+he+"-background-color",type:u.color}),de.push({name:"stripe-"+he+"-background-size",type:u.percent}),de.push({name:"stripe-"+he+"-background-opacity",type:u.zeroOneNumber});var ue=[],ge=Kt.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Te){ge.forEach(function(Ie){ue.push({name:Ie+"-"+Te.name,type:Te.type,triggersBounds:Te.triggersBounds})})},{});var Se=Kt.properties=[].concat(b,C,y,g,w,K,v,h,c,d,f,z,V,F,U,Q,de,q,Z,ue,J),Le=Kt.propertyGroups={behavior:b,transition:C,visibility:y,overlay:g,underlay:w,ghost:K,commonLabel:v,labelDimensions:h,mainLabel:c,sourceLabel:d,targetLabel:f,nodeBody:z,nodeBorder:V,nodeOutline:F,backgroundImage:U,pie:Q,stripe:de,compound:q,edgeLine:Z,edgeArrow:ue,core:J},ye=Kt.propertyGroupNames={};(Kt.propertyGroupKeys=Object.keys(Le)).forEach(function(Te){ye[Te]=Le[Te].map(function(Ie){return Ie.name}),Le[Te].forEach(function(Ie){return Ie.groupKey=Te})});var Ue=Kt.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"}];Kt.propertyNames=Se.map(function(Te){return Te.name});for(var $e=0;$e<Se.length;$e++){var Xe=Se[$e];Se[Xe.name]=Xe}for(var Qe=0;Qe<Ue.length;Qe++){var tt=Ue[Qe],He={name:tt.name,alias:!0,pointsTo:Se[tt.pointsTo]};Se.push(He),Se[tt.name]=He}})(),Kt.getDefaultProperty=function(r){return this.getDefaultProperties()[r]},Kt.getDefaultProperties=function(){var r=this._private;if(null!=r.defaultProperties)return r.defaultProperties;for(var e=mt({"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","box-selection":"contain","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","text-metrics":"font","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","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%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Kt.pieBackgroundN;c++)l[u.name.replace("{{i}}",c)]=u.value;return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=Kt.stripeBackgroundN;c++)l[u.name.replace("{{i}}",c)]=u.value;return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return Kt.arrowPrefixes.forEach(function(c){l[c+"-"+u.name]=u.value}),l},{})),t={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=this.parse(i,e[i]);t[i]=o}}return r.defaultProperties=t,r.defaultProperties},Kt.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 Li={parse:function(r,e,t,n){var a=this;if(Be(e))return a.parseImplWarn(r,e,t,n);var c,l=Hl(r,""+e,t?"t":"f","mapping"===n||!0===n||!1===n||null==n?"dontcare":n),u=a.propCache=a.propCache||[];return(c=u[l])||(c=u[l]=a.parseImplWarn(r,e,t,n)),(t||"mapping"===n)&&(c=Pr(c))&&(c.value=Pr(c.value)),c},parseImplWarn:function(r,e,t,n){var a=this.parseImpl(r,e,t,n);return!a&&null!=e&&_t("The style property `".concat(r,": ").concat(e,"` is invalid")),a&&("width"===a.name||"height"===a.name)&&"label"===e&&_t("The style value of `label` is deprecated for `"+a.name+"`"),a},parseImpl:function(r,e,t,n){var a=this;r=qi(r);var i=a.properties[r],s=e,o=a.types;if(!i||void 0===e)return null;i.alias&&(r=(i=i.pointsTo).name);var l=oe(e);l&&(e=e.trim());var c,d,u=i.type;if(!u)return null;if(t&&(""===e||null===e))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(Be(e))return{name:r,value:e,strValue:"fn",mapped:o.fn,bypass:t};if(!(!l||n||e.length<7||"a"!==e[1])){if(e.length>=7&&"d"===e[0]&&(c=new RegExp(o.data.regex).exec(e)))return!t&&{name:r,value:c,strValue:""+e,mapped:o.data,field:c[1],bypass:t};if(e.length>=10&&"m"===e[0]&&(d=new RegExp(o.mapData.regex).exec(e))){if(t||u.multiple)return!1;var h=o.mapData;if(!u.color&&!u.number)return!1;var v=this.parse(r,d[4]);if(!v||v.mapped)return!1;var b=this.parse(r,d[5]);if(!b||b.mapped)return!1;if(v.pfValue===b.pfValue||v.strValue===b.strValue)return _t("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+v.strValue+"`"),this.parse(r,v.strValue);if(u.color){var y=v.value,g=b.value;if(!(y[0]!==g[0]||y[1]!==g[1]||y[2]!==g[2]||y[3]!==g[3]&&(null!=y[3]&&1!==y[3]||null!=g[3]&&1!==g[3])))return!1}return{name:r,value:d,strValue:""+e,mapped:h,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:v.value,valueMax:b.value,bypass:t}}}if(u.multiple&&"multiple"!==n){var C;if(C=l?e.split(/\s+/):Ye(e)?e:[e],u.evenMultiple&&C.length%2!=0)return null;for(var N=[],z=[],V=[],F="",U=!1,q=0;q<C.length;q++){var Z=a.parse(r,C[q],t,"multiple");U=U||oe(Z.value),N.push(Z.value),V.push(null!=Z.pfValue?Z.pfValue:Z.value),z.push(Z.units),F+=(q>0?" ":"")+Z.strValue}return u.validate&&!u.validate(N,z)?null:u.singleEnum&&U?1===N.length&&oe(N[0])?{name:r,value:N[0],strValue:N[0],bypass:t}:null:{name:r,value:N,pfValue:V,strValue:F,bypass:t,units:z}}var K=function(){for(var He=0;He<u.enums.length;He++)if(u.enums[He]===e)return{name:r,value:e,strValue:""+e,bypass:t};return null};if(u.number){var J,Q="px";if(u.units&&(J=u.units),u.implicitUnits&&(Q=u.implicitUnits),!u.unitless)if(l){var le="px|em"+(u.allowPercent?"|\\%":"");J&&(le=J);var de=e.match("^("+Jt+")("+le+")?$");de&&(e=de[1],J=de[2]||Q)}else(!J||u.implicitUnits)&&(J=Q);if(e=parseFloat(e),isNaN(e)&&void 0===u.enums)return null;if(isNaN(e)&&void 0!==u.enums)return e=s,K();if(u.integer&&!function(e){return _e(e)&&Math.floor(e)===e}(e)||void 0!==u.min&&(e<u.min||u.strictMin&&e===u.min)||void 0!==u.max&&(e>u.max||u.strictMax&&e===u.max))return null;var he={name:r,value:e,strValue:""+e+(J||""),units:J,bypass:t};return he.pfValue=u.unitless||"px"!==J&&"em"!==J?e:"px"!==J&&J?this.getEmSizeInPixels()*e:e,("ms"===J||"s"===J)&&(he.pfValue="ms"===J?e:1e3*e),("deg"===J||"rad"===J)&&(he.pfValue="rad"===J?e:function(e){return Math.PI*e/180}(e)),"%"===J&&(he.pfValue=e/100),he}if(u.propList){var ue=[],ge=""+e;if("none"!==ge){for(var Se=ge.split(/\s*,\s*|\s+/),Le=0;Le<Se.length;Le++){var ye=Se[Le].trim();a.properties[ye]?ue.push(ye):_t("`"+ye+"` is not a valid property name")}if(0===ue.length)return null}return{name:r,value:ue,strValue:0===ue.length?"none":ue.join(" "),bypass:t}}if(u.color){var De=wl(e);return De?{name:r,value:De,pfValue:De,strValue:"rgb("+De[0]+","+De[1]+","+De[2]+")",bypass:t}:null}if(u.regex||u.regexes){if(u.enums){var Ue=K();if(Ue)return Ue}for(var $e=u.regexes?u.regexes:[u.regex],Xe=0;Xe<$e.length;Xe++){var tt=new RegExp($e[Xe]).exec(e);if(tt)return{name:r,value:u.singleRegexMatchValue?tt[1]:tt,strValue:""+e,bypass:t}}return null}return u.string?{name:r,value:""+e,strValue:""+e,bypass:t}:u.enums?K():null}},nr=function(e){if(!(this instanceof nr))return new nr(e);xr(e)?(this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()):Xt("A style must have a core reference")},dr=nr.prototype;dr.instanceString=function(){return"style"},dr.clear=function(){for(var r=this._private,t=r.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(a){var i=a[0]._private;i.styleDirty=!0,i.appliedInitStyle=!1}),this},dr.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},dr.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)},dr.selector=function(r){var e="core"===r?null:new nn(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this},dr.css=function(){var e=arguments;if(1===e.length)for(var t=e[0],n=0;n<this.properties.length;n++){var a=this.properties[n],i=t[a.name];void 0===i&&(i=t[Ua(a.name)]),void 0!==i&&this.cssRule(a.name,i)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},dr.style=dr.css,dr.cssRule=function(r,e){var t=this.parse(r,e);if(t){var n=this.length-1;this[n].properties.push(t),this[n].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[n].mappedProperties.push(t),!this[n].selector&&(this._private.coreStyle[t.name]=t)}return this},dr.append=function(r){return gn(r)?r.appendToStyle(this):Ye(r)?this.appendFromJson(r):oe(r)&&this.appendFromString(r),this},nr.fromJson=function(r,e){var t=new nr(r);return t.fromJson(e),t},nr.fromString=function(r,e){return new nr(r).fromString(e)},[rr,La,Vo,Br,Si,Ho,Kt,Li].forEach(function(r){mt(dr,r)}),nr.types=dr.types,nr.properties=dr.properties,nr.propertyGroups=dr.propertyGroups,nr.propertyGroupNames=dr.propertyGroupNames,nr.propertyGroupKeys=dr.propertyGroupKeys;var Qp={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=gn(e)?e.generateStyle(this):Ye(e)?nr.fromJson(this,e):oe(e)?nr.fromString(this,e):nr(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},En={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:(("additive"===e||"single"===e)&&(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var n,a,i,s,o,e=arguments,t=this._private.pan;switch(e.length){case 0:return t;case 1:if(oe(e[0]))return t[n=e[0]];if(Oe(e[0])){if(!this._private.panningEnabled)return this;o=(i=e[0]).y,_e(s=i.x)&&(t.x=s),_e(o)&&(t.y=o),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;a=e[1],("x"===(n=e[0])||"y"===n)&&_e(a)&&(t[n]=a),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var i,s,o,l,u,n=arguments,a=this._private.pan;if(!this._private.panningEnabled)return this;switch(n.length){case 1:Oe(e)&&(u=(o=n[0]).y,_e(l=o.x)&&(a.x+=l),_e(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:s=t,("x"===(i=e)||"y"===i)&&_e(s)&&(a[i]+=s),this.emit("pan viewport")}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var n=this.getFitViewport(e,t);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,t){var n;if((_e(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled)&&(oe(e)?e=this.$(e):!function(e){return Oe(e)&&_e(e.x1)&&_e(e.x2)&&_e(e.y1)&&_e(e.y2)}(e)?vt(e)||(e=this.mutableElements()):((n={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1),!vt(e)||!e.empty())){n=n||e.boundingBox();var l,s=this.width(),o=this.height();if(t=_e(t)?t:0,!isNaN(s)&&!isNaN(o)&&s>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:l=(l=(l=Math.min((s-2*t)/n.w,(o-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:l)<this._private.minZoom?this._private.minZoom:l,pan:{x:(s-l*(n.x1+n.x2))/2,y:(o-l*(n.y1+n.y2))/2}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var a=e;e=a.min,t=a.max}return _e(e)&&_e(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):_e(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:_e(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var i,s,t=this._private,n=t.pan,a=t.zoom,o=!1;return t.zoomingEnabled||(o=!0),_e(e)?s=e:Oe(e)&&(s=e.level,null!=e.position?i=Za(e.position,a,n):null!=e.renderedPosition&&(i=e.renderedPosition),null!=i&&!t.panningEnabled&&(o=!0)),s=(s=s>t.maxZoom?t.maxZoom:s)<t.minZoom?t.minZoom:s,!o&&_e(s)&&s!==a&&(null==i||_e(i.x)&&_e(i.y))?null!=i?{zoomed:!0,panned:!0,zoom:s,pan:{x:-s/a*(i.x-n.x)+i.x,y:-s/a*(i.y-n.y)+i.y}}:{zoomed:!0,panned:!1,zoom:s,pan:n}:null},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,a=!0,i=[],s=!1,o=!1;if(!e)return this;if(_e(e.zoom)||(n=!1),Oe(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?s=!0:(t.zoom=l,i.push("zoom"))}if(a&&(!s||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;_e(u.x)&&(t.pan.x=u.x,o=!1),_e(u.y)&&(t.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(oe(e)){var n=e;e=this.mutableElements().filter(n)}else vt(e)||(e=this.mutableElements());if(0!==e.length){var a=e.boundingBox(),i=this.width(),s=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(a.x1+a.x2))/2,y:(s-t*(a.y1+a.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var a,i,e=this._private,t=e.container;return e.sizeCache=e.sizeCache||(t?(a=this.window().getComputedStyle(t),{width:t.clientWidth-(i=function(o){return parseFloat(a.getPropertyValue(o))})("padding-left")-i("padding-right"),height:t.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,t=this._private.zoom,n=this.renderedExtent(),a={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return a.w=a.x2-a.x1,a.h=a.y2-a.y1,a},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};En.centre=En.center,En.autolockNodes=En.autolock,En.autoungrabifyNodes=En.autoungrabify;var Aa={data:Ft.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Ft.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Ft.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Ft.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Aa.attr=Aa.data,Aa.removeAttr=Aa.removeData;var Ia=function(e){var t=this,n=(e=mt({},e)).container;n&&!nt(n)&&nt(n[0])&&(n=n[0]);var a=n?n._cyreg:null;(a=a||{})&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=t;var s=void 0!==Re&&void 0!==n&&!e.headless,o=e;o.layout=mt({name:s?"grid":"null"},o.layout),o.renderer=mt({name:s?"canvas":"null"},o.renderer);var l=function(v,b,y){return void 0!==b?b:void 0!==y?y:v},u=this._private={container:n,ready:!1,options:o,elements:new or(this),listeners:[],aniEles:new or(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:void 0===o.styleEnabled?s:o.styleEnabled,zoom:_e(o.zoom)?o.zoom:1,pan:{x:Oe(o.pan)&&_e(o.pan.x)?o.pan.x:0,y:Oe(o.pan)&&_e(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom}),u.styleEnabled&&t.setStyle([]);var d=mt({},o,o.renderer);t.initRenderer(d),function(v,b){if(v.some(Hf))return Vn.all(v).then(b);b(v)}([o.style,o.elements],function(h){var v=h[0],b=h[1];u.styleEnabled&&t.style().append(v),function(v,b,y){t.notifications(!1);var g=t.mutableElements();g.length>0&&g.remove(),null!=v&&(Oe(v)||Ye(v))&&t.add(v),t.one("layoutready",function(C){t.notifications(!0),t.emit(C),t.one("load",b),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",y),t.emit("done")});var w=mt({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()}(b,function(){t.startAnimationLoop(),u.ready=!0,Be(o.ready)&&t.on("ready",o.ready);for(var y=0;y<i.length;y++)t.on("ready",i[y]);a&&(a.readies=[]),t.emit("ready")},o.done)})},Ai=Ia.prototype;mt(Ai,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(null==this._private.container)return Re;var t=this._private.container.ownerDocument;return void 0===t||null==t?Re:t.defaultView||Re},mount:function(e){if(null!=e){var t=this,n=t._private,a=n.options;return!nt(e)&&nt(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(mt({},a,a.renderer,{name:"null"===a.renderer.name?"canvas":a.renderer.name})),t.startAnimationLoop(),t.style(a.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Pr(this._private.options)},json:function(e){var t=this,n=t._private,a=t.mutableElements();if(Oe(e)){if(t.startBatch(),e.elements){var s={},o=function(N,z){for(var V=[],F=[],U=0;U<N.length;U++){var q=N[U];if(q.data.id){var Z=""+q.data.id,K=t.getElementById(Z);s[Z]=!0,0!==K.length?F.push({ele:K,json:q}):(z&&(q.group=z),V.push(q))}else _t("cy.json() cannot handle elements without an ID attribute")}t.add(V);for(var J=0;J<F.length;J++){var Q=F[J];Q.ele.json(Q.json)}};if(Ye(e.elements))o(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];Ye(d)&&o(d,c)}var f=t.collection();a.filter(function(C){return!s[C.id()]}).forEach(function(C){C.isParent()?f.merge(C):C.remove()}),f.forEach(function(C){return C.children().move({parent:null})}),f.forEach(function(C){return(N=C,t.getElementById(N.id())).remove();var N})}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var h=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],v=0;v<h.length;v++){var b=h[v];null!=e[b]&&t[b](e[b])}return t.endBatch(),this}var g={};e?g.elements=this.elements().map(function(C){return C.json()}):(g.elements={},a.forEach(function(C){var N=C.group();g.elements[N]||(g.elements[N]=[]),g.elements[N].push(C.json())})),this._private.styleEnabled&&(g.style=t.style().json()),g.data=Pr(t.data());var w=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=Pr(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=Pr(w.renderer),g.hideEdgesOnViewport=w.hideEdgesOnViewport,g.textureOnViewport=w.textureOnViewport,g.wheelSensitivity=w.wheelSensitivity,g.motionBlur=w.motionBlur,g.multiClickDebounceTime=w.multiClickDebounceTime,g}}),Ai.$id=Ai.getElementById,[Up,qp,gd,Go,Ci,Kp,zo,Di,Qp,En,Aa].forEach(function(r){mt(Ai,r)});var ty={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},ry={maximal:!1,acyclic:!1},Zn=function(e){return e.scratch("breadthfirst")},pd=function(e,t){return e.scratch("breadthfirst",t)};function yd(r){this.options=mt({},ty,ry,r)}yd.prototype.run=function(){var u,r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(pt){return pt.isChildless()}),a=t,i=r.directed,s=r.acyclic||r.maximal||r.maximalAdjustments>0,o=!!r.boundingBox,l=gr(o?r.boundingBox:structuredClone(e.extent()));if(vt(r.roots))u=r.roots;else if(Ye(r.roots)){for(var c=[],d=0;d<r.roots.length;d++){var h=e.getElementById(r.roots[d]);c.push(h)}u=e.collection(c)}else if(oe(r.roots))u=e.$(r.roots);else if(i)u=n.roots();else{var v=t.components();u=e.collection();for(var b=function(){var ot=v[y],gt=ot.maxDegree(!1),ht=ot.filter(function(Tt){return Tt.degree(!1)===gt});u=u.add(ht)},y=0;y<v.length;y++)b()}var g=[],w={},C=function(ot,gt){null==g[gt]&&(g[gt]=[]);var ht=g[gt].length;g[gt].push(ot),pd(ot,{index:ht,depth:gt})};a.bfs({roots:u,directed:r.directed,visit:function(ot,gt,ht,Tt,wt){var Lt=ot[0],Rt=Lt.id();Lt.isChildless()&&C(Lt,wt),w[Rt]=!0}});for(var z=[],V=0;V<n.length;V++){var F=n[V];w[F.id()]||z.push(F)}var U=function(ot){for(var gt=g[ot],ht=0;ht<gt.length;ht++){var Tt=gt[ht];null!=Tt?pd(Tt,{depth:ot,index:ht}):(gt.splice(ht,1),ht--)}},q=function(ot,gt){for(var ht=Zn(ot),Tt=ot.incomers().filter(function(je){return je.isNode()&&t.has(je)}),wt=-1,Lt=ot.id(),Rt=0;Rt<Tt.length;Rt++){var Bt=Zn(Tt[Rt]);wt=Math.max(wt,Bt.depth)}if(ht.depth<=wt){if(!r.acyclic&>[Lt])return null;var Pt=wt+1;return function(ot,gt){var ht=Zn(ot);g[ht.depth][ht.index]=null,ot.isChildless()&&C(ot,gt)}(ot,Pt),gt[Lt]=Pt,!0}return!1};if(i&&s){var Z=[],K={},J=function(ot){return Z.push(ot)},Q=function(){return Z.shift()};for(n.forEach(function(pt){return Z.push(pt)});Z.length>0;){var le=Q(),de=q(le,K);if(de)le.outgoers().filter(function(pt){return pt.isNode()&&t.has(pt)}).forEach(J);else if(null===de){_t("Detected double maximal shift for node `"+le.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var he=0;if(r.avoidOverlap)for(var ue=0;ue<n.length;ue++){var Se=n[ue].layoutDimensions(r);he=Math.max(he,Se.w,Se.h)}var De={},Ue=function(ot){if(De[ot.id()])return De[ot.id()];for(var gt=Zn(ot).depth,ht=ot.neighborhood(),Tt=0,wt=0,Lt=0;Lt<ht.length;Lt++){var Rt=ht[Lt];if(!Rt.isEdge()&&!Rt.isParent()&&n.has(Rt)){var Gt=Zn(Rt);if(null!=Gt){var Bt=Gt.index,Pt=Gt.depth;null!=Bt&&null!=Pt&&Pt<gt&&(Tt+=Bt/g[Pt].length,wt++)}}}return Tt/=wt=Math.max(1,wt),0===wt&&(Tt=0),De[ot.id()]=Tt,Tt},$e=function(ot,gt){var wt=Ue(ot)-Ue(gt);return 0===wt?bl(ot.id(),gt.id()):wt};void 0!==r.depthSort&&($e=r.depthSort);for(var Xe=g.length,Qe=0;Qe<Xe;Qe++)g[Qe].sort($e),U(Qe);for(var tt=[],at=0;at<z.length;at++)tt.push(z[at]);tt.length&&(g.unshift(tt),Xe=g.length,function(){for(var ot=0;ot<Xe;ot++)U(ot)}());for(var Te=0,Ie=0;Ie<Xe;Ie++)Te=Math.max(g[Ie].length,Te);var Pe_x=l.x1+l.w/2,Pe_y=l.y1+l.h/2,ze=n.reduce(function(pt,ot){return gt=ot.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}),{w:-1===pt.w?gt.w:(pt.w+gt.w)/2,h:-1===pt.h?gt.h:(pt.h+gt.h)/2};var gt},{w:-1,h:-1}),rt=Math.max(1===Xe?0:o?(l.h-2*r.padding-ze.h)/(Xe-1):(l.h-2*r.padding-ze.h)/(Xe+1),he),ct=g.reduce(function(pt,ot){return Math.max(pt,ot.length)},0),Et={downward:0,leftward:90,upward:180,rightward:-90};return-1===Object.keys(Et).indexOf(r.direction)&&Xt("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(Et).join(", "))),t.nodes().layoutPositions(this,r,function(ot){return function yh(r,e,t){if(0===t)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=function gh(r,e,t,n,a){var i=a*Math.PI/180;return{x:Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,y:Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n}}(r.x,r.y,n,a,t),l=function(e,t,n,a,i,s){return{x:(e-n)*i+n,y:(t-a)*s+a}}(o.x,o.y,n,a,i,s);return{x:l.x,y:l.y}}(function(ot){var gt=Zn(ot),ht=gt.depth,Tt=gt.index;if(r.circle){var wt=Math.min(l.w/2/Xe,l.h/2/Xe),Lt=(wt=Math.max(wt,he))*ht+wt-(Xe>0&&g[0].length<=3?wt/2:0),Rt=2*Math.PI/g[ht].length*Tt;return 0===ht&&1===g[0].length&&(Lt=1),{x:Pe_x+Lt*Math.cos(Rt),y:Pe_y+Lt*Math.sin(Rt)}}var Gt=g[ht].length,Bt=Math.max(1===Gt?0:o?(l.w-2*r.padding-ze.w)/((r.grid?ct:Gt)-1):(l.w-2*r.padding-ze.w)/((r.grid?ct:Gt)+1),he);return{x:Pe_x+(Tt+1-(Gt+1)/2)*Bt,y:Pe_y+(ht+1-(Xe+1)/2)*rt}}(ot),l,Et[r.direction])}),this};var ny={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function md(r){this.options=mt({},ny,r)}md.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var c,s=gr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},u=(void 0===e.sweep?2*Math.PI-2*Math.PI/i.length:e.sweep)/Math.max(1,i.length-1),d=0,f=0;f<i.length;f++){var v=i[f].layoutDimensions(e);d=Math.max(d,v.w,v.h)}if(c=_e(e.radius)?e.radius:i.length<=1?0:Math.min(s.h,s.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var g=Math.cos(u)-Math.cos(0),w=Math.sin(u)-Math.sin(0),C=Math.sqrt(d*d/(g*g+w*w));c=Math.max(C,c)}return n.nodes().layoutPositions(this,e,function(V,F){var U=e.startAngle+F*u*(a?1:-1),q=c*Math.cos(U),Z=c*Math.sin(U);return{x:o.x+q,y:o.y+Z}}),this};var ay={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function bd(r){this.options=mt({},ay,r)}bd.prototype.run=function(){for(var r=this.options,e=r,t=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=r.cy,a=e.eles,i=a.nodes().not(":parent"),s=gr(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},l=[],u=0,c=0;c<i.length;c++){var f,d=i[c];f=e.concentric(d),l.push({value:f,node:d}),d._private.scratch.concentric=f}i.updateStyle();for(var h=0;h<i.length;h++){var b=i[h].layoutDimensions(e);u=Math.max(u,b.w,b.h)}l.sort(function(rt,ct){return ct.value-rt.value});for(var y=e.levelWidth(i),g=[[]],w=g[0],C=0;C<l.length;C++){var N=l[C];w.length>0&&Math.abs(w[0].value-N.value)>=y&&g.push(w=[]),w.push(N)}var V=u+e.minNodeSpacing;if(!e.avoidOverlap){var F=g.length>0&&g[0].length>1,U=Math.min(s.w,s.h)/2-V;V=Math.min(V,U/(g.length+F?1:0))}for(var Z=0,K=0;K<g.length;K++){var J=g[K],Q=void 0===e.sweep?2*Math.PI-2*Math.PI/J.length:e.sweep,le=J.dTheta=Q/Math.max(1,J.length-1);if(J.length>1&&e.avoidOverlap){var de=Math.cos(le)-Math.cos(0),he=Math.sin(le)-Math.sin(0),ue=Math.sqrt(V*V/(de*de+he*he));Z=Math.max(ue,Z)}J.r=Z,Z+=V}if(e.equidistant){for(var ge=0,Se=0,Le=0;Le<g.length;Le++)ge=Math.max(ge,g[Le].r-Se);Se=0;for(var Ue=0;Ue<g.length;Ue++){var $e=g[Ue];0===Ue&&(Se=$e.r),$e.r=Se,Se+=ge}}for(var Xe={},Qe=0;Qe<g.length;Qe++)for(var tt=g[Qe],at=tt.dTheta,He=tt.r,Te=0;Te<tt.length;Te++){var Ie=tt[Te],Pe=e.startAngle+(t?1:-1)*at*Te,ze={x:o.x+He*Math.cos(Pe),y:o.y+He*Math.sin(Pe)};Xe[Ie.node.id()]=ze}return a.nodes().layoutPositions(this,e,function(rt){var ct=rt.id();return Xe[ct]}),this};var Uo,iy={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Ii(r){this.options=mt({},iy,r),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(a){var i=a.source().data("id"),s=a.target().data("id"),o=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===s});return!o||!l});this.options.eles=this.options.eles.not(n)}Ii.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(!0===r.animate||!1===r.animate)&&t.emit({type:"layoutstart",layout:t}),Uo=!0===r.debug;var n=sy(e,t,r);Uo&&(void 0)(n),r.randomize&&uy(n);var a=Ur(),i=function(){cy(n,e,r),!0===r.fit&&e.fit(r.padding)},s=function(f){return!(t.stopped||f>=r.numIter||(dy(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},o=function(){if(!0===r.animate||!1===r.animate)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var f=r.eles.nodes(),h=xd(n,r,f);f.layoutPositions(t,r,h)}},l=0,u=!0;if(!0===r.animate){var c=function(){for(var f=0;u&&f<r.refresh;)u=s(l),l++,f++;u?(Ur()-a>=r.animationThreshold&&i(),Ya(c)):(Cd(n,r),o())};c()}else{for(;u;)u=s(l),l++;Cd(n,r),o()}return this},Ii.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Ii.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var sy=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),s=gr(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},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],f=0;f<d.length;f++)u[d[f].id()]=c;for(c=0;c<o.nodeSize;c++){var b=(v=i[c]).layoutDimensions(n);(y={}).isLocked=v.locked(),y.id=v.data("id"),y.parentId=v.data("parent"),y.cmptId=u[v.id()],y.children=[],y.positionX=v.position("x"),y.positionY=v.position("y"),y.offsetX=0,y.offsetY=0,y.height=b.w,y.width=b.h,y.maxX=y.positionX+y.width/2,y.minX=y.positionX-y.width/2,y.maxY=y.positionY+y.height/2,y.minY=y.positionY-y.height/2,y.padLeft=parseFloat(v.style("padding")),y.padRight=parseFloat(v.style("padding")),y.padTop=parseFloat(v.style("padding")),y.padBottom=parseFloat(v.style("padding")),y.nodeRepulsion=Be(n.nodeRepulsion)?n.nodeRepulsion(v):n.nodeRepulsion,o.layoutNodes.push(y),o.idToIndex[y.id]=c}var g=[],w=0,C=-1,N=[];for(c=0;c<o.nodeSize;c++){var v,z=(v=o.layoutNodes[c]).parentId;null!=z?o.layoutNodes[o.idToIndex[z]].children.push(v.id):(g[++C]=v.id,N.push(v.id))}for(o.graphSet.push(N);w<=C;){var V=g[w++],U=o.layoutNodes[o.idToIndex[V]].children;if(U.length>0)for(o.graphSet.push(U),c=0;c<U.length;c++)g[++C]=U[c]}for(c=0;c<o.graphSet.length;c++){var q=o.graphSet[c];for(f=0;f<q.length;f++)o.indexToGraph[o.idToIndex[q[f]]]=c}for(c=0;c<o.edgeSize;c++){var K=a[c],J={};J.id=K.data("id"),J.sourceId=K.data("source"),J.targetId=K.data("target");var Q=Be(n.idealEdgeLength)?n.idealEdgeLength(K):n.idealEdgeLength,le=Be(n.edgeElasticity)?n.edgeElasticity(K):n.edgeElasticity,de=o.idToIndex[J.sourceId],he=o.idToIndex[J.targetId];if(o.indexToGraph[de]!=o.indexToGraph[he]){for(var Se=oy(J.sourceId,J.targetId,o),Le=o.graphSet[Se],ye=0,y=o.layoutNodes[de];-1===Le.indexOf(y.id);)y=o.layoutNodes[o.idToIndex[y.parentId]],ye++;for(y=o.layoutNodes[he];-1===Le.indexOf(y.id);)y=o.layoutNodes[o.idToIndex[y.parentId]],ye++;Q*=ye*n.nestingFactor}J.idealLength=Q,J.elasticity=le,o.layoutEdges.push(J)}return o},oy=function(e,t,n){var a=wd(e,t,0,n);return 2>a.count?0:a.graph},wd=function(e,t,n,a){var i=a.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var s=0,o=0;o<i.length;o++){var c=a.layoutNodes[a.idToIndex[i[o]]].children;if(0!==c.length){var f=wd(e,t,a.indexToGraph[a.idToIndex[c[0]]],a);if(0!==f.count){if(1!==f.count)return f;if(2===++s)break}}}return{count:s,graph:n}},uy=function(e,t){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var s=e.layoutNodes[i];0===s.children.length&&!s.isLocked&&(s.positionX=Math.random()*n,s.positionY=Math.random()*a)}},xd=function(e,t,n){var a=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.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 l=e.layoutNodes[e.idToIndex[s.data("id")]];return t.boundingBox?{x:a.x1+(0===i.w?.5:(l.positionX-i.x1)/i.w)*a.w,y:a.y1+(0===i.h?.5:(l.positionY-i.y1)/i.h)*a.h}:{x:l.positionX,y:l.positionY}}},cy=function(e,t,n){var a=n.layout,i=n.eles.nodes(),s=xd(e,n,i);i.positions(s),!0!==e.ready&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},dy=function(e,t,n){fy(e,t),gy(e),py(e,t),yy(e),my(e)},fy=function(e,t){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]]],l=s+1;l<i;l++)hy(o,e.layoutNodes[e.idToIndex[a[l]]],e,t)},Ed=function(e){return-e+2*e*Math.random()},hy=function(e,t,n,a){if(e.cmptId===t.cmptId||n.isCompound){var o=t.positionX-e.positionX,l=t.positionY-e.positionY;0===o&&0===l&&(o=Ed(1),l=Ed(1));var c=vy(e,t,o,l);if(c>0)var h=(d=a.nodeOverlap*c)*o/(f=Math.sqrt(o*o+l*l)),v=d*l/f;else{var d,b=Ni(e,o,l),y=Ni(t,-1*o,-1*l),g=y.x-b.x,w=y.y-b.y,C=g*g+w*w,f=Math.sqrt(C);h=(d=(e.nodeRepulsion+t.nodeRepulsion)/C)*g/f,v=d*w/f}e.isLocked||(e.offsetX-=h,e.offsetY-=v),t.isLocked||(t.offsetX+=h,t.offsetY+=v)}},vy=function(e,t,n,a){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(a>0)var s=e.maxY-t.minY;else s=t.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},Ni=function(e,t,n){var a=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=n/t,u=s/o,c={};return 0===t&&0<n||0===t&&0>n?(c.x=a,c.y=i+s/2,c):0<t&&-1*u<=l&&l<=u?(c.x=a+o/2,c.y=i+o*n/2/t,c):0>t&&-1*u<=l&&l<=u?(c.x=a-o/2,c.y=i-o*n/2/t,c):0<n&&(l<=-1*u||l>=u)?(c.x=a+s*t/2/n,c.y=i+s/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=a-s*t/2/n,c.y=i-s/2),c)},gy=function(e,t){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],s=e.layoutNodes[e.idToIndex[a.sourceId]],l=e.layoutNodes[e.idToIndex[a.targetId]],u=l.positionX-s.positionX,c=l.positionY-s.positionY;if(0!==u||0!==c){var d=Ni(s,u,c),f=Ni(l,-1*u,-1*c),h=f.x-d.x,v=f.y-d.y,b=Math.sqrt(h*h+v*v),y=Math.pow(a.idealLength-b,2)/a.elasticity;if(0!==b)var g=y*h/b,w=y*v/b;else g=0,w=0;s.isLocked||(s.offsetX+=g,s.offsetY+=w),l.isLocked||(l.offsetX-=g,l.offsetY-=w)}}},py=function(e,t){if(0!==t.gravity)for(var a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],s=i.length;if(0===a)var o=e.clientHeight/2,l=e.clientWidth/2;else{var c=e.layoutNodes[e.idToIndex[e.layoutNodes[e.idToIndex[i[0]]].parentId]];o=c.positionX,l=c.positionY}for(var d=0;d<s;d++){var f=e.layoutNodes[e.idToIndex[i[d]]];if(!f.isLocked){var h=o-f.positionX,v=l-f.positionY,b=Math.sqrt(h*h+v*v);if(b>1){var g=t.gravity*v/b;f.offsetX+=t.gravity*h/b,f.offsetY+=g}}}}},yy=function(e,t){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++],l=e.layoutNodes[e.idToIndex[s]],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,f=0;f<u.length;f++){var h=e.layoutNodes[e.idToIndex[u[f]]];h.offsetX+=c,h.offsetY+=d,n[++i]=u[f]}l.offsetX=0,l.offsetY=0}}},my=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(a=e.layoutNodes[n]).children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(a=e.layoutNodes[n]).children.length||a.isLocked)){var i=by(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,Td(a,e)}for(n=0;n<e.nodeSize;n++){var a;0<(a=e.layoutNodes[n]).children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},by=function(e,t,n){var a=Math.sqrt(e*e+t*t);if(a>n)var i={x:n*e/a,y:n*t/a};else i={x:e,y:t};return i},Td=function(e,t){var n=e.parentId;if(null!=n){var a=t.layoutNodes[t.idToIndex[n]],i=!1;if((null==a.maxX||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(null==a.minX||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(null==a.maxY||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(null==a.minY||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return Td(a,t)}},Cd=function(e,t){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var s=n[i],o=s.cmptId;(a[o]=a[o]||[]).push(s)}var u=0;for(i=0;i<a.length;i++)if(c=a[i]){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var d=0;d<c.length;d++){var f=c[d];c.x1=Math.min(c.x1,f.positionX-f.width/2),c.x2=Math.max(c.x2,f.positionX+f.width/2),c.y1=Math.min(c.y1,f.positionY-f.height/2),c.y2=Math.max(c.y2,f.positionY+f.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}a.sort(function(w,C){return C.w*C.h-w.w*w.h});var h=0,v=0,b=0,y=0,g=Math.sqrt(u)*e.clientWidth/e.clientHeight;for(i=0;i<a.length;i++){var c;if(c=a[i]){for(d=0;d<c.length;d++)(f=c[d]).isLocked||(f.positionX+=h-c.x1,f.positionY+=v-c.y1);h+=c.w+t.componentSpacing,b+=c.w+t.componentSpacing,y=Math.max(y,c.h),b>g&&(v+=y+t.componentSpacing,h=0,b=0,y=0)}}},wy={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Dd(r){this.options=mt({},wy,r)}Dd.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=n.nodes().not(":parent");e.sort&&(a=a.sort(e.sort));var i=gr(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(0===i.h||0===i.w)n.nodes().layoutPositions(this,e,function(Ue){return{x:i.x1,y:i.y1}});else{var s=a.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),c=function($e){if(null==$e)return Math.min(l,u);Math.min(l,u)==l?l=$e:u=$e},d=function($e){if(null==$e)return Math.max(l,u);Math.max(l,u)==l?l=$e:u=$e},f=e.rows,h=null!=e.cols?e.cols:e.columns;if(null!=f&&null!=h)l=f,u=h;else if(null!=f&&null==h)l=f,u=Math.ceil(s/l);else if(null==f&&null!=h)u=h,l=Math.ceil(s/u);else if(u*l>s){var v=c(),b=d();(v-1)*b>=s?c(v-1):(b-1)*v>=s&&d(b-1)}else for(;u*l<s;){var y=c(),g=d();(g+1)*y>=s?d(g+1):c(y+1)}var w=i.w/u,C=i.h/l;if(e.condense&&(w=0,C=0),e.avoidOverlap)for(var N=0;N<a.length;N++){var z=a[N],V=z._private.position;(null==V.x||null==V.y)&&(V.x=0,V.y=0);var F=z.layoutDimensions(e),U=e.avoidOverlapPadding,Z=F.h+U;w=Math.max(w,F.w+U),C=Math.max(C,Z)}for(var K={},J=function($e,Xe){return!!K["c-"+$e+"-"+Xe]},Q=function($e,Xe){K["c-"+$e+"-"+Xe]=!0},le=0,de=0,he=function(){++de>=u&&(de=0,le++)},ue={},ge=0;ge<a.length;ge++){var Se=a[ge],Le=e.position(Se);if(Le&&(void 0!==Le.row||void 0!==Le.col)){var ye={row:Le.row,col:Le.col};if(void 0===ye.col)for(ye.col=0;J(ye.row,ye.col);)ye.col++;else if(void 0===ye.row)for(ye.row=0;J(ye.row,ye.col);)ye.row++;ue[Se.id()]=ye,Q(ye.row,ye.col)}}a.layoutPositions(this,e,function($e,Xe){var Qe,tt;if($e.locked()||$e.isParent())return!1;var at=ue[$e.id()];if(at)Qe=at.col*w+w/2+i.x1,tt=at.row*C+C/2+i.y1;else{for(;J(le,de);)he();Qe=de*w+w/2+i.x1,tt=le*C+C/2+i.y1,Q(le,de),he()}return{x:Qe,y:tt}})}return this};var xy={ready:function(){},stop:function(){}};function Xo(r){this.options=mt({},xy,r)}Xo.prototype.run=function(){var r=this.options,e=r.eles,t=this;return t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this},Xo.prototype.stop=function(){return this};var Ey={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Sd(r){this.options=mt({},Ey,r)}Sd.prototype.run=function(){var r=this.options,t=r.eles.nodes(),n=Be(r.positions);return t.layoutPositions(this,r,function(i,s){var o=function a(i){return null==r.positions?function(e){return{x:e.x,y:e.y}}(i.position()):n?r.positions(i):r.positions[i._private.data.id]??null}(i);return!i.locked()&&null!=o&&o}),this};var Ty={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Ld(r){this.options=mt({},Ty,r)}Ld.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=gr(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()});return t.nodes().layoutPositions(this,r,function(s,o){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}}),this};var Cy=[{name:"breadthfirst",impl:yd},{name:"circle",impl:md},{name:"concentric",impl:bd},{name:"cose",impl:Ii},{name:"grid",impl:Dd},{name:"null",impl:Xo},{name:"preset",impl:Sd},{name:"random",impl:Ld}];function Ad(r){this.options=r,this.notifications=0}var Id=function(){},Nd=function(){throw new Error("A headless instance can not render images")};Ad.prototype={recalculateRenderedStyle:Id,notify:function(){this.notifications++},init:Id,isHeadless:function(){return!0},png:Nd,jpg:Nd};var jo={arrowShapeWidth:.3,registerArrowShapes:function(){var r=this.arrowShapes={},e=this,t=function(u,c,d,f,h,v,b){return h.x-d/2-b<=u&&u<=h.x+d/2+b&&h.y-d/2-b<=c&&c<=h.y+d/2+b},n=function(u,c,d,f,h){var v=u*Math.cos(f)-c*Math.sin(f),b=u*Math.sin(f)+c*Math.cos(f);return{x:v*d+h.x,y:b*d+h.y}},a=function(u,c,d,f){for(var h=[],v=0;v<u.length;v+=2)h.push(n(u[v],u[v+1],c,d,f));return h},i=function(u){for(var c=[],d=0;d<u.length;d++){var f=u[d];c.push(f.x,f.y)}return c},s=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},o=function(u,c){oe(c)&&(c=r[c]),r[u]=mt({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(f,h,v,b,y,g){var w=i(a(this.points,v+2*g,b,y));return mr(f,h,w)},roughCollide:t,draw:function(f,h,v,b){var y=a(this.points,h,v,b);e.arrowShapeImpl("polygon")(f,y)},spacing:function(f){return 0},gap:s},c)};o("none",{collide:qa,roughCollide:qa,draw:fs,spacing:jl,gap:jl}),o("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),o("arrow","triangle"),o("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),b=this.controlPoint,y=n(b[0],b[1],c,d,f);e.arrowShapeImpl(this.name)(u,v,y)},gap:function(u){return.8*s(u)}}),o("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,c,d,f,h,v,b){var y=i(a(this.points,d+2*b,f,h)),g=i(a(this.pointsTee,d+2*b,f,h));return mr(u,c,y)||mr(u,c,g)},draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),b=a(this.pointsTee,c,d,f);e.arrowShapeImpl(this.name)(u,v,b)}}),o("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,f,h,v,b){var y=h,g=Math.pow(y.x-u,2)+Math.pow(y.y-c,2)<=Math.pow((d+2*b)*this.radius,2),w=i(a(this.points,d+2*b,f,h));return mr(u,c,w)||g},draw:function(u,c,d,f,h){var v=a(this.pointsTr,c,d,f);e.arrowShapeImpl(this.name)(u,v,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.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(u,c){var d=this.baseCrossLinePts.slice(),f=c/u;return d[3]=d[3]-f,d[5]=d[5]-f,d},collide:function(u,c,d,f,h,v,b){var y=i(a(this.points,d+2*b,f,h)),g=i(a(this.crossLinePts(d,v),d+2*b,f,h));return mr(u,c,y)||mr(u,c,g)},draw:function(u,c,d,f,h){var v=a(this.points,c,d,f),b=a(this.crossLinePts(c,h),c,d,f);e.arrowShapeImpl(this.name)(u,v,b)}}),o("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return.525*s(u)}}),o("circle",{radius:.15,collide:function(u,c,d,f,h,v,b){var y=h;return Math.pow(y.x-u,2)+Math.pow(y.y-c,2)<=Math.pow((d+2*b)*this.radius,2)},draw:function(u,c,d,f,h){e.arrowShapeImpl(this.name)(u,f.x,f.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),o("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){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(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),o("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return.95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})}},Tn={projectIntoViewport:function(r,e){var t=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],s=n[4],o=t.pan(),l=t.zoom();return[((r-a)/s-o.x)/l,((e-i)/s-o.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(g){return parseFloat(t.getPropertyValue(g))},a_left=n("padding-left"),a_right=n("padding-right"),a_top=n("padding-top"),a_bottom=n("padding-bottom"),i_left=n("border-left-width"),i_right=n("border-right-width"),i_top=n("border-top-width"),s=(n("border-bottom-width"),r.clientWidth);return this.containerBB=[e.left+a_left+i_left,e.top+a_top+i_top,s-(a_left+a_right),r.clientHeight-(a_top+a_bottom),e.width/(s+(i_left+i_right))]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]},findNearestElements:function(r,e,t,n){var v,b,a=this,i=this,s=i.getCachedZSortedEles(),o=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,f=(n?8:2)/l,h=1/0;function y(F,U){if(F.isNode()){if(b)return;b=F,o.push(F)}if(F.isEdge()&&(null==U||U<h))if(v){if(v.pstyle("z-compound-depth").value===F.pstyle("z-compound-depth").value&&v.pstyle("z-compound-depth").value===F.pstyle("z-compound-depth").value)for(var q=0;q<o.length;q++)if(o[q].isEdge()){o[q]=F,v=F,h=U??h;break}}else o.push(F),v=F,h=U??h}function g(F){var U=F.outerWidth()+2*d,q=F.outerHeight()+2*d,Z=U/2,K=q/2,J=F.position(),Q="auto"===F.pstyle("corner-radius").value?"auto":F.pstyle("corner-radius").pfValue,le=F._private.rscratch;if(J.x-Z<=r&&r<=J.x+Z&&J.y-K<=e&&e<=J.y+K&&i.nodeShapes[a.getNodeShape(F)].checkPoint(r,e,0,U,q,J.x,J.y,Q,le))return y(F,0),!0}function w(F){var de,U=F._private,q=U.rscratch,Z=F.pstyle("width").pfValue,K=F.pstyle("arrow-scale").value,J=Z/2+c,Q=J*J,le=2*J,ge=U.source,Se=U.target;if("segments"===q.edgeType||"straight"===q.edgeType||"haystack"===q.edgeType){for(var he=q.allpts,ue=0;ue+3<he.length;ue+=2)if(nv(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3],le)&&Q>(de=lv(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3])))return y(F,de),!0}else if("bezier"===q.edgeType||"multibezier"===q.edgeType||"self"===q.edgeType||"compound"===q.edgeType)for(he=q.allpts,ue=0;ue+5<q.allpts.length;ue+=4)if(av(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3],he[ue+4],he[ue+5],le)&&Q>(de=ov(r,e,he[ue],he[ue+1],he[ue+2],he[ue+3],he[ue+4],he[ue+5])))return y(F,de),!0;ge=ge||U.source,Se=Se||U.target;var Le=a.getArrowWidth(Z,K),ye=[{name:"source",x:q.arrowStartX,y:q.arrowStartY,angle:q.srcArrowAngle},{name:"target",x:q.arrowEndX,y:q.arrowEndY,angle:q.tgtArrowAngle},{name:"mid-source",x:q.midX,y:q.midY,angle:q.midsrcArrowAngle},{name:"mid-target",x:q.midX,y:q.midY,angle:q.midtgtArrowAngle}];for(ue=0;ue<ye.length;ue++){var De=ye[ue],Ue=i.arrowShapes[F.pstyle(De.name+"-arrow-shape").value],$e=F.pstyle("width").pfValue;if(Ue.roughCollide(r,e,Le,De.angle,{x:De.x,y:De.y},$e,c)&&Ue.collide(r,e,Le,De.angle,{x:De.x,y:De.y},$e,c))return y(F),!0}u&&o.length>0&&(g(ge),g(Se))}function C(F,U,q){return vr(F,U,q)}function N(F,U){var K,q=F._private,Z=f;K=U?U+"-":"",F.boundingBox();var J=q.labelBounds[U||"main"],Q=F.pstyle(K+"label").value;if("yes"===F.pstyle("text-events").strValue&&Q){var de=C(q.rscratch,"labelX",U),he=C(q.rscratch,"labelY",U),ue=C(q.rscratch,"labelAngle",U),ge=F.pstyle(K+"text-margin-x").pfValue,Se=F.pstyle(K+"text-margin-y").pfValue,Le=J.x1-Z-ge,ye=J.x2+Z-ge,De=J.y1-Z-Se,Ue=J.y2+Z-Se;if(ue){var $e=Math.cos(ue),Xe=Math.sin(ue),Qe=function(ze,rt){return{x:(ze-=de)*$e-(rt-=he)*Xe+de,y:ze*Xe+rt*$e+he}},tt=Qe(Le,De),at=Qe(Le,Ue),He=Qe(ye,De),Te=Qe(ye,Ue);if(mr(r,e,[tt.x+ge,tt.y+Se,He.x+ge,He.y+Se,Te.x+ge,Te.y+Se,at.x+ge,at.y+Se]))return y(F),!0}else if(Qr(J,r,e))return y(F),!0}}t&&(s=s.interactive);for(var z=s.length-1;z>=0;z--){var V=s[z];V.isNode()?g(V)||N(V):w(V)||N(V)||N(V,"source")||N(V,"target")}return o},getAllInBox:function(r,e,t,n){var a=this.getCachedZSortedEles().interactive,s=2/this.cy.zoom(),o=[],l=Math.min(r,t),u=Math.max(r,t),c=Math.min(e,n),d=Math.max(e,n),f=gr({x1:r=l,y1:e=c,x2:t=u,y2:n=d}),h=[{x:f.x1,y:f.y1},{x:f.x2,y:f.y1},{x:f.x2,y:f.y2},{x:f.x1,y:f.y2}],v=[[h[0],h[1]],[h[1],h[2]],[h[2],h[3]],[h[3],h[0]]];function b(ze,rt,ct){return vr(ze,rt,ct)}function y(ze,rt){var ct=ze._private,Nt=s;ze.boundingBox();var bt=ct.labelBounds.main;if(!bt)return null;var pt=b(ct.rscratch,"labelX",rt),ot=b(ct.rscratch,"labelY",rt),gt=b(ct.rscratch,"labelAngle",rt),ht=ze.pstyle("text-margin-x").pfValue,Tt=ze.pstyle("text-margin-y").pfValue,wt=bt.x1-Nt-ht,Lt=bt.x2+Nt-ht,Rt=bt.y1-Nt-Tt,Gt=bt.y2+Nt-Tt;if(gt){var Bt=Math.cos(gt),Pt=Math.sin(gt),je=function(be,Ae){return{x:(be-=pt)*Bt-(Ae-=ot)*Pt+pt,y:be*Pt+Ae*Bt+ot}};return[je(wt,Rt),je(Lt,Rt),je(Lt,Gt),je(wt,Gt)]}return[{x:wt,y:Rt},{x:Lt,y:Rt},{x:Lt,y:Gt},{x:wt,y:Gt}]}function g(ze,rt,ct,Nt){function Et(bt,pt,ot){return(ot.y-bt.y)*(pt.x-bt.x)>(pt.y-bt.y)*(ot.x-bt.x)}return Et(ze,ct,Nt)!==Et(rt,ct,Nt)&&Et(ze,rt,ct)!==Et(ze,rt,Nt)}for(var w=0;w<a.length;w++){var C=a[w];if(C.isNode()){var N=C,z="yes"===N.pstyle("text-events").strValue,V=N.pstyle("box-selection").strValue,F="yes"===N.pstyle("box-select-labels").strValue;if("none"===V)continue;var q=N.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:("overlap"===V||F)&&z});if("contain"===V){var Z=!1;if(F&&z){var K=y(N);K&&Cs(K,h)&&(o.push(N),Z=!0)}!Z&&ru(f,q)&&o.push(N)}else if("overlap"===V&&bs(f,q)){var J=N.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(Cs([{x:J.x1,y:J.y1},{x:J.x2,y:J.y1},{x:J.x2,y:J.y2},{x:J.x1,y:J.y2}],h))o.push(N);else{var le=y(N);le&&Cs(le,h)&&o.push(N)}}}else{var de=C,he=de._private,ue=he.rscratch,ge=de.pstyle("box-selection").strValue;if("none"===ge)continue;if("contain"===ge){if(null!=ue.startX&&null!=ue.startY&&!Qr(f,ue.startX,ue.startY)||null!=ue.endX&&null!=ue.endY&&!Qr(f,ue.endX,ue.endY))continue;if("bezier"===ue.edgeType||"multibezier"===ue.edgeType||"self"===ue.edgeType||"compound"===ue.edgeType||"segments"===ue.edgeType||"haystack"===ue.edgeType){for(var Se=he.rstyle.bezierPts||he.rstyle.linePts||he.rstyle.haystackPts,Le=!0,ye=0;ye<Se.length;ye++)if(!tu(f,Se[ye])){Le=!1;break}Le&&o.push(de)}else"straight"===ue.edgeType&&o.push(de)}else if("overlap"===ge){var De=!1;if(null!=ue.startX&&null!=ue.startY&&null!=ue.endX&&null!=ue.endY&&(Qr(f,ue.startX,ue.startY)||Qr(f,ue.endX,ue.endY)))o.push(de),De=!0;else if(!De&&"haystack"===ue.edgeType)for(var Ue=he.rstyle.haystackPts,$e=0;$e<Ue.length;$e++)if(tu(f,Ue[$e])){o.push(de),De=!0;break}if(!De){var Xe=he.rstyle.bezierPts||he.rstyle.linePts||he.rstyle.haystackPts;if((!Xe||Xe.length<2)&&"straight"===ue.edgeType&&null!=ue.startX&&null!=ue.startY&&null!=ue.endX&&null!=ue.endY&&(Xe=[{x:ue.startX,y:ue.startY},{x:ue.endX,y:ue.endY}]),!Xe||Xe.length<2)continue;for(var Qe=0;Qe<Xe.length-1;Qe++){for(var tt=Xe[Qe],at=Xe[Qe+1],He=0;He<v.length;He++){var Te=fe(v[He],2);if(g(tt,at,Te[0],Te[1])){o.push(de),De=!0;break}}if(De)break}}}}}return o}},Ri={calculateArrowAngles:function(r){var l,u,c,d,f,h,e=r._private.rscratch,t="haystack"===e.edgeType,n="bezier"===e.edgeType,a="multibezier"===e.edgeType,i="segments"===e.edgeType,s="compound"===e.edgeType,o="self"===e.edgeType;t?(c=e.haystackPts[0],d=e.haystackPts[1],f=e.haystackPts[2],h=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,f=e.arrowEndX,h=e.arrowEndY),g=e.midX,w=e.midY,i?(l=c-e.segpts[0],u=d-e.segpts[1]):a||s||o||n?(l=c-tr((v=e.allpts)[0],v[2],v[4],.1),u=d-tr(v[1],v[3],v[5],.1)):(l=c-g,u=d-w),e.srcArrowAngle=Ja(l,u);var g=e.midX,w=e.midY;if(t&&(g=(c+f)/2,w=(d+h)/2),l=f-c,u=h-d,i)if((v=e.allpts).length/2%2==0)l=v[C=v.length/2]-v[N=C-2],u=v[C+1]-v[N+1];else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var N;l=v[C=v.length/2-1]-v[N=C-2],u=v[C+1]-v[N+1]}else if(a||s||o){var V,F,U,q,K,Z,J,v=e.allpts;e.ctrlpts.length/2%2==0?(V=tr(v[Z=v.length/2-1],v[K=Z+2],v[J=K+2],0),F=tr(v[Z+1],v[K+1],v[J+1],0),U=tr(v[Z],v[K],v[J],1e-4),q=tr(v[Z+1],v[K+1],v[J+1],1e-4)):(V=tr(v[Z=(K=v.length/2-1)-2],v[K],v[J=K+2],.4999),F=tr(v[Z+1],v[K+1],v[J+1],.4999),U=tr(v[Z],v[K],v[J],.5),q=tr(v[Z+1],v[K+1],v[J+1],.5)),l=U-V,u=q-F}if(e.midtgtArrowAngle=Ja(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i&&(v=e.allpts).length/2%2!=0&&!e.isRound){var C,Q=2+(C=v.length/2-1);l=-(v[Q]-v[C]),u=-(v[Q+1]-v[C+1])}if(e.midsrcArrowAngle=Ja(l,u),i)l=f-e.segpts[e.segpts.length-2],u=h-e.segpts[e.segpts.length-1];else if(a||s||o||n){var le=(v=e.allpts).length;l=f-tr(v[le-6],v[le-4],v[le-2],.9),u=h-tr(v[le-5],v[le-3],v[le-1],.9)}else l=f-g,u=h-w;e.tgtArrowAngle=Ja(l,u)}};Ri.getArrowWidth=Ri.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(13.37*r,.9),29)*e,t[r+", "+e]=n,n)};var Yo,Wo,Md,Cn,Mi,Yr,Dn,Sn,Fr,Jn,Oi,Od,Pd,qo,$o,kd,_r={},Cr={},Bd=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)};function _d(r,e){0===e.radius?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Ko(r,e,t,n){return 0===n||0===e.radius?{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}:(function(e,t,n,a,i){if(e!==kd?Bd(t,e,_r):function(e,t){t.x=-1*e.x,t.y=-1*e.y,t.nx=-1*e.nx,t.ny=-1*e.ny,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang}(Cr,_r),Bd(t,n,Cr),Md=_r.nx*Cr.nx-_r.ny*-Cr.ny,Yr=Math.asin(Math.max(-1,Math.min(1,_r.nx*Cr.ny-_r.ny*Cr.nx))),Math.abs(Yr)<1e-6)return Yo=t.x,Wo=t.y,void(Sn=Jn=0);Cn=1,Mi=!1,Md<0?Yr<0?Yr=Math.PI+Yr:(Yr=Math.PI-Yr,Cn=-1,Mi=!0):Yr>0&&(Cn=-1,Mi=!0),Jn=void 0!==t.radius?t.radius:a,Dn=Yr/2,Oi=Math.min(_r.len/2,Cr.len/2),i?(Fr=Math.abs(Math.cos(Dn)*Jn/Math.sin(Dn)))>Oi?(Fr=Oi,Sn=Math.abs(Fr*Math.sin(Dn)/Math.cos(Dn))):Sn=Jn:(Fr=Math.min(Oi,Jn),Sn=Math.abs(Fr*Math.sin(Dn)/Math.cos(Dn))),Yo=(qo=t.x+Cr.nx*Fr)-Cr.ny*Sn*Cn,Wo=($o=t.y+Cr.ny*Fr)+Cr.nx*Sn*Cn,Od=t.x+_r.nx*Fr,Pd=t.y+_r.ny*Fr,kd=t}(r,e,t,n,!(arguments.length>4&&void 0!==arguments[4])||arguments[4]),{cx:Yo,cy:Wo,radius:Sn,startX:Od,startY:Pd,stopX:qo,stopY:$o,startAngle:_r.ang+Math.PI/2*Cn,endAngle:Cr.ang-Math.PI/2*Cn,counterClockwise:Mi})}var Ly=Math.sqrt(.02),fr={};function Fd(r){var e=[];if(null!=r){for(var t=0;t<r.length;t+=2)e.push({x:r[t],y:r[t+1]});return e}}fr.findMidptPtsEtc=function(r,e){var i,q,Z,K,t=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,s=r.pstyle("source-endpoint"),o=r.pstyle("target-endpoint"),l=null!=s.units&&null!=o.units;switch(r.pstyle("edge-distances").value){case"node-position":i=t;break;case"intersection":i=n;break;case"endpoints":if(l){var f=fe(this.manualEndptToPx(r.source()[0],s),2),h=f[0],v=f[1],y=fe(this.manualEndptToPx(r.target()[0],o),2),g=y[0],w=y[1],C={x1:h,y1:v,x2:g,y2:w};Z=g-h,a={x:-(q=w-v)/(K=Math.sqrt(Z*Z+q*q)),y:Z/K},i=C}else _t("Edge ".concat(r.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}return{midptPts:i,vectorNormInverse:a}},fr.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],n=t._private,a=n.rscratch;if(!a.haystack){var i=2*Math.random()*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=2*Math.random()*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var s=n.source,o=n.target,l=s.position(),u=o.position(),c=s.width(),d=o.width(),f=s.height(),h=o.height(),b=t.pstyle("haystack-radius").value/2;a.haystackPts=a.allpts=[a.source.x*c*b+l.x,a.source.y*f*b+l.y,a.target.x*d*b+u.x,a.target.y*h*b+u.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}},fr.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),a=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),s=r.pstyle("radius-type"),o=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=s.pfValue[s.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var c=0;c<o;c++){var d=n.pfValue[c],f=a.pfValue[c],h=1-d,v=d,b=this.findMidptPtsEtc(r,e),y=b.midptPts,g=b.vectorNormInverse,w={x:y.x1*h+y.x2*v,y:y.y1*h+y.y2*v};t.segpts.push(w.x+g.x*f,w.y+g.y*f),t.radii.push(void 0!==i.pfValue[c]?i.pfValue[c]:l),t.isArcRadius.push("arc-radius"===(void 0!==s.pfValue[c]?s.pfValue[c]:u))}},fr.findLoopPoints=function(r,e,t,n){var a=r._private.rscratch,i=e.dirCounts,s=e.srcPos,o=r.pstyle("control-point-distances"),l=o?o.pfValue[0]:void 0,u=r.pstyle("loop-direction").pfValue,c=r.pstyle("loop-sweep").pfValue,d=r.pstyle("control-point-step-size").pfValue;a.edgeType="self";var f=t,h=d;n&&(f=0,h=l);var v=u-Math.PI/2,b=v-c/2,y=v+c/2,g=u+"_"+c;f=void 0===i[g]?i[g]=0:++i[g],a.ctrlpts=[s.x+1.4*Math.cos(b)*h*(f/3+1),s.y+1.4*Math.sin(b)*h*(f/3+1),s.x+1.4*Math.cos(y)*h*(f/3+1),s.y+1.4*Math.sin(y)*h*(f/3+1)]},fr.findCompoundLoopPoints=function(r,e,t,n){var a=r._private.rscratch;a.edgeType="compound";var i=e.srcPos,s=e.tgtPos,o=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,f=r.pstyle("control-point-distances"),v=t,b=d;n&&(v=0,b=f?f.pfValue[0]:void 0);var g={x:i.x-o/2,y:i.y-l/2},w={x:s.x-u/2,y:s.y-c/2},C={x:Math.min(g.x,w.x),y:Math.min(g.y,w.y)},z=Math.max(.5,Math.log(.01*o)),V=Math.max(.5,Math.log(.01*u));a.ctrlpts=[C.x,C.y-(1+Math.pow(50,1.12)/100)*b*(v/3+1)*z,C.x-(1+Math.pow(50,1.12)/100)*b*(v/3+1)*V,C.y]},fr.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"},fr.findBezierPoints=function(r,e,t,n,a){var i=r._private.rscratch,s=r.pstyle("control-point-step-size").pfValue,o=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),u=o&&l?Math.min(o.value.length,l.value.length):1,c=o?o.pfValue[0]:void 0,d=l.value[0],f=n;i.edgeType=f?"multibezier":"bezier",i.ctrlpts=[];for(var h=0;h<u;h++){var b,v=(.5-e.eles.length/2+t)*s*(a?-1:1),y=ms(v);f&&(c=o?o.pfValue[h]:s,d=l.value[h]);var g=void 0!==(b=n?c:void 0!==c?y*c:void 0)?b:v,w=1-d,C=d,N=this.findMidptPtsEtc(r,e),z=N.midptPts,V=N.vectorNormInverse,F={x:z.x1*w+z.x2*C,y:z.y1*w+z.y2*C};i.ctrlpts.push(F.x+V.x*g,F.y+V.y*g)}},fr.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",a="horizontal",i="leftward",s="rightward",o="downward",l="upward",c=e.posPts,d=e.srcW,f=e.srcH,h=e.tgtW,v=e.tgtH,y="node-position"!==r.pstyle("edge-distances").value,g=r.pstyle("taxi-direction").value,w=g,C=r.pstyle("taxi-turn"),N="%"===C.units,z=C.pfValue,V=z<0,F=r.pstyle("taxi-turn-min-distance").pfValue,q=y?(f+v)/2:0,Z=c.x2-c.x1,K=c.y2-c.y1,J=function(Ae,Fe){return Ae>0?Math.max(Ae-Fe,0):Math.min(Ae+Fe,0)},Q=J(Z,y?(d+h)/2:0),le=J(K,q),de=!1;"auto"===w?g=Math.abs(Q)>Math.abs(le)?a:n:w===l||w===o?(g=n,de=!0):(w===i||w===s)&&(g=a,de=!0);var ye,he=g===n,ue=he?le:Q,ge=he?K:Z,Se=ms(ge),Le=!1;(!de||!N&&!V)&&(w===o&&ge<0||w===l&&ge>0||w===i&&ge>0||w===s&&ge<0)&&(ue=(Se*=-1)*Math.abs(ue),Le=!0);var $e=function(Ae){return Math.abs(Ae)<F||Math.abs(Ae)>=Math.abs(ue)},Xe=$e(ye=N?(z<0?1+z:z)*ue:(z<0?ue:0)+z*Se),Qe=$e(Math.abs(ue)-Math.abs(ye));if(!Xe&&!Qe||Le)if(he){var wt=c.y1+ye+(y?f/2*Se:0);t.segpts=[c.x1,wt,c.x2,wt]}else{var Gt=c.x1+ye+(y?d/2*Se:0);t.segpts=[Gt,c.y1,Gt,c.y2]}else if(he){var at=Math.abs(ge)<=f/2,He=Math.abs(Z)<=h/2;if(at){var Te=(c.x1+c.x2)/2;t.segpts=[Te,c.y1,Te,c.y2]}else if(He){var ze=(c.y1+c.y2)/2;t.segpts=[c.x1,ze,c.x2,ze]}else t.segpts=[c.x1,c.y2]}else{var Nt=Math.abs(ge)<=d/2,Et=Math.abs(K)<=v/2;if(Nt){var bt=(c.y1+c.y2)/2;t.segpts=[c.x1,bt,c.x2,bt]}else if(Et){var gt=(c.x1+c.x2)/2;t.segpts=[gt,c.y1,gt,c.y2]}else t.segpts=[c.x2,c.y1]}if(t.isRound){var je=r.pstyle("taxi-radius").value,X="arc-radius"===r.pstyle("radius-type").value[0];t.radii=new Array(t.segpts.length/2).fill(je),t.isArcRadius=new Array(t.segpts.length/2).fill(X)}},fr.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if("bezier"===t.edgeType){var n=e.srcPos,a=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,f=e.tgtCornerRadius,h=e.srcRs,v=e.tgtRs,b=!_e(t.startX)||!_e(t.startY),y=!_e(t.arrowStartX)||!_e(t.arrowStartY),g=!_e(t.endX)||!_e(t.endY),w=!_e(t.arrowEndX)||!_e(t.arrowEndY),z=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,V=mn({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),F=V<z,U=mn({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),q=U<z,Z=!1;if(b||y||F){Z=!0;var K={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},J=Math.sqrt(K.x*K.x+K.y*K.y),Q={x:K.x/J,y:K.y/J},le=Math.max(i,s),de={x:t.ctrlpts[0]+2*Q.x*le,y:t.ctrlpts[1]+2*Q.y*le},he=u.intersectLine(n.x,n.y,i,s,de.x,de.y,0,d,h);F?(t.ctrlpts[0]=t.ctrlpts[0]+Q.x*(z-V),t.ctrlpts[1]=t.ctrlpts[1]+Q.y*(z-V)):(t.ctrlpts[0]=he[0]+Q.x*z,t.ctrlpts[1]=he[1]+Q.y*z)}if(g||w||q){Z=!0;var ue={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},ge=Math.sqrt(ue.x*ue.x+ue.y*ue.y),Se={x:ue.x/ge,y:ue.y/ge},Le=Math.max(i,s),ye={x:t.ctrlpts[0]+2*Se.x*Le,y:t.ctrlpts[1]+2*Se.y*Le},De=c.intersectLine(a.x,a.y,o,l,ye.x,ye.y,0,f,v);q?(t.ctrlpts[0]=t.ctrlpts[0]+Se.x*(z-U),t.ctrlpts[1]=t.ctrlpts[1]+Se.y*(z-U)):(t.ctrlpts[0]=De[0]+Se.x*z,t.ctrlpts[1]=De[1]+Se.y*z)}Z&&this.findEndpoints(r)}},fr.storeAllpts=function(r){var e=r._private.rscratch;if("multibezier"===e.edgeType||"bezier"===e.edgeType||"self"===e.edgeType||"compound"===e.edgeType){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);var n;e.allpts.push(e.endX,e.endY),e.ctrlpts.length/2%2==0?(e.midX=e.allpts[n=e.allpts.length/2-1],e.midY=e.allpts[n+1]):(e.midX=tr(e.allpts[n=e.allpts.length/2-3],e.allpts[n+2],e.allpts[n+4],.5),e.midY=tr(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],.5))}else if("straight"===e.edgeType)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("segments"===e.edgeType){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];e.roundCorners.push(Ko({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,e.isArcRadius[i/2-1]))}}if(e.segpts.length%4==0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var c=e.segpts.length/2-1;if(e.isRound){var d={x:e.segpts[c],y:e.segpts[c+1]},f=e.roundCorners[c/2];if(0===f.radius){var h={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-h.y,h.x-d.x]}else{var v=[d.x-f.cx,d.y-f.cy],b=f.radius/Math.sqrt(Math.pow(v[0],2)+Math.pow(v[1],2));v=v.map(function(y){return y*b}),e.midX=f.cx+v[0],e.midY=f.cy+v[1],e.midVector=v}}else e.midX=e.segpts[c],e.midY=e.segpts[c+1]}}},fr.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||_e(e.startX)&&_e(e.startY)&&_e(e.endX)&&_e(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,_t("Edge `"+r.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."))},fr.findEdgeControlPoints=function(r){var e=this;if(r&&0!==r.length){for(var t=this,a=t.cy.hasCompoundNodes(),i=new Xr,s=function(q,Z){return[].concat(te(q),[Z?1:0]).join("-")},o=[],l=[],u=0;u<r.length;u++){var c=r[u],d=c._private,f=c.pstyle("curve-style").value;if(!c.removed()&&c.takesUpSpace()){if("haystack"===f){l.push(c);continue}var h="unbundled-bezier"===f||Kr(f,"segments")||"straight"===f||"straight-triangle"===f||Kr(f,"taxi"),v="unbundled-bezier"===f||"bezier"===f,y=d.target,C=[d.source.poolIndex(),y.poolIndex()].sort(),N=s(C,h),z=i.get(N);null==z&&(z={eles:[]},o.push({pairId:C,edgeIsUnbundled:h}),i.set(N,z)),z.eles.push(c),h&&(z.hasUnbundled=!0),v&&(z.hasBezier=!0)}}for(var V=function(){var le,q=o[F],J=s(q.pairId,q.edgeIsUnbundled),Q=i.get(J);if(!Q.hasUnbundled){var de=Q.eles[0].parallelEdges().filter(function(X){return X.isBundledBezier()});hs(Q.eles),de.forEach(function(X){return Q.eles.push(X)}),Q.eles.sort(function(X,be){return X.poolIndex()-be.poolIndex()})}var he=Q.eles[0],ue=he.source(),ge=he.target();if(ue.poolIndex()>ge.poolIndex()){var Se=ue;ue=ge,ge=Se}var Le=Q.srcPos=ue.position(),ye=Q.tgtPos=ge.position(),De=Q.srcW=ue.outerWidth(),Ue=Q.srcH=ue.outerHeight(),$e=Q.tgtW=ge.outerWidth(),Xe=Q.tgtH=ge.outerHeight(),Qe=Q.srcShape=t.nodeShapes[e.getNodeShape(ue)],tt=Q.tgtShape=t.nodeShapes[e.getNodeShape(ge)],at=Q.srcCornerRadius="auto"===ue.pstyle("corner-radius").value?"auto":ue.pstyle("corner-radius").pfValue,He=Q.tgtCornerRadius="auto"===ge.pstyle("corner-radius").value?"auto":ge.pstyle("corner-radius").pfValue,Te=Q.tgtRs=ge._private.rscratch,Ie=Q.srcRs=ue._private.rscratch;Q.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Pe=0;Pe<Q.eles.length;Pe++){var ze=Q.eles[Pe],rt=ze[0]._private.rscratch,ct=ze.pstyle("curve-style").value,Nt="unbundled-bezier"===ct||Kr(ct,"segments")||Kr(ct,"taxi"),Et=!ue.same(ze.source());if(!Q.calculatedIntersection&&ue!==ge&&(Q.hasBezier||Q.hasUnbundled)){Q.calculatedIntersection=!0;var bt=Qe.intersectLine(Le.x,Le.y,De,Ue,ye.x,ye.y,0,at,Ie),pt=Q.srcIntn=bt,ot=tt.intersectLine(ye.x,ye.y,$e,Xe,Le.x,Le.y,0,He,Te),gt=Q.tgtIntn=ot,ht=Q.intersectionPts={x1:bt[0],x2:ot[0],y1:bt[1],y2:ot[1]},Tt=Q.posPts={x1:Le.x,x2:ye.x,y1:Le.y,y2:ye.y},wt=ot[1]-bt[1],Lt=ot[0]-bt[0],Rt=Math.sqrt(Lt*Lt+wt*wt);_e(Rt)&&Rt>=Ly||(Rt=Math.sqrt(Math.max(Lt*Lt,.01)+Math.max(wt*wt,.01)));var Gt=Q.vector={x:Lt,y:wt},Bt=Q.vectorNorm={x:Gt.x/Rt,y:Gt.y/Rt},Pt={x:-Bt.y,y:Bt.x};Q.nodesOverlap=!_e(Rt)||tt.checkPoint(bt[0],bt[1],0,$e,Xe,ye.x,ye.y,He,Te)||Qe.checkPoint(ot[0],ot[1],0,De,Ue,Le.x,Le.y,at,Ie),Q.vectorNormInverse=Pt,le={nodesOverlap:Q.nodesOverlap,dirCounts:Q.dirCounts,calculatedIntersection:!0,hasBezier:Q.hasBezier,hasUnbundled:Q.hasUnbundled,eles:Q.eles,srcPos:ye,srcRs:Te,tgtPos:Le,tgtRs:Ie,srcW:$e,srcH:Xe,tgtW:De,tgtH:Ue,srcIntn:gt,tgtIntn:pt,srcShape:tt,tgtShape:Qe,posPts:{x1:Tt.x2,y1:Tt.y2,x2:Tt.x1,y2:Tt.y1},intersectionPts:{x1:ht.x2,y1:ht.y2,x2:ht.x1,y2:ht.y1},vector:{x:-Gt.x,y:-Gt.y},vectorNorm:{x:-Bt.x,y:-Bt.y},vectorNormInverse:{x:-Pt.x,y:-Pt.y}}}var je=Et?le:Q;rt.nodesOverlap=je.nodesOverlap,rt.srcIntn=je.srcIntn,rt.tgtIntn=je.tgtIntn,rt.isRound=ct.startsWith("round"),a&&(ue.isParent()||ue.isChild()||ge.isParent()||ge.isChild())&&(ue.parents().anySame(ge)||ge.parents().anySame(ue)||ue.same(ge)&&ue.isParent())?e.findCompoundLoopPoints(ze,je,Pe,Nt):ue===ge?e.findLoopPoints(ze,je,Pe,Nt):ct.endsWith("segments")?e.findSegmentsPoints(ze,je):ct.endsWith("taxi")?e.findTaxiPoints(ze,je):"straight"===ct||!Nt&&Q.eles.length%2==1&&Pe===Math.floor(Q.eles.length/2)?e.findStraightEdgePoints(ze):e.findBezierPoints(ze,je,Pe,Nt,Et),e.findEndpoints(ze),e.tryToCorrectInvalidPoints(ze,je),e.checkForInvalidEdgeWarning(ze),e.storeAllpts(ze),e.storeEdgeProjections(ze),e.calculateArrowAngles(ze),e.recalculateEdgeLabelProjections(ze),e.calculateLabelAngles(ze)}},F=0;F<o.length;F++)V();this.findHaystackPoints(l)}},fr.getSegmentPoints=function(r){var e=r[0]._private.rscratch;if(this.recalculateRenderedStyle(r),"segments"===e.edgeType)return Fd(e.segpts)},fr.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if("bezier"===t||"multibezier"===t||"self"===t||"compound"===t)return Fd(e.ctrlpts)},fr.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Ra={manualEndptToPx:function(r,e){var n=r.position(),a=r.outerWidth(),i=r.outerHeight(),s=r._private.rscratch;if(2===e.value.length){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}var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(a,i),c=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return this.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,"auto"===r.pstyle("corner-radius").value?"auto":r.pstyle("corner-radius").pfValue,s)},findEndpoints:function(r){var e,t,n,a,s,i=this,o=r.source()[0],l=r.target()[0],u=o.position(),c=l.position(),d=r.pstyle("target-arrow-shape").value,f=r.pstyle("source-arrow-shape").value,h=r.pstyle("target-distance-from-node").pfValue,v=r.pstyle("source-distance-from-node").pfValue,b=o._private.rscratch,y=l._private.rscratch,g=r.pstyle("curve-style").value,w=r._private.rscratch,C=w.edgeType,N=Kr(g,"taxi"),z="self"===C||"compound"===C,V="bezier"===C||"multibezier"===C||z,F="bezier"!==C,U="straight"===C||"segments"===C,q="segments"===C,Z=V||F||U,K=z||N,J=r.pstyle("source-endpoint"),Q=K?"outside-to-node":J.value,le="auto"===o.pstyle("corner-radius").value?"auto":o.pstyle("corner-radius").pfValue,de=r.pstyle("target-endpoint"),he=K?"outside-to-node":de.value,ue="auto"===l.pstyle("corner-radius").value?"auto":l.pstyle("corner-radius").pfValue;w.srcManEndpt=J,w.tgtManEndpt=de;var ge,Se,Le,ye,De=null!==(e=2===(null==de||null===(t=de.pfValue)||void 0===t?void 0:t.length)?de.pfValue:null)&&void 0!==e?e:[0,0],Ue=null!==(n=2===(null==J||null===(a=J.pfValue)||void 0===a?void 0:a.length)?J.pfValue:null)&&void 0!==n?n:[0,0];if(V){var $e=[w.ctrlpts[0],w.ctrlpts[1]];ge=F?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:$e,Se=$e}else if(U){var Qe=q?w.segpts.slice(0,2):[c.x+De[0],c.y+De[1]];ge=q?w.segpts.slice(w.segpts.length-2):[u.x+Ue[0],u.y+Ue[1]],Se=Qe}if("inside-to-node"===he)s=[c.x,c.y];else if(de.units)s=this.manualEndptToPx(l,de);else if("outside-to-line"===he)s=w.tgtIntn;else if("outside-to-node"===he||"outside-to-node-or-label"===he?Le=ge:("outside-to-line"===he||"outside-to-line-or-label"===he)&&(Le=[u.x,u.y]),s=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),Le[0],Le[1],0,ue,y),"outside-to-node-or-label"===he||"outside-to-line-or-label"===he){var at=l._private.rscratch,Ie=at.labelX,Pe=at.labelY,ze=at.labelWidth/2,rt=at.labelHeight/2,ct=l.pstyle("text-valign").value;"top"===(ct=Yn(ct))?Pe-=rt:"bottom"===ct&&(Pe+=rt);var Nt=l.pstyle("text-halign").value;"left"===(Nt=jn(Nt))?Ie-=ze:"right"===Nt&&(Ie+=ze);var Et=ya(Le[0],Le[1],[Ie-ze,Pe-rt,Ie+ze,Pe-rt,Ie+ze,Pe+rt,Ie-ze,Pe+rt],c.x,c.y);if(Et.length>0){var bt=u,pt=bn(bt,kn(s)),ot=bn(bt,kn(Et)),gt=pt;ot<pt&&(s=Et,gt=ot),Et.length>2&&bn(bt,{x:Et[2],y:Et[3]})<gt&&(s=[Et[2],Et[3]])}}var Tt=ni(s,ge,i.arrowShapes[d].spacing(r)+h),wt=ni(s,ge,i.arrowShapes[d].gap(r)+h);if(w.endX=wt[0],w.endY=wt[1],w.arrowEndX=Tt[0],w.arrowEndY=Tt[1],"inside-to-node"===Q)s=[u.x,u.y];else if(J.units)s=this.manualEndptToPx(o,J);else if("outside-to-line"===Q)s=w.srcIntn;else if("outside-to-node"===Q||"outside-to-node-or-label"===Q?ye=Se:("outside-to-line"===Q||"outside-to-line-or-label"===Q)&&(ye=[c.x,c.y]),s=i.nodeShapes[this.getNodeShape(o)].intersectLine(u.x,u.y,o.outerWidth(),o.outerHeight(),ye[0],ye[1],0,le,b),"outside-to-node-or-label"===Q||"outside-to-line-or-label"===Q){var Lt=o._private.rscratch,Bt=Lt.labelX,Pt=Lt.labelY,je=Lt.labelWidth/2,X=Lt.labelHeight/2,be=o.pstyle("text-valign").value;"top"===(be=Yn(be))?Pt-=X:"bottom"===be&&(Pt+=X);var Ae=o.pstyle("text-halign").value;"left"===(Ae=jn(Ae))?Bt-=je:"right"===Ae&&(Bt+=je);var Fe=ya(ye[0],ye[1],[Bt-je,Pt-X,Bt+je,Pt-X,Bt+je,Pt+X,Bt-je,Pt+X],u.x,u.y);if(Fe.length>0){var Ve=c,dt=bn(Ve,kn(s)),Ke=bn(Ve,kn(Fe)),st=dt;Ke<dt&&(s=[Fe[0],Fe[1]],st=Ke),Fe.length>2&&bn(Ve,{x:Fe[2],y:Fe[3]})<st&&(s=[Fe[2],Fe[3]])}}var yt=ni(s,Se,i.arrowShapes[f].spacing(r)+v),Ct=ni(s,Se,i.arrowShapes[f].gap(r)+v);w.startX=Ct[0],w.startY=Ct[1],w.arrowStartX=yt[0],w.arrowStartY=yt[1],Z&&(w.badLine=!(_e(w.startX)&&_e(w.startY)&&_e(w.endX)&&_e(w.endY)))},getSourceEndpoint:function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),"haystack"===e.edgeType?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}},getTargetEndpoint:function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),"haystack"===e.edgeType?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}}},Zo={};function Ay(r,e,t){for(var n=function(u,c,d,f){return tr(u,c,d,f)},i=e._private.rstyle.bezierPts,s=0;s<r.bezierProjPcts.length;s++){var o=r.bezierProjPcts[s];i.push({x:n(t[0],t[2],t[4],o),y:n(t[1],t[3],t[5],o)})}}Zo.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,n=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,"multibezier"===n||"bezier"===n||"self"===n||"compound"===n){e.rstyle.bezierPts=[];for(var a=0;a+5<t.allpts.length;a+=4)Ay(this,r,t.allpts.slice(a,a+6))}else if("segments"===n){var i=e.rstyle.linePts=[];for(a=0;a+1<t.allpts.length;a+=2)i.push({x:t.allpts[a],y:t.allpts[a+1]})}else if("haystack"===n){var s=t.haystackPts;e.rstyle.haystackPts=[{x:s[0],y:s[1]},{x:s[2],y:s[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth},Zo.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Gr={recalculateNodeLabelProjection:function(r){var e=r.pstyle("label").strValue;if(!Sr(e)){var t,n,a=r._private,i=r.width(),s=r.height(),o=r.padding(),l=r.position(),u=r.pstyle("text-halign").strValue,c=r.pstyle("text-valign").strValue,d=a.rscratch,f=a.rstyle;switch(u){case"left":t=l.x-i/2-o;break;case"left-inside":t=l.x-i/2+o;break;case"right":t=l.x+i/2+o;break;case"right-inside":t=l.x+i/2-o;break;default:t=l.x}switch(c){case"top":n=l.y-s/2-o;break;case"top-inside":n=l.y-s/2+o;break;case"bottom":n=l.y+s/2+o;break;case"bottom-inside":n=l.y+s/2-o;break;default:n=l.y}d.labelX=t,d.labelY=n,f.labelX=t,f.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}}},Gd=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},zd=function(e,t){return Gd(t.x-e.x,t.y-e.y)};Gr.recalculateEdgeLabelProjections=function(r){var e,t=r._private,n=t.rscratch,a=this,i={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(i.mid||i.source||i.target){var s=function(d,f,h){kr(t.rscratch,d,f,h),kr(t.rstyle,d,f,h)};s("labelX",null,(e={x:n.midX,y:n.midY}).x),s("labelY",null,e.y);var o=Gd(n.midDispX,n.midDispY);s("labelAutoAngle",null,o);var l=function(){if(l.cache)return l.cache;for(var d=[],f=0;f+5<n.allpts.length;f+=4)d.push({p0:{x:n.allpts[f],y:n.allpts[f+1]},p1:{x:n.allpts[f+2],y:n.allpts[f+3]},p2:{x:n.allpts[f+4],y:n.allpts[f+5]},startDist:0,length:0,segments:[]});var y=t.rstyle.bezierPts,g=a.bezierProjPcts.length;function w(F,U,q,Z,K){var J=mn(U,q),Q=F.segments[F.segments.length-1];F.segments.push({p0:U,p1:q,t0:Z,t1:K,startDist:Q?Q.startDist+Q.length:0,length:J}),F.length+=J}for(var C=0;C<d.length;C++){var N=d[C],z=d[C-1];z&&(N.startDist=z.startDist+z.length),w(N,N.p0,y[C*g],0,a.bezierProjPcts[0]);for(var V=0;V<g-1;V++)w(N,y[C*g+V],y[C*g+V+1],a.bezierProjPcts[V],a.bezierProjPcts[V+1]);w(N,y[C*g+g-1],N.p2,a.bezierProjPcts[g-1],1)}return l.cache=d},u=function(d){var f,h="source"===d;if(i[d]){var v=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var y,b=l(),g=0,w=0,C=0;C<b.length;C++){for(var N=b[h?C:b.length-1-C],z=0;z<N.segments.length;z++){var V=N.segments[h?z:N.segments.length-1-z];if(g=w,(w+=V.length)>=v||C===b.length-1&&z===N.segments.length-1){y={cp:N,segment:V};break}}if(y)break}var U=y.cp,q=y.segment,Z=(v-g)/q.length,K=q.t1-q.t0,J=h?q.t0+K*Z:q.t1-K*Z;J=ga(0,J,1),e=Bn(U.p0,U.p1,U.p2,J),f=function(e,t,n,a){var i=ga(0,a-.001,1),s=ga(0,a+.001,1),o=Bn(e,t,n,i),l=Bn(e,t,n,s);return zd(o,l)}(U.p0,U.p1,U.p2,J);break;case"straight":case"segments":case"haystack":for(var le,de,he,ue,Q=0,ge=n.allpts.length,Se=0;Se+3<ge&&(h?(he={x:n.allpts[Se],y:n.allpts[Se+1]},ue={x:n.allpts[Se+2],y:n.allpts[Se+3]}):(he={x:n.allpts[ge-2-Se],y:n.allpts[ge-1-Se]},ue={x:n.allpts[ge-4-Se],y:n.allpts[ge-3-Se]}),de=Q,!((Q+=le=mn(he,ue))>=v));Se+=2);var ye=(v-de)/le;ye=ga(0,ye,1),e=function(e,t,n,a){var i_x=t.x-e.x,i_y=t.y-e.y,s=mn(e,t);return n=n??0,{x:e.x+i_x/s*(a=a??n*s),y:e.y+i_y/s*a}}(he,ue,ye),f=zd(he,ue)}s("labelX",d,e.x),s("labelY",d,e.y),s("labelAutoAngle",d,f)}};u("source"),u("target"),this.applyLabelDimensions(r)}},Gr.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))},Gr.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=yn(n,r._private.labelDimsKey);if(vr(t.rscratch,"prefixedLabelDimsKey",e)!==a){kr(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),s=r.pstyle("line-height").pfValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("text-wrap").strValue,u=vr(t.rscratch,"labelWrapCachedLines",e)||[],c="wrap"!==l?1:Math.max(u.length,1),d=o*s,f=i.width,h=i.height+(c-1)*(s-1)*o;kr(t.rstyle,"labelWidth",e,f),kr(t.rscratch,"labelWidth",e,f),kr(t.rstyle,"labelHeight",e,h),kr(t.rscratch,"labelHeight",e,h),kr(t.rscratch,"labelLineHeight",e,d),kr(t.rscratch,"labelActualDescent",e,i.labelActualDescent)}},Gr.getLabelText=function(r,e){var t=r._private,a=r.pstyle((e?e+"-":"")+"label").strValue,i=r.pstyle("text-transform").value,s=function(Ue,$e){return $e?(kr(t.rscratch,Ue,e,$e),$e):vr(t.rscratch,Ue,e)};if(!a)return"";"none"==i||("uppercase"==i?a=a.toUpperCase():"lowercase"==i&&(a=a.toLowerCase()));var o=r.pstyle("text-wrap").value;if("wrap"===o){var l=s("labelKey");if(null!=l&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var c=a.split("\n"),d=r.pstyle("text-max-width").pfValue,h="anywhere"===r.pstyle("text-overflow-wrap").value,v=[],b=/[\s\u200b]+|$/g,y=0;y<c.length;y++){var g=c[y],C=this.calculateLabelDimensions(r,g).width;if(h){var N=g.split("").join("\u200b");g=N}if(C>d){var q,V="",F=0,U=H(g.matchAll(b));try{for(U.s();!(q=U.n()).done;){var Z=q.value,K=Z[0],J=g.substring(F,Z.index);F=Z.index+K.length,this.calculateLabelDimensions(r,0===V.length?J:V+J+K).width<=d?V+=J+K:(V&&v.push(V),V=J+K)}}catch(De){U.e(De)}finally{U.f()}V.match(/^[\s\u200b]+$/)||v.push(V)}else v.push(g)}s("labelWrapCachedLines",v),a=s("labelWrapCachedText",v.join("\n")),s("labelWrapKey",l)}else if("ellipsis"===o){var he=r.pstyle("text-max-width").pfValue,ue="",Se=!1;if(this.calculateLabelDimensions(r,a).width<he)return a;for(var Le=0;Le<a.length&&!(this.calculateLabelDimensions(r,ue+a[Le]+"\u2026").width>he);Le++)ue+=a[Le],Le===a.length-1&&(Se=!0);return Se||(ue+="\u2026"),ue}return a},Gr.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;return"auto"===e?r.isNode()?function(e){switch(e){case"left":case"right-inside":return"right";case"right":case"left-inside":return"left";default:return"center"}}(t):"center":e},Gr.calculateLabelDimensions=function(r,e){var a=this.cy.window().document,s=r.pstyle("font-style").strValue,o=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,u=r.pstyle("font-weight").strValue,c=r.pstyle("text-metrics").strValue||"font",d=this.labelCalcCanvas,f=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=a.createElement("canvas"),f=this.labelCalcCanvasContext=d.getContext("2d");var h=d.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}f.font="".concat(s," ").concat(u," ").concat(o,"px ").concat(l);for(var v=0,b=0,y=e.split("\n"),g=y.length,w=0,C=0,N=0;N<g;N++){var V=f.measureText(y[N]),F=Math.ceil(V.width),U=o;"glyph"===c&&(0===N&&(C=V.actualBoundingBoxAscent),N===g-1&&(w=V.actualBoundingBoxDescent)),v=Math.max(F,v),b+=U}return"glyph"===c&&(b-=o-C-w),{width:v+=0,height:b+=0,labelActualAscent:C,labelActualDescent:w}},Gr.calculateLabelAngle=function(r,e){var n=r._private.rscratch,a=r.isEdge(),s=r.pstyle((e?e+"-":"")+"text-rotation"),o=s.strValue;return"none"===o?0:a&&"autorotate"===o?n.labelAutoAngle:"autorotate"===o?0:s.pfValue},Gr.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),a=r._private.rscratch;a.labelAngle=e.calculateLabelAngle(r),t&&(a.sourceLabelAngle=e.calculateLabelAngle(r,"source"),a.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var Vd={},Ud=!1;Vd.getNodeShape=function(r){var t=r.pstyle("shape").value;if("cutrectangle"===t&&(r.width()<28||r.height()<28))return Ud||(_t("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Ud=!0),"rectangle";if(r.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=r.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var ki={updateCachedGrabbedEles:function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var a=(n=r[t])._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(t=0;t<e.length;t++){var n;r.drag.push(n=e[t])}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(nd),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e}},Xd={};[Tn,Ri,fr,Ra,Zo,Gr,Vd,{registerCalculationListeners:function(){var r=this.cy,e=r.collection(),t=this,n=function(s){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.merge(s),o)for(var l=0;l<s.length;l++){var d=s[l]._private.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(s){n(s.target)}).on("style.* background.*",function(s){n(s.target,!1)});var a=function(s){if(s){var o=t.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(n(u.connectedEdges()),c.cleanConnected=!0)}if(o)for(var d=0;d<o.length;d++)(0,o[d])(s,e);t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){a(!0)},t.beforeRender(a,t.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(r){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(r)},recalculateRenderedStyle:function(r,e){var t=function(N){return N._private.rstyle.cleanConnected};if(0!==r.length){var n=[],a=[];if(!this.destroyed){void 0===e&&(e=!0);for(var i=0;i<r.length;i++){var s=r[i],o=s._private,l=o.rstyle;s.isEdge()&&(!t(s.source())||!t(s.target()))&&(l.clean=!1),s.isEdge()&&s.isBundledBezier()&&s.parallelEdges().some(function(C){return!C._private.rstyle.clean&&C.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||s.removed())&&"none"!==s.pstyle("display").value&&("nodes"===o.group?a.push(s):n.push(s),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],f=c._private.rstyle,h=c.position();this.recalculateNodeLabelProjection(c),f.nodeX=h.x,f.nodeY=h.y,f.nodeW=c.pstyle("width").pfValue,f.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var v=0;v<n.length;v++){var y=n[v]._private,g=y.rstyle,w=y.rscratch;g.srcX=w.arrowStartX,g.srcY=w.arrowStartY,g.tgtX=w.arrowEndX,g.tgtY=w.arrowEndY,g.midX=w.midX,g.midY=w.midY,g.labelAngle=w.labelAngle,g.sourceLabelAngle=w.sourceLabelAngle,g.targetLabelAngle=w.targetLabelAngle}}}}},ki].forEach(function(r){mt(Xd,r)});var jd={getCachedImage:function(r,e,t){var a=this.imageCache=this.imageCache||{},i=a[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;var s=(i=a[r]=a[r]||{}).image=new Image;s.addEventListener("load",t),s.addEventListener("error",function(){s.error=!0});return"data:"===r.substring(0,5).toLowerCase()||(s.crossOrigin=e="null"===e?null:e),s.src=r,s}},Yd=function(e,t){var n=e[0];!n||n._private.grabbed===t||(n._private.grabbed=t,e.updateStyle(!1))},Qn={registerBinding:function(r,e,t,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],s=0;s<r.length;s++){var o=r[s];if(void 0!==o){var l=this.binder(o);i.push(l.on.apply(l,a))}}return i}return(l=this.binder(r)).on.apply(l,a)},binder:function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||function(e){return!(typeof HTMLElement>"u")&&e instanceof HTMLElement}(r);if(null==e.supportsPassiveEvents){var a=!1;try{var i=Object.defineProperty({},"passive",{get:function(){return a=!0,!0}});t.addEventListener("test",null,i)}catch{}e.supportsPassiveEvents=a}var s=function(l,u,c){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:d}),(r.addEventListener||r.on).apply(r,d),this};return{on:s,addEventListener:s,addListener:s,bind:s}},nodeIsDraggable:function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()},nodeIsGrabbable:function(r){return this.nodeIsDraggable(r)&&r.interactive()}};Qn.load=function(){var r=this,e=r.cy.window(),t=function(X){return X.selected()},a=function(X,be,Ae,Fe){null==X&&(X=r.cy);for(var Ve=0;Ve<be.length;Ve++)X.emit({originalEvent:Ae,type:be[Ve],position:Fe})},i=function(X){return X.shiftKey||X.metaKey||X.ctrlKey},s=function(X,be){var Ae=!0;if(r.cy.hasCompoundNodes()&&X&&X.pannable()){for(var Fe=0;be&&Fe<be.length;Fe++)if((X=be[Fe]).isNode()&&X.isParent()&&!X.pannable()){Ae=!1;break}}else Ae=!0;return Ae},o=function(X){X[0]._private.rscratch.inDragLayer=!0},u=function(X){X[0]._private.rscratch.isGrabTarget=!0},d=function(X,be){var Ae=be.addToList;!Ae.has(X)&&X.grabbable()&&!X.locked()&&(Ae.merge(X),function(e){Yd(e,!0)}(X))},h=function(X,be){be=be||{};var Ae=X.cy().hasCompoundNodes();be.inDragLayer&&(X.forEach(o),X.neighborhood().stdFilter(function(Fe){return!Ae||Fe.isEdge()}).forEach(o)),be.addToList&&X.forEach(function(Fe){d(Fe,be)}),function(X,be){if(X.cy().hasCompoundNodes()&&(null!=be.inDragLayer||null!=be.addToList)){var Ae=X.descendants();be.inDragLayer&&(Ae.forEach(o),Ae.connectedEdges().forEach(o)),be.addToList&&d(Ae,be)}}(X,be),y(X,{inDragLayer:be.inDragLayer}),r.updateCachedGrabbedEles()},v=h,b=function(X){X&&(r.getCachedZSortedEles().forEach(function(be){(function(e){Yd(e,!1)})(be),function(X){X[0]._private.rscratch.inDragLayer=!1}(be),function(X){X[0]._private.rscratch.isGrabTarget=!1}(be)}),r.updateCachedGrabbedEles())},y=function(X,be){if((null!=be.inDragLayer||null!=be.addToList)&&X.cy().hasCompoundNodes()){var Ae=X.ancestors().orphans();if(!Ae.same(X)){var Fe=Ae.descendants().spawnSelf().merge(Ae).unmerge(X).unmerge(X.descendants()),Ve=Fe.connectedEdges();be.inDragLayer&&(Ve.forEach(o),Fe.forEach(o)),be.addToList&&Fe.forEach(function(dt){d(dt,be)})}}},g=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},w=typeof MutationObserver<"u",C=typeof ResizeObserver<"u";w?(r.removeObserver=new MutationObserver(function(je){for(var X=0;X<je.length;X++){var Ae=je[X].removedNodes;if(Ae)for(var Fe=0;Fe<Ae.length;Fe++)if(Ae[Fe]===r.container){r.destroy();break}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(je){r.destroy()});var N=ca(function(){r.cy.resize()},100);w&&(r.styleObserver=new MutationObserver(N),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",N),C&&(r.resizeObserver=new ResizeObserver(N),r.resizeObserver.observe(r.container));var V=function(){r.invalidateContainerClientCoordsCache()};(function(X,be){for(;null!=X;)be(X),X=X.parentNode})(r.container,function(je){r.registerBinding(je,"transitionend",V),r.registerBinding(je,"animationend",V),r.registerBinding(je,"scroll",V)}),r.registerBinding(r.container,"contextmenu",function(je){je.preventDefault()});var U=function(X){for(var be=r.findContainerClientCoords(),Ae=be[0],Fe=be[1],Ve=be[2],dt=be[3],Ke=X.touches?X.touches:[X],st=!1,lt=0;lt<Ke.length;lt++){var yt=Ke[lt];if(Ae<=yt.clientX&&yt.clientX<=Ae+Ve&&Fe<=yt.clientY&&yt.clientY<=Fe+dt){st=!0;break}}if(!st)return!1;for(var Ct=r.container,ft=X.target.parentNode,At=!1;ft;){if(ft===Ct){At=!0;break}ft=ft.parentNode}return!!At};r.registerBinding(r.container,"mousedown",function(X){if(U(X)&&(1!==r.hoverData.which||1===X.which)){X.preventDefault(),g(),r.hoverData.capture=!0,r.hoverData.which=X.which;var be=r.cy,Ae=[X.clientX,X.clientY],Fe=r.projectIntoViewport(Ae[0],Ae[1]),Ve=r.selection,dt=r.findNearestElements(Fe[0],Fe[1],!0,!1),Ke=dt[0],st=r.dragData.possibleDragElements;r.hoverData.mdownPos=Fe,r.hoverData.mdownGPos=Ae;var lt=function(Mt){return{originalEvent:X,type:Mt,position:{x:Fe[0],y:Fe[1]}}};if(3==X.which){r.hoverData.cxtStarted=!0;var Ct={originalEvent:X,type:"cxttapstart",position:{x:Fe[0],y:Fe[1]}};Ke?(Ke.activate(),Ke.emit(Ct),r.hoverData.down=Ke):be.emit(Ct),r.hoverData.downTime=(new Date).getTime(),r.hoverData.cxtDragged=!1}else if(1==X.which){if(Ke&&Ke.activate(),null!=Ke&&r.nodeIsGrabbable(Ke)){if(u(Ke),Ke.selected()){st=r.dragData.possibleDragElements=be.collection();var ft=be.$(function(At){return At.isNode()&&At.selected()&&r.nodeIsGrabbable(At)});h(ft,{addToList:st}),Ke.emit(lt("grabon")),ft.forEach(function(Mt){Mt.emit(lt("grab"))})}else st=r.dragData.possibleDragElements=be.collection(),v(Ke,{addToList:st}),Ke.emit(lt("grabon")).emit(lt("grab"));r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Ke,r.hoverData.downs=dt,r.hoverData.downTime=(new Date).getTime(),a(Ke,["mousedown","tapstart","vmousedown"],X,{x:Fe[0],y:Fe[1]}),null==Ke?(Ve[4]=1,r.data.bgActivePosistion={x:Fe[0],y:Fe[1]},r.redrawHint("select",!0),r.redraw()):Ke.pannable()&&(Ve[4]=1),r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var Mt=r.hoverData.down;Mt?Mt.emit(lt("taphold")):be.emit(lt("taphold"))}},r.tapholdDuration)}Ve[0]=Ve[2]=Fe[0],Ve[1]=Ve[3]=Fe[1]}},!1);var Z,K,J,q=function(X){var be=X.getRootNode();if(be&&11===be.nodeType&&void 0!==be.host)return be}(r.container);r.registerBinding([e,q],"mousemove",function(X){var Dr;if(r.hoverData.capture||U(X)){var Ae=!1,Fe=r.cy,Ve=Fe.zoom(),dt=[X.clientX,X.clientY],Ke=r.projectIntoViewport(dt[0],dt[1]),st=r.hoverData.mdownPos,lt=r.hoverData.mdownGPos,yt=r.selection,Ct=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(Ct=r.findNearestElement(Ke[0],Ke[1],!0,!1));var ar,Dt=r.hoverData.last,ft=r.hoverData.down,At=[Ke[0]-yt[2],Ke[1]-yt[3]],Mt=r.dragData.possibleDragElements;if(lt){var Wt=dt[0]-lt[0],qt=dt[1]-lt[1];r.hoverData.isOverThresholdDrag=ar=Wt*Wt+qt*qt>=r.desktopTapThreshold2}var ur=i(X);ar&&(r.hoverData.tapholdCancelled=!0),Ae=!0,a(Ct,["mousemove","vmousemove","tapdrag"],X,{x:Ke[0],y:Ke[1]});var jt=function(Dr){return{originalEvent:X,type:Dr,position:{x:Ke[0],y:Ke[1]}}},$r=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||Fe.emit(jt("boxstart")),yt[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(3===r.hoverData.which){if(ar){var Rr=jt("cxtdrag");ft?ft.emit(Rr):Fe.emit(Rr),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||Ct!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(jt("cxtdragout")),r.hoverData.cxtOver=Ct,Ct&&Ct.emit(jt("cxtdragover")))}}else if(r.hoverData.dragging){if(Ae=!0,Fe.panningEnabled()&&Fe.userPanningEnabled()){var vn;if(r.hoverData.justStartedPan){var ji=r.hoverData.mdownPos;vn={x:(Ke[0]-ji[0])*Ve,y:(Ke[1]-ji[1])*Ve},r.hoverData.justStartedPan=!1}else vn={x:At[0]*Ve,y:At[1]*Ve};Fe.panBy(vn),Fe.emit(jt("dragpan")),r.hoverData.dragged=!0}Ke=r.projectIntoViewport(X.clientX,X.clientY)}else if(1!=yt[4]||null!=ft&&!ft.pannable()){if(ft&&ft.pannable()&&ft.active()&&ft.unactivate(),(!ft||!ft.grabbed())&&Ct!=Dt&&(Dt&&a(Dt,["mouseout","tapdragout"],X,{x:Ke[0],y:Ke[1]}),Ct&&a(Ct,["mouseover","tapdragover"],X,{x:Ke[0],y:Ke[1]}),r.hoverData.last=Ct),ft)if(ar){if(Fe.boxSelectionEnabled()&&ur)ft&&ft.grabbed()&&(b(Mt),ft.emit(jt("freeon")),Mt.emit(jt("free")),r.dragData.didDrag&&(ft.emit(jt("dragfreeon")),Mt.emit(jt("dragfree")))),$r();else if(ft&&ft.grabbed()&&r.nodeIsDraggable(ft)){var br=!r.dragData.didDrag;br&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||h(Mt,{inDragLayer:!0});var hr={x:0,y:0};if(_e(At[0])&&_e(At[1])&&(hr.x+=At[0],hr.y+=At[1],br)){var wr=r.hoverData.dragDelta;wr&&_e(wr[0])&&_e(wr[1])&&(hr.x+=wr[0],hr.y+=wr[1])}r.hoverData.draggingEles=!0,Mt.silentShift(hr).emit(jt("position")).emit(jt("drag")),r.redrawHint("drag",!0),r.redraw()}}else 0===(Dr=r.hoverData.dragDelta=r.hoverData.dragDelta||[]).length?(Dr.push(At[0]),Dr.push(At[1])):(Dr[0]+=At[0],Dr[1]+=At[1]);Ae=!0}else ar&&(r.hoverData.dragging||!Fe.boxSelectionEnabled()||!ur&&Fe.panningEnabled()&&Fe.userPanningEnabled()?!r.hoverData.selecting&&Fe.panningEnabled()&&Fe.userPanningEnabled()&&s(ft,r.hoverData.downs)&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,yt[4]=0,r.data.bgActivePosistion=kn(st),r.redrawHint("select",!0),r.redraw()):$r(),ft&&ft.pannable()&&ft.active()&&ft.unactivate());if(yt[2]=Ke[0],yt[3]=Ke[1],Ae)return X.stopPropagation&&X.stopPropagation(),X.preventDefault&&X.preventDefault(),!1}},!1),r.registerBinding(e,"mouseup",function(X){if((1!==r.hoverData.which||1===X.which||!r.hoverData.capture)&&r.hoverData.capture){r.hoverData.capture=!1;var Ae=r.cy,Fe=r.projectIntoViewport(X.clientX,X.clientY),Ve=r.selection,dt=r.findNearestElement(Fe[0],Fe[1],!0,!1),Ke=r.dragData.possibleDragElements,st=r.hoverData.down,lt=i(X);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,st&&st.unactivate();var yt=function(Wt){return{originalEvent:X,type:Wt,position:{x:Fe[0],y:Fe[1]}}};if(3===r.hoverData.which){var Ct=yt("cxttapend");if(st?st.emit(Ct):Ae.emit(Ct),!r.hoverData.cxtDragged){var Dt=yt("cxttap");st?st.emit(Dt):Ae.emit(Dt)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(1===r.hoverData.which){if(a(dt,["mouseup","tapend","vmouseup"],X,{x:Fe[0],y:Fe[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(st,["click","tap","vclick"],X,{x:Fe[0],y:Fe[1]}),K=!1,X.timeStamp-J<=Ae.multiClickDebounceTime()?(Z&&clearTimeout(Z),K=!0,J=null,a(st,["dblclick","dbltap","vdblclick"],X,{x:Fe[0],y:Fe[1]})):(Z=setTimeout(function(){K||a(st,["oneclick","onetap","voneclick"],X,{x:Fe[0],y:Fe[1]})},Ae.multiClickDebounceTime()),J=X.timeStamp)),null==st&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(X)&&(Ae.$(t).unselect(["tapunselect"]),Ke.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Ke=Ae.collection()),dt==st&&!r.dragData.didDrag&&!r.hoverData.selecting&&null!=dt&&dt._private.selectable&&(r.hoverData.dragging||("additive"===Ae.selectionType()||lt?dt.selected()?dt.unselect(["tapunselect"]):dt.select(["tapselect"]):lt||(Ae.$(t).unmerge(dt).unselect(["tapunselect"]),dt.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var ft=Ae.collection(r.getAllInBox(Ve[0],Ve[1],Ve[2],Ve[3]));r.redrawHint("select",!0),ft.length>0&&r.redrawHint("eles",!0),Ae.emit(yt("boxend")),"additive"===Ae.selectionType()||lt||Ae.$(t).unmerge(ft).unselect(),ft.emit(yt("box")).stdFilter(function(Wt){return Wt.selectable()&&!Wt.selected()}).select().emit(yt("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!Ve[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Mt=st&&st.grabbed();b(Ke),Mt&&(st.emit(yt("freeon")),Ke.emit(yt("free")),r.dragData.didDrag&&(st.emit(yt("dragfreeon")),Ke.emit(yt("dragfree"))))}}Ve[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}},!1);var de,Q=[],he=1e5,Se=function(X){var be=!1,Ae=X.deltaY;if(null==Ae&&(null!=X.wheelDeltaY?Ae=X.wheelDeltaY/4:null!=X.wheelDelta&&(Ae=X.wheelDelta/4)),0!==Ae){if(null==de)if(Q.length>=4){var Fe=Q;if(de=function(X){for(var Ae=0;Ae<X.length;Ae++)if(X[Ae]%5!=0)return!1;return!0}(Fe),!de){var Ve=Math.abs(Fe[0]);de=function(X){for(var be=Math.abs(X[0]),Ae=1;Ae<X.length;Ae++)if(Math.abs(X[Ae])!==be)return!1;return!0}(Fe)&&Ve>5}if(de)for(var dt=0;dt<Fe.length;dt++)he=Math.min(Math.abs(Fe[dt]),he)}else Q.push(Ae),be=!0;else de&&(he=Math.min(Math.abs(Ae),he));if(!r.scrollingPage){var Ke=r.cy,st=Ke.zoom(),lt=Ke.pan(),yt=r.projectIntoViewport(X.clientX,X.clientY),Ct=[yt[0]*st+lt.x,yt[1]*st+lt.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||0!==r.selection[4])return void X.preventDefault();if(Ke.panningEnabled()&&Ke.userPanningEnabled()&&Ke.zoomingEnabled()&&Ke.userZoomingEnabled()){var Dt;X.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150),be&&Math.abs(Ae)>5&&(Ae=5*ms(Ae)),Dt=Ae/-250,de&&(Dt/=he,Dt*=3),Dt*=r.wheelSensitivity,1===X.deltaMode&&(Dt*=33);var At=Ke.zoom()*Math.pow(10,Dt);"gesturechange"===X.type&&(At=r.gestureStartZoom*X.scale),Ke.zoom({level:At,renderedPosition:{x:Ct[0],y:Ct[1]}}),Ke.emit({type:"gesturechange"===X.type?"pinchzoom":"scrollzoom",originalEvent:X,position:{x:yt[0],y:yt[1]}})}}}};r.registerBinding(r.container,"wheel",Se,!0),r.registerBinding(e,"scroll",function(X){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(X){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||X.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(je){r.hasTouchStarted||Se(je)},!0),r.registerBinding(r.container,"mouseout",function(X){var be=r.projectIntoViewport(X.clientX,X.clientY);r.cy.emit({originalEvent:X,type:"mouseout",position:{x:be[0],y:be[1]}})},!1),r.registerBinding(r.container,"mouseover",function(X){var be=r.projectIntoViewport(X.clientX,X.clientY);r.cy.emit({originalEvent:X,type:"mouseover",position:{x:be[0],y:be[1]}})},!1);var Le,ye,De,Ue,$e,Xe,Qe,tt,at,He,Te,Ie,Pe,ct,Nt,Et,bt,pt,ot,gt,ze=function(X,be,Ae,Fe){return Math.sqrt((Ae-X)*(Ae-X)+(Fe-be)*(Fe-be))},rt=function(X,be,Ae,Fe){return(Ae-X)*(Ae-X)+(Fe-be)*(Fe-be)};if(r.registerBinding(r.container,"touchstart",ct=function(X){if(r.hasTouchStarted=!0,U(X)){g(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var be=r.cy,Ae=r.touchData.now,Fe=r.touchData.earlier;if(X.touches[0]){var Ve=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY);Ae[0]=Ve[0],Ae[1]=Ve[1]}X.touches[1]&&(Ve=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ae[2]=Ve[0],Ae[3]=Ve[1]),X.touches[2]&&(Ve=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ae[4]=Ve[0],Ae[5]=Ve[1]);var dt=function(ur){return{originalEvent:X,type:ur,position:{x:Ae[0],y:Ae[1]}}};if(X.touches[1]){r.touchData.singleTouchMoved=!0,b(r.dragData.touchDragEles);var Ke=r.findContainerClientCoords();Te=Ke[2],Ie=Ke[3],ye=X.touches[0].clientY-(He=Ke[1]),De=X.touches[1].clientX-(at=Ke[0]),Ue=X.touches[1].clientY-He,Pe=0<=(Le=X.touches[0].clientX-at)&&Le<=Te&&0<=De&&De<=Te&&0<=ye&&ye<=Ie&&0<=Ue&&Ue<=Ie;var st=be.pan(),lt=be.zoom();if($e=ze(Le,ye,De,Ue),Xe=rt(Le,ye,De,Ue),tt=[((Qe=[(Le+De)/2,(ye+Ue)/2])[0]-st.x)/lt,(Qe[1]-st.y)/lt],Xe<4e4&&!X.touches[2]){var Dt=r.findNearestElement(Ae[0],Ae[1],!0,!0),ft=r.findNearestElement(Ae[2],Ae[3],!0,!0);return Dt&&Dt.isNode()?(Dt.activate().emit(dt("cxttapstart")),r.touchData.start=Dt):ft&&ft.isNode()?(ft.activate().emit(dt("cxttapstart")),r.touchData.start=ft):be.emit(dt("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,void r.redraw()}}if(X.touches[2])be.boxSelectionEnabled()&&X.preventDefault();else if(!X.touches[1]&&X.touches[0]){var At=r.findNearestElements(Ae[0],Ae[1],!0,!0),Mt=At[0];if(null!=Mt&&(Mt.activate(),r.touchData.start=Mt,r.touchData.starts=At,r.nodeIsGrabbable(Mt))){var ar=r.dragData.touchDragEles=be.collection(),Wt=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),Mt.selected()?(Wt=be.$(function(er){return er.selected()&&r.nodeIsGrabbable(er)}),h(Wt,{addToList:ar})):v(Mt,{addToList:ar}),u(Mt),Mt.emit(dt("grabon")),Wt?Wt.forEach(function(er){er.emit(dt("grab"))}):Mt.emit(dt("grab"))}a(Mt,["touchstart","tapstart","vmousedown"],X,{x:Ae[0],y:Ae[1]}),null==Mt&&(r.data.bgActivePosistion={x:Ve[0],y:Ve[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){!1===r.touchData.singleTouchMoved&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],X,{x:Ae[0],y:Ae[1]})},r.tapholdDuration)}if(X.touches.length>=1){for(var Nr=r.touchData.startPosition=[null,null,null,null,null,null],qt=0;qt<Ae.length;qt++)Nr[qt]=Fe[qt]=Ae[qt];var Zt=X.touches[0];r.touchData.startGPosition=[Zt.clientX,Zt.clientY]}}},!1),r.registerBinding(e,"touchmove",Nt=function(X){var be=r.touchData.capture;if(be||U(X)){var Ae=r.selection,Fe=r.cy,Ve=r.touchData.now,dt=r.touchData.earlier,Ke=Fe.zoom();if(X.touches[0]){var st=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY);Ve[0]=st[0],Ve[1]=st[1]}X.touches[1]&&(st=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ve[2]=st[0],Ve[3]=st[1]),X.touches[2]&&(st=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ve[4]=st[0],Ve[5]=st[1]);var Ct,lt=function(H0){return{originalEvent:X,type:H0,position:{x:Ve[0],y:Ve[1]}}},yt=r.touchData.startGPosition;if(be&&X.touches[0]&&yt){for(var Dt=[],ft=0;ft<Ve.length;ft++)Dt[ft]=Ve[ft]-dt[ft];var At=X.touches[0].clientX-yt[0],ar=X.touches[0].clientY-yt[1];Ct=At*At+ar*ar>=r.touchTapThreshold2}if(be&&r.touchData.cxt){X.preventDefault();var Hr=rt(qt=X.touches[0].clientX-at,Zt=X.touches[0].clientY-He,er=X.touches[1].clientX-at,ur=X.touches[1].clientY-He);if(Hr/Xe>=2.25||Hr>=22500){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Rn=lt("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(Rn),r.touchData.start=null):Fe.emit(Rn)}}if(be&&r.touchData.cxt){Rn=lt("cxtdrag"),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Rn):Fe.emit(Rn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var br=r.findNearestElement(Ve[0],Ve[1],!0,!0);(!r.touchData.cxtOver||br!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(lt("cxtdragout")),r.touchData.cxtOver=br,br&&br.emit(lt("cxtdragover")))}else if(be&&X.touches[2]&&Fe.boxSelectionEnabled())X.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||Fe.emit(lt("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,Ae[4]=1,Ae&&0!==Ae.length&&void 0!==Ae[0]?(Ae[2]=(Ve[0]+Ve[2]+Ve[4])/3,Ae[3]=(Ve[1]+Ve[3]+Ve[5])/3):(Ae[0]=(Ve[0]+Ve[2]+Ve[4])/3,Ae[1]=(Ve[1]+Ve[3]+Ve[5])/3,Ae[2]=(Ve[0]+Ve[2]+Ve[4])/3+1,Ae[3]=(Ve[1]+Ve[3]+Ve[5])/3+1),r.redrawHint("select",!0),r.redraw();else if(be&&X.touches[1]&&!r.touchData.didSelect&&Fe.zoomingEnabled()&&Fe.panningEnabled()&&Fe.userZoomingEnabled()&&Fe.userPanningEnabled()){if(X.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),hr=r.dragData.touchDragEles){r.redrawHint("drag",!0);for(var wr=0;wr<hr.length;wr++){var za=hr[wr]._private;za.grabbed=!1,za.rscratch.inDragLayer=!1}}var qt,Zt,er,ur,Dr=r.touchData.start,Bf=ze(qt=X.touches[0].clientX-at,Zt=X.touches[0].clientY-He,er=X.touches[1].clientX-at,ur=X.touches[1].clientY-He),O0=Bf/$e;if(Pe){var F0=(qt-Le+(er-De))/2,G0=(Zt-ye+(ur-Ue))/2,Va=Fe.zoom(),gl=Va*O0,Yi=Fe.pan(),_f=tt[0]*Va+Yi.x,Ff=tt[1]*Va+Yi.y,z0={x:-gl/Va*(_f-Yi.x-F0)+_f,y:-gl/Va*(Ff-Yi.y-G0)+Ff};Dr&&Dr.active()&&(b(hr=r.dragData.touchDragEles),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Dr.unactivate().emit(lt("freeon")),hr.emit(lt("free")),r.dragData.didDrag&&(Dr.emit(lt("dragfreeon")),hr.emit(lt("dragfree")))),Fe.viewport({zoom:gl,pan:z0,cancelOnFailedZoom:!0}),Fe.emit(lt("pinchzoom")),$e=Bf,Le=qt,ye=Zt,De=er,Ue=ur,r.pinching=!0}X.touches[0]&&(st=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY),Ve[0]=st[0],Ve[1]=st[1]),X.touches[1]&&(st=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ve[2]=st[0],Ve[3]=st[1]),X.touches[2]&&(st=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ve[4]=st[0],Ve[5]=st[1])}else if(X.touches[0]&&!r.touchData.didSelect){var Mr=r.touchData.start,pl=r.touchData.last;if(!r.hoverData.draggingEles&&!r.swipePanning&&(br=r.findNearestElement(Ve[0],Ve[1],!0,!0)),be&&null!=Mr&&X.preventDefault(),be&&null!=Mr&&r.nodeIsDraggable(Mr))if(Ct){var hr=r.dragData.touchDragEles,Gf=!r.dragData.didDrag;Gf&&h(hr,{inDragLayer:!0}),r.dragData.didDrag=!0;var Ha={x:0,y:0};_e(Dt[0])&&_e(Dt[1])&&(Ha.x+=Dt[0],Ha.y+=Dt[1],Gf)&&(r.redrawHint("eles",!0),(Or=r.touchData.dragDelta)&&_e(Or[0])&&_e(Or[1])&&(Ha.x+=Or[0],Ha.y+=Or[1])),r.hoverData.draggingEles=!0,hr.silentShift(Ha).emit(lt("position")).emit(lt("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==dt[0]&&r.touchData.startPosition[1]==dt[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Or;0===(Or=r.touchData.dragDelta=r.touchData.dragDelta||[]).length?(Or.push(Dt[0]),Or.push(Dt[1])):(Or[0]+=Dt[0],Or[1]+=Dt[1])}if(a(Mr||br,["touchmove","tapdrag","vmousemove"],X,{x:Ve[0],y:Ve[1]}),(!Mr||!Mr.grabbed())&&br!=pl&&(pl&&pl.emit(lt("tapdragout")),br&&br.emit(lt("tapdragover"))),r.touchData.last=br,be)for(wr=0;wr<Ve.length;wr++)Ve[wr]&&r.touchData.startPosition[wr]&&Ct&&(r.touchData.singleTouchMoved=!0);be&&(null==Mr||Mr.pannable())&&Fe.panningEnabled()&&Fe.userPanningEnabled()&&(s(Mr,r.touchData.starts)&&(X.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=kn(r.touchData.startPosition)),r.swipePanning?(Fe.panBy({x:Dt[0]*Ke,y:Dt[1]*Ke}),Fe.emit(lt("dragpan"))):Ct&&(r.swipePanning=!0,Fe.panBy({x:At*Ke,y:ar*Ke}),Fe.emit(lt("dragpan")),Mr&&(Mr.unactivate(),r.redrawHint("select",!0),r.touchData.start=null))),st=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY),Ve[0]=st[0],Ve[1]=st[1])}for(ft=0;ft<Ve.length;ft++)dt[ft]=Ve[ft];be&&X.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&null!=r.data.bgActivePosistion&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1),r.registerBinding(e,"touchcancel",Et=function(X){var be=r.touchData.start;r.touchData.capture=!1,be&&be.unactivate()}),r.registerBinding(e,"touchend",bt=function(X){var be=r.touchData.start;if(r.touchData.capture){0===X.touches.length&&(r.touchData.capture=!1),X.preventDefault();var Fe=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var Ve=r.cy,dt=Ve.zoom(),Ke=r.touchData.now,st=r.touchData.earlier;if(X.touches[0]){var lt=r.projectIntoViewport(X.touches[0].clientX,X.touches[0].clientY);Ke[0]=lt[0],Ke[1]=lt[1]}X.touches[1]&&(lt=r.projectIntoViewport(X.touches[1].clientX,X.touches[1].clientY),Ke[2]=lt[0],Ke[3]=lt[1]),X.touches[2]&&(lt=r.projectIntoViewport(X.touches[2].clientX,X.touches[2].clientY),Ke[4]=lt[0],Ke[5]=lt[1]);var Ct,yt=function(Rr){return{originalEvent:X,type:Rr,position:{x:Ke[0],y:Ke[1]}}};if(be&&be.unactivate(),r.touchData.cxt){if(Ct=yt("cxttapend"),be?be.emit(Ct):Ve.emit(Ct),!r.touchData.cxtDragged){var Dt=yt("cxttap");be?be.emit(Dt):Ve.emit(Dt)}return r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,void r.redraw()}if(!X.touches[2]&&Ve.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var ft=Ve.collection(r.getAllInBox(Fe[0],Fe[1],Fe[2],Fe[3]));Fe[0]=void 0,Fe[1]=void 0,Fe[2]=void 0,Fe[3]=void 0,Fe[4]=0,r.redrawHint("select",!0),Ve.emit(yt("boxend")),ft.emit(yt("box")).stdFilter(function(Rr){return Rr.selectable()&&!Rr.selected()}).select().emit(yt("boxselect")),ft.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(be?.unactivate(),X.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!X.touches[1]&&!X.touches[0]&&!X.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Mt=r.dragData.touchDragEles;if(null!=be){var ar=be._private.grabbed;b(Mt),r.redrawHint("drag",!0),r.redrawHint("eles",!0),ar&&(be.emit(yt("freeon")),Mt.emit(yt("free")),r.dragData.didDrag&&(be.emit(yt("dragfreeon")),Mt.emit(yt("dragfree")))),a(be,["touchend","tapend","vmouseup","tapdragout"],X,{x:Ke[0],y:Ke[1]}),be.unactivate(),r.touchData.start=null}else{var Wt=r.findNearestElement(Ke[0],Ke[1],!0,!0);a(Wt,["touchend","tapend","vmouseup","tapdragout"],X,{x:Ke[0],y:Ke[1]})}var Nr=r.touchData.startPosition[0]-Ke[0],Zt=r.touchData.startPosition[1]-Ke[1],Hr=(Nr*Nr+Zt*Zt)*dt*dt;r.touchData.singleTouchMoved||(be||Ve.$(":selected").unselect(["tapunselect"]),a(be,["tap","vclick"],X,{x:Ke[0],y:Ke[1]}),pt=!1,X.timeStamp-gt<=Ve.multiClickDebounceTime()?(ot&&clearTimeout(ot),pt=!0,gt=null,a(be,["dbltap","vdblclick"],X,{x:Ke[0],y:Ke[1]})):(ot=setTimeout(function(){pt||a(be,["onetap","voneclick"],X,{x:Ke[0],y:Ke[1]})},Ve.multiClickDebounceTime()),gt=X.timeStamp)),null!=be&&!r.dragData.didDrag&&be._private.selectable&&Hr<r.touchTapThreshold2&&!r.pinching&&("single"===Ve.selectionType()?(Ve.$(t).unmerge(be).unselect(["tapunselect"]),be.select(["tapselect"])):be.selected()?be.unselect(["tapunselect"]):be.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}for(var jt=0;jt<Ke.length;jt++)st[jt]=Ke[jt];r.dragData.didDrag=!1,0===X.touches.length&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),X.touches.length<2&&(1===X.touches.length&&(r.touchData.startGPosition=[X.touches[0].clientX,X.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())}},!1),typeof TouchEvent>"u"){var ht=[],Tt=function(X){return{clientX:X.clientX,clientY:X.clientY,force:1,identifier:X.pointerId,pageX:X.pageX,pageY:X.pageY,radiusX:X.width/2,radiusY:X.height/2,screenX:X.screenX,screenY:X.screenY,target:X.target}},Rt=function(X){for(var be=0;be<ht.length;be++)if(ht[be].event.pointerId===X.pointerId)return void ht.splice(be,1)},Bt=function(X){X.touches=ht.map(function(be){return be.touch})},Pt=function(X){return"mouse"===X.pointerType||4===X.pointerType};r.registerBinding(r.container,"pointerdown",function(je){Pt(je)||(je.preventDefault(),ht.push(function(X){return{event:X,touch:Tt(X)}}(je)),Bt(je),ct(je))}),r.registerBinding(r.container,"pointerup",function(je){Pt(je)||(Rt(je),Bt(je),bt(je))}),r.registerBinding(r.container,"pointercancel",function(je){Pt(je)||(Rt(je),Bt(je),Et())}),r.registerBinding(r.container,"pointermove",function(je){var X,be;Pt(je)||(je.preventDefault(),X=je,(be=ht.filter(function(Ae){return Ae.event.pointerId===X.pointerId})[0]).event=X,be.touch=Tt(X),Bt(je),Nt(je))})}};var Wr={generatePolygon:function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,a,i,s,o,l){this.renderer.nodeShapeImpl("polygon",n,a,i,s,o,this.points)},intersectLine:function(n,a,i,s,o,l,u,c){return ya(o,l,this.points,n,a,i/2,s/2,u)},checkPoint:function(n,a,i,s,o,l,u,c){return jr(n,a,this.points,l,u,s,o,[0,-1],i)},hasMiterBounds:"rectangle"!==r,miterBounds:function(n,a,i,s,o,l){return function rv(r,e,t,n,a,i){var o=function tv(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(U,q){return{x:U.x+q.x,y:U.y+q.y}},n=function(U,q){return{x:U.x-q.x,y:U.y-q.y}},a=function(U,q){return{x:U.x*q,y:U.y*q}},i=function(U,q){return U.x*q.y-U.y*q.x},s=function(U){var q=ev(U.x,U.y);return 0===q?{x:0,y:0}:{x:U.x/q,y:U.y/q}},l=function(U,q,Z,K){var J=n(q,U),Q=n(K,Z),le=i(J,Q);if(Math.abs(le)<1e-9)return t(U,a(J,.5));var de=i(n(Z,U),Q)/le;return t(U,a(J,de))},u=r.map(function(F){return{x:F.x,y:F.y}});(function(U){for(var q=0,Z=0;Z<U.length;Z++){var K=U[Z],J=U[(Z+1)%U.length];q+=K.x*J.y-J.x*K.y}return q/2})(u)<0&&u.reverse();for(var c=u.length,d=[],f=0;f<c;f++){var b=n(u[(f+1)%c],u[f]),y=s({x:b.y,y:-b.x});d.push(y)}for(var g=d.map(function(F,U){return{p1:t(u[U],a(F,e)),p2:t(u[(U+1)%c],a(F,e))}}),w=[],C=0;C<c;C++){var N=g[(C-1+c)%c],z=g[C],V=l(N.p1,N.p2,z.p1,z.p2);w.push(V)}return w}(dv(r,e,t,n,a),i),l=gr();return o.forEach(function(u){return Ql(l,u.x,u.y)}),l}(this.points,n,a,i,s,o)}}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,s,o,l){return function(e,t,n,a,i,s){var o=n-e,l=a-t;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-t)*d+t]}(i,s,e,t,n/2+o,a/2+o)},checkPoint:function(e,t,n,a,i,s,o,l){return wn(e,t,a,i,s,o,n)}}},generateRoundPolygon:function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,a,i,s,o,l,u){if(void 0!==l[u]&&l[u+"-cx"]===n&&l[u+"-cy"]===a)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=a;var c=i/2,d=s/2;o="auto"===o?iu(i,s):o;for(var f=new Array(e.length/2),h=0;h<e.length/2;h++)f[h]={x:n+c*e[2*h],y:a+d*e[2*h+1]};var v,b,y,g,w=f.length;for(b=f[w-1],v=0;v<w;v++)l[u][v]=Ko(b,y=f[v%w],g=f[(v+1)%w],o),b=y,y=g;return l[u]},draw:function(n,a,i,s,o,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,s,o,this.points,this.getOrCreateCorners(a,i,s,o,l,u,"drawCorners"))},intersectLine:function(n,a,i,s,o,l,u,c,d){return function(e,t,n,a,i,s,o,l,u){var d,c=[],f=new Array(2*n.length);u.forEach(function(w,C){0===C?(f[f.length-2]=w.startX,f[f.length-1]=w.startY):(f[4*C-2]=w.startX,f[4*C-1]=w.startY),f[4*C]=w.stopX,f[4*C+1]=w.stopY,0!==(d=pa(e,t,a,i,w.cx,w.cy,w.radius)).length&&c.push(d[0],d[1])});for(var h=0;h<f.length/4;h++)0!==(d=en(e,t,a,i,f[4*h],f[4*h+1],f[4*h+2],f[4*h+3],!1)).length&&c.push(d[0],d[1]);if(c.length>2){for(var v=[c[0],c[1]],b=Math.pow(v[0]-e,2)+Math.pow(v[1]-t,2),y=1;y<c.length/2;y++){var g=Math.pow(c[2*y]-e,2)+Math.pow(c[2*y+1]-t,2);g<=b&&(v[0]=c[2*y],v[1]=c[2*y+1],b=g)}return v}return c}(o,l,this.points,n,a,0,0,0,this.getOrCreateCorners(n,a,i,s,c,d,"corners"))},checkPoint:function(n,a,i,s,o,l,u,c,d){return function(e,t,n,a,i,s,o,l){for(var u=new Array(2*n.length),c=0;c<l.length;c++){var d=l[c];if(u[4*c+0]=d.startX,u[4*c+1]=d.startY,u[4*c+2]=d.stopX,u[4*c+3]=d.stopY,Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2)<=Math.pow(d.radius,2))return!0}return mr(e,t,u)}(n,a,this.points,0,0,0,0,this.getOrCreateCorners(l,u,s,o,c,d,"corners"))}}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,s)},intersectLine:function(e,t,n,a,i,s,o,l){return nu(i,s,e,t,n,a,o,l)},checkPoint:function(e,t,n,a,i,s,o,l){var u=a/2,c=i/2;l="auto"===l?tn(a,i):l;var d=2*(l=Math.min(u,c,l));return!!(jr(e,t,this.points,s,o,a,i-d,[0,-1],n)||jr(e,t,this.points,s,o,a-d,i,[0,-1],n)||wn(e,t,d,d,s-u+l,o-c+l,n)||wn(e,t,d,d,s+u-l,o-c+l,n)||wn(e,t,d,d,s+u-l,o+c-l,n)||wn(e,t,d,d,s-u+l,o+c-l,n))}}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,null,s)},generateCutTrianglePts:function(e,t,n,a,i){var s="auto"===i?this.cornerLength:i,o=t/2,l=e/2,u=n-l,c=n+l,d=a-o,f=a+o;return{topLeft:[u,d+s,u+s,d,u+s,d+s],topRight:[c-s,d,c,d+s,c-s,d+s],bottomRight:[c,f-s,c-s,f,c-s,f-s],bottomLeft:[u+s,f,u,f-s,u+s,f-s]}},intersectLine:function(e,t,n,a,i,s,o,l){var u=this.generateCutTrianglePts(n+2*o,a+2*o,e,t,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return ya(i,s,c,e,t)},checkPoint:function(e,t,n,a,i,s,o,l){var u="auto"===l?this.cornerLength:l;if(jr(e,t,this.points,s,o,a,i-2*u,[0,-1],n)||jr(e,t,this.points,s,o,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,s,o);return mr(e,t,c.topLeft)||mr(e,t,c.topRight)||mr(e,t,c.bottomRight)||mr(e,t,c.bottomLeft)}}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,s,o,l){var f=this.generateBarrelBezierPts(n+2*o,a+2*o,e,t),h=function(y){var g=Bn({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},.15),w=Bn({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},.5),C=Bn({x:y[0],y:y[1]},{x:y[2],y:y[3]},{x:y[4],y:y[5]},.85);return[y[0],y[1],g.x,g.y,w.x,w.y,C.x,C.y,y[4],y[5]]},v=[].concat(h(f.topLeft),h(f.topRight),h(f.bottomRight),h(f.bottomLeft));return ya(i,s,v,e,t)},generateBarrelBezierPts:function(e,t,n,a){var i=t/2,s=e/2,o=n-s,l=n+s,u=a-i,c=a+i,d=Ts(e,t),f=d.heightOffset,h=d.widthOffset,v=d.ctrlPtOffsetPct*e,b={topLeft:[o,u+f,o+v,u,o+h,u],topRight:[l-h,u,l-v,u,l,u+f],bottomRight:[l,c-f,l-v,c,l-h,c],bottomLeft:[o+h,c,o+v,c,o,c-f]};return b.topLeft.isTop=!0,b.topRight.isTop=!0,b.bottomLeft.isBottom=!0,b.bottomRight.isBottom=!0,b},checkPoint:function(e,t,n,a,i,s,o,l){var u=Ts(a,i),d=u.widthOffset;if(jr(e,t,this.points,s,o,a,i-2*u.heightOffset,[0,-1],n)||jr(e,t,this.points,s,o,a-2*d,i,[0,-1],n))return!0;for(var f=this.generateBarrelBezierPts(a,i,s,o),h=function(U,q,Z){var K=Z[4],J=Z[2],Q=Z[0],le=Z[5],de=Z[1],he=Math.min(K,Q),ue=Math.max(K,Q),ge=Math.min(le,de),Se=Math.max(le,de);if(he<=U&&U<=ue&&ge<=q&&q<=Se){var Le=function(e,t,n){return[e-2*t+n,2*(t-e),e]}(K,J,Q),ye=function(e,t,n,a){var i=t*t-4*e*(n-=a);if(i<0)return[];var s=Math.sqrt(i),o=2*e;return[(-t+s)/o,(-t-s)/o]}(Le[0],Le[1],Le[2],U),De=ye.filter(function(Ue){return 0<=Ue&&Ue<=1});if(De.length>0)return De[0]}return null},v=Object.keys(f),b=0;b<v.length;b++){var g=f[v[b]],w=h(e,t,g);if(null!=w){var V=tr(g[5],g[3],g[1],w);if(g.isTop&&V<=t||g.isBottom&&t<=V)return!0}}return!1}}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:pr(4,0),draw:function(e,t,n,a,i,s){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,s)},intersectLine:function(e,t,n,a,i,s,o,l){var c=t-(a/2+o),h=en(i,s,e,t,e-(n/2+o),c,e+(n/2+o),c,!1);return h.length>0?h:nu(i,s,e,t,n,a,o,l)},checkPoint:function(e,t,n,a,i,s,o,l){var u=2*(l="auto"===l?tn(a,i):l);if(jr(e,t,this.points,s,o,a,i-u,[0,-1],n)||jr(e,t,this.points,s,o,a-u,i,[0,-1],n))return!0;var c=a/2+2*n,d=i/2+2*n;return!!(mr(e,t,[s-c,o-d,s-c,o,s+c,o,s+c,o-d])||wn(e,t,u,u,s+a/2-l,o+i/2-l,n)||wn(e,t,u,u,s-a/2+l,o+i/2-l,n))}}},registerNodeShapes:function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",pr(3,0)),this.generateRoundPolygon("round-triangle",pr(3,0)),this.generatePolygon("rectangle",pr(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t),this.generatePolygon("pentagon",pr(5,0)),this.generateRoundPolygon("round-pentagon",pr(5,0)),this.generatePolygon("hexagon",pr(6,0)),this.generateRoundPolygon("round-hexagon",pr(6,0)),this.generatePolygon("heptagon",pr(7,0)),this.generateRoundPolygon("round-heptagon",pr(7,0)),this.generatePolygon("octagon",pr(8,0)),this.generateRoundPolygon("round-octagon",pr(8,0));var n=new Array(20),a=xs(5,0),i=xs(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o<i.length/2;o++)i[2*o]*=s,i[2*o+1]*=s;for(o=0;o<5;o++)n[4*o]=a[2*o],n[4*o+1]=a[2*o+1],n[4*o+2]=i[2*o],n[4*o+3]=i[2*o+1];n=au(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 l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),r.makePolygon=function(u){var f,d="polygon-"+u.join("$");return(f=this[d])?f:e.generatePolygon(d,u)}}},Ma={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(r){r=r||ql();var e=this;void 0===e.averageRedrawTime&&(e.averageRedrawTime=0),void 0===e.lastRedrawTime&&(e.lastRedrawTime=0),void 0===e.lastDrawTime&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r},beforeRender:function(r,e){if(!this.destroyed){null==e&&Xt("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(n,a){return a.priority-n.priority})}}},Wd=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};Ma.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(a){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){Wd(r,!0,a);var i=Ur();r.render(r.renderOptions);var s=r.lastDrawTime=Ur();void 0===r.averageRedrawTime&&(r.averageRedrawTime=s-i),void 0===r.redrawCount&&(r.redrawCount=0),r.redrawCount++,void 0===r.redrawTotalTime&&(r.redrawTotalTime=0);var o=s-i;r.redrawTotalTime+=o,r.lastRedrawTime=o,r.averageRedrawTime=r.averageRedrawTime/2+o/2,r.requestedFrame=!1}else Wd(r,!1,a);r.skipFrame=!1,Ya(t)}};Ya(t)}};var qd=function(e){this.init(e)},ea=qd.prototype;ea.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],ea.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),n=e.cy.window();if(n){var a=n.document,i=a.head,s="__________cytoscape_stylesheet",o="__________cytoscape_container",l=null!=a.getElementById(s);if(t.className.indexOf(o)<0&&(t.className=(t.className||"")+" "+o),!l){var u=a.createElement("style");u.id=s,u.textContent="."+o+" { position: relative; }",i.insertBefore(u,i.children[0])}"static"===n.getComputedStyle(t).getPropertyValue("position")&&_t("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=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=_e(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.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()},ea.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if("init"===r)return void t.load();if("destroy"===r)return void t.destroy();("add"===r||"remove"===r||"move"===r&&n.hasCompoundNodes()||"load"===r||"zorder"===r||"mount"===r)&&t.invalidateCachedZSortedEles(),"viewport"===r&&t.redrawHint("select",!0),"gc"===r&&t.redrawHint("gc",!0),("load"===r||"resize"===r||"mount"===r)&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},ea.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],a=t.target;(a.off||a.removeEventListener).apply(a,t.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}},ea.isHeadless=function(){return!1},[jo,Xd,jd,Qn,Wr,Ma].forEach(function(r){mt(ea,r)});var Jo=1e3/60,$d_setupDequeueing=function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=ca(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold);a.beforeRender(function(u,c){var d=Ur(),f=a.averageRedrawTime,h=a.lastRedrawTime,v=[],b=a.cy.extent(),y=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var g=Ur(),w=g-d,C=g-c;if(h<Jo){if(C>=e.deqFastCost*(Jo-(u?f:0)))break}else if(u){if(w>=e.deqCost*h||w>=e.deqAvgCost*f)break}else if(C>=e.deqNoDrawCost*Jo)break;var z=e.deq(n,y,b);if(!(z.length>0))break;for(var V=0;V<z.length;V++)v.push(z[V])}v.length>0&&(e.onDeqd(n,v),!u&&e.shouldRedraw(n,v,y,b)&&i())},(e.priority||fs)(n))}}},Oy=function(){return ie(function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qa;_(this,r),this.idsByKey=new Xr,this.keyForId=new Xr,this.cachesByLvl=new Xr,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t},[{key:"getIdsFor",value:function(t){null==t&&Xt("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new Pn,n.set(t,a)),a}},{key:"addIdForKey",value:function(t,n){null!=t&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){null!=t&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return null==t?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n),i=this.getKey(t);this.deleteIdForKey(a,n),this.addIdForKey(i,n),this.keyForId.set(n,i)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteIdForKey(a,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id();return this.keyForId.get(n)!==this.getKey(t)}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,a=this.lvls,i=n.get(t);return i||(i=new Xr,n.set(t,i),a.push(t)),i}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var a=this.getKey(t),i=this.getCache(a,n);return null!=i&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,n){var a=this.keyForId.get(t.id());return this.getCache(a,n)}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var a=this.getKey(t);return this.hasCache(a,n)}},{key:"setCache",value:function(t,n,a){a.key=t,this.getCachesAt(n).set(t,a)}},{key:"set",value:function(t,n,a){var i=this.getKey(t);this.setCache(i,n,a),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var a=this.getKey(t);this.deleteCache(a,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(a){return n.deleteCache(t,a)})}},{key:"invalidate",value:function(t){var n=t.id(),a=this.keyForId.get(n);this.deleteKeyMappingFor(t);var i=this.doesEleInvalidateKey(t);return i&&this.invalidateKey(a),i||0===this.getNumberOfIdsForKey(a)}}])}(),ta={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Wy=ir({getKey:null,doesEleInvalidateKey:qa,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Xl,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Oa=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=Wy(t);mt(n,a),n.lookup=new Oy(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},Qt=Oa.prototype;Qt.reasons=ta,Qt.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]},Qt.getRetiredTextureQueue=function(r){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[r]=t[r]||[]},Qt.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new va(function(t,n){return n.reqs-t.reqs})},Qt.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Qt.getElement=function(r,e,t,n,a){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||0===e.w||0===e.h||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(null==n&&(n=Math.ceil(ys(o*t))),n<-4)n=-4;else if(o>=7.99||n>3)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,f=s.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,f))return null;var v,h=l.get(r,n);if(h&&h.invalidated&&(h.invalidated=!1,h.texture.invalidatedWidth-=h.width),h)return h;if(v=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var b=i.getTextureQueue(v),y=b[b.length-2],g=function(){return i.recycleTexture(v,d)||i.addTexture(v,d)};y||(y=b[b.length-1]),y||(y=g()),y.width-y.usedWidth<d&&(y=g());for(var V,w=function(he){return he&&he.scaledLabelShown===f},C=a&&a===ta.dequeue,N=a&&a===ta.highQuality,z=a&&a===ta.downscale,F=n+1;F<=3;F++){var U=l.get(r,F);if(U){V=U;break}}var q=V&&V.level===n+1?V:null,Z=function(){y.context.drawImage(q.texture.canvas,q.x,0,q.width,q.height,y.usedWidth,0,d,c)};if(y.context.setTransform(1,0,0,1,0,0),y.context.clearRect(y.usedWidth,0,d,v),w(q))Z();else if(w(V)){if(!N)return i.queueElement(r,V.level-1),V;for(var K=V.level;K>n;K--)q=i.getElement(r,e,t,K,ta.downscale);Z()}else{var J;if(!C&&!N&&!z)for(var Q=n-1;Q>=-4;Q--){var le=l.get(r,Q);if(le){J=le;break}}if(w(J))return i.queueElement(r,n),J;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,r,e,f,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return h={x:y.usedWidth,texture:y,level:n,scale:u,width:d,height:c,scaledLabelShown:f},y.usedWidth+=Math.ceil(d+8),y.eleCaches.push(h),l.set(r,n,h),i.checkTextureFullness(y),h},Qt.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])},Qt.invalidateElement=function(r){var e=this,t=e.lookup,n=[];if(t.isInvalid(r)){for(var i=-4;i<=3;i++){var s=t.getForCachedKey(r,i);s&&n.push(s)}if(t.invalidate(r))for(var l=0;l<n.length;l++){var u=n[l],c=u.texture;c.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(r)}},Qt.checkTextureUtility=function(r){r.invalidatedWidth>=.2*r.width&&this.retireTexture(r)},Qt.checkTextureFullness=function(r){var t=this.getTextureQueue(r.height);r.usedWidth/r.width>.8&&r.fullnessChecks>=10?Jr(t,r):r.fullnessChecks++},Qt.retireTexture=function(r){var t=r.height,n=this.getTextureQueue(t),a=this.lookup;Jr(n,r),r.retired=!0;for(var i=r.eleCaches,s=0;s<i.length;s++){var o=i[s];a.deleteCache(o.key,o.level)}hs(i),this.getRetiredTextureQueue(t).push(r)},Qt.addTexture=function(r,e){var a={};return this.getTextureQueue(r).push(a),a.eleCaches=[],a.height=r,a.width=Math.max(1024,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=this.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a},Qt.recycleTexture=function(r,e){for(var n=this.getTextureQueue(r),a=this.getRetiredTextureQueue(r),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,hs(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),Jr(a,s),n.push(s),s}},Qt.queueElement=function(r,e){var n=this.getElementQueue(),a=this.getElementKeyToQueue(),i=this.getKey(r),s=a[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(r),s.reqs++,n.updateItem(s);else{var o={eles:r.spawn().merge(r),level:e,reqs:1,key:i};n.push(o),a[i]=o}},Qt.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,s=0;s<1&&t.size()>0;s++){var o=t.pop(),l=o.key,u=o.eles[0],c=i.hasCache(u,o.level);if(n[l]=null,!c){a.push(o);var d=e.getBoundingBox(u);e.getElement(u,d,r,o.level,ta.dequeue)}}return a},Qt.removeFromQueue=function(r){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),a=this.getKey(r),i=n[a];null!=i&&(1===i.eles.length?(i.reqs=ds,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))},Qt.onDequeue=function(r){this.onDequeues.push(r)},Qt.offDequeue=function(r){Jr(this.onDequeues,r)},Qt.setupDequeueing=$d_setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,a){for(var i=0;i<t.length;i++)for(var s=t[i].eles,o=0;o<s.length;o++){var l=s[o].boundingBox();if(bs(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var ef=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Ur()-500,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=ca(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},50),n.beforeRender(function(s,o){t.skipping=o-t.lastInvalidationTime<=250},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new va(function(o,l){return l.reqs-o.reqs}),t.setupDequeueing()},lr=ef.prototype,tf=0,im=Math.pow(2,53)-1;lr.makeLayer=function(r,e){var t=Math.pow(2,e),n=Math.ceil(r.w*t),a=Math.ceil(r.h*t),i=this.renderer.makeOffscreenCanvas(n,a),s={id:tf=++tf%im,bb:r,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},o=s.context,l=-s.bb.x1,u=-s.bb.y1;return o.scale(t,t),o.translate(l,u),s},lr.getLayers=function(r,e,t){var n=this,s=n.renderer.cy.zoom(),o=n.firstGet;if(n.firstGet=!1,null==t)if((t=Math.ceil(ys(s*e)))<-4)t=-4;else if(s>=3.99||t>2)return null;n.validateLayersElesOrdering(t,r);var d,h,l=n.layersByLevel,u=Math.pow(2,t),c=l[t]=l[t]||[];if(n.levelIsComplete(t,r))return c;!function(){var Z=function(de){if(n.validateLayersElesOrdering(de,r),n.levelIsComplete(de,r))return h=l[de],!0},K=function(de){if(!h)for(var he=t+de;-4<=he&&he<=2&&!Z(he);he+=de);};K(1),K(-1);for(var J=c.length-1;J>=0;J--){var Q=c[J];Q.invalid&&Jr(c,Q)}}();var y=function(Z){var K=(Z=Z||{}).after;!function(){if(!d){d=gr();for(var Z=0;Z<r.length;Z++)Qh(d,r[Z].boundingBox())}}();var J=Math.ceil(d.w*u),Q=Math.ceil(d.h*u);if(J>32767||Q>32767)return null;if(J*Q>16e6)return null;var de=n.makeLayer(d,t);if(null!=K){var he=c.indexOf(K)+1;c.splice(he,0,de)}else(void 0===Z.insert||Z.insert)&&c.unshift(de);return de};if(n.skipping&&!o)return null;for(var g=null,w=r.length/1,C=!o,N=0;N<r.length;N++){var z=r[N],V=z._private.rscratch,F=V.imgLayerCaches=V.imgLayerCaches||{},U=F[t];if(U)g=U;else{if((!g||g.eles.length>=w||!ru(g.bb,z.boundingBox()))&&!(g=y({insert:!0,after:g})))return null;h||C?n.queueLayer(g,z):n.drawEleInLayer(g,z,t,e),g.eles.push(z),F[t]=g}}return h||(C?null:c)},lr.getEleLevelForLayerLevel=function(r,e){return r},lr.drawEleInLayer=function(r,e,t,n){var i=this.renderer,s=r.context,o=e.boundingBox();0===o.w||0===o.h||!e.visible()||(t=this.getEleLevelForLayerLevel(t,n),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,t,!0),i.setImgSmoothing(s,!0))},lr.levelIsComplete=function(r,e){var n=this.layersByLevel[r];if(!n||0===n.length)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},lr.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n<t.length;n++){for(var a=t[n],i=-1,s=0;s<e.length;s++)if(a.eles[0]===e[s]){i=s;break}if(i<0)this.invalidateLayer(a);else{var o=i;for(s=0;s<a.eles.length;s++)if(a.eles[s]!==e[o+s]){this.invalidateLayer(a);break}}}},lr.updateElementsInLayers=function(r,e){for(var n=It(r[0]),a=0;a<r.length;a++)for(var i=n?null:r[a],s=n?r[a]:r[a].ele,o=s._private.rscratch,l=o.imgLayerCaches=o.imgLayerCaches||{},u=-4;u<=2;u++){var c=l[u];c&&(i&&this.getEleLevelForLayerLevel(c.level)!==i.level||e(c,s,i))}},lr.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},lr.invalidateElements=function(r){var e=this;0!==r.length&&(e.lastInvalidationTime=Ur(),0!==r.length&&e.haveLayers()&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))},lr.invalidateLayer=function(r){if(this.lastInvalidationTime=Ur(),!r.invalid){var e=r.level,t=r.eles;Jr(this.layersByLevel[e],r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var a=0;a<t.length;a++){var i=t[a]._private.rscratch.imgLayerCaches;i&&(i[e]=null)}}},lr.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,a,i){var s=n.replacement;if(s||((s=n.replacement=e.makeLayer(n.bb,n.level)).replaces=n,s.eles=n.eles),!s.reqs)for(var o=0;o<s.eles.length;o++)e.queueLayer(s,s.eles[o])})},lr.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()},lr.queueLayer=function(r,e){var n=this.layersQueue,a=r.elesQueue,i=a.hasId=a.hasId||{};if(!r.replacement){if(e){if(i[e.id()])return;a.push(e),i[e.id()]=!0}r.reqs?(r.reqs++,n.updateItem(r)):(r.reqs=1,n.push(r))}},lr.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],a=0;a<1&&0!==t.size();){var i=t.peek();if(i.replacement)t.pop();else if(i.replaces&&i!==i.replaces.replacement)t.pop();else if(i.invalid)t.pop();else{var s=i.elesQueue.shift();s&&(e.drawEleInLayer(i,s,i.level,r),a++),0===n.length&&n.push(!0),0===i.elesQueue.length&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}}return n},lr.applyLayerReplacement=function(r){var t=this.layersByLevel[r.level],n=r.replaces,a=t.indexOf(n);if(!(a<0||n.invalid)){t[a]=r;for(var i=0;i<r.eles.length;i++){var s=r.eles[i]._private,o=s.imgLayerCaches=s.imgLayerCaches||{};o&&(o[r.level]=r)}this.requestRedraw()}},lr.requestRedraw=ca(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100),lr.setupDequeueing=$d_setupDequeueing({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:fs,shouldRedraw:Xl,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var nf,rf={};function sm(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function om(r,e,t){for(var n,a=0;a<e.length;a++){var i=e[a];0===a&&(n=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function af(r,e,t){r.beginPath&&r.beginPath();for(var n=e,a=0;a<n.length;a++)r.lineTo((i=n[a]).x,i.y);var s=t,o=t[0];for(r.moveTo(o.x,o.y),a=1;a<s.length;a++){var i;r.lineTo((i=s[a]).x,i.y)}r.closePath&&r.closePath()}function lm(r,e,t,n,a){r.beginPath&&r.beginPath(),r.arc(t,n,a,0,2*Math.PI,!1);var i=e,s=i[0];r.moveTo(s.x,s.y);for(var o=0;o<i.length;o++){var l=i[o];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function um(r,e,t,n){r.arc(e,t,n,0,2*Math.PI,!1)}rf.arrowShapeImpl=function(r){return(nf||(nf={polygon:sm,"triangle-backcurve":om,"triangle-tee":af,"circle-triangle":lm,"triangle-cross":af,circle:um}))[r]};var zr={drawElement:function(r,e,t,n,a,i){e.isNode()?this.drawNode(r,e,t,n,a,i):this.drawEdge(r,e,t,n,a,i)},drawElementOverlay:function(r,e){e.isNode()?this.drawNodeOverlay(r,e):this.drawEdgeOverlay(r,e)},drawElementUnderlay:function(r,e){e.isNode()?this.drawNodeUnderlay(r,e):this.drawEdgeUnderlay(r,e)},drawCachedElementPortion:function(r,e,t,n,a,i,s,o){var l=this,u=t.getBoundingBox(e);if(0!==u.w&&0!==u.h){var c=t.getElement(e,u,n,a,i);if(null!=c){var d=o(l,e);if(0===d)return;var g,w,C,N,z,U,f=s(l,e),h=u.x1,v=u.y1,b=u.w,y=u.h;if(0!==f){var V=t.getRotationPoint(e);r.translate(C=V.x,N=V.y),r.rotate(f),(z=l.getImgSmoothing(r))||l.setImgSmoothing(r,!0);var F=t.getRotationOffset(e);g=F.x,w=F.y}else g=h,w=v;1!==d&&(r.globalAlpha=(U=r.globalAlpha)*d),r.drawImage(c.texture.canvas,c.x,0,c.width,c.height,g,w,b,y),1!==d&&(r.globalAlpha=U),0!==f&&(r.rotate(-f),r.translate(-C,-N),z||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}}},cm=function(){return 0},dm=function(e,t){return e.getTextAngle(t,null)},fm=function(e,t){return e.getTextAngle(t,"source")},hm=function(e,t){return e.getTextAngle(t,"target")},vm=function(e,t){return t.effectiveOpacity()},el=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};zr.drawCachedElement=function(r,e,t,n,a,i){var s=this,o=s.data,l=o.eleTxrCache,u=o.lblTxrCache,c=o.slbTxrCache,d=o.tlbTxrCache,f=e.boundingBox(),h=!0===i?l.reasons.highQuality:null;if(0!==f.w&&0!==f.h&&e.visible()&&(!n||bs(f,n))){var v=e.isEdge(),b=e.element()._private.rscratch.badLine;s.drawElementUnderlay(r,e),s.drawCachedElementPortion(r,e,l,t,a,h,cm,vm),(!v||!b)&&s.drawCachedElementPortion(r,e,u,t,a,h,dm,el),v&&!b&&(s.drawCachedElementPortion(r,e,c,t,a,h,fm,el),s.drawCachedElementPortion(r,e,d,t,a,h,hm,el)),s.drawElementOverlay(r,e)}},zr.drawElements=function(r,e){for(var n=0;n<e.length;n++)this.drawElement(r,e[n])},zr.drawCachedElements=function(r,e,t,n){for(var i=0;i<e.length;i++)this.drawCachedElement(r,e[i],t,n)},zr.drawCachedNodes=function(r,e,t,n){for(var i=0;i<e.length;i++){var s=e[i];s.isNode()&&this.drawCachedElement(r,s,t,n)}},zr.drawLayeredElements=function(r,e,t,n){var i=this.data.lyrTxrCache.getLayers(e,t);if(i)for(var s=0;s<i.length;s++){var o=i[s],l=o.bb;0===l.w||0===l.h||r.drawImage(o.canvas,l.x1,l.y1,l.w,l.h)}else this.drawCachedElements(r,e,t,n)};var qr={drawEdge:function(r,e,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this,o=e._private.rscratch;if((!i||e.visible())&&!o.badLine&&null!=o.allpts&&!isNaN(o.allpts[0])){var l;t&&r.translate(-(l=t).x1,-l.y1);var u=i?e.pstyle("opacity").value:1,c=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,f=e.pstyle("line-style").value,h=e.pstyle("width").pfValue,v=e.pstyle("line-cap").value,b=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,g=u*c,w=u*c,C=function(){var de=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;"straight-triangle"===d?(s.eleStrokeStyle(r,e,de),s.drawEdgeTrianglePath(e,r,o.allpts)):(r.lineWidth=h,r.lineCap=v,s.eleStrokeStyle(r,e,de),s.drawEdgePath(e,r,o.allpts,f),r.lineCap="butt")},F=function(){s.drawArrowheads(r,e,arguments.length>0&&void 0!==arguments[0]?arguments[0]:w)};if(r.lineJoin="round","yes"===e.pstyle("ghost").value){var Z=e.pstyle("ghost-offset-x").pfValue,K=e.pstyle("ghost-offset-y").pfValue,J=e.pstyle("ghost-opacity").value,Q=g*J;r.translate(Z,K),C(Q),F(Q),r.translate(-Z,-K)}else!function(){var de=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;r.lineWidth=h+b,r.lineCap=v,b>0?(s.colorStrokeStyle(r,y[0],y[1],y[2],de),"straight-triangle"===d?s.drawEdgeTrianglePath(e,r,o.allpts):(s.drawEdgePath(e,r,o.allpts,f),r.lineCap="butt")):r.lineCap="butt"}();a&&s.drawEdgeUnderlay(r,e),C(),F(),a&&s.drawEdgeOverlay(r,e),s.drawElementText(r,e,null,n),t&&r.translate(l.x1,l.y1)}}},sf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var a=n.pstyle("".concat(e,"-opacity")).value;if(0!==a){var i=this,s=i.usePaths(),o=n._private.rscratch,u=2*n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=u,t.lineCap="self"!==o.edgeType||s?"round":"butt",i.colorStrokeStyle(t,c[0],c[1],c[2],a),i.drawEdgePath(n,t,o.allpts,"solid")}}}};qr.drawEdgeOverlay=sf("overlay"),qr.drawEdgeUnderlay=sf("underlay"),qr.drawEdgePath=function(r,e,t,n){var s,a=r._private.rscratch,i=e,o=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,c=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$");a.pathCacheKey&&a.pathCacheKey===d?(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(u),i.lineDashOffset=c;break;case"solid":i.setLineDash([])}if(!o&&!a.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),a.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+3<t.length;h+=4)e.quadraticCurveTo(t[h],t[h+1],t[h+2],t[h+3]);break;case"straight":case"haystack":for(var v=2;v+1<t.length;v+=2)e.lineTo(t[v],t[v+1]);break;case"segments":if(a.isRound){var y,b=H(a.roundCorners);try{for(b.s();!(y=b.n()).done;)_d(e,y.value)}catch(C){b.e(C)}finally{b.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var w=2;w+1<t.length;w+=2)e.lineTo(t[w],t[w+1])}e=i,l?e.stroke(s):e.stroke(),e.setLineDash&&e.setLineDash([])},qr.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var n=r.pstyle("width").pfValue,a=0;a+1<t.length;a+=2){var i=[t[a+2]-t[a],t[a+3]-t[a+1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),o=[i[1]/s,-i[0]/s],l=[o[0]*n/2,o[1]*n/2];e.beginPath(),e.moveTo(t[a]-l[0],t[a+1]-l[1]),e.lineTo(t[a]+l[0],t[a+1]+l[1]),e.lineTo(t[a+2],t[a+3]),e.closePath(),e.fill()}},qr.drawArrowheads=function(r,e,t){var n=e._private.rscratch,a="haystack"===n.edgeType;a||this.drawArrowhead(r,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,t),a||this.drawArrowhead(r,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,t)},qr.drawArrowhead=function(r,e,t,n,a,i,s){if(!(isNaN(n)||null==n||isNaN(a)||null==a||isNaN(i)||null==i)){var o=this,l=e.pstyle(t+"-arrow-shape").value;if("none"!==l){var u="hollow"===e.pstyle(t+"-arrow-fill").value?"both":"filled",c=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,f=e.pstyle(t+"-arrow-width"),h="match-line"===f.value?d:f.pfValue;"%"===f.units&&(h*=d);var v=e.pstyle("opacity").value;void 0===s&&(s=v);var b=r.globalCompositeOperation;(1!==s||"hollow"===c)&&(r.globalCompositeOperation="destination-out",o.colorFillStyle(r,255,255,255,1),o.colorStrokeStyle(r,255,255,255,1),o.drawArrowShape(e,r,u,d,l,h,n,a,i),r.globalCompositeOperation=b);var y=e.pstyle(t+"-arrow-color").value;o.colorFillStyle(r,y[0],y[1],y[2],s),o.colorStrokeStyle(r,y[0],y[1],y[2],s),o.drawArrowShape(e,r,c,d,l,h,n,a,i)}}},qr.drawArrowShape=function(r,e,t,n,a,i,s,o,l){var f,u=this,c=this.usePaths()&&"triangle-cross"!==a,d=!1,h=e,v={x:s,y:o},b=r.pstyle("arrow-scale").value,y=this.getArrowWidth(n,b),g=u.arrowShapes[a];if(c){var w=u.arrowPathCache=u.arrowPathCache||[],C=yn(a),N=w[C];null!=N?(f=e=N,d=!0):(f=e=new Path2D,w[C]=f)}d||(e.beginPath&&e.beginPath(),c?g.draw(e,1,0,{x:0,y:0},1):g.draw(e,y,l,v,n),e.closePath&&e.closePath()),e=h,c&&(e.translate(s,o),e.rotate(l),e.scale(y,y)),("filled"===t||"both"===t)&&(c?e.fill(f):e.fill()),("hollow"===t||"both"===t)&&(e.lineWidth=i/(c?y:1),e.lineJoin="miter",c?e.stroke(f):e.stroke()),c&&(e.scale(1/y,1/y),e.rotate(-l),e.translate(-s,-o))};var tl={safeDrawImage:function(r,e,t,n,a,i,s,o,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{r.drawImage(e,t,n,a,i,s,o,l,u)}catch(c){_t(c)}},drawInscribedImage:function(r,e,t,n,a){var i=this,s=t.position(),o=s.x,l=s.y,u=t.cy().style(),c=u.getIndexedStyle.bind(u),d=c(t,"background-fit","value",n),f=c(t,"background-repeat","value",n),h=t.width(),v=t.height(),b=2*t.padding(),y=h+("inner"===c(t,"background-width-relative-to","value",n)?0:b),g=v+("inner"===c(t,"background-height-relative-to","value",n)?0:b),w=t._private.rscratch,N="node"===c(t,"background-clip","value",n),z=c(t,"background-image-opacity","value",n)*a,V=c(t,"background-image-smoothing","value",n),F=t.pstyle("corner-radius").value;"auto"!==F&&(F=t.pstyle("corner-radius").pfValue);var U=e.width||e.cachedW,q=e.height||e.cachedH;(null==U||null==q)&&(document.body.appendChild(e),U=e.cachedW=e.width||e.offsetWidth,q=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var Z=U,K=q;if("auto"!==c(t,"background-width","value",n)&&(Z="%"===c(t,"background-width","units",n)?c(t,"background-width","pfValue",n)*y:c(t,"background-width","pfValue",n)),"auto"!==c(t,"background-height","value",n)&&(K="%"===c(t,"background-height","units",n)?c(t,"background-height","pfValue",n)*g:c(t,"background-height","pfValue",n)),0!==Z&&0!==K){if("contain"===d)Z*=J=Math.min(y/Z,g/K),K*=J;else if("cover"===d){var J;Z*=J=Math.max(y/Z,g/K),K*=J}var Q=o-y/2,le=c(t,"background-position-x","units",n),de=c(t,"background-position-x","pfValue",n);Q+="%"===le?(y-Z)*de:de;var he=c(t,"background-offset-x","units",n),ue=c(t,"background-offset-x","pfValue",n);Q+="%"===he?(y-Z)*ue:ue;var ge=l-g/2,Se=c(t,"background-position-y","units",n),Le=c(t,"background-position-y","pfValue",n);ge+="%"===Se?(g-K)*Le:Le;var ye=c(t,"background-offset-y","units",n),De=c(t,"background-offset-y","pfValue",n);ge+="%"===ye?(g-K)*De:De,w.pathCache&&(Q-=o,ge-=l,o=0,l=0);var Ue=r.globalAlpha;r.globalAlpha=z;var $e=i.getImgSmoothing(r),Xe=!1;if("no"===V&&$e?(i.setImgSmoothing(r,!1),Xe=!0):"yes"===V&&!$e&&(i.setImgSmoothing(r,!0),Xe=!0),"no-repeat"===f)N&&(r.save(),w.pathCache?r.clip(w.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,o,l,y,g,F,w),r.clip())),i.safeDrawImage(r,e,0,0,U,q,Q,ge,Z,K),N&&r.restore();else{var Qe=r.createPattern(e,f);r.fillStyle=Qe,i.nodeShapes[i.getNodeShape(t)].draw(r,o,l,y,g,F,w),r.translate(Q,ge),r.fill(),r.translate(-Q,-ge)}r.globalAlpha=Ue,Xe&&i.setImgSmoothing(r,$e)}}},Ln={};function of(r,e,t,n,a){var s=Math.min(arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,n/2,a/2);r.beginPath(),r.moveTo(e+s,t),r.lineTo(e+n-s,t),r.quadraticCurveTo(e+n,t,e+n,t+s),r.lineTo(e+n,t+a-s),r.quadraticCurveTo(e+n,t+a,e+n-s,t+a),r.lineTo(e+s,t+a),r.quadraticCurveTo(e,t+a,e,t+a-s),r.lineTo(e,t+s),r.quadraticCurveTo(e,t,e+s,t),r.closePath()}Ln.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(ys(t*n));e=Math.pow(2,a)}return!(r.pstyle("font-size").pfValue*e<r.pstyle("min-zoomed-font-size").pfValue)},Ln.drawElementText=function(r,e,t,n,a){var i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this;if(null==n){if(i&&!s.eleTextBiggerThanMin(e))return}else if(!1===n)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e),u="glyph"===e.pstyle("text-metrics").strValue;r.textAlign=l,r.textBaseline=u?"alphabetic":"bottom"}else{var c=e.element()._private.rscratch.badLine,d=e.pstyle("label"),f=e.pstyle("source-label"),h=e.pstyle("target-label");if(c||(!d||!d.value)&&(!f||!f.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var b,v=!t;t&&r.translate(-(b=t).x1,-b.y1),null==a?(s.drawText(r,e,null,v,i),e.isEdge()&&(s.drawText(r,e,"source",v,i),s.drawText(r,e,"target",v,i))):s.drawText(r,e,a,v,i),t&&r.translate(b.x1,b.y1)},Ln.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if((e=this.fontCaches[t]).context===r)return e;return this.fontCaches.push(e={context:r}),e},Ln.setupTextStyle=function(r,e){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],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=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;r.font=n+" "+s+" "+a+" "+i,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],o),this.colorStrokeStyle(r,c[0],c[1],c[2],l)},Ln.getTextAngle=function(r,e){var t,a=r._private.rscratch,s=r.pstyle((e?e+"-":"")+"text-rotation");if("autorotate"===s.strValue){var o=vr(a,"labelAngle",e);t=r.isEdge()?o:0}else t="none"===s.strValue?0:s.pfValue;return t},Ln.drawText=function(r,e,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=e._private.rscratch,o=a?e.effectiveOpacity():1;if(!a||0!==o&&0!==e.pstyle("text-opacity").value){"main"===t&&(t=null);var c,d,l=vr(s,"labelX",t),u=vr(s,"labelY",t),f=this.getLabelText(e,t);if(null!=f&&""!==f&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,a);var V,h=t?t+"-":"",v=vr(s,"labelWidth",t),b=vr(s,"labelHeight",t),y=vr(s,"labelActualDescent",t),g=e.pstyle(h+"text-margin-x").pfValue,w=e.pstyle(h+"text-margin-y").pfValue,C=e.isEdge(),N=e.pstyle("text-halign").value,z=e.pstyle("text-valign").value;C&&(N="center",z="center"),l+=g,u+=w,0!==(V=n?this.getTextAngle(e,t):0)&&(r.translate(c=l,d=u),r.rotate(V),l=0,u=0);var F=jn(N),U=Yn(z);switch(U){case"top":break;case"center":u+=b/2;break;case"bottom":u+=b}var q=e.pstyle("text-background-opacity").value,Z=e.pstyle("text-border-opacity").value,K=e.pstyle("text-border-width").pfValue,J=e.pstyle("text-background-padding").pfValue,Q=e.pstyle("text-background-shape").strValue,le="round-rectangle"===Q||"roundrectangle"===Q,de="circle"===Q;if(q>0||K>0&&Z>0){var ue=r.fillStyle,ge=r.strokeStyle,Se=r.lineWidth,Le=e.pstyle("text-background-color").value,ye=e.pstyle("text-border-color").value,De=e.pstyle("text-border-style").value,Ue=q>0,$e=K>0&&Z>0,Xe=l-J;switch(F){case"left":Xe-=v;break;case"center":Xe-=v/2}var Qe=u-b-J,tt=v+2*J,at=b+2*J;if(Ue&&(r.fillStyle="rgba(".concat(Le[0],",").concat(Le[1],",").concat(Le[2],",").concat(q*o,")")),$e&&(r.strokeStyle="rgba(".concat(ye[0],",").concat(ye[1],",").concat(ye[2],",").concat(Z*o,")"),r.lineWidth=K,r.setLineDash))switch(De){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=K/4,r.setLineDash([]);break;default:r.setLineDash([])}if(le?(r.beginPath(),of(r,Xe,Qe,tt,at,2)):de?(r.beginPath(),function gm(r,e,t,n,a){var s=Math.min(n,a)/2,o=e+n/2,l=t+a/2;r.beginPath(),r.arc(o,l,s,0,2*Math.PI),r.closePath()}(r,Xe,Qe,tt,at)):(r.beginPath(),r.rect(Xe,Qe,tt,at)),Ue&&r.fill(),$e&&r.stroke(),$e&&"double"===De){var He=K/2;r.beginPath(),le?of(r,Xe+He,Qe+He,tt-2*He,at-2*He,2):r.rect(Xe+He,Qe+He,tt-2*He,at-2*He),r.stroke()}r.fillStyle=ue,r.strokeStyle=ge,r.lineWidth=Se,r.setLineDash&&r.setLineDash([])}var Te=2*e.pstyle("text-outline-width").pfValue;if(Te>0&&(r.lineWidth=Te),u-=y,"wrap"===e.pstyle("text-wrap").value){var Ie=vr(s,"labelWrapCachedLines",t),Pe=vr(s,"labelLineHeight",t),ze=v/2,rt=this.getLabelJustification(e);switch("auto"===rt||("left"===F?"left"===rt?l+=-v:"center"===rt&&(l+=-ze):"center"===F?"left"===rt?l+=-ze:"right"===rt&&(l+=ze):"right"===F&&("center"===rt?l+=ze:"right"===rt&&(l+=v))),U){case"top":case"center":case"bottom":u-=(Ie.length-1)*Pe}for(var ct=0;ct<Ie.length;ct++)Te>0&&r.strokeText(Ie[ct],l,u),r.fillText(Ie[ct],l,u),u+=Pe}else Te>0&&r.strokeText(f,l,u),r.fillText(f,l,u);0!==V&&(r.rotate(-V),r.translate(-c,-d))}}};var dn={drawNode:function(r,e,t){var o,l,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=this,u=e._private,c=u.rscratch,d=e.position();if(_e(d.x)&&_e(d.y)&&(!i||e.visible())){var v,g,f=i?e.effectiveOpacity():1,h=s.usePaths(),b=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y,t&&r.translate(-(g=t).x1,-g.y1);for(var C=e.pstyle("background-image").value,N=new Array(C.length),z=new Array(C.length),V=0,F=0;F<C.length;F++){var U=C[F];if(N[F]=null!=U&&"none"!==U){var Z=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",F);V++,z[F]=s.getCachedImage(U,Z,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var K=e.pstyle("background-blacken").value,J=e.pstyle("border-width").pfValue,Q=e.pstyle("background-opacity").value*f,le=e.pstyle("border-color").value,de=e.pstyle("border-style").value,he=e.pstyle("border-join").value,ue=e.pstyle("border-cap").value,ge=e.pstyle("border-position").value,Se=e.pstyle("border-dash-pattern").pfValue,Le=e.pstyle("border-dash-offset").pfValue,ye=e.pstyle("border-opacity").value*f,De=e.pstyle("outline-width").pfValue,Ue=e.pstyle("outline-color").value,$e=e.pstyle("outline-style").value,Xe=e.pstyle("outline-opacity").value*f,Qe=e.pstyle("outline-offset").value,tt=e.pstyle("corner-radius").value;"auto"!==tt&&(tt=e.pstyle("corner-radius").pfValue);var at=function(){s.eleFillStyle(r,e,arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q)},He=function(){s.colorStrokeStyle(r,le[0],le[1],le[2],arguments.length>0&&void 0!==arguments[0]?arguments[0]:ye)},Te=function(){s.colorStrokeStyle(r,Ue[0],Ue[1],Ue[2],arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xe)},Ie=function(X,be,Ae,Fe){var st,Ve=s.nodePathCache=s.nodePathCache||[],dt=Hl("polygon"===Ae?Ae+","+Fe.join(","):Ae,""+be,""+X,""+tt),Ke=Ve[dt],lt=!1;return null!=Ke?(lt=!0,c.pathCache=st=Ke):(st=new Path2D,Ve[dt]=c.pathCache=st),{path:st,cacheHit:lt}},Pe=e.pstyle("shape").strValue,ze=e.pstyle("shape-polygon-points").pfValue;if(h){r.translate(d.x,d.y);var rt=Ie(o,l,Pe,ze);v=rt.path,b=rt.cacheHit}var ct=function(){if(!b){var X=d;h&&(X={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(v||r,X.x,X.y,o,l,tt,c)}h?r.fill(v):r.fill()},Nt=function(){for(var X=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,be=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Ae=u.backgrounding,Fe=0,Ve=0;Ve<z.length;Ve++){var dt=e.cy().style().getIndexedStyle(e,"background-image-containment","value",Ve);be&&"over"===dt||!be&&"inside"===dt?Fe++:N[Ve]&&z[Ve].complete&&!z[Ve].error&&(Fe++,s.drawInscribedImage(r,z[Ve],e,Ve,X))}u.backgrounding=Fe!==V,Ae!==u.backgrounding&&e.updateStyle(!1)},Et=function(){var X=arguments.length>0&&void 0!==arguments[0]&&arguments[0],be=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;s.hasPie(e)&&(s.drawPie(r,e,be),X&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,tt,c)))},bt=function(){var X=arguments.length>0&&void 0!==arguments[0]&&arguments[0],be=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;s.hasStripe(e)&&(r.save(),h?r.clip(c.pathCache):(s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,tt,c),r.clip()),s.drawStripe(r,e,be),r.restore(),X&&(h||s.nodeShapes[s.getNodeShape(e)].draw(r,d.x,d.y,o,l,tt,c)))},pt=function(){var Ae=K>0?0:255;0!==K&&(s.colorFillStyle(r,Ae,Ae,Ae,(K>0?K:-K)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f)),h?r.fill(v):r.fill())},ot=function(){if(J>0){if(r.lineWidth=J,r.lineCap=ue,r.lineJoin=he,r.setLineDash)switch(de){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(Se),r.lineDashOffset=Le;break;case"solid":case"double":r.setLineDash([])}if("center"!==ge){if(r.save(),r.lineWidth*=2,"inside"===ge)h?r.clip(v):r.clip();else{var X=new Path2D;X.rect(-o/2-J,-l/2-J,o+2*J,l+2*J),X.addPath(v),r.clip(X,"evenodd")}h?r.stroke(v):r.stroke(),r.restore()}else h?r.stroke(v):r.stroke();if("double"===de){r.lineWidth=J/3;var be=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(v):r.stroke(),r.globalCompositeOperation=be}r.setLineDash&&r.setLineDash([])}},gt=function(){if(De>0){if(r.lineWidth=De,r.lineCap="butt",r.setLineDash)switch($e){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([])}var X=d;h&&(X={x:0,y:0});var be=s.getNodeShape(e),Ae=J;"inside"===ge&&(Ae=0),"outside"===ge&&(Ae*=2);var lt,Fe=(o+Ae+(De+Qe))/o,Ve=(l+Ae+(De+Qe))/l,dt=o*Fe,Ke=l*Ve,st=s.nodeShapes[be].points;if(h&&(lt=Ie(dt,Ke,be,st).path),"ellipse"===be)s.drawEllipsePath(lt||r,X.x,X.y,dt,Ke);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(be)){var Ct=0,Dt=0,ft=0;"round-diamond"===be?Ct=1.4*(Ae+Qe+De):"round-heptagon"===be?(Ct=1.075*(Ae+Qe+De),ft=-(Ae/2+Qe+De)/35):"round-hexagon"===be?Ct=1.12*(Ae+Qe+De):"round-pentagon"===be?(Ct=1.13*(Ae+Qe+De),ft=-(Ae/2+Qe+De)/15):"round-tag"===be?(Ct=1.12*(Ae+Qe+De),Dt=.07*(Ae/2+De+Qe)):"round-triangle"===be&&(Ct=(Ae+Qe+De)*(Math.PI/2),ft=-(Ae+Qe/2+De)/Math.PI),0!==Ct&&(dt=o*(Fe=(o+Ct)/o),["round-hexagon","round-tag"].includes(be)||(Ke=l*(Ve=(l+Ct)/l)));for(var At=dt/2,Mt=Ke/2,ar=(tt="auto"===tt?iu(dt,Ke):tt)+(Ae+De+Qe)/2,Wt=new Array(st.length/2),Nr=new Array(st.length/2),qt=0;qt<st.length/2;qt++)Wt[qt]={x:X.x+Dt+At*st[2*qt],y:X.y+ft+Mt*st[2*qt+1]};var Zt,er,ur,Hr,jt=Wt.length;for(er=Wt[jt-1],Zt=0;Zt<jt;Zt++)Nr[Zt]=Ko(er,ur=Wt[Zt%jt],Hr=Wt[(Zt+1)%jt],ar),er=ur,ur=Hr;s.drawRoundPolygonPath(lt||r,X.x+Dt,X.y+ft,o*Fe,l*Ve,st,Nr)}else["roundrectangle","round-rectangle"].includes(be)?(tt="auto"===tt?tn(dt,Ke):tt,s.drawRoundRectanglePath(lt||r,X.x,X.y,dt,Ke,tt+(Ae+De+Qe)/2)):["cutrectangle","cut-rectangle"].includes(be)?s.drawCutRectanglePath(lt||r,X.x,X.y,dt,Ke,null,(tt="auto"===tt?8:tt)+(Ae+De+Qe)/4):["bottomroundrectangle","bottom-round-rectangle"].includes(be)?(tt="auto"===tt?tn(dt,Ke):tt,s.drawBottomRoundRectanglePath(lt||r,X.x,X.y,dt,Ke,tt+(Ae+De+Qe)/2)):"barrel"===be?s.drawBarrelPath(lt||r,X.x,X.y,dt,Ke):be.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(be)?(st=ti(ri(st,(Ae+De+Qe)/o)),s.drawPolygonPath(lt||r,X.x,X.y,o,l,st)):(st=ti(ri(st,-(Ae+De+Qe)/o)),s.drawPolygonPath(lt||r,X.x,X.y,o,l,st));if(h?r.stroke(lt):r.stroke(),"double"===$e){r.lineWidth=Ae/3;var vn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",h?r.stroke(lt):r.stroke(),r.globalCompositeOperation=vn}r.setLineDash&&r.setLineDash([])}};if("yes"===e.pstyle("ghost").value){var Rt=e.pstyle("ghost-offset-x").pfValue,Gt=e.pstyle("ghost-offset-y").pfValue,Bt=e.pstyle("ghost-opacity").value,Pt=Bt*f;r.translate(Rt,Gt),Te(),gt(),at(Bt*Q),ct(),Nt(Pt,!0),He(Bt*ye),ot(),Et(0!==K||0!==J),bt(0!==K||0!==J),Nt(Pt,!1),pt(Pt),r.translate(-Rt,-Gt)}h&&r.translate(-d.x,-d.y),a&&s.drawNodeUnderlay(r,e,d,o,l),h&&r.translate(d.x,d.y),Te(),gt(),at(),ct(),Nt(f,!0),He(),ot(),Et(0!==K||0!==J),bt(0!==K||0!==J),Nt(f,!1),pt(),h&&r.translate(-d.x,-d.y),s.drawElementText(r,e,null,n),a&&s.drawNodeOverlay(r,e,d,o,l),t&&r.translate(g.x1,g.y1)}}},lf=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,a,i,s){if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,f=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),null==i||null==s){var h=n.padding();i=n.width()+2*h,s=n.height()+2*h}this.colorFillStyle(t,c[0],c[1],c[2],u),this.nodeShapes[d].draw(t,a.x,a.y,i+2*l,s+2*l,f),t.fill()}}}};dn.drawNodeOverlay=lf("overlay"),dn.drawNodeUnderlay=lf("underlay"),dn.hasPie=function(r){return(r=r[0])._private.hasPie},dn.hasStripe=function(r){return(r=r[0])._private.hasStripe},dn.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var h,a=e.cy().style(),i=e.pstyle("pie-size"),s=e.pstyle("pie-hole"),o=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),f=Math.min(c,d)/2,v=0;if(this.usePaths()&&(l=0,u=0),"%"===i.units?f*=i.pfValue:void 0!==i.pfValue&&(f=i.pfValue/2),"%"===s.units?h=f*s.pfValue:void 0!==s.pfValue&&(h=s.pfValue/2),!(h>=f))for(var y=1;y<=a.pieBackgroundN;y++){var g=e.pstyle("pie-"+y+"-background-size").value,w=e.pstyle("pie-"+y+"-background-color").value,C=e.pstyle("pie-"+y+"-background-opacity").value*t,N=g/100;N+v>1&&(N=1-v);var z=1.5*Math.PI+2*Math.PI*v,F=(z+=o)+2*Math.PI*N;0===g||v>=1||v+N>1||(0===h?(r.beginPath(),r.moveTo(l,u),r.arc(l,u,f,z,F),r.closePath()):(r.beginPath(),r.arc(l,u,f,z,F),r.arc(l,u,h,F,z,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],C),r.fill(),v+=N)}},dn.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,s=n.y,o=e.width(),l=e.height(),u=0,c=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,f=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2)}var h=o,v=l;"%"===f.units?(h*=f.pfValue,v*=f.pfValue):void 0!==f.pfValue&&(h=f.pfValue,v=f.pfValue),c&&(i=0,s=0),s-=h/2,i-=v/2;for(var b=1;b<=a.stripeBackgroundN;b++){var y=e.pstyle("stripe-"+b+"-background-size").value,g=e.pstyle("stripe-"+b+"-background-color").value,w=e.pstyle("stripe-"+b+"-background-opacity").value*t,C=y/100;C+u>1&&(C=1-u),!(0===y||u>=1||u+C>1)&&(r.beginPath(),r.rect(i,s+v*u,h,v*C),r.closePath(),this.colorFillStyle(r,g[0],g[1],g[2],w),r.fill(),u+=C)}r.restore()};var ka,yr={};function uf(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function mm(r,e,t){void 0===t&&(t=e);var n=r.makeOffscreenCanvas(e,t),a=n.context=n.getContext("2d");return n.clear=function(){return a.clearRect(0,0,n.width,n.height)},n.clear(),n}function rl(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function xm(r,e){return!!e.picking||"solid"===r.pstyle("background-fill").value&&"none"===r.pstyle("background-image").strValue&&(0===r.pstyle("border-width").value||0===r.pstyle("border-opacity").value||"solid"===r.pstyle("border-style").value)}function Em(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function An(r,e,t){var n=r[0]/255,a=r[1]/255,i=r[2]/255,s=e,o=t||new Array(4);return o[0]=n*s,o[1]=a*s,o[2]=i*s,o[3]=s,o}function ra(r,e){var t=e||new Array(4);return t[0]=(255&r)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function Tm(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function cf(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function df(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function Dm(r,e,t,n,a,i){switch(e){case r.FLOAT:return new Float32Array(t.buffer,i*n,a);case r.INT:return new Int32Array(t.buffer,i*n,a)}}function Vr(r,e,t,n){var i=fe(cf(r,t),3),s=i[0],o=i[1],l=i[2],u=df(r,o,e*s),c=s*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*c,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),o===r.FLOAT?r.vertexAttribPointer(n,s,o,!1,c,0):o===r.INT&&r.vertexAttribIPointer(n,s,o,c,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var f=new Array(e),h=0;h<e;h++)f[h]=Dm(r,o,u,c,s,h);return d.dataArray=u,d.stride=c,d.size=s,d.getView=function(v){return f[v]},d.setPoint=function(v,b,y){var g=f[v];g[0]=b,g[1]=y},d.bufferSubData=function(v){r.bindBuffer(r.ARRAY_BUFFER,d),v?r.bufferSubData(r.ARRAY_BUFFER,0,u,0,v*s):r.bufferSubData(r.ARRAY_BUFFER,0,u)},d}yr.getPixelRatio=function(){var r=this.data.contexts[0];return null!=this.forcedPixelRatio?this.forcedPixelRatio:(this.cy.window().devicePixelRatio||1)/(r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1)},yr.paintCache=function(r){for(var n,e=this.paintCaches=this.paintCaches||[],t=!0,a=0;a<e.length;a++)if((n=e[a]).context===r){t=!1;break}return t&&e.push(n={context:r}),n},yr.createGradientStyleFor=function(r,e,t,n,a){var i,s=this.usePaths(),o=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if("radial-gradient"===n)if(t.isEdge()){var u=t.sourceEndpoint(),c=t.targetEndpoint(),d=t.midpoint(),f=mn(u,d),h=mn(c,d);i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(f,h))}else{var v=s?{x:0,y:0}:t.position(),b=t.paddedWidth(),y=t.paddedHeight();i=r.createRadialGradient(v.x,v.y,0,v.x,v.y,Math.max(b,y))}else if(t.isEdge()){var g=t.sourceEndpoint(),w=t.targetEndpoint();i=r.createLinearGradient(g.x,g.y,w.x,w.y)}else{var C=s?{x:0,y:0}:t.position(),V=t.paddedWidth()/2,F=t.paddedHeight()/2;switch(t.pstyle("background-gradient-direction").value){case"to-bottom":i=r.createLinearGradient(C.x,C.y-F,C.x,C.y+F);break;case"to-top":i=r.createLinearGradient(C.x,C.y+F,C.x,C.y-F);break;case"to-left":i=r.createLinearGradient(C.x+V,C.y,C.x-V,C.y);break;case"to-right":i=r.createLinearGradient(C.x-V,C.y,C.x+V,C.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(C.x-V,C.y-F,C.x+V,C.y+F);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(C.x-V,C.y+F,C.x+V,C.y-F);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(C.x+V,C.y-F,C.x-V,C.y+F);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(C.x+V,C.y+F,C.x-V,C.y-F)}}if(!i)return null;for(var q=l.length===o.length,Z=o.length,K=0;K<Z;K++)i.addColorStop(q?l[K]:K/(Z-1),"rgba("+o[K][0]+","+o[K][1]+","+o[K][2]+","+a+")");return i},yr.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a},yr.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"},yr.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientFillStyle(r,e,n,t);else{var a=e.pstyle("background-color").value;this.colorFillStyle(r,a[0],a[1],a[2],t)}},yr.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a},yr.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"},yr.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientStrokeStyle(r,e,n,t);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(r,a[0],a[1],a[2],t)}},yr.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],s=e.getPixelRatio();(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(s=e.motionBlurPxRatio);var c,l=a*s,u=i*s;if(l!==e.canvasWidth||u!==e.canvasHeight){e.fontCaches=null;var d=t.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var f=0;f<e.CANVAS_LAYERS;f++)(c=t.canvases[f]).width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";for(f=0;f<e.BUFFER_COUNT;f++)(c=t.bufferCanvases[f]).width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,s<=1&&(c=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=l*e.textureMult,c.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=s}},yr.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})},yr.clearCanvas=function(){var r=this,e=r.data;function t(n){n.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])},yr.render=function(r){var e=this;r=r||ql();var t=e.cy,n=r.forcedContext,a=r.drawAllLayers,i=r.drawOnlyNodeLayer,s=r.forcedZoom,o=r.forcedPan,l=void 0===r.forcedPxRatio?this.getPixelRatio():r.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),f=void 0!==r.motionBlur?r.motionBlur:e.motionBlur,h=e.motionBlurPxRatio,v=t.hasCompoundNodes(),b=e.hoverData.draggingEles,g=f=f&&!n&&e.motionBlurEnabled&&!(e.hoverData.selecting||e.touchData.selecting);n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),f&&(null==e.mbFrames&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(g=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var w=t.style(),C=t.zoom(),N=void 0!==s?s:C,z=t.pan(),V={x:z.x,y:z.y},F={zoom:C,pan:{x:z.x,y:z.y}},U=e.prevViewport;!(void 0===U||F.zoom!==U.zoom||F.pan.x!==U.pan.x||F.pan.y!==U.pan.y)&&!(b&&!v)&&(e.motionBlurPxRatio=1),o&&(V=o),N*=l,V.x*=l,V.y*=l;var Z=e.getCachedZSortedEles();function K(He,Te,Ie,Pe,ze){var rt=He.globalCompositeOperation;He.globalCompositeOperation="destination-out",e.colorFillStyle(He,255,255,255,e.motionBlurTransparency),He.fillRect(Te,Ie,Pe,ze),He.globalCompositeOperation=rt}function J(He,Te){var Ie,Pe,ze,rt;e.clearingMotionBlur||He!==u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]&&He!==u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]?(Ie=V,Pe=N,ze=e.canvasWidth,rt=e.canvasHeight):(Ie={x:z.x*h,y:z.y*h},Pe=C*h,ze=e.canvasWidth*h,rt=e.canvasHeight*h),He.setTransform(1,0,0,1,0,0),"motionBlur"===Te?K(He,0,0,ze,rt):!n&&(void 0===Te||Te)&&He.clearRect(0,0,ze,rt),a||(He.translate(Ie.x,Ie.y),He.scale(Pe,Pe)),o&&He.translate(o.x,o.y),s&&He.scale(s,s)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var Q=e.data.bufferContexts[e.TEXTURE_BUFFER];Q.setTransform(1,0,0,1,0,0),Q.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:Q,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult}),(F=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight}).mpan={x:(0-F.pan.x)/F.zoom,y:(0-F.pan.y)/F.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var de=e.textureCache.texture;F=e.textureCache.viewport,(le=u.contexts[e.NODE]).setTransform(1,0,0,1,0,0),f?K(le,0,0,F.width,F.height):le.clearRect(0,0,F.width,F.height);var he=w.core("outside-texture-bg-color").value,ue=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(le,he[0],he[1],he[2],ue),le.fillRect(0,0,F.width,F.height),C=t.zoom(),J(le,!1),le.clearRect(F.mpan.x,F.mpan.y,F.width/F.zoom/l,F.height/F.zoom/l),le.drawImage(de,F.mpan.x,F.mpan.y,F.width/F.zoom/l,F.height/F.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var le,ge=t.extent(),Se=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),Le=e.hideEdgesOnViewport&&Se,ye=[];if(ye[e.NODE]=!c[e.NODE]&&f&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,ye[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),ye[e.DRAG]=!c[e.DRAG]&&f&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,ye[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||ye[e.NODE]){var De=f&&!ye[e.NODE]&&1!==h;J(le=n||(De?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),f&&!De?"motionBlur":void 0),Le?e.drawCachedNodes(le,Z.nondrag,l,ge):e.drawLayeredElements(le,Z.nondrag,l,ge),e.debug&&e.drawDebugPoints(le,Z.nondrag),!a&&!f&&(c[e.NODE]=!1)}!i&&(c[e.DRAG]||a||ye[e.DRAG])&&(De=f&&!ye[e.DRAG]&&1!==h,J(le=n||(De?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]),f&&!De?"motionBlur":void 0),Le?e.drawCachedNodes(le,Z.drag,l,ge):e.drawCachedElements(le,Z.drag,l,ge),e.debug&&e.drawDebugPoints(le,Z.drag),!a&&!f&&(c[e.DRAG]=!1));if(this.drawSelectionRectangle(r,J),f&&1!==h){var Qe=u.contexts[e.DRAG],tt=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],at=function(Te,Ie,Pe){Te.setTransform(1,0,0,1,0,0),Pe||!g?Te.clearRect(0,0,e.canvasWidth,e.canvasHeight):K(Te,0,0,e.canvasWidth,e.canvasHeight),Te.drawImage(Ie,0,0,e.canvasWidth*h,e.canvasHeight*h,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||ye[e.NODE])&&(at(u.contexts[e.NODE],e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],ye[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||ye[e.DRAG])&&(at(Qe,tt,ye[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=F,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),f&&(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,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},100)),n||t.emit("render")},yr.drawSelectionRectangle=function(r,e){var t=this,a=t.data,i=t.cy.style(),o=r.drawAllLayers,l=a.canvasNeedsRedraw;if(t.showFps||!r.drawOnlyNodeLayer&&l[t.SELECT_BOX]&&!o){var c=r.forcedContext||a.contexts[t.SELECT_BOX];if(e(c),1==t.selection[4]&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),f=i.core("selection-box-border-width").value/d;c.lineWidth=f,c.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+")",c.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),f>0&&(c.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+")",c.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(a.bgActivePosistion&&!t.hoverData.selecting){d=t.cy.zoom();var h=a.bgActivePosistion;c.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+")",c.beginPath(),c.arc(h.x,h.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var v=t.lastRedrawTime;if(t.showFps&&v){v=Math.round(v);var b=Math.round(1e3/v),y="1 frame = "+v+" ms = "+b+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!ka){var g=c.measureText(y);ka=g.actualBoundingBoxAscent}c.fillText(y,0,ka),c.strokeRect(0,ka+10,250,20),c.fillRect(0,ka+10,250*Math.min(b/60,1),20)}o||(l[t.SELECT_BOX]=!1)}};var ff=typeof Float32Array<"u"?Float32Array:Array;function nl(){var r=new ff(9);return ff!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function hf(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function Gi(r,e,t){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=t[0],h=t[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=s,r[4]=o,r[5]=l,r[6]=f*n+h*s+u,r[7]=f*a+h*o+c,r[8]=f*i+h*l+d,r}function vf(r,e,t){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=Math.sin(t),h=Math.cos(t);return r[0]=h*n+f*s,r[1]=h*a+f*o,r[2]=h*i+f*l,r[3]=h*s-f*n,r[4]=h*o-f*a,r[5]=h*l-f*i,r[6]=u,r[7]=c,r[8]=d,r}function al(r,e,t){var n=t[0],a=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=a*e[3],r[4]=a*e[4],r[5]=a*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});var Rm=function(){return ie(function r(e,t,n,a){_(this,r),this.debugID=Math.floor(1e4*Math.random()),this.r=e,this.texSize=t,this.texRows=n,this.texHeight=Math.floor(t/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=a(e,t,t),this.scratch=a(e,t,this.texHeight,"scratch")},[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var n=t.w,a=t.h,s=this.texSize,o=this.texHeight/a,l=n*o,u=a*o;return l>s&&(l=n*(o=s/n),u=a*o),{scale:o,texW:l,texH:u}}},{key:"draw",value:function(t,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var s=this.texSize,o=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,f=u.texH,h=function(C,N){if(a&&N){var z=N.context,U=C.x,q=l*C.row;z.save(),z.translate(U,q),z.scale(c,c),a(z,n),z.restore()}},v=[null,null],b=function(){h(i.freePointer,i.canvas),v[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:d,h:f},v[1]={x:i.freePointer.x+d,y:i.freePointer.row*l,w:0,h:f},i.freePointer.x+=d,i.freePointer.x==s&&(i.freePointer.x=0,i.freePointer.row++)},g=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?(g(),b()):this.enableWrapping?function(){var C=i.scratch,N=i.canvas;C.clear(),h({x:0,row:0},C);var z=s-i.freePointer.x,V=d-z,F=l,U=i.freePointer.x,q=i.freePointer.row*l,Z=z;N.context.drawImage(C,0,0,Z,F,U,q,Z,F),v[0]={x:U,y:q,w:Z,h:f};var J=(i.freePointer.row+1)*l,Q=V;N&&N.context.drawImage(C,z,0,Q,F,0,J,Q,F),v[1]={x:0,y:J,w:Q,h:f},i.freePointer.x=V,i.freePointer.row++}():(g(),b())}return this.keyToLocation.set(t,v),this.needsBuffer=!0,v}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return 0===this.freePointer.x&&0===this.freePointer.row}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(t);return!(this.freePointer.x+i.texW>n)||this.freePointer.row<a-1}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=function Cm(r){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}(t)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),Mm=function(){return ie(function r(e,t,n,a){_(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set},[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){return new Rm(this.r,this.texSize,this.texRows,this.createTextureCanvas)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,i=this.createTextureCanvas,s=Math.floor(n/this.texRows);this.scratch=i(t,n,s,"scratch")}return this.scratch}},{key:"draw",value:function(t,n,a){var i=this.styleKeyToAtlas.get(t);return i||((!(i=this.atlases[this.atlases.length-1])||!i.canFit(n))&&(i&&i.lock(),i=this._createAtlas(),this.atlases.push(i)),i.draw(t,n,a),this.styleKeyToAtlas.set(t,i)),i}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,n=this.markedKeys;if(0!==n.size){var l,a=[],i=new Map,s=null,o=H(this.atlases);try{var u=function(){var d=l.value,f=d.getKeys(),h=function Om(r,e){return r.intersection?r.intersection(e):new Set(te(r).filter(function(t){return e.has(t)}))}(n,f);if(0===h.size)return a.push(d),f.forEach(function(z){return i.set(z,d)}),1;s||(s=t._createAtlas(),a.push(s));var b,v=H(f);try{for(v.s();!(b=v.n()).done;){var y=b.value;if(!h.has(y)){var w=fe(d.getOffsets(y),2),C=w[0];s.canFit({w:C.w+w[1].w,h:C.h})||(s.lock(),s=t._createAtlas(),a.push(s)),d.canvas&&(t._copyTextureToNewAtlas(y,d,s),i.set(y,s))}}}catch(z){v.e(z)}finally{v.f()}d.dispose()};for(o.s();!(l=o.n()).done;)u()}catch(c){o.e(c)}finally{o.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}else console.log("nothing to garbage collect")}},{key:"_copyTextureToNewAtlas",value:function(t,n,a){var s=fe(n.getOffsets(t),2),o=s[0],l=s[1];if(0===l.w)a.draw(t,o,function(f){f.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,o.x,o.y,o.w,o.h,0,0,o.w,o.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,o.w,0,l.w,l.h);var c=o.w+l.w,d=o.h;a.draw(t,{w:c,h:d},function(f){f.drawImage(u,0,0,c,d,0,0,c,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}(),Pm=function(){return ie(function r(e,t){_(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map},[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var a=this.globalOptions,i=a.webglTexSize,o=n.texRows,l=this._cacheScratchCanvas(a.createTextureCanvas),u=new Mm(this.r,i,o,l);this.collections.set(t,u)}},{key:"addRenderType",value:function(t,n){var a=n.collection;if(!this.collections.has(a))throw new Error("invalid atlas collection name '".concat(a,"'"));var i=this.collections.get(a),s=mt({type:t,atlasCollection:i},n);this.renderTypes.set(t,s)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var n=-1,a=-1,i=null;return function(s,o,l,u){return u?((!i||o!=n||l!=a)&&(n=o,a=l,i=t(s,o,l)),i):t(s,o,l)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var v,n=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=a.forceRedraw,s=void 0!==i&&i,o=a.filterEle,l=void 0===o?function(){return!0}:o,u=a.filterType,c=void 0===u?function(){return!0}:u,d=!1,f=!1,h=H(t);try{for(h.s();!(v=h.n()).done;){var b=v.value;if(l(b)){var g,y=H(this.renderTypes.values());try{var w=function(){var N=g.value,z=N.type;if(c(z)){var V=n.collections.get(N.collection),F=N.getKey(b),U=Array.isArray(F)?F:[F];if(s)U.forEach(function(J){return V.markKeyForGC(J)}),f=!0;else{var q=N.getID?N.getID(b):b.id(),Z=n._key(z,q),K=n.typeAndIdToKey.get(Z);void 0!==K&&!Em(U,K)&&(d=!0,n.typeAndIdToKey.delete(Z),K.forEach(function(J){return V.markKeyForGC(J)}))}}};for(y.s();!(g=y.n()).done;)w()}catch(C){y.e(C)}finally{y.f()}}}}catch(C){h.e(C)}finally{h.f()}return f&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var n,t=H(this.collections.values());try{for(t.s();!(n=t.n()).done;)n.value.gc()}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,a,i){var s=this.renderTypes.get(n),o=this.collections.get(s.collection),l=!1,u=o.draw(i,a,function(f){s.drawClipped?(f.save(),f.beginPath(),f.rect(0,0,a.w,a.h),f.clip(),s.drawElement(f,t,a,!0,!0),f.restore()):s.drawElement(f,t,a,!0,!0),l=!0});if(l){var c=s.getID?s.getID(t):t.id(),d=this._key(n,c);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(i):this.typeAndIdToKey.set(d,[i])}return u}},{key:"getAtlasInfo",value:function(t,n){var a=this,i=this.renderTypes.get(n),s=i.getKey(t);return(Array.isArray(s)?s:[s]).map(function(l){var u=i.getBoundingBox(t,l),c=a.getOrCreateAtlas(t,n,u,l),f=fe(c.getOffsets(l),2),h=f[0];return{atlas:c,tex:h,tex1:h,tex2:f[1],bb:u}})}},{key:"getDebugInfo",value:function(){var a,t=[],n=H(this.collections);try{for(n.s();!(a=n.n()).done;){var i=fe(a.value,2),s=i[0],l=i[1].getCounts();t.push({type:s,keyCount:l.keyCount,atlasCount:l.atlasCount})}}catch(d){n.e(d)}finally{n.f()}return t}}])}(),km=function(){return ie(function r(e){_(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]},[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(t)}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])}(),Ba={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},zm=function(){return ie(function r(e,t,n){_(this,r),this.r=e,this.gl=t,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=mm,this.atlasManager=new Pm(e,n),this.batchManager=new km(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Ba.SCREEN),this.pickingProgram=this._createShaderProgram(Ba.PICKING),this.vao=this._createVAO()},[{key:"addAtlasCollection",value:function(t,n){this.atlasManager.addAtlasCollection(t,n)}},{key:"addTextureAtlasRenderType",value:function(t,n){this.atlasManager.addRenderType(t,n)}},{key:"addSimpleShapeRenderType",value:function(t,n){this.simpleShapeOptions.set(t,n)}},{key:"invalidate",value:function(t){var a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).type,i=this.atlasManager;return a?i.invalidate(t,{filterType:function(o){return o===a},forceRedraw:!0}):i.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var n=this.gl,a="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat(0,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(4," || aVertType == ").concat(7," \n || aVertType == ").concat(5," || aVertType == ").concat(6,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(1,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(2,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n "),i=this.batchManager.getIndexArray(),o=function ym(r,e,t){var n=uf(r,r.VERTEX_SHADER,e),a=uf(r,r.FRAGMENT_SHADER,t),i=r.createProgram();if(r.attachShader(i,n),r.attachShader(i,a),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS))throw new Error("Could not initialize shaders");return i}(n,a,"#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(i.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join("\n\t"),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat("\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n","\n ").concat("\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n","\n ").concat("\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n","\n ").concat("\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x<q.y)? 1.570796327 : 0.0;\n for( int i=0; i<5; i++ ) {\n vec2 cs = vec2(cos(w),sin(w));\n vec2 u = ab*vec2( cs.x,cs.y);\n vec2 v = ab*vec2(-cs.y,cs.x);\n w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));\n }\n \n // compute final point and distance\n float d = length(p-ab*vec2(cos(w),sin(w)));\n \n // return signed distance\n return (dot(p/ab,p/ab)>1.0) ? d : -d;\n }\n","\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n // look up the texel from the texture unit\n ").concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join("\n\telse "),"\n } \n else if(vVertType == ").concat(3,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(4," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(4," || vVertType == ").concat(7," \n || vVertType == ").concat(5," || vVertType == ").concat(6,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(4,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(7," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(7,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(t.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "));o.aPosition=n.getAttribLocation(o,"aPosition"),o.aIndex=n.getAttribLocation(o,"aIndex"),o.aVertType=n.getAttribLocation(o,"aVertType"),o.aTransform=n.getAttribLocation(o,"aTransform"),o.aAtlasId=n.getAttribLocation(o,"aAtlasId"),o.aTex=n.getAttribLocation(o,"aTex"),o.aPointAPointB=n.getAttribLocation(o,"aPointAPointB"),o.aPointCPointD=n.getAttribLocation(o,"aPointCPointD"),o.aLineWidth=n.getAttribLocation(o,"aLineWidth"),o.aColor=n.getAttribLocation(o,"aColor"),o.aCornerRadius=n.getAttribLocation(o,"aCornerRadius"),o.aBorderColor=n.getAttribLocation(o,"aBorderColor"),o.uPanZoomMatrix=n.getUniformLocation(o,"uPanZoomMatrix"),o.uAtlasSize=n.getUniformLocation(o,"uAtlasSize"),o.uBGColor=n.getUniformLocation(o,"uBGColor"),o.uZoom=n.getUniformLocation(o,"uZoom"),o.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)o.uTextures.push(n.getUniformLocation(o,"uTexture".concat(l)));return o}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,a=this.gl,i=this.program,s=a.createVertexArray();return a.bindVertexArray(s),function Sm(r,e,t,n){var i=fe(cf(r,e),2),s=i[0],o=i[1],l=df(r,o,n),u=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),o===r.FLOAT?r.vertexAttribPointer(t,s,o,!1,0,0):o===r.INT&&r.vertexAttribIPointer(t,s,o,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null)}(a,"vec2",i.aPosition,t),this.transformBuffer=function Lm(r,e,t){for(var a=new Float32Array(9*e),i=new Array(e),s=0;s<e;s++)i[s]=new Float32Array(a.buffer,9*s*4,9);var l=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,a.byteLength,r.DYNAMIC_DRAW);for(var u=0;u<3;u++){var c=t+u;r.enableVertexAttribArray(c),r.vertexAttribPointer(c,3,r.FLOAT,!1,36,12*u),r.vertexAttribDivisor(c,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),l.getMatrixView=function(d){return i[d]},l.setData=function(d,f){i[f].set(d,0)},l.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferSubData(r.ARRAY_BUFFER,0,a)},l}(a,n,i.aTransform),this.indexBuffer=Vr(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Vr(a,n,"int",i.aVertType),this.atlasIdBuffer=Vr(a,n,"int",i.aAtlasId),this.texBuffer=Vr(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Vr(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Vr(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Vr(a,n,"vec2",i.aLineWidth),this.colorBuffer=Vr(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Vr(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Vr(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),s}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Kr(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ba.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return!!t.visible()&&(!n||!n.isVisible||n.isVisible(t))}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,s=this.batchManager,o=i.getRenderTypeOpts(a);if(this._isVisible(t,o)&&(!t.isEdge()||this._isValidEdge(t))){if(this.renderTarget.picking&&o.getTexPickingMode){var l=o.getTexPickingMode(t);if(1===l)return;if(2==l)return void this.drawPickingRectangle(t,n,a)}var d,c=H(i.getAtlasInfo(t,a));try{for(c.s();!(d=c.n()).done;){var f=d.value,h=f.atlas,v=f.tex1,b=f.tex2;s.canAddToCurrentBatch(h)||this.endBatch();for(var y=s.getAtlasIndexForBatch(h),g=0,w=[[v,!0],[b,!1]];g<w.length;g++){var C=fe(w[g],2),N=C[0],z=C[1];if(0!=N.w){var V=this.instanceCount;this.vertTypeBuffer.getView(V)[0]=0,ra(n,this.indexBuffer.getView(V)),this.atlasIdBuffer.getView(V)[0]=y;var q=this.texBuffer.getView(V);q[0]=N.x,q[1]=N.y,q[2]=N.w,q[3]=N.h;var Z=this.transformBuffer.getMatrixView(V);this.setTransformMatrix(t,Z,o,f,z),this.instanceCount++,z||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(K){c.e(K)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=0;if(a.shapeProps&&a.shapeProps.padding&&(o=t.pstyle(a.shapeProps.padding).pfValue),i){var u=i.tex1,d=u.w/(u.w+i.tex2.w);s||(d=1-d);var f=this._getAdjustedBB(i.bb,o,s,d);this._applyTransformMatrix(n,f,a,t)}else{var h=a.getBoundingBox(t),v=this._getAdjustedBB(h,o,!0,1);this._applyTransformMatrix(n,v,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var s,o;hf(t);var l=a.getRotation?a.getRotation(i):0;if(0!==l){var u=a.getRotationPoint(i);Gi(t,t,[u.x,u.y]),vf(t,t,l);var f=a.getRotationOffset(i);s=f.x+(n.xOffset||0),o=f.y+(n.yOffset||0)}else s=n.x1,o=n.y1;Gi(t,t,[s,o]),al(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var s=t.x1,o=t.y1,l=t.w,u=t.h;n&&(s-=n,o-=n,l+=2*n,u+=2*n);var d=0,f=l*i;return a&&i<1?l=f:!a&&i<1&&(s+=d=l-f,l=f),{x1:s,y1:o,w:l,h:u,xOffset:d,yOffset:t.yOffset}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),s=this.instanceCount;this.vertTypeBuffer.getView(s)[0]=4,ra(n,this.indexBuffer.getView(s)),An([0,0,0],1,this.colorBuffer.getView(s));var u=this.transformBuffer.getMatrixView(s);this.setTransformMatrix(t,u,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,a){var i=this.simpleShapeOptions.get(a);if(this._isVisible(t,i)){var s=i.shapeProps,o=this._getVertTypeForShape(t,s.shape);if(void 0===o||i.isSimple&&!i.isSimple(t,this.renderTarget))return void this.drawTexture(t,n,a);var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=o,5===o||6===o){var u=i.getBoundingBox(t),c=this._getCornerRadius(t,s.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,6===o&&(d[0]=0,d[2]=0)}ra(n,this.indexBuffer.getView(l));var h=this.renderTarget.picking?1:"node-body"===a?t.effectiveOpacity():1,v=this.renderTarget.picking?1:t.pstyle(s.opacity).value*h;An(t.pstyle(s.color).value,v,this.colorBuffer.getView(l));var g=this.lineWidthBuffer.getView(l);if(g[0]=0,g[1]=0,s.border){var w=t.pstyle("border-width").value;if(w>0){An(t.pstyle("border-color").value,h*t.pstyle("border-opacity").value,this.borderColorBuffer.getView(l));var V=t.pstyle("border-position").value;if("inside"===V)g[0]=0,g[1]=-w;else if("outside"===V)g[0]=w,g[1]=0;else{var F=w/2;g[0]=F,g[1]=-F}}}var U=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,U,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){switch(t.pstyle(n).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,s=a.h;if("auto"===t.pstyle(n).value)return tn(i,s);var o=t.pstyle(n).pfValue;return Math.min(o,s/2,i/2)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var s,o,l,i=t._private.rscratch;if(!("source"===a?(s=i.arrowStartX,o=i.arrowStartY,l=i.srcArrowAngle):(s=i.arrowEndX,o=i.arrowEndY,l=i.tgtArrowAngle),isNaN(s)||null==s||isNaN(o)||null==o||isNaN(l)||null==l||"none"===t.pstyle(a+"-arrow-shape").value)){var c=t.pstyle(a+"-arrow-color").value,h=t.pstyle("opacity").value*t.pstyle("line-opacity").value,v=t.pstyle("width").pfValue,b=t.pstyle("arrow-scale").value,y=this.r.getArrowWidth(v,b),g=this.instanceCount,w=this.transformBuffer.getMatrixView(g);hf(w),Gi(w,w,[s,o]),al(w,w,[y,y]),vf(w,w,l),this.vertTypeBuffer.getView(g)[0]=3,ra(n,this.indexBuffer.getView(g)),An(c,h,this.colorBuffer.getView(g)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var a=this._getEdgePoints(t);if(a){var i=t.pstyle("opacity").value,s=t.pstyle("line-opacity").value,o=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*s;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==a.length){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=1,ra(n,this.indexBuffer.getView(c)),An(l,u,this.colorBuffer.getView(c)),this.lineWidthBuffer.getView(c)[0]=o;var v=this.pointAPointBBuffer.getView(c);v[0]=a[0],v[1]=a[1],v[2]=a[2],v[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var b=0;b<a.length-2;b+=2){var y=this.instanceCount;this.vertTypeBuffer.getView(y)[0]=2,ra(n,this.indexBuffer.getView(y)),An(l,u,this.colorBuffer.getView(y)),this.lineWidthBuffer.getView(y)[0]=o;var N=a[b-2],z=a[b-1],V=a[b],F=a[b+1],U=a[b+2],q=a[b+3],Z=a[b+4],K=a[b+5];0==b&&(N=2*V-U+.001,z=2*F-q+.001),b==a.length-4&&(Z=2*U-V+.001,K=2*q-F+.001);var J=this.pointAPointBBuffer.getView(y);J[0]=N,J[1]=z,J[2]=V,J[3]=F;var Q=this.pointCPointDBuffer.getView(y);Q[0]=U,Q[1]=q,Q[2]=Z,Q[3]=K,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||null==n.allpts||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(4==a.length)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){return Math.min(Math.max(15,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(4==t.length)return t;for(var a=Array(2*(n+1)),i=0;i<=n;i++)0==i?(a[0]=t[0],a[1]=t[1]):i==n?(a[2*i]=t[t.length-2],a[2*i+1]=t[t.length-1]):this._setCurvePoint(t,i/n,a,2*i);return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(!(t.length<=2)){for(var s=Array(t.length-2),o=0;o<s.length;o+=2){var u=(1-n)*t[o+1]+n*t[o+3];s[o]=(1-n)*t[o]+n*t[o+2],s[o+1]=u}return this._setCurvePoint(s,n,a,i)}a[i]=t[0],a[i+1]=t[1]}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(0!==i){var s=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(s),t.bindVertexArray(n);var l,o=H(this.buffers);try{for(o.s();!(l=o.n()).done;)l.value.bufferSubData(i)}catch(v){o.e(v)}finally{o.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var f=0;f<c.length;f++)t.activeTexture(t.TEXTURE0+f),t.bindTexture(t.TEXTURE_2D,c[f].texture),t.uniform1i(s.uTextures[f],f);t.uniform1f(s.uZoom,function bm(r){var e=r.pixelRatio;return r.cy.zoom()*e}(this.r)),t.uniformMatrix3fv(s.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(s.uAtlasSize,this.batchManager.getAtlasSize());var h=An(this.bgColor,1);t.uniform4fv(s.uBGColor,h),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(s,o){return s+o.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(s,o){return s+o.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])}(),yf={};function mf(r,e){return vr(r._private.rscratch,"labelWrapCachedLines",e)||[]}yf.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=function Vm(r){var e=r.cy.container();return wl(e&&e.style&&e.style.backgroundColor||"white")}(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=function Am(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,a){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,a,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new zm(t,n,r);var a=function(d){return function(f){return t.getTextAngle(f,d)}},i=function(d){return function(f){var h=f.pstyle(d);return h&&h.value}},s=function(d){return function(f){return f.pstyle("".concat(d,"-opacity")).value>0}},o=function(d){return"yes"===d.pstyle("text-events").strValue?2:1},l=function(d){var f=d.position(),h=f.x,v=f.y,b=d.outerWidth(),y=d.outerHeight();return{w:b,h:y,x1:h-b/2,y1:v-y/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:xm,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:s("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:s("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:o,getKey:ol(e.getLabelKey,null),getBoundingBox:ll(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:a(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:i("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:o,getKey:ol(e.getSourceLabelKey,"source"),getBoundingBox:ll(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:a("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:i("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:o,getKey:ol(e.getTargetLabelKey,"target"),getBoundingBox:ll(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ca(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var f=!1;d&&d.length>0&&(f|=t.drawing.invalidate(d)),f&&u()}),function Hm(r){var e=r.render;r.render=function(i){i=i||{},r.webgl&&(r.cy.zoom()>7.99?(function Um(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}(r),e.call(r,i)):(function Xm(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}(r),wf(r,i,Ba.SCREEN)))};var t=r.matchCanvasSize;r.matchCanvasSize=function(i){t.call(r,i),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0},r.findNearestElements=function(i,s,o,l){return function Km(r,e,t){var i,s,l,n=function $m(r,e,t){var i,s,u=rl(r),f=function wm(r,e,t,n,a){var s=a*t+e.y;return[n*t+e.x,s=Math.round(r.canvasHeight-s)]}(r,u.pan,u.zoom,e,t),h=fe(f,2);i=h[0]-3,s=h[1]-3;var g=r.data.contexts[r.WEBGL];g.bindFramebuffer(g.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(g.viewport(0,0,g.canvas.width,g.canvas.height),wf(r,null,Ba.PICKING),r.pickingFrameBuffer.needsDraw=!1);var C=new Uint8Array(144);g.readPixels(i,s,6,6,g.RGBA,g.UNSIGNED_BYTE,C),g.bindFramebuffer(g.FRAMEBUFFER,null);for(var N=new Set,z=0;z<36;z++){var F=Tm(C.slice(4*z,4*z+4))-1;F>=0&&N.add(F)}return N}(r,e,t),a=r.getCachedZSortedEles(),o=H(n);try{for(o.s();!(l=o.n()).done;){var c=a[l.value];if(!i&&c.isNode()&&(i=c),!s&&c.isEdge()&&(s=c),i&&s)break}}catch(d){o.e(d)}finally{o.f()}return[i,s].filter(Boolean)}(r,i,s)};var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0};var a=r.notify;r.notify=function(i,s){a.call(r,i,s),"viewport"===i||"bounds"===i?r.pickingFrameBuffer.needsDraw=!0:"background"===i&&r.drawing.invalidate(s,{type:"node-body"})}}(t)};var ol=function(e,t){return function(n){var a=e(n),i=mf(n,t);return i.length>1?i.map(function(s,o){return"".concat(a,"_").concat(o)}):a}},ll=function(e,t){return function(n,a){var i=e(n);if("string"==typeof a){var s=a.indexOf("_");if(s>0){var o=Number(a.substring(s+1)),l=mf(n,t),u=i.h/l.length,c=u*o;return{x1:i.x1,w:i.w,y1:i.y1+c,h:u,yOffset:c}}}return i}};function bf(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=rl(r),i=a.pan,s=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(s,s)}function ul(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function wf(r,e,t){var n;r.webglDebug&&(n=performance.now());var a=r.drawing,i=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&function Ym(r,e){r.drawSelectionRectangle(e,function(t){return bf(r,t)})}(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var s=r.data.contexts[r.WEBGL];t.screen?(s.clearColor(0,0,0,0),s.enable(s.BLEND),s.blendFunc(s.ONE,s.ONE_MINUS_SRC_ALPHA)):s.disable(s.BLEND),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.viewport(0,0,s.canvas.width,s.canvas.height);var o=function jm(r){var e=r.canvasWidth,t=r.canvasHeight,n=rl(r),a=n.pan,i=n.zoom,s=nl();Gi(s,s,[a.x,a.y]),al(s,s,[i,i]);var o=nl();!function Nm(r,e,t){r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1}(o,e,t);var l=nl();return function Im(r,e,t){var n=e[0],a=e[1],i=e[2],s=e[3],o=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=t[0],h=t[1],v=t[2],b=t[3],y=t[4],g=t[5],w=t[6],C=t[7],N=t[8];r[0]=f*n+h*s+v*u,r[1]=f*a+h*o+v*c,r[2]=f*i+h*l+v*d,r[3]=b*n+y*s+g*u,r[4]=b*a+y*o+g*c,r[5]=b*i+y*l+g*d,r[6]=w*n+C*s+N*u,r[7]=w*a+C*o+N*c,r[8]=w*i+C*l+N*d}(l,o,s),l}(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(o,t),t.screen){for(var u=0;u<l.nondrag.length;u++)ul(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)ul(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)ul(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(function Wm(r){var e=r.data.contexts[r.NODE];e.save(),bf(r,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()}(r),function qm(r){var e=function(a,i,s){for(var o=a.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=o.atlases,c=0;c<u.length;c++){var f=u[c].canvas;if(f){var h=f.width,v=f.height,b=h*c,y=f.height*s;l.save(),l.scale(.4,.4),l.drawImage(f,b,y),l.strokeStyle="black",l.rect(b,y,h,v),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var f=performance.now(),v=Math.ceil(f-n),b=a.getDebugInfo(),y=["".concat(i," elements"),"".concat(b.totalInstances," instances"),"".concat(b.batchCount," batches"),"".concat(b.totalAtlases," atlases"),"".concat(b.wrappedCount," wrapped textures"),"".concat(b.simpleCount," simple shapes")].join(", ");console.log("WebGL (".concat(t.name,") - frame time ").concat(v,"ms")),console.log("Totals:"),console.log(" ".concat(y)),console.log("Texture Atlases Used:");var C,w=H(b.atlasInfo);try{for(w.s();!(C=w.n()).done;){var N=C.value;console.log(" ".concat(N.type,": ").concat(N.keyCount," keys, ").concat(N.atlasCount," atlases"))}}catch(z){w.e(z)}finally{w.f()}console.log("")}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}for(var fn={drawPolygonPath:function(r,e,t,n,a,i){var s=n/2,o=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+s*i[0],t+o*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+s*i[2*l],t+o*i[2*l+1]);r.closePath()},drawRoundPolygonPath:function(r,e,t,n,a,i,s){s.forEach(function(o){return _d(r,o)}),r.closePath()},drawRoundRectanglePath:function(r,e,t,n,a,i){var s=n/2,o=a/2,l="auto"===i?tn(n,a):Math.min(i,o,s);r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.arcTo(e+s,t-o,e+s,t,l),r.arcTo(e+s,t+o,e,t+o,l),r.arcTo(e-s,t+o,e-s,t,l),r.arcTo(e-s,t-o,e,t-o,l),r.lineTo(e,t-o),r.closePath()},drawBottomRoundRectanglePath:function(r,e,t,n,a,i){var s=n/2,o=a/2,l="auto"===i?tn(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-o),r.lineTo(e+s,t-o),r.lineTo(e+s,t),r.arcTo(e+s,t+o,e,t+o,l),r.arcTo(e-s,t+o,e-s,t,l),r.lineTo(e-s,t-o),r.lineTo(e,t-o),r.closePath()},drawCutRectanglePath:function(r,e,t,n,a,i,s){var o=n/2,l=a/2,u="auto"===s?8:s;r.beginPath&&r.beginPath(),r.moveTo(e-o+u,t-l),r.lineTo(e+o-u,t-l),r.lineTo(e+o,t-l+u),r.lineTo(e+o,t+l-u),r.lineTo(e+o-u,t+l),r.lineTo(e-o+u,t+l),r.lineTo(e-o,t+l-u),r.lineTo(e-o,t-l+u),r.closePath()},drawBarrelPath:function(r,e,t,n,a){var i=n/2,s=a/2,o=e-i,l=e+i,u=t-s,c=t+s,d=Ts(n,a),f=d.widthOffset,h=d.heightOffset,v=d.ctrlPtOffsetPct*f;r.beginPath&&r.beginPath(),r.moveTo(o,u+h),r.lineTo(o,c-h),r.quadraticCurveTo(o+v,c,o+f,c),r.lineTo(l-f,c),r.quadraticCurveTo(l-v,c,l,c-h),r.lineTo(l,u+h),r.quadraticCurveTo(l-v,u,l-f,u),r.lineTo(o+f,u),r.quadraticCurveTo(o+v,u,o,u+h),r.closePath()}},xf=Math.sin(0),Ef=Math.cos(0),cl={},dl={},Tf=Math.PI/40,aa=0*Math.PI;aa<2*Math.PI;aa+=Tf)cl[aa]=Math.sin(aa),dl[aa]=Math.cos(aa);fn.drawEllipsePath=function(r,e,t,n,a){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,a/2,0,0,2*Math.PI);else for(var i,s,o=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=Tf)i=e-o*cl[u]*xf+o*dl[u]*Ef,s=t+l*dl[u]*xf+l*cl[u]*Ef,0===u?r.moveTo(i,s):r.lineTo(i,s);r.closePath()};var Ga={};function Cf(r){var e=r.indexOf(",");return r.substr(e+1)}function Df(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new Vn(function(a,i){try{e.toBlob(function(s){null!=s?a(s):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(s){i(s)}});case"blob":return function Zm(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),a=new Uint8Array(n),i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return new Blob([n],{type:e})}(Cf(n()),t);case"base64":return Cf(n());default:return n()}}Ga.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]},Ga.bufferCanvasImage=function(r){var e=this.cy,n=e.mutableElements().boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],s=r.full?Math.ceil(n.h):a[3],o=_e(r.maxWidth)||_e(r.maxHeight),l=this.getPixelRatio(),u=1;if(void 0!==r.scale)i*=r.scale,s*=r.scale,u=r.scale;else if(o){var c=1/0,d=1/0;_e(r.maxWidth)&&(c=u*r.maxWidth/i),_e(r.maxHeight)&&(d=u*r.maxHeight/s),i*=u=Math.min(c,d),s*=u}o||(i*=l,s*=l,u*=l);var f=document.createElement("canvas");f.width=i,f.height=s,f.style.width=i+"px",f.style.height=s+"px";var h=f.getContext("2d");if(i>0&&s>0){h.clearRect(0,0,i,s),h.globalCompositeOperation="source-over";var v=this.getCachedZSortedEles();if(r.full)h.translate(-n.x1*u,-n.y1*u),h.scale(u,u),this.drawElements(h,v),h.scale(1/u,1/u),h.translate(n.x1*u,n.y1*u);else{var b=e.pan(),y={x:b.x*u,y:b.y*u};u*=e.zoom(),h.translate(y.x,y.y),h.scale(u,u),this.drawElements(h,v),h.scale(1/u,1/u),h.translate(-y.x,-y.y)}r.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=r.bg,h.rect(0,0,i,s),h.fill())}return f},Ga.png=function(r){return Df(r,this.bufferCanvasImage(r),"image/png")},Ga.jpg=function(r){return Df(r,this.bufferCanvasImage(r),"image/jpeg")};var Jm=Lf,St=Lf.prototype;function Lf(r){var e=this,n=e.cy.window().document;r.webgl&&(St.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(St.CANVAS_LAYERS),contexts:new Array(St.CANVAS_LAYERS),canvasNeedsRedraw:new Array(St.CANVAS_LAYERS),bufferCanvases:new Array(St.BUFFER_COUNT),bufferContexts:new Array(St.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=r.cy.container();o.appendChild(e.data.canvasContainer),o.style[a]=i;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};Je&&Je.userAgent.match(/msie|trident|edge/i)&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<St.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=St.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Xt("Could not create canvas of type "+d),Object.keys(l).forEach(function(He){c.style[He]=l[He]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(St.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}for(e.data.topCanvas=e.data.canvases[0],e.data.canvases[St.NODE].setAttribute("data-id","layer"+St.NODE+"-node"),e.data.canvases[St.SELECT_BOX].setAttribute("data-id","layer"+St.SELECT_BOX+"-selectbox"),e.data.canvases[St.DRAG].setAttribute("data-id","layer"+St.DRAG+"-drag"),e.data.canvases[St.WEBGL]&&e.data.canvases[St.WEBGL].setAttribute("data-id","layer"+St.WEBGL+"-webgl"),u=0;u<St.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var f=gr(),v=function(Te){return{x:-Te.w/2,y:-Te.h/2}},y=function(Te){return Te[0]._private.nodeKey},g=function(Te){return Te[0]._private.labelStyleKey},w=function(Te){return Te[0]._private.sourceLabelStyleKey},C=function(Te){return Te[0]._private.targetLabelStyleKey},N=function(Te,Ie,Pe,ze,rt){return e.drawElement(Te,Ie,Pe,!1,!1,rt)},z=function(Te,Ie,Pe,ze,rt){return e.drawElementText(Te,Ie,Pe,ze,"main",rt)},V=function(Te,Ie,Pe,ze,rt){return e.drawElementText(Te,Ie,Pe,ze,"source",rt)},F=function(Te,Ie,Pe,ze,rt){return e.drawElementText(Te,Ie,Pe,ze,"target",rt)},U=function(Te){return Te.boundingBox(),Te[0]._private.bodyBounds},q=function(Te){return Te.boundingBox(),Te[0]._private.labelBounds.main||f},Z=function(Te){return Te.boundingBox(),Te[0]._private.labelBounds.source||f},K=function(Te){return Te.boundingBox(),Te[0]._private.labelBounds.target||f},J=function(Te,Ie){return Ie},Q=function(Te){return function(Te){return{x:(Te.x1+Te.x2)/2,y:(Te.y1+Te.y2)/2}}(U(Te))},le=function(Te,Ie,Pe){var ze=Te?Te+"-":"";return{x:Ie.x+Pe.pstyle(ze+"text-margin-x").pfValue,y:Ie.y+Pe.pstyle(ze+"text-margin-y").pfValue}},de=function(Te,Ie,Pe){var ze=Te[0]._private.rscratch;return{x:ze[Ie],y:ze[Pe]}},he=function(Te){return le("",de(Te,"labelX","labelY"),Te)},ue=function(Te){return le("source",de(Te,"sourceLabelX","sourceLabelY"),Te)},ge=function(Te){return le("target",de(Te,"targetLabelX","targetLabelY"),Te)},Se=function(Te){return v(U(Te))},Le=function(Te){return v(Z(Te))},ye=function(Te){return v(K(Te))},De=function(Te){var Ie=q(Te),Pe=v(q(Te));if(Te.isNode()){switch(jn(Te.pstyle("text-halign").value)){case"left":Pe.x=-Ie.w-(Ie.leftPad||0);break;case"right":Pe.x=-(Ie.rightPad||0)}switch(Yn(Te.pstyle("text-valign").value)){case"top":Pe.y=-Ie.h-(Ie.topPad||0);break;case"bottom":Pe.y=-(Ie.botPad||0)}}return Pe},Ue=e.data.eleTxrCache=new Oa(e,{getKey:y,doesEleInvalidateKey:function(Te){var Ie=Te[0]._private;return!(Ie.oldBackgroundTimestamp===Ie.backgroundTimestamp)},drawElement:N,getBoundingBox:U,getRotationPoint:Q,getRotationOffset:Se,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),$e=e.data.lblTxrCache=new Oa(e,{getKey:g,drawElement:z,getBoundingBox:q,getRotationPoint:he,getRotationOffset:De,isVisible:J}),Xe=e.data.slbTxrCache=new Oa(e,{getKey:w,drawElement:V,getBoundingBox:Z,getRotationPoint:ue,getRotationOffset:Le,isVisible:J}),Qe=e.data.tlbTxrCache=new Oa(e,{getKey:C,drawElement:F,getBoundingBox:K,getRotationPoint:ge,getRotationOffset:ye,isVisible:J}),tt=e.data.lyrTxrCache=new ef(e);e.onUpdateEleCalcs(function(Te,Ie){Ue.invalidateElements(Ie),$e.invalidateElements(Ie),Xe.invalidateElements(Ie),Qe.invalidateElements(Ie),tt.invalidateElements(Ie);for(var Pe=0;Pe<Ie.length;Pe++){var ze=Ie[Pe]._private;ze.oldBackgroundTimestamp=ze.backgroundTimestamp}});var at=function(Te){for(var Ie=0;Ie<Te.length;Ie++)tt.enqueueElementRefinement(Te[Ie].ele)};Ue.onDequeue(at),$e.onDequeue(at),Xe.onDequeue(at),Qe.onDequeue(at),r.webgl&&e.initWebgl(r,{getStyleKey:y,getLabelKey:g,getSourceLabelKey:w,getTargetLabelKey:C,drawElement:N,drawLabel:z,drawSourceLabel:V,drawTargetLabel:F,getElementBox:U,getLabelBox:q,getSourceLabelBox:Z,getTargetLabelBox:K,getElementRotationPoint:Q,getElementRotationOffset:Se,getLabelRotationPoint:he,getSourceLabelRotationPoint:ue,getTargetLabelRotationPoint:ge,getLabelRotationOffset:De,getSourceLabelRotationOffset:Le,getTargetLabelRotationOffset:ye})}St.CANVAS_LAYERS=3,St.SELECT_BOX=0,St.DRAG=1,St.NODE=2,St.WEBGL=3,St.CANVAS_TYPES=["2d","2d","2d","webgl2"],St.BUFFER_COUNT=3,St.TEXTURE_BUFFER=0,St.MOTIONBLUR_BUFFER_NODE=1,St.MOTIONBLUR_BUFFER_DRAG=2,St.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[St.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[St.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[St.SELECT_BOX]=e;break;case"gc":t.data.gc=!0}};var Qm=typeof Path2D<"u";St.path2dEnabled=function(r){if(void 0===r)return this.pathsEnabled;this.pathsEnabled=!!r},St.usePaths=function(){return Qm&&this.pathsEnabled},St.setImgSmoothing=function(r,e){null!=r.imageSmoothingEnabled?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)},St.getImgSmoothing=function(r){return null!=r.imageSmoothingEnabled?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled},St.makeOffscreenCanvas=function(r,e){var t;return"undefined"!==(typeof OffscreenCanvas>"u"?"undefined":pe(OffscreenCanvas))?t=new OffscreenCanvas(r,e):((t=this.cy.window().document.createElement("canvas")).width=r,t.height=e),t},[rf,zr,qr,tl,Ln,dn,yr,yf,fn,Ga,{nodeShapeImpl:function(r,e,t,n,a,i,s,o){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,s);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,s,o);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,o);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,s,o);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,o);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}}}].forEach(function(r){mt(St,r)});var t0=[{type:"layout",extensions:Cy},{type:"renderer",extensions:[{name:"null",impl:Ad},{name:"base",impl:qd},{name:"canvas",impl:Jm}]}],Af={},If={};function Nf(r,e,t){var n=t,a=function(U){_t("Can not register `"+e+"` for `"+r+"` since `"+U+"` already exists in the prototype and can not be overridden")};if("core"===r){if(Ia.prototype[e])return a(e);Ia.prototype[e]=t}else if("collection"===r){if(or.prototype[e])return a(e);or.prototype[e]=t}else if("layout"===r){for(var i=function(U){this.options=U,t.call(this,U),Oe(this._private)||(this._private={}),this._private.cy=U.cy,this._private.listeners=[],this.createEmitter()},s=i.prototype=Object.create(t.prototype),o=[],l=0;l<o.length;l++){var u=o[l];s[u]=s[u]||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 c=t.prototype.stop;s.stop=function(){var F=this.options;if(F&&F.animate){var U=this.animations;if(U)for(var q=0;q<U.length;q++)U[q].stop()}return c?c.call(this):this.emit("layoutstop"),this},s.destroy||(s.destroy=function(){return this}),s.cy=function(){return this._private.cy};var d=function(U){return U._private.cy},f={addEventFields:function(U,q){q.layout=U,q.cy=d(U),q.target=U},bubble:function(){return!0},parent:function(U){return d(U)}};mt(s,{createEmitter:function(){return this._private.emitter=new pi(f,this),this},emitter:function(){return this._private.emitter},on:function(U,q){return this.emitter().on(U,q),this},one:function(U,q){return this.emitter().one(U,q),this},once:function(U,q){return this.emitter().one(U,q),this},removeListener:function(U,q){return this.emitter().removeListener(U,q),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(U,q){return this.emitter().emit(U,q),this}}),Ft.eventAliasesOn(s),n=i}else if("renderer"===r&&"null"!==e&&"base"!==e){var h=Rf("renderer","base"),v=h.prototype,b=t,y=t.prototype,g=function(){h.apply(this,arguments),b.apply(this,arguments)},w=g.prototype;for(var C in v){var N=v[C];if(null!=y[C])return a(C);w[C]=N}for(var V in y)w[V]=y[V];v.clientFunctions.forEach(function(F){w[F]=w[F]||function(){Xt("Renderer does not implement `renderer."+F+"()` on its prototype")}}),n=g}else if("__proto__"===r||"constructor"===r||"prototype"===r)return Xt(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return xl({map:Af,keys:[r,e],value:n})}function Rf(r,e){return El({map:Af,keys:[r,e]})}function r0(r,e,t,n,a){return xl({map:If,keys:[r,e,t,n],value:a})}function n0(r,e,t,n){return El({map:If,keys:[r,e,t,n]})}var fl=function(){return 2===arguments.length?Rf.apply(null,arguments):3===arguments.length?Nf.apply(null,arguments):4===arguments.length?n0.apply(null,arguments):5===arguments.length?r0.apply(null,arguments):void Xt("Invalid extension access syntax")};Ia.prototype.extension=fl,t0.forEach(function(r){r.extensions.forEach(function(e){Nf(r.type,e.name,e.impl)})});var Hi=function(){if(!(this instanceof Hi))return new Hi;this.length=0},In=Hi.prototype;In.instanceString=function(){return"stylesheet"},In.selector=function(r){return this[this.length++]={selector:r,properties:[]},this},In.css=function(r,e){var t=this.length-1;if(oe(r))this[t].properties.push({name:r,value:e});else if(Oe(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var s=a[i],o=n[s];if(null!=o){var l=nr.properties[s]||nr.properties[Ua(s)];null!=l&&this[t].properties.push({name:l.name,value:o})}}return this},In.style=In.css,In.generateStyle=function(r){var e=new nr(r);return this.appendToStyle(e)},In.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],a=t.properties;r.selector(t.selector);for(var i=0;i<a.length;i++){var s=a[i];r.css(s.name,s.value)}}return r};var hn=function(e){return void 0===e&&(e={}),Oe(e)?new Ia(e):oe(e)?fl.apply(fl,arguments):void 0};hn.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(hn),r.apply(null,e),this},hn.warnings=function(r){return Yl(r)},hn.version="3.34.0",hn.stylesheet=hn.Stylesheet=Hi;var i0=Y(5970),Ce=Y(5547);const s0=["graphContainer"],o0=(r,e)=>e.key,Mf=(r,e)=>e.id;function l0(r,e){if(1&r&&(Ce.j41(0,"div",5)(1,"span",6),Ce.EFF(2),Ce.k0s(),Ce.j41(3,"span",7),Ce.EFF(4),Ce.k0s()()),2&r){const t=e.$implicit;Ce.R7$(2),Ce.JRh(t.key),Ce.R7$(2),Ce.JRh(t.value)}}function u0(r,e){if(1&r&&(Ce.j41(0,"div",4),Ce.Z7z(1,l0,5,2,"div",5,o0),Ce.k0s()),2&r){const t=e;Ce.xc7("left",t.x,"px")("top",t.y,"px"),Ce.R7$(),Ce.Dyx(t.entries)}}function c0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"button",10),Ce.bIt("mousedown",function(a){return a.stopPropagation()})("click",function(){const a=E.eBV(t).$implicit,i=Ce.XpG(2);return E.Njj(i._onContextMenuAction(a.id))}),Ce.EFF(1),Ce.k0s()}if(2&r){const t=e.$implicit;Ce.R7$(),Ce.SpI(" ",t.label," ")}}function d0(r,e){if(1&r&&(Ce.j41(0,"div",8),Ce.Z7z(1,c0,2,1,"button",9,Mf),Ce.k0s()),2&r){const t=Ce.XpG();Ce.xc7("left",t.contextMenuPos().x,"px")("top",t.contextMenuPos().y,"px"),Ce.R7$(),Ce.Dyx(t.contextMenuItems())}}function f0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"button",10),Ce.bIt("mousedown",function(a){return a.stopPropagation()})("click",function(){const a=E.eBV(t).$implicit,i=Ce.XpG(2);return E.Njj(i._onEdgeContextMenuAction(a.id))}),Ce.EFF(1),Ce.k0s()}if(2&r){const t=e.$implicit;Ce.R7$(),Ce.SpI(" ",t.label," ")}}function h0(r,e){if(1&r&&(Ce.j41(0,"div",8),Ce.Z7z(1,f0,2,1,"button",9,Mf),Ce.k0s()),2&r){const t=Ce.XpG();Ce.xc7("left",t.edgeContextMenuPos().x,"px")("top",t.edgeContextMenuPos().y,"px"),Ce.R7$(),Ce.Dyx(t.edgeContextMenuItems())}}try{hn.use(ne())}catch{}let hl=(()=>{class r{elements=M.hFB.required();animate=(0,M.hFB)(!1);stopAnimationAfterFirstNodeHover=(0,M.hFB)(!0);layout=(0,M.hFB)("cose-bilkent");highlightNeighborsOnHover=(0,M.hFB)(!0);userZoomingEnabled=(0,M.hFB)(!0);userPanningEnabled=(0,M.hFB)(!0);appendHTMLLabels=(0,M.hFB)(!0);directed=(0,M.hFB)(!0);labelPropsSettings=(0,M.hFB)(new G);contextMenuItems=(0,M.hFB)([]);edgeContextMenuItems=(0,M.hFB)([]);nodeHover=(0,M.CGW)();nodeClick=(0,M.CGW)();canvasClick=(0,M.CGW)();contextMenuAction=(0,M.CGW)();edgeContextMenuAction=(0,M.CGW)();_cy=(0,E.vPA)(void 0);_container=(0,E.vPA)(void 0);_animate;_positionCache=new Map;hoverNodeOverlay=(0,E.vPA)(null);contextMenuVisible=(0,E.vPA)(!1);contextMenuPos=(0,E.vPA)({x:0,y:0});_contextMenuNode=null;edgeContextMenuVisible=(0,E.vPA)(!1);edgeContextMenuPos=(0,E.vPA)({x:0,y:0});_edgeContextMenuLabel="";_edgeContextMenuEdge={source:"",target:""};graphContainer;handleElements=(0,E.QZP)(()=>{const t=this.elements();if(void 0===this._container())return;const n=this._cy();n?this._patch(n,t):this._build(),this._setupClickHoverEvents()});handleAnimate=(0,E.QZP)(()=>{const t=this._cy();void 0!==t&&(this.animate()?this._setAnimation(t):this._stopAnimation())});handleHTMLLabels=(0,E.QZP)(()=>{const t=this._cy(),n=this._container();if(void 0===t||void 0===n)return;const a=this.labelPropsSettings(),i=new G;i.boxLabels={...a.boxLabels},i.props={display:!1,displayOnlyOnHover:a.props.displayOnlyOnHover},P(t,n,i)});_bodyObserver;_resizeDebounce;_startBodyObserver(){this._bodyObserver=new MutationObserver(()=>{this._reapplyStyles()}),this._bodyObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]})}_reapplyStyles(){const t=this._cy(),n=this._container();if(!t||!n)return;const a=this._resolveParentBg(n),i={...$,directed:this.directed(),backgroundColor:a};t.style(B(i)).update()}_resolveParentBg(t){let n=t.parentElement;for(;n;){const a=window.getComputedStyle(n).backgroundColor;if(a&&"rgba(0, 0, 0, 0)"!==a&&"transparent"!==a)return a;n=n.parentElement}return"#ffffff"}ngAfterViewInit(){const t=this.graphContainer.nativeElement;void 0!==t&&this._container.update(()=>t)}ngOnDestroy(){this._bodyObserver?.disconnect(),clearTimeout(this._resizeDebounce),this._cy()?.destroy()}onResize(){const t=this._cy();t&&(t.resize(),clearTimeout(this._resizeDebounce),this._resizeDebounce=setTimeout(()=>{t.resize(),this._nodesHavePosition()||t.fit(void 0,60),t.center()},250))}_setAnimation(t){this._stopAnimation(),this._animate=new j(t,this.stopAnimationAfterFirstNodeHover(),1e-4,.02)}_stopAnimation(){this._animate?.stop()}_patch(t,n){const a=new Set(n.nodes.map(g=>g.data.id)),i=new Set(n.edges.map(g=>g.data.id??""));t.nodes().filter(g=>!a.has(g.id())).forEach(g=>{this._positionCache.set(g.id(),{...g.position()})}),t.remove(t.nodes().filter(g=>!a.has(g.id()))),t.remove(t.edges().filter(g=>!i.has(g.id())));const s=new Set(t.nodes().map(g=>g.id())),o=new Set(t.edges().map(g=>g.id()));for(const g of n.nodes)if(s.has(g.data.id)){const w=t.getElementById(g.data.id);w.data(g.data),w.classes(g.classes??"")}const l=n.nodes.filter(g=>!s.has(g.data.id)),u=n.edges.filter(g=>!o.has(g.data.id??""));if(0===l.length&&0===u.length)return;t.nodes().lock();const c=new Set(l.map(g=>g.data.id)),d=t.nodes();t.add([...l.map(g=>({group:"nodes",data:g.data,classes:g.classes??""})),...u.map(g=>({group:"edges",data:g.data,classes:g.classes??""}))]);const f=new Map;for(const g of u){const w=c.has(g.data.source),C=c.has(g.data.target??"");if(w&&!C){const N=t.getElementById(g.data.target??"");N.length>0&&!f.has(g.data.source)&&f.set(g.data.source,{...N.position()})}if(C&&!w){const N=t.getElementById(g.data.source);N.length>0&&!f.has(g.data.target)&&f.set(g.data.target,{...N.position()})}}const h=[];let v=0;if(t.nodes().filter(g=>c.has(g.id())).forEach(g=>{const w=this._positionCache.get(g.id());if(w)g.position(w),g.lock(),this._positionCache.delete(g.id());else{const C=f.get(g.id());if(C){const N=v++*(2*Math.PI/Math.max(l.length,1)),z=100+60*Math.random();g.position({x:C.x+z*Math.cos(N),y:C.y+z*Math.sin(N)})}else h.push(g)}}),h.length>0&&d.length>0){const g=d.boundingBox({}),w=(g.x1+g.x2)/2,C=(g.y1+g.y2)/2,N=Math.max(g.x2-g.x1,g.y2-g.y1)/2+180,z=2*Math.PI/Math.max(h.length,1);h.forEach((V,F)=>{V.position({x:w+N*Math.cos(z*F),y:C+N*Math.sin(z*F)})})}const b=this._container();if(b&&this.appendHTMLLabels()){const g=new G,w=this.labelPropsSettings();g.boxLabels={...w.boxLabels},g.props={display:!1,displayOnlyOnHover:w.props.displayOnlyOnHover},P(t,b,g)}const y=t.layout({...this._layoutOptions(),randomize:!1,fit:!1,animate:!0});y.on("layoutstop",()=>t.nodes().unlock()),y.run()}_build(){this._bodyObserver?.disconnect(),this._bodyObserver=void 0;const t=this._container(),n=t?this._resolveParentBg(t):$.backgroundColor,a={...$,directed:this.directed(),backgroundColor:n},i=B(a),s=this._nodesHavePosition()?{name:"preset",padding:100,animate:!1}:{...this._layoutOptions(),padding:80,animate:!1},o=hn({container:this._container(),style:i,layout:s,elements:this.elements(),userZoomingEnabled:this.userZoomingEnabled(),userPanningEnabled:this.userPanningEnabled(),minZoom:.2,maxZoom:3});o.one("layoutstop",()=>{o.resize(),this._nodesHavePosition()||o.fit(void 0,60),o.center()}),this._cy.update(()=>o),this._startBodyObserver()}_setupClickHoverEvents(){const t=this._cy();if(null==t)return;let n=t.collection();t.nodes().unbind("tapstart"),t.nodes().bind("tapstart",a=>{const i=a.target.data();!i.isCollapser&&!i.isChainExpander&&this.contextMenuItems().length>0&&(a.originalEvent?.preventDefault(),a.originalEvent?.stopPropagation())}),t.nodes().unbind("click"),t.nodes().bind("click",a=>{const i=a.target,s=i.data();if(s.isCollapser||s.isChainExpander)return this.contextMenuVisible.set(!1),this.nodeClick.emit(s),void(n=n.union(i));if(this.contextMenuItems().length>0){const o=i.renderedPosition();return this._contextMenuNode=s,this.contextMenuPos.set({x:o.x,y:o.y}),void this.contextMenuVisible.set(!0)}this.nodeClick.emit(s),n=n.union(i)}),t.nodes().unbind("cxttap"),t.nodes().bind("cxttap",a=>{if(!this.contextMenuItems().length)return;const i=a.target,s=i.data(),o=i.renderedPosition();this._contextMenuNode=s,this.contextMenuPos.set({x:o.x,y:o.y}),this.contextMenuVisible.set(!0),this.edgeContextMenuVisible.set(!1),this.nodeHover.emit(s)}),t.nodes().unbind("mouseover"),t.nodes().bind("mouseover",a=>{this._dimAllButNeighbors(a.target);const i=a.target.data();this.nodeHover.emit(i);const s=i.properties;if(this.labelPropsSettings().props.display&&s){const o=Object.entries(s).map(([l,u])=>({key:l,value:String(u)}));if(o.length>0){const l=a.target.renderedBoundingBox();this.hoverNodeOverlay.set({x:(l.x1+l.x2)/2,y:l.y2,entries:o})}}}),t.nodes().unbind("mouseout"),t.nodes().bind("mouseout",()=>{this._unDimAll(),this.nodeHover.emit(void 0),this.hoverNodeOverlay.set(null)}),t.nodes().unbind("drag"),t.nodes().bind("drag",a=>{if(null===this.hoverNodeOverlay())return;const i=a.target.renderedBoundingBox(),s=this.hoverNodeOverlay();this.hoverNodeOverlay.set({...s,x:(i.x1+i.x2)/2,y:i.y2})}),t.nodes().unbind("dragfree"),t.nodes().bind("dragfree",()=>{this.hoverNodeOverlay.set(null)}),t.edges().unbind("mouseover"),t.edges().bind("mouseover",a=>{a.target.addClass("edge-hover")}),t.edges().unbind("mouseout"),t.edges().bind("mouseout",a=>{a.target.removeClass("edge-hover")}),t.edges().unbind("tap"),t.edges().bind("tap",a=>{if(!this.edgeContextMenuItems().length)return;const i=a.target,s=i.renderedMidpoint();this._edgeContextMenuLabel=i.data("label")??"",this._edgeContextMenuEdge={id:i.data("id"),iri:i.data("iri"),label:i.data("label"),source:i.data("source"),target:i.data("target"),color:i.data("color"),width:i.data("width")},this.edgeContextMenuPos.set({x:s.x,y:s.y}),this.edgeContextMenuVisible.set(!0),this.contextMenuVisible.set(!1)}),t.off("click"),t.on("click",a=>{0===Object.keys(a.target.data()).length&&(this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1),this.canvasClick.emit())}),t.off("viewport"),t.on("viewport",()=>{this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1)})}_onContextMenuAction(t){this.contextMenuVisible.set(!1),this._contextMenuNode&&this.contextMenuAction.emit({actionId:t,node:this._contextMenuNode})}_onEdgeContextMenuAction(t){this.edgeContextMenuVisible.set(!1),this.edgeContextMenuAction.emit({actionId:t,edgeLabel:this._edgeContextMenuLabel,edge:this._edgeContextMenuEdge})}_layoutOptions(){const t=this.layout();if("cose-bilkent"!==t)return{name:t};const n=this.elements().nodes,a=this.elements().edges,i=n.length>0?2*a.length/n.length:1,s=n.map(b=>{const w=[b.data.label||"",...b.data.boxLabels||[]].filter(Boolean);return Math.max(...w.map(C=>C.length),0)}),o=s.length>0?s.reduce((b,y)=>b+y,0)/s.length:0,l=s.length>0?Math.max(...s):0,c=1.5*o,d=.8*Math.max(0,l-20),f=7.2*i;return{name:"cose-bilkent",nodeDimensionsIncludeLabels:!0,randomize:!0,nodeRepulsion:Math.round(4500+500*i),idealEdgeLength:Math.round(48+c+d+f),edgeElasticity:.45,gravity:.25,gravityRange:3.8,numIter:2500}}_nodesHavePosition(){return void 0!==this.elements().nodes.find(n=>void 0!==n.position)}fitTo(t,n=80){const a=this._cy();if(!a||0===t.length)return;let i=a.collection();for(const s of t){const o=a.getElementById(s);o.length>0&&(i=i.union(o))}0!==i.length&&a.animate({fit:{eles:i,padding:n},duration:400,easing:"ease-in-out-cubic"})}_unDimAll(){const t=this._cy();t?.elements().forEach(n=>{n.removeClass("faded")})}_dimAllButNeighbors(t){const n=this._cy();if(null==n)return;const a=t.neighborhood().map(i=>i.id());n.elements().forEach(i=>{a.includes(i.id())||i.id()===t.id()?i.removeClass("faded"):i.addClass("faded")})}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=Ce.VBU({type:r,selectors:[["cue-simple-graph"]],viewQuery:function(n,a){if(1&n&&Ce.GBs(s0,5),2&n){let i;Ce.mGM(i=Ce.lsd())&&(a.graphContainer=i.first)}},inputs:{elements:[1,"elements"],animate:[1,"animate"],stopAnimationAfterFirstNodeHover:[1,"stopAnimationAfterFirstNodeHover"],layout:[1,"layout"],highlightNeighborsOnHover:[1,"highlightNeighborsOnHover"],userZoomingEnabled:[1,"userZoomingEnabled"],userPanningEnabled:[1,"userPanningEnabled"],appendHTMLLabels:[1,"appendHTMLLabels"],directed:[1,"directed"],labelPropsSettings:[1,"labelPropsSettings"],contextMenuItems:[1,"contextMenuItems"],edgeContextMenuItems:[1,"edgeContextMenuItems"]},outputs:{nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick",contextMenuAction:"contextMenuAction",edgeContextMenuAction:"edgeContextMenuAction"},decls:5,vars:3,consts:[["graphContainer",""],["id","graph","cueResized","",3,"resized"],[1,"node-props-overlay",3,"left","top"],[1,"cy-context-menu",3,"left","top"],[1,"node-props-overlay"],[1,"prop-row"],[1,"prop-key"],[1,"prop-value"],[1,"cy-context-menu"],[1,"cy-context-item"],[1,"cy-context-item",3,"mousedown","click"]],template:function(n,a){if(1&n&&(Ce.j41(0,"div",1,0),Ce.bIt("resized",function(){return a.onResize()}),Ce.nVh(2,u0,3,4,"div",2),Ce.nVh(3,d0,3,4,"div",3),Ce.nVh(4,h0,3,4,"div",3),Ce.k0s()),2&n){let i;Ce.R7$(2),Ce.vxM((i=a.hoverNodeOverlay())?2:-1,i),Ce.R7$(),Ce.vxM(a.contextMenuVisible()&&a.contextMenuItems().length>0?3:-1),Ce.R7$(),Ce.vxM(a.edgeContextMenuVisible()&&a.edgeContextMenuItems().length>0?4:-1)}},dependencies:[i0.C],styles:["[_nghost-%COMP%]{display:contents}#graph[_ngcontent-%COMP%]{display:block!important;text-align:left!important;margin:0!important;min-height:100px;flex:1 1;width:100%;position:relative;overflow:hidden} .box-label{position:absolute;pointer-events:none;display:flex;flex-direction:column;align-items:flex-start;gap:4px}.node-props-overlay[_ngcontent-%COMP%]{position:absolute;transform:translate(-50%,8px);z-index:20;pointer-events:none;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:var(--cue-menu-padding-y) var(--cue-menu-padding-x);display:flex;flex-direction:column;gap:8px;min-width:140px;max-width:260px}.prop-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.prop-key[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.6rem;font-weight:600;color:var(--cue-neutral);text-transform:uppercase;letter-spacing:.05em}.prop-value[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.72rem;color:var(--cue-menu-foreground-color);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.cy-context-menu[_ngcontent-%COMP%]{position:absolute;z-index:30;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:4px 0;min-width:160px;display:flex;flex-direction:column}.cy-context-item[_ngcontent-%COMP%]{background:none;border:none;padding:8px 16px;text-align:left;font-family:Poppins,sans-serif;font-size:.8rem;color:var(--cue-menu-foreground-color);cursor:pointer}.cy-context-item[_ngcontent-%COMP%]:hover{background:var(--cue-menu-hover-color, rgba(0, 0, 0, .06))}"],changeDetection:0})}return r})();const Of=["#2859e1","#4caf50","#fc2626","#f59e0b","#8b5cf6","#06b6d4","#f97316","#14b8a6","#ec4899","#6366f1"],vl="__collapser__",Xi="__chain__";var m0=Y(9134),b0=Y(6034),w0=Y(7517),x0=Y(6455),E0=Y(8334),Nn=Y(9352),T0=Y(5971),C0=Y(5448);function D0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-simple-graph",3),Ce.bIt("nodeHover",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onNodeHover(a))})("nodeClick",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onNodeClick(a))})("canvasClick",function(){E.eBV(t);const a=Ce.XpG();return E.Njj(a._onCanvasClick())})("contextMenuAction",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onContextMenuAction(a))})("edgeContextMenuAction",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onEdgeContextMenuAction(a))}),Ce.k0s()}if(2&r){const t=Ce.XpG();Ce.Y8G("elements",e)("labelPropsSettings",t.labelPropsSettings())("contextMenuItems",t._nodeMenuItems())("edgeContextMenuItems",t._edgeMenuItems())}}function S0(r,e){1&r&&Ce.EFF(0," No elements ")}function L0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-draggable-card",4),Ce.nI1(1,"transloco"),Ce.bIt("clickedClose",function(){E.eBV(t);const a=Ce.XpG();return E.Njj(a._tabbedLegendClosed.set(!0))}),Ce.j41(2,"cue-tabs",5)(3,"cue-tab",6),Ce.nI1(4,"transloco"),Ce.j41(5,"div",7)(6,"cue-layer-legend",8),Ce.bIt("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onCategoryVisibilityAll(a))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onCategoryLayerChange(a))}),Ce.k0s()()(),Ce.j41(7,"cue-tab",6),Ce.nI1(8,"transloco"),Ce.j41(9,"div",7)(10,"cue-layer-legend",8),Ce.bIt("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onPredicateVisibilityAll(a))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG();return E.Njj(i._onPredicateLayerChange(a))}),Ce.k0s()()()()()}if(2&r){const t=Ce.XpG();Ce.Y8G("label",Ce.bMT(1,7,"components.graph.rdf.legendTitle"))("padded",!1)("position",t.legendPosition()),Ce.R7$(3),Ce.Y8G("label",Ce.bMT(4,9,"components.graph.rdf.legendEntities")),Ce.R7$(3),Ce.Y8G("layers",t._categoryLayers()),Ce.R7$(),Ce.Y8G("label",Ce.bMT(8,11,"components.graph.rdf.legendRelationships")),Ce.R7$(3),Ce.Y8G("layers",t._predicateLayers())}}function A0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-color-legend-panel",10),Ce.nI1(1,"transloco"),Ce.bIt("close",function(){E.eBV(t);const a=Ce.XpG(2);return E.Njj(a._legendClosed.set(!0))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onCategoryLayerChange(a))})("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onCategoryVisibilityAll(a))}),Ce.k0s()}if(2&r){const t=Ce.XpG(2);Ce.Y8G("title",Ce.bMT(1,2,"components.graph.rdf.legendCategories"))("layers",t._categoryLayers())}}function I0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-button",13),Ce.bIt("click",function(){E.eBV(t);const a=Ce.XpG(3);return E.Njj(a._unhideAllPredicates())}),Ce.j41(1,"cue-button-label"),Ce.EFF(2),Ce.nI1(3,"transloco"),Ce.k0s()()}2&r&&(Ce.xc7("position","absolute")("top","2.5rem")("right","0.5rem"),Ce.R7$(2),Ce.JRh(Ce.bMT(3,7,"components.graph.rdf.labelUnhideEdges")))}function N0(r,e){if(1&r){const t=Ce.RV6();Ce.j41(0,"cue-color-legend-panel",11),Ce.nI1(1,"transloco"),Ce.bIt("close",function(){E.eBV(t);const a=Ce.XpG(2);return E.Njj(a._predicateLegendClosed.set(!0))})("layerChange",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onPredicateLayerChange(a))})("visibilityAll",function(a){E.eBV(t);const i=Ce.XpG(2);return E.Njj(i._onPredicateVisibilityAll(a))}),Ce.k0s(),Ce.nVh(2,I0,4,9,"cue-button",12)}if(2&r){const t=Ce.XpG(2);Ce.Y8G("title",Ce.bMT(1,4,"components.graph.rdf.legendRelationships"))("layers",t._predicateLayers())("position",t.legendPosition()),Ce.R7$(2),Ce.vxM(t._anyPredicateHidden()?2:-1)}}function R0(r,e){if(1&r&&(Ce.nVh(0,A0,2,4,"cue-color-legend-panel",9),Ce.nVh(1,N0,3,6)),2&r){const t=Ce.XpG();Ce.vxM(t.colorByCategory()&&t._categoryLayers().length>0&&!t._legendClosed()?0:-1),Ce.R7$(),Ce.vxM(t.showRelationshipLegend()&&t._predicateLayers().length>0&&!t._predicateLegendClosed()?1:-1)}}let M0=(()=>{class r{_graph=(0,M.ebz)(hl);doc=(0,M.hFB)();collapseClasses=(0,M.hFB)(!0);collapseAttributes=(0,M.hFB)(!0);collapseRelationships=(0,M.hFB)(!0);classPredicates=(0,M.hFB)([]);focusNodes=(0,M.hFB)([]);focusNodeColor=(0,M.hFB)("red");zoomToFocusNodes=(0,M.hFB)(!1);colorByCategory=(0,M.hFB)(!1);showRelationshipLegend=(0,M.hFB)(!1);legendPosition=(0,M.hFB)("top-left");tabbedLegend=(0,M.hFB)(!1);categoryLabelsOnHover=(0,M.hFB)(!0);nodeMenuItems=(0,M.hFB)(void 0);edgeMenuItems=(0,M.hFB)(void 0);nodeHover=(0,M.CGW)();nodeClick=(0,M.CGW)();canvasClick=(0,M.CGW)();_fullElements=null;_collapserGroups=[];_chainGroups=[];_focusedNodeId=void 0;_hiddenNodeIds=new Set;_categoryColors=new Map;_labelFocusOnNeighbours=(0,Nn.Xx)("components.graph.rdf.labelFocusOnNeighbours");_labelUnhideEdges=(0,Nn.Xx)("components.graph.rdf.labelUnhideEdges");_labelHideEdgeType=(0,Nn.Xx)("components.graph.rdf.labelHideEdgeType");_labelCollapseRelationship=(0,Nn.Xx)("components.graph.rdf.labelCollapseRelationship");_labelExpandMore=(0,Nn.Xx)("components.graph.rdf.labelExpandMore");_labelCollapseExpanded=(0,Nn.Xx)("components.graph.rdf.labelCollapseExpanded");_hoveredNode=(0,E.vPA)(null);_nodeMenuItems=(0,T.EW)(()=>{const t=this.nodeMenuItems();if(void 0!==t)return t;const n=this._hoveredNode()?.id,a=!!n&&this._collapserGroups.some(d=>d.allTargetNodeIds.includes(n)),i=n?this._collapserGroups.find(d=>d.id===n):void 0,s=!!i&&i.visibleCount>0,o=!!i&&i.visibleCount<i.allTargetNodeIds.length,l=n?this._chainGroups.find(d=>d.id===n):void 0,u=!!l&&l.visibleCount>0,c=!!l&&l.visibleCount<l.hiddenNodeIds.length;return[{id:"focus",label:this._labelFocusOnNeighbours()},{id:"unhide-edges",label:this._labelUnhideEdges()},...o||c?[{id:"expand-more",label:this._labelExpandMore()}]:[],...s||u?[{id:"collapse-expanded",label:this._labelCollapseExpanded()}]:[],...a?[{id:"collapse-relationship",label:this._labelCollapseRelationship()}]:[]]});_edgeMenuItems=(0,T.EW)(()=>{const t=this.edgeMenuItems();return void 0!==t?t:[{id:"hide-edge-type",label:this._labelHideEdgeType()}]});elements=(0,E.vPA)(void 0);_categoryLayers=(0,E.vPA)([]);_legendClosed=(0,E.vPA)(!1);_predicateLayers=(0,E.vPA)([]);_predicateLegendClosed=(0,E.vPA)(!1);_nodeLayers=(0,E.vPA)([]);_tabbedLegendClosed=(0,E.vPA)(!1);_anyPredicateHidden=(0,T.EW)(()=>this._predicateLayers().some(t=>!t.visible));_unhideAllPredicates(){this._predicateLayers.update(t=>t.map(n=>({...n,visible:!0}))),this.elements.set(this._display())}onDoc=(0,E.QZP)((()=>{var t=this;return(0,W.A)(function*(){const n=t.doc();if(void 0===n)return;const a=new I;a.hideClassAssignmentTriples=t.collapseClasses(),a.hideDatatypePropertyTriples=t.collapseAttributes(),a.collapseIntoClassificationLabels=t.classPredicates();const i=new D(n,a);let s;try{s=yield i.init(),console.log("[rdf-graph onDoc] elements:",s.nodes.length,"nodes,",s.edges.length,"edges")}catch(l){return void console.error("[rdf-graph onDoc] CytoscapeJSONLD.init() threw:",l)}t._fullElements=s,t._collapserGroups=t.collapseRelationships()?function g0(r){const e=new Map,t=new Map;for(const i of r.edges)i.data.target&&e.set(i.data.target,(e.get(i.data.target)??0)+1),i.data.source&&t.set(i.data.source,(t.get(i.data.source)??0)+1);const n=new Map;for(const i of r.edges){const s=`${i.data.source}\0${i.data.label}`;n.has(s)||n.set(s,[]),n.get(s).push(i)}const a=[];for(const[i,s]of n){if(s.length<4)continue;const o=i.indexOf("\0"),l=i.slice(0,o),u=i.slice(o+1),c=s.map(d=>d.data.target).filter(d=>d&&1===(e.get(d)??0)&&0===(t.get(d)??0));c.length<4||a.push({id:`${vl}${l}\0${u}`,sourceId:l,predicateLabel:u,allTargetNodeIds:c,visibleCount:0})}return a}(s):[],t._chainGroups=function p0(r){const e=new Map,t=new Map;for(const u of r.nodes)e.set(u.data.id,[]),t.set(u.data.id,[]);for(const u of r.edges)e.get(u.data.source)?.push(u),u.data.target&&t.get(u.data.target)?.push(u);const n=new Map,a=(u,c=new Set)=>{if(n.has(u))return n.get(u);if(c.has(u))return 0;c.add(u);const h=1+(e.get(u)??[]).reduce((v,b)=>Math.max(v,b.data.target?a(b.data.target,c):0),0);return n.set(u,h),h};for(const u of r.nodes)a(u.data.id);const i=new Set,s=[...r.nodes].sort((u,c)=>(n.get(c.data.id)??0)-(n.get(u.data.id)??0));for(const u of s){if(i.size>=20)break;let c=u.data.id;for(;c&&!i.has(c)&&i.size<20;)i.add(c),c=(e.get(c)??[]).filter(f=>f.data.target&&!i.has(f.data.target)).sort((f,h)=>(n.get(h.data.target)??0)-(n.get(f.data.target)??0))[0]?.data.target}const o=new Set(r.nodes.map(u=>u.data.id).filter(u=>!i.has(u)));if(0===o.size)return[];const l=new Map;for(const u of i)for(const c of e.get(u)??[]){if(!c.data.target||!o.has(c.data.target))continue;const d=`${u}\0${c.data.label??""}`;l.has(d)||l.set(d,{id:`${Xi}${u}\0${c.data.label??""}`,sourceId:u,predicateLabel:c.data.label??"",hiddenNodeIds:[],visibleCount:0});const f=l.get(d);let h=c.data.target;for(;h&&o.has(h)&&!f.hiddenNodeIds.includes(h);)f.hiddenNodeIds.push(h),o.delete(h),h=(e.get(h)??[]).filter(b=>b.data.target&&o.has(b.data.target)).sort((b,y)=>(n.get(y.data.target)??0)-(n.get(b.data.target)??0))[0]?.data.target}return o.size>0&&l.set("__orphan__",{id:`${Xi}__orphan__`,sourceId:s[0]?.data.id??"",predicateLabel:"",hiddenNodeIds:[...o],visibleCount:0}),[...l.values()].filter(u=>u.hiddenNodeIds.length>0)}(s),t._categoryLayers.set(t._buildCategoryLayers(s)),t._predicateLayers.set(t._buildPredicateLayers(s)),t._nodeLayers.set(t._buildNodeLayers(s)),t._hiddenNodeIds.clear(),t._legendClosed.set(!1),t._predicateLegendClosed.set(!1),t._tabbedLegendClosed.set(!1),t.elements.set(t._display());const o=t.focusNodes();o.length>0&&t.zoomToFocusNodes()&&setTimeout(()=>t._graph()?.fitTo(o),450)})})());focusEffect=(0,E.QZP)(()=>{const t=this.focusNodes();this._fullElements&&(this.elements.set(this._display()),t.length>0&&this.zoomToFocusNodes()&&setTimeout(()=>this._graph()?.fitTo(t),200))});triggerResize(){const t=this._graph();if(t){const n=t._cy();n.resize(),setTimeout(()=>{const a=n.container(),i=a?.offsetWidth||0,s=a?.offsetHeight||0;if(i>=100&&s>=100){n.resize();const o=n.elements();if(o.length>0){const l=o.nodes();if(!(l.length>0&&l.every(Z=>{const K=Z.position();return 0!==K.x||0!==K.y}))){const Z=this._graph();return void(Z&&Z._build?.())}const c=Math.min(i,s),d=Math.min(Math.max(.15*c,40),120),f=o.boundingBox(),C=Math.min((i-2*d)/(f.w||1),(s-2*d)/(f.h||1)),N=o.nodes().length,z=o.edges().length,V=N>0?2*z/N:1;let F=2.5;V>10?F=1:V>6?F=1.5:V>3&&(F=2);const q=Math.min(Math.max(C,.2),F);n.animate(q!==C?{zoom:q,center:{eles:o},duration:300}:{fit:{eles:o,padding:d},duration:300})}}else console.warn("\u{1f3af} RDFGraph: container too small or invalid dimensions, skipping fit")},150)}}colorByCategoryEffect=(0,E.QZP)(()=>{this.colorByCategory()&&this._legendClosed.set(!1),this._fullElements&&this.elements.set(this._display())});showRelationshipLegendEffect=(0,E.QZP)(()=>{this.showRelationshipLegend()&&this._predicateLegendClosed.set(!1)});labelPropsSettings=(0,T.EW)(()=>{const t=new G;return t.boxLabels.display=this.collapseClasses(),t.props.display=this.collapseAttributes(),t.boxLabels.displayOnlyOnHover=this.colorByCategory()||this.categoryLabelsOnHover(),t});_onNodeHover(t){t&&this._hoveredNode.set(t),this.nodeHover.emit(t)}_onNodeClick(t){const n=t;if(n.isCollapser&&n.collapserGroupId){const a=this._collapserGroups.find(i=>i.id===n.collapserGroupId);if(a){const i=Math.min(a.visibleCount+5,a.allTargetNodeIds.length);return void(i!==a.visibleCount&&(a.visibleCount=i,this.elements.set(this._display())))}}if(n.isChainExpander&&n.chainGroupId){const a=this._chainGroups.find(i=>i.id===n.chainGroupId);if(a){const i=Math.min(a.visibleCount+5,a.hiddenNodeIds.length);return void(i!==a.visibleCount&&(a.visibleCount=i,this.elements.set(this._display())))}}this.nodeClick.emit(t)}_onCanvasClick(){this.canvasClick.emit(),this._focusedNodeId&&(this._focusedNodeId=void 0,this.elements.set(this._display()))}_onContextMenuAction(t){const n=this.nodeMenuItems();if(void 0===n){if("focus"===t.actionId){const a=t.node.id;this._focusedNodeId=this._focusedNodeId===a?void 0:a,this.elements.set(this._display())}else if("unhide-edges"===t.actionId)this._unhideAllPredicates();else if("expand-more"===t.actionId){const a=t.node.id,i=this._collapserGroups.find(o=>o.id===a);i&&(i.visibleCount=Math.min(i.visibleCount+5,i.allTargetNodeIds.length));const s=this._chainGroups.find(o=>o.id===a);s&&(s.visibleCount=Math.min(s.visibleCount+5,s.hiddenNodeIds.length)),this.elements.set(this._display())}else if("collapse-expanded"===t.actionId){const a=t.node.id,i=this._collapserGroups.find(o=>o.id===a);i&&(i.visibleCount=0);const s=this._chainGroups.find(o=>o.id===a);s&&(s.visibleCount=0),this.elements.set(this._display())}else if("collapse-relationship"===t.actionId){const a=t.node.id;for(const i of this._collapserGroups)i.allTargetNodeIds.includes(a)&&(i.visibleCount=0);this.elements.set(this._display())}}else n.find(a=>a.id===t.actionId)?.action(t.node)}_onEdgeContextMenuAction(t){const n=this.edgeMenuItems();void 0===n?"hide-edge-type"===t.actionId&&(this._predicateLayers.update(a=>a.map(i=>i.label===t.edgeLabel?{...i,visible:!1}:i)),this.elements.set(this._display())):n.find(a=>a.id===t.actionId)?.action(t.edge)}_onCategoryLayerChange(t){this._categoryLayers.update(n=>[...n]),this.elements.set(this._display())}_onCategoryVisibilityAll(t){this._categoryLayers.update(n=>[...n]),this.elements.set(this._display())}_onPredicateLayerChange(t){this._predicateLayers.update(n=>[...n]),this.elements.set(this._display())}_onPredicateVisibilityAll(t){this._predicateLayers.update(n=>[...n]),this.elements.set(this._display())}_onNodeLayerChange(t){this._syncHiddenNodeIds(),this._nodeLayers.update(n=>[...n]),this.elements.set(this._display())}_onNodeVisibilityAll(t){this._syncHiddenNodeIds(),this._nodeLayers.update(n=>[...n]),this.elements.set(this._display())}_syncHiddenNodeIds(){this._hiddenNodeIds.clear();for(const t of this._nodeLayers())t.visible||this._hiddenNodeIds.add(t.label)}static _PREDICATE_COLOR="#4a90d9";_buildPredicateLayers(t){const n=new Set,a=[];for(const i of t.edges){const s=i.data.label??"";s&&!n.has(s)&&(n.add(s),a.push(s))}return a.map(i=>({label:i,color:r._PREDICATE_COLOR,visible:!0}))}_buildCategoryLayers(t){const n=new Set,a=[];for(const i of t.nodes){if(i.data.id.startsWith(vl)||i.data.id.startsWith(Xi))continue;const s=i.data.boxLabels?.[0];s&&!n.has(s)&&(n.add(s),a.push(s))}return this._categoryColors=function v0(r){const e=new Map;return r.forEach((t,n)=>{e.set(t,Of[n%Of.length])}),e}(a),a.map(i=>({label:i,color:this._categoryColors.get(i),visible:!0}))}_buildNodeLayers(t){const n=new Set,a=[];for(const i of t.nodes){if(i.data.id.startsWith(vl)||i.data.id.startsWith(Xi))continue;const s=i.data.label||i.data.id,o=i.data.boxLabels?.[0],l=o?this._categoryColors.get(o):void 0;s&&!n.has(s)&&(n.add(s),a.push({label:s,color:l,visible:!0}))}return a.sort((i,s)=>i.label.localeCompare(s.label))}_display(){if(!this._fullElements)return{nodes:[],edges:[]};let t=function y0(r,e,t){const n=new Set,a=new Set,i=[],s=[];for(const l of t){const u=l.hiddenNodeIds.length-l.visibleCount;if(u<=0)continue;for(const f of l.hiddenNodeIds.slice(l.visibleCount))n.add(f);const c=l.visibleCount>0,d=c?l.hiddenNodeIds[l.visibleCount-1]:l.sourceId;i.push({data:{id:l.id,label:`+${u}`,size:28,isChainExpander:!0,isExpanded:c,chainGroupId:l.id},classes:c?"collapser collapser-expanded":"collapser"}),s.push({data:{id:`edge_${l.id}`,source:d,target:l.id,label:l.predicateLabel}})}for(const l of e){const u=l.allTargetNodeIds.length-l.visibleCount;if(u<=0)continue;for(const f of l.allTargetNodeIds.slice(l.visibleCount))n.add(f);const c=r.edges.filter(f=>f.data.source===l.sourceId&&f.data.label===l.predicateLabel&&l.allTargetNodeIds.includes(f.data.target));for(const f of c)a.add(f.data.id??"");for(const f of c)l.allTargetNodeIds.indexOf(f.data.target)<l.visibleCount&&s.push(f);const d=l.visibleCount>0;i.push({data:{id:l.id,label:`+${u}`,size:28,isCollapser:!0,isExpanded:d,collapserGroupId:l.id},classes:d?"collapser collapser-expanded":"collapser"}),s.push({data:{id:`edge_${l.id}`,source:l.sourceId,target:l.id,label:l.predicateLabel}})}const o=new Set(i.map(l=>l.data.id));return{nodes:[...r.nodes.filter(l=>!n.has(l.data.id)),...i],edges:[...r.edges.filter(l=>!(a.has(l.data.id??"")||n.has(l.data.source)||n.has(l.data.target??"")||o.has(l.data.source)||o.has(l.data.target??""))),...s]}}(this._fullElements,this._collapserGroups,this._chainGroups);const n=new Set(this._predicateLayers().filter(s=>!s.visible).map(s=>s.label));if(n.size>0){const s=t.edges.filter(l=>!n.has(l.data.label??"")),o=new Set;for(const l of s)o.add(l.data.source),o.add(l.data.target);t={nodes:t.nodes.filter(l=>o.has(l.data.id)),edges:s}}if(this._hiddenNodeIds.size>0){const s=new Set(t.nodes.filter(o=>this._hiddenNodeIds.has(o.data.label||o.data.id)).map(o=>o.data.id));s.size>0&&(t={nodes:t.nodes.filter(o=>!s.has(o.data.id)),edges:t.edges.filter(o=>!s.has(o.data.source)&&!s.has(o.data.target))})}if(this.colorByCategory()){const s=new Set(this._categoryLayers().filter(o=>!o.visible).map(o=>o.label));if(s.size>0){const o=new Map(this._fullElements.nodes.map(c=>[c.data.id,c.data.boxLabels?.[0]])),l=c=>{const d=o.get(c);return void 0!==d&&s.has(d)},u=new Set(t.nodes.filter(c=>{const d=c.data.boxLabels?.[0];return void 0!==d&&s.has(d)}).map(c=>c.data.id));for(const c of this._collapserGroups)c.allTargetNodeIds.every(l)&&u.add(c.id);for(const c of this._chainGroups){const d=c.hiddenNodeIds.slice(c.visibleCount);d.length>0&&d.every(l)&&u.add(c.id)}t={nodes:t.nodes.filter(c=>!u.has(c.data.id)),edges:t.edges.filter(c=>!u.has(c.data.source)&&!u.has(c.data.target))}}t={...t,nodes:t.nodes.map(o=>{const l=o.data.boxLabels?.[0],u=l?this._categoryColors.get(l):void 0;return u?{...o,data:{...o.data,color:u}}:o})}}this._focusedNodeId&&(t=this._applyFocus(t,this._focusedNodeId));const a=new Set(this.focusNodes()),i=this.focusNodeColor();return a.size>0&&(t={...t,nodes:t.nodes.map(s=>{if(!a.has(s.data.id))return s;const o=s.classes?s.classes.trim():"";return{...s,data:{...s.data,color:i},classes:o?`${o} focused`:"focused"}})}),t}_applyFocus(t,n){return{...t,nodes:t.nodes.map(a=>{if(a.data.id!==n)return a;const i=a.classes?a.classes.trim():"";return{...a,classes:i?`${i} focused`:"focused"}})}}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=Ce.VBU({type:r,selectors:[["cue-rdf-graph"]],viewQuery:function(n,a){1&n&&Ce.wEZ(a._graph,hl,5),2&n&&Ce.NyB()},inputs:{doc:[1,"doc"],collapseClasses:[1,"collapseClasses"],collapseAttributes:[1,"collapseAttributes"],collapseRelationships:[1,"collapseRelationships"],classPredicates:[1,"classPredicates"],focusNodes:[1,"focusNodes"],focusNodeColor:[1,"focusNodeColor"],zoomToFocusNodes:[1,"zoomToFocusNodes"],colorByCategory:[1,"colorByCategory"],showRelationshipLegend:[1,"showRelationshipLegend"],legendPosition:[1,"legendPosition"],tabbedLegend:[1,"tabbedLegend"],categoryLabelsOnHover:[1,"categoryLabelsOnHover"],nodeMenuItems:[1,"nodeMenuItems"],edgeMenuItems:[1,"edgeMenuItems"]},outputs:{nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick"},decls:5,vars:2,consts:[[2,"display","flex","flex-direction","column","position","relative","width","100%","flex","1","min-height","0"],[3,"elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems"],[3,"label","padded","position"],[3,"nodeHover","nodeClick","canvasClick","contextMenuAction","edgeContextMenuAction","elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems"],[3,"clickedClose","label","padded","position"],[1,"legend-tabs"],[3,"label"],[1,"legend-content"],[3,"visibilityAll","layerChange","layers"],["position","top-right",3,"title","layers"],["position","top-right",3,"close","layerChange","visibilityAll","title","layers"],[3,"close","layerChange","visibilityAll","title","layers","position"],["variant","ghost","size","s",1,"unhide-btn",3,"position","top","right"],["variant","ghost","size","s",1,"unhide-btn",3,"click"]],template:function(n,a){if(1&n&&(Ce.j41(0,"div",0),Ce.nVh(1,D0,1,4,"cue-simple-graph",1)(2,S0,1,0),Ce.nVh(3,L0,11,13,"cue-draggable-card",2)(4,R0,2,2),Ce.k0s()),2&n){let i;Ce.R7$(),Ce.vxM((i=a.elements())?1:2,i),Ce.R7$(2),Ce.vxM(a.tabbedLegend()&&!a._tabbedLegendClosed()?3:4)}},dependencies:[hl,m0.v,b0.y,w0.P,x0.t,E0.o,T0.Button,C0.ButtonLabel,Nn.Kj],styles:["[_nghost-%COMP%]{display:contents}.legend-tabs[_ngcontent-%COMP%]{width:180px}.legend-content[_ngcontent-%COMP%]{padding:4px 10px 24px;font-size:.8em;max-height:200px;overflow:auto}"],changeDetection:0})}return r})()},2065(Ze,Ne,Y){"use strict";function E(p,x,m="text/plain"){return function W(p,x="data.zip"){const m=document.createElement("a"),A=URL.createObjectURL(p);m.href=A,m.download=x,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(A)}(new Blob([p],{type:m}),x)}function T(p,x){const m=document.createElement("a");m.style.display="hidden",m.setAttribute("href",window.URL.createObjectURL(p)),m.setAttribute("download",x),document.body.appendChild(m),m.click(),m.remove()}Y.d(Ne,{KE:()=>T,YN:()=>E})},7573(Ze,Ne,Y){"use strict";Y.d(Ne,{E:()=>W});const W={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"}},8846(Ze){"use strict";Ze.exports=function Ne(Y){return null===Y||"object"!=typeof Y||null!=Y.toJSON?JSON.stringify(Y):Array.isArray(Y)?"["+Y.reduce((W,M,E)=>W+(0===E?"":",")+Ne(void 0===M||"symbol"==typeof M?null:M),"")+"]":"{"+Object.keys(Y).sort().reduce((W,M,E)=>void 0===Y[M]||"symbol"==typeof Y[M]?W:W+(0===W.length?"":",")+Ne(M)+":"+Ne(Y[M]),"")+"}"}},1692(Ze,Ne,Y){var W;Ze.exports=(W=Y(6556),function(M){var E={};function T(I){if(E[I])return E[I].exports;var p=E[I]={i:I,l:!1,exports:{}};return M[I].call(p.exports,p,p.exports,T),p.l=!0,p.exports}return T.m=M,T.c=E,T.i=function(I){return I},T.d=function(I,p,x){T.o(I,p)||Object.defineProperty(I,p,{configurable:!1,enumerable:!0,get:x})},T.n=function(I){var p=I&&I.__esModule?function(){return I.default}:function(){return I};return T.d(p,"a",p),p},T.o=function(I,p){return Object.prototype.hasOwnProperty.call(I,p)},T.p="",T(T.s=7)}([function(M,E){M.exports=W},function(M,E,T){"use strict";var I=T(0).FDLayoutConstants;function p(){}for(var x in I)p[x]=I[x];p.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,p.DEFAULT_RADIAL_SEPARATION=I.DEFAULT_EDGE_LENGTH,p.DEFAULT_COMPONENT_SEPERATION=60,p.TILE=!0,p.TILING_PADDING_VERTICAL=10,p.TILING_PADDING_HORIZONTAL=10,p.TREE_REDUCTION_ON_INCREMENTAL=!1,M.exports=p},function(M,E,T){"use strict";var I=T(0).FDLayoutEdge;function p(m,A,D){I.call(this,m,A,D)}for(var x in p.prototype=Object.create(I.prototype),I)p[x]=I[x];M.exports=p},function(M,E,T){"use strict";var I=T(0).LGraph;function p(m,A,D){I.call(this,m,A,D)}for(var x in p.prototype=Object.create(I.prototype),I)p[x]=I[x];M.exports=p},function(M,E,T){"use strict";var I=T(0).LGraphManager;function p(m){I.call(this,m)}for(var x in p.prototype=Object.create(I.prototype),I)p[x]=I[x];M.exports=p},function(M,E,T){"use strict";var I=T(0).FDLayoutNode,p=T(0).IMath;function x(A,D,k,G){I.call(this,A,D,k,G)}for(var m in x.prototype=Object.create(I.prototype),I)x[m]=I[m];x.prototype.move=function(){var A=this.graphManager.getLayout();this.displacementX=A.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=A.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>A.coolingFactor*A.maxNodeDisplacement&&(this.displacementX=A.coolingFactor*A.maxNodeDisplacement*p.sign(this.displacementX)),Math.abs(this.displacementY)>A.coolingFactor*A.maxNodeDisplacement&&(this.displacementY=A.coolingFactor*A.maxNodeDisplacement*p.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),A.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},x.prototype.propogateDisplacementToChildren=function(A,D){for(var G,k=this.getChild().getNodes(),P=0;P<k.length;P++)null==(G=k[P]).getChild()?(G.moveBy(A,D),G.displacementX+=A,G.displacementY+=D):G.propogateDisplacementToChildren(A,D)},x.prototype.setPred1=function(A){this.pred1=A},x.prototype.getPred1=function(){return pred1},x.prototype.getPred2=function(){return pred2},x.prototype.setNext=function(A){this.next=A},x.prototype.getNext=function(){return next},x.prototype.setProcessed=function(A){this.processed=A},x.prototype.isProcessed=function(){return processed},M.exports=x},function(M,E,T){"use strict";var I=T(0).FDLayout,p=T(4),x=T(3),m=T(5),A=T(2),D=T(1),k=T(0).FDLayoutConstants,G=T(0).LayoutConstants,P=T(0).Point,O=T(0).PointD,$=T(0).Layout,B=T(0).Integer,re=T(0).IGeometry,j=T(0).LGraph,xe=T(0).Transform;function ne(){I.call(this),this.toBeTiled={}}for(var R in ne.prototype=Object.create(I.prototype),I)ne[R]=I[R];ne.prototype.newGraphManager=function(){var S=new p(this);return this.graphManager=S,S},ne.prototype.newGraph=function(S){return new x(null,this.graphManager,S)},ne.prototype.newNode=function(S){return new m(this.graphManager,S)},ne.prototype.newEdge=function(S){return new A(null,null,S)},ne.prototype.initParameters=function(){I.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=D.DEFAULT_EDGE_LENGTH<10?10:D.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=D.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=k.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=k.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=k.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=k.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=k.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=k.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/k.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=k.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},ne.prototype.layout=function(){return G.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},ne.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(D.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var L=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(H){return L.has(H)});this.graphManager.setAllNodesToApplyGravitation(_)}}else{var S=this.getFlatForest();S.length>0?this.positionNodesRadially(S):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),L=new Set(this.getAllNodes()),_=this.nodesWithGravity.filter(function(ee){return L.has(ee)}),this.graphManager.setAllNodesToApplyGravitation(_),this.positionNodesRandomly())}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},ne.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%k.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var S=new Set(this.getAllNodes()),L=this.nodesWithGravity.filter(function(ie){return S.has(ie)});this.graphManager.setAllNodesToApplyGravitation(L),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=k.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var _=!this.isTreeGrowing&&!this.isGrowthFinished,ee=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(_,ee),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},ne.prototype.getPositionsData=function(){for(var S=this.graphManager.getAllNodes(),L={},_=0;_<S.length;_++){var ee=S[_].rect,ie=S[_].id;L[ie]={id:ie,x:ee.getCenterX(),y:ee.getCenterY(),w:ee.width,h:ee.height}}return L},ne.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var S=!1;if("during"===k.ANIMATE)this.emit("layoutstarted");else{for(;!S;)S=this.tick();this.graphManager.updateBounds()}},ne.prototype.calculateNodesToApplyGravitationTo=function(){var L,ie,S=[],_=this.graphManager.getGraphs(),ee=_.length;for(ie=0;ie<ee;ie++)(L=_[ie]).updateConnected(),L.isConnected||(S=S.concat(L.getNodes()));return S},ne.prototype.createBendpoints=function(){var S=[];S=S.concat(this.graphManager.getAllEdges());var _,L=new Set;for(_=0;_<S.length;_++){var ee=S[_];if(!L.has(ee)){var ie=ee.getSource(),H=ee.getTarget();if(ie==H)ee.getBendpoints().push(new O),ee.getBendpoints().push(new O),this.createDummyNodesForBendpoints(ee),L.add(ee);else{var ae=[];if(ae=(ae=ae.concat(ie.getEdgeListToNode(H))).concat(H.getEdgeListToNode(ie)),!L.has(ae[0])){var me;if(ae.length>1)for(me=0;me<ae.length;me++){var ve=ae[me];ve.getBendpoints().push(new O),this.createDummyNodesForBendpoints(ve)}ae.forEach(function(Ee){L.add(Ee)})}}}if(L.size==S.length)break}},ne.prototype.positionNodesRadially=function(S){for(var L=new P(0,0),_=Math.ceil(Math.sqrt(S.length)),ee=0,ie=0,H=0,ae=new O(0,0),me=0;me<S.length;me++){me%_==0&&(H=0,ie=ee,0!=me&&(ie+=D.DEFAULT_COMPONENT_SEPERATION),ee=0);var ve=S[me],Ee=$.findCenterOfTree(ve);L.x=H,L.y=ie,(ae=ne.radialLayout(ve,Ee,L)).y>ee&&(ee=Math.floor(ae.y)),H=Math.floor(ae.x+D.DEFAULT_COMPONENT_SEPERATION)}this.transform(new O(G.WORLD_CENTER_X-ae.x/2,G.WORLD_CENTER_Y-ae.y/2))},ne.radialLayout=function(S,L,_){var ee=Math.max(this.maxDiagonalInTree(S),D.DEFAULT_RADIAL_SEPARATION);ne.branchRadialLayout(L,null,0,359,0,ee);var ie=j.calculateBounds(S),H=new xe;H.setDeviceOrgX(ie.getMinX()),H.setDeviceOrgY(ie.getMinY()),H.setWorldOrgX(_.x),H.setWorldOrgY(_.y);for(var ae=0;ae<S.length;ae++)S[ae].transform(H);var ve=new O(ie.getMaxX(),ie.getMaxY());return H.inverseTransformPoint(ve)},ne.branchRadialLayout=function(S,L,_,ee,ie,H){var ae=(ee-_+1)/2;ae<0&&(ae+=180);var ve=(ae+_)%360*re.TWO_PI/360,Ge=(Math.cos(ve),ie*Math.cos(ve)),fe=ie*Math.sin(ve);S.setCenter(Ge,fe);var te=[],ce=(te=te.concat(S.getEdges())).length;null!=L&&ce--;for(var se,Me=0,pe=te.length,Re=S.getEdgesBetween(L);Re.length>1;){var Je=Re[0];Re.splice(0,1);var qe=te.indexOf(Je);qe>=0&&te.splice(qe,1),pe--,ce--}se=null!=L?(te.indexOf(Re[0])+1)%pe:0;for(var et=Math.abs(ee-_)/ce,ke=se;Me!=ce;ke=++ke%pe){var We=te[ke].getOtherEnd(S);if(We!=L){var we=(_+Me*et)%360;ne.branchRadialLayout(We,S,we,(we+et)%360,ie+H,H),Me++}}},ne.maxDiagonalInTree=function(S){for(var L=B.MIN_VALUE,_=0;_<S.length;_++){var ie=S[_].getDiagonal();ie>L&&(L=ie)}return L},ne.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},ne.prototype.groupZeroDegreeMembers=function(){var S=this,L={};this.memberGroups={},this.idToDummyNode={};for(var _=[],ee=this.graphManager.getAllNodes(),ie=0;ie<ee.length;ie++){var ae=(H=ee[ie]).getParent();0===this.getNodeDegreeWithChildren(H)&&(null==ae.id||!this.getToBeTiled(ae))&&_.push(H)}for(ie=0;ie<_.length;ie++){var H,me=(H=_[ie]).getParent().id;typeof L[me]>"u"&&(L[me]=[]),L[me]=L[me].concat(H)}Object.keys(L).forEach(function(ve){if(L[ve].length>1){var Ee="DummyCompound_"+ve;S.memberGroups[Ee]=L[ve];var Ge=L[ve][0].getParent(),fe=new m(S.graphManager);fe.id=Ee,fe.paddingLeft=Ge.paddingLeft||0,fe.paddingRight=Ge.paddingRight||0,fe.paddingBottom=Ge.paddingBottom||0,fe.paddingTop=Ge.paddingTop||0,S.idToDummyNode[Ee]=fe;var te=S.getGraphManager().add(S.newGraph(),fe),ce=Ge.getChild();ce.add(fe);for(var Me=0;Me<L[ve].length;Me++){var pe=L[ve][Me];ce.remove(pe),te.add(pe)}}})},ne.prototype.clearCompounds=function(){var S={},L={};this.performDFSOnCompounds();for(var _=0;_<this.compoundOrder.length;_++)L[this.compoundOrder[_].id]=this.compoundOrder[_],S[this.compoundOrder[_].id]=[].concat(this.compoundOrder[_].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[_].getChild()),this.compoundOrder[_].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(S,L)},ne.prototype.clearZeroDegreeMembers=function(){var S=this,L=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(_){var ee=S.idToDummyNode[_];L[_]=S.tileNodes(S.memberGroups[_],ee.paddingLeft+ee.paddingRight),ee.rect.width=L[_].width,ee.rect.height=L[_].height})},ne.prototype.repopulateCompounds=function(){for(var S=this.compoundOrder.length-1;S>=0;S--){var L=this.compoundOrder[S];this.adjustLocations(this.tiledMemberPack[L.id],L.rect.x,L.rect.y,L.paddingLeft,L.paddingTop)}},ne.prototype.repopulateZeroDegreeMembers=function(){var S=this,L=this.tiledZeroDegreePack;Object.keys(L).forEach(function(_){var ee=S.idToDummyNode[_];S.adjustLocations(L[_],ee.rect.x,ee.rect.y,ee.paddingLeft,ee.paddingTop)})},ne.prototype.getToBeTiled=function(S){var L=S.id;if(null!=this.toBeTiled[L])return this.toBeTiled[L];var _=S.getChild();if(null==_)return this.toBeTiled[L]=!1,!1;for(var ee=_.getNodes(),ie=0;ie<ee.length;ie++){var H=ee[ie];if(this.getNodeDegree(H)>0)return this.toBeTiled[L]=!1,!1;if(null!=H.getChild()){if(!this.getToBeTiled(H))return this.toBeTiled[L]=!1,!1}else this.toBeTiled[H.id]=!1}return this.toBeTiled[L]=!0,!0},ne.prototype.getNodeDegree=function(S){for(var _=S.getEdges(),ee=0,ie=0;ie<_.length;ie++){var H=_[ie];H.getSource().id!==H.getTarget().id&&(ee+=1)}return ee},ne.prototype.getNodeDegreeWithChildren=function(S){var L=this.getNodeDegree(S);if(null==S.getChild())return L;for(var _=S.getChild().getNodes(),ee=0;ee<_.length;ee++)L+=this.getNodeDegreeWithChildren(_[ee]);return L},ne.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},ne.prototype.fillCompexOrderByDFS=function(S){for(var L=0;L<S.length;L++){var _=S[L];null!=_.getChild()&&this.fillCompexOrderByDFS(_.getChild().getNodes()),this.getToBeTiled(_)&&this.compoundOrder.push(_)}},ne.prototype.adjustLocations=function(S,L,_,ee,ie){_+=ie;for(var H=L+=ee,ae=0;ae<S.rows.length;ae++){var me=S.rows[ae];L=H;for(var ve=0,Ee=0;Ee<me.length;Ee++){var Ge=me[Ee];Ge.rect.x=L,Ge.rect.y=_,L+=Ge.rect.width+S.horizontalPadding,Ge.rect.height>ve&&(ve=Ge.rect.height)}_+=ve+S.verticalPadding}},ne.prototype.tileCompoundMembers=function(S,L){var _=this;this.tiledMemberPack=[],Object.keys(S).forEach(function(ee){var ie=L[ee];_.tiledMemberPack[ee]=_.tileNodes(S[ee],ie.paddingLeft+ie.paddingRight),ie.rect.width=_.tiledMemberPack[ee].width,ie.rect.height=_.tiledMemberPack[ee].height})},ne.prototype.tileNodes=function(S,L){var ie={rows:[],rowWidth:[],rowHeight:[],width:0,height:L,verticalPadding:D.TILING_PADDING_VERTICAL,horizontalPadding:D.TILING_PADDING_HORIZONTAL};S.sort(function(me,ve){return me.rect.width*me.rect.height>ve.rect.width*ve.rect.height?-1:me.rect.width*me.rect.height<ve.rect.width*ve.rect.height?1:0});for(var H=0;H<S.length;H++){var ae=S[H];0==ie.rows.length?this.insertNodeToRow(ie,ae,0,L):this.canAddHorizontal(ie,ae.rect.width,ae.rect.height)?this.insertNodeToRow(ie,ae,this.getShortestRowIndex(ie),L):this.insertNodeToRow(ie,ae,ie.rows.length,L),this.shiftToLastRow(ie)}return ie},ne.prototype.insertNodeToRow=function(S,L,_,ee){var ie=ee;_==S.rows.length&&(S.rows.push([]),S.rowWidth.push(ie),S.rowHeight.push(0));var ae=S.rowWidth[_]+L.rect.width;S.rows[_].length>0&&(ae+=S.horizontalPadding),S.rowWidth[_]=ae,S.width<ae&&(S.width=ae);var me=L.rect.height;_>0&&(me+=S.verticalPadding);var ve=0;me>S.rowHeight[_]&&(ve=S.rowHeight[_],S.rowHeight[_]=me,ve=S.rowHeight[_]-ve),S.height+=ve,S.rows[_].push(L)},ne.prototype.getShortestRowIndex=function(S){for(var L=-1,_=Number.MAX_VALUE,ee=0;ee<S.rows.length;ee++)S.rowWidth[ee]<_&&(L=ee,_=S.rowWidth[ee]);return L},ne.prototype.getLongestRowIndex=function(S){for(var L=-1,_=Number.MIN_VALUE,ee=0;ee<S.rows.length;ee++)S.rowWidth[ee]>_&&(L=ee,_=S.rowWidth[ee]);return L},ne.prototype.canAddHorizontal=function(S,L,_){var ee=this.getShortestRowIndex(S);if(ee<0)return!0;var ie=S.rowWidth[ee];if(ie+S.horizontalPadding+L<=S.width)return!0;var ae,me,H=0;return S.rowHeight[ee]<_&&ee>0&&(H=_+S.verticalPadding-S.rowHeight[ee]),ae=S.width-ie>=L+S.horizontalPadding?(S.height+H)/(ie+L+S.horizontalPadding):(S.height+H)/S.width,H=_+S.verticalPadding,(me=S.width<L?(S.height+H)/L:(S.height+H)/S.width)<1&&(me=1/me),ae<1&&(ae=1/ae),ae<me},ne.prototype.shiftToLastRow=function(S){var L=this.getLongestRowIndex(S),_=S.rowWidth.length-1,ee=S.rows[L],ie=ee[ee.length-1],H=ie.width+S.horizontalPadding;if(S.width-S.rowWidth[_]>H&&L!=_){ee.splice(-1,1),S.rows[_].push(ie),S.rowWidth[L]=S.rowWidth[L]-H,S.rowWidth[_]=S.rowWidth[_]+H,S.width=S.rowWidth[instance.getLongestRowIndex(S)];for(var ae=Number.MIN_VALUE,me=0;me<ee.length;me++)ee[me].height>ae&&(ae=ee[me].height);L>0&&(ae+=S.verticalPadding);var ve=S.rowHeight[L]+S.rowHeight[_];S.rowHeight[L]=ae,S.rowHeight[_]<ie.height+S.verticalPadding&&(S.rowHeight[_]=ie.height+S.verticalPadding),S.height+=S.rowHeight[L]+S.rowHeight[_]-ve,this.shiftToLastRow(S)}},ne.prototype.tilingPreLayout=function(){D.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},ne.prototype.tilingPostLayout=function(){D.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},ne.prototype.reduceTrees=function(){for(var _,S=[],L=!0;L;){var ee=this.graphManager.getAllNodes(),ie=[];L=!1;for(var H=0;H<ee.length;H++)1==(_=ee[H]).getEdges().length&&!_.getEdges()[0].isInterGraph&&null==_.getChild()&&(ie.push([_,_.getEdges()[0],_.getOwner()]),L=!0);if(1==L){for(var ae=[],me=0;me<ie.length;me++)1==ie[me][0].getEdges().length&&(ae.push(ie[me]),ie[me][0].getOwner().remove(ie[me][0]));S.push(ae),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=S},ne.prototype.growTree=function(S){for(var ee,_=S[S.length-1],ie=0;ie<_.length;ie++)this.findPlaceforPrunedNode(ee=_[ie]),ee[2].add(ee[0]),ee[2].add(ee[1],ee[1].source,ee[1].target);S.splice(S.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},ne.prototype.findPlaceforPrunedNode=function(S){var L,_,ee=S[0],ie=(_=ee==S[1].source?S[1].target:S[1].source).startX,H=_.finishX,ae=_.startY,me=_.finishY,te=[0,0,0,0];if(ae>0)for(var ce=ie;ce<=H;ce++)te[0]+=this.grid[ce][ae-1].length+this.grid[ce][ae].length-1;if(H<this.grid.length-1)for(ce=ae;ce<=me;ce++)te[1]+=this.grid[H+1][ce].length+this.grid[H][ce].length-1;if(me<this.grid[0].length-1)for(ce=ie;ce<=H;ce++)te[2]+=this.grid[ce][me+1].length+this.grid[ce][me].length-1;if(ie>0)for(ce=ae;ce<=me;ce++)te[3]+=this.grid[ie-1][ce].length+this.grid[ie][ce].length-1;for(var pe,se,Me=B.MAX_VALUE,Re=0;Re<te.length;Re++)te[Re]<Me?(Me=te[Re],pe=1,se=Re):te[Re]==Me&&pe++;if(3==pe&&0==Me)0==te[0]&&0==te[1]&&0==te[2]?L=1:0==te[0]&&0==te[1]&&0==te[3]?L=0:0==te[0]&&0==te[2]&&0==te[3]?L=3:0==te[1]&&0==te[2]&&0==te[3]&&(L=2);else if(2==pe&&0==Me){var Je=Math.floor(2*Math.random());L=0==te[0]&&0==te[1]?0==Je?0:1:0==te[0]&&0==te[2]?0==Je?0:2:0==te[0]&&0==te[3]?0==Je?0:3:0==te[1]&&0==te[2]?0==Je?1:2:0==te[1]&&0==te[3]?0==Je?1:3:0==Je?2:3}else L=4==pe&&0==Me?Je=Math.floor(4*Math.random()):se;0==L?ee.setCenter(_.getCenterX(),_.getCenterY()-_.getHeight()/2-k.DEFAULT_EDGE_LENGTH-ee.getHeight()/2):1==L?ee.setCenter(_.getCenterX()+_.getWidth()/2+k.DEFAULT_EDGE_LENGTH+ee.getWidth()/2,_.getCenterY()):2==L?ee.setCenter(_.getCenterX(),_.getCenterY()+_.getHeight()/2+k.DEFAULT_EDGE_LENGTH+ee.getHeight()/2):ee.setCenter(_.getCenterX()-_.getWidth()/2-k.DEFAULT_EDGE_LENGTH-ee.getWidth()/2,_.getCenterY())},M.exports=ne},function(M,E,T){"use strict";var I={};I.layoutBase=T(0),I.CoSEConstants=T(1),I.CoSEEdge=T(2),I.CoSEGraph=T(3),I.CoSEGraphManager=T(4),I.CoSELayout=T(6),I.CoSENode=T(5),M.exports=I}]))},6894(Ze,Ne,Y){var W;Ze.exports=(W=Y(1692),function(M){var E={};function T(I){if(E[I])return E[I].exports;var p=E[I]={i:I,l:!1,exports:{}};return M[I].call(p.exports,p,p.exports,T),p.l=!0,p.exports}return T.m=M,T.c=E,T.i=function(I){return I},T.d=function(I,p,x){T.o(I,p)||Object.defineProperty(I,p,{configurable:!1,enumerable:!0,get:x})},T.n=function(I){var p=I&&I.__esModule?function(){return I.default}:function(){return I};return T.d(p,"a",p),p},T.o=function(I,p){return Object.prototype.hasOwnProperty.call(I,p)},T.p="",T(T.s=1)}([function(M,E){M.exports=W},function(M,E,T){"use strict";var I=T(0).layoutBase.LayoutConstants,p=T(0).layoutBase.FDLayoutConstants,x=T(0).CoSEConstants,m=T(0).CoSELayout,A=T(0).CoSENode,D=T(0).layoutBase.PointD,k=T(0).layoutBase.DimensionD,G={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function O(re){this.options=function P(re,j){var xe={};for(var ne in re)xe[ne]=re[ne];for(var ne in j)xe[ne]=j[ne];return xe}(G,re),$(this.options)}var $=function(j){null!=j.nodeRepulsion&&(x.DEFAULT_REPULSION_STRENGTH=p.DEFAULT_REPULSION_STRENGTH=j.nodeRepulsion),null!=j.idealEdgeLength&&(x.DEFAULT_EDGE_LENGTH=p.DEFAULT_EDGE_LENGTH=j.idealEdgeLength),null!=j.edgeElasticity&&(x.DEFAULT_SPRING_STRENGTH=p.DEFAULT_SPRING_STRENGTH=j.edgeElasticity),null!=j.nestingFactor&&(x.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=j.nestingFactor),null!=j.gravity&&(x.DEFAULT_GRAVITY_STRENGTH=p.DEFAULT_GRAVITY_STRENGTH=j.gravity),null!=j.numIter&&(x.MAX_ITERATIONS=p.MAX_ITERATIONS=j.numIter),null!=j.gravityRange&&(x.DEFAULT_GRAVITY_RANGE_FACTOR=p.DEFAULT_GRAVITY_RANGE_FACTOR=j.gravityRange),null!=j.gravityCompound&&(x.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH=j.gravityCompound),null!=j.gravityRangeCompound&&(x.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=j.gravityRangeCompound),null!=j.initialEnergyOnIncremental&&(x.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.DEFAULT_COOLING_FACTOR_INCREMENTAL=j.initialEnergyOnIncremental),I.QUALITY="draft"==j.quality?0:"proof"==j.quality?2:1,x.NODE_DIMENSIONS_INCLUDE_LABELS=p.NODE_DIMENSIONS_INCLUDE_LABELS=I.NODE_DIMENSIONS_INCLUDE_LABELS=j.nodeDimensionsIncludeLabels,x.DEFAULT_INCREMENTAL=p.DEFAULT_INCREMENTAL=I.DEFAULT_INCREMENTAL=!j.randomize,x.ANIMATE=p.ANIMATE=I.ANIMATE=j.animate,x.TILE=j.tile,x.TILING_PADDING_VERTICAL="function"==typeof j.tilingPaddingVertical?j.tilingPaddingVertical.call():j.tilingPaddingVertical,x.TILING_PADDING_HORIZONTAL="function"==typeof j.tilingPaddingHorizontal?j.tilingPaddingHorizontal.call():j.tilingPaddingHorizontal};O.prototype.run=function(){var re,j,xe=this.options,R=(this.idToLNode={},this.layout=new m),S=this;S.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var L=R.newGraphManager();this.gm=L;var _=this.options.eles.nodes(),ee=this.options.eles.edges();this.root=L.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(_),R);for(var ie=0;ie<ee.length;ie++){var H=ee[ie],ae=this.idToLNode[H.data("source")],me=this.idToLNode[H.data("target")];ae!==me&&0==ae.getEdgesBetween(me).length&&(L.add(R.newEdge(),ae,me).id=H.id())}var Ee=function(te,ce){"number"==typeof te&&(te=ce);var Me=te.data("id"),pe=S.idToLNode[Me];return{x:pe.getRect().getCenterX(),y:pe.getRect().getCenterY()}},Ge=function fe(){for(var Me,te=function(){xe.fit&&xe.cy.fit(xe.eles,xe.padding),re||(re=!0,S.cy.one("layoutready",xe.ready),S.cy.trigger({type:"layoutready",layout:S}))},ce=S.options.refresh,pe=0;pe<ce&&!Me;pe++)Me=S.stopped||S.layout.tick();if(Me)return R.checkLayoutSuccess()&&!R.isSubLayout&&R.doPostLayout(),R.tilingPostLayout&&R.tilingPostLayout(),R.isLayoutFinished=!0,S.options.eles.nodes().positions(Ee),te(),S.cy.one("layoutstop",S.options.stop),S.cy.trigger({type:"layoutstop",layout:S}),j&&cancelAnimationFrame(j),void(re=!1);var se=S.layout.getPositionsData();xe.eles.nodes().positions(function(Re,Je){if("number"==typeof Re&&(Re=Je),!Re.isParent()){for(var qe=Re.id(),et=se[qe],ke=Re;null==et&&(et=se[ke.data("parent")]||se["DummyCompound_"+ke.data("parent")],se[qe]=et,null!=(ke=ke.parent()[0])););return null!=et?{x:et.x,y:et.y}:{x:Re.position("x"),y:Re.position("y")}}}),te(),j=requestAnimationFrame(fe)};return R.addListener("layoutstarted",function(){"during"===S.options.animate&&(j=requestAnimationFrame(Ge))}),R.runLayout(),"during"!==this.options.animate&&(S.options.eles.nodes().not(":parent").layoutPositions(S,S.options,Ee),re=!1),this},O.prototype.getTopMostNodes=function(re){for(var j={},xe=0;xe<re.length;xe++)j[re[xe].id()]=!0;return re.filter(function(R,S){"number"==typeof R&&(R=S);for(var L=R.parent()[0];null!=L;){if(j[L.id()])return!1;L=L.parent()[0]}return!0})},O.prototype.processChildrenList=function(re,j,xe){for(var ne=j.length,R=0;R<ne;R++){var _,me,S=j[R],L=S.children(),ee=S.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((_=null!=S.outerWidth()&&null!=S.outerHeight()?re.add(new A(xe.graphManager,new D(S.position("x")-ee.w/2,S.position("y")-ee.h/2),new k(parseFloat(ee.w),parseFloat(ee.h)))):re.add(new A(this.graphManager))).id=S.data("id"),_.paddingLeft=parseInt(S.css("padding")),_.paddingTop=parseInt(S.css("padding")),_.paddingRight=parseInt(S.css("padding")),_.paddingBottom=parseInt(S.css("padding")),this.options.nodeDimensionsIncludeLabels&&S.isParent()){var ie=S.boundingBox({includeLabels:!0,includeNodes:!1}).w,H=S.boundingBox({includeLabels:!0,includeNodes:!1}).h,ae=S.css("text-halign");_.labelWidth=ie,_.labelHeight=H,_.labelPos=ae}this.idToLNode[S.data("id")]=_,isNaN(_.rect.x)&&(_.rect.x=0),isNaN(_.rect.y)&&(_.rect.y=0),null!=L&&L.length>0&&(me=xe.getGraphManager().add(xe.newGraph(),_),this.processChildrenList(me,L,xe))}},O.prototype.stop=function(){return this.stopped=!0,this};var B=function(j){j("layout","cose-bilkent",O)};typeof cytoscape<"u"&&B(cytoscape),M.exports=B}]))},7839(Ze,Ne,Y){"use strict";var W=Y(9293).default;const{isArray:M,isObject:E,isString:T}=Y(2831),{asArray:I}=Y(9420),{prependBase:p}=Y(2051),x=Y(262),m=Y(6181);function D(G){throw new x("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:G})}function k({context:G,base:P}){if(!G)return;const O=G["@context"];if(T(O))G["@context"]=p(P,O);else if(M(O))for(let $=0;$<O.length;++$){const B=O[$];T(B)?O[$]=p(P,B):E(B)&&k({context:{"@context":B},base:P})}else if(E(O))for(const $ in O)k({context:O[$],base:P})}Ze.exports=class{constructor({sharedCache:P}){this.perOpCache=new Map,this.sharedCache=P}resolve(P){var O=this;return W(function*({activeCtx:$,context:B,documentLoader:re,base:j,cycles:xe=new Set}){B&&E(B)&&B["@context"]&&(B=B["@context"]),B=I(B);const ne=[];for(const R of B){if(T(R)){let _=O._get(R);_||(_=yield O._resolveRemoteContext({activeCtx:$,url:R,documentLoader:re,base:j,cycles:xe})),M(_)?ne.push(..._):ne.push(_);continue}if(null===R){ne.push(new m({document:null}));continue}E(R)||D(B);const S=JSON.stringify(R);let L=O._get(S);L||(L=new m({document:R}),O._cacheResolvedContext({key:S,resolved:L,tag:"static"})),ne.push(L)}return ne}).apply(this,arguments)}_get(P){let O=this.perOpCache.get(P);if(!O){const $=this.sharedCache.get(P);$&&(O=$.get("static"),O&&this.perOpCache.set(P,O))}return O}_cacheResolvedContext({key:P,resolved:O,tag:$}){if(this.perOpCache.set(P,O),void 0!==$){let B=this.sharedCache.get(P);B||(B=new Map,this.sharedCache.set(P,B)),B.set($,O)}return O}_resolveRemoteContext(P){var O=this;return W(function*({activeCtx:$,url:B,documentLoader:re,base:j,cycles:xe}){B=p(j,B);const{context:ne,remoteDoc:R}=yield O._fetchContext({activeCtx:$,url:B,documentLoader:re,cycles:xe});k({context:ne,base:j=R.documentUrl||B});const S=yield O.resolve({activeCtx:$,context:ne,documentLoader:re,base:j,cycles:xe});return O._cacheResolvedContext({key:B,resolved:S,tag:R.tag}),S}).apply(this,arguments)}_fetchContext(P){return W(function*({activeCtx:O,url:$,documentLoader:B,cycles:re}){if(re.size>10)throw new x("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===O.processingMode?"loading remote context failed":"context overflow",max:10});if(re.has($))throw new x("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===O.processingMode?"recursive context inclusion":"context overflow",url:$});let j,xe;re.add($);try{xe=yield B($),j=xe.document||null,T(j)&&(j=JSON.parse(j))}catch(ne){throw new x(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${$}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:$,cause:ne})}if(!E(j))throw new x(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${$}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:$});return j="@context"in j?{"@context":j["@context"]}:{"@context":{}},xe.contextUrl&&(M(j["@context"])||(j["@context"]=[j["@context"]]),j["@context"].push(xe.contextUrl)),{context:j,remoteDoc:xe}}).apply(this,arguments)}}},262(Ze){"use strict";Ze.exports=class extends Error{constructor(Y="An unspecified JSON-LD error occurred.",W="jsonld.Error",M={}){super(Y),this.name=W,this.message=Y,this.details=M}}},1328(Ze){"use strict";Ze.exports=Ne=>{class Y{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(Y,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(Y.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:Y}),Y.compact=function(W,M){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):Ne.compact(W,M)},Y.expand=function(W){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):Ne.expand(W)},Y.flatten=function(W){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):Ne.flatten(W)},Y}},5426(Ze,Ne,Y){"use strict";Ze.exports=Y(1224).NQuads},4808(Ze,Ne,Y){"use strict";var W=Y(9293).default;Ze.exports=class{constructor(){this._requests={}}wrapLoader(E){const T=this;return T._loader=E,function(){return T.add.apply(T,arguments)}}add(E){var T=this;return W(function*(){let I=T._requests[E];if(I)return Promise.resolve(I);I=T._requests[E]=T._loader(E);try{return yield I}finally{delete T._requests[E]}})()}}},6181(Ze,Ne,Y){"use strict";const W=Y(3052);Ze.exports=class{constructor({document:T}){this.document=T,this.cache=new W({max:10})}getProcessed(T){return this.cache.get(T)}setProcessed(T,I){this.cache.set(T,I)}}},3763(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(262),{isArray:E,isObject:T,isString:I,isUndefined:p}=Y(2831),{isList:x,isValue:m,isGraph:A,isSimpleGraph:D,isSubjectReference:k}=Y(4209),{expandIri:G,getContextValue:P,isKeyword:O,process:$,processingMode:B}=Y(429),{removeBase:re,prependBase:j}=Y(2051),{REGEX_KEYWORD:xe,addValue:ne,asArray:R,compareShortestLeast:S}=Y(9420),L={};function ee(ie,H,ae){if("@nest"!==G(ie,H,{vocab:!0},ae))throw new M("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}Ze.exports=L,L.compact=function(){var ie=W(function*({activeCtx:H,activeProperty:ae=null,element:me,options:ve={}}){if(E(me)){let Ge=[];for(let fe=0;fe<me.length;++fe){const te=yield L.compact({activeCtx:H,activeProperty:ae,element:me[fe],options:ve});null!==te&&Ge.push(te)}return ve.compactArrays&&1===Ge.length&&0===(P(H,ae,"@container")||[]).length&&(Ge=Ge[0]),Ge}const Ee=P(H,ae,"@context");if(p(Ee)||(H=yield $({activeCtx:H,localCtx:Ee,propagate:!0,overrideProtected:!0,options:ve})),T(me)){if(ve.link&&"@id"in me&&ve.link.hasOwnProperty(me["@id"])){const Re=ve.link[me["@id"]];for(let Je=0;Je<Re.length;++Je)if(Re[Je].expanded===me)return Re[Je].compacted}if(m(me)||k(me)){const Re=L.compactValue({activeCtx:H,activeProperty:ae,value:me,options:ve});return ve.link&&k(me)&&(ve.link.hasOwnProperty(me["@id"])||(ve.link[me["@id"]]=[]),ve.link[me["@id"]].push({expanded:me,compacted:Re})),Re}if(x(me)&&(P(H,ae,"@container")||[]).includes("@list"))return L.compact({activeCtx:H,activeProperty:ae,element:me["@list"],options:ve});const Ge="@reverse"===ae,fe={},te=H;!m(me)&&!k(me)&&(H=H.revertToPreviousContext());const ce=P(te,ae,"@context");p(ce)||(H=yield $({activeCtx:H,localCtx:ce,propagate:!0,overrideProtected:!0,options:ve})),ve.link&&"@id"in me&&(ve.link.hasOwnProperty(me["@id"])||(ve.link[me["@id"]]=[]),ve.link[me["@id"]].push({expanded:me,compacted:fe}));let Me=me["@type"]||[];Me.length>1&&(Me=Array.from(Me).sort());const pe=H;for(const Re of Me){const Je=L.compactIri({activeCtx:pe,iri:Re,relativeTo:{vocab:!0}}),qe=P(te,Je,"@context");p(qe)||(H=yield $({activeCtx:H,localCtx:qe,options:ve,propagate:!1}))}const se=Object.keys(me).sort();for(const Re of se){const Je=me[Re];if("@id"===Re){let qe=R(Je).map(ke=>L.compactIri({activeCtx:H,iri:ke,relativeTo:{vocab:!1},base:ve.base}));1===qe.length&&(qe=qe[0]),fe[L.compactIri({activeCtx:H,iri:"@id",relativeTo:{vocab:!0}})]=qe;continue}if("@type"===Re){let qe=R(Je).map(oe=>L.compactIri({activeCtx:te,iri:oe,relativeTo:{vocab:!0}}));1===qe.length&&(qe=qe[0]);const et=L.compactIri({activeCtx:H,iri:"@type",relativeTo:{vocab:!0}}),we=(P(H,et,"@container")||[]).includes("@set")&&B(H,1.1)||E(qe)&&0===Je.length;ne(fe,et,qe,{propertyIsArray:we});continue}if("@reverse"===Re){const qe=yield L.compact({activeCtx:H,activeProperty:"@reverse",element:Je,options:ve});for(const et in qe)if(H.mappings.has(et)&&H.mappings.get(et).reverse){const ke=qe[et],we=(P(H,et,"@container")||[]).includes("@set")||!ve.compactArrays;ne(fe,et,ke,{propertyIsArray:we}),delete qe[et]}if(Object.keys(qe).length>0){const et=L.compactIri({activeCtx:H,iri:Re,relativeTo:{vocab:!0}});ne(fe,et,qe)}continue}if("@preserve"===Re){const qe=yield L.compact({activeCtx:H,activeProperty:ae,element:Je,options:ve});E(qe)&&0===qe.length||ne(fe,Re,qe);continue}if("@index"===Re){if((P(H,ae,"@container")||[]).includes("@index"))continue;const et=L.compactIri({activeCtx:H,iri:Re,relativeTo:{vocab:!0}});ne(fe,et,Je);continue}if("@graph"!==Re&&"@list"!==Re&&"@included"!==Re&&O(Re)){const qe=L.compactIri({activeCtx:H,iri:Re,relativeTo:{vocab:!0}});ne(fe,qe,Je);continue}if(!E(Je))throw new M("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===Je.length){const qe=L.compactIri({activeCtx:H,iri:Re,value:Je,relativeTo:{vocab:!0},reverse:Ge}),et=H.mappings.has(qe)?H.mappings.get(qe)["@nest"]:null;let ke=fe;et&&(ee(H,et,ve),T(fe[et])||(fe[et]={}),ke=fe[et]),ne(ke,qe,Je,{propertyIsArray:!0})}for(const qe of Je){const et=L.compactIri({activeCtx:H,iri:Re,value:qe,relativeTo:{vocab:!0},reverse:Ge}),ke=H.mappings.has(et)?H.mappings.get(et)["@nest"]:null;let We=fe;ke&&(ee(H,ke,ve),T(fe[ke])||(fe[ke]={}),We=fe[ke]);const we=P(H,et,"@container")||[],oe=A(qe),Be=x(qe);let Ye;Be?Ye=qe["@list"]:oe&&(Ye=qe["@graph"]);let Oe=yield L.compact({activeCtx:H,activeProperty:et,element:Be||oe?Ye:qe,options:ve});if(Be){if(E(Oe)||(Oe=[Oe]),we.includes("@list")){ne(We,et,Oe,{valueIsArray:!0,allowDuplicate:!0});continue}Oe={[L.compactIri({activeCtx:H,iri:"@list",relativeTo:{vocab:!0}})]:Oe},"@index"in qe&&(Oe[L.compactIri({activeCtx:H,iri:"@index",relativeTo:{vocab:!0}})]=qe["@index"])}if(oe)if(we.includes("@graph")&&(we.includes("@id")||we.includes("@index")&&D(qe))){let it;We.hasOwnProperty(et)?it=We[et]:We[et]=it={};const _e=(we.includes("@id")?qe["@id"]:qe["@index"])||L.compactIri({activeCtx:H,iri:"@none",relativeTo:{vocab:!0}});ne(it,_e,Oe,{propertyIsArray:!ve.compactArrays||we.includes("@set")})}else we.includes("@graph")&&D(qe)?(E(Oe)&&Oe.length>1&&(Oe={"@included":Oe}),ne(We,et,Oe,{propertyIsArray:!ve.compactArrays||we.includes("@set")})):(E(Oe)&&1===Oe.length&&ve.compactArrays&&(Oe=Oe[0]),Oe={[L.compactIri({activeCtx:H,iri:"@graph",relativeTo:{vocab:!0}})]:Oe},"@id"in qe&&(Oe[L.compactIri({activeCtx:H,iri:"@id",relativeTo:{vocab:!0}})]=qe["@id"]),"@index"in qe&&(Oe[L.compactIri({activeCtx:H,iri:"@index",relativeTo:{vocab:!0}})]=qe["@index"]),ne(We,et,Oe,{propertyIsArray:!ve.compactArrays||we.includes("@set")}));else if(we.includes("@language")||we.includes("@index")||we.includes("@id")||we.includes("@type")){let it,_e;if(We.hasOwnProperty(et)?it=We[et]:We[et]=it={},we.includes("@language"))m(Oe)&&(Oe=Oe["@value"]),_e=qe["@language"];else if(we.includes("@index")){const xt=P(H,et,"@index")||"@index",nt=L.compactIri({activeCtx:H,iri:xt,relativeTo:{vocab:!0}});if("@index"===xt)_e=qe["@index"],delete Oe[nt];else{let vt;if([_e,...vt]=R(Oe[xt]||[]),I(_e))switch(vt.length){case 0:delete Oe[xt];break;case 1:Oe[xt]=vt[0];break;default:Oe[xt]=vt}else _e=null}}else if(we.includes("@id")){const xt=L.compactIri({activeCtx:H,iri:"@id",relativeTo:{vocab:!0}});_e=Oe[xt],delete Oe[xt]}else if(we.includes("@type")){const xt=L.compactIri({activeCtx:H,iri:"@type",relativeTo:{vocab:!0}});let nt;switch([_e,...nt]=R(Oe[xt]||[]),nt.length){case 0:delete Oe[xt];break;case 1:Oe[xt]=nt[0];break;default:Oe[xt]=nt}1===Object.keys(Oe).length&&"@id"in qe&&(Oe=yield L.compact({activeCtx:H,activeProperty:et,element:{"@id":qe["@id"]},options:ve}))}_e||(_e=L.compactIri({activeCtx:H,iri:"@none",relativeTo:{vocab:!0}})),ne(it,_e,Oe,{propertyIsArray:we.includes("@set")})}else{const it=!ve.compactArrays||we.includes("@set")||we.includes("@list")||E(Oe)&&0===Oe.length||"@list"===Re||"@graph"===Re;ne(We,et,Oe,{propertyIsArray:it})}}}return fe}return me});return function(H){return ie.apply(this,arguments)}}(),L.compactIri=({activeCtx:ie,iri:H,value:ae=null,relativeTo:me={vocab:!1},reverse:ve=!1,base:Ee=null})=>{if(null===H)return H;ie.isPropertyTermScoped&&ie.previousContext&&(ie=ie.previousContext);const Ge=ie.getInverse();if(O(H)&&H in Ge&&"@none"in Ge[H]&&"@type"in Ge[H]["@none"]&&"@none"in Ge[H]["@none"]["@type"])return Ge[H]["@none"]["@type"]["@none"];if(me.vocab&&H in Ge){const pe=ie["@language"]||"@none",se=[];T(ae)&&"@index"in ae&&!("@graph"in ae)&&se.push("@index","@index@set"),T(ae)&&"@preserve"in ae&&(ae=ae["@preserve"][0]),A(ae)?("@index"in ae&&se.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in ae&&se.push("@graph@id","@graph@id@set"),se.push("@graph","@graph@set","@set"),"@index"in ae||se.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in ae||se.push("@graph@id","@graph@id@set")):T(ae)&&!m(ae)&&se.push("@id","@id@set","@type","@set@type");let Re="@language",Je="@null";if(ve)Re="@type",Je="@reverse",se.push("@set");else if(x(ae)){"@index"in ae||se.push("@list");const et=ae["@list"];if(0===et.length)Re="@any",Je="@none";else{let ke=0===et.length?pe:null,We=null;for(let we=0;we<et.length;++we){const oe=et[we];let Be="@none",Ye="@none";if(m(oe)?"@direction"in oe?Be=`${(oe["@language"]||"").toLowerCase()}_${oe["@direction"]}`:"@language"in oe?Be=oe["@language"].toLowerCase():"@type"in oe?Ye=oe["@type"]:Be="@null":Ye="@id",null===ke?ke=Be:Be!==ke&&m(oe)&&(ke="@none"),null===We?We=Ye:Ye!==We&&(We="@none"),"@none"===ke&&"@none"===We)break}ke=ke||"@none",We=We||"@none","@none"!==We?(Re="@type",Je=We):Je=ke}}else{if(m(ae))if("@language"in ae&&!("@index"in ae)){se.push("@language","@language@set"),Je=ae["@language"];const et=ae["@direction"];et&&(Je=`${Je}_${et}`)}else"@direction"in ae&&!("@index"in ae)?Je=`_${ae["@direction"]}`:"@type"in ae&&(Re="@type",Je=ae["@type"]);else Re="@type",Je="@id";se.push("@set")}se.push("@none"),T(ae)&&!("@index"in ae)&&se.push("@index","@index@set"),m(ae)&&1===Object.keys(ae).length&&se.push("@language","@language@set");const qe=function _(ie,H,ae,me,ve,Ee){null===Ee&&(Ee="@null");const Ge=[];if(("@id"===Ee||"@reverse"===Ee)&&T(ae)&&"@id"in ae){"@reverse"===Ee&&Ge.push("@reverse");const te=L.compactIri({activeCtx:ie,iri:ae["@id"],relativeTo:{vocab:!0}});ie.mappings.has(te)&&ie.mappings.get(te)&&ie.mappings.get(te)["@id"]===ae["@id"]?Ge.push.apply(Ge,["@vocab","@id"]):Ge.push.apply(Ge,["@id","@vocab"])}else{Ge.push(Ee);const te=Ge.find(ce=>ce.includes("_"));te&&Ge.push(te.replace(/^[^_]+_/,"_"))}Ge.push("@none");const fe=ie.inverse[H];for(const te of me){if(!(te in fe))continue;const ce=fe[te][ve];for(const Me of Ge)if(Me in ce)return ce[Me]}return null}(ie,H,ae,se,Re,Je);if(null!==qe)return qe}if(me.vocab&&"@vocab"in ie){const pe=ie["@vocab"];if(0===H.indexOf(pe)&&H!==pe){const se=H.substr(pe.length);if(!ie.mappings.has(se))return se}}let fe=null;const te=[];let ce=ie.fastCurieMap;const Me=H.length-1;for(let pe=0;pe<Me&&H[pe]in ce;++pe)ce=ce[H[pe]],""in ce&&te.push(ce[""][0]);for(let pe=te.length-1;pe>=0;--pe){const se=te[pe],Re=se.terms;for(const Je of Re){const qe=Je+":"+H.substr(se.iri.length);ie.mappings.get(Je)._prefix&&(!ie.mappings.has(qe)||null===ae&&ie.mappings.get(qe)["@id"]===H)&&(null===fe||S(qe,fe)<0)&&(fe=qe)}}if(null!==fe)return fe;for(const[pe,se]of ie.mappings)if(se&&se._prefix&&H.startsWith(pe+":"))throw new M(`Absolute IRI "${H}" confused with prefix "${pe}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:ie});if(!me.vocab){if("@base"in ie){if(ie["@base"]){const pe=re(j(Ee,ie["@base"]),H);return xe.test(pe)?`./${pe}`:pe}return H}return re(Ee,H)}return H},L.compactValue=({activeCtx:ie,activeProperty:H,value:ae,options:me})=>{if(m(ae)){const fe=P(ie,H,"@type"),te=P(ie,H,"@language"),ce=P(ie,H,"@direction"),Me=P(ie,H,"@container")||[],pe="@index"in ae&&!Me.includes("@index");if(!pe&&"@none"!==fe&&(ae["@type"]===fe||"@language"in ae&&ae["@language"]===te&&"@direction"in ae&&ae["@direction"]===ce||"@language"in ae&&ae["@language"]===te||"@direction"in ae&&ae["@direction"]===ce))return ae["@value"];const se=Object.keys(ae).length,Re=1===se||2===se&&"@index"in ae&&!pe,Je="@language"in ie,qe=I(ae["@value"]),et=ie.mappings.has(H)&&null===ie.mappings.get(H)["@language"];if(Re&&"@none"!==fe&&(!Je||!qe||et))return ae["@value"];const ke={};return pe&&(ke[L.compactIri({activeCtx:ie,iri:"@index",relativeTo:{vocab:!0}})]=ae["@index"]),"@type"in ae?ke[L.compactIri({activeCtx:ie,iri:"@type",relativeTo:{vocab:!0}})]=L.compactIri({activeCtx:ie,iri:ae["@type"],relativeTo:{vocab:!0}}):"@language"in ae&&(ke[L.compactIri({activeCtx:ie,iri:"@language",relativeTo:{vocab:!0}})]=ae["@language"]),"@direction"in ae&&(ke[L.compactIri({activeCtx:ie,iri:"@direction",relativeTo:{vocab:!0}})]=ae["@direction"]),ke[L.compactIri({activeCtx:ie,iri:"@value",relativeTo:{vocab:!0}})]=ae["@value"],ke}const ve=G(ie,H,{vocab:!0},me),Ee=P(ie,H,"@type"),Ge=L.compactIri({activeCtx:ie,iri:ae["@id"],relativeTo:{vocab:"@vocab"===Ee},base:me.base});return"@id"===Ee||"@vocab"===Ee||"@graph"===ve?Ge:{[L.compactIri({activeCtx:ie,iri:"@id",relativeTo:{vocab:!0}})]:Ge}}},5315(Ze){"use strict";const Ne="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Y="http://www.w3.org/2001/XMLSchema#";Ze.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:Ne,RDF_LIST:Ne+"List",RDF_FIRST:Ne+"first",RDF_REST:Ne+"rest",RDF_NIL:Ne+"nil",RDF_TYPE:Ne+"type",RDF_PLAIN_LITERAL:Ne+"PlainLiteral",RDF_XML_LITERAL:Ne+"XMLLiteral",RDF_JSON_LITERAL:Ne+"JSON",RDF_OBJECT:Ne+"object",RDF_LANGSTRING:Ne+"langString",XSD:Y,XSD_BOOLEAN:Y+"boolean",XSD_DOUBLE:Y+"double",XSD_INTEGER:Y+"integer",XSD_STRING:Y+"string"}},429(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(9420),E=Y(262),{isArray:T,isObject:I,isString:p,isUndefined:x}=Y(2831),{isAbsolute:m,isRelative:A,prependBase:D}=Y(2051),{handleEvent:k}=Y(2585),{REGEX_BCP47:G,REGEX_KEYWORD:P,asArray:O,compareShortestLeast:$}=Y(9420),B=new Map,j={};function xe(R,S,L,_,ee,ie){if(null===S||!p(S)||j.isKeyword(S))return S;if(S.match(P))return null;if(_&&_.hasOwnProperty(S)&&!0!==ee.get(S)&&j.createTermDefinition({activeCtx:R,localCtx:_,term:S,defined:ee,options:ie}),(L=L||{}).vocab){const ae=R.mappings.get(S);if(null===ae)return null;if(I(ae)&&"@id"in ae)return ae["@id"]}const H=S.indexOf(":");if(H>0){const ae=S.substr(0,H),me=S.substr(H+1);if("_"===ae||0===me.indexOf("//"))return S;_&&_.hasOwnProperty(ae)&&j.createTermDefinition({activeCtx:R,localCtx:_,term:ae,defined:ee,options:ie});const ve=R.mappings.get(ae);if(ve&&ve._prefix)return ve["@id"]+me;if(m(S))return S}if(L.vocab&&"@vocab"in R)S=R["@vocab"]+S;else if(L.base){let ae,me;"@base"in R?R["@base"]?(me=D(ie.base,R["@base"]),ae=D(me,S)):(me=R["@base"],ae=S):(me=ie.base,ae=D(ie.base,S)),S=ae}return S}function ne(R,S){if(!R||"object"!=typeof R||!S||"object"!=typeof S)return R===S;const L=Array.isArray(R);if(L!==Array.isArray(S))return!1;if(L){if(R.length!==S.length)return!1;for(let ie=0;ie<R.length;++ie)if(!ne(R[ie],S[ie]))return!1;return!0}const _=Object.keys(R),ee=Object.keys(S);if(_.length!==ee.length)return!1;for(const ie in R){let H=R[ie],ae=S[ie];if("@container"===ie&&Array.isArray(H)&&Array.isArray(ae)&&(H=H.slice().sort(),ae=ae.slice().sort()),!ne(H,ae))return!1}return!0}Ze.exports=j,j.process=function(){var R=W(function*({activeCtx:S,localCtx:L,options:_,propagate:ee=!0,overrideProtected:ie=!1,cycles:H=new Set}){if(I(L)&&"@context"in L&&T(L["@context"])&&(L=L["@context"]),0===O(L).length)return S;const me=[],ve=[({event:te,next:ce})=>{me.push(te),ce()}];_.eventHandler&&ve.push(_.eventHandler);const Ee=_;_={..._,eventHandler:ve};const Ge=yield _.contextResolver.resolve({activeCtx:S,context:L,documentLoader:_.documentLoader,base:_.base});I(Ge[0].document)&&"boolean"==typeof Ge[0].document["@propagate"]&&(ee=Ge[0].document["@propagate"]);let fe=S;!ee&&!fe.previousContext&&(fe=fe.clone(),fe.previousContext=S);for(const te of Ge){let{document:ce}=te;if(S=fe,null===ce){if(!ie&&0!==Object.keys(S.protected).length)throw new E("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});fe=S=j.getInitialContext(_).clone();continue}const Me=te.getProcessed(S);if(Me){if(Ee.eventHandler)for(const se of Me.events)k({event:se,options:Ee});fe=S=Me.context;continue}if(I(ce)&&"@context"in ce&&(ce=ce["@context"]),!I(ce))throw new E("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:ce});fe=fe.clone();const pe=new Map;if("@version"in ce){if(1.1!==ce["@version"])throw new E("Unsupported JSON-LD version: "+ce["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:ce});if(S.processingMode&&"json-ld-1.0"===S.processingMode)throw new E("@version: "+ce["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:ce});fe.processingMode="json-ld-1.1",fe["@version"]=ce["@version"],pe.set("@version",!0)}if(fe.processingMode=fe.processingMode||S.processingMode,"@base"in ce){let se=ce["@base"];if(null!==se&&!m(se)){if(!A(se))throw new E('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:ce});se=D(fe["@base"],se)}fe["@base"]=se,pe.set("@base",!0)}if("@vocab"in ce){const se=ce["@vocab"];if(null===se)delete fe["@vocab"];else{if(!p(se))throw new E('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:ce});if(!m(se)&&j.processingMode(fe,1))throw new E('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:ce});{const Re=xe(fe,se,{vocab:!0,base:!0},void 0,void 0,_);m(Re)||_.eventHandler&&k({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:Re}},options:_}),fe["@vocab"]=Re}}pe.set("@vocab",!0)}if("@language"in ce){const se=ce["@language"];if(null===se)delete fe["@language"];else{if(!p(se))throw new E('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:ce});se.match(G)||_.eventHandler&&k({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:se}},options:_}),fe["@language"]=se.toLowerCase()}pe.set("@language",!0)}if("@direction"in ce){const se=ce["@direction"];if("json-ld-1.0"===S.processingMode)throw new E("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:ce});if(null===se)delete fe["@direction"];else{if("ltr"!==se&&"rtl"!==se)throw new E('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:ce});fe["@direction"]=se}pe.set("@direction",!0)}if("@propagate"in ce){const se=ce["@propagate"];if("json-ld-1.0"===S.processingMode)throw new E("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:ce});if("boolean"!=typeof se)throw new E("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:L});pe.set("@propagate",!0)}if("@import"in ce){const se=ce["@import"];if("json-ld-1.0"===S.processingMode)throw new E("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:ce});if(!p(se))throw new E("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:L});const Re=yield _.contextResolver.resolve({activeCtx:S,context:se,documentLoader:_.documentLoader,base:_.base});if(1!==Re.length)throw new E("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:L});const Je=Re[0].getProcessed(S);if(Je)ce=Je;else{const qe=Re[0].document;if("@import"in qe)throw new E("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:L});for(const et in qe)ce.hasOwnProperty(et)||(ce[et]=qe[et]);Re[0].setProcessed(S,ce)}pe.set("@import",!0)}pe.set("@protected",ce["@protected"]||!1);for(const se in ce)if(j.createTermDefinition({activeCtx:fe,localCtx:ce,term:se,defined:pe,options:_,overrideProtected:ie}),I(ce[se])&&"@context"in ce[se]){const Re=ce[se]["@context"];let Je=!0;if(p(Re)){const qe=D(_.base,Re);H.has(qe)?Je=!1:H.add(qe)}if(Je)try{yield j.process({activeCtx:fe.clone(),localCtx:ce[se]["@context"],overrideProtected:!0,options:_,cycles:H})}catch{throw new E("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:ce[se]["@context"],term:se})}}te.setProcessed(S,{context:fe,events:me})}return fe});return function(S){return R.apply(this,arguments)}}(),j.createTermDefinition=({activeCtx:R,localCtx:S,term:L,defined:_,options:ee,overrideProtected:ie=!1})=>{if(_.has(L)){if(_.get(L))return;throw new E("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:S,term:L})}let H;if(_.set(L,!1),S.hasOwnProperty(L)&&(H=S[L]),"@type"===L&&I(H)&&"@set"===(H["@container"]||"@set")&&j.processingMode(R,1.1)){const te=["@container","@id","@protected"],ce=Object.keys(H);if(0===ce.length||ce.some(Me=>!te.includes(Me)))throw new E("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:S,term:L})}else{if(j.isKeyword(L))throw new E("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:S,term:L});if(L.match(P))return void(ee.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:L}},options:ee}));if(""===L)throw new E("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:S})}const ae=R.mappings.get(L);R.mappings.has(L)&&R.mappings.delete(L);let me=!1;if((p(H)||null===H)&&(me=!0,H={"@id":H}),!I(H))throw new E("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:S});const ve={};R.mappings.set(L,ve),ve.reverse=!1;const Ee=["@container","@id","@language","@reverse","@type"];j.processingMode(R,1.1)&&Ee.push("@context","@direction","@index","@nest","@prefix","@protected");for(const te in H)if(!Ee.includes(te))throw new E("Invalid JSON-LD syntax; a term definition must not contain "+te,"jsonld.SyntaxError",{code:"invalid term definition",context:S});const Ge=L.indexOf(":");if(ve._termHasColon=Ge>0,"@reverse"in H){if("@id"in H)throw new E("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:S});if("@nest"in H)throw new E("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:S});const te=H["@reverse"];if(!p(te))throw new E("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});if(te.match(P))return ee.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:te}},options:ee}),void(ae?R.mappings.set(L,ae):R.mappings.delete(L));const ce=xe(R,te,{vocab:!0,base:!1},S,_,ee);if(!m(ce))throw new E("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});ve["@id"]=ce,ve.reverse=!0}else if("@id"in H){let te=H["@id"];if(te&&!p(te))throw new E("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});if(null===te)ve["@id"]=null;else{if(!j.isKeyword(te)&&te.match(P))return ee.eventHandler&&k({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:te}},options:ee}),void(ae?R.mappings.set(L,ae):R.mappings.delete(L));if(te!==L){if(te=xe(R,te,{vocab:!0,base:!1},S,_,ee),!m(te)&&!j.isKeyword(te))throw new E("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});if(L.match(/(?::[^:])|\//)&&xe(R,L,{vocab:!0,base:!1},S,new Map(_).set(L,!0),ee)!==te)throw new E("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S});ve["@id"]=te,ve._prefix=me&&!ve._termHasColon&&null!==te.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in ve))if(ve._termHasColon){const te=L.substr(0,Ge);if(S.hasOwnProperty(te)&&j.createTermDefinition({activeCtx:R,localCtx:S,term:te,defined:_,options:ee}),R.mappings.has(te)){const ce=L.substr(Ge+1);ve["@id"]=R.mappings.get(te)["@id"]+ce}else ve["@id"]=L}else if("@type"===L)ve["@id"]=L;else{if(!("@vocab"in R))throw new E("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:S,term:L});ve["@id"]=R["@vocab"]+L}if((!0===H["@protected"]||!0===_.get("@protected")&&!1!==H["@protected"])&&(R.protected[L]=!0,ve.protected=!0),_.set(L,!0),"@type"in H){let te=H["@type"];if(!p(te))throw new E("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:S});if("@json"===te||"@none"===te){if(j.processingMode(R,1))throw new E(`Invalid JSON-LD syntax; an @context @type value must not be "${te}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:S})}else if("@id"!==te&&"@vocab"!==te){if(te=xe(R,te,{vocab:!0,base:!1},S,_,ee),!m(te))throw new E("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:S});if(0===te.indexOf("_:"))throw new E("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:S})}ve["@type"]=te}if("@container"in H){const te=p(H["@container"])?[H["@container"]]:H["@container"]||[],ce=["@list","@set","@index","@language"];let Me=!0;const pe=te.includes("@set");if(j.processingMode(R,1.1)){if(ce.push("@graph","@id","@type"),te.includes("@list")){if(1!==te.length)throw new E("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:S})}else if(te.includes("@graph")){if(te.some(se=>"@graph"!==se&&"@id"!==se&&"@index"!==se&&"@set"!==se))throw new E("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:S})}else Me&=te.length<=(pe?2:1);if(te.includes("@type")&&(ve["@type"]=ve["@type"]||"@id",!["@id","@vocab"].includes(ve["@type"])))throw new E("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:S})}else Me&=!T(H["@container"]),Me&=te.length<=1;if(Me&=te.every(se=>ce.includes(se)),Me&=!(pe&&te.includes("@list")),!Me)throw new E("Invalid JSON-LD syntax; @context @container value must be one of the following: "+ce.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:S});if(ve.reverse&&!te.every(se=>["@index","@set"].includes(se)))throw new E("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:S});ve["@container"]=te}if("@index"in H){if(!("@container"in H)||!ve["@container"].includes("@index"))throw new E(`Invalid JSON-LD syntax; @index without @index in @container: "${H["@index"]}" on term "${L}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:S});if(!p(H["@index"])||0===H["@index"].indexOf("@"))throw new E(`Invalid JSON-LD syntax; @index must expand to an IRI: "${H["@index"]}" on term "${L}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:S});ve["@index"]=H["@index"]}if("@context"in H&&(ve["@context"]=H["@context"]),"@language"in H&&!("@type"in H)){let te=H["@language"];if(null!==te&&!p(te))throw new E("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:S});null!==te&&(te=te.toLowerCase()),ve["@language"]=te}if("@prefix"in H){if(L.match(/:|\//))throw new E("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:S});if(j.isKeyword(ve["@id"]))throw new E("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:S});if("boolean"!=typeof H["@prefix"])throw new E("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:S});ve._prefix=!0===H["@prefix"]}if("@direction"in H){const te=H["@direction"];if(null!==te&&"ltr"!==te&&"rtl"!==te)throw new E('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:S});ve["@direction"]=te}if("@nest"in H){const te=H["@nest"];if(!p(te)||"@nest"!==te&&0===te.indexOf("@"))throw new E("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:S});ve["@nest"]=te}const fe=ve["@id"];if("@context"===fe||"@preserve"===fe)throw new E("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:S});if(ae&&ae.protected&&!ie&&(R.protected[L]=!0,ve.protected=!0,!ne(ae,ve)))throw new E("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:S,term:L})},j.expandIri=(R,S,L,_)=>xe(R,S,L,void 0,void 0,_),j.getInitialContext=R=>{const S=JSON.stringify({processingMode:R.processingMode}),L=B.get(S);if(L)return L;const _={processingMode:R.processingMode,mappings:new Map,inverse:null,getInverse:function ee(){const ve=this;if(ve.inverse)return ve.inverse;const Ee=ve.inverse={},Ge=ve.fastCurieMap={},fe={},te=(ve["@language"]||"@none").toLowerCase(),ce=ve["@direction"],Me=ve.mappings,pe=[...Me.keys()].sort($);for(const se of pe){const Re=Me.get(se);if(null===Re)continue;let Je=Re["@container"]||"@none";if(Je=[].concat(Je).sort().join(""),null===Re["@id"])continue;const qe=O(Re["@id"]);for(const et of qe){let ke=Ee[et];const We=j.isKeyword(et);if(ke)!We&&!Re._termHasColon&&fe[et].push(se);else if(Ee[et]=ke={},!We&&!Re._termHasColon){fe[et]=[se];const we={iri:et,terms:fe[et]};et[0]in Ge?Ge[et[0]].push(we):Ge[et[0]]=[we]}if(ke[Je]||(ke[Je]={"@language":{},"@type":{},"@any":{}}),ke=ke[Je],H(se,ke["@any"],"@none"),Re.reverse)H(se,ke["@type"],"@reverse");else if("@none"===Re["@type"])H(se,ke["@any"],"@none"),H(se,ke["@language"],"@none"),H(se,ke["@type"],"@none");else if("@type"in Re)H(se,ke["@type"],Re["@type"]);else if("@language"in Re&&"@direction"in Re){const we=Re["@language"],oe=Re["@direction"];H(se,ke["@language"],we&&oe?`${we}_${oe}`.toLowerCase():we?we.toLowerCase():oe?`_${oe}`:"@null")}else"@language"in Re?H(se,ke["@language"],(Re["@language"]||"@null").toLowerCase()):"@direction"in Re?H(se,ke["@language"],Re["@direction"]?`_${Re["@direction"]}`:"@none"):ce?(H(se,ke["@language"],`_${ce}`),H(se,ke["@language"],"@none"),H(se,ke["@type"],"@none")):(H(se,ke["@language"],te),H(se,ke["@language"],"@none"),H(se,ke["@type"],"@none"))}}for(const se in Ge)ie(Ge,se,1);return Ee},clone:function ae(){const ve={};return ve.mappings=M.clone(this.mappings),ve.clone=this.clone,ve.inverse=null,ve.getInverse=this.getInverse,ve.protected=M.clone(this.protected),this.previousContext&&(ve.previousContext=this.previousContext.clone()),ve.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(ve["@base"]=this["@base"]),"@language"in this&&(ve["@language"]=this["@language"]),"@vocab"in this&&(ve["@vocab"]=this["@vocab"]),ve},revertToPreviousContext:function me(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===B.size&&B.clear(),B.set(S,_),_;function ie(ve,Ee,Ge){const fe=ve[Ee],te=ve[Ee]={};let ce,Me;for(const pe of fe)ce=pe.iri,Me=Ge>=ce.length?"":ce[Ge],Me in te?te[Me].push(pe):te[Me]=[pe];for(const pe in te)""!==pe&&ie(te,pe,Ge+1)}function H(ve,Ee,Ge){Ee.hasOwnProperty(Ge)||(Ee[Ge]=ve)}},j.getContextValue=(R,S,L)=>{if(null===S)return"@context"===L?void 0:null;if(R.mappings.has(S)){const _=R.mappings.get(S);if(x(L))return _;if(_.hasOwnProperty(L))return _[L]}return"@language"===L&&L in R||"@direction"===L&&L in R?R[L]:"@context"!==L?null:void 0},j.processingMode=(R,S)=>S.toString()>="1.1"?!R.processingMode||R.processingMode>="json-ld-"+S.toString():"json-ld-1.0"===R.processingMode,j.isKeyword=R=>{if(!p(R)||"@"!==R[0])return!1;switch(R){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},3120(Ze,Ne,Y){"use strict";var W=Y(9293).default;const{parseLinkHeader:M,buildHeaders:E}=Y(9420),{LINK_HEADER_CONTEXT:T}=Y(5315),I=Y(262),p=Y(4808),{prependBase:x}=Y(2051),m=/(^|(\r\n))link:/i;Ze.exports=({secure:D,headers:k={},xhr:G}={headers:{}})=>{return k=E(k),(new p).wrapLoader(O);function O(B){return $.apply(this,arguments)}function $(){return $=W(function*(B){if(0!==B.indexOf("http:")&&0!==B.indexOf("https:"))throw new I('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:B});if(D&&0!==B.indexOf("https"))throw new I('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:B});let re;try{re=yield function A(D,k,G){const P=new(D=D||XMLHttpRequest);return new Promise((O,$)=>{P.onload=()=>O(P),P.onerror=B=>$(B),P.open("GET",k,!0);for(const B in G)P.setRequestHeader(B,G[B]);P.send()})}(G,B,k)}catch(S){throw new I("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:B,cause:S})}if(re.status>=400)throw new I("URL could not be dereferenced: "+re.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:B,httpStatusCode:re.status});let j={contextUrl:null,documentUrl:B,document:re.response},xe=null;const ne=re.getResponseHeader("Content-Type");let R;if(m.test(re.getAllResponseHeaders())&&(R=re.getResponseHeader("Link")),R&&"application/ld+json"!==ne){const S=M(R),L=S[T];if(Array.isArray(L))throw new I("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:B});L&&(j.contextUrl=L.target),xe=S.alternate,xe&&"application/ld+json"==xe.type&&!(ne||"").match(/^application\/(\w*\+)?json$/)&&(j=yield O(x(B,xe.target)))}return j}),$.apply(this,arguments)}}},2585(Ze,Ne,Y){"use strict";const W=Y(262),{isArray:M}=Y(2831),{asArray:E}=Y(9420),T={};function I({event:x,handlers:m}){let A=!0;for(let D=0;A&&D<m.length;++D){A=!1;const k=m[D];if(M(k))A=I({event:x,handlers:k});else if("function"==typeof k)k({event:x,next:()=>{A=!0}});else{if("object"!=typeof k)throw new W("Invalid event handler.","jsonld.InvalidEventHandler",{event:x});x.code in k?k[x.code]({event:x,next:()=>{A=!0}}):A=!0}}return A}Ze.exports=T,T.defaultEventHandler=null,T.setupEventHandler=({options:x={}})=>{const m=[].concat(x.safe?T.safeEventHandler:[],x.eventHandler?E(x.eventHandler):[],T.defaultEventHandler?T.defaultEventHandler:[]);return 0===m.length?null:m},T.handleEvent=({event:x,options:m})=>{I({event:x,handlers:m.eventHandler})};const p=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);T.safeEventHandler=function({event:m,next:A}){if("warning"===m.level&&p.has(m.code))throw new W("Safe mode validation error.","jsonld.ValidationError",{event:m});A()},T.logEventHandler=function({event:m,next:A}){console.log(`EVENT: ${m.message}`,{event:m}),A()},T.logWarningEventHandler=function({event:m,next:A}){"warning"===m.level&&console.warn(`WARNING: ${m.message}`,{event:m}),A()},T.unhandledEventHandler=function({event:m}){throw new W("No handler for event.","jsonld.UnhandledEvent",{event:m})},T.setDefaultEventHandler=function({eventHandler:x}={}){T.defaultEventHandler=x?E(x):null}},7336(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(262),{isArray:E,isObject:T,isEmptyObject:I,isString:p,isUndefined:x}=Y(2831),{isList:m,isValue:A,isGraph:D,isSubject:k}=Y(4209),{expandIri:G,getContextValue:P,isKeyword:O,process:$,processingMode:B}=Y(429),{isAbsolute:re}=Y(2051),{REGEX_BCP47:j,REGEX_KEYWORD:xe,addValue:ne,asArray:R,getValues:S,validateTypeValue:L}=Y(9420),{handleEvent:_}=Y(2585),ee={};function ie({value:fe,count:te,options:ce}){if(0===te||"@value"in fe||"@list"in fe||1===te&&"@id"in fe){if(ce.eventHandler){let Me,pe;0===te?(Me="empty object",pe="Dropping empty object."):"@value"in fe?(Me="object with only @value",pe="Dropping object with only @value."):"@list"in fe?(Me="object with only @list",pe="Dropping object with only @list."):1===te&&"@id"in fe&&(Me="object with only @id",pe="Dropping object with only @id."),_({event:{type:["JsonLdEvent"],code:Me,level:"warning",message:pe,details:{value:fe}},options:ce})}return null}return fe}function H(fe){return ae.apply(this,arguments)}function ae(){return(ae=W(function*({activeCtx:fe,activeProperty:te,expandedActiveProperty:ce,element:Me,expandedParent:pe,options:se={},insideList:Re,typeKey:Je,typeScopedContext:qe}){const et=Object.keys(Me).sort(),ke=[];let We;const we=Me[Je]&&"@json"===G(fe,E(Me[Je])?Me[Je][0]:Me[Je],{vocab:!0},{...se,typeExpansion:!0});for(const oe of et){let Ye,Be=Me[oe];if("@context"===oe)continue;const Oe=G(fe,oe,{vocab:!0},se);if(null===Oe||!re(Oe)&&!O(Oe)){se.eventHandler&&_({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:oe,expandedProperty:Oe}},options:se});continue}if(O(Oe)){if("@reverse"===ce)throw new M("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:Be});if(Oe in pe&&"@included"!==Oe&&"@type"!==Oe)throw new M("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:Oe})}if("@id"===Oe){if(!p(Be)){if(!se.isFrame)throw new M('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:Be});if(T(Be)){if(!I(Be))throw new M('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Be})}else{if(!E(Be))throw new M('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Be});if(!Be.every(nt=>p(nt)))throw new M('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Be})}}ne(pe,"@id",R(Be).map(nt=>{if(p(nt)){const vt=G(fe,nt,{base:!0},se);return se.eventHandler&&(null===vt?_(null===nt?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:nt}},options:se}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:nt}},options:se}):re(vt)||_({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:nt,expandedId:vt}},options:se})),vt}return nt}),{propertyIsArray:se.isFrame});continue}if("@type"===Oe){T(Be)&&(Be=Object.fromEntries(Object.entries(Be).map(([nt,vt])=>[G(qe,nt,{vocab:!0}),R(vt).map(It=>G(qe,It,{base:!0,vocab:!0},{...se,typeExpansion:!0}))]))),L(Be,se.isFrame),ne(pe,"@type",R(Be).map(nt=>{if(p(nt)){const vt=G(qe,nt,{base:!0,vocab:!0},{...se,typeExpansion:!0});return"@json"!==vt&&!re(vt)&&se.eventHandler&&_({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:nt}},options:se}),vt}return nt}),{propertyIsArray:!!se.isFrame});continue}if("@included"===Oe&&B(fe,1.1)){const nt=R(yield ee.expand({activeCtx:fe,activeProperty:te,element:Be,options:se}));if(!nt.every(vt=>k(vt)))throw new M("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:Be});ne(pe,"@included",nt,{propertyIsArray:!0});continue}if("@graph"===Oe&&!T(Be)&&!E(Be))throw new M('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:Be});if("@value"===Oe){We=Be,we&&B(fe,1.1)?pe["@value"]=Be:ne(pe,"@value",Be,{propertyIsArray:se.isFrame});continue}if("@language"===Oe){if(null===Be)continue;if(!p(Be)&&!se.isFrame)throw new M('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:Be});Be=R(Be).map(nt=>p(nt)?nt.toLowerCase():nt);for(const nt of Be)p(nt)&&!nt.match(j)&&se.eventHandler&&_({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:nt}},options:se});ne(pe,"@language",Be,{propertyIsArray:se.isFrame});continue}if("@direction"===Oe){if(!p(Be)&&!se.isFrame)throw new M('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:Be});Be=R(Be);for(const nt of Be)if(p(nt)&&"ltr"!==nt&&"rtl"!==nt)throw new M('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:Be});ne(pe,"@direction",Be,{propertyIsArray:se.isFrame});continue}if("@index"===Oe){if(!p(Be))throw new M('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:Be});ne(pe,"@index",Be);continue}if("@reverse"===Oe){if(!T(Be))throw new M('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:Be});if(Ye=yield ee.expand({activeCtx:fe,activeProperty:"@reverse",element:Be,options:se}),"@reverse"in Ye)for(const vt in Ye["@reverse"])ne(pe,vt,Ye["@reverse"][vt],{propertyIsArray:!0});let nt=pe["@reverse"]||null;for(const vt in Ye){if("@reverse"===vt)continue;null===nt&&(nt=pe["@reverse"]={}),ne(nt,vt,[],{propertyIsArray:!0});const It=Ye[vt];for(let $t=0;$t<It.length;++$t){const xr=It[$t];if(A(xr)||m(xr))throw new M('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:Ye});ne(nt,vt,xr,{propertyIsArray:!0})}}continue}if("@nest"===Oe){ke.push(oe);continue}let it=fe;const _e=P(fe,oe,"@context");x(_e)||(it=yield $({activeCtx:fe,localCtx:_e,propagate:!0,overrideProtected:!0,options:se}));const xt=P(fe,oe,"@container")||[];if(xt.includes("@language")&&T(Be))Ye=ve(it,Be,P(it,oe,"@direction"),se);else if(xt.includes("@index")&&T(Be)){const nt=xt.includes("@graph"),vt=P(it,oe,"@index")||"@index",It="@index"!==vt&&G(fe,vt,{vocab:!0},se);Ye=yield Ee({activeCtx:it,options:se,activeProperty:oe,value:Be,asGraph:nt,indexKey:vt,propertyIndex:It})}else if(xt.includes("@id")&&T(Be)){const nt=xt.includes("@graph");Ye=yield Ee({activeCtx:it,options:se,activeProperty:oe,value:Be,asGraph:nt,indexKey:"@id"})}else if(xt.includes("@type")&&T(Be))Ye=yield Ee({activeCtx:it.revertToPreviousContext(),options:se,activeProperty:oe,value:Be,asGraph:!1,indexKey:"@type"});else{const nt="@list"===Oe;if(nt||"@set"===Oe){let vt=te;nt&&"@graph"===ce&&(vt=null),Ye=yield ee.expand({activeCtx:it,activeProperty:vt,element:Be,options:se,insideList:nt})}else Ye="@json"===P(fe,oe,"@type")?{"@type":"@json","@value":Be}:yield ee.expand({activeCtx:it,activeProperty:oe,element:Be,options:se,insideList:!1})}if(null!==Ye||"@value"===Oe){if("@list"!==Oe&&!m(Ye)&&xt.includes("@list")&&(Ye={"@list":R(Ye)}),xt.includes("@graph")&&!xt.some(nt=>"@id"===nt||"@index"===nt)){if(Ye=R(Ye),se.isFrame||(Ye=Ye.filter(nt=>null!==ie({value:nt,count:Object.keys(nt).length,options:se}))),0===Ye.length)continue;Ye=Ye.map(nt=>({"@graph":R(nt)}))}if(it.mappings.has(oe)&&it.mappings.get(oe).reverse){const nt=pe["@reverse"]=pe["@reverse"]||{};Ye=R(Ye);for(let vt=0;vt<Ye.length;++vt){const It=Ye[vt];if(A(It)||m(It))throw new M('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:Ye});ne(nt,Oe,It,{propertyIsArray:!0})}continue}ne(pe,Oe,Ye,{propertyIsArray:!0})}}if("@value"in pe&&("@json"!==pe["@type"]||!B(fe,1.1))&&(T(We)||E(We))&&!se.isFrame)throw new M('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:We});for(const oe of ke){const Be=E(Me[oe])?Me[oe]:[Me[oe]];for(const Ye of Be){if(!T(Ye)||Object.keys(Ye).some(Oe=>"@value"===G(fe,Oe,{vocab:!0},se)))throw new M("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:Ye});yield H({activeCtx:fe,activeProperty:te,expandedActiveProperty:ce,element:Ye,expandedParent:pe,options:se,insideList:Re,typeScopedContext:qe,typeKey:Je})}}})).apply(this,arguments)}function me({activeCtx:fe,activeProperty:te,value:ce,options:Me}){if(null==ce)return null;const pe=G(fe,te,{vocab:!0},Me);if("@id"===pe)return G(fe,ce,{base:!0},Me);if("@type"===pe)return G(fe,ce,{vocab:!0,base:!0},{...Me,typeExpansion:!0});const se=P(fe,te,"@type");if(("@id"===se||"@graph"===pe)&&p(ce)){const Je=G(fe,ce,{base:!0},Me);return null===Je&&ce.match(xe)&&Me.eventHandler&&_({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:te}},options:Me}),{"@id":Je}}if("@vocab"===se&&p(ce))return{"@id":G(fe,ce,{vocab:!0,base:!0},Me)};if(O(pe))return ce;const Re={};if(se&&!["@id","@vocab","@none"].includes(se))Re["@type"]=se;else if(p(ce)){const Je=P(fe,te,"@language");null!==Je&&(Re["@language"]=Je);const qe=P(fe,te,"@direction");null!==qe&&(Re["@direction"]=qe)}return["boolean","number","string"].includes(typeof ce)||(ce=ce.toString()),Re["@value"]=ce,Re}function ve(fe,te,ce,Me){const pe=[],se=Object.keys(te).sort();for(const Re of se){const Je=G(fe,Re,{vocab:!0},Me);let qe=te[Re];E(qe)||(qe=[qe]);for(const et of qe){if(null===et)continue;if(!p(et))throw new M("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:te});const ke={"@value":et};"@none"!==Je&&(Re.match(j)||Me.eventHandler&&_({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:Re}},options:Me}),ke["@language"]=Re.toLowerCase()),ce&&(ke["@direction"]=ce),pe.push(ke)}}return pe}function Ee(fe){return Ge.apply(this,arguments)}function Ge(){return(Ge=W(function*({activeCtx:fe,options:te,activeProperty:ce,value:Me,asGraph:pe,indexKey:se,propertyIndex:Re}){const Je=[],qe=Object.keys(Me).sort(),et="@type"===se;for(let ke of qe){if(et){const oe=P(fe,ke,"@context");x(oe)||(fe=yield $({activeCtx:fe,localCtx:oe,propagate:!1,options:te}))}let we,We=Me[ke];E(We)||(We=[We]),We=yield ee.expand({activeCtx:fe,activeProperty:ce,element:We,options:te,insideList:!1,insideIndex:!0}),we=Re?"@none"===ke?"@none":me({activeCtx:fe,activeProperty:se,value:ke,options:te}):G(fe,ke,{vocab:!0},te),"@id"===se?ke=G(fe,ke,{base:!0},te):et&&(ke=we);for(let oe of We){if(pe&&!D(oe)&&(oe={"@graph":[oe]}),"@type"===se)"@none"===we||(oe["@type"]=oe["@type"]?[ke].concat(oe["@type"]):[ke]);else{if(A(oe)&&!["@language","@type","@index"].includes(se))throw new M(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${se}".`,"jsonld.SyntaxError",{code:"invalid value object",value:oe});Re?"@none"!==we&&ne(oe,Re,we,{propertyIsArray:!0,prependValue:!0}):"@none"!==we&&!(se in oe)&&(oe[se]=ke)}Je.push(oe)}}return Je})).apply(this,arguments)}Ze.exports=ee,ee.expand=function(){var fe=W(function*({activeCtx:te,activeProperty:ce=null,element:Me,options:pe={},insideList:se=!1,insideIndex:Re=!1,typeScopedContext:Je=null}){if(null==Me)return null;if("@default"===ce&&(pe=Object.assign({},pe,{isFrame:!1})),!E(Me)&&!T(Me))return se||null!==ce&&"@graph"!==G(te,ce,{vocab:!0},pe)?me({activeCtx:te,activeProperty:ce,value:Me,options:pe}):(pe.eventHandler&&_({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Me}},options:pe}),null);if(E(Me)){let Ye=[];const Oe=P(te,ce,"@container")||[];se=se||Oe.includes("@list");for(let it=0;it<Me.length;++it){let _e=yield ee.expand({activeCtx:te,activeProperty:ce,element:Me[it],options:pe,insideIndex:Re,typeScopedContext:Je});se&&E(_e)&&(_e={"@list":_e}),null!==_e&&(E(_e)?Ye=Ye.concat(_e):Ye.push(_e))}return Ye}const qe=G(te,ce,{vocab:!0},pe),et=P(te,ce,"@context");Je=Je||(te.previousContext?te:null);let ke=Object.keys(Me).sort(),We=!Re;if(We&&Je&&ke.length<=2&&!ke.includes("@context"))for(const Ye of ke){const Oe=G(Je,Ye,{vocab:!0},pe);if("@value"===Oe){We=!1,te=Je;break}if("@id"===Oe&&1===ke.length){We=!1;break}}We&&(te=te.revertToPreviousContext()),x(et)||(te=yield $({activeCtx:te,localCtx:et,propagate:!0,overrideProtected:!0,options:pe})),"@context"in Me&&(te=yield $({activeCtx:te,localCtx:Me["@context"],options:pe})),Je=te;let we=null;for(const Ye of ke)if("@type"===G(te,Ye,{vocab:!0},pe)){we=we||Ye;const it=Me[Ye],_e=Array.isArray(it)?it.length>1?it.slice().sort():it:[it];for(const xt of _e){const nt=P(Je,xt,"@context");x(nt)||(te=yield $({activeCtx:te,localCtx:nt,options:pe,propagate:!1}))}}let oe={};yield H({activeCtx:te,activeProperty:ce,expandedActiveProperty:qe,element:Me,expandedParent:oe,options:pe,insideList:se,typeKey:we,typeScopedContext:Je}),ke=Object.keys(oe);let Be=ke.length;if("@value"in oe){if("@type"in oe&&("@language"in oe||"@direction"in oe))throw new M('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:oe});let Ye=Be-1;if("@type"in oe&&(Ye-=1),"@index"in oe&&(Ye-=1),"@language"in oe&&(Ye-=1),"@direction"in oe&&(Ye-=1),0!==Ye)throw new M('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:oe});const Oe=null===oe["@value"]?[]:R(oe["@value"]),it=S(oe,"@type");if(!B(te,1.1)||!it.includes("@json")||1!==it.length)if(0===Oe.length)pe.eventHandler&&_({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:oe}},options:pe}),oe=null;else{if(!Oe.every(_e=>p(_e)||I(_e))&&"@language"in oe)throw new M("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:oe});if(!it.every(_e=>re(_e)&&!(p(_e)&&0===_e.indexOf("_:"))||I(_e)))throw new M('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:oe})}}else if("@type"in oe&&!E(oe["@type"]))oe["@type"]=[oe["@type"]];else if("@set"in oe||"@list"in oe){if(Be>1&&(2!==Be||!("@index"in oe)))throw new M('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:oe});"@set"in oe&&(oe=oe["@set"],ke=Object.keys(oe),Be=ke.length)}else 1===Be&&"@language"in oe&&(pe.eventHandler&&_({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:oe}},options:pe}),oe=null);return T(oe)&&!pe.keepFreeFloatingNodes&&!se&&(null===ce||"@graph"===qe||(P(te,ce,"@container")||[]).includes("@graph"))&&(oe=ie({value:oe,count:Be,options:pe})),oe});return function(te){return fe.apply(this,arguments)}}()},9392(Ze,Ne,Y){"use strict";const{isSubjectReference:W}=Y(4209),{createMergedNodeMap:M}=Y(5096),E={};Ze.exports=E,E.flatten=T=>{const I=M(T),p=[],x=Object.keys(I).sort();for(let m=0;m<x.length;++m){const A=I[x[m]];W(A)||p.push(A)}return p}},7031(Ze,Ne,Y){"use strict";const{isKeyword:W}=Y(429),M=Y(4209),E=Y(2831),T=Y(9420),I=Y(2051),p=Y(262),{createNodeMap:x,mergeNodeMapGraphs:m}=Y(5096),A={};function D(R){const S={};for(const L in R)void 0!==R[L]&&(S["@"+L]=[R[L]]);return[S]}function k(R,S,L){for(let _=L.length-1;_>=0;--_){const ee=L[_];if(ee.graph===S&&ee.subject["@id"]===R["@id"])return!0}return!1}function G(R,S,L){const _="@"+L;let ee=_ in R?R[_][0]:S[L];if("embed"===L)if(!0===ee)ee="@once";else if(!1===ee)ee="@never";else if("@always"!==ee&&"@never"!==ee&&"@link"!==ee&&"@first"!==ee&&"@last"!==ee&&"@once"!==ee)throw new p("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:R});return ee}function P(R){if(!E.isArray(R)||1!==R.length||!E.isObject(R[0]))throw new p("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:R});if("@id"in R[0])for(const S of T.asArray(R[0]["@id"]))if(!E.isObject(S)&&!I.isAbsolute(S)||E.isString(S)&&0===S.indexOf("_:"))throw new p("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:R});if("@type"in R[0])for(const S of T.asArray(R[0]["@type"]))if(!E.isObject(S)&&!I.isAbsolute(S)&&"@json"!==S||E.isString(S)&&0===S.indexOf("_:"))throw new p("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:R})}function $(R,S,L,_){let ee=!0,ie=!1;for(const H in L){let ae=!1;const me=T.getValues(S,H),ve=0===T.getValues(L,H).length;if("@id"===H){if(E.isEmptyObject(L["@id"][0]||{})?ae=!0:L["@id"].length>=0&&(ae=L["@id"].includes(me[0])),!_.requireAll)return ae}else if("@type"===H){if(ee=!1,ve){if(me.length>0)return!1;ae=!0}else if(1===L["@type"].length&&E.isEmptyObject(L["@type"][0]))ae=me.length>0;else for(const Ee of L["@type"])ae=!(!E.isObject(Ee)||!("@default"in Ee))||ae||me.some(Ge=>Ge===Ee);if(!_.requireAll)return ae}else{if(W(H))continue;{const Ee=T.getValues(L,H)[0];let Ge=!1;if(Ee&&(P([Ee]),Ge="@default"in Ee),ee=!1,0===me.length&&Ge)continue;if(me.length>0&&ve)return!1;if(void 0===Ee){if(me.length>0)return!1;ae=!0}else if(M.isList(Ee)){const fe=Ee["@list"][0];if(M.isList(me[0])){const te=me[0]["@list"];M.isValue(fe)?ae=te.some(ce=>ne(fe,ce)):(M.isSubject(fe)||M.isSubjectReference(fe))&&(ae=te.some(ce=>xe(R,fe,ce,_)))}}else ae=M.isValue(Ee)?me.some(fe=>ne(Ee,fe)):M.isSubjectReference(Ee)?me.some(fe=>xe(R,Ee,fe,_)):!!E.isObject(Ee)&&me.length>0}}if(!ae&&_.requireAll)return!1;ie=ie||ae}return ee||ie}function B(R,S){const L=R.uniqueEmbeds[R.graph],_=L[S],ee=_.parent,ie=_.property,H={"@id":S};if(E.isArray(ee)){for(let me=0;me<ee.length;++me)if(T.compareValues(ee[me],H)){ee[me]=H;break}}else{const me=E.isArray(ee[ie]);T.removeValue(ee,ie,H,{propertyIsArray:me}),T.addValue(ee,ie,H,{propertyIsArray:me})}const ae=me=>{const ve=Object.keys(L);for(const Ee of ve)Ee in L&&E.isObject(L[Ee].parent)&&L[Ee].parent["@id"]===me&&(delete L[Ee],ae(Ee))};ae(S)}function re(R,S){if(E.isArray(R))return R.map(L=>re(L,S));if(E.isObject(R)){if("@preserve"in R)return R["@preserve"][0];if(M.isValue(R))return R;if(M.isList(R))return R["@list"]=re(R["@list"],S),R;if("@id"in R){const L=R["@id"];if(S.link.hasOwnProperty(L)){const _=S.link[L].indexOf(R);if(-1!==_)return S.link[L][_];S.link[L].push(R)}else S.link[L]=[R]}for(const L in R)"@id"===L&&S.bnodesToClear.includes(R[L])?delete R["@id"]:R[L]=re(R[L],S)}return R}function j(R,S,L){E.isObject(R)?T.addValue(R,S,L,{propertyIsArray:!0}):R.push(L)}function xe(R,S,L,_){if(!("@id"in L))return!1;const ee=R.subjects[L["@id"]];return ee&&$(R,ee,S,_)}function ne(R,S){const L=S["@value"],_=S["@type"],ee=S["@language"],ie=R["@value"]?E.isArray(R["@value"])?R["@value"]:[R["@value"]]:[],H=R["@type"]?E.isArray(R["@type"])?R["@type"]:[R["@type"]]:[],ae=R["@language"]?E.isArray(R["@language"])?R["@language"]:[R["@language"]]:[];return 0===ie.length&&0===H.length&&0===ae.length||!(!ie.includes(L)&&!E.isEmptyObject(ie[0])||!(!_&&0===H.length||H.includes(_)||_&&E.isEmptyObject(H[0]))||!(!ee&&0===ae.length||ae.includes(ee)||ee&&E.isEmptyObject(ae[0])))}Ze.exports=A,A.frameMergedOrDefault=(R,S,L)=>{const _={options:L,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},ee=new T.IdentifierIssuer("_:b");x(R,_.graphMap,"@default",ee),L.merged&&(_.graphMap["@merged"]=m(_.graphMap),_.graph="@merged"),_.subjects=_.graphMap[_.graph];const ie=[];return A.frame(_,Object.keys(_.subjects).sort(),S,ie),L.pruneBlankNodeIdentifiers&&(L.bnodesToClear=Object.keys(_.bnodeMap).filter(H=>1===_.bnodeMap[H].length)),L.link={},re(ie,L)},A.frame=(R,S,L,_,ee=null)=>{P(L);const ie=R.options,H={embed:G(L=L[0],ie,"embed"),explicit:G(L,ie,"explicit"),requireAll:G(L,ie,"requireAll")};R.link.hasOwnProperty(R.graph)||(R.link[R.graph]={});const ae=R.link[R.graph],me=function O(R,S,L,_){const ee={};for(const ie of S){const H=R.graphMap[R.graph][ie];$(R,H,L,_)&&(ee[ie]=H)}return ee}(R,S,L,H),ve=Object.keys(me).sort();for(const Ee of ve){const Ge=me[Ee];if(null===ee?R.uniqueEmbeds={[R.graph]:{}}:R.uniqueEmbeds[R.graph]=R.uniqueEmbeds[R.graph]||{},"@link"===H.embed&&Ee in ae){j(_,ee,ae[Ee]);continue}const fe={"@id":Ee};if(0===Ee.indexOf("_:")&&T.addValue(R.bnodeMap,Ee,fe,{propertyIsArray:!0}),ae[Ee]=fe,("@first"===H.embed||"@last"===H.embed)&&R.is11)throw new p("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:L});if(R.embedded||!R.uniqueEmbeds[R.graph].hasOwnProperty(Ee)){if(R.embedded&&("@never"===H.embed||k(Ge,R.graph,R.subjectStack))){j(_,ee,fe);continue}if(R.embedded&&("@first"==H.embed||"@once"==H.embed)&&R.uniqueEmbeds[R.graph].hasOwnProperty(Ee)){j(_,ee,fe);continue}if("@last"===H.embed&&Ee in R.uniqueEmbeds[R.graph]&&B(R,Ee),R.uniqueEmbeds[R.graph][Ee]={parent:_,property:ee},R.subjectStack.push({subject:Ge,graph:R.graph}),Ee in R.graphMap){let te=!1,ce=null;"@graph"in L?(ce=L["@graph"][0],te=!("@merged"===Ee||"@default"===Ee),E.isObject(ce)||(ce={})):(te="@merged"!==R.graph,ce={}),te&&A.frame({...R,graph:Ee,embedded:!1},Object.keys(R.graphMap[Ee]).sort(),[ce],fe,"@graph")}"@included"in L&&A.frame({...R,embedded:!1},S,L["@included"],fe,"@included");for(const te of Object.keys(Ge).sort())if(W(te)){if(fe[te]=T.clone(Ge[te]),"@type"===te)for(const ce of Ge["@type"])0===ce.indexOf("_:")&&T.addValue(R.bnodeMap,ce,fe,{propertyIsArray:!0})}else if(!H.explicit||te in L)for(const ce of Ge[te]){const Me=te in L?L[te]:D(H);if(M.isList(ce)){const pe=L[te]&&L[te][0]&&L[te][0]["@list"]?L[te][0]["@list"]:D(H),se={"@list":[]};j(fe,te,se);const Re=ce["@list"];for(const Je of Re)M.isSubjectReference(Je)?A.frame({...R,embedded:!0},[Je["@id"]],pe,se,"@list"):j(se,"@list",T.clone(Je))}else M.isSubjectReference(ce)?A.frame({...R,embedded:!0},[ce["@id"]],Me,fe,te):ne(Me[0],ce)&&j(fe,te,T.clone(ce))}for(const te of Object.keys(L).sort()){if("@type"===te){if(!E.isObject(L[te][0])||!("@default"in L[te][0]))continue}else if(W(te))continue;const ce=L[te][0]||{};if(!G(ce,ie,"omitDefault")&&!(te in fe)){let pe="@null";"@default"in ce&&(pe=T.clone(ce["@default"])),E.isArray(pe)||(pe=[pe]),fe[te]=[{"@preserve":pe}]}}for(const te of Object.keys(L["@reverse"]||{}).sort()){const ce=L["@reverse"][te];for(const Me of Object.keys(R.subjects))T.getValues(R.subjects[Me],te).some(se=>se["@id"]===Ee)&&(fe["@reverse"]=fe["@reverse"]||{},T.addValue(fe["@reverse"],te,[],{propertyIsArray:!0}),A.frame({...R,embedded:!0},[Me],ce,fe["@reverse"][te],ee))}j(_,ee,fe),R.subjectStack.pop()}}},A.cleanupNull=(R,S)=>{if(E.isArray(R))return R.map(_=>A.cleanupNull(_,S)).filter(_=>_);if("@null"===R)return null;if(E.isObject(R)){if("@id"in R){const L=R["@id"];if(S.link.hasOwnProperty(L)){const _=S.link[L].indexOf(R);if(-1!==_)return S.link[L][_];S.link[L].push(R)}else S.link[L]=[R]}for(const L in R)R[L]=A.cleanupNull(R[L],S)}return R}},4814(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(262),E=Y(4209),T=Y(2831),{REGEX_BCP47:I,addValue:p}=Y(9420),{handleEvent:x}=Y(2585),{RDF_LIST:m,RDF_FIRST:A,RDF_REST:D,RDF_NIL:k,RDF_TYPE:G,RDF_JSON_LITERAL:P,XSD_BOOLEAN:O,XSD_DOUBLE:$,XSD_INTEGER:B,XSD_STRING:re}=Y(5315),j={};function xe(ne,R,S,L){if(ne.termType.endsWith("Node"))return{"@id":ne.value};const _={"@value":ne.value};if(ne.language)ne.language.match(I)||L.eventHandler&&x({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ne.language}},options:L}),_["@language"]=ne.language;else{let ee=ne.datatype.value;if(ee||(ee=re),ee===P){ee="@json";try{_["@value"]=JSON.parse(_["@value"])}catch(ie){throw new M("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:_["@value"],cause:ie})}}if(R){if(ee===O)"true"===_["@value"]?_["@value"]=!0:"false"===_["@value"]&&(_["@value"]=!1);else if(T.isNumeric(_["@value"]))if(ee===B){const ie=parseInt(_["@value"],10);ie.toFixed(0)===_["@value"]&&(_["@value"]=ie)}else ee===$&&(_["@value"]=parseFloat(_["@value"]));[O,B,$,re].includes(ee)||(_["@type"]=ee)}else if("i18n-datatype"===S&&ee.startsWith("https://www.w3.org/ns/i18n#")){const[,ie,H]=ee.split(/[#_]/);ie.length>0&&(_["@language"]=ie,ie.match(I)||L.eventHandler&&x({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ie}},options:L})),_["@direction"]=H}else ee!==re&&(_["@type"]=ee)}return _}Ze.exports=j,j.fromRDF=function(){var ne=W(function*(R,S){const{useRdfType:L=!1,useNativeTypes:_=!1,rdfDirection:ee=null}=S,ie={},H={"@default":ie},ae={};if(ee){if("compound-literal"===ee)throw new M("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:ee});if("i18n-datatype"!==ee)throw new M("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:ee})}for(const Ee of R){const Ge="DefaultGraph"===Ee.graph.termType?"@default":Ee.graph.value;Ge in H||(H[Ge]={}),"@default"!==Ge&&!(Ge in ie)&&(ie[Ge]={"@id":Ge});const fe=H[Ge],te=Ee.subject.value,ce=Ee.predicate.value,Me=Ee.object;te in fe||(fe[te]={"@id":te});const pe=fe[te],se=Me.termType.endsWith("Node");if(se&&!(Me.value in fe)&&(fe[Me.value]={"@id":Me.value}),ce===G&&!L&&se){p(pe,"@type",Me.value,{propertyIsArray:!0});continue}const Re=xe(Me,_,ee,S);if(p(pe,ce,Re,{propertyIsArray:!0}),se)if(Me.value===k){const Je=fe[Me.value];"usages"in Je||(Je.usages=[]),Je.usages.push({node:pe,property:ce,value:Re})}else ae[Me.value]=!(Me.value in ae)&&{node:pe,property:ce,value:Re}}for(const Ee in H){const Ge=H[Ee];if(!(k in Ge))continue;const fe=Ge[k];if(fe.usages){for(let te of fe.usages){let ce=te.node,Me=te.property,pe=te.value;const se=[],Re=[];let Je=Object.keys(ce).length;for(;Me===D&&T.isObject(ae[ce["@id"]])&&T.isArray(ce[A])&&1===ce[A].length&&T.isArray(ce[D])&&1===ce[D].length&&(3===Je||4===Je&&T.isArray(ce["@type"])&&1===ce["@type"].length&&ce["@type"][0]===m)&&(se.push(ce[A][0]),Re.push(ce["@id"]),te=ae[ce["@id"]],ce=te.node,Me=te.property,pe=te.value,Je=Object.keys(ce).length,E.isBlankNode(ce)););delete pe["@id"],pe["@list"]=se.reverse();for(const qe of Re)delete Ge[qe]}delete fe.usages}}const me=[],ve=Object.keys(ie).sort();for(const Ee of ve){const Ge=ie[Ee];if(Ee in H){const fe=Ge["@graph"]=[],te=H[Ee],ce=Object.keys(te).sort();for(const Me of ce){const pe=te[Me];E.isSubjectReference(pe)||fe.push(pe)}}E.isSubjectReference(Ge)||me.push(Ge)}return me});return function(R,S){return ne.apply(this,arguments)}}()},4209(Ze,Ne,Y){"use strict";const W=Y(2831),M={};Ze.exports=M,M.isSubject=E=>!(!W.isObject(E)||"@value"in E||"@set"in E||"@list"in E)&&(Object.keys(E).length>1||!("@id"in E)),M.isSubjectReference=E=>W.isObject(E)&&1===Object.keys(E).length&&"@id"in E,M.isValue=E=>W.isObject(E)&&"@value"in E,M.isList=E=>W.isObject(E)&&"@list"in E,M.isGraph=E=>W.isObject(E)&&"@graph"in E&&1===Object.keys(E).filter(T=>"@id"!==T&&"@index"!==T).length,M.isSimpleGraph=E=>M.isGraph(E)&&!("@id"in E),M.isBlankNode=E=>{if(W.isObject(E)){if("@id"in E){const T=E["@id"];return!W.isString(T)||0===T.indexOf("_:")}return 0===Object.keys(E).length||!("@value"in E||"@set"in E||"@list"in E)}return!1}},2130(Ze,Ne,Y){var W=Y(9293).default;const M=Y(1224),E=Y(8666),T=Y(9420),I=Y(7839),p=T.IdentifierIssuer,x=Y(262),m=Y(3052),A=Y(5426),{expand:D}=Y(7336),{flatten:k}=Y(9392),{fromRDF:G}=Y(4814),{toRDF:P}=Y(6397),{frameMergedOrDefault:O,cleanupNull:$}=Y(7031),{isArray:B,isObject:re,isString:j}=Y(2831),{isSubjectReference:xe}=Y(4209),{expandIri:ne,getInitialContext:R,process:S,processingMode:L}=Y(429),{compact:_,compactIri:ee}=Y(3763),{createNodeMap:ie,createMergedNodeMap:H,mergeNodeMaps:ae}=Y(5096),{logEventHandler:me,logWarningEventHandler:ve,safeEventHandler:Ee,setDefaultEventHandler:Ge,setupEventHandler:fe,strictEventHandler:te,unhandledEventHandler:ce}=Y(2585),Me=function(se){const Re={},qe=new m({max:100});function et(ke,{documentLoader:We=se.documentLoader,...we}){if(ke&&"compactionMap"in ke)throw new x('"compactionMap" not supported.',"jsonld.OptionsError");if(ke&&"expansionMap"in ke)throw new x('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:We},we,ke,{eventHandler:fe({options:ke})})}return se.compact=function(){var ke=W(function*(We,we,oe){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===we)throw new x("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===We)return null;let Be;(oe=et(oe,{base:j(We)?We:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new p("_:b"),contextResolver:new I({sharedCache:qe})})).link&&(oe.skipExpansion=!0),oe.compactToRelative||delete oe.base,Be=oe.skipExpansion?We:yield se.expand(We,oe);const Ye=yield se.processContext(R(oe),we,oe);let Oe=yield _({activeCtx:Ye,element:Be,options:oe});oe.compactArrays&&!oe.graph&&B(Oe)?1===Oe.length?Oe=Oe[0]:0===Oe.length&&(Oe={}):oe.graph&&re(Oe)&&(Oe=[Oe]),re(we)&&"@context"in we&&(we=we["@context"]),we=T.clone(we),B(we)||(we=[we]);const it=we;we=[];for(let xt=0;xt<it.length;++xt)(!re(it[xt])||Object.keys(it[xt]).length>0)&&we.push(it[xt]);const _e=we.length>0;if(1===we.length&&(we=we[0]),B(Oe)){const xt=ee({activeCtx:Ye,iri:"@graph",relativeTo:{vocab:!0}}),nt=Oe;Oe={},_e&&(Oe["@context"]=we),Oe[xt]=nt}else if(re(Oe)&&_e){const xt=Oe;Oe={"@context":we};for(const nt in xt)Oe[nt]=xt[nt]}return Oe});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.expand=function(){var ke=W(function*(We,we){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const oe={},Be=[];if("expandContext"in(we=et(we,{keepFreeFloatingNodes:!1,contextResolver:new I({sharedCache:qe})}))){const _e=T.clone(we.expandContext);oe.expandContext=re(_e)&&"@context"in _e?_e:{"@context":_e},Be.push(oe.expandContext)}let Ye;if(j(We)){const _e=yield se.get(We,we);Ye=_e.documentUrl,oe.input=_e.document,_e.contextUrl&&(oe.remoteContext={"@context":_e.contextUrl},Be.push(oe.remoteContext))}else oe.input=T.clone(We);"base"in we||(we.base=Ye||"");let Oe=R(we);for(const _e of Be)Oe=yield S({activeCtx:Oe,localCtx:_e,options:we});let it=yield D({activeCtx:Oe,element:oe.input,options:we});return re(it)&&"@graph"in it&&1===Object.keys(it).length?it=it["@graph"]:null===it&&(it=[]),B(it)||(it=[it]),it});return function(We,we){return ke.apply(this,arguments)}}(),se.flatten=function(){var ke=W(function*(We,we,oe){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");we="function"==typeof we?null:we||null,oe=et(oe,{base:j(We)?We:"",contextResolver:new I({sharedCache:qe})});const Be=yield se.expand(We,oe),Ye=k(Be);return null===we?Ye:(oe.graph=!0,oe.skipExpansion=!0,yield se.compact(Ye,we,oe))});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.frame=function(){var ke=W(function*(We,we,oe){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(oe=et(oe,{base:j(We)?We:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new I({sharedCache:qe})}),j(we)){const It=yield se.get(we,oe);if(we=It.document,It.contextUrl){let $t=we["@context"];$t?B($t)?$t.push(It.contextUrl):$t=[$t,It.contextUrl]:$t=It.contextUrl,we["@context"]=$t}}const Be=we&&we["@context"]||{},Ye=yield se.processContext(R(oe),Be,oe);oe.hasOwnProperty("omitGraph")||(oe.omitGraph=L(Ye,1.1)),oe.hasOwnProperty("pruneBlankNodeIdentifiers")||(oe.pruneBlankNodeIdentifiers=L(Ye,1.1));const Oe=yield se.expand(We,oe),it={...oe};it.isFrame=!0,it.keepFreeFloatingNodes=!0;const _e=yield se.expand(we,it),xt=Object.keys(we).map(It=>ne(Ye,It,{vocab:!0}));it.merged=!xt.includes("@graph"),it.is11=L(Ye,1.1);const nt=O(Oe,_e,it);it.graph=!oe.omitGraph,it.skipExpansion=!0,it.link={},it.framing=!0;let vt=yield se.compact(nt,Be,it);return it.link={},vt=$(vt,it),vt});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.link=function(){var ke=W(function*(We,we,oe){const Be={};return we&&(Be["@context"]=we),Be["@embed"]="@link",se.frame(We,Be,oe)});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.normalize=se.canonize=function(){var ke=W(function*(We,we){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(we=et(we,{base:j(We)?We:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new I({sharedCache:qe})}))){if("application/n-quads"!==we.inputFormat&&"application/nquads"!==we.inputFormat)throw new x("Unknown canonicalization input format.","jsonld.CanonizeError");const Ye=A.parse(We);return M.canonize(Ye,we)}const oe={...we};delete oe.format,oe.produceGeneralizedRdf=!1;const Be=yield se.toRDF(We,oe);return M.canonize(Be,we)});return function(We,we){return ke.apply(this,arguments)}}(),se.fromRDF=function(){var ke=W(function*(We,we){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");we=et(we,{format:j(We)?"application/n-quads":void 0});const{format:oe}=we;let{rdfParser:Be}=we;if(oe){if(Be=Be||Re[oe],!Be)throw new x("Unknown input format.","jsonld.UnknownFormat",{format:oe})}else Be=()=>We;const Ye=yield Be(We);return G(Ye,we)});return function(We,we){return ke.apply(this,arguments)}}(),se.toRDF=function(){var ke=W(function*(We,we){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let oe;oe=(we=et(we,{base:j(We)?We:"",skipExpansion:!1,contextResolver:new I({sharedCache:qe})})).skipExpansion?We:yield se.expand(We,we);const Be=P(oe,we);if(we.format){if("application/n-quads"===we.format||"application/nquads"===we.format)return A.serialize(Be);throw new x("Unknown output format.","jsonld.UnknownFormat",{format:we.format})}return Be});return function(We,we){return ke.apply(this,arguments)}}(),se.createNodeMap=function(){var ke=W(function*(We,we){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");we=et(we,{base:j(We)?We:"",contextResolver:new I({sharedCache:qe})});const oe=yield se.expand(We,we);return H(oe,we)});return function(We,we){return ke.apply(this,arguments)}}(),se.merge=function(){var ke=W(function*(We,we,oe){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!B(We))throw new TypeError('Could not merge, "docs" must be an array.');we="function"==typeof we?null:we||null,oe=et(oe,{contextResolver:new I({sharedCache:qe})});const Be=yield Promise.all(We.map(It=>{const $t={...oe};return se.expand(It,$t)}));let Ye=!0;"mergeNodes"in oe&&(Ye=oe.mergeNodes);const Oe=oe.issuer||new p("_:b"),it={"@default":{}};for(let It=0;It<Be.length;++It){const $t=T.relabelBlankNodes(Be[It],{issuer:new p("_:b"+It+"-")}),xr=Ye||0===It?it:{"@default":{}};if(ie($t,xr,"@default",Oe),xr!==it)for(const gn in xr){const ia=xr[gn];if(!(gn in it)){it[gn]=ia;continue}const Sr=it[gn];for(const sa in ia)sa in Sr||(Sr[sa]=ia[sa])}}const _e=ae(it),xt=[],nt=Object.keys(_e).sort();for(let It=0;It<nt.length;++It){const $t=_e[nt[It]];xe($t)||xt.push($t)}return null===we?xt:(oe.graph=!0,oe.skipExpansion=!0,yield se.compact(xt,we,oe))});return function(We,we,oe){return ke.apply(this,arguments)}}(),Object.defineProperty(se,"documentLoader",{get:()=>se._documentLoader,set:ke=>se._documentLoader=ke}),se.documentLoader=function(){var ke=W(function*(We){throw new x("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:We})});return function(We){return ke.apply(this,arguments)}}(),se.get=function(){var ke=W(function*(We,we){let oe;oe="function"==typeof we.documentLoader?we.documentLoader:se.documentLoader;const Be=yield oe(We);try{if(!Be.document)throw new x("No remote document found at the given URL.","jsonld.NullRemoteDocument");j(Be.document)&&(Be.document=JSON.parse(Be.document))}catch(Ye){throw new x("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Ye,remoteDoc:Be})}return Be});return function(We,we){return ke.apply(this,arguments)}}(),se.processContext=function(){var ke=W(function*(We,we,oe){return oe=et(oe,{base:"",contextResolver:new I({sharedCache:qe})}),null===we?R(oe):(we=T.clone(we),re(we)&&"@context"in we||(we={"@context":we}),S({activeCtx:We,localCtx:we,options:oe}))});return function(We,we,oe){return ke.apply(this,arguments)}}(),se.getContextValue=Y(429).getContextValue,se.documentLoaders={},se.useDocumentLoader=function(ke){if(!(ke in se.documentLoaders))throw new x('Unknown document loader type: "'+ke+'"',"jsonld.UnknownDocumentLoader",{type:ke});se.documentLoader=se.documentLoaders[ke].apply(se,Array.prototype.slice.call(arguments,1))},se.registerRDFParser=function(ke,We){Re[ke]=We},se.unregisterRDFParser=function(ke){delete Re[ke]},se.registerRDFParser("application/n-quads",A.parse),se.registerRDFParser("application/nquads",A.parse),se.url=Y(2051),se.logEventHandler=me,se.logWarningEventHandler=ve,se.safeEventHandler=Ee,se.setDefaultEventHandler=Ge,se.strictEventHandler=te,se.unhandledEventHandler=ce,se.util=T,Object.assign(se,T),se.promises=se,se.RequestQueue=Y(4808),se.JsonLdProcessor=Y(1328)(se),E.setupGlobals(se),E.setupDocumentLoaders(se),se},pe=function(){return Me(function(){return pe()})};Me(pe),Ze.exports=pe},5096(Ze,Ne,Y){"use strict";const{isKeyword:W}=Y(429),M=Y(4209),E=Y(2831),T=Y(9420),I=Y(262),p={};Ze.exports=p,p.createMergedNodeMap=(x,m)=>{const A=(m=m||{}).issuer||new T.IdentifierIssuer("_:b"),D={"@default":{}};return p.createNodeMap(x,D,"@default",A),p.mergeNodeMaps(D)},p.createNodeMap=(x,m,A,D,k,G)=>{if(E.isArray(x)){for(const B of x)p.createNodeMap(B,m,A,D,void 0,G);return}if(!E.isObject(x))return void(G&&G.push(x));if(M.isValue(x)){if("@type"in x){let B=x["@type"];0===B.indexOf("_:")&&(x["@type"]=B=D.getId(B))}return void(G&&G.push(x))}if(G&&M.isList(x)){const B=[];return p.createNodeMap(x["@list"],m,A,D,k,B),void G.push({"@list":B})}if("@type"in x){const B=x["@type"];for(const re of B)0===re.indexOf("_:")&&D.getId(re)}E.isUndefined(k)&&(k=M.isBlankNode(x)?D.getId(x["@id"]):x["@id"]),G&&G.push({"@id":k});const P=m[A],O=P[k]=P[k]||{};O["@id"]=k;const $=Object.keys(x).sort();for(let B of $){if("@id"===B)continue;if("@reverse"===B){const j={"@id":k},xe=x["@reverse"];for(const ne in xe){const R=xe[ne];for(const S of R){let L=S["@id"];M.isBlankNode(S)&&(L=D.getId(L)),p.createNodeMap(S,m,A,D,L),T.addValue(P[L],ne,j,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===B){k in m||(m[k]={}),p.createNodeMap(x[B],m,k,D);continue}if("@included"===B){p.createNodeMap(x[B],m,A,D);continue}if("@type"!==B&&W(B)){if("@index"===B&&B in O&&(x[B]!==O[B]||x[B]["@id"]!==O[B]["@id"]))throw new I("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:O});O[B]=x[B];continue}const re=x[B];if(0===B.indexOf("_:")&&(B=D.getId(B)),0!==re.length)for(let j of re)if("@type"===B&&(j=0===j.indexOf("_:")?D.getId(j):j),M.isSubject(j)||M.isSubjectReference(j)){if("@id"in j&&!j["@id"])continue;const xe=M.isBlankNode(j)?D.getId(j["@id"]):j["@id"];T.addValue(O,B,{"@id":xe},{propertyIsArray:!0,allowDuplicate:!1}),p.createNodeMap(j,m,A,D,xe)}else if(M.isValue(j))T.addValue(O,B,j,{propertyIsArray:!0,allowDuplicate:!1});else if(M.isList(j)){const xe=[];p.createNodeMap(j["@list"],m,A,D,k,xe),j={"@list":xe},T.addValue(O,B,j,{propertyIsArray:!0,allowDuplicate:!1})}else p.createNodeMap(j,m,A,D,k),T.addValue(O,B,j,{propertyIsArray:!0,allowDuplicate:!1});else T.addValue(O,B,[],{propertyIsArray:!0})}},p.mergeNodeMapGraphs=x=>{const m={};for(const A of Object.keys(x).sort())for(const D of Object.keys(x[A]).sort()){const k=x[A][D];D in m||(m[D]={"@id":D});const G=m[D];for(const P of Object.keys(k).sort())if(W(P)&&"@type"!==P)G[P]=T.clone(k[P]);else for(const O of k[P])T.addValue(G,P,T.clone(O),{propertyIsArray:!0,allowDuplicate:!1})}return m},p.mergeNodeMaps=x=>{const m=x["@default"],A=Object.keys(x).sort();for(const D of A){if("@default"===D)continue;const k=x[D];let G=m[D];G?"@graph"in G||(G["@graph"]=[]):m[D]=G={"@id":D,"@graph":[]};const P=G["@graph"];for(const O of Object.keys(k).sort()){const $=k[O];M.isSubjectReference($)||P.push($)}}return m}},8666(Ze,Ne,Y){"use strict";const W=Y(3120),M={};Ze.exports=M,M.setupDocumentLoaders=function(E){typeof XMLHttpRequest<"u"&&(E.documentLoaders.xhr=W,E.useDocumentLoader("xhr"))},M.setupGlobals=function(E){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:E.JsonLdProcessor})}},6397(Ze,Ne,Y){"use strict";const{createNodeMap:W}=Y(5096),{isKeyword:M}=Y(429),E=Y(4209),T=Y(8846),I=Y(262),p=Y(2831),x=Y(9420),{handleEvent:m}=Y(2585),{RDF_FIRST:A,RDF_REST:D,RDF_NIL:k,RDF_TYPE:G,RDF_JSON_LITERAL:P,RDF_LANGSTRING:O,XSD_BOOLEAN:$,XSD_DOUBLE:B,XSD_INTEGER:re,XSD_STRING:j}=Y(5315),{isAbsolute:xe}=Y(2051),ne={};function R(_,ee,ie,H,ae){const me=Object.keys(ee).sort();for(const ve of me){const Ee=ee[ve],Ge=Object.keys(Ee).sort();for(let fe of Ge){const te=Ee[fe];if("@type"===fe)fe=G;else if(M(fe))continue;for(const ce of te){const Me={termType:ve.startsWith("_:")?"BlankNode":"NamedNode",value:ve};if(!xe(ve)){ae.eventHandler&&m({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:ve}},options:ae});continue}const pe={termType:fe.startsWith("_:")?"BlankNode":"NamedNode",value:fe};if(!xe(fe)){ae.eventHandler&&m({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:fe}},options:ae});continue}if("BlankNode"===pe.termType&&!ae.produceGeneralizedRdf){ae.eventHandler&&m({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:H.getOldIds().find(Re=>H.getId(Re)===fe)}},options:ae});continue}const se=L(ce,H,_,ie,ae.rdfDirection,ae);se&&_.push({subject:Me,predicate:pe,object:se,graph:ie})}}}}function L(_,ee,ie,H,ae,me){const ve={};if(E.isValue(_)){ve.termType="Literal",ve.value=void 0,ve.datatype={termType:"NamedNode"};let Ee=_["@value"];const Ge=_["@type"]||null;if("@json"===Ge)ve.value=T(Ee),ve.datatype.value=P;else if(p.isBoolean(Ee))ve.value=Ee.toString(),ve.datatype.value=Ge||$;else if(p.isDouble(Ee)||Ge===B)p.isDouble(Ee)||(Ee=parseFloat(Ee)),ve.value=Ee.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),ve.datatype.value=Ge||B;else if(p.isNumber(Ee))ve.value=Ee.toFixed(0),ve.datatype.value=Ge||re;else if("@direction"in _&&"i18n-datatype"===ae){const fe=(_["@language"]||"").toLowerCase();ve.datatype.value=`https://www.w3.org/ns/i18n#${fe}_${_["@direction"]}`,ve.value=Ee}else{if("@direction"in _&&"compound-literal"===ae)throw new I("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:ae});if("@direction"in _&&ae)throw new I("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:ae});"@language"in _?("@direction"in _&&!ae&&me.eventHandler&&m({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:ve.value}},options:me}),ve.value=Ee,ve.datatype.value=Ge||O,ve.language=_["@language"]):("@direction"in _&&!ae&&me.eventHandler&&m({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:ve.value}},options:me}),ve.value=Ee,ve.datatype.value=Ge||j)}}else if(E.isList(_)){const Ee=function S(_,ee,ie,H,ae,me){const ve={termType:"NamedNode",value:A},Ee={termType:"NamedNode",value:D},Ge={termType:"NamedNode",value:k},fe=_.pop(),te=fe?{termType:"BlankNode",value:ee.getId()}:Ge;let ce=te;for(const Me of _){const pe=L(Me,ee,ie,H,ae,me),se={termType:"BlankNode",value:ee.getId()};ie.push({subject:ce,predicate:ve,object:pe,graph:H}),ie.push({subject:ce,predicate:Ee,object:se,graph:H}),ce=se}if(fe){const Me=L(fe,ee,ie,H,ae,me);ie.push({subject:ce,predicate:ve,object:Me,graph:H}),ie.push({subject:ce,predicate:Ee,object:Ge,graph:H})}return te}(_["@list"],ee,ie,H,ae,me);ve.termType=Ee.termType,ve.value=Ee.value}else{const Ee=p.isObject(_)?_["@id"]:_;ve.termType=Ee.startsWith("_:")?"BlankNode":"NamedNode",ve.value=Ee}return"NamedNode"!==ve.termType||xe(ve.value)?ve:(me.eventHandler&&m({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:ve.value}},options:me}),null)}Ze.exports=ne,ne.toRDF=(_,ee)=>{const ie=new x.IdentifierIssuer("_:b"),H={"@default":{}};W(_,H,"@default",ie);const ae=[],me=Object.keys(H).sort();for(const ve of me){let Ee;if("@default"===ve)Ee={termType:"DefaultGraph",value:""};else{if(!xe(ve)){ee.eventHandler&&m({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:ve}},options:ee});continue}Ee=ve.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},Ee.value=ve}R(ae,H[ve],Ee,ie,ee)}return ae}},2831(Ze){"use strict";const Ne={};Ze.exports=Ne,Ne.isArray=Array.isArray,Ne.isBoolean=Y=>"boolean"==typeof Y||"[object Boolean]"===Object.prototype.toString.call(Y),Ne.isDouble=Y=>Ne.isNumber(Y)&&(-1!==String(Y).indexOf(".")||Math.abs(Y)>=1e21),Ne.isEmptyObject=Y=>Ne.isObject(Y)&&0===Object.keys(Y).length,Ne.isNumber=Y=>"number"==typeof Y||"[object Number]"===Object.prototype.toString.call(Y),Ne.isNumeric=Y=>!isNaN(parseFloat(Y))&&isFinite(Y),Ne.isObject=Y=>"[object Object]"===Object.prototype.toString.call(Y),Ne.isString=Y=>"string"==typeof Y||"[object String]"===Object.prototype.toString.call(Y),Ne.isUndefined=Y=>typeof Y>"u"},2051(Ze,Ne,Y){"use strict";const W=Y(2831),M={};Ze.exports=M,M.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},M.parse=(T,I)=>{const p={},x=M.parsers[I||"full"],m=x.regex.exec(T);let A=x.keys.length;for(;A--;)p[x.keys[A]]=void 0===m[A]?null:m[A];return("https"===p.scheme&&"443"===p.port||"http"===p.scheme&&"80"===p.port)&&(p.href=p.href.replace(":"+p.port,""),p.authority=p.authority.replace(":"+p.port,""),p.port=null),p.normalizedPath=M.removeDotSegments(p.path),p},M.prependBase=(T,I)=>{if(null===T||M.isAbsolute(I))return I;(!T||W.isString(T))&&(T=M.parse(T||""));const p=M.parse(I),x={protocol:T.protocol||""};if(null!==p.authority)x.authority=p.authority,x.path=p.path,x.query=p.query;else if(x.authority=T.authority,""===p.path)x.path=T.path,x.query=null!==p.query?p.query:T.query;else{if(0===p.path.indexOf("/"))x.path=p.path;else{let A=T.path;A=A.substr(0,A.lastIndexOf("/")+1),(A.length>0||T.authority)&&"/"!==A.substr(-1)&&(A+="/"),A+=p.path,x.path=A}x.query=p.query}""!==p.path&&(x.path=M.removeDotSegments(x.path));let m=x.protocol;return null!==x.authority&&(m+="//"+x.authority),m+=x.path,null!==x.query&&(m+="?"+x.query),null!==p.fragment&&(m+="#"+p.fragment),""===m&&(m="./"),m},M.removeBase=(T,I)=>{if(null===T)return I;(!T||W.isString(T))&&(T=M.parse(T||""));let p="";if(""!==T.href?p+=(T.protocol||"")+"//"+(T.authority||""):I.indexOf("//")&&(p+="//"),0!==I.indexOf(p))return I;const x=M.parse(I.substr(p.length)),m=T.normalizedPath.split("/"),A=x.normalizedPath.split("/"),D=x.fragment||x.query?0:1;for(;m.length>0&&A.length>D&&m[0]===A[0];)m.shift(),A.shift();let k="";if(m.length>0){m.pop();for(let G=0;G<m.length;++G)k+="../"}return k+=A.join("/"),null!==x.query&&(k+="?"+x.query),null!==x.fragment&&(k+="#"+x.fragment),""===k&&(k="./"),k},M.removeDotSegments=T=>{if(0===T.length)return"";const I=T.split("/"),p=[];for(;I.length>0;){const x=I.shift(),m=0===I.length;"."!==x?".."!==x?p.push(x):(p.pop(),m&&p.push("")):m&&p.push("")}return"/"===T[0]&&p.length>0&&""!==p[0]&&p.unshift(""),1===p.length&&""===p[0]?"/":p.join("/")};const E=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;M.isAbsolute=T=>W.isString(T)&&E.test(T),M.isRelative=T=>W.isString(T)},9420(Ze,Ne,Y){"use strict";const W=Y(4209),M=Y(2831),E=Y(1224).IdentifierIssuer,T=Y(262),p=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,x=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,m=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,D_headers_accept="application/ld+json, application/json",k={};function G(P,O){if(M.isArray(O))for(let $=0;$<O.length;++$)O[$]=G(P,O[$]);else if(W.isList(O))O["@list"]=G(P,O["@list"]);else if(M.isObject(O)){W.isBlankNode(O)&&(O["@id"]=P.getId(O["@id"]));const $=Object.keys(O).sort();for(let B=0;B<$.length;++B){const re=$[B];"@id"!==re&&(O[re]=G(P,O[re]))}}return O}Ze.exports=k,k.IdentifierIssuer=E,k.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,k.REGEX_KEYWORD=/^@[a-zA-Z]+$/,k.clone=function(P){if(P&&"object"==typeof P){let O;if(M.isArray(P)){O=[];for(let $=0;$<P.length;++$)O[$]=k.clone(P[$])}else if(P instanceof Map){O=new Map;for(const[$,B]of P)O.set($,k.clone(B))}else if(P instanceof Set){O=new Set;for(const $ of P)O.add(k.clone($))}else if(M.isObject(P)){O={};for(const $ in P)O[$]=k.clone(P[$])}else O=P.toString();return O}return P},k.asArray=function(P){return Array.isArray(P)?P:[P]},k.buildHeaders=(P={})=>{if(Object.keys(P).some($=>"accept"===$.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+D_headers_accept+'" is supported.');return Object.assign({Accept:D_headers_accept},P)},k.parseLinkHeader=P=>{const O={},$=P.match(p);for(let B=0;B<$.length;++B){let re=$[B].match(x);if(!re)continue;const j={target:re[1]},xe=re[2];for(;re=m.exec(xe);)j[re[1]]=void 0===re[2]?re[3]:re[2];const ne=j.rel||"";Array.isArray(O[ne])?O[ne].push(j):O[ne]=O.hasOwnProperty(ne)?[O[ne],j]:j}return O},k.validateTypeValue=(P,O)=>{if(!(M.isString(P)||M.isArray(P)&&P.every($=>M.isString($)))){if(O&&M.isObject(P))switch(Object.keys(P).length){case 0:return;case 1:if("@default"in P&&k.asArray(P["@default"]).every($=>M.isString($)))return}throw new T('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:P})}},k.hasProperty=(P,O)=>{if(P.hasOwnProperty(O)){const $=P[O];return!M.isArray($)||$.length>0}return!1},k.hasValue=(P,O,$)=>{if(k.hasProperty(P,O)){let B=P[O];const re=W.isList(B);if(M.isArray(B)||re){re&&(B=B["@list"]);for(let j=0;j<B.length;++j)if(k.compareValues($,B[j]))return!0}else if(!M.isArray($))return k.compareValues($,B)}return!1},k.addValue=(P,O,$,B)=>{if("propertyIsArray"in(B=B||{})||(B.propertyIsArray=!1),"valueIsArray"in B||(B.valueIsArray=!1),"allowDuplicate"in B||(B.allowDuplicate=!0),"prependValue"in B||(B.prependValue=!1),B.valueIsArray)P[O]=$;else if(M.isArray($)){0===$.length&&B.propertyIsArray&&!P.hasOwnProperty(O)&&(P[O]=[]),B.prependValue&&($=$.concat(P[O]),P[O]=[]);for(let re=0;re<$.length;++re)k.addValue(P,O,$[re],B)}else if(P.hasOwnProperty(O)){const re=!B.allowDuplicate&&k.hasValue(P,O,$);!M.isArray(P[O])&&(!re||B.propertyIsArray)&&(P[O]=[P[O]]),re||(B.prependValue?P[O].unshift($):P[O].push($))}else P[O]=B.propertyIsArray?[$]:$},k.getValues=(P,O)=>[].concat(P[O]||[]),k.removeProperty=(P,O)=>{delete P[O]},k.removeValue=(P,O,$,B)=>{"propertyIsArray"in(B=B||{})||(B.propertyIsArray=!1);const re=k.getValues(P,O).filter(j=>!k.compareValues(j,$));0===re.length?k.removeProperty(P,O):P[O]=1!==re.length||B.propertyIsArray?re:re[0]},k.relabelBlankNodes=(P,O)=>G((O=O||{}).issuer||new E("_:b"),P),k.compareValues=(P,O)=>!!(P===O||W.isValue(P)&&W.isValue(O)&&P["@value"]===O["@value"]&&P["@type"]===O["@type"]&&P["@language"]===O["@language"]&&P["@index"]===O["@index"])||!!(M.isObject(P)&&"@id"in P&&M.isObject(O)&&"@id"in O)&&P["@id"]===O["@id"],k.compareShortestLeast=(P,O)=>P.length<O.length?-1:O.length<P.length?1:P===O?0:P<O?-1:1},3052(Ze,Ne,Y){"use strict";const W=Y(4842),M=Symbol("max"),E=Symbol("length"),T=Symbol("lengthCalculator"),I=Symbol("allowStale"),p=Symbol("maxAge"),x=Symbol("dispose"),m=Symbol("noDisposeOnSet"),A=Symbol("lruList"),D=Symbol("cache"),k=Symbol("updateAgeOnGet"),G=()=>1,O=(ne,R,S)=>{const L=ne[D].get(R);if(L){const _=L.value;if($(ne,_)){if(re(ne,L),!ne[I])return}else S&&(ne[k]&&(L.value.now=Date.now()),ne[A].unshiftNode(L));return _.value}},$=(ne,R)=>{if(!R||!R.maxAge&&!ne[p])return!1;const S=Date.now()-R.now;return R.maxAge?S>R.maxAge:ne[p]&&S>ne[p]},B=ne=>{if(ne[E]>ne[M])for(let R=ne[A].tail;ne[E]>ne[M]&&null!==R;){const S=R.prev;re(ne,R),R=S}},re=(ne,R)=>{if(R){const S=R.value;ne[x]&&ne[x](S.key,S.value),ne[E]-=S.length,ne[D].delete(S.key),ne[A].removeNode(R)}};class j{constructor(R,S,L,_,ee){this.key=R,this.value=S,this.length=L,this.now=_,this.maxAge=ee||0}}const xe=(ne,R,S,L)=>{let _=S.value;$(ne,_)&&(re(ne,S),ne[I]||(_=void 0)),_&&R.call(L,_.value,_.key,ne)};Ze.exports=class P{constructor(R){if("number"==typeof R&&(R={max:R}),R||(R={}),R.max&&("number"!=typeof R.max||R.max<0))throw new TypeError("max must be a non-negative number");this[M]=R.max||1/0;const L=R.length||G;if(this[T]="function"!=typeof L?G:L,this[I]=R.stale||!1,R.maxAge&&"number"!=typeof R.maxAge)throw new TypeError("maxAge must be a number");this[p]=R.maxAge||0,this[x]=R.dispose,this[m]=R.noDisposeOnSet||!1,this[k]=R.updateAgeOnGet||!1,this.reset()}set max(R){if("number"!=typeof R||R<0)throw new TypeError("max must be a non-negative number");this[M]=R||1/0,B(this)}get max(){return this[M]}set allowStale(R){this[I]=!!R}get allowStale(){return this[I]}set maxAge(R){if("number"!=typeof R)throw new TypeError("maxAge must be a non-negative number");this[p]=R,B(this)}get maxAge(){return this[p]}set lengthCalculator(R){"function"!=typeof R&&(R=G),R!==this[T]&&(this[T]=R,this[E]=0,this[A].forEach(S=>{S.length=this[T](S.value,S.key),this[E]+=S.length})),B(this)}get lengthCalculator(){return this[T]}get length(){return this[E]}get itemCount(){return this[A].length}rforEach(R,S){S=S||this;for(let L=this[A].tail;null!==L;){const _=L.prev;xe(this,R,L,S),L=_}}forEach(R,S){S=S||this;for(let L=this[A].head;null!==L;){const _=L.next;xe(this,R,L,S),L=_}}keys(){return this[A].toArray().map(R=>R.key)}values(){return this[A].toArray().map(R=>R.value)}reset(){this[x]&&this[A]&&this[A].length&&this[A].forEach(R=>this[x](R.key,R.value)),this[D]=new Map,this[A]=new W,this[E]=0}dump(){return this[A].map(R=>!$(this,R)&&{k:R.key,v:R.value,e:R.now+(R.maxAge||0)}).toArray().filter(R=>R)}dumpLru(){return this[A]}set(R,S,L){if((L=L||this[p])&&"number"!=typeof L)throw new TypeError("maxAge must be a number");const _=L?Date.now():0,ee=this[T](S,R);if(this[D].has(R)){if(ee>this[M])return re(this,this[D].get(R)),!1;const ae=this[D].get(R).value;return this[x]&&(this[m]||this[x](R,ae.value)),ae.now=_,ae.maxAge=L,ae.value=S,this[E]+=ee-ae.length,ae.length=ee,this.get(R),B(this),!0}const ie=new j(R,S,ee,_,L);return ie.length>this[M]?(this[x]&&this[x](R,S),!1):(this[E]+=ie.length,this[A].unshift(ie),this[D].set(R,this[A].head),B(this),!0)}has(R){if(!this[D].has(R))return!1;const S=this[D].get(R).value;return!$(this,S)}get(R){return O(this,R,!0)}peek(R){return O(this,R,!1)}pop(){const R=this[A].tail;return R?(re(this,R),R.value):null}del(R){re(this,this[D].get(R))}load(R){this.reset();const S=Date.now();for(let L=R.length-1;L>=0;L--){const _=R[L],ee=_.e||0;if(0===ee)this.set(_.k,_.v);else{const ie=ee-S;ie>0&&this.set(_.k,_.v,ie)}}}prune(){this[D].forEach((R,S)=>O(this,S,!1))}}},7568(Ze){"use strict";Ze.exports=function(Ne){Ne.prototype[Symbol.iterator]=function*(){for(let Y=this.head;Y;Y=Y.next)yield Y.value}}},4842(Ze,Ne,Y){"use strict";function W(p){var x=this;if(x instanceof W||(x=new W),x.tail=null,x.head=null,x.length=0,p&&"function"==typeof p.forEach)p.forEach(function(D){x.push(D)});else if(arguments.length>0)for(var m=0,A=arguments.length;m<A;m++)x.push(arguments[m]);return x}function M(p,x,m){var A=x===p.head?new I(m,null,x,p):new I(m,x,x.next,p);return null===A.next&&(p.tail=A),null===A.prev&&(p.head=A),p.length++,A}function E(p,x){p.tail=new I(x,p.tail,null,p),p.head||(p.head=p.tail),p.length++}function T(p,x){p.head=new I(x,null,p.head,p),p.tail||(p.tail=p.head),p.length++}function I(p,x,m,A){if(!(this instanceof I))return new I(p,x,m,A);this.list=A,this.value=p,x?(x.next=this,this.prev=x):this.prev=null,m?(m.prev=this,this.next=m):this.next=null}Ze.exports=W,W.Node=I,W.create=W,W.prototype.removeNode=function(p){if(p.list!==this)throw new Error("removing node which does not belong to this list");var x=p.next,m=p.prev;return x&&(x.prev=m),m&&(m.next=x),p===this.head&&(this.head=x),p===this.tail&&(this.tail=m),p.list.length--,p.next=null,p.prev=null,p.list=null,x},W.prototype.unshiftNode=function(p){if(p!==this.head){p.list&&p.list.removeNode(p);var x=this.head;p.list=this,p.next=x,x&&(x.prev=p),this.head=p,this.tail||(this.tail=p),this.length++}},W.prototype.pushNode=function(p){if(p!==this.tail){p.list&&p.list.removeNode(p);var x=this.tail;p.list=this,p.prev=x,x&&(x.next=p),this.tail=p,this.head||(this.head=p),this.length++}},W.prototype.push=function(){for(var p=0,x=arguments.length;p<x;p++)E(this,arguments[p]);return this.length},W.prototype.unshift=function(){for(var p=0,x=arguments.length;p<x;p++)T(this,arguments[p]);return this.length},W.prototype.pop=function(){if(this.tail){var p=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,p}},W.prototype.shift=function(){if(this.head){var p=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,p}},W.prototype.forEach=function(p,x){x=x||this;for(var m=this.head,A=0;null!==m;A++)p.call(x,m.value,A,this),m=m.next},W.prototype.forEachReverse=function(p,x){x=x||this;for(var m=this.tail,A=this.length-1;null!==m;A--)p.call(x,m.value,A,this),m=m.prev},W.prototype.get=function(p){for(var x=0,m=this.head;null!==m&&x<p;x++)m=m.next;if(x===p&&null!==m)return m.value},W.prototype.getReverse=function(p){for(var x=0,m=this.tail;null!==m&&x<p;x++)m=m.prev;if(x===p&&null!==m)return m.value},W.prototype.map=function(p,x){x=x||this;for(var m=new W,A=this.head;null!==A;)m.push(p.call(x,A.value,this)),A=A.next;return m},W.prototype.mapReverse=function(p,x){x=x||this;for(var m=new W,A=this.tail;null!==A;)m.push(p.call(x,A.value,this)),A=A.prev;return m},W.prototype.reduce=function(p,x){var m,A=this.head;if(arguments.length>1)m=x;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");A=this.head.next,m=this.head.value}for(var D=0;null!==A;D++)m=p(m,A.value,D),A=A.next;return m},W.prototype.reduceReverse=function(p,x){var m,A=this.tail;if(arguments.length>1)m=x;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");A=this.tail.prev,m=this.tail.value}for(var D=this.length-1;null!==A;D--)m=p(m,A.value,D),A=A.prev;return m},W.prototype.toArray=function(){for(var p=new Array(this.length),x=0,m=this.head;null!==m;x++)p[x]=m.value,m=m.next;return p},W.prototype.toArrayReverse=function(){for(var p=new Array(this.length),x=0,m=this.tail;null!==m;x++)p[x]=m.value,m=m.prev;return p},W.prototype.slice=function(p,x){(x=x||this.length)<0&&(x+=this.length),(p=p||0)<0&&(p+=this.length);var m=new W;if(x<p||x<0)return m;p<0&&(p=0),x>this.length&&(x=this.length);for(var A=0,D=this.head;null!==D&&A<p;A++)D=D.next;for(;null!==D&&A<x;A++,D=D.next)m.push(D.value);return m},W.prototype.sliceReverse=function(p,x){(x=x||this.length)<0&&(x+=this.length),(p=p||0)<0&&(p+=this.length);var m=new W;if(x<p||x<0)return m;p<0&&(p=0),x>this.length&&(x=this.length);for(var A=this.length,D=this.tail;null!==D&&A>x;A--)D=D.prev;for(;null!==D&&A>p;A--,D=D.prev)m.push(D.value);return m},W.prototype.splice=function(p,x,...m){p>this.length&&(p=this.length-1),p<0&&(p=this.length+p);for(var A=0,D=this.head;null!==D&&A<p;A++)D=D.next;var k=[];for(A=0;D&&A<x;A++)k.push(D.value),D=this.removeNode(D);for(null===D&&(D=this.tail),D!==this.head&&D!==this.tail&&(D=D.prev),A=0;A<m.length;A++)D=M(this,D,m[A]);return k},W.prototype.reverse=function(){for(var p=this.head,x=this.tail,m=p;null!==m;m=m.prev){var A=m.prev;m.prev=m.next,m.next=A}return this.head=x,this.tail=p,this};try{Y(7568)(W)}catch{}},6556(Ze){Ze.exports=function(Ne){var Y={};function W(M){if(Y[M])return Y[M].exports;var E=Y[M]={i:M,l:!1,exports:{}};return Ne[M].call(E.exports,E,E.exports,W),E.l=!0,E.exports}return W.m=Ne,W.c=Y,W.i=function(M){return M},W.d=function(M,E,T){W.o(M,E)||Object.defineProperty(M,E,{configurable:!1,enumerable:!0,get:T})},W.n=function(M){var E=M&&M.__esModule?function(){return M.default}:function(){return M};return W.d(E,"a",E),E},W.o=function(M,E){return Object.prototype.hasOwnProperty.call(M,E)},W.p="",W(W.s=26)}([function(Ne,Y,W){"use strict";function M(){}M.QUALITY=1,M.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,M.DEFAULT_INCREMENTAL=!1,M.DEFAULT_ANIMATION_ON_LAYOUT=!0,M.DEFAULT_ANIMATION_DURING_LAYOUT=!1,M.DEFAULT_ANIMATION_PERIOD=50,M.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,M.DEFAULT_GRAPH_MARGIN=15,M.NODE_DIMENSIONS_INCLUDE_LABELS=!1,M.SIMPLE_NODE_HALF_SIZE=(M.SIMPLE_NODE_SIZE=40)/2,M.EMPTY_COMPOUND_NODE_SIZE=40,M.MIN_EDGE_LENGTH=1,M.INITIAL_WORLD_BOUNDARY=(M.WORLD_BOUNDARY=1e6)/1e3,M.WORLD_CENTER_X=1200,M.WORLD_CENTER_Y=900,Ne.exports=M},function(Ne,Y,W){"use strict";var M=W(2),E=W(8),T=W(9);function I(x,m,A){M.call(this,A),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=A,this.bendpoints=[],this.source=x,this.target=m}for(var p in I.prototype=Object.create(M.prototype),M)I[p]=M[p];I.prototype.getSource=function(){return this.source},I.prototype.getTarget=function(){return this.target},I.prototype.isInterGraph=function(){return this.isInterGraph},I.prototype.getLength=function(){return this.length},I.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},I.prototype.getBendpoints=function(){return this.bendpoints},I.prototype.getLca=function(){return this.lca},I.prototype.getSourceInLca=function(){return this.sourceInLca},I.prototype.getTargetInLca=function(){return this.targetInLca},I.prototype.getOtherEnd=function(x){if(this.source===x)return this.target;if(this.target===x)return this.source;throw"Node is not incident with this edge"},I.prototype.getOtherEndInGraph=function(x,m){for(var A=this.getOtherEnd(x),D=m.getGraphManager().getRoot();;){if(A.getOwner()==m)return A;if(A.getOwner()==D)break;A=A.getOwner().getParent()}return null},I.prototype.updateLength=function(){var x=new Array(4);this.isOverlapingSourceAndTarget=E.getIntersection(this.target.getRect(),this.source.getRect(),x),this.isOverlapingSourceAndTarget||(this.lengthX=x[0]-x[2],this.lengthY=x[1]-x[3],Math.abs(this.lengthX)<1&&(this.lengthX=T.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=T.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},I.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=T.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=T.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},Ne.exports=I},function(Ne,Y,W){"use strict";Ne.exports=function M(E){this.vGraphObject=E}},function(Ne,Y,W){"use strict";var M=W(2),E=W(10),T=W(13),I=W(0),p=W(16),x=W(4);function m(D,k,G,P){null==G&&null==P&&(P=k),M.call(this,P),null!=D.graphManager&&(D=D.graphManager),this.estimatedSize=E.MIN_VALUE,this.inclusionTreeDepth=E.MAX_VALUE,this.vGraphObject=P,this.edges=[],this.graphManager=D,this.rect=null!=G&&null!=k?new T(k.x,k.y,G.width,G.height):new T}for(var A in m.prototype=Object.create(M.prototype),M)m[A]=M[A];m.prototype.getEdges=function(){return this.edges},m.prototype.getChild=function(){return this.child},m.prototype.getOwner=function(){return this.owner},m.prototype.getWidth=function(){return this.rect.width},m.prototype.setWidth=function(D){this.rect.width=D},m.prototype.getHeight=function(){return this.rect.height},m.prototype.setHeight=function(D){this.rect.height=D},m.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},m.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},m.prototype.getCenter=function(){return new x(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},m.prototype.getLocation=function(){return new x(this.rect.x,this.rect.y)},m.prototype.getRect=function(){return this.rect},m.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},m.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},m.prototype.setRect=function(D,k){this.rect.x=D.x,this.rect.y=D.y,this.rect.width=k.width,this.rect.height=k.height},m.prototype.setCenter=function(D,k){this.rect.x=D-this.rect.width/2,this.rect.y=k-this.rect.height/2},m.prototype.setLocation=function(D,k){this.rect.x=D,this.rect.y=k},m.prototype.moveBy=function(D,k){this.rect.x+=D,this.rect.y+=k},m.prototype.getEdgeListToNode=function(D){var k=[],P=this;return P.edges.forEach(function(O){if(O.target==D){if(O.source!=P)throw"Incorrect edge source!";k.push(O)}}),k},m.prototype.getEdgesBetween=function(D){var k=[],P=this;return P.edges.forEach(function(O){if(O.source!=P&&O.target!=P)throw"Incorrect edge source and/or target";(O.target==D||O.source==D)&&k.push(O)}),k},m.prototype.getNeighborsList=function(){var D=new Set,k=this;return k.edges.forEach(function(G){if(G.source==k)D.add(G.target);else{if(G.target!=k)throw"Incorrect incidency!";D.add(G.source)}}),D},m.prototype.withChildren=function(){var D=new Set;if(D.add(this),null!=this.child)for(var P=this.child.getNodes(),O=0;O<P.length;O++)P[O].withChildren().forEach(function($){D.add($)});return D},m.prototype.getNoOfChildren=function(){var D=0;if(null==this.child)D=1;else for(var G=this.child.getNodes(),P=0;P<G.length;P++)D+=G[P].getNoOfChildren();return 0==D&&(D=1),D},m.prototype.getEstimatedSize=function(){if(this.estimatedSize==E.MIN_VALUE)throw"assert failed";return this.estimatedSize},m.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},m.prototype.scatter=function(){var D,k,G=-I.INITIAL_WORLD_BOUNDARY,P=I.INITIAL_WORLD_BOUNDARY;D=I.WORLD_CENTER_X+p.nextDouble()*(P-G)+G;var O=-I.INITIAL_WORLD_BOUNDARY,$=I.INITIAL_WORLD_BOUNDARY;k=I.WORLD_CENTER_Y+p.nextDouble()*($-O)+O,this.rect.x=D,this.rect.y=k},m.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var D=this.getChild();if(D.updateBounds(!0),this.rect.x=D.getLeft(),this.rect.y=D.getTop(),this.setWidth(D.getRight()-D.getLeft()),this.setHeight(D.getBottom()-D.getTop()),I.NODE_DIMENSIONS_INCLUDE_LABELS){var k=D.getRight()-D.getLeft(),G=D.getBottom()-D.getTop();this.labelWidth>k&&(this.rect.x-=(this.labelWidth-k)/2,this.setWidth(this.labelWidth)),this.labelHeight>G&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-G)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-G),this.setHeight(this.labelHeight))}}},m.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==E.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},m.prototype.transform=function(D){var k=this.rect.x;k>I.WORLD_BOUNDARY?k=I.WORLD_BOUNDARY:k<-I.WORLD_BOUNDARY&&(k=-I.WORLD_BOUNDARY);var G=this.rect.y;G>I.WORLD_BOUNDARY?G=I.WORLD_BOUNDARY:G<-I.WORLD_BOUNDARY&&(G=-I.WORLD_BOUNDARY);var P=new x(k,G),O=D.inverseTransformPoint(P);this.setLocation(O.x,O.y)},m.prototype.getLeft=function(){return this.rect.x},m.prototype.getRight=function(){return this.rect.x+this.rect.width},m.prototype.getTop=function(){return this.rect.y},m.prototype.getBottom=function(){return this.rect.y+this.rect.height},m.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},Ne.exports=m},function(Ne,Y,W){"use strict";function M(E,T){null==E&&null==T?(this.x=0,this.y=0):(this.x=E,this.y=T)}M.prototype.getX=function(){return this.x},M.prototype.getY=function(){return this.y},M.prototype.setX=function(E){this.x=E},M.prototype.setY=function(E){this.y=E},M.prototype.getDifference=function(E){return new DimensionD(this.x-E.x,this.y-E.y)},M.prototype.getCopy=function(){return new M(this.x,this.y)},M.prototype.translate=function(E){return this.x+=E.width,this.y+=E.height,this},Ne.exports=M},function(Ne,Y,W){"use strict";var M=W(2),E=W(10),T=W(0),I=W(6),p=W(3),x=W(1),m=W(13),A=W(12),D=W(11);function k(P,O,$){M.call(this,$),this.estimatedSize=E.MIN_VALUE,this.margin=T.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=P,null!=O&&O instanceof I?this.graphManager=O:null!=O&&O instanceof Layout&&(this.graphManager=O.graphManager)}for(var G in k.prototype=Object.create(M.prototype),M)k[G]=M[G];k.prototype.getNodes=function(){return this.nodes},k.prototype.getEdges=function(){return this.edges},k.prototype.getGraphManager=function(){return this.graphManager},k.prototype.getParent=function(){return this.parent},k.prototype.getLeft=function(){return this.left},k.prototype.getRight=function(){return this.right},k.prototype.getTop=function(){return this.top},k.prototype.getBottom=function(){return this.bottom},k.prototype.isConnected=function(){return this.isConnected},k.prototype.add=function(P,O,$){if(null==O&&null==$){var B=P;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(B)>-1)throw"Node already in graph!";return B.owner=this,this.getNodes().push(B),B}var re=P;if(!(this.getNodes().indexOf(O)>-1&&this.getNodes().indexOf($)>-1))throw"Source or target not in graph!";if(O.owner!=$.owner||O.owner!=this)throw"Both owners must be this graph!";return O.owner!=$.owner?null:(re.source=O,re.target=$,re.isInterGraph=!1,this.getEdges().push(re),O.edges.push(re),$!=O&&$.edges.push(re),re)},k.prototype.remove=function(P){var O=P;if(P instanceof p){if(null==O)throw"Node is null!";if(null==O.owner||O.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var $=O.edges.slice(),re=$.length,j=0;j<re;j++)(B=$[j]).isInterGraph?this.graphManager.remove(B):B.source.owner.remove(B);if(-1==(xe=this.nodes.indexOf(O)))throw"Node not in owner node list!";this.nodes.splice(xe,1)}else if(P instanceof x){var B;if(null==(B=P))throw"Edge is null!";if(null==B.source||null==B.target)throw"Source and/or target is null!";if(null==B.source.owner||null==B.target.owner||B.source.owner!=this||B.target.owner!=this)throw"Source and/or target owner is invalid!";var xe,ne=B.source.edges.indexOf(B),R=B.target.edges.indexOf(B);if(!(ne>-1&&R>-1))throw"Source and/or target doesn't know this edge!";if(B.source.edges.splice(ne,1),B.target!=B.source&&B.target.edges.splice(R,1),-1==(xe=B.source.owner.getEdges().indexOf(B)))throw"Not in owner's edge list!";B.source.owner.getEdges().splice(xe,1)}},k.prototype.updateLeftTop=function(){for(var $,B,re,P=E.MAX_VALUE,O=E.MAX_VALUE,j=this.getNodes(),xe=j.length,ne=0;ne<xe;ne++){var R=j[ne];P>($=R.getTop())&&(P=$),O>(B=R.getLeft())&&(O=B)}return P==E.MAX_VALUE?null:(re=null!=j[0].getParent().paddingLeft?j[0].getParent().paddingLeft:this.margin,this.left=O-re,this.top=P-re,new A(this.left,this.top))},k.prototype.updateBounds=function(P){for(var j,xe,ne,R,S,O=E.MAX_VALUE,$=-E.MAX_VALUE,B=E.MAX_VALUE,re=-E.MAX_VALUE,L=this.nodes,_=L.length,ee=0;ee<_;ee++){var ie=L[ee];P&&null!=ie.child&&ie.updateBounds(),O>(j=ie.getLeft())&&(O=j),$<(xe=ie.getRight())&&($=xe),B>(ne=ie.getTop())&&(B=ne),re<(R=ie.getBottom())&&(re=R)}var H=new m(O,B,$-O,re-B);O==E.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),S=null!=L[0].getParent().paddingLeft?L[0].getParent().paddingLeft:this.margin,this.left=H.x-S,this.right=H.x+H.width+S,this.top=H.y-S,this.bottom=H.y+H.height+S},k.calculateBounds=function(P){for(var j,xe,ne,R,O=E.MAX_VALUE,$=-E.MAX_VALUE,B=E.MAX_VALUE,re=-E.MAX_VALUE,S=P.length,L=0;L<S;L++){var _=P[L];O>(j=_.getLeft())&&(O=j),$<(xe=_.getRight())&&($=xe),B>(ne=_.getTop())&&(B=ne),re<(R=_.getBottom())&&(re=R)}return new m(O,B,$-O,re-B)},k.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},k.prototype.getEstimatedSize=function(){if(this.estimatedSize==E.MIN_VALUE)throw"assert failed";return this.estimatedSize},k.prototype.calcEstimatedSize=function(){for(var P=0,O=this.nodes,$=O.length,B=0;B<$;B++)P+=O[B].calcEstimatedSize();return this.estimatedSize=0==P?T.EMPTY_COMPOUND_NODE_SIZE:P/Math.sqrt(this.nodes.length),this.estimatedSize},k.prototype.updateConnected=function(){var P=this;if(0!=this.nodes.length){var re,j,O=new D,$=new Set,B=this.nodes[0];for(B.withChildren().forEach(function(ee){O.push(ee),$.add(ee)});0!==O.length;)for(var ne=(re=(B=O.shift()).getEdges()).length,R=0;R<ne;R++)null==(j=re[R].getOtherEndInGraph(B,this))||$.has(j)||j.withChildren().forEach(function(ee){O.push(ee),$.add(ee)});if(this.isConnected=!1,$.size>=this.nodes.length){var _=0;$.forEach(function(ee){ee.owner==P&&_++}),_==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},Ne.exports=k},function(Ne,Y,W){"use strict";var M,E=W(1);function T(I){M=W(5),this.layout=I,this.graphs=[],this.edges=[]}T.prototype.addRoot=function(){var I=this.layout.newGraph(),p=this.layout.newNode(null),x=this.add(I,p);return this.setRootGraph(x),this.rootGraph},T.prototype.add=function(I,p,x,m,A){if(null==x&&null==m&&null==A){if(null==I)throw"Graph is null!";if(null==p)throw"Parent node is null!";if(this.graphs.indexOf(I)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(I),null!=I.parent)throw"Already has a parent!";if(null!=p.child)throw"Already has a child!";return I.parent=p,p.child=I,I}A=x,x=I;var D=(m=p).getOwner(),k=A.getOwner();if(null==D||D.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==k||k.getGraphManager()!=this)throw"Target not in this graph mgr!";if(D==k)return x.isInterGraph=!1,D.add(x,m,A);if(x.isInterGraph=!0,x.source=m,x.target=A,this.edges.indexOf(x)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(x),null==x.source||null==x.target)throw"Edge source and/or target is null!";if(-1!=x.source.edges.indexOf(x)||-1!=x.target.edges.indexOf(x))throw"Edge already in source and/or target incidency list!";return x.source.edges.push(x),x.target.edges.push(x),x},T.prototype.remove=function(I){if(I instanceof M){var p=I;if(p.getGraphManager()!=this)throw"Graph not in this graph mgr";if(p!=this.rootGraph&&(null==p.parent||p.parent.graphManager!=this))throw"Invalid parent node!";for(var m,x=[],A=(x=x.concat(p.getEdges())).length,D=0;D<A;D++)p.remove(m=x[D]);var k=[];for(A=(k=k.concat(p.getNodes())).length,D=0;D<A;D++)p.remove(k[D]);p==this.rootGraph&&this.setRootGraph(null);var P=this.graphs.indexOf(p);this.graphs.splice(P,1),p.parent=null}else if(I instanceof E){if(null==(m=I))throw"Edge is null!";if(!m.isInterGraph)throw"Not an inter-graph edge!";if(null==m.source||null==m.target)throw"Source and/or target is null!";if(-1==m.source.edges.indexOf(m)||-1==m.target.edges.indexOf(m))throw"Source and/or target doesn't know this edge!";if(P=m.source.edges.indexOf(m),m.source.edges.splice(P,1),P=m.target.edges.indexOf(m),m.target.edges.splice(P,1),null==m.source.owner||null==m.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==m.source.owner.getGraphManager().edges.indexOf(m))throw"Not in owner graph manager's edge list!";P=m.source.owner.getGraphManager().edges.indexOf(m),m.source.owner.getGraphManager().edges.splice(P,1)}},T.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},T.prototype.getGraphs=function(){return this.graphs},T.prototype.getAllNodes=function(){if(null==this.allNodes){for(var I=[],p=this.getGraphs(),x=p.length,m=0;m<x;m++)I=I.concat(p[m].getNodes());this.allNodes=I}return this.allNodes},T.prototype.resetAllNodes=function(){this.allNodes=null},T.prototype.resetAllEdges=function(){this.allEdges=null},T.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},T.prototype.getAllEdges=function(){if(null==this.allEdges){for(var I=[],p=this.getGraphs(),m=0;m<p.length;m++)I=I.concat(p[m].getEdges());I=I.concat(this.edges),this.allEdges=I}return this.allEdges},T.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},T.prototype.setAllNodesToApplyGravitation=function(I){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=I},T.prototype.getRoot=function(){return this.rootGraph},T.prototype.setRootGraph=function(I){if(I.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=I,null==I.parent&&(I.parent=this.layout.newNode("Root node"))},T.prototype.getLayout=function(){return this.layout},T.prototype.isOneAncestorOfOther=function(I,p){if(null==I||null==p)throw"assert failed";if(I==p)return!0;for(var m,x=I.getOwner();null!=(m=x.getParent());){if(m==p)return!0;if(null==(x=m.getOwner()))break}for(x=p.getOwner();null!=(m=x.getParent());){if(m==I)return!0;if(null==(x=m.getOwner()))break}return!1},T.prototype.calcLowestCommonAncestors=function(){for(var I,p,x,m,A,D=this.getAllEdges(),k=D.length,G=0;G<k;G++)if(p=(I=D[G]).source,x=I.target,I.lca=null,I.sourceInLca=p,I.targetInLca=x,p!=x){for(m=p.getOwner();null==I.lca;){for(I.targetInLca=x,A=x.getOwner();null==I.lca;){if(A==m){I.lca=A;break}if(A==this.rootGraph)break;if(null!=I.lca)throw"assert failed";I.targetInLca=A.getParent(),A=I.targetInLca.getOwner()}if(m==this.rootGraph)break;null==I.lca&&(I.sourceInLca=m.getParent(),m=I.sourceInLca.getOwner())}if(null==I.lca)throw"assert failed"}else I.lca=p.getOwner()},T.prototype.calcLowestCommonAncestor=function(I,p){if(I==p)return I.getOwner();for(var x=I.getOwner();null!=x;){for(var m=p.getOwner();null!=m;){if(m==x)return m;m=m.getParent().getOwner()}x=x.getParent().getOwner()}return x},T.prototype.calcInclusionTreeDepths=function(I,p){null==I&&null==p&&(I=this.rootGraph,p=1);for(var x,m=I.getNodes(),A=m.length,D=0;D<A;D++)(x=m[D]).inclusionTreeDepth=p,null!=x.child&&this.calcInclusionTreeDepths(x.child,p+1)},T.prototype.includesInvalidEdge=function(){for(var I,p=this.edges.length,x=0;x<p;x++)if(this.isOneAncestorOfOther((I=this.edges[x]).source,I.target))return!0;return!1},Ne.exports=T},function(Ne,Y,W){"use strict";var M=W(0);function E(){}for(var T in M)E[T]=M[T];E.MAX_ITERATIONS=2500,E.DEFAULT_EDGE_LENGTH=50,E.DEFAULT_SPRING_STRENGTH=.45,E.DEFAULT_REPULSION_STRENGTH=4500,E.DEFAULT_GRAVITY_STRENGTH=.4,E.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,E.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,E.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,E.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,E.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,E.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,E.COOLING_ADAPTATION_FACTOR=.33,E.ADAPTATION_LOWER_NODE_LIMIT=1e3,E.ADAPTATION_UPPER_NODE_LIMIT=5e3,E.MAX_NODE_DISPLACEMENT=3*(E.MAX_NODE_DISPLACEMENT_INCREMENTAL=100),E.MIN_REPULSION_DIST=E.DEFAULT_EDGE_LENGTH/10,E.CONVERGENCE_CHECK_PERIOD=100,E.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,E.MIN_EDGE_LENGTH=1,E.GRID_CALCULATION_CHECK_PERIOD=10,Ne.exports=E},function(Ne,Y,W){"use strict";var M=W(12);function E(){}E.calcSeparationAmount=function(T,I,p,x){if(!T.intersects(I))throw"assert failed";var m=new Array(2);this.decideDirectionsForOverlappingNodes(T,I,m),p[0]=Math.min(T.getRight(),I.getRight())-Math.max(T.x,I.x),p[1]=Math.min(T.getBottom(),I.getBottom())-Math.max(T.y,I.y),T.getX()<=I.getX()&&T.getRight()>=I.getRight()?p[0]+=Math.min(I.getX()-T.getX(),T.getRight()-I.getRight()):I.getX()<=T.getX()&&I.getRight()>=T.getRight()&&(p[0]+=Math.min(T.getX()-I.getX(),I.getRight()-T.getRight())),T.getY()<=I.getY()&&T.getBottom()>=I.getBottom()?p[1]+=Math.min(I.getY()-T.getY(),T.getBottom()-I.getBottom()):I.getY()<=T.getY()&&I.getBottom()>=T.getBottom()&&(p[1]+=Math.min(T.getY()-I.getY(),I.getBottom()-T.getBottom()));var A=Math.abs((I.getCenterY()-T.getCenterY())/(I.getCenterX()-T.getCenterX()));I.getCenterY()===T.getCenterY()&&I.getCenterX()===T.getCenterX()&&(A=1);var D=A*p[0],k=p[1]/A;p[0]<k?k=p[0]:D=p[1],p[0]=-1*m[0]*(k/2+x),p[1]=-1*m[1]*(D/2+x)},E.decideDirectionsForOverlappingNodes=function(T,I,p){p[0]=T.getCenterX()<I.getCenterX()?-1:1,p[1]=T.getCenterY()<I.getCenterY()?-1:1},E.getIntersection2=function(T,I,p){var x=T.getCenterX(),m=T.getCenterY(),A=I.getCenterX(),D=I.getCenterY();if(T.intersects(I))return p[0]=x,p[1]=m,p[2]=A,p[3]=D,!0;var k=T.getX(),G=T.getY(),P=T.getRight(),O=T.getX(),$=T.getBottom(),B=T.getRight(),re=T.getWidthHalf(),j=T.getHeightHalf(),xe=I.getX(),ne=I.getY(),R=I.getRight(),S=I.getX(),L=I.getBottom(),_=I.getRight(),ee=I.getWidthHalf(),ie=I.getHeightHalf(),H=!1,ae=!1;if(x===A){if(m>D)return p[0]=x,p[1]=G,p[2]=A,p[3]=L,!1;if(m<D)return p[0]=x,p[1]=$,p[2]=A,p[3]=ne,!1}else if(m===D){if(x>A)return p[0]=k,p[1]=m,p[2]=R,p[3]=D,!1;if(x<A)return p[0]=P,p[1]=m,p[2]=xe,p[3]=D,!1}else{var me=T.height/T.width,ve=I.height/I.width,Ee=(D-m)/(A-x),Ge=void 0,fe=void 0,ce=void 0,pe=void 0;if(-me===Ee?x>A?(p[0]=O,p[1]=$,H=!0):(p[0]=P,p[1]=G,H=!0):me===Ee&&(x>A?(p[0]=k,p[1]=G,H=!0):(p[0]=B,p[1]=$,H=!0)),-ve===Ee?A>x?(p[2]=S,p[3]=L,ae=!0):(p[2]=R,p[3]=ne,ae=!0):ve===Ee&&(A>x?(p[2]=xe,p[3]=ne,ae=!0):(p[2]=_,p[3]=L,ae=!0)),H&&ae)return!1;if(x>A?m>D?(Ge=this.getCardinalDirection(me,Ee,4),fe=this.getCardinalDirection(ve,Ee,2)):(Ge=this.getCardinalDirection(-me,Ee,3),fe=this.getCardinalDirection(-ve,Ee,1)):m>D?(Ge=this.getCardinalDirection(-me,Ee,1),fe=this.getCardinalDirection(-ve,Ee,3)):(Ge=this.getCardinalDirection(me,Ee,2),fe=this.getCardinalDirection(ve,Ee,4)),!H)switch(Ge){case 1:ce=G,p[0]=x+-j/Ee,p[1]=ce;break;case 2:ce=m+re*Ee,p[0]=B,p[1]=ce;break;case 3:ce=$,p[0]=x+j/Ee,p[1]=ce;break;case 4:ce=m+-re*Ee,p[0]=O,p[1]=ce}if(!ae)switch(fe){case 1:pe=ne,p[2]=A+-ie/Ee,p[3]=pe;break;case 2:pe=D+ee*Ee,p[2]=_,p[3]=pe;break;case 3:pe=L,p[2]=A+ie/Ee,p[3]=pe;break;case 4:pe=D+-ee*Ee,p[2]=S,p[3]=pe}}return!1},E.getCardinalDirection=function(T,I,p){return T>I?p:1+p%4},E.getIntersection=function(T,I,p,x){if(null==x)return this.getIntersection2(T,I,p);var j,xe,ne,R,S,L,_,m=T.x,A=T.y,D=I.x,k=I.y,G=p.x,P=p.y,O=x.x,$=x.y;return S=D*A-m*k,L=O*P-G*$,0===(_=(j=k-A)*(R=G-O)-(xe=$-P)*(ne=m-D))?null:new M((ne*L-R*S)/_,(xe*S-j*L)/_)},E.angleOfVector=function(T,I,p,x){var m=void 0;return T!==p?(m=Math.atan((x-I)/(p-T)),p<T?m+=Math.PI:x<I&&(m+=this.TWO_PI)):m=x<I?this.ONE_AND_HALF_PI:this.HALF_PI,m},E.doIntersect=function(T,I,p,x){var m=T.x,A=T.y,D=I.x,k=I.y,G=p.x,P=p.y,O=x.x,$=x.y,B=(D-m)*($-P)-(O-G)*(k-A);if(0===B)return!1;var re=(($-P)*(O-m)+(G-O)*($-A))/B,j=((A-k)*(O-m)+(D-m)*($-A))/B;return 0<re&&re<1&&0<j&&j<1},E.HALF_PI=.5*Math.PI,E.ONE_AND_HALF_PI=1.5*Math.PI,E.TWO_PI=2*Math.PI,E.THREE_PI=3*Math.PI,Ne.exports=E},function(Ne,Y,W){"use strict";function M(){}M.sign=function(E){return E>0?1:E<0?-1:0},M.floor=function(E){return E<0?Math.ceil(E):Math.floor(E)},M.ceil=function(E){return E<0?Math.floor(E):Math.ceil(E)},Ne.exports=M},function(Ne,Y,W){"use strict";function M(){}M.MAX_VALUE=2147483647,M.MIN_VALUE=-2147483648,Ne.exports=M},function(Ne,Y,W){"use strict";var M=function(){function m(A,D){for(var k=0;k<D.length;k++){var G=D[k];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(A,G.key,G)}}return function(A,D,k){return D&&m(A.prototype,D),k&&m(A,k),A}}();var T=function(A){return{value:A,next:null,prev:null}},I=function(A,D,k,G){return null!==A?A.next=D:G.head=D,null!==k?k.prev=D:G.tail=D,D.prev=A,D.next=k,G.length++,D},p=function(A,D){var k=A.prev,G=A.next;return null!==k?k.next=G:D.head=G,null!==G?G.prev=k:D.tail=k,A.prev=A.next=null,D.length--,A},x=function(){function m(A){var D=this;(function E(m,A){if(!(m instanceof A))throw new TypeError("Cannot call a class as a function")})(this,m),this.length=0,this.head=null,this.tail=null,A?.forEach(function(k){return D.push(k)})}return M(m,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(D,k){return I(k.prev,T(D),k,this)}},{key:"insertAfter",value:function(D,k){return I(k,T(D),k.next,this)}},{key:"insertNodeBefore",value:function(D,k){return I(k.prev,D,k,this)}},{key:"insertNodeAfter",value:function(D,k){return I(k,D,k.next,this)}},{key:"push",value:function(D){return I(this.tail,T(D),null,this)}},{key:"unshift",value:function(D){return I(null,T(D),this.head,this)}},{key:"remove",value:function(D){return p(D,this)}},{key:"pop",value:function(){return p(this.tail,this).value}},{key:"popNode",value:function(){return p(this.tail,this)}},{key:"shift",value:function(){return p(this.head,this).value}},{key:"shiftNode",value:function(){return p(this.head,this)}},{key:"get_object_at",value:function(D){if(D<=this.length()){for(var k=1,G=this.head;k<D;)G=G.next,k++;return G.value}}},{key:"set_object_at",value:function(D,k){if(D<=this.length()){for(var G=1,P=this.head;G<D;)P=P.next,G++;P.value=k}}}]),m}();Ne.exports=x},function(Ne,Y,W){"use strict";function M(E,T,I){this.x=null,this.y=null,null==E&&null==T&&null==I?(this.x=0,this.y=0):"number"==typeof E&&"number"==typeof T&&null==I?(this.x=E,this.y=T):"Point"==E.constructor.name&&null==T&&null==I&&(this.x=(I=E).x,this.y=I.y)}M.prototype.getX=function(){return this.x},M.prototype.getY=function(){return this.y},M.prototype.getLocation=function(){return new M(this.x,this.y)},M.prototype.setLocation=function(E,T,I){"Point"==E.constructor.name&&null==T&&null==I?this.setLocation((I=E).x,I.y):"number"==typeof E&&"number"==typeof T&&null==I&&(parseInt(E)==E&&parseInt(T)==T?this.move(E,T):(this.x=Math.floor(E+.5),this.y=Math.floor(T+.5)))},M.prototype.move=function(E,T){this.x=E,this.y=T},M.prototype.translate=function(E,T){this.x+=E,this.y+=T},M.prototype.equals=function(E){return"Point"==E.constructor.name?this.x==E.x&&this.y==E.y:this==E},M.prototype.toString=function(){return(new M).constructor.name+"[x="+this.x+",y="+this.y+"]"},Ne.exports=M},function(Ne,Y,W){"use strict";function M(E,T,I,p){this.x=0,this.y=0,this.width=0,this.height=0,null!=E&&null!=T&&null!=I&&null!=p&&(this.x=E,this.y=T,this.width=I,this.height=p)}M.prototype.getX=function(){return this.x},M.prototype.setX=function(E){this.x=E},M.prototype.getY=function(){return this.y},M.prototype.setY=function(E){this.y=E},M.prototype.getWidth=function(){return this.width},M.prototype.setWidth=function(E){this.width=E},M.prototype.getHeight=function(){return this.height},M.prototype.setHeight=function(E){this.height=E},M.prototype.getRight=function(){return this.x+this.width},M.prototype.getBottom=function(){return this.y+this.height},M.prototype.intersects=function(E){return!(this.getRight()<E.x||this.getBottom()<E.y||E.getRight()<this.x||E.getBottom()<this.y)},M.prototype.getCenterX=function(){return this.x+this.width/2},M.prototype.getMinX=function(){return this.getX()},M.prototype.getMaxX=function(){return this.getX()+this.width},M.prototype.getCenterY=function(){return this.y+this.height/2},M.prototype.getMinY=function(){return this.getY()},M.prototype.getMaxY=function(){return this.getY()+this.height},M.prototype.getWidthHalf=function(){return this.width/2},M.prototype.getHeightHalf=function(){return this.height/2},Ne.exports=M},function(Ne,Y,W){"use strict";var M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(T){return typeof T}:function(T){return T&&"function"==typeof Symbol&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T};function E(){}E.lastID=0,E.createID=function(T){return E.isPrimitive(T)?T:(null!=T.uniqueID||(T.uniqueID=E.getString(),E.lastID++),T.uniqueID)},E.getString=function(T){return null==T&&(T=E.lastID),"Object#"+T},E.isPrimitive=function(T){var I=typeof T>"u"?"undefined":M(T);return null==T||"object"!=I&&"function"!=I},Ne.exports=E},function(Ne,Y,W){"use strict";function M(G){if(Array.isArray(G)){for(var P=0,O=Array(G.length);P<G.length;P++)O[P]=G[P];return O}return Array.from(G)}var E=W(0),T=W(6),I=W(3),p=W(1),x=W(5),m=W(4),A=W(17),D=W(27);function k(G){D.call(this),this.layoutQuality=E.QUALITY,this.createBendsAsNeeded=E.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=E.DEFAULT_INCREMENTAL,this.animationOnLayout=E.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=E.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=E.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=E.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new T(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=G&&(this.isRemoteUse=G)}k.RANDOM_SEED=1,(k.prototype=Object.create(D.prototype)).getGraphManager=function(){return this.graphManager},k.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},k.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},k.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},k.prototype.newGraphManager=function(){var G=new T(this);return this.graphManager=G,G},k.prototype.newGraph=function(G){return new x(null,this.graphManager,G)},k.prototype.newNode=function(G){return new I(this.graphManager,G)},k.prototype.newEdge=function(G){return new p(null,null,G)},k.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},k.prototype.runLayout=function(){var G;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),G=!this.checkLayoutSuccess()&&this.layout(),"during"!==E.ANIMATE&&(G&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,G)},k.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},k.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var P=this.graphManager.getAllEdges(),O=0;O<P.length;O++);var B=this.graphManager.getRoot().getNodes();for(O=0;O<B.length;O++);this.update(this.graphManager.getRoot())}},k.prototype.update=function(G){if(null==G)this.update2();else if(G instanceof I){var P=G;if(null!=P.getChild())for(var O=P.getChild().getNodes(),$=0;$<O.length;$++)update(O[$]);null!=P.vGraphObject&&P.vGraphObject.update(P)}else G instanceof p?null!=G.vGraphObject&&G.vGraphObject.update(G):G instanceof x&&null!=G.vGraphObject&&G.vGraphObject.update(G)},k.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=E.QUALITY,this.animationDuringLayout=E.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=E.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=E.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=E.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=E.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=E.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},k.prototype.transform=function(G){if(null==G)this.transform(new m(0,0));else{var P=new A,O=this.graphManager.getRoot().updateLeftTop();if(null!=O){P.setWorldOrgX(G.x),P.setWorldOrgY(G.y),P.setDeviceOrgX(O.x),P.setDeviceOrgY(O.y);for(var $=this.getAllNodes(),re=0;re<$.length;re++)$[re].transform(P)}}},k.prototype.positionNodesRandomly=function(G){if(null==G)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var P,O,$=G.getNodes(),B=0;B<$.length;B++)null==(O=(P=$[B]).getChild())||0==O.getNodes().length?P.scatter():(this.positionNodesRandomly(O),P.updateBounds())},k.prototype.getFlatForest=function(){for(var G=[],P=!0,O=this.graphManager.getRoot().getNodes(),$=!0,B=0;B<O.length;B++)null!=O[B].getChild()&&($=!1);if(!$)return G;var re=new Set,j=[],xe=new Map,ne=[];for(ne=ne.concat(O);ne.length>0&&P;){for(j.push(ne[0]);j.length>0&&P;){var R=j[0];j.splice(0,1),re.add(R);var S=R.getEdges();for(B=0;B<S.length;B++){var L=S[B].getOtherEnd(R);if(xe.get(R)!=L){if(re.has(L)){P=!1;break}j.push(L),xe.set(L,R)}}}if(P){var _=[].concat(M(re));for(G.push(_),B=0;B<_.length;B++){var ie=ne.indexOf(_[B]);ie>-1&&ne.splice(ie,1)}re=new Set,xe=new Map}else G=[]}return G},k.prototype.createDummyNodesForBendpoints=function(G){for(var P=[],O=G.source,$=this.graphManager.calcLowestCommonAncestor(G.source,G.target),B=0;B<G.bendpoints.length;B++){var re=this.newNode(null);re.setRect(new Point(0,0),new Dimension(1,1)),$.add(re);var j=this.newEdge(null);this.graphManager.add(j,O,re),P.add(re),O=re}return j=this.newEdge(null),this.graphManager.add(j,O,G.target),this.edgeToDummyNodes.set(G,P),G.isInterGraph()?this.graphManager.remove(G):$.remove(G),P},k.prototype.createBendpointsFromDummyNodes=function(){var G=[];G=G.concat(this.graphManager.getAllEdges()),G=[].concat(M(this.edgeToDummyNodes.keys())).concat(G);for(var P=0;P<G.length;P++){var O=G[P];if(O.bendpoints.length>0){for(var $=this.edgeToDummyNodes.get(O),B=0;B<$.length;B++){var re=$[B],j=new m(re.getCenterX(),re.getCenterY()),xe=O.bendpoints.get(B);xe.x=j.x,xe.y=j.y,re.getOwner().remove(re)}this.graphManager.add(O,O.source,O.target)}}},k.transform=function(G,P,O,$){if(null!=O&&null!=$){var B=P;return G<=50?B-=(P-P/O)/50*(50-G):B+=(P*$-P)/50*(G-50),B}var xe,ne;return G<=50?(xe=9*P/500,ne=P/10):(xe=9*P/50,ne=-8*P),xe*G+ne},k.findCenterOfTree=function(G){var P=[];P=P.concat(G);var O=[],$=new Map,B=!1,re=null;(1==P.length||2==P.length)&&(B=!0,re=P[0]);for(var j=0;j<P.length;j++){var ne=(xe=P[j]).getNeighborsList().size;$.set(xe,xe.getNeighborsList().size),1==ne&&O.push(xe)}var R=[];for(R=R.concat(O);!B;){var S=[];for(S=S.concat(R),R=[],j=0;j<P.length;j++){var xe,L=P.indexOf(xe=P[j]);L>=0&&P.splice(L,1),xe.getNeighborsList().forEach(function(H){if(O.indexOf(H)<0){var me=$.get(H)-1;1==me&&R.push(H),$.set(H,me)}})}O=O.concat(R),(1==P.length||2==P.length)&&(B=!0,re=P[0])}return re},k.prototype.setGraphManager=function(G){this.graphManager=G},Ne.exports=k},function(Ne,Y,W){"use strict";function M(){}M.seed=1,M.x=0,M.nextDouble=function(){return(M.x=1e4*Math.sin(M.seed++))-Math.floor(M.x)},Ne.exports=M},function(Ne,Y,W){"use strict";var M=W(4);function E(T,I){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}E.prototype.getWorldOrgX=function(){return this.lworldOrgX},E.prototype.setWorldOrgX=function(T){this.lworldOrgX=T},E.prototype.getWorldOrgY=function(){return this.lworldOrgY},E.prototype.setWorldOrgY=function(T){this.lworldOrgY=T},E.prototype.getWorldExtX=function(){return this.lworldExtX},E.prototype.setWorldExtX=function(T){this.lworldExtX=T},E.prototype.getWorldExtY=function(){return this.lworldExtY},E.prototype.setWorldExtY=function(T){this.lworldExtY=T},E.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},E.prototype.setDeviceOrgX=function(T){this.ldeviceOrgX=T},E.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},E.prototype.setDeviceOrgY=function(T){this.ldeviceOrgY=T},E.prototype.getDeviceExtX=function(){return this.ldeviceExtX},E.prototype.setDeviceExtX=function(T){this.ldeviceExtX=T},E.prototype.getDeviceExtY=function(){return this.ldeviceExtY},E.prototype.setDeviceExtY=function(T){this.ldeviceExtY=T},E.prototype.transformX=function(T){var I=0,p=this.lworldExtX;return 0!=p&&(I=this.ldeviceOrgX+(T-this.lworldOrgX)*this.ldeviceExtX/p),I},E.prototype.transformY=function(T){var I=0,p=this.lworldExtY;return 0!=p&&(I=this.ldeviceOrgY+(T-this.lworldOrgY)*this.ldeviceExtY/p),I},E.prototype.inverseTransformX=function(T){var I=0,p=this.ldeviceExtX;return 0!=p&&(I=this.lworldOrgX+(T-this.ldeviceOrgX)*this.lworldExtX/p),I},E.prototype.inverseTransformY=function(T){var I=0,p=this.ldeviceExtY;return 0!=p&&(I=this.lworldOrgY+(T-this.ldeviceOrgY)*this.lworldExtY/p),I},E.prototype.inverseTransformPoint=function(T){return new M(this.inverseTransformX(T.x),this.inverseTransformY(T.y))},Ne.exports=E},function(Ne,Y,W){"use strict";var E=W(15),T=W(7),I=W(0),p=W(8),x=W(9);function m(){E.call(this),this.useSmartIdealEdgeLengthCalculation=T.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=T.DEFAULT_EDGE_LENGTH,this.springConstant=T.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=T.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=T.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=T.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=T.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*T.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=T.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=T.MAX_ITERATIONS}for(var A in m.prototype=Object.create(E.prototype),E)m[A]=E[A];m.prototype.initParameters=function(){E.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=T.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},m.prototype.calcIdealEdgeLengths=function(){for(var D,k,G,P,O,$,B=this.getGraphManager().getAllEdges(),re=0;re<B.length;re++)(D=B[re]).idealLength=this.idealEdgeLength,D.isInterGraph&&(G=D.getSource(),P=D.getTarget(),O=D.getSourceInLca().getEstimatedSize(),$=D.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(D.idealLength+=O+$-2*I.SIMPLE_NODE_SIZE),k=D.getLca().getInclusionTreeDepth(),D.idealLength+=T.DEFAULT_EDGE_LENGTH*T.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(G.getInclusionTreeDepth()+P.getInclusionTreeDepth()-2*k))},m.prototype.initSpringEmbedder=function(){var D=this.getAllNodes().length;this.incremental?(D>T.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*T.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(D-T.ADAPTATION_LOWER_NODE_LIMIT)/(T.ADAPTATION_UPPER_NODE_LIMIT-T.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-T.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=T.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=D>T.ADAPTATION_LOWER_NODE_LIMIT?Math.max(T.COOLING_ADAPTATION_FACTOR,1-(D-T.ADAPTATION_LOWER_NODE_LIMIT)/(T.ADAPTATION_UPPER_NODE_LIMIT-T.ADAPTATION_LOWER_NODE_LIMIT)*(1-T.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=T.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},m.prototype.calcSpringForces=function(){for(var k,D=this.getAllEdges(),G=0;G<D.length;G++)this.calcSpringForce(k=D[G],k.idealLength)},m.prototype.calcRepulsionForces=function(){var G,P,O,$,re,D=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],k=arguments.length>1&&void 0!==arguments[1]&&arguments[1],B=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%T.GRID_CALCULATION_CHECK_PERIOD==1&&D&&this.updateGrid(),re=new Set,G=0;G<B.length;G++)this.calculateRepulsionForceOfANode(O=B[G],re,D,k),re.add(O);else for(G=0;G<B.length;G++)for(O=B[G],P=G+1;P<B.length;P++)$=B[P],O.getOwner()==$.getOwner()&&this.calcRepulsionForce(O,$)},m.prototype.calcGravitationalForces=function(){for(var k=this.getAllNodesToApplyGravitation(),G=0;G<k.length;G++)this.calcGravitationalForce(k[G])},m.prototype.moveNodes=function(){for(var D=this.getAllNodes(),G=0;G<D.length;G++)D[G].move()},m.prototype.calcSpringForce=function(D,k){var O,$,B,re,G=D.getSource(),P=D.getTarget();if(this.uniformLeafNodeSizes&&null==G.getChild()&&null==P.getChild())D.updateLengthSimple();else if(D.updateLength(),D.isOverlapingSourceAndTarget)return;0!=(O=D.getLength())&&(re=($=this.springConstant*(O-k))*(D.lengthY/O),G.springForceX+=B=$*(D.lengthX/O),G.springForceY+=re,P.springForceX-=B,P.springForceY-=re)},m.prototype.calcRepulsionForce=function(D,k){var B,re,j,xe,ne,R,S,G=D.getRect(),P=k.getRect(),O=new Array(2),$=new Array(4);if(G.intersects(P)){p.calcSeparationAmount(G,P,O,T.DEFAULT_EDGE_LENGTH/2),S=2*O[1];var L=D.noOfChildren*k.noOfChildren/(D.noOfChildren+k.noOfChildren);D.repulsionForceX-=L*(R=2*O[0]),D.repulsionForceY-=L*S,k.repulsionForceX+=L*R,k.repulsionForceY+=L*S}else this.uniformLeafNodeSizes&&null==D.getChild()&&null==k.getChild()?(B=P.getCenterX()-G.getCenterX(),re=P.getCenterY()-G.getCenterY()):(p.getIntersection(G,P,$),B=$[2]-$[0],re=$[3]-$[1]),Math.abs(B)<T.MIN_REPULSION_DIST&&(B=x.sign(B)*T.MIN_REPULSION_DIST),Math.abs(re)<T.MIN_REPULSION_DIST&&(re=x.sign(re)*T.MIN_REPULSION_DIST),j=B*B+re*re,xe=Math.sqrt(j),S=(ne=this.repulsionConstant*D.noOfChildren*k.noOfChildren/j)*re/xe,D.repulsionForceX-=R=ne*B/xe,D.repulsionForceY-=S,k.repulsionForceX+=R,k.repulsionForceY+=S},m.prototype.calcGravitationalForce=function(D){var k,G,P,O,$,B,re,j;G=((k=D.getOwner()).getRight()+k.getLeft())/2,P=(k.getTop()+k.getBottom())/2,O=D.getCenterX()-G,$=D.getCenterY()-P,B=Math.abs(O)+D.getWidth()/2,re=Math.abs($)+D.getHeight()/2,D.getOwner()==this.graphManager.getRoot()?(B>(j=k.getEstimatedSize()*this.gravityRangeFactor)||re>j)&&(D.gravitationForceX=-this.gravityConstant*O,D.gravitationForceY=-this.gravityConstant*$):(B>(j=k.getEstimatedSize()*this.compoundGravityRangeFactor)||re>j)&&(D.gravitationForceX=-this.gravityConstant*O*this.compoundGravityConstant,D.gravitationForceY=-this.gravityConstant*$*this.compoundGravityConstant)},m.prototype.isConverged=function(){var D,k=!1;return this.totalIterations>this.maxIterations/3&&(k=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),D=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,D||k},m.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},m.prototype.calcNoOfChildrenForAllNodes=function(){for(var D,k=this.graphManager.getAllNodes(),G=0;G<k.length;G++)(D=k[G]).noOfChildren=D.getNoOfChildren()},m.prototype.calcGrid=function(D){var k,G;k=parseInt(Math.ceil((D.getRight()-D.getLeft())/this.repulsionRange)),G=parseInt(Math.ceil((D.getBottom()-D.getTop())/this.repulsionRange));for(var P=new Array(k),O=0;O<k;O++)P[O]=new Array(G);for(O=0;O<k;O++)for(var $=0;$<G;$++)P[O][$]=new Array;return P},m.prototype.addNodeToGrid=function(D,k,G){var P,O,$,B;P=parseInt(Math.floor((D.getRect().x-k)/this.repulsionRange)),O=parseInt(Math.floor((D.getRect().width+D.getRect().x-k)/this.repulsionRange)),$=parseInt(Math.floor((D.getRect().y-G)/this.repulsionRange)),B=parseInt(Math.floor((D.getRect().height+D.getRect().y-G)/this.repulsionRange));for(var re=P;re<=O;re++)for(var j=$;j<=B;j++)this.grid[re][j].push(D),D.setGridCoordinates(P,O,$,B)},m.prototype.updateGrid=function(){var D,G=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),D=0;D<G.length;D++)this.addNodeToGrid(G[D],this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},m.prototype.calculateRepulsionForceOfANode=function(D,k,G,P){if(this.totalIterations%T.GRID_CALCULATION_CHECK_PERIOD==1&&G||P){var O=new Set;D.surrounding=new Array;for(var $,B=this.grid,re=D.startX-1;re<D.finishX+2;re++)for(var j=D.startY-1;j<D.finishY+2;j++)if(!(re<0||j<0||re>=B.length||j>=B[0].length))for(var xe=0;xe<B[re][j].length;xe++)if($=B[re][j][xe],D.getOwner()==$.getOwner()&&D!=$&&!k.has($)&&!O.has($)){var ne=Math.abs(D.getCenterX()-$.getCenterX())-(D.getWidth()/2+$.getWidth()/2),R=Math.abs(D.getCenterY()-$.getCenterY())-(D.getHeight()/2+$.getHeight()/2);ne<=this.repulsionRange&&R<=this.repulsionRange&&O.add($)}D.surrounding=[].concat(function M(D){if(Array.isArray(D)){for(var k=0,G=Array(D.length);k<D.length;k++)G[k]=D[k];return G}return Array.from(D)}(O))}for(re=0;re<D.surrounding.length;re++)this.calcRepulsionForce(D,D.surrounding[re])},m.prototype.calcRepulsionRange=function(){return 0},Ne.exports=m},function(Ne,Y,W){"use strict";var M=W(1),E=W(7);function T(p,x,m){M.call(this,p,x,m),this.idealLength=E.DEFAULT_EDGE_LENGTH}for(var I in T.prototype=Object.create(M.prototype),M)T[I]=M[I];Ne.exports=T},function(Ne,Y,W){"use strict";var M=W(3);function E(I,p,x,m){M.call(this,I,p,x,m),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var T in E.prototype=Object.create(M.prototype),M)E[T]=M[T];E.prototype.setGridCoordinates=function(I,p,x,m){this.startX=I,this.finishX=p,this.startY=x,this.finishY=m},Ne.exports=E},function(Ne,Y,W){"use strict";function M(E,T){this.width=0,this.height=0,null!==E&&null!==T&&(this.height=T,this.width=E)}M.prototype.getWidth=function(){return this.width},M.prototype.setWidth=function(E){this.width=E},M.prototype.getHeight=function(){return this.height},M.prototype.setHeight=function(E){this.height=E},Ne.exports=M},function(Ne,Y,W){"use strict";var M=W(14);function E(){this.map={},this.keys=[]}E.prototype.put=function(T,I){var p=M.createID(T);this.contains(p)||(this.map[p]=I,this.keys.push(T))},E.prototype.contains=function(T){return M.createID(T),null!=this.map[T]},E.prototype.get=function(T){var I=M.createID(T);return this.map[I]},E.prototype.keySet=function(){return this.keys},Ne.exports=E},function(Ne,Y,W){"use strict";var M=W(14);function E(){this.set={}}E.prototype.add=function(T){var I=M.createID(T);this.contains(I)||(this.set[I]=T)},E.prototype.remove=function(T){delete this.set[M.createID(T)]},E.prototype.clear=function(){this.set={}},E.prototype.contains=function(T){return this.set[M.createID(T)]==T},E.prototype.isEmpty=function(){return 0===this.size()},E.prototype.size=function(){return Object.keys(this.set).length},E.prototype.addAllTo=function(T){for(var I=Object.keys(this.set),p=I.length,x=0;x<p;x++)T.push(this.set[I[x]])},E.prototype.size=function(){return Object.keys(this.set).length},E.prototype.addAll=function(T){for(var I=T.length,p=0;p<I;p++)this.add(T[p])},Ne.exports=E},function(Ne,Y,W){"use strict";var M=function(){function p(x,m){for(var A=0;A<m.length;A++){var D=m[A];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(x,D.key,D)}}return function(x,m,A){return m&&p(x.prototype,m),A&&p(x,A),x}}();var T=W(11),I=function(){function p(x,m){(function E(p,x){if(!(p instanceof x))throw new TypeError("Cannot call a class as a function")})(this,p),(null!==m||void 0!==m)&&(this.compareFunction=this._defaultCompareFunction);var A;A=x instanceof T?x.size():x.length,this._quicksort(x,0,A-1)}return M(p,[{key:"_quicksort",value:function(m,A,D){if(A<D){var k=this._partition(m,A,D);this._quicksort(m,A,k),this._quicksort(m,k+1,D)}}},{key:"_partition",value:function(m,A,D){for(var k=this._get(m,A),G=A,P=D;;){for(;this.compareFunction(k,this._get(m,P));)P--;for(;this.compareFunction(this._get(m,G),k);)G++;if(!(G<P))return P;this._swap(m,G,P),G++,P--}}},{key:"_get",value:function(m,A){return m instanceof T?m.get_object_at(A):m[A]}},{key:"_set",value:function(m,A,D){m instanceof T?m.set_object_at(A,D):m[A]=D}},{key:"_swap",value:function(m,A,D){var k=this._get(m,A);this._set(m,A,this._get(m,D)),this._set(m,D,k)}},{key:"_defaultCompareFunction",value:function(m,A){return A>m}}]),p}();Ne.exports=I},function(Ne,Y,W){"use strict";var M=function(){function I(p,x){for(var m=0;m<x.length;m++){var A=x[m];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(p,A.key,A)}}return function(p,x,m){return x&&I(p.prototype,x),m&&I(p,m),p}}();var T=function(){function I(p,x){var m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,A=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,D=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;(function E(I,p){if(!(I instanceof p))throw new TypeError("Cannot call a class as a function")})(this,I),this.sequence1=p,this.sequence2=x,this.match_score=m,this.mismatch_penalty=A,this.gap_penalty=D,this.iMax=p.length+1,this.jMax=x.length+1,this.grid=new Array(this.iMax);for(var k=0;k<this.iMax;k++){this.grid[k]=new Array(this.jMax);for(var G=0;G<this.jMax;G++)this.grid[k][G]=0}this.tracebackGrid=new Array(this.iMax);for(var P=0;P<this.iMax;P++){this.tracebackGrid[P]=new Array(this.jMax);for(var O=0;O<this.jMax;O++)this.tracebackGrid[P][O]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return M(I,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var x=1;x<this.jMax;x++)this.grid[0][x]=this.grid[0][x-1]+this.gap_penalty,this.tracebackGrid[0][x]=[!1,!1,!0];for(var m=1;m<this.iMax;m++)this.grid[m][0]=this.grid[m-1][0]+this.gap_penalty,this.tracebackGrid[m][0]=[!1,!0,!1];for(var A=1;A<this.iMax;A++)for(var D=1;D<this.jMax;D++){var O=[this.sequence1[A-1]===this.sequence2[D-1]?this.grid[A-1][D-1]+this.match_score:this.grid[A-1][D-1]+this.mismatch_penalty,this.grid[A-1][D]+this.gap_penalty,this.grid[A][D-1]+this.gap_penalty],$=this.arrayAllMaxIndexes(O);this.grid[A][D]=O[$[0]],this.tracebackGrid[A][D]=[$.includes(0),$.includes(1),$.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var x=[];for(x.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});x[0];){var m=x[0],A=this.tracebackGrid[m.pos[0]][m.pos[1]];A[0]&&x.push({pos:[m.pos[0]-1,m.pos[1]-1],seq1:this.sequence1[m.pos[0]-1]+m.seq1,seq2:this.sequence2[m.pos[1]-1]+m.seq2}),A[1]&&x.push({pos:[m.pos[0]-1,m.pos[1]],seq1:this.sequence1[m.pos[0]-1]+m.seq1,seq2:"-"+m.seq2}),A[2]&&x.push({pos:[m.pos[0],m.pos[1]-1],seq1:"-"+m.seq1,seq2:this.sequence2[m.pos[1]-1]+m.seq2}),0===m.pos[0]&&0===m.pos[1]&&this.alignments.push({sequence1:m.seq1,sequence2:m.seq2}),x.shift()}return this.alignments}},{key:"getAllIndexes",value:function(x,m){for(var A=[],D=-1;-1!==(D=x.indexOf(m,D+1));)A.push(D);return A}},{key:"arrayAllMaxIndexes",value:function(x){return this.getAllIndexes(x,Math.max.apply(null,x))}}]),I}();Ne.exports=T},function(Ne,Y,W){"use strict";var M=function(){};M.FDLayout=W(18),M.FDLayoutConstants=W(7),M.FDLayoutEdge=W(19),M.FDLayoutNode=W(20),M.DimensionD=W(21),M.HashMap=W(22),M.HashSet=W(23),M.IGeometry=W(8),M.IMath=W(9),M.Integer=W(10),M.Point=W(12),M.PointD=W(4),M.RandomSeed=W(16),M.RectangleD=W(13),M.Transform=W(17),M.UniqueIDGeneretor=W(14),M.Quicksort=W(24),M.LinkedList=W(11),M.LGraphObject=W(2),M.LGraph=W(5),M.LEdge=W(1),M.LGraphManager=W(6),M.LNode=W(3),M.Layout=W(15),M.LayoutConstants=W(0),M.NeedlemanWunsch=W(25),Ne.exports=M},function(Ne,Y,W){"use strict";function M(){this.listeners=[]}var E=M.prototype;E.addListener=function(T,I){this.listeners.push({event:T,callback:I})},E.removeListener=function(T,I){for(var p=this.listeners.length;p>=0;p--){var x=this.listeners[p];x.event===T&&x.callback===I&&this.listeners.splice(p,1)}},E.emit=function(T,I){for(var p=0;p<this.listeners.length;p++){var x=this.listeners[p];T===x.event&&x.callback(I)}},Ne.exports=M}])},1224(Ze,Ne,Y){Ze.exports=Y(4548)},250(Ze){"use strict";Ze.exports=class zf{constructor(Y,W=new Map,M=0){this.prefix=Y,this._existing=W,this.counter=M}clone(){const{prefix:Y,_existing:W,counter:M}=this;return new zf(Y,new Map(W),M)}getId(Y){const W=Y&&this._existing.get(Y);if(W)return W;const M=this.prefix+this.counter;return this.counter++,Y&&this._existing.set(Y,M),M}hasId(Y){return this._existing.has(Y)}getOldIds(){return[...this._existing.keys()]}}},1126(Ze,Ne,Y){"use strict";var W=Y(9293).default;Y(7140);const M=self.crypto||self.msCrypto;Ze.exports=class{constructor(T){if(!M||!M.subtle)throw new Error("crypto.subtle not found.");if("sha256"===T)this.algorithm={name:"SHA-256"};else{if("sha1"!==T)throw new Error(`Unsupported algorithm "${T}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(T){this._content+=T}digest(){var T=this;return W(function*(){const I=(new TextEncoder).encode(T._content),p=new Uint8Array(yield M.subtle.digest(T.algorithm,I));let x="";for(let m=0;m<p.length;++m)x+=p[m].toString(16).padStart(2,"0");return x})()}}},8276(Ze){"use strict";const W="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",M="http://www.w3.org/2001/XMLSchema#string",E="NamedNode",T="BlankNode",I="Literal",p="DefaultGraph",x={};function m(P,O){return P.subject.termType===O.subject.termType&&P.object.termType===O.object.termType&&P.subject.value===O.subject.value&&P.predicate.value===O.predicate.value&&P.object.value===O.object.value&&(P.object.termType!==I||P.object.datatype.termType===O.object.datatype.termType&&P.object.language===O.object.language&&P.object.datatype.value===O.object.datatype.value)}(()=>{const P="(?:<([^:]+:[^>]*)>)",$="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_",B=$+"0-9-\xb7\u0300-\u036f\u203f-\u2040",j="(_:(?:["+$+"0-9])(?:(?:["+B+".])*(?:["+B+"]))?)",L="[ \\t]+",_="[ \\t]*",ee="(?:"+P+"|"+j+")"+L,ie=P+L,H="(?:"+P+"|"+j+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+P+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+_,ae="(?:\\.|(?:(?:"+P+"|"+j+")"+_+"\\.))";x.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,x.empty=new RegExp("^"+_+"$"),x.quad=new RegExp("^"+_+ee+ie+H+ae+_+"$")})(),Ze.exports=class Wi{static parse(O){const $=[],B={},re=O.split(x.eoln);let j=0;for(const xe of re){if(j++,x.empty.test(xe))continue;const ne=xe.match(x.quad);if(null===ne)throw new Error("N-Quads parse error on line "+j+".");const R={subject:null,predicate:null,object:null,graph:null};if(R.subject=void 0!==ne[1]?{termType:E,value:ne[1]}:{termType:T,value:ne[2]},R.predicate={termType:E,value:ne[3]},void 0!==ne[4]?R.object={termType:E,value:ne[4]}:void 0!==ne[5]?R.object={termType:T,value:ne[5]}:(R.object={termType:I,value:void 0,datatype:{termType:E}},void 0!==ne[7]?R.object.datatype.value=ne[7]:void 0!==ne[8]?(R.object.datatype.value=W,R.object.language=ne[8]):R.object.datatype.value=M,R.object.value=G(ne[6])),R.graph=void 0!==ne[9]?{termType:E,value:ne[9]}:void 0!==ne[10]?{termType:T,value:ne[10]}:{termType:p,value:""},R.graph.value in B){let S=!0;const L=B[R.graph.value];for(const _ of L)if(m(_,R)){S=!1;break}S&&(L.push(R),$.push(R))}else B[R.graph.value]=[R],$.push(R)}return $}static serialize(O){Array.isArray(O)||(O=Wi.legacyDatasetToQuads(O));const $=[];for(const B of O)$.push(Wi.serializeQuad(B));return $.sort().join("")}static serializeQuadComponents(O,$,B,re){let j="";return j+=O.termType===E?`<${O.value}>`:`${O.value}`,j+=` <${$.value}> `,B.termType===E?j+=`<${B.value}>`:B.termType===T?j+=B.value:(j+=`"${function D(P){return P.replace(A,function(O){switch(O){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}(B.value)}"`,B.datatype.value===W?B.language&&(j+=`@${B.language}`):B.datatype.value!==M&&(j+=`^^<${B.datatype.value}>`)),re.termType===E?j+=` <${re.value}>`:re.termType===T&&(j+=` ${re.value}`),j+=" .\n",j}static serializeQuad(O){return Wi.serializeQuadComponents(O.subject,O.predicate,O.object,O.graph)}static legacyDatasetToQuads(O){const $=[],B={"blank node":T,IRI:E,literal:I};for(const re in O)O[re].forEach(xe=>{const ne={};for(const R in xe){const S=xe[R],L={termType:B[S.type],value:S.value};L.termType===I&&(L.datatype={termType:E},"datatype"in S&&(L.datatype.value=S.datatype),"language"in S?("datatype"in S||(L.datatype.value=W),L.language=S.language):"datatype"in S||(L.datatype.value=M)),ne[R]=L}ne.graph="@default"===re?{termType:p,value:""}:{termType:re.startsWith("_:")?T:E,value:re},$.push(ne)});return $}};const A=/["\\\n\r]/g,k=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function G(P){return P.replace(k,function(O,$,B,re){if($)switch($){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(B)return String.fromCharCode(parseInt(B,16));if(re)throw new Error("Unsupported U escape")})}},7794(Ze){"use strict";Ze.exports=class{constructor(Y){this.current=Y.sort(),this.done=!1,this.dir=new Map;for(let W=0;W<Y.length;++W)this.dir.set(Y[W],!0)}hasNext(){return!this.done}next(){const{current:Y,dir:W}=this,M=Y.slice();let E=null,T=0;const I=Y.length;for(let p=0;p<I;++p){const x=Y[p],m=W.get(x);(null===E||x>E)&&(m&&p>0&&x>Y[p-1]||!m&&p<I-1&&x>Y[p+1])&&(E=x,T=p)}if(null===E)this.done=!0;else{const p=W.get(E)?T-1:T+1;Y[T]=Y[p],Y[p]=E;for(const x of Y)x>E&&W.set(x,!W.get(x))}return M}}},624(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(250),E=Y(1126),T=Y(7794),I=Y(8276);function p(x,m){return x.hash<m.hash?-1:x.hash>m.hash?1:0}Ze.exports=class{constructor({createMessageDigest:m=()=>new E("sha256"),canonicalIdMap:A=new Map,maxDeepIterations:D=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new M("_:c14n",A),this.createMessageDigest=m,this.maxDeepIterations=D,this.quads=null,this.deepIterations=null}main(m){var A=this;return W(function*(){A.deepIterations=new Map,A.quads=m;for(const B of m)A._addBlankNodeQuadInfo({quad:B,component:B.subject}),A._addBlankNodeQuadInfo({quad:B,component:B.object}),A._addBlankNodeQuadInfo({quad:B,component:B.graph});const D=new Map,k=[...A.blankNodeInfo.keys()];let G=0;for(const B of k)++G%100==0&&(yield A._yield()),yield A._hashAndTrackBlankNode({id:B,hashToBlankNodes:D});const P=[...D.keys()].sort(),O=[];for(const B of P){const re=D.get(B);re.length>1?O.push(re):A.canonicalIssuer.getId(re[0])}for(const B of O){const re=[];for(const j of B){if(A.canonicalIssuer.hasId(j))continue;const xe=new M("_:b");xe.getId(j);const ne=yield A.hashNDegreeQuads(j,xe);re.push(ne)}re.sort(p);for(const j of re){const xe=j.issuer.getOldIds();for(const ne of xe)A.canonicalIssuer.getId(ne)}}const $=[];for(const B of A.quads){const re=I.serializeQuadComponents(A._componentWithCanonicalId(B.subject),B.predicate,A._componentWithCanonicalId(B.object),A._componentWithCanonicalId(B.graph));$.push(re)}return $.sort(),$.join("")})()}hashFirstDegreeQuads(m){var A=this;return W(function*(){const D=[],k=A.blankNodeInfo.get(m),G=k.quads;for(const O of G){const $={subject:null,predicate:O.predicate,object:null,graph:null};$.subject=A.modifyFirstDegreeComponent(m,O.subject,"subject"),$.object=A.modifyFirstDegreeComponent(m,O.object,"object"),$.graph=A.modifyFirstDegreeComponent(m,O.graph,"graph"),D.push(I.serializeQuad($))}D.sort();const P=A.createMessageDigest();for(const O of D)P.update(O);return k.hash=yield P.digest(),k.hash})()}hashRelatedBlankNode(m,A,D,k){var G=this;return W(function*(){let P;P=G.canonicalIssuer.hasId(m)?G.canonicalIssuer.getId(m):D.hasId(m)?D.getId(m):G.blankNodeInfo.get(m).hash;const O=G.createMessageDigest();return O.update(k),"g"!==k&&O.update(G.getRelatedPredicate(A)),O.update(P),O.digest()})()}hashNDegreeQuads(m,A){var D=this;return W(function*(){const k=D.deepIterations.get(m)||0;if(k>D.maxDeepIterations)throw new Error(`Maximum deep iterations (${D.maxDeepIterations}) exceeded.`);D.deepIterations.set(m,k+1);const G=D.createMessageDigest(),P=yield D.createHashToRelated(m,A),O=[...P.keys()].sort();for(const $ of O){G.update($);let re,B="";const j=new T(P.get($));let xe=0;for(;j.hasNext();){const ne=j.next();++xe%3==0&&(yield D._yield());let R=A.clone(),S="";const L=[];let _=!1;for(const ee of ne)if(D.canonicalIssuer.hasId(ee)?S+=D.canonicalIssuer.getId(ee):(R.hasId(ee)||L.push(ee),S+=R.getId(ee)),0!==B.length&&S>B){_=!0;break}if(!_){for(const ee of L){const ie=yield D.hashNDegreeQuads(ee,R);if(S+=R.getId(ee),S+=`<${ie.hash}>`,R=ie.issuer,0!==B.length&&S>B){_=!0;break}}_||(0===B.length||S<B)&&(B=S,re=R)}}G.update(B),A=re}return{hash:yield G.digest(),issuer:A}})()}modifyFirstDegreeComponent(m,A){return"BlankNode"!==A.termType?A:{termType:"BlankNode",value:A.value===m?"_:a":"_:z"}}getRelatedPredicate(m){return`<${m.predicate.value}>`}createHashToRelated(m,A){var D=this;return W(function*(){const k=new Map,G=D.blankNodeInfo.get(m).quads;let P=0;for(const O of G)++P%100==0&&(yield D._yield()),yield Promise.all([D._addRelatedBlankNodeHash({quad:O,component:O.subject,position:"s",id:m,issuer:A,hashToRelated:k}),D._addRelatedBlankNodeHash({quad:O,component:O.object,position:"o",id:m,issuer:A,hashToRelated:k}),D._addRelatedBlankNodeHash({quad:O,component:O.graph,position:"g",id:m,issuer:A,hashToRelated:k})]);return k})()}_hashAndTrackBlankNode(m){var A=this;return W(function*({id:D,hashToBlankNodes:k}){const G=yield A.hashFirstDegreeQuads(D),P=k.get(G);P?P.push(D):k.set(G,[D])}).apply(this,arguments)}_addBlankNodeQuadInfo({quad:m,component:A}){if("BlankNode"!==A.termType)return;const D=A.value,k=this.blankNodeInfo.get(D);k?k.quads.add(m):this.blankNodeInfo.set(D,{quads:new Set([m]),hash:null})}_addRelatedBlankNodeHash(m){var A=this;return W(function*({quad:D,component:k,position:G,id:P,issuer:O,hashToRelated:$}){if("BlankNode"!==k.termType||k.value===P)return;const B=k.value,re=yield A.hashRelatedBlankNode(B,D,O,G),j=$.get(re);j?j.push(B):$.set(re,[B])}).apply(this,arguments)}_componentWithCanonicalId(m){return"BlankNode"!==m.termType||m.value.startsWith(this.canonicalIssuer.prefix)?m:{termType:"BlankNode",value:this.canonicalIssuer.getId(m.value)}}_yield(){return W(function*(){return new Promise(m=>setImmediate(m))})()}}},203(Ze,Ne,Y){"use strict";const W=Y(250),M=Y(1126),E=Y(7794),T=Y(8276);function I(p,x){return p.hash<x.hash?-1:p.hash>x.hash?1:0}Ze.exports=class{constructor({createMessageDigest:x=()=>new M("sha256"),canonicalIdMap:m=new Map,maxDeepIterations:A=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new W("_:c14n",m),this.createMessageDigest=x,this.maxDeepIterations=A,this.quads=null,this.deepIterations=null}main(x){this.deepIterations=new Map,this.quads=x;for(const P of x)this._addBlankNodeQuadInfo({quad:P,component:P.subject}),this._addBlankNodeQuadInfo({quad:P,component:P.object}),this._addBlankNodeQuadInfo({quad:P,component:P.graph});const m=new Map,A=[...this.blankNodeInfo.keys()];for(const P of A)this._hashAndTrackBlankNode({id:P,hashToBlankNodes:m});const D=[...m.keys()].sort(),k=[];for(const P of D){const O=m.get(P);O.length>1?k.push(O):this.canonicalIssuer.getId(O[0])}for(const P of k){const O=[];for(const $ of P){if(this.canonicalIssuer.hasId($))continue;const B=new W("_:b");B.getId($);const re=this.hashNDegreeQuads($,B);O.push(re)}O.sort(I);for(const $ of O){const B=$.issuer.getOldIds();for(const re of B)this.canonicalIssuer.getId(re)}}const G=[];for(const P of this.quads){const O=T.serializeQuadComponents(this._componentWithCanonicalId({component:P.subject}),P.predicate,this._componentWithCanonicalId({component:P.object}),this._componentWithCanonicalId({component:P.graph}));G.push(O)}return G.sort(),G.join("")}hashFirstDegreeQuads(x){const m=[],A=this.blankNodeInfo.get(x),D=A.quads;for(const G of D){const P={subject:null,predicate:G.predicate,object:null,graph:null};P.subject=this.modifyFirstDegreeComponent(x,G.subject,"subject"),P.object=this.modifyFirstDegreeComponent(x,G.object,"object"),P.graph=this.modifyFirstDegreeComponent(x,G.graph,"graph"),m.push(T.serializeQuad(P))}m.sort();const k=this.createMessageDigest();for(const G of m)k.update(G);return A.hash=k.digest(),A.hash}hashRelatedBlankNode(x,m,A,D){let k;k=this.canonicalIssuer.hasId(x)?this.canonicalIssuer.getId(x):A.hasId(x)?A.getId(x):this.blankNodeInfo.get(x).hash;const G=this.createMessageDigest();return G.update(D),"g"!==D&&G.update(this.getRelatedPredicate(m)),G.update(k),G.digest()}hashNDegreeQuads(x,m){const A=this.deepIterations.get(x)||0;if(A>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(x,A+1);const D=this.createMessageDigest(),k=this.createHashToRelated(x,m),G=[...k.keys()].sort();for(const P of G){D.update(P);let $,O="";const B=new E(k.get(P));for(;B.hasNext();){const re=B.next();let j=m.clone(),xe="";const ne=[];let R=!1;for(const S of re)if(this.canonicalIssuer.hasId(S)?xe+=this.canonicalIssuer.getId(S):(j.hasId(S)||ne.push(S),xe+=j.getId(S)),0!==O.length&&xe>O){R=!0;break}if(!R){for(const S of ne){const L=this.hashNDegreeQuads(S,j);if(xe+=j.getId(S),xe+=`<${L.hash}>`,j=L.issuer,0!==O.length&&xe>O){R=!0;break}}R||(0===O.length||xe<O)&&(O=xe,$=j)}}D.update(O),m=$}return{hash:D.digest(),issuer:m}}modifyFirstDegreeComponent(x,m){return"BlankNode"!==m.termType?m:{termType:"BlankNode",value:m.value===x?"_:a":"_:z"}}getRelatedPredicate(x){return`<${x.predicate.value}>`}createHashToRelated(x,m){const A=new Map,D=this.blankNodeInfo.get(x).quads;for(const k of D)this._addRelatedBlankNodeHash({quad:k,component:k.subject,position:"s",id:x,issuer:m,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:k,component:k.object,position:"o",id:x,issuer:m,hashToRelated:A}),this._addRelatedBlankNodeHash({quad:k,component:k.graph,position:"g",id:x,issuer:m,hashToRelated:A});return A}_hashAndTrackBlankNode({id:x,hashToBlankNodes:m}){const A=this.hashFirstDegreeQuads(x),D=m.get(A);D?D.push(x):m.set(A,[x])}_addBlankNodeQuadInfo({quad:x,component:m}){if("BlankNode"!==m.termType)return;const A=m.value,D=this.blankNodeInfo.get(A);D?D.quads.add(x):this.blankNodeInfo.set(A,{quads:new Set([x]),hash:null})}_addRelatedBlankNodeHash({quad:x,component:m,position:A,id:D,issuer:k,hashToRelated:G}){if("BlankNode"!==m.termType||m.value===D)return;const P=m.value,O=this.hashRelatedBlankNode(P,x,k,A),$=G.get(O);$?$.push(P):G.set(O,[P])}_componentWithCanonicalId({component:x}){return"BlankNode"!==x.termType||x.value.startsWith(this.canonicalIssuer.prefix)?x:{termType:"BlankNode",value:this.canonicalIssuer.getId(x.value)}}}},6268(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(1126),E=Y(624);Ze.exports=class extends E{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new M("sha1")}modifyFirstDegreeComponent(I,p,x){return"BlankNode"!==p.termType?p:"graph"===x?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:p.value===I?"_:a":"_:z"}}getRelatedPredicate(I){return I.predicate.value}createHashToRelated(I,p){var x=this;return W(function*(){const m=new Map,A=x.blankNodeInfo.get(I).quads;let D=0;for(const k of A){let G,P;if("BlankNode"===k.subject.termType&&k.subject.value!==I)P=k.subject.value,G="p";else{if("BlankNode"!==k.object.termType||k.object.value===I)continue;P=k.object.value,G="r"}++D%100==0&&(yield x._yield());const O=yield x.hashRelatedBlankNode(P,k,p,G),$=m.get(O);$?$.push(P):m.set(O,[P])}return m})()}}},8911(Ze,Ne,Y){"use strict";const W=Y(1126),M=Y(203);Ze.exports=class extends M{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new W("sha1")}modifyFirstDegreeComponent(T,I,p){return"BlankNode"!==I.termType?I:"graph"===p?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:I.value===T?"_:a":"_:z"}}getRelatedPredicate(T){return T.predicate.value}createHashToRelated(T,I){const p=new Map,x=this.blankNodeInfo.get(T).quads;for(const m of x){let A,D;if("BlankNode"===m.subject.termType&&m.subject.value!==T)D=m.subject.value,A="p";else{if("BlankNode"!==m.object.termType||m.object.value===T)continue;D=m.object.value,A="r"}const k=this.hashRelatedBlankNode(D,m,I,A),G=p.get(k);G?G.push(D):p.set(k,[D])}return p}}},4548(Ze,Ne,Y){"use strict";var W=Y(9293).default;const M=Y(624),E=Y(6268),T=Y(203),I=Y(8911);let p;try{p=Y(7789)}catch{}function x(m){return Array.isArray(m)?m:Ne.NQuads.legacyDatasetToQuads(m)}Ne.NQuads=Y(8276),Ne.IdentifierIssuer=Y(250),Ne._rdfCanonizeNative=function(m){return m&&(p=m),p},Ne.canonize=function(){var m=W(function*(A,D){const k=x(A);if(D.useNative){if(!p)throw new Error("rdf-canonize-native not available");if(D.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((G,P)=>p.canonize(k,D,(O,$)=>O?P(O):G($)))}if("URDNA2015"===D.algorithm)return new M(D).main(k);if("URGNA2012"===D.algorithm){if(D.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new E(D).main(k)}throw"algorithm"in D?new Error("Invalid RDF Dataset Canonicalization algorithm: "+D.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(A,D){return m.apply(this,arguments)}}(),Ne._canonizeSync=function(m,A){const D=x(m);if(A.useNative){if(!p)throw new Error("rdf-canonize-native not available");if(A.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return p.canonizeSync(D,A)}if("URDNA2015"===A.algorithm)return new T(A).main(D);if("URGNA2012"===A.algorithm){if(A.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new I(A).main(D)}throw"algorithm"in A?new Error("Invalid RDF Dataset Canonicalization algorithm: "+A.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},7140(){!function(Ze){"use strict";if(!Ze.setImmediate){var T,Y=1,W={},M=!1,E=Ze.document,$=Object.getPrototypeOf&&Object.getPrototypeOf(Ze);$=$&&$.setTimeout?$:Ze,"[object process]"==={}.toString.call(Ze.process)?function A(){T=function(B){process.nextTick(function(){m(B)})}}():function D(){if(Ze.postMessage&&!Ze.importScripts){var B=!0,re=Ze.onmessage;return Ze.onmessage=function(){B=!1},Ze.postMessage("","*"),Ze.onmessage=re,B}}()?function k(){var B="setImmediate$"+Math.random()+"$",re=function(j){j.source===Ze&&"string"==typeof j.data&&0===j.data.indexOf(B)&&m(+j.data.slice(B.length))};Ze.addEventListener?Ze.addEventListener("message",re,!1):Ze.attachEvent("onmessage",re),T=function(j){Ze.postMessage(B+j,"*")}}():Ze.MessageChannel?function G(){var B=new MessageChannel;B.port1.onmessage=function(re){m(re.data)},T=function(re){B.port2.postMessage(re)}}():E&&"onreadystatechange"in E.createElement("script")?function P(){var B=E.documentElement;T=function(re){var j=E.createElement("script");j.onreadystatechange=function(){m(re),j.onreadystatechange=null,B.removeChild(j),j=null},B.appendChild(j)}}():function O(){T=function(B){setTimeout(m,0,B)}}(),$.setImmediate=function I(B){"function"!=typeof B&&(B=new Function(""+B));for(var re=new Array(arguments.length-1),j=0;j<re.length;j++)re[j]=arguments[j+1];return W[Y]={callback:B,args:re},T(Y),Y++},$.clearImmediate=p}function p(B){delete W[B]}function m(B){if(M)setTimeout(m,0,B);else{var re=W[B];if(re){M=!0;try{!function x(B){var re=B.callback,j=B.args;switch(j.length){case 0:re();break;case 1:re(j[0]);break;case 2:re(j[0],j[1]);break;case 3:re(j[0],j[1],j[2]);break;default:re.apply(void 0,j)}}(re)}finally{p(B),M=!1}}}}}(typeof self>"u"?typeof global>"u"?this:global:self)},7789(){},9293(Ze){function Ne(W,M,E,T,I,p,x){try{var m=W[p](x),A=m.value}catch(D){return void E(D)}m.done?M(A):Promise.resolve(A).then(T,I)}Ze.exports=function Y(W){return function(){var M=this,E=arguments;return new Promise(function(T,I){var p=W.apply(M,E);function x(A){Ne(p,T,I,x,m,"next",A)}function m(A){Ne(p,T,I,x,m,"throw",A)}x(void 0)})}},Ze.exports.__esModule=!0,Ze.exports.default=Ze.exports}}]);
|