@squeed/flow-sdk 0.1.14 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +60 -60
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +177 -2
- package/dist/index.js +31947 -30348
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,36 +1,62 @@
|
|
|
1
|
-
"use strict";var JO=Object.create;var F1=Object.defineProperty;var eq=Object.getOwnPropertyDescriptor;var rq=Object.getOwnPropertyNames;var tq=Object.getPrototypeOf,nq=Object.prototype.hasOwnProperty;var aq=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of rq(e))!nq.call(r,a)&&a!==t&&F1(r,a,{get:()=>e[a],enumerable:!(n=eq(e,a))||n.enumerable});return r};var Rr=(r,e,t)=>(t=r!=null?JO(tq(r)):{},aq(e||!r||!r.__esModule?F1(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react/jsx-runtime"),De=require("@chakra-ui/react"),Te=require("react"),Hr=require("react-icons/pi"),iq=require("react-icons/hi2"),oq=require("react-icons/gr"),fc=require("react-icons/vsc"),sq=require("react-icons/tb"),z1=require("react-icons/io5"),j2=Te.createContext(null);function Mn(){const r=Te.useContext(j2);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function uq({config:r,callbacks:e,children:t}){const n=Te.useRef(null),[a,i]=Te.useState([]),[o,s]=Te.useState(null),[l,u]=Te.useState(!0),[c,d]=Te.useState(!1),[h,g]=Te.useState(!0),[p,E]=Te.useState(r.edgeHandles===!0),[m,b]=Te.useState(!1),[w,x]=Te.useState(!0),[C,T]=Te.useState(!1),S=Te.useRef(e);S.current=e;const _=Te.useMemo(()=>{const Y=K=>(...ee)=>{var le,G;return(G=(le=S.current)==null?void 0:le[K])==null?void 0:G.call(le,...ee)};return{onNodeSelect:Y("onNodeSelect"),onNodeDeselect:Y("onNodeDeselect"),onNodeDoubleClick:Y("onNodeDoubleClick"),onNodeCreate:Y("onNodeCreate"),onNodeDelete:Y("onNodeDelete"),onNodeLabelChange:Y("onNodeLabelChange"),onNodeCollapse:Y("onNodeCollapse"),onNodeColorChange:Y("onNodeColorChange"),onNodeIconChange:Y("onNodeIconChange"),onNodeHoverAction:Y("onNodeHoverAction"),onEdgeCreate:Y("onEdgeCreate"),onEdgeSelect:Y("onEdgeSelect"),onEdgeDeselect:Y("onEdgeDeselect"),onEdgeRemove:Y("onEdgeRemove"),onEdgeColorChange:Y("onEdgeColorChange"),onEdgeLabelChange:Y("onEdgeLabelChange"),onEdgeStyleChange:Y("onEdgeStyleChange"),onViewportChange:Y("onViewportChange"),onDirectionChange:Y("onDirectionChange"),onArrayModeChange:Y("onArrayModeChange"),onCyInit:Y("onCyInit")}},[]),A=r.themeColor||"blue.500",P=r.edgeColor||"",D=r.colorMode||"light",I=r.direction||"LR",M=r.readOnly??!1,k=r.isZoomMode!==void 0?r.isZoomMode:l,N=r.isMultiSelectMode!==void 0?r.isMultiSelectMode:c,z=r.isEdgeHandlesEnabled!==void 0?r.isEdgeHandlesEnabled:p,W=r.isDragMode!==void 0?r.isDragMode:h,q=Te.useRef(r);q.current=r;const $=Te.useMemo(()=>({get direction(){return q.current.direction},get themeColor(){return q.current.themeColor},get colorMode(){return q.current.colorMode},get readOnly(){return q.current.readOnly},get editable(){return q.current.editable},get minZoom(){return q.current.minZoom},get maxZoom(){return q.current.maxZoom},get backgroundPattern(){return q.current.backgroundPattern},get edgeColor(){return q.current.edgeColor},get backgroundColor(){return q.current.backgroundColor},get edgeHandles(){return q.current.edgeHandles},get initialViewport(){return q.current.initialViewport},get nodeOverlayActions(){return q.current.nodeOverlayActions},get renderNodeOverlay(){return q.current.renderNodeOverlay},get renderSelectedNodeToolbar(){return q.current.renderSelectedNodeToolbar},get renderSelectedEdgeToolbar(){return q.current.renderSelectedEdgeToolbar},get renderBottomBar(){return q.current.renderBottomBar},get customViews(){return q.current.customViews},get disableKeyboardShortcuts(){return q.current.disableKeyboardShortcuts},get isZoomMode(){return q.current.isZoomMode},get isMultiSelectMode(){return q.current.isMultiSelectMode},get isEdgeHandlesEnabled(){return q.current.isEdgeHandlesEnabled},get isDragMode(){return q.current.isDragMode}}),[]),X=Te.useMemo(()=>({themeColor:A,edgeColor:P,colorMode:D,direction:I,selectedNodeIds:a,setSelectedNodeIds:i,selectedEdgeId:o,setSelectedEdgeId:s,isZoomMode:k,setIsZoomMode:u,isMultiSelectMode:N,setIsMultiSelectMode:d,isDragMode:W,setIsDragMode:g,isEdgeHandlesEnabled:z,setIsEdgeHandlesEnabled:E,isArrayNodeMode:m,setIsArrayNodeMode:b,isPinned:w,setIsPinned:x,isPerformanceMode:C,setIsPerformanceMode:T,cyRef:n,callbacks:_,config:$,readOnly:M}),[A,P,D,I,a,o,k,N,W,z,m,w,C,M,_,$]);return ue.jsx(j2.Provider,{value:X,children:t})}const lq=({children:r,pattern:e="dot",backgroundColor:t})=>{const{colorMode:n}=Mn(),a=n==="dark",i=a?"--chakra-colors-gray-700":"--chakra-colors-gray-500",o=a?"--chakra-colors-gray-700":"--chakra-colors-gray-800";return e==="none"?ue.jsx(De.Box,{width:"100%",height:"100%",padding:0,bg:t,children:r}):ue.jsxs(De.Box,{position:"relative",width:"100%",height:"100%",padding:0,bg:t,children:[ue.jsx(De.Box,{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",zIndex:0,pointerEvents:"none",style:{backgroundImage:e==="dot"?`radial-gradient(var(${i}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${o}) 0, var(${o}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${o}) 1px, transparent 1px), linear-gradient(90deg, var(${o}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),ue.jsx(De.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})};function Uu(r,e=.2){const t=r.replace(/^#/,""),n=parseInt(t,16);let a=n>>16&255,i=n>>8&255,o=n&255;return a=Math.max(0,Math.floor(a*(1-e))),i=Math.max(0,Math.floor(i*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),"#"+((1<<24)+(a<<16)+(i<<8)+o).toString(16).slice(1).toUpperCase()}const In=r=>r!=null&&r.startsWith("#")?{background:r,highlight:Uu(r,.1),border:Uu(r,.5),property:"gray.900",boolean:"green.200",string:"gray.900",number:"orange.800"}:r==="gray"?{background:"gray.950",highlight:"gray.800",border:"gray.700",property:"gray.200",boolean:"green.400",string:"gray.200",number:"orange.600"}:r==="white"?{background:"white",highlight:"gray.200",border:"gray.400",property:"gray.900",boolean:"green.400",string:"gray.900",number:"orange.600"}:{background:r+".100",highlight:r+".200",border:r+".700",property:"gray.900",boolean:"green.800",string:"gray.900",number:"orange.800"},Y2=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:Uu(r)};let t=String(Number(r.slice(-3))+200);t=r.slice(0,-3).concat(t);let n=String(Number(r.slice(-3))-100);return n=r.slice(0,-3).concat(n),{primary:e,secondary:t,light:n}},$1={red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#EBF8FF",100:"#BEE3F8",200:"#90CDF4",300:"#63B3ED",400:"#4299E1",500:"#3182CE",600:"#2B6CB0",700:"#2C5282",800:"#2A4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923",950:"#0d1117"}},ht=(r,e)=>{var i;if(r!=null&&r.startsWith("#"))return r;if(!r)return"whitesmoke";const t=r.replace(/\./g,"-");try{const s=getComputedStyle(document.documentElement).getPropertyValue(`--chakra-colors-${t}`).trim();if(s&&s!=="")return s}catch{}const[n,a]=r.split(".");return n&&a&&((i=$1[n])!=null&&i[Number(a)])?$1[n][Number(a)]:`var(--chakra-colors-${t})`};function Et(r,e,t){return r?t:e}function cs(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=Y2(r),n=In(e).background,a=In(e).highlight,i=In(e).border,o=In(e).property,s=In(e).property;let l=In(e).background,u=In(e).highlight;return l=ht(l)+50,u=ht(u)+20,{bgColor:n,highlightColor:a,borderColor:i,textColor:o,propertyColor:s,secondary:t,bgColorFaint:l,highlightColorFaint:u}}function ds(r=null){const{colorMode:e}=Mn(),t=r==null?void 0:r.includes("gray"),n=e==="dark",a=Et(n,"gray.100","gray.900"),i=Et(n,"gray.200","blackAlpha.400"),o=Et(n,"gray.200","blackAlpha.600"),s=Et(n,"gray.500","gray.800"),l=Et(n,"gray.700","gray.700"),u=Et(n,"gray.900","gray.900"),c=Et(n,"gray.400","gray.500"),d=Et(n,"gray.400","gray.700"),h=Et(n,"gray.900","gray.200"),g=Et(n,t?"gray.900":"gray.200",t?"gray.200":"gray.900"),p=Et(n,"gray.900","gray.200"),E=Et(n,r&&"#000000",r||"#ffffff"),m=Et(n,r||"#ffffff",r?"#000000":"#ffffff"),b=l,w=Et(n,"gray.300","gray.800"),x=Et(n,"white","blackAlpha.400"),C=Et(n,"green.100","green.700");return{background:a,backgroundSecondary:i,darkBackgroundSecondary:o,border:s,darkColor:u,backgroundWhiteColor:x,borderSecondary:l,colorActive:c,colorInactive:d,iconColor:p,moreIconColor:b,colorText:h,themedColorText:g,logoColor:E,logoColorSecondary:m,darkColorActive:w,greenColor:C}}const V1=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:l}=ds();return ue.jsxs(De.Tooltip.Root,{positioning:{placement:i.placement||"top"},children:[ue.jsx(De.Tooltip.Trigger,{asChild:!0,children:ue.jsx(De.Flex,{children:ue.jsx(De.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})}),ue.jsx(De.Tooltip.Positioner,{children:ue.jsx(De.Tooltip.Content,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||l,borderRadius:15,fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:e})})]})},fq=({data:r,children:e,isInverted:t,isParent:n})=>{var z,W;const{selectedNodeIds:a,setSelectedNodeIds:i,isMultiSelectMode:o,isPerformanceMode:s,cyRef:l,callbacks:u,config:c,themeColor:d,direction:h}=Mn(),{background:g,border:p,colorText:E}=ds(),m=Te.useRef(null),b=Te.useRef(null),[w,x]=Te.useState(!1),[C,T]=Te.useState(!1),S=r==null?void 0:r.id,_=a.includes(S),A=c.nodeOverlayActions,P=c.renderNodeOverlay,D=(()=>{var q;try{const $=(q=l.current)==null?void 0:q.zoom();return $!==void 0&&$<.08}catch{return!1}})(),I=Te.useCallback(()=>{var q,$,X;if(!C)if(o){const Y=a.includes(S),K=Y?a.filter(ee=>ee!==S):[...a,S];i(K),Y?(q=u.onNodeDeselect)==null||q.call(u):($=u.onNodeSelect)==null||$.call(u,S,r)}else i([S]),(X=u.onNodeSelect)==null||X.call(u,S,r)},[S,r,a,o,C,i,u]),M=Te.useCallback(()=>{var q;C||(q=u.onNodeDoubleClick)==null||q.call(u,S,r)},[S,r,C,u]),k=Te.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(!0),100)},[]),N=Te.useCallback(()=>{b.current&&clearTimeout(b.current),x(!1)},[]);return n?ue.jsxs(De.Box,{ref:m,onClick:I,onDoubleClick:M,onMouseEnter:k,onMouseLeave:N,cursor:"pointer",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!0,isHovered:w,setIsHovered:x})}):ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(De.HStack,{px:2,gap:2,children:A.map((q,$)=>ue.jsxs(De.Box,{display:"contents",children:[$>0&&ue.jsx(De.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(V1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:X=>{var Y;X.stopPropagation(),(Y=u.onNodeHoverAction)==null||Y.call(u,q.id,S,r)}})]},q.id))})})]}),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)}),((z=r==null?void 0:r.config)==null?void 0:z.collapsed)!==void 0&&(()=>{var X;const q=h==="TB"||h==="BT",$=t||h==="RL";return ue.jsx(De.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:$?void 0:"-75px",left:$?"-75px":void 0,top:"50%",transform:"translateY(-50%)"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:Y=>{var K;Y.stopPropagation(),(K=u.onNodeCollapse)==null||K.call(u,S,!r.config.collapsed)},bgColor:ht(((X=r==null?void 0:r.viewProps)==null?void 0:X.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?ue.jsx(Hr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Hr.PiMinusBold,{size:30,color:"gray.800"})})})()]}):ue.jsxs(De.Box,{ref:m,onClick:I,onDoubleClick:M,onMouseEnter:k,onMouseLeave:N,cursor:"pointer",transition:"transform 0.1s ease",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:P({nodeId:S,nodeData:r,isRoot:S==="root",isParent:!!n,isHovered:w,setIsHovered:x})}):ue.jsx(De.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:g,p:3,borderColor:p,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>x(!0),onMouseLeave:N,willChange:"transform",children:ue.jsx(De.HStack,{px:2,gap:2,children:A.map((q,$)=>ue.jsxs(De.Box,{display:"contents",children:[$>0&&ue.jsx(De.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(V1,{icon:q.icon,label:q.label,color:E,bgColor:g,borderColor:p,textColor:E,boxSize:5,onClick:X=>{var Y;X.stopPropagation(),(Y=u.onNodeHoverAction)==null||Y.call(u,q.id,S,r)}})]},q.id))})})]}),ue.jsxs(De.Box,{position:"relative",display:"flex",h:"100%",w:"100%",children:[((W=r==null?void 0:r.config)==null?void 0:W.collapsed)!==void 0&&!n&&(()=>{var X;const q=h==="TB"||h==="BT",$=t||h==="RL";return ue.jsx(De.IconButton,{position:"absolute",...q?{[h==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:$?void 0:"-75px",left:$?"-75px":void 0,alignSelf:"center"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:Y=>{var K;Y.stopPropagation(),(K=u.onNodeCollapse)==null||K.call(u,S,!r.config.collapsed)},bgColor:ht(((X=r==null?void 0:r.viewProps)==null?void 0:X.bgColor)||d),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?ue.jsx(Hr.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Hr.PiMinusBold,{size:30,color:"gray.800"})})})(),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)})]})]})},ul=Te.memo(fq);function Z2(r=!0){const e=Te.useRef(null);return Te.useEffect(()=>{if(!r||!e.current)return;const t=i=>{i.stopPropagation(),i.stopImmediatePropagation()},n=e.current,a=["mousedown","mouseup","click","pointerdown","pointerup","keydown","keyup","keypress","input","focus"];return a.forEach(i=>n.addEventListener(i,t,!0)),()=>{a.forEach(i=>n.removeEventListener(i,t,!0))}},[r]),e}const X2=({nodeId:r,label:e,color:t,fontWeight:n="bold",fontSize:a="5xl",isEditing:i,onEditStart:o,onEditEnd:s})=>{const{callbacks:l,config:u,readOnly:c}=Mn(),d=u.editable&&!c,[h,g]=Te.useState(e),p=Te.useRef(null),E=Te.useRef(!1),m=Z2(i);Te.useEffect(()=>{i&&(E.current=!1,p.current&&(p.current.focus(),p.current.select()))},[i]);const b=()=>{var x;if(E.current)return;E.current=!0;const w=h.trim();w&&w!==e&&((x=l.onNodeLabelChange)==null||x.call(l,r,w)),s()};return!d||!i?ue.jsx(De.Text,{color:t,fontWeight:n,fontSize:a,onDoubleClick:d?w=>{w.stopPropagation(),g(e),o()}:void 0,cursor:d?"text":void 0,children:e}):ue.jsx("div",{ref:m,children:ue.jsx(De.Input,{ref:p,value:h,onChange:w=>g(w.target.value),onBlur:b,onKeyDown:w=>{w.key==="Enter"&&b(),w.key==="Escape"&&s()},color:t,fontWeight:n,fontSize:a,bg:"transparent",borderWidth:0,p:0,h:"auto",lineHeight:"normal"})})},cq=({id:r,data:e,isActive:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var d,h,g;const{themeColor:o}=Mn(),{bgColor:s,borderColor:l,textColor:u}=cs(((d=e==null?void 0:e.viewProps)==null?void 0:d.bgColor)||o),c=ht(((h=e==null?void 0:e.viewProps)==null?void 0:h.textColor)||u);return ue.jsx(De.Box,{borderRadius:(g=e==null?void 0:e.viewProps)==null?void 0:g.borderRadius,bgColor:s,borderColor:t?"white":l,_hover:{borderColor:"white"},borderWidth:2,py:14,px:20,whiteSpace:"normal",children:ue.jsx(De.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:ue.jsx(X2,{nodeId:r,label:(e==null?void 0:e.label)||(e==null?void 0:e.text)||"",color:c,isEditing:n,onEditStart:a,onEditEnd:i})})})},dq=({id:r,isActive:e,data:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var p,E,m,b;const{themeColor:o}=Mn(),s=((p=t==null?void 0:t.viewProps)==null?void 0:p.bgColor)||o,{borderColor:l,highlightColor:u,textColor:c}=cs(s),d=ht(((E=t==null?void 0:t.viewProps)==null?void 0:E.textColor)||c),h=ht(((m=t==null?void 0:t.viewProps)==null?void 0:m.borderColor)||l),g=s!=null&&s.startsWith("#")?s:ht(u);return ue.jsx(De.Flex,{align:"center",borderRadius:(b=t==null?void 0:t.viewProps)==null?void 0:b.borderRadius,bgColor:g,style:{backgroundColor:g},textTransform:"capitalize",borderColor:e?"white":h,_hover:{borderColor:"white"},borderWidth:2,px:50,whiteSpace:"nowrap",children:ue.jsx(De.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:ue.jsx(X2,{nodeId:r,label:(t==null?void 0:t.label)||(t==null?void 0:t.text)||"",color:d,isEditing:n,onEditStart:a,onEditEnd:i})})})},Pm=({name:r,...e})=>{const[t,n]=Te.useState(null),[a,i]=Te.useState(!0),[o,s]=Te.useState(!1);return Te.useEffect(()=>{if(!r||r.length<2){n(null),i(!1);return}i(!0),s(!1),(async()=>{try{let u;if(r.startsWith("Md"))u="md";else if(r.startsWith("Fa"))u="fa6";else if(r.startsWith("Io5"))u="io5";else if(r.startsWith("Io"))u="io";else if(r.startsWith("Ti"))u="ti";else if(r.startsWith("Go"))u="go";else if(r.startsWith("Fi"))u="fi";else if(r.startsWith("Di"))u="di";else if(r.startsWith("Ai"))u="ai";else if(r.startsWith("Bs"))u="bs";else if(r.startsWith("Ri"))u="ri";else if(r.startsWith("Fc"))u="fc";else if(r.startsWith("Gi"))u="gi";else if(r.startsWith("Hi2"))u="hi2";else if(r.startsWith("Hi"))u="hi";else if(r.startsWith("Si"))u="si";else if(r.startsWith("Sl"))u="sl";else if(r.startsWith("Im"))u="im";else if(r.startsWith("Bi"))u="bi";else if(r.startsWith("Pi"))u="pi";else if(r.startsWith("Vsc"))u="vsc";else if(r.startsWith("Tb"))u="tb";else if(r.startsWith("Tfi"))u="tfi";else if(r.startsWith("Cg"))u="cg";else if(r.startsWith("Lia"))u="lia";else if(r.startsWith("Lu"))u="lu";else throw new Error(`Unknown library prefix for icon: ${r}`);let c;switch(u){case"md":c=await import("react-icons/md");break;case"fa6":c=await import("react-icons/fa6");break;case"io5":c=await import("react-icons/io5");break;case"io":c=await import("react-icons/io");break;case"ti":c=await import("react-icons/ti");break;case"go":c=await import("react-icons/go");break;case"fi":c=await import("react-icons/fi");break;case"di":c=await import("react-icons/di");break;case"ai":c=await import("react-icons/ai");break;case"bs":c=await import("react-icons/bs");break;case"ri":c=await import("react-icons/ri");break;case"fc":c=await import("react-icons/fc");break;case"gi":c=await import("react-icons/gi");break;case"hi2":c=await import("react-icons/hi2");break;case"hi":c=await import("react-icons/hi");break;case"si":c=await import("react-icons/si");break;case"sl":c=await import("react-icons/sl");break;case"im":c=await import("react-icons/im");break;case"bi":c=await import("react-icons/bi");break;case"pi":c=await import("react-icons/pi");break;case"vsc":c=await import("react-icons/vsc");break;case"tb":c=await import("react-icons/tb");break;case"tfi":c=await import("react-icons/tfi");break;case"cg":c=await import("react-icons/cg");break;case"lia":c=await import("react-icons/lia");break;case"lu":c=await import("react-icons/lu");break;default:throw new Error(`Unsupported library: ${u}`)}const d=c[r];if(!d)throw new Error(`Icon ${r} not found in library ${u}`);n(()=>d)}catch(u){console.warn(`Failed to load icon ${r}:`,u.message),s(!0),n(null)}finally{i(!1)}})()},[r]),a||!t?null:ue.jsx(t,{...e})},Q2=(r,e)=>{var l,u,c;const t=((l=r==null?void 0:r.viewProps)==null?void 0:l.bgColor)||e,[n]=t.split("."),a=cs(t),i=t!=null&&t.startsWith("#")?ht(t):ht(a.bgColor),o=ht(((u=r==null?void 0:r.viewProps)==null?void 0:u.textColor)||a.textColor),s=ht(((c=r==null?void 0:r.viewProps)==null?void 0:c.borderColor)||a.borderColor);return{...a,bg:t,wordBeforeDot:n,hexbgColor:i,hextextColor:o,hexborderColor:s}},vq=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,J2=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,hq=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},eR=r=>ue.jsx(ul,{...r,children:e=>ue.jsx(cq,{...e})}),rR=r=>ue.jsx(ul,{...r,children:e=>ue.jsx(dq,{...e})}),tR=r=>{const{themeColor:e}=Mn(),[t,n]=Te.useState(!1);return ue.jsx(ul,{...r,children:({data:a,isActive:i,isLowZoom:o})=>{var h,g,p,E,m,b,w,x;const s=Q2(a,e),l=Object.entries(a.description||{}).length>0,u=hq(a.description),c=(g=(h=r.data)==null?void 0:h.config)==null?void 0:g.icon,d=(E=(p=r.data)==null?void 0:p.config)==null?void 0:E.content;return ue.jsx(De.Flex,{justifyContent:"space-between",...a==null?void 0:a.viewProps,direction:"column",p:0,borderRadius:(m=a==null?void 0:a.viewProps)==null?void 0:m.borderRadius,overflow:"hidden",alignItems:"center",style:{backgroundColor:s.hexbgColor,transition:"border-color 0.2s ease-in-out"},width:"100%",borderColor:i?"white":s.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:ue.jsxs(De.Flex,{width:"100%",direction:"column",borderRadius:(b=a==null?void 0:a.viewProps)==null?void 0:b.borderRadius,borderColor:s.hexborderColor,borderWidth:0,overflow:"hidden",children:[a.headerTitle&&ue.jsxs(De.Flex,{justify:"flex-start",direction:"row",p:Object.entries(a.description||{}).length?8:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:d?"left":"center",textOverflow:"ellipsis",alignItems:"center",fontWeight:"bold",color:s.propertyColor,bgColor:s.highlightColor,borderBottomColor:!l&&!d?"transparent":s.hexborderColor,children:[!!c&&ue.jsx(De.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Pm,{name:c,size:80,color:s.hextextColor},s.hextextColor)}),ue.jsx(De.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(w=a==null?void 0:a.viewProps)==null?void 0:w.textColor,children:J2(a.headerTitle)}),!!d&&ue.jsx(De.Box,{ml:10,onClick:()=>n(!t),children:t?ue.jsx(Hr.PiGear,{size:30,style:{cursor:"pointer"}}):ue.jsx(Hr.PiNotepad,{size:30,style:{cursor:"pointer"}})})]}),d&&!t?ue.jsx(De.Flex,{w:"100%",overflow:"auto",justifyContent:"start",background:s.highlightColor,p:10,fontSize:"5xl",lineHeight:"normal",cursor:"text",children:ue.jsx(De.Text,{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis",color:(x=a==null?void 0:a.viewProps)==null?void 0:x.textColor,children:d})}):ue.jsx(De.Box,{children:Object.entries(a.description||{}).map(([C,T],S)=>{var P,D;const _=In(s.wordBeforeDot)[typeof T],A=In(s.wordBeforeDot).property;return ue.jsxs(De.Box,{children:[ue.jsxs(De.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[ue.jsx(De.Flex,{justifyContent:"start",align:"center",background:s.highlightColor,width:`${u}px`,minWidth:`${u}px`,borderRightColor:s.hexborderColor,borderRightWidth:1,children:ue.jsx(De.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",color:((P=a==null?void 0:a.viewProps)==null?void 0:P.textColor)||A,children:C})}),ue.jsx(De.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:s.hexbgColor,w:600,maxH:200,children:ue.jsx(De.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",color:((D=a==null?void 0:a.viewProps)==null?void 0:D.textColor)||_,fontWeight:400,children:vq(T)})})]}),S!==Object.entries(a.description||{}).length-1&&ue.jsx(De.Box,{borderTopWidth:1,my:0,borderColor:s.hexborderColor})]},S)})})]})})}})},nR=r=>{const{themeColor:e}=Mn();return ue.jsx(ul,{...r,children:({data:t,isActive:n})=>{var o,s,l,u;const a=Q2(t,e),i=(s=(o=r.data)==null?void 0:o.config)==null?void 0:s.icon;return ue.jsx(De.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:((l=t==null?void 0:t.viewProps)==null?void 0:l.borderRadius)||15,overflow:"hidden",bgColor:a.bgColor,position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",style:{backgroundColor:a.hexbgColor,transition:"border-color 0.2s ease-in-out"},borderColor:n?"white":a.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:t.headerTitle&&ue.jsxs(De.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",color:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:[!!i&&ue.jsx(De.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Pm,{name:i,size:80,color:a.hextextColor},a.hextextColor)}),ue.jsx(De.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(u=t==null?void 0:t.viewProps)==null?void 0:u.textColor,children:J2(t.headerTitle)})]})})}})};eR.displayName="text";rR.displayName="arrayView";tR.displayName="NodeJsonObjectView";nR.displayName="ParentContainerView";const gq={objectView:tR,arrayView:rR,text:eR,parentContainer:nR},pq=r=>[{selector:"node",style:{"outline-opacity":0,"background-opacity":0,"background-color":"transparent","border-color":"transparent",color:"transparent","border-opacity":0,"text-valign":"center","text-halign":"center","border-width":0,"outline-width":0,width:60,height:60}},{selector:"node:selected",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:"node:active",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:":parent",style:{shape:"round-rectangle","background-opacity":.4,"corner-radius":50,"line-color":r("light"),"background-color":r(),"border-color":r(),"border-width":6,"border-style":"solid","border-opacity":1,padding:"120px","text-valign":"top","font-size":"70px","font-weight":"bold","text-margin-y":90,"text-background-opacity":0,"text-background-padding":"45px","z-index":1e3,"compound-sizing-wrt-labels":"include",label:"data(label)"}},{selector:"edge",style:{width:6,label:"data(label)","z-index":-100,"control-point-step-size":10,"taxi-direction":"horizontal","curve-style":"round-taxi","edge-distances":"intersection","line-color":r("light"),color:r("light"),"text-rotation":"autorotate","target-arrow-color":r("light"),"source-arrow-color":r("light"),"target-arrow-shape":"triangle","arrow-scale":"3","text-background-color":r("dark"),"text-background-opacity":1,"text-background-padding":"15px","taxi-radius":500,"source-arrow-fill":"filled","target-arrow-fill":"filled","text-max-width":"200px","font-size":"45px","text-wrap":"wrap","text-margin-x":50,"transition-duration":"0.5s","source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","source-distance-from-node":80,"target-distance-from-node":80}}],cc=(r,e,t,n)=>{if(!r)return{controlPointDistances:[0],controlPointWeights:[.5]};const a=r.edges().filter(u=>{const c=u.data();return c.source===e&&c.target===t||c.source===t&&c.target===e});if(a.length<=1)return{controlPointDistances:[0],controlPointWeights:[.5]};let i=0;a.forEach((u,c)=>{u.data().id===n&&(i=c)});const o=a.length;return{controlPointDistances:[(i-(o-1)/2)*60],controlPointWeights:[.5]}},yq=r=>{const n=1/(Math.cbrt(r)*.8);let a=Math.round(650*n),i=Math.round(350*n);return a=Math.max(40,Math.min(450,a)),i=Math.max(30,Math.min(300,i)),{edgeSep:a,rankSep:i}};function mq({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:l,isPerformanceMode:u}){const c=Te.useRef(null),d=Te.useRef(null),[h,g]=Te.useState(2);let p,E;function m(S){if(l){const _=l(S,t,a);p=_.hasOwnProperty("line-style"),E=_.hasOwnProperty("source-arrow-shape"),S.style(_)}}const b=Te.useCallback(()=>{if(!p||u)return;const S=r.getElementById(e);if(S.length===0)return;const D=Date.now()*.1%(20*50),I=E?D:-D;S.style("line-dash-offset",I),d.current=requestAnimationFrame(b)},[p,r,e,E,u]);function w(S){const _=cc(r,t,a,e),A=r.add({data:{...S,controlPointDistances:_.controlPointDistances,controlPointWeights:_.controlPointWeights}});m(A),p&&(d.current=requestAnimationFrame(b))}function x(S,_){let A=2;return r.getElementById(S).length===1&&(A-=1),r.getElementById(_).length===1&&(A-=1),A}if(Te.useEffect(()=>{if(x(t,a)===0){const _=r.getElementById(e);if(_.length===0){const A=cc(r,t,a,e),P=r.add({data:{id:e,source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}});m(P),p&&(d.current=requestAnimationFrame(b))}else{const A=cc(r,t,a,e);_.data({source:t,target:a,label:i,type:n,controlPointDistances:A.controlPointDistances,controlPointWeights:A.controlPointWeights}),m(_)}}},[t,a,e,i,n,r,p,b]),Te.useEffect(()=>{function S(A){const P=A.target.id();if(P===t||P===a){const D=x(t,a);D!==h&&g(D),D===0&&w({id:e,source:t,target:a,label:i,type:n})}}function _(A){const P=A.target.id();if(P===t||P===a){const D=x(t,a);D!==h&&g(D),D>0&&(r.getElementById(e).remove(),d.current&&cancelAnimationFrame(d.current))}}return r.on("add","node",S),r.on("remove","node",_),p&&h===0&&(d.current=requestAnimationFrame(b)),()=>{r.getElementById(e).remove(),r.off("add","node",S),r.off("remove","node",_),d.current&&cancelAnimationFrame(d.current)}},[]),Te.useEffect(()=>(p&&h===0?d.current||(d.current=requestAnimationFrame(b)):!p&&d.current&&(cancelAnimationFrame(d.current),d.current=null),()=>{d.current&&cancelAnimationFrame(d.current)}),[p,h,b]),Te.useEffect(()=>{s()},[e,o]),Te.useEffect(()=>{if(!h){const S=r.getElementById(e);m(S)}},[l,h]),h>0)return null;function C(S){return Te.cloneElement(S,{cytoInstance:r,layout:s})}const T=Te.Children.map(o,C);return ue.jsx("div",{ref:c,className:"cytoscape-react-edge",children:T})}function lm(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function bq(r){if(Array.isArray(r))return r}function wq(r){if(Array.isArray(r))return lm(r)}function La(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function xq(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,iR(n.key),n)}}function Oa(r,e,t){return e&&xq(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function $t(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Dm(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.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yr(r,e){return bq(r)||Cq(r,e)||Dm(r,e)||_q()}function Hu(r){return wq(r)||Eq(r)||Dm(r)||Sq()}function Tq(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function iR(r){var e=Tq(r,"string");return typeof e=="symbol"?e:e+""}function tt(r){"@babel/helpers - typeof";return tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tt(r)}function Dm(r,e){if(r){if(typeof r=="string")return lm(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?lm(r,e):void 0}}var et=typeof window>"u"?null:window,G1=et?et.navigator:null;et&&et.document;var Rq=tt(""),oR=tt({}),Aq=tt(function(){}),Pq=typeof HTMLElement>"u"?"undefined":tt(HTMLElement),vs=function(e){return e&&e.instanceString&&Fr(e.instanceString)?e.instanceString():null},Ke=function(e){return e!=null&&tt(e)==Rq},Fr=function(e){return e!=null&&tt(e)===Aq},Sr=function(e){return!Zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},pr=function(e){return e!=null&&tt(e)===oR&&!Sr(e)&&e.constructor===Object},Dq=function(e){return e!=null&&tt(e)===oR},ke=function(e){return e!=null&&tt(e)===tt(1)&&!isNaN(e)},Iq=function(e){return ke(e)&&Math.floor(e)===e},Ku=function(e){if(Pq!=="undefined")return e!=null&&e instanceof HTMLElement},Zt=function(e){return hs(e)||sR(e)},hs=function(e){return vs(e)==="collection"&&e._private.single},sR=function(e){return vs(e)==="collection"&&!e._private.single},Im=function(e){return vs(e)==="core"},uR=function(e){return vs(e)==="stylesheet"},Bq=function(e){return vs(e)==="event"},Ta=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},kq=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Mq=function(e){return pr(e)&&ke(e.x1)&&ke(e.x2)&&ke(e.y1)&&ke(e.y2)},Lq=function(e){return Dq(e)&&Fr(e.then)},Oq=function(){return G1&&G1.userAgent.match(/msie|trident|edge/i)},to=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function(){var i=this,o=arguments,s,l=t.apply(i,o),u=n.cache;return(s=u[l])||(s=u[l]=e.apply(i,o)),s};return n.cache={},n},Bm=to(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ll=to(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),lR=to(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),W1=function(e){return Ta(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},wa=function(e,t){return e.slice(-1*t.length)===t},rt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",qq="rgb[a]?\\(("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)(?:\\s*,\\s*("+rt+"))?\\)",Nq="rgb[a]?\\((?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)(?:\\s*,\\s*(?:"+rt+"))?\\)",Fq="hsl[a]?\\(("+rt+")\\s*,\\s*("+rt+"[%])\\s*,\\s*("+rt+"[%])(?:\\s*,\\s*("+rt+"))?\\)",zq="hsl[a]?\\((?:"+rt+")\\s*,\\s*(?:"+rt+"[%])\\s*,\\s*(?:"+rt+"[%])(?:\\s*,\\s*(?:"+rt+"))?\\)",$q="\\#[0-9a-fA-F]{3}",Vq="\\#[0-9a-fA-F]{6}",fR=function(e,t){return e<t?-1:e>t?1:0},Gq=function(e,t){return-1*fR(e,t)},Ye=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];r[o]=n[o]}}return r},Wq=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,n,a,i,o=16;return t?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},Uq=function(e){var t,n,a,i,o,s,l,u;function c(p,E,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?p+(E-p)*6*m:m<1/2?E:m<2/3?p+(E-p)*(2/3-m)*6:p}var d=new RegExp("^"+Fq+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,o=d[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=l=u=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,g=2*i-h;s=Math.round(255*c(g,h,n+1/3)),l=Math.round(255*c(g,h,n)),u=Math.round(255*c(g,h,n-1/3))}t=[s,l,u,o]}return t},Hq=function(e){var t,n=new RegExp("^"+qq+"$").exec(e);if(n){t=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=a[1]||a[2]||a[3],l=a[1]&&a[2]&&a[3];if(s&&!l)return;var u=n[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;t.push(u)}}return t},Kq=function(e){return jq[e.toLowerCase()]},cR=function(e){return(Sr(e)?e:null)||Kq(e)||Wq(e)||Hq(e)||Uq(e)},jq={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]},dR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to set map with object key");i<n.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},vR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(pr(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t},mu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dc,U1;function ps(){if(U1)return dc;U1=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return dc=r,dc}var vc,H1;function Yq(){if(H1)return vc;H1=1;var r=typeof mu=="object"&&mu&&mu.Object===Object&μreturn vc=r,vc}var hc,K1;function fl(){if(K1)return hc;K1=1;var r=Yq(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return hc=t,hc}var gc,j1;function Zq(){if(j1)return gc;j1=1;var r=fl(),e=function(){return r.Date.now()};return gc=e,gc}var pc,Y1;function Xq(){if(Y1)return pc;Y1=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return pc=e,pc}var yc,Z1;function Qq(){if(Z1)return yc;Z1=1;var r=Xq(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return yc=t,yc}var mc,X1;function km(){if(X1)return mc;X1=1;var r=fl(),e=r.Symbol;return mc=e,mc}var bc,Q1;function Jq(){if(Q1)return bc;Q1=1;var r=km(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[a]=l:delete o[a]),c}return bc=i,bc}var wc,J1;function eN(){if(J1)return wc;J1=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return wc=t,wc}var xc,ew;function hR(){if(ew)return xc;ew=1;var r=km(),e=Jq(),t=eN(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return xc=o,xc}var Ec,rw;function rN(){if(rw)return Ec;rw=1;function r(e){return e!=null&&typeof e=="object"}return Ec=r,Ec}var Cc,tw;function ys(){if(tw)return Cc;tw=1;var r=hR(),e=rN(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return Cc=n,Cc}var _c,nw;function tN(){if(nw)return _c;nw=1;var r=Qq(),e=ps(),t=ys(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=r(u);var d=i.test(u);return d||o.test(u)?s(u.slice(2),d?2:8):a.test(u)?n:+u}return _c=l,_c}var Sc,aw;function nN(){if(aw)return Sc;aw=1;var r=ps(),e=Zq(),t=tN(),n="Expected a function",a=Math.max,i=Math.min;function o(s,l,u){var c,d,h,g,p,E,m=0,b=!1,w=!1,x=!0;if(typeof s!="function")throw new TypeError(n);l=t(l)||0,r(u)&&(b=!!u.leading,w="maxWait"in u,h=w?a(t(u.maxWait)||0,l):h,x="trailing"in u?!!u.trailing:x);function C(k){var N=c,z=d;return c=d=void 0,m=k,g=s.apply(z,N),g}function T(k){return m=k,p=setTimeout(A,l),b?C(k):g}function S(k){var N=k-E,z=k-m,W=l-N;return w?i(W,h-z):W}function _(k){var N=k-E,z=k-m;return E===void 0||N>=l||N<0||w&&z>=h}function A(){var k=e();if(_(k))return P(k);p=setTimeout(A,S(k))}function P(k){return p=void 0,x&&c?C(k):(c=d=void 0,g)}function D(){p!==void 0&&clearTimeout(p),m=0,c=E=d=p=void 0}function I(){return p===void 0?g:P(e())}function M(){var k=e(),N=_(k);if(c=arguments,d=this,E=k,N){if(p===void 0)return T(E);if(w)return clearTimeout(p),p=setTimeout(A,l),C(E)}return p===void 0&&(p=setTimeout(A,l)),g}return M.cancel=D,M.flush=I,M}return Sc=o,Sc}var aN=nN(),ms=gs(aN),Tc=et?et.performance:null,gR=Tc&&Tc.now?function(){return Tc.now()}:function(){return Date.now()},iN=(function(){if(et){if(et.requestAnimationFrame)return function(r){et.requestAnimationFrame(r)};if(et.mozRequestAnimationFrame)return function(r){et.mozRequestAnimationFrame(r)};if(et.webkitRequestAnimationFrame)return function(r){et.webkitRequestAnimationFrame(r)};if(et.msRequestAnimationFrame)return function(r){et.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(gR())},1e3/60)}})(),ju=function(e){return iN(e)},Qn=gR,ti=9261,pR=65599,Ui=5381,yR=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ti,n=t,a;a=e.next(),!a.done;)n=n*pR+a.value|0;return n},es=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ti;return t*pR+e|0},rs=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ui;return(t<<5)+t+e|0},oN=function(e,t){return e*2097152+t},pa=function(e){return e[0]*2097152+e[1]},bu=function(e,t){return[es(e[0],t[0]),rs(e[1],t[1])]},iw=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return yR(o,t)},oi=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return yR(o,t)},mR=function(){return sN(arguments)},sN=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];n===0?t=oi(a):t=oi(a,t)}return t};function uN(r,e,t,n,a){var i=a*Math.PI/180,o=Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,s=Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n;return{x:o,y:s}}var lN=function(e,t,n,a,i,o){return{x:(e-n)*i+n,y:(t-a)*o+a}};function fN(r,e,t){if(t===0)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=uN(r.x,r.y,n,a,t),l=lN(s.x,s.y,n,a,i,o);return{x:l.x,y:l.y}}var ow=!0,cN=console.warn!=null,dN=console.trace!=null,Mm=Number.MAX_SAFE_INTEGER||9007199254740991,bR=function(){return!0},Yu=function(){return!1},sw=function(){return 0},Lm=function(){},Lr=function(e){throw new Error(e)},wR=function(e){if(e!==void 0)ow=!!e;else return ow},Er=function(e){wR()&&(cN?console.warn(e):(console.log(e),dN&&console.trace()))},vN=function(e){return Ye({},e)},Bn=function(e){return e==null?e:Sr(e)?e.slice():pr(e)?vN(e):e},hN=function(e){return e.slice()},xR=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},gN={},ER=function(){return gN},yt=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var o=t[i],s=n==null?void 0:n[o];a[o]=s===void 0?e[o]:s}return a}},Ra=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},Om=function(e){e.splice(0,e.length)},pN=function(e,t){for(var n=0;n<t.length;n++){var a=t[n];e.push(a)}},Ft=function(e,t,n){return n&&(t=lR(n,t)),e[t]},Zn=function(e,t,n,a){n&&(t=lR(n,t)),e[t]=a},yN=(function(){function r(){La(this,r),this._obj={}}return Oa(r,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),Xn=typeof Map<"u"?Map:yN,mN="undefined",bN=(function(){function r(e){if(La(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var n=0;n<t.length;n++)this.add(t[n])}}return Oa(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])})(),io=(typeof Set>"u"?"undefined":tt(Set))!==mN?Set:bN,cl=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Im(e)){Lr("An element must have a core reference and parameters set");return}var a=t.group;if(a==null&&(t.data&&t.data.source!=null&&t.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){Lr("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data: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:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?a==="edges":!!t.pannable,active:!1,classes:new io,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(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),l=e.zoom();i.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];Sr(t.classes)?u=t.classes:Ke(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var h=u[c];!h||h===""||i.classes.add(h)}this.createEmitter(),(n===void 0||n)&&this.restore();var g=t.style||t.css;g&&(Er("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},uw=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;pr(n)&&!Zt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!Fr(a)?a:i,a=Fr(a)?a:function(){};for(var s=this._private.cy,l=n=Ke(n)?this.filter(n):n,u=[],c=[],d={},h={},g={},p=0,E,m=this.byGroup(),b=m.nodes,w=m.edges,x=0;x<l.length;x++){var C=l[x],T=C.id();C.isNode()&&(u.unshift(C),e.bfs&&(g[T]=!0,c.push(C)),h[T]=0)}for(var S=function(){var k=e.bfs?u.shift():u.pop(),N=k.id();if(e.dfs){if(g[N])return 0;g[N]=!0,c.push(k)}var z=h[N],W=d[N],q=W!=null?W.source():null,$=W!=null?W.target():null,X=W==null?void 0:k.same(q)?$[0]:q[0],Y;if(Y=a(k,W,X,p++,z),Y===!0)return E=k,1;if(Y===!1)return 1;for(var K=k.connectedEdges().filter(function(j){return(!i||j.source().same(k))&&w.has(j)}),ee=0;ee<K.length;ee++){var le=K[ee],G=le.connectedNodes().filter(function(j){return!j.same(k)&&b.has(j)}),V=G.id();G.length!==0&&!g[V]&&(G=G[0],u.push(G),e.bfs&&(g[V]=!0,c.push(G)),d[V]=le,h[V]=h[N]+1)}},_;u.length!==0&&(_=S(),!(_!==0&&_===1)););for(var A=s.collection(),P=0;P<c.length;P++){var D=c[P],I=d[D.id()];I!=null&&A.push(I),A.push(D)}return{path:s.collection(A),found:s.collection(E)}}},ts={breadthFirstSearch:uw({bfs:!0}),depthFirstSearch:uw({dfs:!0})};ts.bfs=ts.breadthFirstSearch;ts.dfs=ts.depthFirstSearch;var Bu={exports:{}},wN=Bu.exports,lw;function xN(){return lw||(lw=1,(function(r,e){(function(){var t,n,a,i,o,s,l,u,c,d,h,g,p,E,m;a=Math.floor,d=Math.min,n=function(b,w){return b<w?-1:b>w?1:0},c=function(b,w,x,C,T){var S;if(x==null&&(x=0),T==null&&(T=n),x<0)throw new Error("lo must be non-negative");for(C==null&&(C=b.length);x<C;)S=a((x+C)/2),T(w,b[S])<0?C=S:x=S+1;return[].splice.apply(b,[x,x-x].concat(w)),w},s=function(b,w,x){return x==null&&(x=n),b.push(w),E(b,0,b.length-1,x)},o=function(b,w){var x,C;return w==null&&(w=n),x=b.pop(),b.length?(C=b[0],b[0]=x,m(b,0,w)):C=x,C},u=function(b,w,x){var C;return x==null&&(x=n),C=b[0],b[0]=w,m(b,0,x),C},l=function(b,w,x){var C;return x==null&&(x=n),b.length&&x(b[0],w)<0&&(C=[b[0],w],w=C[0],b[0]=C[1],m(b,0,x)),w},i=function(b,w){var x,C,T,S,_,A;for(w==null&&(w=n),S=(function(){A=[];for(var P=0,D=a(b.length/2);0<=D?P<D:P>D;0<=D?P++:P--)A.push(P);return A}).apply(this).reverse(),_=[],C=0,T=S.length;C<T;C++)x=S[C],_.push(m(b,x,w));return _},p=function(b,w,x){var C;if(x==null&&(x=n),C=b.indexOf(w),C!==-1)return E(b,0,C,x),m(b,C,x)},h=function(b,w,x){var C,T,S,_,A;if(x==null&&(x=n),T=b.slice(0,w),!T.length)return T;for(i(T,x),A=b.slice(w),S=0,_=A.length;S<_;S++)C=A[S],l(T,C,x);return T.sort(x).reverse()},g=function(b,w,x){var C,T,S,_,A,P,D,I,M;if(x==null&&(x=n),w*10<=b.length){if(S=b.slice(0,w).sort(x),!S.length)return S;for(T=S[S.length-1],D=b.slice(w),_=0,P=D.length;_<P;_++)C=D[_],x(C,T)<0&&(c(S,C,0,null,x),S.pop(),T=S[S.length-1]);return S}for(i(b,x),M=[],A=0,I=d(w,b.length);0<=I?A<I:A>I;0<=I?++A:--A)M.push(o(b,x));return M},E=function(b,w,x,C){var T,S,_;for(C==null&&(C=n),T=b[x];x>w;){if(_=x-1>>1,S=b[_],C(T,S)<0){b[x]=S,x=_;continue}break}return b[x]=T},m=function(b,w,x){var C,T,S,_,A;for(x==null&&(x=n),T=b.length,A=w,S=b[w],C=2*w+1;C<T;)_=C+1,_<T&&!(x(b[C],b[_])<0)&&(C=_),b[w]=b[C],w=C,C=2*w+1;return b[w]=S,E(b,A,w,x)},t=(function(){b.push=s,b.pop=o,b.replace=u,b.pushpop=l,b.heapify=i,b.updateItem=p,b.nlargest=h,b.nsmallest=g;function b(w){this.cmp=w??n,this.nodes=[]}return b.prototype.push=function(w){return s(this.nodes,w,this.cmp)},b.prototype.pop=function(){return o(this.nodes,this.cmp)},b.prototype.peek=function(){return this.nodes[0]},b.prototype.contains=function(w){return this.nodes.indexOf(w)!==-1},b.prototype.replace=function(w){return u(this.nodes,w,this.cmp)},b.prototype.pushpop=function(w){return l(this.nodes,w,this.cmp)},b.prototype.heapify=function(){return i(this.nodes,this.cmp)},b.prototype.updateItem=function(w){return p(this.nodes,w,this.cmp)},b.prototype.clear=function(){return this.nodes=[]},b.prototype.empty=function(){return this.nodes.length===0},b.prototype.size=function(){return this.nodes.length},b.prototype.clone=function(){var w;return w=new b,w.nodes=this.nodes.slice(0),w},b.prototype.toArray=function(){return this.nodes.slice(0)},b.prototype.insert=b.prototype.push,b.prototype.top=b.prototype.peek,b.prototype.front=b.prototype.peek,b.prototype.has=b.prototype.contains,b.prototype.copy=b.prototype.clone,b})(),(function(b,w){return r.exports=w()})(this,function(){return t})}).call(wN)})(Bu)),Bu.exports}var Rc,fw;function EN(){return fw||(fw=1,Rc=xN()),Rc}var CN=EN(),bs=gs(CN),_N=yt({root:null,weight:function(e){return 1},directed:!1}),SN={dijkstra:function(e){if(!pr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=_N(e),a=n.root,i=n.weight,o=n.directed,s=this,l=i,u=Ke(a)?this.filter(a)[0]:a[0],c={},d={},h={},g=this.byGroup(),p=g.nodes,E=g.edges;E.unmergeBy(function(z){return z.isLoop()});for(var m=function(W){return c[W.id()]},b=function(W,q){c[W.id()]=q,w.updateItem(W)},w=new bs(function(z,W){return m(z)-m(W)}),x=0;x<p.length;x++){var C=p[x];c[C.id()]=C.same(u)?0:1/0,w.push(C)}for(var T=function(W,q){for(var $=(o?W.edgesTo(q):W.edgesWith(q)).intersect(E),X=1/0,Y,K=0;K<$.length;K++){var ee=$[K],le=l(ee);(le<X||!Y)&&(X=le,Y=ee)}return{edge:Y,dist:X}};w.size()>0;){var S=w.pop(),_=m(S),A=S.id();if(h[A]=_,_!==1/0)for(var P=S.neighborhood().intersect(p),D=0;D<P.length;D++){var I=P[D],M=I.id(),k=T(S,I),N=_+k.dist;N<m(I)&&(b(I,N),d[M]={node:S,edge:k.edge})}}return{distanceTo:function(W){var q=Ke(W)?p.filter(W)[0]:W[0];return h[q.id()]},pathTo:function(W){var q=Ke(W)?p.filter(W)[0]:W[0],$=[],X=q,Y=X.id();if(q.length>0)for($.unshift(q);d[Y];){var K=d[Y];$.unshift(K.edge),$.unshift(K.node),X=K.node,Y=X.id()}return s.spawn($)}}}},TN={kruskal:function(e){e=e||function(x){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,o=new Array(i),s=n,l=function(C){for(var T=0;T<o.length;T++){var S=o[T];if(S.has(C))return T}},u=0;u<i;u++)o[u]=this.spawn(n[u]);for(var c=a.sort(function(x,C){return e(x)-e(C)}),d=0;d<c.length;d++){var h=c[d],g=h.source()[0],p=h.target()[0],E=l(g),m=l(p),b=o[E],w=o[m];E!==m&&(s.merge(h),b.merge(w),o.splice(m,1))}return s}},RN=yt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),AN={aStar:function(e){var t=this.cy(),n=RN(e),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,l=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var u=a.id(),c=i.id(),d={},h={},g={},p=new bs(function(Y,K){return h[Y.id()]-h[K.id()]}),E=new io,m={},b={},w=function(K,ee){p.push(K),E.add(ee)},x,C,T=function(){x=p.pop(),C=x.id(),E.delete(C)},S=function(K){return E.has(K)};w(a,u),d[u]=0,h[u]=o(a);for(var _=0;p.size()>0;){if(T(),_++,C===c){for(var A=[],P=i,D=c,I=b[D];A.unshift(P),I!=null&&A.unshift(I),P=m[D],P!=null;)D=P.id(),I=b[D];return{found:!0,distance:d[C],path:this.spawn(A),steps:_}}g[C]=!0;for(var M=x._private.edges,k=0;k<M.length;k++){var N=M[k];if(this.hasElementWithId(N.id())&&!(s&&N.data("source")!==C)){var z=N.source(),W=N.target(),q=z.id()!==C?z:W,$=q.id();if(this.hasElementWithId($)&&!g[$]){var X=d[C]+l(N);if(!S($)){d[$]=X,h[$]=X+o(q),w(q,$),m[$]=x,b[$]=N;continue}X<d[$]&&(d[$]=X,h[$]=X+o(q),m[$]=x,b[$]=N)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},PN=yt({weight:function(e){return 1},directed:!1}),DN={floydWarshall:function(e){for(var t=this.cy(),n=PN(e),a=n.weight,i=n.directed,o=a,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=function(le){return l.indexOf(le)},g=function(le){return l[le]},p=new Array(d),E=0;E<d;E++){var m=E%c,b=(E-m)/c;b===m?p[E]=0:p[E]=1/0}for(var w=new Array(d),x=new Array(d),C=0;C<u.length;C++){var T=u[C],S=T.source()[0],_=T.target()[0];if(S!==_){var A=h(S),P=h(_),D=A*c+P,I=o(T);if(p[D]>I&&(p[D]=I,w[D]=P,x[D]=T),!i){var M=P*c+A;!i&&p[M]>I&&(p[M]=I,w[M]=A,x[M]=T)}}}for(var k=0;k<c;k++)for(var N=0;N<c;N++)for(var z=N*c+k,W=0;W<c;W++){var q=N*c+W,$=k*c+W;p[z]+p[$]<p[q]&&(p[q]=p[z]+p[$],w[q]=w[z])}var X=function(le){return(Ke(le)?t.filter(le):le)[0]},Y=function(le){return h(X(le))},K={distance:function(le,G){var V=Y(le),j=Y(G);return p[V*c+j]},path:function(le,G){var V=Y(le),j=Y(G),re=g(V);if(V===j)return re.collection();if(w[V*c+j]==null)return t.collection();var ce=t.collection(),se=V,Z;for(ce.merge(re);V!==j;)se=V,V=w[V*c+j],Z=x[se*c+V],ce.merge(Z),ce.merge(g(V));return ce}};return K}},IN=yt({weight:function(e){return 1},directed:!1,root:null}),BN={bellmanFord:function(e){var t=this,n=IN(e),a=n.weight,i=n.directed,o=n.root,s=a,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,h=c.nodes,g=h.length,p=new Xn,E=!1,m=[];o=u.collection(o)[0],d.unmergeBy(function(U){return U.isLoop()});for(var b=d.length,w=function(fe){var we=p.get(fe.id());return we||(we={},p.set(fe.id(),we)),we},x=function(fe){return(Ke(fe)?u.$(fe):fe)[0]},C=function(fe){return w(x(fe)).dist},T=function(fe){for(var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ge=x(fe),me=[],Re=ge;;){if(Re==null)return t.spawn();var Ie=w(Re),Be=Ie.edge,Oe=Ie.pred;if(me.unshift(Re[0]),Re.same(we)&&me.length>0)break;Be!=null&&me.unshift(Be),Re=Oe}return l.spawn(me)},S=0;S<g;S++){var _=h[S],A=w(_);_.same(o)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var P=!1,D=function(fe,we,ge,me,Re,Ie){var Be=me.dist+Ie;Be<Re.dist&&!ge.same(me.edge)&&(Re.dist=Be,Re.pred=fe,Re.edge=ge,P=!0)},I=1;I<g;I++){P=!1;for(var M=0;M<b;M++){var k=d[M],N=k.source(),z=k.target(),W=s(k),q=w(N),$=w(z);D(N,z,k,q,$,W),i||D(z,N,k,$,q,W)}if(!P)break}if(P)for(var X=[],Y=0;Y<b;Y++){var K=d[Y],ee=K.source(),le=K.target(),G=s(K),V=w(ee).dist,j=w(le).dist;if(V+G<j||!i&&j+G<V)if(E||(Er("Graph contains a negative weight cycle for Bellman-Ford"),E=!0),e.findNegativeWeightCycles!==!1){var re=[];V+G<j&&re.push(ee),!i&&j+G<V&&re.push(le);for(var ce=re.length,se=0;se<ce;se++){var Z=re[se],Q=[Z];Q.push(w(Z).edge);for(var ae=w(Z).pred;Q.indexOf(ae)===-1;)Q.push(ae),Q.push(w(ae).edge),ae=w(ae).pred;Q=Q.slice(Q.indexOf(ae));for(var ne=Q[0].id(),de=0,Ce=2;Ce<Q.length;Ce+=2)Q[Ce].id()<ne&&(ne=Q[Ce].id(),de=Ce);Q=Q.slice(de).concat(Q.slice(0,de)),Q.push(Q[0]);var ve=Q.map(function(U){return U.id()}).join(",");X.indexOf(ve)===-1&&(m.push(l.spawn(Q)),X.push(ve))}}else break}return{distanceTo:C,pathTo:T,hasNegativeWeightCycle:E,negativeWeightCycles:m}}},kN=Math.sqrt(2),MN=function(e,t,n){n.length===0&&Lr("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],s=t[i],l=t[o],u=n,c=u.length-1;c>=0;c--){var d=u[c],h=d[1],g=d[2];(t[h]===s&&t[g]===l||t[h]===l&&t[g]===s)&&u.splice(c,1)}for(var p=0;p<u.length;p++){var E=u[p];E[1]===l?(u[p]=E.slice(),u[p][1]=s):E[2]===l&&(u[p]=E.slice(),u[p][2]=s)}for(var m=0;m<t.length;m++)t[m]===l&&(t[m]=s);return u},Ac=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=MN(i,e,t),n--}return t},LN={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function($){return $.isLoop()});var i=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/kN);if(i<2){Lr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],c=0;c<o;c++){var d=a[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var h=1/0,g=[],p=new Array(i),E=new Array(i),m=new Array(i),b=function(X,Y){for(var K=0;K<i;K++)Y[K]=X[K]},w=0;w<=s;w++){for(var x=0;x<i;x++)E[x]=x;var C=Ac(E,u.slice(),i,l),T=C.slice();b(E,m);var S=Ac(E,C,l,2),_=Ac(m,T,l,2);S.length<=_.length&&S.length<h?(h=S.length,g=S,b(E,p)):_.length<=S.length&&_.length<h&&(h=_.length,g=_,b(m,p))}for(var A=this.spawn(g.map(function($){return a[$[0]]})),P=this.spawn(),D=this.spawn(),I=p[0],M=0;M<p.length;M++){var k=p[M],N=n[M];k===I?P.merge(N):D.merge(N)}var z=function(X){var Y=e.spawn();return X.forEach(function(K){Y.merge(K),K.connectedEdges().forEach(function(ee){e.contains(ee)&&!A.contains(ee)&&Y.merge(ee)})}),Y},W=[z(P),z(D)],q={cut:A,components:W,partition1:P,partition2:D};return q}},Pc,ON=function(e){return{x:e.x,y:e.y}},dl=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},CR=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Hi=function(e){return{x:e[0],y:e[1]}},qN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},NN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},FN=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=t;o<n;o++){var s=e[o];isFinite(s)&&(a+=s,i++)}return a/i},zN=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var s=0,l=e.length-1;l>=0;l--){var u=e[l];o?isFinite(u)||(e[l]=-1/0,s++):e.splice(l,1)}i&&e.sort(function(h,g){return h-g});var c=e.length,d=Math.floor(c/2);return c%2!==0?e[d+1+s]:(e[d-1+s]+e[d+s])/2},$N=function(e){return Math.PI*e/180},wu=function(e,t){return Math.atan2(t,e)-Math.PI/2},qm=Math.log2||function(r){return Math.log(r)/Math.log(2)},Nm=function(e){return e>0?1:e<0?-1:0},si=function(e,t){return Math.sqrt(ei(e,t))},ei=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},VN=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},ot=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},Zi=function(e,t,n,a){return{x:ot(e.x,t.x,n.x,a),y:ot(e.y,t.y,n.y,a)}},GN=function(e,t,n,a){var i={x:t.x-e.x,y:t.y-e.y},o=si(e,t),s={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+s.x*a,y:e.y+s.y*a}},ns=function(e,t,n){return Math.max(e,Math.min(n,t))},Bt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},WN=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},UN=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},HN=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},_R=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},ku=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Mu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(t.length===1)n=a=i=o=t[0];else if(t.length===2)n=i=t[0],o=a=t[1];else if(t.length===4){var s=Yr(t,4);n=s[0],a=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},cw=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},Fm=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)},xa=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},dw=function(e,t){return xa(e,t.x,t.y)},SR=function(e,t){return xa(e,t.x1,t.y1)&&xa(e,t.x2,t.y2)},KN=(Pc=Math.hypot)!==null&&Pc!==void 0?Pc:function(r,e){return Math.sqrt(r*r+e*e)};function jN(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(A,P){return{x:A.x+P.x,y:A.y+P.y}},n=function(A,P){return{x:A.x-P.x,y:A.y-P.y}},a=function(A,P){return{x:A.x*P,y:A.y*P}},i=function(A,P){return A.x*P.y-A.y*P.x},o=function(A){var P=KN(A.x,A.y);return P===0?{x:0,y:0}:{x:A.x/P,y:A.y/P}},s=function(A){for(var P=0,D=0;D<A.length;D++){var I=A[D],M=A[(D+1)%A.length];P+=I.x*M.y-M.x*I.y}return P/2},l=function(A,P,D,I){var M=n(P,A),k=n(I,D),N=i(M,k);if(Math.abs(N)<1e-9)return t(A,a(M,.5));var z=i(n(D,A),k)/N;return t(A,a(M,z))},u=r.map(function(_){return{x:_.x,y:_.y}});s(u)<0&&u.reverse();for(var c=u.length,d=[],h=0;h<c;h++){var g=u[h],p=u[(h+1)%c],E=n(p,g),m=o({x:E.y,y:-E.x});d.push(m)}for(var b=d.map(function(_,A){var P=t(u[A],a(_,e)),D=t(u[(A+1)%c],a(_,e));return{p1:P,p2:D}}),w=[],x=0;x<c;x++){var C=b[(x-1+c)%c],T=b[x],S=l(C.p1,C.p2,T.p1,T.p2);w.push(S)}return w}function YN(r,e,t,n,a,i){var o=aF(r,e,t,n,a),s=jN(o,i),l=Bt();return s.forEach(function(u){return _R(l,u.x,u.y)}),l}var TR=function(e,t,n,a,i,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Aa(i,o):l,c=i/2,d=o/2;u=Math.min(u,c,d);var h=u!==c,g=u!==d,p;if(h){var E=n-c+u-s,m=a-d-s,b=n+c-u+s,w=m;if(p=Ea(e,t,n,a,E,m,b,w,!1),p.length>0)return p}if(g){var x=n+c+s,C=a-d+u-s,T=x,S=a+d-u+s;if(p=Ea(e,t,n,a,x,C,T,S,!1),p.length>0)return p}if(h){var _=n-c+u-s,A=a+d+s,P=n+c-u+s,D=A;if(p=Ea(e,t,n,a,_,A,P,D,!1),p.length>0)return p}if(g){var I=n-c-s,M=a-d+u-s,k=I,N=a+d-u+s;if(p=Ea(e,t,n,a,I,M,k,N,!1),p.length>0)return p}var z;{var W=n-c+u,q=a-d+u;if(z=zo(e,t,n,a,W,q,u+s),z.length>0&&z[0]<=W&&z[1]<=q)return[z[0],z[1]]}{var $=n+c-u,X=a-d+u;if(z=zo(e,t,n,a,$,X,u+s),z.length>0&&z[0]>=$&&z[1]<=X)return[z[0],z[1]]}{var Y=n+c-u,K=a+d-u;if(z=zo(e,t,n,a,Y,K,u+s),z.length>0&&z[0]>=Y&&z[1]>=K)return[z[0],z[1]]}{var ee=n-c+u,le=a+d-u;if(z=zo(e,t,n,a,ee,le,u+s),z.length>0&&z[0]<=ee&&z[1]>=le)return[z[0],z[1]]}return[]},ZN=function(e,t,n,a,i,o,s){var l=s,u=Math.min(n,i),c=Math.max(n,i),d=Math.min(a,o),h=Math.max(a,o);return u-l<=e&&e<=c+l&&d-l<=t&&t<=h+l},XN=function(e,t,n,a,i,o,s,l,u){var c={x1:Math.min(n,s,i)-u,x2:Math.max(n,s,i)+u,y1:Math.min(a,l,o)-u,y2:Math.max(a,l,o)+u};return!(e<c.x1||e>c.x2||t<c.y1||t>c.y2)},QN=function(e,t,n,a){n-=a;var i=t*t-4*e*n;if(i<0)return[];var o=Math.sqrt(i),s=2*e,l=(-t+o)/s,u=(-t-o)/s;return[l,u]},JN=function(e,t,n,a,i){var o=1e-5;e===0&&(e=o),t/=e,n/=e,a/=e;var s,l,u,c,d,h,g,p;if(l=(3*n-t*t)/9,u=-(27*a)+t*(9*n-2*(t*t)),u/=54,s=l*l*l+u*u,i[1]=0,g=t/3,s>0){d=u+Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),h=u-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-g+d+h,g+=(d+h)/2,i[4]=i[2]=-g,g=Math.sqrt(3)*(-h+d)/2,i[3]=g,i[5]=-g;return}if(i[5]=i[3]=0,s===0){p=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-g+2*p,i[4]=i[2]=-(p+g);return}l=-l,c=l*l*l,c=Math.acos(u/Math.sqrt(c)),p=2*Math.sqrt(l),i[0]=-g+p*Math.cos(c/3),i[2]=-g+p*Math.cos((c+2*Math.PI)/3),i[4]=-g+p*Math.cos((c+4*Math.PI)/3)},eF=function(e,t,n,a,i,o,s,l){var u=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*l+4*o*o-4*o*l+l*l,c=9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*l-6*o*o+3*o*l,d=3*n*n-6*n*i+n*s-n*e+2*i*i+2*i*e-s*e+3*a*a-6*a*o+a*l-a*t+2*o*o+2*o*t-l*t,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*t-o*t,g=[];JN(u,c,d,h,g);for(var p=1e-7,E=[],m=0;m<6;m+=2)Math.abs(g[m+1])<p&&g[m]>=0&&g[m]<=1&&E.push(g[m]);E.push(1),E.push(0);for(var b=-1,w,x,C,T=0;T<E.length;T++)w=Math.pow(1-E[T],2)*n+2*(1-E[T])*E[T]*i+E[T]*E[T]*s,x=Math.pow(1-E[T],2)*a+2*(1-E[T])*E[T]*o+E[T]*E[T]*l,C=Math.pow(w-e,2)+Math.pow(x-t,2),b>=0?C<b&&(b=C):b=C;return b},rF=function(e,t,n,a,i,o){var s=[e-n,t-a],l=[i-n,o-a],u=l[0]*l[0]+l[1]*l[1],c=s[0]*s[0]+s[1]*s[1],d=s[0]*l[0]+s[1]*l[1],h=d*d/u;return d<0?c:h>u?(e-i)*(e-i)+(t-o)*(t-o):c-h},zt=function(e,t,n){for(var a,i,o,s,l,u=0,c=0;c<n.length/2;c++)if(a=n[c*2],i=n[c*2+1],c+1<n.length/2?(o=n[(c+1)*2],s=n[(c+1)*2+1]):(o=n[(c+1-n.length/2)*2],s=n[(c+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)l=(e-a)/(o-a)*(s-i)+i,l>t&&u++;else continue;return u%2!==0},Jn=function(e,t,n,a,i,o,s,l,u){var c=new Array(n.length),d;l[0]!=null?(d=Math.atan(l[1]/l[0]),l[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),g=Math.sin(-d),p=0;p<c.length/2;p++)c[p*2]=o/2*(n[p*2]*h-n[p*2+1]*g),c[p*2+1]=s/2*(n[p*2+1]*h+n[p*2]*g),c[p*2]+=a,c[p*2+1]+=i;var E;if(u>0){var m=Xu(c,-u);E=Zu(m)}else E=c;return zt(e,t,E)},tF=function(e,t,n,a,i,o,s,l){for(var u=new Array(n.length*2),c=0;c<l.length;c++){var d=l[c];u[c*4+0]=d.startX,u[c*4+1]=d.startY,u[c*4+2]=d.stopX,u[c*4+3]=d.stopY;var h=Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2);if(h<=Math.pow(d.radius,2))return!0}return zt(e,t,u)},Zu=function(e){for(var t=new Array(e.length/2),n,a,i,o,s,l,u,c,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],o=e[d*4+3],d<e.length/4-1?(s=e[(d+1)*4],l=e[(d+1)*4+1],u=e[(d+1)*4+2],c=e[(d+1)*4+3]):(s=e[0],l=e[1],u=e[2],c=e[3]);var h=Ea(n,a,i,o,s,l,u,c,!0);t[d*2]=h[0],t[d*2+1]=h[1]}return t},Xu=function(e,t){for(var n=new Array(e.length*2),a,i,o,s,l=0;l<e.length/2;l++){a=e[l*2],i=e[l*2+1],l<e.length/2-1?(o=e[(l+1)*2],s=e[(l+1)*2+1]):(o=e[0],s=e[1]);var u=s-i,c=-(o-a),d=Math.sqrt(u*u+c*c),h=u/d,g=c/d;n[l*4]=a+h*t,n[l*4+1]=i+g*t,n[l*4+2]=o+h*t,n[l*4+3]=s+g*t}return n},nF=function(e,t,n,a,i,o){var s=n-e,l=a-t;s/=i,l/=o;var u=Math.sqrt(s*s+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(a-t)*d+t]},ii=function(e,t,n,a,i,o,s){return e-=i,t-=o,e/=n/2+s,t/=a/2+s,e*e+t*t<=1},zo=function(e,t,n,a,i,o,s){var l=[n-e,a-t],u=[e-i,t-o],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-s*s,g=d*d-4*c*h;if(g<0)return[];var p=(-d+Math.sqrt(g))/(2*c),E=(-d-Math.sqrt(g))/(2*c),m=Math.min(p,E),b=Math.max(p,E),w=[];if(m>=0&&m<=1&&w.push(m),b>=0&&b<=1&&w.push(b),w.length===0)return[];var x=w[0]*l[0]+e,C=w[0]*l[1]+t;if(w.length>1){if(w[0]==w[1])return[x,C];var T=w[1]*l[0]+e,S=w[1]*l[1]+t;return[x,C,T,S]}else return[x,C]},Dc=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Ea=function(e,t,n,a,i,o,s,l,u){var c=e-i,d=n-e,h=s-i,g=t-o,p=a-t,E=l-o,m=h*g-E*c,b=d*g-p*c,w=E*d-h*p;if(w!==0){var x=m/w,C=b/w,T=.001,S=0-T,_=1+T;return S<=x&&x<=_&&S<=C&&C<=_?[e+x*d,t+x*p]:u?[e+x*d,t+x*p]:[]}else return m===0||b===0?Dc(e,n,s)===s?[s,l]:Dc(e,n,i)===i?[i,o]:Dc(i,s,n)===n?[n,a]:[]:[]},aF=function(e,t,n,a,i){var o=[],s=a/2,l=i/2,u=t,c=n;o.push({x:u+s*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)o.push({x:u+s*e[d*2],y:c+l*e[d*2+1]});return o},as=function(e,t,n,a,i,o,s,l){var u=[],c,d=new Array(n.length),h=!0;o==null&&(h=!1);var g;if(h){for(var p=0;p<d.length/2;p++)d[p*2]=n[p*2]*o+a,d[p*2+1]=n[p*2+1]*s+i;if(l>0){var E=Xu(d,-l);g=Zu(E)}else g=d}else g=n;for(var m,b,w,x,C=0;C<g.length/2;C++)m=g[C*2],b=g[C*2+1],C<g.length/2-1?(w=g[(C+1)*2],x=g[(C+1)*2+1]):(w=g[0],x=g[1]),c=Ea(e,t,a,i,m,b,w,x),c.length!==0&&u.push(c[0],c[1]);return u},iF=function(e,t,n,a,i,o,s,l,u){var c=[],d,h=new Array(n.length*2);u.forEach(function(w,x){x===0?(h[h.length-2]=w.startX,h[h.length-1]=w.startY):(h[x*4-2]=w.startX,h[x*4-1]=w.startY),h[x*4]=w.stopX,h[x*4+1]=w.stopY,d=zo(e,t,a,i,w.cx,w.cy,w.radius),d.length!==0&&c.push(d[0],d[1])});for(var g=0;g<h.length/4;g++)d=Ea(e,t,a,i,h[g*4],h[g*4+1],h[g*4+2],h[g*4+3],!1),d.length!==0&&c.push(d[0],d[1]);if(c.length>2){for(var p=[c[0],c[1]],E=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),m=1;m<c.length/2;m++){var b=Math.pow(c[m*2]-e,2)+Math.pow(c[m*2+1]-t,2);b<=E&&(p[0]=c[m*2],p[1]=c[m*2+1],E=b)}return p}return c},xu=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]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*a[0],t[1]+o*a[1]]},It=function(e,t){var n=fm(e,t);return n=RR(n),n},RR=function(e){for(var t,n,a=e.length/2,i=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u<a;u++)t=e[2*u],n=e[2*u+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),l=Math.max(l,n);for(var c=2/(s-i),d=2/(l-o),h=0;h<a;h++)t=e[2*h]=e[2*h]*c,n=e[2*h+1]=e[2*h+1]*d,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),l=Math.max(l,n);if(o<-1)for(var g=0;g<a;g++)n=e[2*g+1]=e[2*g+1]+(-1-o);return e},fm=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 i=new Array(e*2),o,s=0;s<e;s++)o=s*n+a,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Aa=function(e,t){return Math.min(e/4,t/4,8)},AR=function(e,t){return Math.min(e/10,t/10,8)},zm=function(){return 8},oF=function(e,t,n){return[e-2*t+n,2*(t-e),e]},cm=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Ic(r,e){function t(d){for(var h=[],g=0;g<d.length;g++){var p=d[g],E=d[(g+1)%d.length],m={x:E.x-p.x,y:E.y-p.y},b={x:-m.y,y:m.x},w=Math.sqrt(b.x*b.x+b.y*b.y);h.push({x:b.x/w,y:b.y/w})}return h}function n(d,h){var g=1/0,p=-1/0,E=$t(d),m;try{for(E.s();!(m=E.n()).done;){var b=m.value,w=b.x*h.x+b.y*h.y;g=Math.min(g,w),p=Math.max(p,w)}}catch(x){E.e(x)}finally{E.f()}return{min:g,max:p}}function a(d,h){return!(d.max<h.min||h.max<d.min)}var i=[].concat(Hu(t(r)),Hu(t(e))),o=$t(i),s;try{for(o.s();!(s=o.n()).done;){var l=s.value,u=n(r,l),c=n(e,l);if(!a(u,c))return!1}}catch(d){o.e(d)}finally{o.f()}return!0}var sF=yt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),uF={pageRank:function(e){for(var t=sF(e),n=t.dampingFactor,a=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,h=d*d,g=c.length,p=new Array(h),E=new Array(d),m=(1-n)/d,b=0;b<d;b++){for(var w=0;w<d;w++){var x=b*d+w;p[x]=0}E[b]=0}for(var C=0;C<g;C++){var T=c[C],S=T.data("source"),_=T.data("target");if(S!==_){var A=u.indexOfId(S),P=u.indexOfId(_),D=o(T),I=P*d+A;p[I]+=D,E[A]+=D}}for(var M=1/d+m,k=0;k<d;k++)if(E[k]===0)for(var N=0;N<d;N++){var z=N*d+k;p[z]=M}else for(var W=0;W<d;W++){var q=W*d+k;p[q]=p[q]/E[k]+m}for(var $=new Array(d),X=new Array(d),Y,K=0;K<d;K++)$[K]=1;for(var ee=0;ee<i;ee++){for(var le=0;le<d;le++)X[le]=0;for(var G=0;G<d;G++)for(var V=0;V<d;V++){var j=G*d+V;X[G]+=p[j]*$[V]}VN(X),Y=$,$=X,X=Y;for(var re=0,ce=0;ce<d;ce++){var se=Y[ce]-$[ce];re+=se*se}if(re<a)break}var Z={rank:function(ae){return ae=s.collection(ae)[0],$[u.indexOf(ae)]}};return Z}},vw=yt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),Xi={degreeCentralityNormalized:function(e){e=vw(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var c={},d={},h=0,g=0,p=0;p<a;p++){var E=n[p],m=E.id();e.root=E;var b=this.degreeCentrality(e);h<b.indegree&&(h=b.indegree),g<b.outdegree&&(g=b.outdegree),c[m]=b.indegree,d[m]=b.outdegree}return{indegree:function(x){return h==0?0:(Ke(x)&&(x=t.filter(x)),c[x.id()]/h)},outdegree:function(x){return g===0?0:(Ke(x)&&(x=t.filter(x)),d[x.id()]/g)}}}else{for(var i={},o=0,s=0;s<a;s++){var l=n[s];e.root=l;var u=this.degreeCentrality(e);o<u.degree&&(o=u.degree),i[l.id()]=u.degree}return{degree:function(x){return o===0?0:(Ke(x)&&(x=t.filter(x)),i[x.id()]/o)}}}},degreeCentrality:function(e){e=vw(e);var t=this.cy(),n=this,a=e,i=a.root,o=a.weight,s=a.directed,l=a.alpha;if(i=t.collection(i)[0],s){for(var g=i.connectedEdges(),p=g.filter(function(S){return S.target().same(i)&&n.has(S)}),E=g.filter(function(S){return S.source().same(i)&&n.has(S)}),m=p.length,b=E.length,w=0,x=0,C=0;C<p.length;C++)w+=o(p[C]);for(var T=0;T<E.length;T++)x+=o(E[T]);return{indegree:Math.pow(m,1-l)*Math.pow(w,l),outdegree:Math.pow(b,1-l)*Math.pow(x,l)}}else{for(var u=i.connectedEdges().intersection(n),c=u.length,d=0,h=0;h<u.length;h++)d+=o(u[h]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}}};Xi.dc=Xi.degreeCentrality;Xi.dcn=Xi.degreeCentralityNormalised=Xi.degreeCentralityNormalized;var hw=yt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Qi={closenessCentralityNormalized:function(e){for(var t=hw(e),n=t.harmonic,a=t.weight,i=t.directed,o=this.cy(),s={},l=0,u=this.nodes(),c=this.floydWarshall({weight:a,directed:i}),d=0;d<u.length;d++){for(var h=0,g=u[d],p=0;p<u.length;p++)if(d!==p){var E=c.distance(g,u[p]);n?h+=1/E:h+=E}n||(h=1/h),l<h&&(l=h),s[g.id()]=h}return{closeness:function(b){return l==0?0:(Ke(b)?b=o.filter(b)[0].id():b=b.id(),s[b]/l)}}},closenessCentrality:function(e){var t=hw(e),n=t.root,a=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var s=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 h=s.distanceTo(d);o?l+=1/h:l+=h}}return o?l:1/l}};Qi.cc=Qi.closenessCentrality;Qi.ccn=Qi.closenessCentralityNormalised=Qi.closenessCentralityNormalized;var lF=yt({weight:null,directed:!1}),dm={betweennessCentrality:function(e){for(var t=lF(e),n=t.directed,a=t.weight,i=a!=null,o=this.cy(),s=this.nodes(),l={},u={},c=0,d={set:function(x,C){u[x]=C,C>c&&(c=C)},get:function(x){return u[x]}},h=0;h<s.length;h++){var g=s[h],p=g.id();n?l[p]=g.outgoers().nodes():l[p]=g.openNeighborhood().nodes(),d.set(p,0)}for(var E=function(){for(var x=s[m].id(),C=[],T={},S={},_={},A=new bs(function(G,V){return _[G]-_[V]}),P=0;P<s.length;P++){var D=s[P].id();T[D]=[],S[D]=0,_[D]=1/0}for(S[x]=1,_[x]=0,A.push(x);!A.empty();){var I=A.pop();if(C.push(I),i)for(var M=0;M<l[I].length;M++){var k=l[I][M],N=o.getElementById(I),z=void 0;N.edgesTo(k).length>0?z=N.edgesTo(k)[0]:z=k.edgesTo(N)[0];var W=a(z);k=k.id(),_[k]>_[I]+W&&(_[k]=_[I]+W,A.nodes.indexOf(k)<0?A.push(k):A.updateItem(k),S[k]=0,T[k]=[]),_[k]==_[I]+W&&(S[k]=S[k]+S[I],T[k].push(I))}else for(var q=0;q<l[I].length;q++){var $=l[I][q].id();_[$]==1/0&&(A.push($),_[$]=_[I]+1),_[$]==_[I]+1&&(S[$]=S[$]+S[I],T[$].push(I))}}for(var X={},Y=0;Y<s.length;Y++)X[s[Y].id()]=0;for(;C.length>0;){for(var K=C.pop(),ee=0;ee<T[K].length;ee++){var le=T[K][ee];X[le]=X[le]+S[le]/S[K]*(1+X[K])}K!=s[m].id()&&d.set(K,d.get(K)+X[K])}},m=0;m<s.length;m++)E();var b={betweenness:function(x){var C=o.collection(x).id();return d.get(C)},betweennessNormalized:function(x){if(c==0)return 0;var C=o.collection(x).id();return d.get(C)/c}};return b.betweennessNormalised=b.betweennessNormalized,b}};dm.bc=dm.betweennessCentrality;var fF=yt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),cF=function(e){return fF(e)},dF=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},vF=function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n},PR=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 o=0;o<t;o++)e[o*t+a]=e[o*t+a]/n}},hF=function(e,t,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var s=0;s<n;s++)for(var l=0;l<n;l++)a[i*n+l]+=e[i*n+s]*t[s*n+l]}return a},gF=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=hF(e,a,t);return e},pF=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 PR(a,t),a},yF=function(e,t,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),s=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s)return!1}return!0},mF=function(e,t,n,a){for(var i=[],o=0;o<t;o++){for(var s=[],l=0;l<t;l++)Math.round(e[o*t+l]*1e3)/1e3>0&&s.push(n[l]);s.length!==0&&i.push(a.collection(s))}return i},bF=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},wF=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&bF(e[t],e[n])&&e.splice(n,1);return e},gw=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=cF(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var l=t.length,u=l*l,c=new Array(u),d,h=0;h<u;h++)c[h]=0;for(var g=0;g<n.length;g++){var p=n[g],E=o[p.source().id()],m=o[p.target().id()],b=dF(p,i.attributes);c[E*l+m]+=b,c[m*l+E]+=b}vF(c,l,i.multFactor),PR(c,l);for(var w=!0,x=0;w&&x<i.maxIterations;)w=!1,d=gF(c,l,i.expandFactor),c=pF(d,l,i.inflateFactor),yF(c,d,u,4)||(w=!0),x++;var C=mF(c,l,t,a);return C=wF(C),C},xF={markovClustering:gw,mcl:gw},EF=function(e){return e},DR=function(e,t){return Math.abs(t-e)},pw=function(e,t,n){return e+DR(t,n)},yw=function(e,t,n){return e+Math.pow(n-t,2)},CF=function(e){return Math.sqrt(e)},_F=function(e,t,n){return Math.max(e,DR(t,n))},ko=function(e,t,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:EF,s=a,l,u,c=0;c<e;c++)l=t(c),u=n(c),s=i(s,l,u);return o(s)},no={euclidean:function(e,t,n){return e>=2?ko(e,t,n,0,yw,CF):ko(e,t,n,0,pw)},squaredEuclidean:function(e,t,n){return ko(e,t,n,0,yw)},manhattan:function(e,t,n){return ko(e,t,n,0,pw)},max:function(e,t,n){return ko(e,t,n,-1/0,_F)}};no["squared-euclidean"]=no.squaredEuclidean;no.squaredeuclidean=no.squaredEuclidean;function vl(r,e,t,n,a,i){var o;return Fr(r)?o=r:o=no[r]||no.euclidean,e===0&&Fr(r)?o(a,i):o(e,t,n,a,i)}var SF=yt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),$m=function(e){return SF(e)},Qu=function(e,t,n,a,i){var o=i!=="kMedoids",s=o?function(d){return n[d]}:function(d){return a[d](n)},l=function(h){return a[h](t)},u=n,c=t;return vl(e,a.length,s,l,u,c)},Bc=function(e,t,n){for(var a=n.length,i=new Array(a),o=new Array(a),s=new Array(t),l=null,u=0;u<a;u++)i[u]=e.min(n[u]).value,o[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()*(o[d]-i[d])+i[d];s[c]=l}return s},IR=function(e,t,n,a,i){for(var o=1/0,s=0,l=0;l<t.length;l++){var u=Qu(n,e,t[l],a,i);u<o&&(o=u,s=l)}return s},BR=function(e,t,n){for(var a=[],i=null,o=0;o<t.length;o++)i=t[o],n[i.id()]===e&&a.push(i);return a},TF=function(e,t,n){return Math.abs(t-e)<=n},RF=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-t[a][i]);if(o>n)return!1}return!0},AF=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},mw=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)];AF(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},bw=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=Qu("manhattan",t[i],e,n,"kMedoids");return a},PF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=$m(e),o=new Array(i.k),s={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=Bc(n,i.k,i.attributes)):tt(i.testCentroids)==="object"?l=i.testCentroids:l=Bc(n,i.k,i.attributes):l=Bc(n,i.k,i.attributes);for(var u=!0,c=0;u&&c<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],s[a.id()]=IR(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var g=BR(h,n,s);if(g.length!==0){for(var p=i.attributes.length,E=l[h],m=new Array(p),b=new Array(p),w=0;w<p;w++){b[w]=0;for(var x=0;x<g.length;x++)a=g[x],b[w]+=i.attributes[w](a);m[w]=b[w]/g.length,TF(m[w],E[w],i.sensitivityThreshold)||(u=!0)}l[h]=m,o[h]=t.collection(g)}}c++}return o},DF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=$m(e),o=new Array(i.k),s,l={},u,c=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(tt(i.testCentroids)==="object"?s=i.testCentroids:s=mw(n,i.k)):s=mw(n,i.k);for(var d=!0,h=0;d&&h<i.maxIterations;){for(var g=0;g<n.length;g++)a=n[g],l[a.id()]=IR(a,s,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<s.length;p++){var E=BR(p,n,l);if(E.length!==0){c[p]=bw(s[p],E,i.attributes);for(var m=0;m<E.length;m++)u=bw(E[m],E,i.attributes),u<c[p]&&(c[p]=u,s[p]=E[m],d=!0);o[p]=t.collection(E)}}h++}return o},IF=function(e,t,n,a,i){for(var o,s,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++){o=0,s=0;for(var h=0;h<t.length;h++)o+=a[h][c]*i.attributes[d](t[h]),s+=a[h][c];e[c][d]=o/s}},BF=function(e,t,n,a,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,l,u,c=2/(i.m-1),d=0;d<n.length;d++)for(var h=0;h<a.length;h++){s=0;for(var g=0;g<n.length;g++)l=Qu(i.distance,a[h],n[d],i.attributes,"cmeans"),u=Qu(i.distance,a[h],n[g],i.attributes,"cmeans"),s+=Math.pow(l/u,c);e[h][d]=1/s}},kF=function(e,t,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var s,l,u=0;u<t.length;u++){s=-1/0,l=-1;for(var c=0;c<t[0].length;c++)t[u][c]>s&&(s=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},ww=function(e){var t=this.cy(),n=this.nodes(),a=$m(e),i,o,s,l,u;l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=new Array(a.k);s=new Array(n.length);for(var d=0;d<n.length;d++)s[d]=new Array(a.k);for(var h=0;h<n.length;h++){for(var g=0,p=0;p<a.k;p++)s[h][p]=Math.random(),g+=s[h][p];for(var E=0;E<a.k;E++)s[h][E]=s[h][E]/g}o=new Array(a.k);for(var m=0;m<a.k;m++)o[m]=new Array(a.attributes.length);u=new Array(n.length);for(var b=0;b<n.length;b++)u[b]=new Array(a.k);for(var w=!0,x=0;w&&x<a.maxIterations;)w=!1,IF(o,n,s,u,a),BF(s,l,o,n,a),RF(s,l,a.sensitivityThreshold)||(w=!0),x++;return i=kF(n,s,a,t),{clusters:i,degreeOfMembership:s}},MF={kMeans:PF,kMedoids:DF,fuzzyCMeans:ww,fcm:ww},LF=yt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),OF={single:"min",complete:"max"},qF=function(e){var t=LF(e),n=OF[t.linkage];return n!=null&&(t.linkage=n),t},xw=function(e,t,n,a,i){for(var o=0,s=1/0,l,u=i.attributes,c=function(P,D){return vl(i.distance,u.length,function(I){return u[I](P)},function(I){return u[I](D)},P,D)},d=0;d<e.length;d++){var h=e[d].key,g=n[h][a[h]];g<s&&(o=h,s=g)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=t[o],E=t[a[o]],m;i.mode==="dendrogram"?m={left:p,right:E,key:p.key}:m={value:p.value.concat(E.value),key:p.key},e[p.index]=m,e.splice(E.index,1),t[p.key]=m;for(var b=0;b<e.length;b++){var w=e[b];p.key===w.key?l=1/0:i.linkage==="min"?(l=n[p.key][w.key],n[p.key][w.key]>n[E.key][w.key]&&(l=n[E.key][w.key])):i.linkage==="max"?(l=n[p.key][w.key],n[p.key][w.key]<n[E.key][w.key]&&(l=n[E.key][w.key])):i.linkage==="mean"?l=(n[p.key][w.key]*p.size+n[E.key][w.key]*E.size)/(p.size+E.size):i.mode==="dendrogram"?l=c(w.value,p.value):l=c(w.value[0],p.value[0]),n[p.key][w.key]=n[w.key][p.key]=l}for(var x=0;x<e.length;x++){var C=e[x].key;if(a[C]===p.key||a[C]===E.key){for(var T=C,S=0;S<e.length;S++){var _=e[S].key;n[C][_]<n[C][T]&&(T=_)}a[C]=T}e[x].index=x}return p.key=E.key=p.index=E.index=null,!0},Ki=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Ki(e.left,t),e.right&&Ki(e.right,t)))},vm=function(e,t){if(!e)return"";if(e.left&&e.right){var n=vm(e.left,t),a=vm(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()}else if(e.value)return e.value.id()},hm=function(e,t,n){if(!e)return[];var a=[],i=[],o=[];return t===0?(e.left&&Ki(e.left,a),e.right&&Ki(e.right,i),o=a.concat(i),[n.collection(o)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Ki(e.left,a),e.right&&Ki(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=hm(e.left,t-1,n)),e.right&&(i=hm(e.right,t-1,n)),a.concat(i))},Ew=function(e){for(var t=this.cy(),n=this.nodes(),a=qF(e),i=a.attributes,o=function(x,C){return vl(a.distance,i.length,function(T){return i[T](x)},function(T){return i[T](C)},x,C)},s=[],l=[],u=[],c=[],d=0;d<n.length;d++){var h={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};s[d]=h,c[d]=h,l[d]=[],u[d]=0}for(var g=0;g<s.length;g++)for(var p=0;p<=g;p++){var E=void 0;a.mode==="dendrogram"?E=g===p?1/0:o(s[g].value,s[p].value):E=g===p?1/0:o(s[g].value[0],s[p].value[0]),l[g][p]=E,l[p][g]=E,E<l[g][u[g]]&&(u[g]=p)}for(var m=xw(s,c,l,u,a);m;)m=xw(s,c,l,u,a);var b;return a.mode==="dendrogram"?(b=hm(s[0],a.dendrogramDepth,t),a.addDendrogram&&vm(s[0],t)):(b=new Array(s.length),s.forEach(function(w,x){w.key=w.index=null,b[x]=t.collection(w.value)})),b},NF={hierarchicalClustering:Ew,hca:Ew},FF=yt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),zF=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Lr("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||ke(n)||Lr("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),FF(e)},$F=function(e,t,n,a){var i=function(s,l){return a[l](s)};return-vl(e,a.length,function(o){return i(t,o)},function(o){return i(n,o)},t,n)},VF=function(e,t){var n=null;return t==="median"?n=zN(e):t==="mean"?n=FN(e):t==="min"?n=qN(e):t==="max"?n=NN(e):n=t,n},GF=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},Cw=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var o=-1,s=-1/0,l=0;l<n.length;l++){var u=n[l];t[i*e+u]>s&&(o=u,s=t[i*e+u])}o>0&&a.push(o)}for(var c=0;c<n.length;c++)a[n[c]]=n[c];return a},WF=function(e,t,n){for(var a=Cw(e,t,n),i=0;i<n.length;i++){for(var o=[],s=0;s<a.length;s++)a[s]===n[i]&&o.push(s);for(var l=-1,u=-1/0,c=0;c<o.length;c++){for(var d=0,h=0;h<o.length;h++)d+=t[o[h]*e+o[c]];d>u&&(l=c,u=d)}n[i]=o[l]}return a=Cw(e,t,n),a},_w=function(e){for(var t=this.cy(),n=this.nodes(),a=zF(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var s,l,u,c,d,h;s=n.length,l=s*s,u=new Array(l);for(var g=0;g<l;g++)u[g]=-1/0;for(var p=0;p<s;p++)for(var E=0;E<s;E++)p!==E&&(u[p*s+E]=$F(a.distance,n[p],n[E],a.attributes));c=VF(u,a.preference);for(var m=0;m<s;m++)u[m*s+m]=c;d=new Array(l);for(var b=0;b<l;b++)d[b]=0;h=new Array(l);for(var w=0;w<l;w++)h[w]=0;for(var x=new Array(s),C=new Array(s),T=new Array(s),S=0;S<s;S++)x[S]=0,C[S]=0,T[S]=0;for(var _=new Array(s*a.minIterations),A=0;A<_.length;A++)_[A]=0;var P;for(P=0;P<a.maxIterations;P++){for(var D=0;D<s;D++){for(var I=-1/0,M=-1/0,k=-1,N=0,z=0;z<s;z++)x[z]=d[D*s+z],N=h[D*s+z]+u[D*s+z],N>=I?(M=I,I=N,k=z):N>M&&(M=N);for(var W=0;W<s;W++)d[D*s+W]=(1-a.damping)*(u[D*s+W]-I)+a.damping*x[W];d[D*s+k]=(1-a.damping)*(u[D*s+k]-M)+a.damping*x[k]}for(var q=0;q<s;q++){for(var $=0,X=0;X<s;X++)x[X]=h[X*s+q],C[X]=Math.max(0,d[X*s+q]),$+=C[X];$-=C[q],C[q]=d[q*s+q],$+=C[q];for(var Y=0;Y<s;Y++)h[Y*s+q]=(1-a.damping)*Math.min(0,$-C[Y])+a.damping*x[Y];h[q*s+q]=(1-a.damping)*($-C[q])+a.damping*x[q]}for(var K=0,ee=0;ee<s;ee++){var le=h[ee*s+ee]+d[ee*s+ee]>0?1:0;_[P%a.minIterations*s+ee]=le,K+=le}if(K>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var G=0,V=0;V<s;V++){T[V]=0;for(var j=0;j<a.minIterations;j++)T[V]+=_[j*s+V];(T[V]===0||T[V]===a.minIterations)&&G++}if(G===s)break}}for(var re=GF(s,d,h),ce=WF(s,u,re),se={},Z=0;Z<re.length;Z++)se[re[Z]]=[];for(var Q=0;Q<n.length;Q++){var ae=i[n[Q].id()],ne=ce[ae];ne!=null&&se[ne].push(n[Q])}for(var de=new Array(re.length),Ce=0;Ce<re.length;Ce++)de[Ce]=t.collection(se[re[Ce]]);return de},UF={affinityPropagation:_w,ap:_w},HF=yt({root:void 0,directed:!1}),KF={hierholzer:function(e){if(!pr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=HF(e),a=n.root,i=n.directed,o=this,s=!1,l,u,c;a&&(c=Ke(a)?this.filter(a)[0].id():a[0].id());var d={},h={};i?o.forEach(function(w){var x=w.id();if(w.isNode()){var C=w.indegree(!0),T=w.outdegree(!0),S=C-T,_=T-C;S==1?l?s=!0:l=x:_==1?u?s=!0:u=x:(_>1||S>1)&&(s=!0),d[x]=[],w.outgoers().forEach(function(A){A.isEdge()&&d[x].push(A.id())})}else h[x]=[void 0,w.target().id()]}):o.forEach(function(w){var x=w.id();if(w.isNode()){var C=w.degree(!0);C%2&&(l?u?s=!0:u=x:l=x),d[x]=[],w.connectedEdges().forEach(function(T){return d[x].push(T.id())})}else h[x]=[w.source().id(),w.target().id()]});var g={found:!1,trail:void 0};if(s)return g;if(u&&l)if(i){if(c&&u!=c)return g;c=u}else{if(c&&u!=c&&l!=c)return g;c||(c=u)}else c||(c=o[0].id());var p=function(x){for(var C=x,T=[x],S,_,A;d[C].length;)S=d[C].shift(),_=h[S][0],A=h[S][1],C!=A?(d[A]=d[A].filter(function(P){return P!=S}),C=A):!i&&C!=_&&(d[_]=d[_].filter(function(P){return P!=S}),C=_),T.unshift(S),T.unshift(C);return T},E=[],m=[];for(m=p(c);m.length!=1;)d[m[0]].length==0?(E.unshift(o.getElementById(m.shift())),E.unshift(o.getElementById(m.shift()))):m=p(m.shift()).concat(m);E.unshift(o.getElementById(m.shift()));for(var b in d)if(d[b].length)return g;return g.found=!0,g.trail=this.spawn(E,!0),g}},Eu=function(){var e=this,t={},n=0,a=0,i=[],o=[],s={},l=function(h,g){for(var p=o.length-1,E=[],m=e.spawn();o[p].x!=h||o[p].y!=g;)E.push(o.pop().edge),p--;E.push(o.pop().edge),E.forEach(function(b){var w=b.connectedNodes().intersection(e);m.merge(b),w.forEach(function(x){var C=x.id(),T=x.connectedEdges().intersection(e);m.merge(x),t[C].cutVertex?m.merge(T.filter(function(S){return S.isLoop()})):m.merge(T)})}),i.push(m)},u=function(h,g,p){h===p&&(a+=1),t[g]={id:n,low:n++,cutVertex:!1};var E=e.getElementById(g).connectedEdges().intersection(e);if(E.size()===0)i.push(e.spawn(e.getElementById(g)));else{var m,b,w,x;E.forEach(function(C){m=C.source().id(),b=C.target().id(),w=m===g?b:m,w!==p&&(x=C.id(),s[x]||(s[x]=!0,o.push({x:g,y:w,edge:C})),w in t?t[g].low=Math.min(t[g].low,t[w].id):(u(h,w,g),t[g].low=Math.min(t[g].low,t[w].low),t[g].id<=t[w].low&&(t[g].cutVertex=!0,l(g,w))))})}};e.forEach(function(d){if(d.isNode()){var h=d.id();h in t||(a=0,u(h,h),t[h].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}},jF={hopcroftTarjanBiconnected:Eu,htbc:Eu,htb:Eu,hopcroftTarjanBiconnectedComponents:Eu},Cu=function(){var e=this,t={},n=0,a=[],i=[],o=e.spawn(e),s=function(u){i.push(u),t[u]={index:n,low:n++,explored:!1};var c=e.getElementById(u).connectedEdges().intersection(e);if(c.forEach(function(E){var m=E.target().id();m!==u&&(m in t||s(m),t[m].explored||(t[u].low=Math.min(t[u].low,t[m].low)))}),t[u].index===t[u].low){for(var d=e.spawn();;){var h=i.pop();if(d.merge(e.getElementById(h)),t[h].low=t[u].index,t[h].explored=!0,h===u)break}var g=d.edgesWith(d),p=d.merge(g);a.push(p),o=o.difference(p)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||s(u)}}),{cut:o,components:a}},YF={tarjanStronglyConnected:Cu,tsc:Cu,tscc:Cu,tarjanStronglyConnectedComponents:Cu},kR={};[ts,SN,TN,AN,DN,BN,LN,uF,Xi,Qi,dm,xF,MF,NF,UF,KF,jF,YF].forEach(function(r){Ye(kR,r)});/*!
|
|
1
|
+
"use strict";var Iq=Object.create;var J1=Object.defineProperty;var Dq=Object.getOwnPropertyDescriptor;var Bq=Object.getOwnPropertyNames;var Mq=Object.getPrototypeOf,Lq=Object.prototype.hasOwnProperty;var Oq=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Bq(e))!Lq.call(r,a)&&a!==t&&J1(r,a,{get:()=>e[a],enumerable:!(n=Dq(e,a))||n.enumerable});return r};var Ar=(r,e,t)=>(t=r!=null?Iq(Mq(r)):{},Oq(e||!r||!r.__esModule?J1(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("react/jsx-runtime"),Re=require("@chakra-ui/react"),xe=require("react"),rr=require("react-icons/pi");var St=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ko={exports:{}};/**
|
|
2
|
+
* @license
|
|
3
|
+
* Lodash <https://lodash.com/>
|
|
4
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
5
|
+
* Released under MIT license <https://lodash.com/license>
|
|
6
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
7
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
8
|
+
*/var kq=Ko.exports,ew;function qq(){return ew||(ew=1,(function(r,e){(function(){var t,n="4.17.23",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,f="__lodash_placeholder__",d=1,h=2,g=4,p=1,x=2,b=1,w=2,y=4,E=8,C=16,S=32,R=64,_=128,A=256,P=512,I=30,D="...",L=800,M=16,q=1,N=2,W=3,V=1/0,$=9007199254740991,X=17976931348623157e292,ee=NaN,K=4294967295,j=K-1,fe=K>>>1,G=[["ary",_],["bind",b],["bindKey",w],["curry",E],["curryRight",C],["flip",P],["partial",S],["partialRight",R],["rearg",A]],z="[object Arguments]",Y="[object Array]",te="[object AsyncFunction]",ue="[object Boolean]",oe="[object Date]",Z="[object DOMException]",Q="[object Error]",ie="[object Function]",de="[object GeneratorFunction]",we="[object Map]",Ae="[object Number]",ve="[object Null]",le="[object Object]",Me="[object Promise]",Se="[object Proxy]",Ee="[object RegExp]",re="[object Set]",ce="[object String]",_e="[object Symbol]",me="[object Undefined]",Te="[object WeakMap]",De="[object WeakSet]",Ne="[object ArrayBuffer]",ze="[object DataView]",$e="[object Float32Array]",ke="[object Float64Array]",Oe="[object Int8Array]",ye="[object Int16Array]",O="[object Int32Array]",ne="[object Uint8Array]",he="[object Uint8ClampedArray]",ge="[object Uint16Array]",be="[object Uint32Array]",Ve=/\b__p \+= '';/g,Be=/\b(__p \+=) '' \+/g,He=/(__e\(.*?\)|\b__t\)) \+\n'';/g,We=/&(?:amp|lt|gt|quot|#39);/g,Xe=/[&<>"']/g,sr=RegExp(We.source),ar=RegExp(Xe.source),Ke=/<%-([\s\S]+?)%>/g,lr=/<%([\s\S]+?)%>/g,ir=/<%=([\s\S]+?)%>/g,Ur=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mr=/^\w*$/,ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lr=/[\\^$.*+?()[\]{}|]/g,jr=RegExp(Lr.source),Nr=/^\s+/,Qr=/\s/,Pn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vr=/\{\n\/\* \[wrapped with (.+)\] \*/,pn=/,? & /,yn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ua=/[()=,{}\[\]\/\s]/,Ci=/\\(\\)?/g,Gn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dt=/\w*$/,ot=/^[-+]0x[0-9a-f]+$/i,Et=/^0b[01]+$/i,Ga=/^\[object .+?Constructor\]$/,kt=/^0o[0-7]+$/i,qs=/^(?:0|[1-9]\d*)$/,rf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_i=/($^)/,tf=/['\n\r\u2028\u2029\\]/g,Si="\\ud800-\\udfff",nf="\\u0300-\\u036f",af="\\ufe20-\\ufe2f",of="\\u20d0-\\u20ff",la=nf+af+of,Ti="\\u2700-\\u27bf",Wa="a-z\\xdf-\\xf6\\xf8-\\xff",Ns="\\xac\\xb1\\xd7\\xf7",Fs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",sf="\\u2000-\\u206f",Ut=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ri="A-Z\\xc0-\\xd6\\xd8-\\xde",_o="\\ufe0e\\ufe0f",fa=Ns+Fs+sf+Ut,Pt="['’]",uf="["+Si+"]",lf="["+fa+"]",Ai="["+la+"]",O0="\\d+",DI="["+Ti+"]",k0="["+Wa+"]",q0="[^"+Si+fa+O0+Ti+Wa+Ri+"]",ff="\\ud83c[\\udffb-\\udfff]",BI="(?:"+Ai+"|"+ff+")",N0="[^"+Si+"]",cf="(?:\\ud83c[\\udde6-\\uddff]){2}",df="[\\ud800-\\udbff][\\udc00-\\udfff]",Pi="["+Ri+"]",F0="\\u200d",z0="(?:"+k0+"|"+q0+")",MI="(?:"+Pi+"|"+q0+")",$0="(?:"+Pt+"(?:d|ll|m|re|s|t|ve))?",V0="(?:"+Pt+"(?:D|LL|M|RE|S|T|VE))?",G0=BI+"?",W0="["+_o+"]?",LI="(?:"+F0+"(?:"+[N0,cf,df].join("|")+")"+W0+G0+")*",OI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",kI="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",U0=W0+G0+LI,qI="(?:"+[DI,cf,df].join("|")+")"+U0,NI="(?:"+[N0+Ai+"?",Ai,cf,df,uf].join("|")+")",FI=RegExp(Pt,"g"),zI=RegExp(Ai,"g"),vf=RegExp(ff+"(?="+ff+")|"+NI+U0,"g"),$I=RegExp([Pi+"?"+k0+"+"+$0+"(?="+[lf,Pi,"$"].join("|")+")",MI+"+"+V0+"(?="+[lf,Pi+z0,"$"].join("|")+")",Pi+"?"+z0+"+"+$0,Pi+"+"+V0,kI,OI,O0,qI].join("|"),"g"),VI=RegExp("["+F0+Si+la+_o+"]"),GI=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,WI=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],UI=-1,Dr={};Dr[$e]=Dr[ke]=Dr[Oe]=Dr[ye]=Dr[O]=Dr[ne]=Dr[he]=Dr[ge]=Dr[be]=!0,Dr[z]=Dr[Y]=Dr[Ne]=Dr[ue]=Dr[ze]=Dr[oe]=Dr[Q]=Dr[ie]=Dr[we]=Dr[Ae]=Dr[le]=Dr[Ee]=Dr[re]=Dr[ce]=Dr[Te]=!1;var Rr={};Rr[z]=Rr[Y]=Rr[Ne]=Rr[ze]=Rr[ue]=Rr[oe]=Rr[$e]=Rr[ke]=Rr[Oe]=Rr[ye]=Rr[O]=Rr[we]=Rr[Ae]=Rr[le]=Rr[Ee]=Rr[re]=Rr[ce]=Rr[_e]=Rr[ne]=Rr[he]=Rr[ge]=Rr[be]=!0,Rr[Q]=Rr[ie]=Rr[Te]=!1;var HI={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},KI={"&":"&","<":"<",">":">",'"':""","'":"'"},jI={"&":"&","<":"<",">":">",""":'"',"'":"'"},YI={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},XI=parseFloat,ZI=parseInt,H0=typeof St=="object"&&St&&St.Object===Object&&St,QI=typeof self=="object"&&self&&self.Object===Object&&self,vt=H0||QI||Function("return this")(),hf=e&&!e.nodeType&&e,Ua=hf&&!0&&r&&!r.nodeType&&r,K0=Ua&&Ua.exports===hf,gf=K0&&H0.process,tn=(function(){try{var ae=Ua&&Ua.require&&Ua.require("util").types;return ae||gf&&gf.binding&&gf.binding("util")}catch{}})(),j0=tn&&tn.isArrayBuffer,Y0=tn&&tn.isDate,X0=tn&&tn.isMap,Z0=tn&&tn.isRegExp,Q0=tn&&tn.isSet,J0=tn&&tn.isTypedArray;function Ht(ae,Ce,pe){switch(pe.length){case 0:return ae.call(Ce);case 1:return ae.call(Ce,pe[0]);case 2:return ae.call(Ce,pe[0],pe[1]);case 3:return ae.call(Ce,pe[0],pe[1],pe[2])}return ae.apply(Ce,pe)}function JI(ae,Ce,pe,Ge){for(var tr=-1,br=ae==null?0:ae.length;++tr<br;){var Jr=ae[tr];Ce(Ge,Jr,pe(Jr),ae)}return Ge}function nn(ae,Ce){for(var pe=-1,Ge=ae==null?0:ae.length;++pe<Ge&&Ce(ae[pe],pe,ae)!==!1;);return ae}function eD(ae,Ce){for(var pe=ae==null?0:ae.length;pe--&&Ce(ae[pe],pe,ae)!==!1;);return ae}function eb(ae,Ce){for(var pe=-1,Ge=ae==null?0:ae.length;++pe<Ge;)if(!Ce(ae[pe],pe,ae))return!1;return!0}function ca(ae,Ce){for(var pe=-1,Ge=ae==null?0:ae.length,tr=0,br=[];++pe<Ge;){var Jr=ae[pe];Ce(Jr,pe,ae)&&(br[tr++]=Jr)}return br}function zs(ae,Ce){var pe=ae==null?0:ae.length;return!!pe&&Ii(ae,Ce,0)>-1}function pf(ae,Ce,pe){for(var Ge=-1,tr=ae==null?0:ae.length;++Ge<tr;)if(pe(Ce,ae[Ge]))return!0;return!1}function Or(ae,Ce){for(var pe=-1,Ge=ae==null?0:ae.length,tr=Array(Ge);++pe<Ge;)tr[pe]=Ce(ae[pe],pe,ae);return tr}function da(ae,Ce){for(var pe=-1,Ge=Ce.length,tr=ae.length;++pe<Ge;)ae[tr+pe]=Ce[pe];return ae}function yf(ae,Ce,pe,Ge){var tr=-1,br=ae==null?0:ae.length;for(Ge&&br&&(pe=ae[++tr]);++tr<br;)pe=Ce(pe,ae[tr],tr,ae);return pe}function rD(ae,Ce,pe,Ge){var tr=ae==null?0:ae.length;for(Ge&&tr&&(pe=ae[--tr]);tr--;)pe=Ce(pe,ae[tr],tr,ae);return pe}function mf(ae,Ce){for(var pe=-1,Ge=ae==null?0:ae.length;++pe<Ge;)if(Ce(ae[pe],pe,ae))return!0;return!1}var tD=bf("length");function nD(ae){return ae.split("")}function aD(ae){return ae.match(yn)||[]}function rb(ae,Ce,pe){var Ge;return pe(ae,function(tr,br,Jr){if(Ce(tr,br,Jr))return Ge=br,!1}),Ge}function $s(ae,Ce,pe,Ge){for(var tr=ae.length,br=pe+(Ge?1:-1);Ge?br--:++br<tr;)if(Ce(ae[br],br,ae))return br;return-1}function Ii(ae,Ce,pe){return Ce===Ce?pD(ae,Ce,pe):$s(ae,tb,pe)}function iD(ae,Ce,pe,Ge){for(var tr=pe-1,br=ae.length;++tr<br;)if(Ge(ae[tr],Ce))return tr;return-1}function tb(ae){return ae!==ae}function nb(ae,Ce){var pe=ae==null?0:ae.length;return pe?xf(ae,Ce)/pe:ee}function bf(ae){return function(Ce){return Ce==null?t:Ce[ae]}}function wf(ae){return function(Ce){return ae==null?t:ae[Ce]}}function ab(ae,Ce,pe,Ge,tr){return tr(ae,function(br,Jr,Sr){pe=Ge?(Ge=!1,br):Ce(pe,br,Jr,Sr)}),pe}function oD(ae,Ce){var pe=ae.length;for(ae.sort(Ce);pe--;)ae[pe]=ae[pe].value;return ae}function xf(ae,Ce){for(var pe,Ge=-1,tr=ae.length;++Ge<tr;){var br=Ce(ae[Ge]);br!==t&&(pe=pe===t?br:pe+br)}return pe}function Ef(ae,Ce){for(var pe=-1,Ge=Array(ae);++pe<ae;)Ge[pe]=Ce(pe);return Ge}function sD(ae,Ce){return Or(Ce,function(pe){return[pe,ae[pe]]})}function ib(ae){return ae&&ae.slice(0,lb(ae)+1).replace(Nr,"")}function Kt(ae){return function(Ce){return ae(Ce)}}function Cf(ae,Ce){return Or(Ce,function(pe){return ae[pe]})}function So(ae,Ce){return ae.has(Ce)}function ob(ae,Ce){for(var pe=-1,Ge=ae.length;++pe<Ge&&Ii(Ce,ae[pe],0)>-1;);return pe}function sb(ae,Ce){for(var pe=ae.length;pe--&&Ii(Ce,ae[pe],0)>-1;);return pe}function uD(ae,Ce){for(var pe=ae.length,Ge=0;pe--;)ae[pe]===Ce&&++Ge;return Ge}var lD=wf(HI),fD=wf(KI);function cD(ae){return"\\"+YI[ae]}function dD(ae,Ce){return ae==null?t:ae[Ce]}function Di(ae){return VI.test(ae)}function vD(ae){return GI.test(ae)}function hD(ae){for(var Ce,pe=[];!(Ce=ae.next()).done;)pe.push(Ce.value);return pe}function _f(ae){var Ce=-1,pe=Array(ae.size);return ae.forEach(function(Ge,tr){pe[++Ce]=[tr,Ge]}),pe}function ub(ae,Ce){return function(pe){return ae(Ce(pe))}}function va(ae,Ce){for(var pe=-1,Ge=ae.length,tr=0,br=[];++pe<Ge;){var Jr=ae[pe];(Jr===Ce||Jr===f)&&(ae[pe]=f,br[tr++]=pe)}return br}function Vs(ae){var Ce=-1,pe=Array(ae.size);return ae.forEach(function(Ge){pe[++Ce]=Ge}),pe}function gD(ae){var Ce=-1,pe=Array(ae.size);return ae.forEach(function(Ge){pe[++Ce]=[Ge,Ge]}),pe}function pD(ae,Ce,pe){for(var Ge=pe-1,tr=ae.length;++Ge<tr;)if(ae[Ge]===Ce)return Ge;return-1}function yD(ae,Ce,pe){for(var Ge=pe+1;Ge--;)if(ae[Ge]===Ce)return Ge;return Ge}function Bi(ae){return Di(ae)?bD(ae):tD(ae)}function mn(ae){return Di(ae)?wD(ae):nD(ae)}function lb(ae){for(var Ce=ae.length;Ce--&&Qr.test(ae.charAt(Ce)););return Ce}var mD=wf(jI);function bD(ae){for(var Ce=vf.lastIndex=0;vf.test(ae);)++Ce;return Ce}function wD(ae){return ae.match(vf)||[]}function xD(ae){return ae.match($I)||[]}var ED=(function ae(Ce){Ce=Ce==null?vt:Mi.defaults(vt.Object(),Ce,Mi.pick(vt,WI));var pe=Ce.Array,Ge=Ce.Date,tr=Ce.Error,br=Ce.Function,Jr=Ce.Math,Sr=Ce.Object,Sf=Ce.RegExp,CD=Ce.String,an=Ce.TypeError,Gs=pe.prototype,_D=br.prototype,Li=Sr.prototype,Ws=Ce["__core-js_shared__"],Us=_D.toString,wr=Li.hasOwnProperty,SD=0,fb=(function(){var c=/[^.]+$/.exec(Ws&&Ws.keys&&Ws.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""})(),Hs=Li.toString,TD=Us.call(Sr),RD=vt._,AD=Sf("^"+Us.call(wr).replace(Lr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ks=K0?Ce.Buffer:t,ha=Ce.Symbol,js=Ce.Uint8Array,cb=Ks?Ks.allocUnsafe:t,Ys=ub(Sr.getPrototypeOf,Sr),db=Sr.create,vb=Li.propertyIsEnumerable,Xs=Gs.splice,hb=ha?ha.isConcatSpreadable:t,To=ha?ha.iterator:t,Ha=ha?ha.toStringTag:t,Zs=(function(){try{var c=Za(Sr,"defineProperty");return c({},"",{}),c}catch{}})(),PD=Ce.clearTimeout!==vt.clearTimeout&&Ce.clearTimeout,ID=Ge&&Ge.now!==vt.Date.now&&Ge.now,DD=Ce.setTimeout!==vt.setTimeout&&Ce.setTimeout,Qs=Jr.ceil,Js=Jr.floor,Tf=Sr.getOwnPropertySymbols,BD=Ks?Ks.isBuffer:t,gb=Ce.isFinite,MD=Gs.join,LD=ub(Sr.keys,Sr),et=Jr.max,Ct=Jr.min,OD=Ge.now,kD=Ce.parseInt,pb=Jr.random,qD=Gs.reverse,Rf=Za(Ce,"DataView"),Ro=Za(Ce,"Map"),Af=Za(Ce,"Promise"),Oi=Za(Ce,"Set"),Ao=Za(Ce,"WeakMap"),Po=Za(Sr,"create"),eu=Ao&&new Ao,ki={},ND=Qa(Rf),FD=Qa(Ro),zD=Qa(Af),$D=Qa(Oi),VD=Qa(Ao),ru=ha?ha.prototype:t,Io=ru?ru.valueOf:t,yb=ru?ru.toString:t;function k(c){if(Gr(c)&&!nr(c)&&!(c instanceof vr)){if(c instanceof on)return c;if(wr.call(c,"__wrapped__"))return m1(c)}return new on(c)}var qi=(function(){function c(){}return function(v){if(!Fr(v))return{};if(db)return db(v);c.prototype=v;var m=new c;return c.prototype=t,m}})();function tu(){}function on(c,v){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!v,this.__index__=0,this.__values__=t}k.templateSettings={escape:Ke,evaluate:lr,interpolate:ir,variable:"",imports:{_:k}},k.prototype=tu.prototype,k.prototype.constructor=k,on.prototype=qi(tu.prototype),on.prototype.constructor=on;function vr(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=K,this.__views__=[]}function GD(){var c=new vr(this.__wrapped__);return c.__actions__=qt(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=qt(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=qt(this.__views__),c}function WD(){if(this.__filtered__){var c=new vr(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function UD(){var c=this.__wrapped__.value(),v=this.__dir__,m=nr(c),T=v<0,B=m?c.length:0,F=nM(0,B,this.__views__),U=F.start,J=F.end,se=J-U,Pe=T?J:U-1,Ie=this.__iteratees__,Le=Ie.length,Fe=0,je=Ct(se,this.__takeCount__);if(!m||!T&&B==se&&je==se)return $b(c,this.__actions__);var Je=[];e:for(;se--&&Fe<je;){Pe+=v;for(var ur=-1,er=c[Pe];++ur<Le;){var dr=Ie[ur],hr=dr.iteratee,Xt=dr.type,Bt=hr(er);if(Xt==N)er=Bt;else if(!Bt){if(Xt==q)continue e;break e}}Je[Fe++]=er}return Je}vr.prototype=qi(tu.prototype),vr.prototype.constructor=vr;function Ka(c){var v=-1,m=c==null?0:c.length;for(this.clear();++v<m;){var T=c[v];this.set(T[0],T[1])}}function HD(){this.__data__=Po?Po(null):{},this.size=0}function KD(c){var v=this.has(c)&&delete this.__data__[c];return this.size-=v?1:0,v}function jD(c){var v=this.__data__;if(Po){var m=v[c];return m===u?t:m}return wr.call(v,c)?v[c]:t}function YD(c){var v=this.__data__;return Po?v[c]!==t:wr.call(v,c)}function XD(c,v){var m=this.__data__;return this.size+=this.has(c)?0:1,m[c]=Po&&v===t?u:v,this}Ka.prototype.clear=HD,Ka.prototype.delete=KD,Ka.prototype.get=jD,Ka.prototype.has=YD,Ka.prototype.set=XD;function Wn(c){var v=-1,m=c==null?0:c.length;for(this.clear();++v<m;){var T=c[v];this.set(T[0],T[1])}}function ZD(){this.__data__=[],this.size=0}function QD(c){var v=this.__data__,m=nu(v,c);if(m<0)return!1;var T=v.length-1;return m==T?v.pop():Xs.call(v,m,1),--this.size,!0}function JD(c){var v=this.__data__,m=nu(v,c);return m<0?t:v[m][1]}function eB(c){return nu(this.__data__,c)>-1}function rB(c,v){var m=this.__data__,T=nu(m,c);return T<0?(++this.size,m.push([c,v])):m[T][1]=v,this}Wn.prototype.clear=ZD,Wn.prototype.delete=QD,Wn.prototype.get=JD,Wn.prototype.has=eB,Wn.prototype.set=rB;function Un(c){var v=-1,m=c==null?0:c.length;for(this.clear();++v<m;){var T=c[v];this.set(T[0],T[1])}}function tB(){this.size=0,this.__data__={hash:new Ka,map:new(Ro||Wn),string:new Ka}}function nB(c){var v=gu(this,c).delete(c);return this.size-=v?1:0,v}function aB(c){return gu(this,c).get(c)}function iB(c){return gu(this,c).has(c)}function oB(c,v){var m=gu(this,c),T=m.size;return m.set(c,v),this.size+=m.size==T?0:1,this}Un.prototype.clear=tB,Un.prototype.delete=nB,Un.prototype.get=aB,Un.prototype.has=iB,Un.prototype.set=oB;function ja(c){var v=-1,m=c==null?0:c.length;for(this.__data__=new Un;++v<m;)this.add(c[v])}function sB(c){return this.__data__.set(c,u),this}function uB(c){return this.__data__.has(c)}ja.prototype.add=ja.prototype.push=sB,ja.prototype.has=uB;function bn(c){var v=this.__data__=new Wn(c);this.size=v.size}function lB(){this.__data__=new Wn,this.size=0}function fB(c){var v=this.__data__,m=v.delete(c);return this.size=v.size,m}function cB(c){return this.__data__.get(c)}function dB(c){return this.__data__.has(c)}function vB(c,v){var m=this.__data__;if(m instanceof Wn){var T=m.__data__;if(!Ro||T.length<a-1)return T.push([c,v]),this.size=++m.size,this;m=this.__data__=new Un(T)}return m.set(c,v),this.size=m.size,this}bn.prototype.clear=lB,bn.prototype.delete=fB,bn.prototype.get=cB,bn.prototype.has=dB,bn.prototype.set=vB;function mb(c,v){var m=nr(c),T=!m&&Ja(c),B=!m&&!T&&ba(c),F=!m&&!T&&!B&&$i(c),U=m||T||B||F,J=U?Ef(c.length,CD):[],se=J.length;for(var Pe in c)(v||wr.call(c,Pe))&&!(U&&(Pe=="length"||B&&(Pe=="offset"||Pe=="parent")||F&&(Pe=="buffer"||Pe=="byteLength"||Pe=="byteOffset")||Yn(Pe,se)))&&J.push(Pe);return J}function bb(c){var v=c.length;return v?c[Ff(0,v-1)]:t}function hB(c,v){return pu(qt(c),Ya(v,0,c.length))}function gB(c){return pu(qt(c))}function Pf(c,v,m){(m!==t&&!wn(c[v],m)||m===t&&!(v in c))&&Hn(c,v,m)}function Do(c,v,m){var T=c[v];(!(wr.call(c,v)&&wn(T,m))||m===t&&!(v in c))&&Hn(c,v,m)}function nu(c,v){for(var m=c.length;m--;)if(wn(c[m][0],v))return m;return-1}function pB(c,v,m,T){return ga(c,function(B,F,U){v(T,B,m(B),U)}),T}function wb(c,v){return c&&Dn(v,st(v),c)}function yB(c,v){return c&&Dn(v,Ft(v),c)}function Hn(c,v,m){v=="__proto__"&&Zs?Zs(c,v,{configurable:!0,enumerable:!0,value:m,writable:!0}):c[v]=m}function If(c,v){for(var m=-1,T=v.length,B=pe(T),F=c==null;++m<T;)B[m]=F?t:fc(c,v[m]);return B}function Ya(c,v,m){return c===c&&(m!==t&&(c=c<=m?c:m),v!==t&&(c=c>=v?c:v)),c}function sn(c,v,m,T,B,F){var U,J=v&d,se=v&h,Pe=v&g;if(m&&(U=B?m(c,T,B,F):m(c)),U!==t)return U;if(!Fr(c))return c;var Ie=nr(c);if(Ie){if(U=iM(c),!J)return qt(c,U)}else{var Le=_t(c),Fe=Le==ie||Le==de;if(ba(c))return Wb(c,J);if(Le==le||Le==z||Fe&&!B){if(U=se||Fe?{}:l1(c),!J)return se?jB(c,yB(U,c)):KB(c,wb(U,c))}else{if(!Rr[Le])return B?c:{};U=oM(c,Le,J)}}F||(F=new bn);var je=F.get(c);if(je)return je;F.set(c,U),N1(c)?c.forEach(function(er){U.add(sn(er,v,m,er,c,F))}):k1(c)&&c.forEach(function(er,dr){U.set(dr,sn(er,v,m,dr,c,F))});var Je=Pe?se?Xf:Yf:se?Ft:st,ur=Ie?t:Je(c);return nn(ur||c,function(er,dr){ur&&(dr=er,er=c[dr]),Do(U,dr,sn(er,v,m,dr,c,F))}),U}function mB(c){var v=st(c);return function(m){return xb(m,c,v)}}function xb(c,v,m){var T=m.length;if(c==null)return!T;for(c=Sr(c);T--;){var B=m[T],F=v[B],U=c[B];if(U===t&&!(B in c)||!F(U))return!1}return!0}function Eb(c,v,m){if(typeof c!="function")throw new an(o);return No(function(){c.apply(t,m)},v)}function Bo(c,v,m,T){var B=-1,F=zs,U=!0,J=c.length,se=[],Pe=v.length;if(!J)return se;m&&(v=Or(v,Kt(m))),T?(F=pf,U=!1):v.length>=a&&(F=So,U=!1,v=new ja(v));e:for(;++B<J;){var Ie=c[B],Le=m==null?Ie:m(Ie);if(Ie=T||Ie!==0?Ie:0,U&&Le===Le){for(var Fe=Pe;Fe--;)if(v[Fe]===Le)continue e;se.push(Ie)}else F(v,Le,T)||se.push(Ie)}return se}var ga=Yb(In),Cb=Yb(Bf,!0);function bB(c,v){var m=!0;return ga(c,function(T,B,F){return m=!!v(T,B,F),m}),m}function au(c,v,m){for(var T=-1,B=c.length;++T<B;){var F=c[T],U=v(F);if(U!=null&&(J===t?U===U&&!Yt(U):m(U,J)))var J=U,se=F}return se}function wB(c,v,m,T){var B=c.length;for(m=or(m),m<0&&(m=-m>B?0:B+m),T=T===t||T>B?B:or(T),T<0&&(T+=B),T=m>T?0:z1(T);m<T;)c[m++]=v;return c}function _b(c,v){var m=[];return ga(c,function(T,B,F){v(T,B,F)&&m.push(T)}),m}function ht(c,v,m,T,B){var F=-1,U=c.length;for(m||(m=uM),B||(B=[]);++F<U;){var J=c[F];v>0&&m(J)?v>1?ht(J,v-1,m,T,B):da(B,J):T||(B[B.length]=J)}return B}var Df=Xb(),Sb=Xb(!0);function In(c,v){return c&&Df(c,v,st)}function Bf(c,v){return c&&Sb(c,v,st)}function iu(c,v){return ca(v,function(m){return Xn(c[m])})}function Xa(c,v){v=ya(v,c);for(var m=0,T=v.length;c!=null&&m<T;)c=c[Bn(v[m++])];return m&&m==T?c:t}function Tb(c,v,m){var T=v(c);return nr(c)?T:da(T,m(c))}function It(c){return c==null?c===t?me:ve:Ha&&Ha in Sr(c)?tM(c):gM(c)}function Mf(c,v){return c>v}function xB(c,v){return c!=null&&wr.call(c,v)}function EB(c,v){return c!=null&&v in Sr(c)}function CB(c,v,m){return c>=Ct(v,m)&&c<et(v,m)}function Lf(c,v,m){for(var T=m?pf:zs,B=c[0].length,F=c.length,U=F,J=pe(F),se=1/0,Pe=[];U--;){var Ie=c[U];U&&v&&(Ie=Or(Ie,Kt(v))),se=Ct(Ie.length,se),J[U]=!m&&(v||B>=120&&Ie.length>=120)?new ja(U&&Ie):t}Ie=c[0];var Le=-1,Fe=J[0];e:for(;++Le<B&&Pe.length<se;){var je=Ie[Le],Je=v?v(je):je;if(je=m||je!==0?je:0,!(Fe?So(Fe,Je):T(Pe,Je,m))){for(U=F;--U;){var ur=J[U];if(!(ur?So(ur,Je):T(c[U],Je,m)))continue e}Fe&&Fe.push(Je),Pe.push(je)}}return Pe}function _B(c,v,m,T){return In(c,function(B,F,U){v(T,m(B),F,U)}),T}function Mo(c,v,m){v=ya(v,c),c=v1(c,v);var T=c==null?c:c[Bn(ln(v))];return T==null?t:Ht(T,c,m)}function Rb(c){return Gr(c)&&It(c)==z}function SB(c){return Gr(c)&&It(c)==Ne}function TB(c){return Gr(c)&&It(c)==oe}function Lo(c,v,m,T,B){return c===v?!0:c==null||v==null||!Gr(c)&&!Gr(v)?c!==c&&v!==v:RB(c,v,m,T,Lo,B)}function RB(c,v,m,T,B,F){var U=nr(c),J=nr(v),se=U?Y:_t(c),Pe=J?Y:_t(v);se=se==z?le:se,Pe=Pe==z?le:Pe;var Ie=se==le,Le=Pe==le,Fe=se==Pe;if(Fe&&ba(c)){if(!ba(v))return!1;U=!0,Ie=!1}if(Fe&&!Ie)return F||(F=new bn),U||$i(c)?o1(c,v,m,T,B,F):eM(c,v,se,m,T,B,F);if(!(m&p)){var je=Ie&&wr.call(c,"__wrapped__"),Je=Le&&wr.call(v,"__wrapped__");if(je||Je){var ur=je?c.value():c,er=Je?v.value():v;return F||(F=new bn),B(ur,er,m,T,F)}}return Fe?(F||(F=new bn),rM(c,v,m,T,B,F)):!1}function AB(c){return Gr(c)&&_t(c)==we}function Of(c,v,m,T){var B=m.length,F=B,U=!T;if(c==null)return!F;for(c=Sr(c);B--;){var J=m[B];if(U&&J[2]?J[1]!==c[J[0]]:!(J[0]in c))return!1}for(;++B<F;){J=m[B];var se=J[0],Pe=c[se],Ie=J[1];if(U&&J[2]){if(Pe===t&&!(se in c))return!1}else{var Le=new bn;if(T)var Fe=T(Pe,Ie,se,c,v,Le);if(!(Fe===t?Lo(Ie,Pe,p|x,T,Le):Fe))return!1}}return!0}function Ab(c){if(!Fr(c)||fM(c))return!1;var v=Xn(c)?AD:Ga;return v.test(Qa(c))}function PB(c){return Gr(c)&&It(c)==Ee}function IB(c){return Gr(c)&&_t(c)==re}function DB(c){return Gr(c)&&Eu(c.length)&&!!Dr[It(c)]}function Pb(c){return typeof c=="function"?c:c==null?zt:typeof c=="object"?nr(c)?Bb(c[0],c[1]):Db(c):Z1(c)}function kf(c){if(!qo(c))return LD(c);var v=[];for(var m in Sr(c))wr.call(c,m)&&m!="constructor"&&v.push(m);return v}function BB(c){if(!Fr(c))return hM(c);var v=qo(c),m=[];for(var T in c)T=="constructor"&&(v||!wr.call(c,T))||m.push(T);return m}function qf(c,v){return c<v}function Ib(c,v){var m=-1,T=Nt(c)?pe(c.length):[];return ga(c,function(B,F,U){T[++m]=v(B,F,U)}),T}function Db(c){var v=Qf(c);return v.length==1&&v[0][2]?c1(v[0][0],v[0][1]):function(m){return m===c||Of(m,c,v)}}function Bb(c,v){return ec(c)&&f1(v)?c1(Bn(c),v):function(m){var T=fc(m,c);return T===t&&T===v?cc(m,c):Lo(v,T,p|x)}}function ou(c,v,m,T,B){c!==v&&Df(v,function(F,U){if(B||(B=new bn),Fr(F))MB(c,v,U,m,ou,T,B);else{var J=T?T(tc(c,U),F,U+"",c,v,B):t;J===t&&(J=F),Pf(c,U,J)}},Ft)}function MB(c,v,m,T,B,F,U){var J=tc(c,m),se=tc(v,m),Pe=U.get(se);if(Pe){Pf(c,m,Pe);return}var Ie=F?F(J,se,m+"",c,v,U):t,Le=Ie===t;if(Le){var Fe=nr(se),je=!Fe&&ba(se),Je=!Fe&&!je&&$i(se);Ie=se,Fe||je||Je?nr(J)?Ie=J:Hr(J)?Ie=qt(J):je?(Le=!1,Ie=Wb(se,!0)):Je?(Le=!1,Ie=Ub(se,!0)):Ie=[]:Fo(se)||Ja(se)?(Ie=J,Ja(J)?Ie=$1(J):(!Fr(J)||Xn(J))&&(Ie=l1(se))):Le=!1}Le&&(U.set(se,Ie),B(Ie,se,T,F,U),U.delete(se)),Pf(c,m,Ie)}function Mb(c,v){var m=c.length;if(m)return v+=v<0?m:0,Yn(v,m)?c[v]:t}function Lb(c,v,m){v.length?v=Or(v,function(F){return nr(F)?function(U){return Xa(U,F.length===1?F[0]:F)}:F}):v=[zt];var T=-1;v=Or(v,Kt(Qe()));var B=Ib(c,function(F,U,J){var se=Or(v,function(Pe){return Pe(F)});return{criteria:se,index:++T,value:F}});return oD(B,function(F,U){return HB(F,U,m)})}function LB(c,v){return Ob(c,v,function(m,T){return cc(c,T)})}function Ob(c,v,m){for(var T=-1,B=v.length,F={};++T<B;){var U=v[T],J=Xa(c,U);m(J,U)&&Oo(F,ya(U,c),J)}return F}function OB(c){return function(v){return Xa(v,c)}}function Nf(c,v,m,T){var B=T?iD:Ii,F=-1,U=v.length,J=c;for(c===v&&(v=qt(v)),m&&(J=Or(c,Kt(m)));++F<U;)for(var se=0,Pe=v[F],Ie=m?m(Pe):Pe;(se=B(J,Ie,se,T))>-1;)J!==c&&Xs.call(J,se,1),Xs.call(c,se,1);return c}function kb(c,v){for(var m=c?v.length:0,T=m-1;m--;){var B=v[m];if(m==T||B!==F){var F=B;Yn(B)?Xs.call(c,B,1):Vf(c,B)}}return c}function Ff(c,v){return c+Js(pb()*(v-c+1))}function kB(c,v,m,T){for(var B=-1,F=et(Qs((v-c)/(m||1)),0),U=pe(F);F--;)U[T?F:++B]=c,c+=m;return U}function zf(c,v){var m="";if(!c||v<1||v>$)return m;do v%2&&(m+=c),v=Js(v/2),v&&(c+=c);while(v);return m}function fr(c,v){return nc(d1(c,v,zt),c+"")}function qB(c){return bb(Vi(c))}function NB(c,v){var m=Vi(c);return pu(m,Ya(v,0,m.length))}function Oo(c,v,m,T){if(!Fr(c))return c;v=ya(v,c);for(var B=-1,F=v.length,U=F-1,J=c;J!=null&&++B<F;){var se=Bn(v[B]),Pe=m;if(se==="__proto__"||se==="constructor"||se==="prototype")return c;if(B!=U){var Ie=J[se];Pe=T?T(Ie,se,J):t,Pe===t&&(Pe=Fr(Ie)?Ie:Yn(v[B+1])?[]:{})}Do(J,se,Pe),J=J[se]}return c}var qb=eu?function(c,v){return eu.set(c,v),c}:zt,FB=Zs?function(c,v){return Zs(c,"toString",{configurable:!0,enumerable:!1,value:vc(v),writable:!0})}:zt;function zB(c){return pu(Vi(c))}function un(c,v,m){var T=-1,B=c.length;v<0&&(v=-v>B?0:B+v),m=m>B?B:m,m<0&&(m+=B),B=v>m?0:m-v>>>0,v>>>=0;for(var F=pe(B);++T<B;)F[T]=c[T+v];return F}function $B(c,v){var m;return ga(c,function(T,B,F){return m=v(T,B,F),!m}),!!m}function su(c,v,m){var T=0,B=c==null?T:c.length;if(typeof v=="number"&&v===v&&B<=fe){for(;T<B;){var F=T+B>>>1,U=c[F];U!==null&&!Yt(U)&&(m?U<=v:U<v)?T=F+1:B=F}return B}return $f(c,v,zt,m)}function $f(c,v,m,T){var B=0,F=c==null?0:c.length;if(F===0)return 0;v=m(v);for(var U=v!==v,J=v===null,se=Yt(v),Pe=v===t;B<F;){var Ie=Js((B+F)/2),Le=m(c[Ie]),Fe=Le!==t,je=Le===null,Je=Le===Le,ur=Yt(Le);if(U)var er=T||Je;else Pe?er=Je&&(T||Fe):J?er=Je&&Fe&&(T||!je):se?er=Je&&Fe&&!je&&(T||!ur):je||ur?er=!1:er=T?Le<=v:Le<v;er?B=Ie+1:F=Ie}return Ct(F,j)}function Nb(c,v){for(var m=-1,T=c.length,B=0,F=[];++m<T;){var U=c[m],J=v?v(U):U;if(!m||!wn(J,se)){var se=J;F[B++]=U===0?0:U}}return F}function Fb(c){return typeof c=="number"?c:Yt(c)?ee:+c}function jt(c){if(typeof c=="string")return c;if(nr(c))return Or(c,jt)+"";if(Yt(c))return yb?yb.call(c):"";var v=c+"";return v=="0"&&1/c==-V?"-0":v}function pa(c,v,m){var T=-1,B=zs,F=c.length,U=!0,J=[],se=J;if(m)U=!1,B=pf;else if(F>=a){var Pe=v?null:QB(c);if(Pe)return Vs(Pe);U=!1,B=So,se=new ja}else se=v?[]:J;e:for(;++T<F;){var Ie=c[T],Le=v?v(Ie):Ie;if(Ie=m||Ie!==0?Ie:0,U&&Le===Le){for(var Fe=se.length;Fe--;)if(se[Fe]===Le)continue e;v&&se.push(Le),J.push(Ie)}else B(se,Le,m)||(se!==J&&se.push(Le),J.push(Ie))}return J}function Vf(c,v){v=ya(v,c);var m=-1,T=v.length;if(!T)return!0;for(var B=c==null||typeof c!="object"&&typeof c!="function";++m<T;){var F=v[m];if(typeof F=="string"){if(F==="__proto__"&&!wr.call(c,"__proto__"))return!1;if(F==="constructor"&&m+1<T&&typeof v[m+1]=="string"&&v[m+1]==="prototype"){if(B&&m===0)continue;return!1}}}var U=v1(c,v);return U==null||delete U[Bn(ln(v))]}function zb(c,v,m,T){return Oo(c,v,m(Xa(c,v)),T)}function uu(c,v,m,T){for(var B=c.length,F=T?B:-1;(T?F--:++F<B)&&v(c[F],F,c););return m?un(c,T?0:F,T?F+1:B):un(c,T?F+1:0,T?B:F)}function $b(c,v){var m=c;return m instanceof vr&&(m=m.value()),yf(v,function(T,B){return B.func.apply(B.thisArg,da([T],B.args))},m)}function Gf(c,v,m){var T=c.length;if(T<2)return T?pa(c[0]):[];for(var B=-1,F=pe(T);++B<T;)for(var U=c[B],J=-1;++J<T;)J!=B&&(F[B]=Bo(F[B]||U,c[J],v,m));return pa(ht(F,1),v,m)}function Vb(c,v,m){for(var T=-1,B=c.length,F=v.length,U={};++T<B;){var J=T<F?v[T]:t;m(U,c[T],J)}return U}function Wf(c){return Hr(c)?c:[]}function Uf(c){return typeof c=="function"?c:zt}function ya(c,v){return nr(c)?c:ec(c,v)?[c]:y1(xr(c))}var VB=fr;function ma(c,v,m){var T=c.length;return m=m===t?T:m,!v&&m>=T?c:un(c,v,m)}var Gb=PD||function(c){return vt.clearTimeout(c)};function Wb(c,v){if(v)return c.slice();var m=c.length,T=cb?cb(m):new c.constructor(m);return c.copy(T),T}function Hf(c){var v=new c.constructor(c.byteLength);return new js(v).set(new js(c)),v}function GB(c,v){var m=v?Hf(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.byteLength)}function WB(c){var v=new c.constructor(c.source,dt.exec(c));return v.lastIndex=c.lastIndex,v}function UB(c){return Io?Sr(Io.call(c)):{}}function Ub(c,v){var m=v?Hf(c.buffer):c.buffer;return new c.constructor(m,c.byteOffset,c.length)}function Hb(c,v){if(c!==v){var m=c!==t,T=c===null,B=c===c,F=Yt(c),U=v!==t,J=v===null,se=v===v,Pe=Yt(v);if(!J&&!Pe&&!F&&c>v||F&&U&&se&&!J&&!Pe||T&&U&&se||!m&&se||!B)return 1;if(!T&&!F&&!Pe&&c<v||Pe&&m&&B&&!T&&!F||J&&m&&B||!U&&B||!se)return-1}return 0}function HB(c,v,m){for(var T=-1,B=c.criteria,F=v.criteria,U=B.length,J=m.length;++T<U;){var se=Hb(B[T],F[T]);if(se){if(T>=J)return se;var Pe=m[T];return se*(Pe=="desc"?-1:1)}}return c.index-v.index}function Kb(c,v,m,T){for(var B=-1,F=c.length,U=m.length,J=-1,se=v.length,Pe=et(F-U,0),Ie=pe(se+Pe),Le=!T;++J<se;)Ie[J]=v[J];for(;++B<U;)(Le||B<F)&&(Ie[m[B]]=c[B]);for(;Pe--;)Ie[J++]=c[B++];return Ie}function jb(c,v,m,T){for(var B=-1,F=c.length,U=-1,J=m.length,se=-1,Pe=v.length,Ie=et(F-J,0),Le=pe(Ie+Pe),Fe=!T;++B<Ie;)Le[B]=c[B];for(var je=B;++se<Pe;)Le[je+se]=v[se];for(;++U<J;)(Fe||B<F)&&(Le[je+m[U]]=c[B++]);return Le}function qt(c,v){var m=-1,T=c.length;for(v||(v=pe(T));++m<T;)v[m]=c[m];return v}function Dn(c,v,m,T){var B=!m;m||(m={});for(var F=-1,U=v.length;++F<U;){var J=v[F],se=T?T(m[J],c[J],J,m,c):t;se===t&&(se=c[J]),B?Hn(m,J,se):Do(m,J,se)}return m}function KB(c,v){return Dn(c,Jf(c),v)}function jB(c,v){return Dn(c,s1(c),v)}function lu(c,v){return function(m,T){var B=nr(m)?JI:pB,F=v?v():{};return B(m,c,Qe(T,2),F)}}function Ni(c){return fr(function(v,m){var T=-1,B=m.length,F=B>1?m[B-1]:t,U=B>2?m[2]:t;for(F=c.length>3&&typeof F=="function"?(B--,F):t,U&&Dt(m[0],m[1],U)&&(F=B<3?t:F,B=1),v=Sr(v);++T<B;){var J=m[T];J&&c(v,J,T,F)}return v})}function Yb(c,v){return function(m,T){if(m==null)return m;if(!Nt(m))return c(m,T);for(var B=m.length,F=v?B:-1,U=Sr(m);(v?F--:++F<B)&&T(U[F],F,U)!==!1;);return m}}function Xb(c){return function(v,m,T){for(var B=-1,F=Sr(v),U=T(v),J=U.length;J--;){var se=U[c?J:++B];if(m(F[se],se,F)===!1)break}return v}}function YB(c,v,m){var T=v&b,B=ko(c);function F(){var U=this&&this!==vt&&this instanceof F?B:c;return U.apply(T?m:this,arguments)}return F}function Zb(c){return function(v){v=xr(v);var m=Di(v)?mn(v):t,T=m?m[0]:v.charAt(0),B=m?ma(m,1).join(""):v.slice(1);return T[c]()+B}}function Fi(c){return function(v){return yf(Y1(j1(v).replace(FI,"")),c,"")}}function ko(c){return function(){var v=arguments;switch(v.length){case 0:return new c;case 1:return new c(v[0]);case 2:return new c(v[0],v[1]);case 3:return new c(v[0],v[1],v[2]);case 4:return new c(v[0],v[1],v[2],v[3]);case 5:return new c(v[0],v[1],v[2],v[3],v[4]);case 6:return new c(v[0],v[1],v[2],v[3],v[4],v[5]);case 7:return new c(v[0],v[1],v[2],v[3],v[4],v[5],v[6])}var m=qi(c.prototype),T=c.apply(m,v);return Fr(T)?T:m}}function XB(c,v,m){var T=ko(c);function B(){for(var F=arguments.length,U=pe(F),J=F,se=zi(B);J--;)U[J]=arguments[J];var Pe=F<3&&U[0]!==se&&U[F-1]!==se?[]:va(U,se);if(F-=Pe.length,F<m)return t1(c,v,fu,B.placeholder,t,U,Pe,t,t,m-F);var Ie=this&&this!==vt&&this instanceof B?T:c;return Ht(Ie,this,U)}return B}function Qb(c){return function(v,m,T){var B=Sr(v);if(!Nt(v)){var F=Qe(m,3);v=st(v),m=function(J){return F(B[J],J,B)}}var U=c(v,m,T);return U>-1?B[F?v[U]:U]:t}}function Jb(c){return jn(function(v){var m=v.length,T=m,B=on.prototype.thru;for(c&&v.reverse();T--;){var F=v[T];if(typeof F!="function")throw new an(o);if(B&&!U&&hu(F)=="wrapper")var U=new on([],!0)}for(T=U?T:m;++T<m;){F=v[T];var J=hu(F),se=J=="wrapper"?Zf(F):t;se&&rc(se[0])&&se[1]==(_|E|S|A)&&!se[4].length&&se[9]==1?U=U[hu(se[0])].apply(U,se[3]):U=F.length==1&&rc(F)?U[J]():U.thru(F)}return function(){var Pe=arguments,Ie=Pe[0];if(U&&Pe.length==1&&nr(Ie))return U.plant(Ie).value();for(var Le=0,Fe=m?v[Le].apply(this,Pe):Ie;++Le<m;)Fe=v[Le].call(this,Fe);return Fe}})}function fu(c,v,m,T,B,F,U,J,se,Pe){var Ie=v&_,Le=v&b,Fe=v&w,je=v&(E|C),Je=v&P,ur=Fe?t:ko(c);function er(){for(var dr=arguments.length,hr=pe(dr),Xt=dr;Xt--;)hr[Xt]=arguments[Xt];if(je)var Bt=zi(er),Zt=uD(hr,Bt);if(T&&(hr=Kb(hr,T,B,je)),F&&(hr=jb(hr,F,U,je)),dr-=Zt,je&&dr<Pe){var Kr=va(hr,Bt);return t1(c,v,fu,er.placeholder,m,hr,Kr,J,se,Pe-dr)}var xn=Le?m:this,Qn=Fe?xn[c]:c;return dr=hr.length,J?hr=pM(hr,J):Je&&dr>1&&hr.reverse(),Ie&&se<dr&&(hr.length=se),this&&this!==vt&&this instanceof er&&(Qn=ur||ko(Qn)),Qn.apply(xn,hr)}return er}function e1(c,v){return function(m,T){return _B(m,c,v(T),{})}}function cu(c,v){return function(m,T){var B;if(m===t&&T===t)return v;if(m!==t&&(B=m),T!==t){if(B===t)return T;typeof m=="string"||typeof T=="string"?(m=jt(m),T=jt(T)):(m=Fb(m),T=Fb(T)),B=c(m,T)}return B}}function Kf(c){return jn(function(v){return v=Or(v,Kt(Qe())),fr(function(m){var T=this;return c(v,function(B){return Ht(B,T,m)})})})}function du(c,v){v=v===t?" ":jt(v);var m=v.length;if(m<2)return m?zf(v,c):v;var T=zf(v,Qs(c/Bi(v)));return Di(v)?ma(mn(T),0,c).join(""):T.slice(0,c)}function ZB(c,v,m,T){var B=v&b,F=ko(c);function U(){for(var J=-1,se=arguments.length,Pe=-1,Ie=T.length,Le=pe(Ie+se),Fe=this&&this!==vt&&this instanceof U?F:c;++Pe<Ie;)Le[Pe]=T[Pe];for(;se--;)Le[Pe++]=arguments[++J];return Ht(Fe,B?m:this,Le)}return U}function r1(c){return function(v,m,T){return T&&typeof T!="number"&&Dt(v,m,T)&&(m=T=t),v=Zn(v),m===t?(m=v,v=0):m=Zn(m),T=T===t?v<m?1:-1:Zn(T),kB(v,m,T,c)}}function vu(c){return function(v,m){return typeof v=="string"&&typeof m=="string"||(v=fn(v),m=fn(m)),c(v,m)}}function t1(c,v,m,T,B,F,U,J,se,Pe){var Ie=v&E,Le=Ie?U:t,Fe=Ie?t:U,je=Ie?F:t,Je=Ie?t:F;v|=Ie?S:R,v&=~(Ie?R:S),v&y||(v&=-4);var ur=[c,v,B,je,Le,Je,Fe,J,se,Pe],er=m.apply(t,ur);return rc(c)&&h1(er,ur),er.placeholder=T,g1(er,c,v)}function jf(c){var v=Jr[c];return function(m,T){if(m=fn(m),T=T==null?0:Ct(or(T),292),T&&gb(m)){var B=(xr(m)+"e").split("e"),F=v(B[0]+"e"+(+B[1]+T));return B=(xr(F)+"e").split("e"),+(B[0]+"e"+(+B[1]-T))}return v(m)}}var QB=Oi&&1/Vs(new Oi([,-0]))[1]==V?function(c){return new Oi(c)}:pc;function n1(c){return function(v){var m=_t(v);return m==we?_f(v):m==re?gD(v):sD(v,c(v))}}function Kn(c,v,m,T,B,F,U,J){var se=v&w;if(!se&&typeof c!="function")throw new an(o);var Pe=T?T.length:0;if(Pe||(v&=-97,T=B=t),U=U===t?U:et(or(U),0),J=J===t?J:or(J),Pe-=B?B.length:0,v&R){var Ie=T,Le=B;T=B=t}var Fe=se?t:Zf(c),je=[c,v,m,T,B,Ie,Le,F,U,J];if(Fe&&vM(je,Fe),c=je[0],v=je[1],m=je[2],T=je[3],B=je[4],J=je[9]=je[9]===t?se?0:c.length:et(je[9]-Pe,0),!J&&v&(E|C)&&(v&=-25),!v||v==b)var Je=YB(c,v,m);else v==E||v==C?Je=XB(c,v,J):(v==S||v==(b|S))&&!B.length?Je=ZB(c,v,m,T):Je=fu.apply(t,je);var ur=Fe?qb:h1;return g1(ur(Je,je),c,v)}function a1(c,v,m,T){return c===t||wn(c,Li[m])&&!wr.call(T,m)?v:c}function i1(c,v,m,T,B,F){return Fr(c)&&Fr(v)&&(F.set(v,c),ou(c,v,t,i1,F),F.delete(v)),c}function JB(c){return Fo(c)?t:c}function o1(c,v,m,T,B,F){var U=m&p,J=c.length,se=v.length;if(J!=se&&!(U&&se>J))return!1;var Pe=F.get(c),Ie=F.get(v);if(Pe&&Ie)return Pe==v&&Ie==c;var Le=-1,Fe=!0,je=m&x?new ja:t;for(F.set(c,v),F.set(v,c);++Le<J;){var Je=c[Le],ur=v[Le];if(T)var er=U?T(ur,Je,Le,v,c,F):T(Je,ur,Le,c,v,F);if(er!==t){if(er)continue;Fe=!1;break}if(je){if(!mf(v,function(dr,hr){if(!So(je,hr)&&(Je===dr||B(Je,dr,m,T,F)))return je.push(hr)})){Fe=!1;break}}else if(!(Je===ur||B(Je,ur,m,T,F))){Fe=!1;break}}return F.delete(c),F.delete(v),Fe}function eM(c,v,m,T,B,F,U){switch(m){case ze:if(c.byteLength!=v.byteLength||c.byteOffset!=v.byteOffset)return!1;c=c.buffer,v=v.buffer;case Ne:return!(c.byteLength!=v.byteLength||!F(new js(c),new js(v)));case ue:case oe:case Ae:return wn(+c,+v);case Q:return c.name==v.name&&c.message==v.message;case Ee:case ce:return c==v+"";case we:var J=_f;case re:var se=T&p;if(J||(J=Vs),c.size!=v.size&&!se)return!1;var Pe=U.get(c);if(Pe)return Pe==v;T|=x,U.set(c,v);var Ie=o1(J(c),J(v),T,B,F,U);return U.delete(c),Ie;case _e:if(Io)return Io.call(c)==Io.call(v)}return!1}function rM(c,v,m,T,B,F){var U=m&p,J=Yf(c),se=J.length,Pe=Yf(v),Ie=Pe.length;if(se!=Ie&&!U)return!1;for(var Le=se;Le--;){var Fe=J[Le];if(!(U?Fe in v:wr.call(v,Fe)))return!1}var je=F.get(c),Je=F.get(v);if(je&&Je)return je==v&&Je==c;var ur=!0;F.set(c,v),F.set(v,c);for(var er=U;++Le<se;){Fe=J[Le];var dr=c[Fe],hr=v[Fe];if(T)var Xt=U?T(hr,dr,Fe,v,c,F):T(dr,hr,Fe,c,v,F);if(!(Xt===t?dr===hr||B(dr,hr,m,T,F):Xt)){ur=!1;break}er||(er=Fe=="constructor")}if(ur&&!er){var Bt=c.constructor,Zt=v.constructor;Bt!=Zt&&"constructor"in c&&"constructor"in v&&!(typeof Bt=="function"&&Bt instanceof Bt&&typeof Zt=="function"&&Zt instanceof Zt)&&(ur=!1)}return F.delete(c),F.delete(v),ur}function jn(c){return nc(d1(c,t,x1),c+"")}function Yf(c){return Tb(c,st,Jf)}function Xf(c){return Tb(c,Ft,s1)}var Zf=eu?function(c){return eu.get(c)}:pc;function hu(c){for(var v=c.name+"",m=ki[v],T=wr.call(ki,v)?m.length:0;T--;){var B=m[T],F=B.func;if(F==null||F==c)return B.name}return v}function zi(c){var v=wr.call(k,"placeholder")?k:c;return v.placeholder}function Qe(){var c=k.iteratee||hc;return c=c===hc?Pb:c,arguments.length?c(arguments[0],arguments[1]):c}function gu(c,v){var m=c.__data__;return lM(v)?m[typeof v=="string"?"string":"hash"]:m.map}function Qf(c){for(var v=st(c),m=v.length;m--;){var T=v[m],B=c[T];v[m]=[T,B,f1(B)]}return v}function Za(c,v){var m=dD(c,v);return Ab(m)?m:t}function tM(c){var v=wr.call(c,Ha),m=c[Ha];try{c[Ha]=t;var T=!0}catch{}var B=Hs.call(c);return T&&(v?c[Ha]=m:delete c[Ha]),B}var Jf=Tf?function(c){return c==null?[]:(c=Sr(c),ca(Tf(c),function(v){return vb.call(c,v)}))}:yc,s1=Tf?function(c){for(var v=[];c;)da(v,Jf(c)),c=Ys(c);return v}:yc,_t=It;(Rf&&_t(new Rf(new ArrayBuffer(1)))!=ze||Ro&&_t(new Ro)!=we||Af&&_t(Af.resolve())!=Me||Oi&&_t(new Oi)!=re||Ao&&_t(new Ao)!=Te)&&(_t=function(c){var v=It(c),m=v==le?c.constructor:t,T=m?Qa(m):"";if(T)switch(T){case ND:return ze;case FD:return we;case zD:return Me;case $D:return re;case VD:return Te}return v});function nM(c,v,m){for(var T=-1,B=m.length;++T<B;){var F=m[T],U=F.size;switch(F.type){case"drop":c+=U;break;case"dropRight":v-=U;break;case"take":v=Ct(v,c+U);break;case"takeRight":c=et(c,v-U);break}}return{start:c,end:v}}function aM(c){var v=c.match(Vr);return v?v[1].split(pn):[]}function u1(c,v,m){v=ya(v,c);for(var T=-1,B=v.length,F=!1;++T<B;){var U=Bn(v[T]);if(!(F=c!=null&&m(c,U)))break;c=c[U]}return F||++T!=B?F:(B=c==null?0:c.length,!!B&&Eu(B)&&Yn(U,B)&&(nr(c)||Ja(c)))}function iM(c){var v=c.length,m=new c.constructor(v);return v&&typeof c[0]=="string"&&wr.call(c,"index")&&(m.index=c.index,m.input=c.input),m}function l1(c){return typeof c.constructor=="function"&&!qo(c)?qi(Ys(c)):{}}function oM(c,v,m){var T=c.constructor;switch(v){case Ne:return Hf(c);case ue:case oe:return new T(+c);case ze:return GB(c,m);case $e:case ke:case Oe:case ye:case O:case ne:case he:case ge:case be:return Ub(c,m);case we:return new T;case Ae:case ce:return new T(c);case Ee:return WB(c);case re:return new T;case _e:return UB(c)}}function sM(c,v){var m=v.length;if(!m)return c;var T=m-1;return v[T]=(m>1?"& ":"")+v[T],v=v.join(m>2?", ":" "),c.replace(Pn,`{
|
|
9
|
+
/* [wrapped with `+v+`] */
|
|
10
|
+
`)}function uM(c){return nr(c)||Ja(c)||!!(hb&&c&&c[hb])}function Yn(c,v){var m=typeof c;return v=v??$,!!v&&(m=="number"||m!="symbol"&&qs.test(c))&&c>-1&&c%1==0&&c<v}function Dt(c,v,m){if(!Fr(m))return!1;var T=typeof v;return(T=="number"?Nt(m)&&Yn(v,m.length):T=="string"&&v in m)?wn(m[v],c):!1}function ec(c,v){if(nr(c))return!1;var m=typeof c;return m=="number"||m=="symbol"||m=="boolean"||c==null||Yt(c)?!0:Mr.test(c)||!Ur.test(c)||v!=null&&c in Sr(v)}function lM(c){var v=typeof c;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?c!=="__proto__":c===null}function rc(c){var v=hu(c),m=k[v];if(typeof m!="function"||!(v in vr.prototype))return!1;if(c===m)return!0;var T=Zf(m);return!!T&&c===T[0]}function fM(c){return!!fb&&fb in c}var cM=Ws?Xn:mc;function qo(c){var v=c&&c.constructor,m=typeof v=="function"&&v.prototype||Li;return c===m}function f1(c){return c===c&&!Fr(c)}function c1(c,v){return function(m){return m==null?!1:m[c]===v&&(v!==t||c in Sr(m))}}function dM(c){var v=wu(c,function(T){return m.size===l&&m.clear(),T}),m=v.cache;return v}function vM(c,v){var m=c[1],T=v[1],B=m|T,F=B<(b|w|_),U=T==_&&m==E||T==_&&m==A&&c[7].length<=v[8]||T==(_|A)&&v[7].length<=v[8]&&m==E;if(!(F||U))return c;T&b&&(c[2]=v[2],B|=m&b?0:y);var J=v[3];if(J){var se=c[3];c[3]=se?Kb(se,J,v[4]):J,c[4]=se?va(c[3],f):v[4]}return J=v[5],J&&(se=c[5],c[5]=se?jb(se,J,v[6]):J,c[6]=se?va(c[5],f):v[6]),J=v[7],J&&(c[7]=J),T&_&&(c[8]=c[8]==null?v[8]:Ct(c[8],v[8])),c[9]==null&&(c[9]=v[9]),c[0]=v[0],c[1]=B,c}function hM(c){var v=[];if(c!=null)for(var m in Sr(c))v.push(m);return v}function gM(c){return Hs.call(c)}function d1(c,v,m){return v=et(v===t?c.length-1:v,0),function(){for(var T=arguments,B=-1,F=et(T.length-v,0),U=pe(F);++B<F;)U[B]=T[v+B];B=-1;for(var J=pe(v+1);++B<v;)J[B]=T[B];return J[v]=m(U),Ht(c,this,J)}}function v1(c,v){return v.length<2?c:Xa(c,un(v,0,-1))}function pM(c,v){for(var m=c.length,T=Ct(v.length,m),B=qt(c);T--;){var F=v[T];c[T]=Yn(F,m)?B[F]:t}return c}function tc(c,v){if(!(v==="constructor"&&typeof c[v]=="function")&&v!="__proto__")return c[v]}var h1=p1(qb),No=DD||function(c,v){return vt.setTimeout(c,v)},nc=p1(FB);function g1(c,v,m){var T=v+"";return nc(c,sM(T,yM(aM(T),m)))}function p1(c){var v=0,m=0;return function(){var T=OD(),B=M-(T-m);if(m=T,B>0){if(++v>=L)return arguments[0]}else v=0;return c.apply(t,arguments)}}function pu(c,v){var m=-1,T=c.length,B=T-1;for(v=v===t?T:v;++m<v;){var F=Ff(m,B),U=c[F];c[F]=c[m],c[m]=U}return c.length=v,c}var y1=dM(function(c){var v=[];return c.charCodeAt(0)===46&&v.push(""),c.replace(ct,function(m,T,B,F){v.push(B?F.replace(Ci,"$1"):T||m)}),v});function Bn(c){if(typeof c=="string"||Yt(c))return c;var v=c+"";return v=="0"&&1/c==-V?"-0":v}function Qa(c){if(c!=null){try{return Us.call(c)}catch{}try{return c+""}catch{}}return""}function yM(c,v){return nn(G,function(m){var T="_."+m[0];v&m[1]&&!zs(c,T)&&c.push(T)}),c.sort()}function m1(c){if(c instanceof vr)return c.clone();var v=new on(c.__wrapped__,c.__chain__);return v.__actions__=qt(c.__actions__),v.__index__=c.__index__,v.__values__=c.__values__,v}function mM(c,v,m){(m?Dt(c,v,m):v===t)?v=1:v=et(or(v),0);var T=c==null?0:c.length;if(!T||v<1)return[];for(var B=0,F=0,U=pe(Qs(T/v));B<T;)U[F++]=un(c,B,B+=v);return U}function bM(c){for(var v=-1,m=c==null?0:c.length,T=0,B=[];++v<m;){var F=c[v];F&&(B[T++]=F)}return B}function wM(){var c=arguments.length;if(!c)return[];for(var v=pe(c-1),m=arguments[0],T=c;T--;)v[T-1]=arguments[T];return da(nr(m)?qt(m):[m],ht(v,1))}var xM=fr(function(c,v){return Hr(c)?Bo(c,ht(v,1,Hr,!0)):[]}),EM=fr(function(c,v){var m=ln(v);return Hr(m)&&(m=t),Hr(c)?Bo(c,ht(v,1,Hr,!0),Qe(m,2)):[]}),CM=fr(function(c,v){var m=ln(v);return Hr(m)&&(m=t),Hr(c)?Bo(c,ht(v,1,Hr,!0),t,m):[]});function _M(c,v,m){var T=c==null?0:c.length;return T?(v=m||v===t?1:or(v),un(c,v<0?0:v,T)):[]}function SM(c,v,m){var T=c==null?0:c.length;return T?(v=m||v===t?1:or(v),v=T-v,un(c,0,v<0?0:v)):[]}function TM(c,v){return c&&c.length?uu(c,Qe(v,3),!0,!0):[]}function RM(c,v){return c&&c.length?uu(c,Qe(v,3),!0):[]}function AM(c,v,m,T){var B=c==null?0:c.length;return B?(m&&typeof m!="number"&&Dt(c,v,m)&&(m=0,T=B),wB(c,v,m,T)):[]}function b1(c,v,m){var T=c==null?0:c.length;if(!T)return-1;var B=m==null?0:or(m);return B<0&&(B=et(T+B,0)),$s(c,Qe(v,3),B)}function w1(c,v,m){var T=c==null?0:c.length;if(!T)return-1;var B=T-1;return m!==t&&(B=or(m),B=m<0?et(T+B,0):Ct(B,T-1)),$s(c,Qe(v,3),B,!0)}function x1(c){var v=c==null?0:c.length;return v?ht(c,1):[]}function PM(c){var v=c==null?0:c.length;return v?ht(c,V):[]}function IM(c,v){var m=c==null?0:c.length;return m?(v=v===t?1:or(v),ht(c,v)):[]}function DM(c){for(var v=-1,m=c==null?0:c.length,T={};++v<m;){var B=c[v];T[B[0]]=B[1]}return T}function E1(c){return c&&c.length?c[0]:t}function BM(c,v,m){var T=c==null?0:c.length;if(!T)return-1;var B=m==null?0:or(m);return B<0&&(B=et(T+B,0)),Ii(c,v,B)}function MM(c){var v=c==null?0:c.length;return v?un(c,0,-1):[]}var LM=fr(function(c){var v=Or(c,Wf);return v.length&&v[0]===c[0]?Lf(v):[]}),OM=fr(function(c){var v=ln(c),m=Or(c,Wf);return v===ln(m)?v=t:m.pop(),m.length&&m[0]===c[0]?Lf(m,Qe(v,2)):[]}),kM=fr(function(c){var v=ln(c),m=Or(c,Wf);return v=typeof v=="function"?v:t,v&&m.pop(),m.length&&m[0]===c[0]?Lf(m,t,v):[]});function qM(c,v){return c==null?"":MD.call(c,v)}function ln(c){var v=c==null?0:c.length;return v?c[v-1]:t}function NM(c,v,m){var T=c==null?0:c.length;if(!T)return-1;var B=T;return m!==t&&(B=or(m),B=B<0?et(T+B,0):Ct(B,T-1)),v===v?yD(c,v,B):$s(c,tb,B,!0)}function FM(c,v){return c&&c.length?Mb(c,or(v)):t}var zM=fr(C1);function C1(c,v){return c&&c.length&&v&&v.length?Nf(c,v):c}function $M(c,v,m){return c&&c.length&&v&&v.length?Nf(c,v,Qe(m,2)):c}function VM(c,v,m){return c&&c.length&&v&&v.length?Nf(c,v,t,m):c}var GM=jn(function(c,v){var m=c==null?0:c.length,T=If(c,v);return kb(c,Or(v,function(B){return Yn(B,m)?+B:B}).sort(Hb)),T});function WM(c,v){var m=[];if(!(c&&c.length))return m;var T=-1,B=[],F=c.length;for(v=Qe(v,3);++T<F;){var U=c[T];v(U,T,c)&&(m.push(U),B.push(T))}return kb(c,B),m}function ac(c){return c==null?c:qD.call(c)}function UM(c,v,m){var T=c==null?0:c.length;return T?(m&&typeof m!="number"&&Dt(c,v,m)?(v=0,m=T):(v=v==null?0:or(v),m=m===t?T:or(m)),un(c,v,m)):[]}function HM(c,v){return su(c,v)}function KM(c,v,m){return $f(c,v,Qe(m,2))}function jM(c,v){var m=c==null?0:c.length;if(m){var T=su(c,v);if(T<m&&wn(c[T],v))return T}return-1}function YM(c,v){return su(c,v,!0)}function XM(c,v,m){return $f(c,v,Qe(m,2),!0)}function ZM(c,v){var m=c==null?0:c.length;if(m){var T=su(c,v,!0)-1;if(wn(c[T],v))return T}return-1}function QM(c){return c&&c.length?Nb(c):[]}function JM(c,v){return c&&c.length?Nb(c,Qe(v,2)):[]}function eL(c){var v=c==null?0:c.length;return v?un(c,1,v):[]}function rL(c,v,m){return c&&c.length?(v=m||v===t?1:or(v),un(c,0,v<0?0:v)):[]}function tL(c,v,m){var T=c==null?0:c.length;return T?(v=m||v===t?1:or(v),v=T-v,un(c,v<0?0:v,T)):[]}function nL(c,v){return c&&c.length?uu(c,Qe(v,3),!1,!0):[]}function aL(c,v){return c&&c.length?uu(c,Qe(v,3)):[]}var iL=fr(function(c){return pa(ht(c,1,Hr,!0))}),oL=fr(function(c){var v=ln(c);return Hr(v)&&(v=t),pa(ht(c,1,Hr,!0),Qe(v,2))}),sL=fr(function(c){var v=ln(c);return v=typeof v=="function"?v:t,pa(ht(c,1,Hr,!0),t,v)});function uL(c){return c&&c.length?pa(c):[]}function lL(c,v){return c&&c.length?pa(c,Qe(v,2)):[]}function fL(c,v){return v=typeof v=="function"?v:t,c&&c.length?pa(c,t,v):[]}function ic(c){if(!(c&&c.length))return[];var v=0;return c=ca(c,function(m){if(Hr(m))return v=et(m.length,v),!0}),Ef(v,function(m){return Or(c,bf(m))})}function _1(c,v){if(!(c&&c.length))return[];var m=ic(c);return v==null?m:Or(m,function(T){return Ht(v,t,T)})}var cL=fr(function(c,v){return Hr(c)?Bo(c,v):[]}),dL=fr(function(c){return Gf(ca(c,Hr))}),vL=fr(function(c){var v=ln(c);return Hr(v)&&(v=t),Gf(ca(c,Hr),Qe(v,2))}),hL=fr(function(c){var v=ln(c);return v=typeof v=="function"?v:t,Gf(ca(c,Hr),t,v)}),gL=fr(ic);function pL(c,v){return Vb(c||[],v||[],Do)}function yL(c,v){return Vb(c||[],v||[],Oo)}var mL=fr(function(c){var v=c.length,m=v>1?c[v-1]:t;return m=typeof m=="function"?(c.pop(),m):t,_1(c,m)});function S1(c){var v=k(c);return v.__chain__=!0,v}function bL(c,v){return v(c),c}function yu(c,v){return v(c)}var wL=jn(function(c){var v=c.length,m=v?c[0]:0,T=this.__wrapped__,B=function(F){return If(F,c)};return v>1||this.__actions__.length||!(T instanceof vr)||!Yn(m)?this.thru(B):(T=T.slice(m,+m+(v?1:0)),T.__actions__.push({func:yu,args:[B],thisArg:t}),new on(T,this.__chain__).thru(function(F){return v&&!F.length&&F.push(t),F}))});function xL(){return S1(this)}function EL(){return new on(this.value(),this.__chain__)}function CL(){this.__values__===t&&(this.__values__=F1(this.value()));var c=this.__index__>=this.__values__.length,v=c?t:this.__values__[this.__index__++];return{done:c,value:v}}function _L(){return this}function SL(c){for(var v,m=this;m instanceof tu;){var T=m1(m);T.__index__=0,T.__values__=t,v?B.__wrapped__=T:v=T;var B=T;m=m.__wrapped__}return B.__wrapped__=c,v}function TL(){var c=this.__wrapped__;if(c instanceof vr){var v=c;return this.__actions__.length&&(v=new vr(this)),v=v.reverse(),v.__actions__.push({func:yu,args:[ac],thisArg:t}),new on(v,this.__chain__)}return this.thru(ac)}function RL(){return $b(this.__wrapped__,this.__actions__)}var AL=lu(function(c,v,m){wr.call(c,m)?++c[m]:Hn(c,m,1)});function PL(c,v,m){var T=nr(c)?eb:bB;return m&&Dt(c,v,m)&&(v=t),T(c,Qe(v,3))}function IL(c,v){var m=nr(c)?ca:_b;return m(c,Qe(v,3))}var DL=Qb(b1),BL=Qb(w1);function ML(c,v){return ht(mu(c,v),1)}function LL(c,v){return ht(mu(c,v),V)}function OL(c,v,m){return m=m===t?1:or(m),ht(mu(c,v),m)}function T1(c,v){var m=nr(c)?nn:ga;return m(c,Qe(v,3))}function R1(c,v){var m=nr(c)?eD:Cb;return m(c,Qe(v,3))}var kL=lu(function(c,v,m){wr.call(c,m)?c[m].push(v):Hn(c,m,[v])});function qL(c,v,m,T){c=Nt(c)?c:Vi(c),m=m&&!T?or(m):0;var B=c.length;return m<0&&(m=et(B+m,0)),Cu(c)?m<=B&&c.indexOf(v,m)>-1:!!B&&Ii(c,v,m)>-1}var NL=fr(function(c,v,m){var T=-1,B=typeof v=="function",F=Nt(c)?pe(c.length):[];return ga(c,function(U){F[++T]=B?Ht(v,U,m):Mo(U,v,m)}),F}),FL=lu(function(c,v,m){Hn(c,m,v)});function mu(c,v){var m=nr(c)?Or:Ib;return m(c,Qe(v,3))}function zL(c,v,m,T){return c==null?[]:(nr(v)||(v=v==null?[]:[v]),m=T?t:m,nr(m)||(m=m==null?[]:[m]),Lb(c,v,m))}var $L=lu(function(c,v,m){c[m?0:1].push(v)},function(){return[[],[]]});function VL(c,v,m){var T=nr(c)?yf:ab,B=arguments.length<3;return T(c,Qe(v,4),m,B,ga)}function GL(c,v,m){var T=nr(c)?rD:ab,B=arguments.length<3;return T(c,Qe(v,4),m,B,Cb)}function WL(c,v){var m=nr(c)?ca:_b;return m(c,xu(Qe(v,3)))}function UL(c){var v=nr(c)?bb:qB;return v(c)}function HL(c,v,m){(m?Dt(c,v,m):v===t)?v=1:v=or(v);var T=nr(c)?hB:NB;return T(c,v)}function KL(c){var v=nr(c)?gB:zB;return v(c)}function jL(c){if(c==null)return 0;if(Nt(c))return Cu(c)?Bi(c):c.length;var v=_t(c);return v==we||v==re?c.size:kf(c).length}function YL(c,v,m){var T=nr(c)?mf:$B;return m&&Dt(c,v,m)&&(v=t),T(c,Qe(v,3))}var XL=fr(function(c,v){if(c==null)return[];var m=v.length;return m>1&&Dt(c,v[0],v[1])?v=[]:m>2&&Dt(v[0],v[1],v[2])&&(v=[v[0]]),Lb(c,ht(v,1),[])}),bu=ID||function(){return vt.Date.now()};function ZL(c,v){if(typeof v!="function")throw new an(o);return c=or(c),function(){if(--c<1)return v.apply(this,arguments)}}function A1(c,v,m){return v=m?t:v,v=c&&v==null?c.length:v,Kn(c,_,t,t,t,t,v)}function P1(c,v){var m;if(typeof v!="function")throw new an(o);return c=or(c),function(){return--c>0&&(m=v.apply(this,arguments)),c<=1&&(v=t),m}}var oc=fr(function(c,v,m){var T=b;if(m.length){var B=va(m,zi(oc));T|=S}return Kn(c,T,v,m,B)}),I1=fr(function(c,v,m){var T=b|w;if(m.length){var B=va(m,zi(I1));T|=S}return Kn(v,T,c,m,B)});function D1(c,v,m){v=m?t:v;var T=Kn(c,E,t,t,t,t,t,v);return T.placeholder=D1.placeholder,T}function B1(c,v,m){v=m?t:v;var T=Kn(c,C,t,t,t,t,t,v);return T.placeholder=B1.placeholder,T}function M1(c,v,m){var T,B,F,U,J,se,Pe=0,Ie=!1,Le=!1,Fe=!0;if(typeof c!="function")throw new an(o);v=fn(v)||0,Fr(m)&&(Ie=!!m.leading,Le="maxWait"in m,F=Le?et(fn(m.maxWait)||0,v):F,Fe="trailing"in m?!!m.trailing:Fe);function je(Kr){var xn=T,Qn=B;return T=B=t,Pe=Kr,U=c.apply(Qn,xn),U}function Je(Kr){return Pe=Kr,J=No(dr,v),Ie?je(Kr):U}function ur(Kr){var xn=Kr-se,Qn=Kr-Pe,Q1=v-xn;return Le?Ct(Q1,F-Qn):Q1}function er(Kr){var xn=Kr-se,Qn=Kr-Pe;return se===t||xn>=v||xn<0||Le&&Qn>=F}function dr(){var Kr=bu();if(er(Kr))return hr(Kr);J=No(dr,ur(Kr))}function hr(Kr){return J=t,Fe&&T?je(Kr):(T=B=t,U)}function Xt(){J!==t&&Gb(J),Pe=0,T=se=B=J=t}function Bt(){return J===t?U:hr(bu())}function Zt(){var Kr=bu(),xn=er(Kr);if(T=arguments,B=this,se=Kr,xn){if(J===t)return Je(se);if(Le)return Gb(J),J=No(dr,v),je(se)}return J===t&&(J=No(dr,v)),U}return Zt.cancel=Xt,Zt.flush=Bt,Zt}var QL=fr(function(c,v){return Eb(c,1,v)}),JL=fr(function(c,v,m){return Eb(c,fn(v)||0,m)});function eO(c){return Kn(c,P)}function wu(c,v){if(typeof c!="function"||v!=null&&typeof v!="function")throw new an(o);var m=function(){var T=arguments,B=v?v.apply(this,T):T[0],F=m.cache;if(F.has(B))return F.get(B);var U=c.apply(this,T);return m.cache=F.set(B,U)||F,U};return m.cache=new(wu.Cache||Un),m}wu.Cache=Un;function xu(c){if(typeof c!="function")throw new an(o);return function(){var v=arguments;switch(v.length){case 0:return!c.call(this);case 1:return!c.call(this,v[0]);case 2:return!c.call(this,v[0],v[1]);case 3:return!c.call(this,v[0],v[1],v[2])}return!c.apply(this,v)}}function rO(c){return P1(2,c)}var tO=VB(function(c,v){v=v.length==1&&nr(v[0])?Or(v[0],Kt(Qe())):Or(ht(v,1),Kt(Qe()));var m=v.length;return fr(function(T){for(var B=-1,F=Ct(T.length,m);++B<F;)T[B]=v[B].call(this,T[B]);return Ht(c,this,T)})}),sc=fr(function(c,v){var m=va(v,zi(sc));return Kn(c,S,t,v,m)}),L1=fr(function(c,v){var m=va(v,zi(L1));return Kn(c,R,t,v,m)}),nO=jn(function(c,v){return Kn(c,A,t,t,t,v)});function aO(c,v){if(typeof c!="function")throw new an(o);return v=v===t?v:or(v),fr(c,v)}function iO(c,v){if(typeof c!="function")throw new an(o);return v=v==null?0:et(or(v),0),fr(function(m){var T=m[v],B=ma(m,0,v);return T&&da(B,T),Ht(c,this,B)})}function oO(c,v,m){var T=!0,B=!0;if(typeof c!="function")throw new an(o);return Fr(m)&&(T="leading"in m?!!m.leading:T,B="trailing"in m?!!m.trailing:B),M1(c,v,{leading:T,maxWait:v,trailing:B})}function sO(c){return A1(c,1)}function uO(c,v){return sc(Uf(v),c)}function lO(){if(!arguments.length)return[];var c=arguments[0];return nr(c)?c:[c]}function fO(c){return sn(c,g)}function cO(c,v){return v=typeof v=="function"?v:t,sn(c,g,v)}function dO(c){return sn(c,d|g)}function vO(c,v){return v=typeof v=="function"?v:t,sn(c,d|g,v)}function hO(c,v){return v==null||xb(c,v,st(v))}function wn(c,v){return c===v||c!==c&&v!==v}var gO=vu(Mf),pO=vu(function(c,v){return c>=v}),Ja=Rb((function(){return arguments})())?Rb:function(c){return Gr(c)&&wr.call(c,"callee")&&!vb.call(c,"callee")},nr=pe.isArray,yO=j0?Kt(j0):SB;function Nt(c){return c!=null&&Eu(c.length)&&!Xn(c)}function Hr(c){return Gr(c)&&Nt(c)}function mO(c){return c===!0||c===!1||Gr(c)&&It(c)==ue}var ba=BD||mc,bO=Y0?Kt(Y0):TB;function wO(c){return Gr(c)&&c.nodeType===1&&!Fo(c)}function xO(c){if(c==null)return!0;if(Nt(c)&&(nr(c)||typeof c=="string"||typeof c.splice=="function"||ba(c)||$i(c)||Ja(c)))return!c.length;var v=_t(c);if(v==we||v==re)return!c.size;if(qo(c))return!kf(c).length;for(var m in c)if(wr.call(c,m))return!1;return!0}function EO(c,v){return Lo(c,v)}function CO(c,v,m){m=typeof m=="function"?m:t;var T=m?m(c,v):t;return T===t?Lo(c,v,t,m):!!T}function uc(c){if(!Gr(c))return!1;var v=It(c);return v==Q||v==Z||typeof c.message=="string"&&typeof c.name=="string"&&!Fo(c)}function _O(c){return typeof c=="number"&&gb(c)}function Xn(c){if(!Fr(c))return!1;var v=It(c);return v==ie||v==de||v==te||v==Se}function O1(c){return typeof c=="number"&&c==or(c)}function Eu(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=$}function Fr(c){var v=typeof c;return c!=null&&(v=="object"||v=="function")}function Gr(c){return c!=null&&typeof c=="object"}var k1=X0?Kt(X0):AB;function SO(c,v){return c===v||Of(c,v,Qf(v))}function TO(c,v,m){return m=typeof m=="function"?m:t,Of(c,v,Qf(v),m)}function RO(c){return q1(c)&&c!=+c}function AO(c){if(cM(c))throw new tr(i);return Ab(c)}function PO(c){return c===null}function IO(c){return c==null}function q1(c){return typeof c=="number"||Gr(c)&&It(c)==Ae}function Fo(c){if(!Gr(c)||It(c)!=le)return!1;var v=Ys(c);if(v===null)return!0;var m=wr.call(v,"constructor")&&v.constructor;return typeof m=="function"&&m instanceof m&&Us.call(m)==TD}var lc=Z0?Kt(Z0):PB;function DO(c){return O1(c)&&c>=-$&&c<=$}var N1=Q0?Kt(Q0):IB;function Cu(c){return typeof c=="string"||!nr(c)&&Gr(c)&&It(c)==ce}function Yt(c){return typeof c=="symbol"||Gr(c)&&It(c)==_e}var $i=J0?Kt(J0):DB;function BO(c){return c===t}function MO(c){return Gr(c)&&_t(c)==Te}function LO(c){return Gr(c)&&It(c)==De}var OO=vu(qf),kO=vu(function(c,v){return c<=v});function F1(c){if(!c)return[];if(Nt(c))return Cu(c)?mn(c):qt(c);if(To&&c[To])return hD(c[To]());var v=_t(c),m=v==we?_f:v==re?Vs:Vi;return m(c)}function Zn(c){if(!c)return c===0?c:0;if(c=fn(c),c===V||c===-V){var v=c<0?-1:1;return v*X}return c===c?c:0}function or(c){var v=Zn(c),m=v%1;return v===v?m?v-m:v:0}function z1(c){return c?Ya(or(c),0,K):0}function fn(c){if(typeof c=="number")return c;if(Yt(c))return ee;if(Fr(c)){var v=typeof c.valueOf=="function"?c.valueOf():c;c=Fr(v)?v+"":v}if(typeof c!="string")return c===0?c:+c;c=ib(c);var m=Et.test(c);return m||kt.test(c)?ZI(c.slice(2),m?2:8):ot.test(c)?ee:+c}function $1(c){return Dn(c,Ft(c))}function qO(c){return c?Ya(or(c),-$,$):c===0?c:0}function xr(c){return c==null?"":jt(c)}var NO=Ni(function(c,v){if(qo(v)||Nt(v)){Dn(v,st(v),c);return}for(var m in v)wr.call(v,m)&&Do(c,m,v[m])}),V1=Ni(function(c,v){Dn(v,Ft(v),c)}),_u=Ni(function(c,v,m,T){Dn(v,Ft(v),c,T)}),FO=Ni(function(c,v,m,T){Dn(v,st(v),c,T)}),zO=jn(If);function $O(c,v){var m=qi(c);return v==null?m:wb(m,v)}var VO=fr(function(c,v){c=Sr(c);var m=-1,T=v.length,B=T>2?v[2]:t;for(B&&Dt(v[0],v[1],B)&&(T=1);++m<T;)for(var F=v[m],U=Ft(F),J=-1,se=U.length;++J<se;){var Pe=U[J],Ie=c[Pe];(Ie===t||wn(Ie,Li[Pe])&&!wr.call(c,Pe))&&(c[Pe]=F[Pe])}return c}),GO=fr(function(c){return c.push(t,i1),Ht(G1,t,c)});function WO(c,v){return rb(c,Qe(v,3),In)}function UO(c,v){return rb(c,Qe(v,3),Bf)}function HO(c,v){return c==null?c:Df(c,Qe(v,3),Ft)}function KO(c,v){return c==null?c:Sb(c,Qe(v,3),Ft)}function jO(c,v){return c&&In(c,Qe(v,3))}function YO(c,v){return c&&Bf(c,Qe(v,3))}function XO(c){return c==null?[]:iu(c,st(c))}function ZO(c){return c==null?[]:iu(c,Ft(c))}function fc(c,v,m){var T=c==null?t:Xa(c,v);return T===t?m:T}function QO(c,v){return c!=null&&u1(c,v,xB)}function cc(c,v){return c!=null&&u1(c,v,EB)}var JO=e1(function(c,v,m){v!=null&&typeof v.toString!="function"&&(v=Hs.call(v)),c[v]=m},vc(zt)),ek=e1(function(c,v,m){v!=null&&typeof v.toString!="function"&&(v=Hs.call(v)),wr.call(c,v)?c[v].push(m):c[v]=[m]},Qe),rk=fr(Mo);function st(c){return Nt(c)?mb(c):kf(c)}function Ft(c){return Nt(c)?mb(c,!0):BB(c)}function tk(c,v){var m={};return v=Qe(v,3),In(c,function(T,B,F){Hn(m,v(T,B,F),T)}),m}function nk(c,v){var m={};return v=Qe(v,3),In(c,function(T,B,F){Hn(m,B,v(T,B,F))}),m}var ak=Ni(function(c,v,m){ou(c,v,m)}),G1=Ni(function(c,v,m,T){ou(c,v,m,T)}),ik=jn(function(c,v){var m={};if(c==null)return m;var T=!1;v=Or(v,function(F){return F=ya(F,c),T||(T=F.length>1),F}),Dn(c,Xf(c),m),T&&(m=sn(m,d|h|g,JB));for(var B=v.length;B--;)Vf(m,v[B]);return m});function ok(c,v){return W1(c,xu(Qe(v)))}var sk=jn(function(c,v){return c==null?{}:LB(c,v)});function W1(c,v){if(c==null)return{};var m=Or(Xf(c),function(T){return[T]});return v=Qe(v),Ob(c,m,function(T,B){return v(T,B[0])})}function uk(c,v,m){v=ya(v,c);var T=-1,B=v.length;for(B||(B=1,c=t);++T<B;){var F=c==null?t:c[Bn(v[T])];F===t&&(T=B,F=m),c=Xn(F)?F.call(c):F}return c}function lk(c,v,m){return c==null?c:Oo(c,v,m)}function fk(c,v,m,T){return T=typeof T=="function"?T:t,c==null?c:Oo(c,v,m,T)}var U1=n1(st),H1=n1(Ft);function ck(c,v,m){var T=nr(c),B=T||ba(c)||$i(c);if(v=Qe(v,4),m==null){var F=c&&c.constructor;B?m=T?new F:[]:Fr(c)?m=Xn(F)?qi(Ys(c)):{}:m={}}return(B?nn:In)(c,function(U,J,se){return v(m,U,J,se)}),m}function dk(c,v){return c==null?!0:Vf(c,v)}function vk(c,v,m){return c==null?c:zb(c,v,Uf(m))}function hk(c,v,m,T){return T=typeof T=="function"?T:t,c==null?c:zb(c,v,Uf(m),T)}function Vi(c){return c==null?[]:Cf(c,st(c))}function gk(c){return c==null?[]:Cf(c,Ft(c))}function pk(c,v,m){return m===t&&(m=v,v=t),m!==t&&(m=fn(m),m=m===m?m:0),v!==t&&(v=fn(v),v=v===v?v:0),Ya(fn(c),v,m)}function yk(c,v,m){return v=Zn(v),m===t?(m=v,v=0):m=Zn(m),c=fn(c),CB(c,v,m)}function mk(c,v,m){if(m&&typeof m!="boolean"&&Dt(c,v,m)&&(v=m=t),m===t&&(typeof v=="boolean"?(m=v,v=t):typeof c=="boolean"&&(m=c,c=t)),c===t&&v===t?(c=0,v=1):(c=Zn(c),v===t?(v=c,c=0):v=Zn(v)),c>v){var T=c;c=v,v=T}if(m||c%1||v%1){var B=pb();return Ct(c+B*(v-c+XI("1e-"+((B+"").length-1))),v)}return Ff(c,v)}var bk=Fi(function(c,v,m){return v=v.toLowerCase(),c+(m?K1(v):v)});function K1(c){return dc(xr(c).toLowerCase())}function j1(c){return c=xr(c),c&&c.replace(rf,lD).replace(zI,"")}function wk(c,v,m){c=xr(c),v=jt(v);var T=c.length;m=m===t?T:Ya(or(m),0,T);var B=m;return m-=v.length,m>=0&&c.slice(m,B)==v}function xk(c){return c=xr(c),c&&ar.test(c)?c.replace(Xe,fD):c}function Ek(c){return c=xr(c),c&&jr.test(c)?c.replace(Lr,"\\$&"):c}var Ck=Fi(function(c,v,m){return c+(m?"-":"")+v.toLowerCase()}),_k=Fi(function(c,v,m){return c+(m?" ":"")+v.toLowerCase()}),Sk=Zb("toLowerCase");function Tk(c,v,m){c=xr(c),v=or(v);var T=v?Bi(c):0;if(!v||T>=v)return c;var B=(v-T)/2;return du(Js(B),m)+c+du(Qs(B),m)}function Rk(c,v,m){c=xr(c),v=or(v);var T=v?Bi(c):0;return v&&T<v?c+du(v-T,m):c}function Ak(c,v,m){c=xr(c),v=or(v);var T=v?Bi(c):0;return v&&T<v?du(v-T,m)+c:c}function Pk(c,v,m){return m||v==null?v=0:v&&(v=+v),kD(xr(c).replace(Nr,""),v||0)}function Ik(c,v,m){return(m?Dt(c,v,m):v===t)?v=1:v=or(v),zf(xr(c),v)}function Dk(){var c=arguments,v=xr(c[0]);return c.length<3?v:v.replace(c[1],c[2])}var Bk=Fi(function(c,v,m){return c+(m?"_":"")+v.toLowerCase()});function Mk(c,v,m){return m&&typeof m!="number"&&Dt(c,v,m)&&(v=m=t),m=m===t?K:m>>>0,m?(c=xr(c),c&&(typeof v=="string"||v!=null&&!lc(v))&&(v=jt(v),!v&&Di(c))?ma(mn(c),0,m):c.split(v,m)):[]}var Lk=Fi(function(c,v,m){return c+(m?" ":"")+dc(v)});function Ok(c,v,m){return c=xr(c),m=m==null?0:Ya(or(m),0,c.length),v=jt(v),c.slice(m,m+v.length)==v}function kk(c,v,m){var T=k.templateSettings;m&&Dt(c,v,m)&&(v=t),c=xr(c),v=_u({},v,T,a1);var B=_u({},v.imports,T.imports,a1),F=st(B),U=Cf(B,F),J,se,Pe=0,Ie=v.interpolate||_i,Le="__p += '",Fe=Sf((v.escape||_i).source+"|"+Ie.source+"|"+(Ie===ir?Gn:_i).source+"|"+(v.evaluate||_i).source+"|$","g"),je="//# sourceURL="+(wr.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++UI+"]")+`
|
|
11
|
+
`;c.replace(Fe,function(er,dr,hr,Xt,Bt,Zt){return hr||(hr=Xt),Le+=c.slice(Pe,Zt).replace(tf,cD),dr&&(J=!0,Le+=`' +
|
|
12
|
+
__e(`+dr+`) +
|
|
13
|
+
'`),Bt&&(se=!0,Le+=`';
|
|
14
|
+
`+Bt+`;
|
|
15
|
+
__p += '`),hr&&(Le+=`' +
|
|
16
|
+
((__t = (`+hr+`)) == null ? '' : __t) +
|
|
17
|
+
'`),Pe=Zt+er.length,er}),Le+=`';
|
|
18
|
+
`;var Je=wr.call(v,"variable")&&v.variable;if(!Je)Le=`with (obj) {
|
|
19
|
+
`+Le+`
|
|
20
|
+
}
|
|
21
|
+
`;else if(ua.test(Je))throw new tr(s);Le=(se?Le.replace(Ve,""):Le).replace(Be,"$1").replace(He,"$1;"),Le="function("+(Je||"obj")+`) {
|
|
22
|
+
`+(Je?"":`obj || (obj = {});
|
|
23
|
+
`)+"var __t, __p = ''"+(J?", __e = _.escape":"")+(se?`, __j = Array.prototype.join;
|
|
24
|
+
function print() { __p += __j.call(arguments, '') }
|
|
25
|
+
`:`;
|
|
26
|
+
`)+Le+`return __p
|
|
27
|
+
}`;var ur=X1(function(){return br(F,je+"return "+Le).apply(t,U)});if(ur.source=Le,uc(ur))throw ur;return ur}function qk(c){return xr(c).toLowerCase()}function Nk(c){return xr(c).toUpperCase()}function Fk(c,v,m){if(c=xr(c),c&&(m||v===t))return ib(c);if(!c||!(v=jt(v)))return c;var T=mn(c),B=mn(v),F=ob(T,B),U=sb(T,B)+1;return ma(T,F,U).join("")}function zk(c,v,m){if(c=xr(c),c&&(m||v===t))return c.slice(0,lb(c)+1);if(!c||!(v=jt(v)))return c;var T=mn(c),B=sb(T,mn(v))+1;return ma(T,0,B).join("")}function $k(c,v,m){if(c=xr(c),c&&(m||v===t))return c.replace(Nr,"");if(!c||!(v=jt(v)))return c;var T=mn(c),B=ob(T,mn(v));return ma(T,B).join("")}function Vk(c,v){var m=I,T=D;if(Fr(v)){var B="separator"in v?v.separator:B;m="length"in v?or(v.length):m,T="omission"in v?jt(v.omission):T}c=xr(c);var F=c.length;if(Di(c)){var U=mn(c);F=U.length}if(m>=F)return c;var J=m-Bi(T);if(J<1)return T;var se=U?ma(U,0,J).join(""):c.slice(0,J);if(B===t)return se+T;if(U&&(J+=se.length-J),lc(B)){if(c.slice(J).search(B)){var Pe,Ie=se;for(B.global||(B=Sf(B.source,xr(dt.exec(B))+"g")),B.lastIndex=0;Pe=B.exec(Ie);)var Le=Pe.index;se=se.slice(0,Le===t?J:Le)}}else if(c.indexOf(jt(B),J)!=J){var Fe=se.lastIndexOf(B);Fe>-1&&(se=se.slice(0,Fe))}return se+T}function Gk(c){return c=xr(c),c&&sr.test(c)?c.replace(We,mD):c}var Wk=Fi(function(c,v,m){return c+(m?" ":"")+v.toUpperCase()}),dc=Zb("toUpperCase");function Y1(c,v,m){return c=xr(c),v=m?t:v,v===t?vD(c)?xD(c):aD(c):c.match(v)||[]}var X1=fr(function(c,v){try{return Ht(c,t,v)}catch(m){return uc(m)?m:new tr(m)}}),Uk=jn(function(c,v){return nn(v,function(m){m=Bn(m),Hn(c,m,oc(c[m],c))}),c});function Hk(c){var v=c==null?0:c.length,m=Qe();return c=v?Or(c,function(T){if(typeof T[1]!="function")throw new an(o);return[m(T[0]),T[1]]}):[],fr(function(T){for(var B=-1;++B<v;){var F=c[B];if(Ht(F[0],this,T))return Ht(F[1],this,T)}})}function Kk(c){return mB(sn(c,d))}function vc(c){return function(){return c}}function jk(c,v){return c==null||c!==c?v:c}var Yk=Jb(),Xk=Jb(!0);function zt(c){return c}function hc(c){return Pb(typeof c=="function"?c:sn(c,d))}function Zk(c){return Db(sn(c,d))}function Qk(c,v){return Bb(c,sn(v,d))}var Jk=fr(function(c,v){return function(m){return Mo(m,c,v)}}),eq=fr(function(c,v){return function(m){return Mo(c,m,v)}});function gc(c,v,m){var T=st(v),B=iu(v,T);m==null&&!(Fr(v)&&(B.length||!T.length))&&(m=v,v=c,c=this,B=iu(v,st(v)));var F=!(Fr(m)&&"chain"in m)||!!m.chain,U=Xn(c);return nn(B,function(J){var se=v[J];c[J]=se,U&&(c.prototype[J]=function(){var Pe=this.__chain__;if(F||Pe){var Ie=c(this.__wrapped__),Le=Ie.__actions__=qt(this.__actions__);return Le.push({func:se,args:arguments,thisArg:c}),Ie.__chain__=Pe,Ie}return se.apply(c,da([this.value()],arguments))})}),c}function rq(){return vt._===this&&(vt._=RD),this}function pc(){}function tq(c){return c=or(c),fr(function(v){return Mb(v,c)})}var nq=Kf(Or),aq=Kf(eb),iq=Kf(mf);function Z1(c){return ec(c)?bf(Bn(c)):OB(c)}function oq(c){return function(v){return c==null?t:Xa(c,v)}}var sq=r1(),uq=r1(!0);function yc(){return[]}function mc(){return!1}function lq(){return{}}function fq(){return""}function cq(){return!0}function dq(c,v){if(c=or(c),c<1||c>$)return[];var m=K,T=Ct(c,K);v=Qe(v),c-=K;for(var B=Ef(T,v);++m<c;)v(m);return B}function vq(c){return nr(c)?Or(c,Bn):Yt(c)?[c]:qt(y1(xr(c)))}function hq(c){var v=++SD;return xr(c)+v}var gq=cu(function(c,v){return c+v},0),pq=jf("ceil"),yq=cu(function(c,v){return c/v},1),mq=jf("floor");function bq(c){return c&&c.length?au(c,zt,Mf):t}function wq(c,v){return c&&c.length?au(c,Qe(v,2),Mf):t}function xq(c){return nb(c,zt)}function Eq(c,v){return nb(c,Qe(v,2))}function Cq(c){return c&&c.length?au(c,zt,qf):t}function _q(c,v){return c&&c.length?au(c,Qe(v,2),qf):t}var Sq=cu(function(c,v){return c*v},1),Tq=jf("round"),Rq=cu(function(c,v){return c-v},0);function Aq(c){return c&&c.length?xf(c,zt):0}function Pq(c,v){return c&&c.length?xf(c,Qe(v,2)):0}return k.after=ZL,k.ary=A1,k.assign=NO,k.assignIn=V1,k.assignInWith=_u,k.assignWith=FO,k.at=zO,k.before=P1,k.bind=oc,k.bindAll=Uk,k.bindKey=I1,k.castArray=lO,k.chain=S1,k.chunk=mM,k.compact=bM,k.concat=wM,k.cond=Hk,k.conforms=Kk,k.constant=vc,k.countBy=AL,k.create=$O,k.curry=D1,k.curryRight=B1,k.debounce=M1,k.defaults=VO,k.defaultsDeep=GO,k.defer=QL,k.delay=JL,k.difference=xM,k.differenceBy=EM,k.differenceWith=CM,k.drop=_M,k.dropRight=SM,k.dropRightWhile=TM,k.dropWhile=RM,k.fill=AM,k.filter=IL,k.flatMap=ML,k.flatMapDeep=LL,k.flatMapDepth=OL,k.flatten=x1,k.flattenDeep=PM,k.flattenDepth=IM,k.flip=eO,k.flow=Yk,k.flowRight=Xk,k.fromPairs=DM,k.functions=XO,k.functionsIn=ZO,k.groupBy=kL,k.initial=MM,k.intersection=LM,k.intersectionBy=OM,k.intersectionWith=kM,k.invert=JO,k.invertBy=ek,k.invokeMap=NL,k.iteratee=hc,k.keyBy=FL,k.keys=st,k.keysIn=Ft,k.map=mu,k.mapKeys=tk,k.mapValues=nk,k.matches=Zk,k.matchesProperty=Qk,k.memoize=wu,k.merge=ak,k.mergeWith=G1,k.method=Jk,k.methodOf=eq,k.mixin=gc,k.negate=xu,k.nthArg=tq,k.omit=ik,k.omitBy=ok,k.once=rO,k.orderBy=zL,k.over=nq,k.overArgs=tO,k.overEvery=aq,k.overSome=iq,k.partial=sc,k.partialRight=L1,k.partition=$L,k.pick=sk,k.pickBy=W1,k.property=Z1,k.propertyOf=oq,k.pull=zM,k.pullAll=C1,k.pullAllBy=$M,k.pullAllWith=VM,k.pullAt=GM,k.range=sq,k.rangeRight=uq,k.rearg=nO,k.reject=WL,k.remove=WM,k.rest=aO,k.reverse=ac,k.sampleSize=HL,k.set=lk,k.setWith=fk,k.shuffle=KL,k.slice=UM,k.sortBy=XL,k.sortedUniq=QM,k.sortedUniqBy=JM,k.split=Mk,k.spread=iO,k.tail=eL,k.take=rL,k.takeRight=tL,k.takeRightWhile=nL,k.takeWhile=aL,k.tap=bL,k.throttle=oO,k.thru=yu,k.toArray=F1,k.toPairs=U1,k.toPairsIn=H1,k.toPath=vq,k.toPlainObject=$1,k.transform=ck,k.unary=sO,k.union=iL,k.unionBy=oL,k.unionWith=sL,k.uniq=uL,k.uniqBy=lL,k.uniqWith=fL,k.unset=dk,k.unzip=ic,k.unzipWith=_1,k.update=vk,k.updateWith=hk,k.values=Vi,k.valuesIn=gk,k.without=cL,k.words=Y1,k.wrap=uO,k.xor=dL,k.xorBy=vL,k.xorWith=hL,k.zip=gL,k.zipObject=pL,k.zipObjectDeep=yL,k.zipWith=mL,k.entries=U1,k.entriesIn=H1,k.extend=V1,k.extendWith=_u,gc(k,k),k.add=gq,k.attempt=X1,k.camelCase=bk,k.capitalize=K1,k.ceil=pq,k.clamp=pk,k.clone=fO,k.cloneDeep=dO,k.cloneDeepWith=vO,k.cloneWith=cO,k.conformsTo=hO,k.deburr=j1,k.defaultTo=jk,k.divide=yq,k.endsWith=wk,k.eq=wn,k.escape=xk,k.escapeRegExp=Ek,k.every=PL,k.find=DL,k.findIndex=b1,k.findKey=WO,k.findLast=BL,k.findLastIndex=w1,k.findLastKey=UO,k.floor=mq,k.forEach=T1,k.forEachRight=R1,k.forIn=HO,k.forInRight=KO,k.forOwn=jO,k.forOwnRight=YO,k.get=fc,k.gt=gO,k.gte=pO,k.has=QO,k.hasIn=cc,k.head=E1,k.identity=zt,k.includes=qL,k.indexOf=BM,k.inRange=yk,k.invoke=rk,k.isArguments=Ja,k.isArray=nr,k.isArrayBuffer=yO,k.isArrayLike=Nt,k.isArrayLikeObject=Hr,k.isBoolean=mO,k.isBuffer=ba,k.isDate=bO,k.isElement=wO,k.isEmpty=xO,k.isEqual=EO,k.isEqualWith=CO,k.isError=uc,k.isFinite=_O,k.isFunction=Xn,k.isInteger=O1,k.isLength=Eu,k.isMap=k1,k.isMatch=SO,k.isMatchWith=TO,k.isNaN=RO,k.isNative=AO,k.isNil=IO,k.isNull=PO,k.isNumber=q1,k.isObject=Fr,k.isObjectLike=Gr,k.isPlainObject=Fo,k.isRegExp=lc,k.isSafeInteger=DO,k.isSet=N1,k.isString=Cu,k.isSymbol=Yt,k.isTypedArray=$i,k.isUndefined=BO,k.isWeakMap=MO,k.isWeakSet=LO,k.join=qM,k.kebabCase=Ck,k.last=ln,k.lastIndexOf=NM,k.lowerCase=_k,k.lowerFirst=Sk,k.lt=OO,k.lte=kO,k.max=bq,k.maxBy=wq,k.mean=xq,k.meanBy=Eq,k.min=Cq,k.minBy=_q,k.stubArray=yc,k.stubFalse=mc,k.stubObject=lq,k.stubString=fq,k.stubTrue=cq,k.multiply=Sq,k.nth=FM,k.noConflict=rq,k.noop=pc,k.now=bu,k.pad=Tk,k.padEnd=Rk,k.padStart=Ak,k.parseInt=Pk,k.random=mk,k.reduce=VL,k.reduceRight=GL,k.repeat=Ik,k.replace=Dk,k.result=uk,k.round=Tq,k.runInContext=ae,k.sample=UL,k.size=jL,k.snakeCase=Bk,k.some=YL,k.sortedIndex=HM,k.sortedIndexBy=KM,k.sortedIndexOf=jM,k.sortedLastIndex=YM,k.sortedLastIndexBy=XM,k.sortedLastIndexOf=ZM,k.startCase=Lk,k.startsWith=Ok,k.subtract=Rq,k.sum=Aq,k.sumBy=Pq,k.template=kk,k.times=dq,k.toFinite=Zn,k.toInteger=or,k.toLength=z1,k.toLower=qk,k.toNumber=fn,k.toSafeInteger=qO,k.toString=xr,k.toUpper=Nk,k.trim=Fk,k.trimEnd=zk,k.trimStart=$k,k.truncate=Vk,k.unescape=Gk,k.uniqueId=hq,k.upperCase=Wk,k.upperFirst=dc,k.each=T1,k.eachRight=R1,k.first=E1,gc(k,(function(){var c={};return In(k,function(v,m){wr.call(k.prototype,m)||(c[m]=v)}),c})(),{chain:!1}),k.VERSION=n,nn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){k[c].placeholder=k}),nn(["drop","take"],function(c,v){vr.prototype[c]=function(m){m=m===t?1:et(or(m),0);var T=this.__filtered__&&!v?new vr(this):this.clone();return T.__filtered__?T.__takeCount__=Ct(m,T.__takeCount__):T.__views__.push({size:Ct(m,K),type:c+(T.__dir__<0?"Right":"")}),T},vr.prototype[c+"Right"]=function(m){return this.reverse()[c](m).reverse()}}),nn(["filter","map","takeWhile"],function(c,v){var m=v+1,T=m==q||m==W;vr.prototype[c]=function(B){var F=this.clone();return F.__iteratees__.push({iteratee:Qe(B,3),type:m}),F.__filtered__=F.__filtered__||T,F}}),nn(["head","last"],function(c,v){var m="take"+(v?"Right":"");vr.prototype[c]=function(){return this[m](1).value()[0]}}),nn(["initial","tail"],function(c,v){var m="drop"+(v?"":"Right");vr.prototype[c]=function(){return this.__filtered__?new vr(this):this[m](1)}}),vr.prototype.compact=function(){return this.filter(zt)},vr.prototype.find=function(c){return this.filter(c).head()},vr.prototype.findLast=function(c){return this.reverse().find(c)},vr.prototype.invokeMap=fr(function(c,v){return typeof c=="function"?new vr(this):this.map(function(m){return Mo(m,c,v)})}),vr.prototype.reject=function(c){return this.filter(xu(Qe(c)))},vr.prototype.slice=function(c,v){c=or(c);var m=this;return m.__filtered__&&(c>0||v<0)?new vr(m):(c<0?m=m.takeRight(-c):c&&(m=m.drop(c)),v!==t&&(v=or(v),m=v<0?m.dropRight(-v):m.take(v-c)),m)},vr.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},vr.prototype.toArray=function(){return this.take(K)},In(vr.prototype,function(c,v){var m=/^(?:filter|find|map|reject)|While$/.test(v),T=/^(?:head|last)$/.test(v),B=k[T?"take"+(v=="last"?"Right":""):v],F=T||/^find/.test(v);B&&(k.prototype[v]=function(){var U=this.__wrapped__,J=T?[1]:arguments,se=U instanceof vr,Pe=J[0],Ie=se||nr(U),Le=function(dr){var hr=B.apply(k,da([dr],J));return T&&Fe?hr[0]:hr};Ie&&m&&typeof Pe=="function"&&Pe.length!=1&&(se=Ie=!1);var Fe=this.__chain__,je=!!this.__actions__.length,Je=F&&!Fe,ur=se&&!je;if(!F&&Ie){U=ur?U:new vr(this);var er=c.apply(U,J);return er.__actions__.push({func:yu,args:[Le],thisArg:t}),new on(er,Fe)}return Je&&ur?c.apply(this,J):(er=this.thru(Le),Je?T?er.value()[0]:er.value():er)})}),nn(["pop","push","shift","sort","splice","unshift"],function(c){var v=Gs[c],m=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",T=/^(?:pop|shift)$/.test(c);k.prototype[c]=function(){var B=arguments;if(T&&!this.__chain__){var F=this.value();return v.apply(nr(F)?F:[],B)}return this[m](function(U){return v.apply(nr(U)?U:[],B)})}}),In(vr.prototype,function(c,v){var m=k[v];if(m){var T=m.name+"";wr.call(ki,T)||(ki[T]=[]),ki[T].push({name:v,func:m})}}),ki[fu(t,w).name]=[{name:"wrapper",func:t}],vr.prototype.clone=GD,vr.prototype.reverse=WD,vr.prototype.value=UD,k.prototype.at=wL,k.prototype.chain=xL,k.prototype.commit=EL,k.prototype.next=CL,k.prototype.plant=SL,k.prototype.reverse=TL,k.prototype.toJSON=k.prototype.valueOf=k.prototype.value=RL,k.prototype.first=k.prototype.head,To&&(k.prototype[To]=_L),k}),Mi=ED();Ua?((Ua.exports=Mi)._=Mi,hf._=Mi):vt._=Mi}).call(kq)})(Ko,Ko.exports)),Ko.exports}var pr=qq();const pl={label:"Untitled",description:"",isTask:!1,isLocked:!1},$m={id:null,type:"text",data:{...pl,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",borderColor:"transparent",borderRadius:25,borderWidth:0,boxShadow:"none",textOverflow:"ellipsis",fontWeight:"bold",textColor:"gray.800",textAlign:"center"}}},rw={id:null,type:"objectView",data:{...pl,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},Nq={id:null,type:"arrayView",data:{...pl,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",textAlign:"center",borderRadius:25,fontSize:"5xl",borderWidth:2,textOverflow:"ellipsis",wordBreak:"keep-all",fontWeight:"bold",textColor:"gray.900",placeholder:"Start Typing"}}},tw={id:null,type:"workflowStep",data:{...pl,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Su;const Fq=new Uint8Array(16);function zq(){if(!Su&&(Su=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Su))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Su(Fq)}const pt=[];for(let r=0;r<256;++r)pt.push((r+256).toString(16).slice(1));function $q(r,e=0){return pt[r[e+0]]+pt[r[e+1]]+pt[r[e+2]]+pt[r[e+3]]+"-"+pt[r[e+4]]+pt[r[e+5]]+"-"+pt[r[e+6]]+pt[r[e+7]]+"-"+pt[r[e+8]]+pt[r[e+9]]+"-"+pt[r[e+10]]+pt[r[e+11]]+pt[r[e+12]]+pt[r[e+13]]+pt[r[e+14]]+pt[r[e+15]]}const Vq=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nw={randomUUID:Vq};function Gq(r,e,t){if(nw.randomUUID&&!r)return nw.randomUUID();r=r||{};const n=r.random||(r.rng||zq)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,$q(n)}const Qt=r=>typeof r=="object",fR=r=>Array.isArray(r),Wq=["order","position","selected","locked","grabbed","grabbable","scratch"],Pa=r=>Object.entries(r).reduce((e,[t,n])=>(!Qt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),Vm=(r,e)=>typeof r=="string"&&r.startsWith("$")?bc(r,e):Qt(r)&&!fR(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...bc(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=bc(a,e):t[n]=a,t),{}):r,Ia=r=>Object.entries(r).reduce((e,[t,n])=>(Qt(n)&&t&&n&&!t.startsWith("$")&&(Wq.includes(t)&&(t=t+"#"),e[t]=n),e),{}),ai=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Qt(i)||fR(i))&&(i=JSON.stringify(i,null,2)),{data:{parent:n,...r.data,id:e,text:t||"",label:t,code:i||null,type:r.type,description:a}}),Ca=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:Gq(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),_n=(r,e=[])=>{const t={},n={};let a=[];if(r)for(const[i,o]of Object.entries(r))i.startsWith("$")&&i!=="$"?t[i.slice(1)]=o:i!=="$"?n[i]=o:i==="$"&&(a=o);return{newConfig:t,updatedObject:n,arrayObject:a}},Qi=(r,e)=>{let t=rw;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:u,stepType:l}=e;r=n||r,l?t={...tw}:r==="object"?t=rw:r==="text"?t=$m:r==="array"?t=Nq:r==="workflowStep"&&(t={...tw});const f=t.data.viewProps;return t.data.viewProps={...f,borderRadius:i||(l?15:50),bgColor:o,borderColor:a,textColor:s,fontSize:u},t.data.config=e,{config:t}},ss=(r,e)=>(r=e.find(n=>n.data.id===r)?`${r}.#`:r,r),bc=(r,{ids:e,jsnObjct:t})=>{if(typeof r=="string"&&(r!=null&&r.startsWith("$"))){const n=r.replace("$","").replace("*","");r==null||r.endsWith("*");const a=e.find(s=>s.split(".").slice(-1)[0]===n||n===s);if(!a)return r;const i=Uq(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},Uq=(r,e)=>{let t=r.split(".").splice(1);return t=t[t.length-1]==="#"||t[t.length-1].includes("{")?t.slice(0,-2):t,(i=>t.reduce((o,s)=>{s=s.replace("[","").replace("]","");const{arrayObject:u}=_n(o);return o=u.length?u:o,o[s]},i))(e)};function to(r,e="root",t=[]){try{const{arrayObject:n}=_n(r);n.length&&(r=n);const a=Pa(r),i=Ia(r);return Qt(r)?(pr.isArray(r)||pr.isArray(r)&&e==="root"||!pr.isArray(r)&&Object.keys(a).length||e==="root")&&t.push(e):t.push(e),Object.keys(i).length&&!pr.isArray(r)?rs({chldPth:null,itrblObjct:i,nodes:t,path:e}):pr.isArray(r)&&r.forEach((o,s)=>{const u=Pa(o),l=Ia(o),{newConfig:f,arrayObject:d}=_n(o);let h=`${e}.${s}`;Qt(o)?Object.keys(u).length?(to(u,h,t),Object.keys(l).length&&!pr.isArray(o)&&rs({chldPth:h,itrblObjct:l,nodes:t,path:e})):Object.keys(l).length&&!pr.isArray(o)?rs({chldPth:h,itrblObjct:l,nodes:t,path:e}):pr.isArray(o)&&cR({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const rs=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Pa(i),u=Ia(i),{newConfig:l,arrayObject:f}=_n(i);f.length&&(i=f),n.split(".").slice(0,2).join(".");let d=r?`${r}.${a}`:`${n}.${a}`;if(Qt(i)&&!pr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Qi("array",l),t.push(d)),Object.keys(s).length){const g=pr.isArray(i)?`${i.length||""}`:`{${Object.keys(i).length||""}}`;let p=d;h&&(p=`${d}.${g}`),to(i,p,t)}else Object.keys(u).length&&!pr.isArray(i)?rs({chldPth:d,itrblObjct:u,path:d,nodes:t}):to(i,d,t)}else pr.isArray(i)&&to(i,d,t)}),cR=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=Ia(a),u=Pa(a);Qt(a)?!pr.isArray(a)&&Object.keys(u).length?to(a,o,t):Object.keys(s).length&&!pr.isArray(a)?rs({chldPth:o,itrblObjct:s,path:n,nodes:t}):pr.isArray(a)&&cR({chldPth:o,item:a,nodes:t,path:n}):t.push(o)}),Qu=[];let ts;function li(r,e="root",t=[],n=[],a="untitled",i={hideDefaultObject:!1,sprtObjctKy:!1,isCntr:!1},o={}){if(!r||typeof r!="object")return console.error("Invalid object passed",r),{nodes:t,edges:n};const s=r;if(!ts){const{nodes:f}=to(r);ts={ids:f,jsnObjct:r}}let{hideDefaultObject:u,sprtObjctKy:l}=i;try{e=ss(e,t);const{newConfig:f,arrayObject:d}=_n(r),h=Object.keys(o).length>0?o:f;d.length&&(r=d);const g=Pa(r),p=Ia(r),{label:x,collapsed:b,parent:w}=h;if(!Qt(r))t.push(ai($m,e,{label:x||e,parent:w},r,s));else if(pr.isArray(r)||pr.isArray(r)&&e==="root"){const{config:y}=Qi("array",h),E=pr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,C=e==="root"?a:`${a} ${E}`;t.push(ai(y,e,{label:x||C,parent:w},r,pr.isArray(s)?{[a]:s}:s))}else if(!pr.isArray(r)&&Object.keys(g).length||e==="root"){const{config:y}=Qi(null,h),E=pr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,C=e.split("."),S=C[C.length-1];let R=isNaN(Number(S))?null:Number(S)+1;const _=isNaN(Number(S))?S:C[C.length-2]+" "+R,A=e==="root"?a:_;let P=!1;Number.isNaN(Number(a))||(P=!0);const I=r;if(x){const{config:D}=Qi("object",h);t.push(ai(D,e,{label:x||`${x} ${E}`,parent:w},g,I))}else y.data.headerTitle=A,t.push(ai(y,e,{label:x,parent:w},g,I))}return b||(Object.keys(p).length&&!pr.isArray(r)?ns({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:p,nodes:t,path:e,newConfig:h}):pr.isArray(r)&&r.forEach((y,E)=>{y=Vm(y,ts);const C=y,S=Pa(y),R=Ia(y),{newConfig:_,arrayObject:A}=_n(y);A.length&&(y=A);const{config:P}=Qi(typeof y=="string"?"text":"array",_),{hideConfig:I,sourceLabel:D,label:L,isEdgeAnimated:M,parent:q}=_;u=u||I;const N=e==="root"&&i.isCntr,W=e.split(".").slice(0,2).join("."),V=Qu.includes(W),$=i.isCntr&&V||E%2===0&&N;let X=`${e}.${E}`;X=ss(X,t),$&&Qu.push(X),Qt(y)?Object.keys(S).length&&!pr.isArray(y)?(n.push(Ca(e,X,null,D,$,M)),li(y,X,t,n,L||E,i,_)):Object.keys(R).length&&!pr.isArray(y)?ns({flowConfig:i,chldPth:X,isInverted:$,edges:n,itrblObjct:R,nodes:t,path:e,newConfig:_,forceIsInverted:!0}):pr.isArray(y)?dR({flowConfig:i,chldPth:X,edges:n,isInverted:$,item:y,nodes:t,path:e}):Qt(y)&&ns({flowConfig:i,chldPth:X,isInverted:$,edges:n,itrblObjct:[y],nodes:t,path:e,newConfig:_}):(n.push(Ca(e,X,null,D,$,M)),t.push(ai(P,X,{label:L||String(y),parent:q},y,C)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const ns=({chldPth:r,flowConfig:e,edges:t,itrblObjct:n,nodes:a,isInverted:i,path:o,newConfig:s,forceIsInverted:u=!1})=>{let{hideDefaultObject:l,sprtObjctKy:f}=e;return Object.entries(n).forEach(([d,h],g)=>{h=Vm(h,ts);const p=h,x=Pa(h),b=Ia(h),{newConfig:w,arrayObject:y}=_n(h);y.length&&(h=y);const{hideConfig:E,sourceLabel:C,label:S,content:R,target:_,targetLabel:A,collapsed:P,isEdgeAnimated:I,parent:D}=w;l=l||E;const L=o==="root"&&e.isCntr,M=o.split(".").slice(0,2).join("."),q=Qu.includes(M);u||(i=e.isCntr&&q||g%2===0&&L);let N=r?`${r}.${d}`:`${o}.${d}`;if(N=ss(N,a),i&&Qu.push(N),_&&t.push(Ca(N,_,null,A,i,I)),Qt(h)&&!pr.isArray(h)){t.push(Ca(o,N,null,C,i,I));const W=f||Object.keys(x).length===0;if(W){const V=R?"object":"array",{config:$}=Qi(V,w);$.data.headerTitle=R?S:null,a.push(ai($,N,{label:S||d,parent:D},h,p))}if(Object.keys(x).length&&!l){const V=pr.isArray(h)?` ${h.length||""}`:`{${Object.keys(h).length||""}}`;let $=N;W&&($=`${N}.${V}`,$=ss($,a),t.push(Ca(N,$,null,C,i,I))),li(h,$,a,t,S||d,e,w)}else Object.keys(b).length&&!pr.isArray(h)?ns({chldPth:N,flowConfig:e,itrblObjct:b,path:N,edges:t,nodes:a,newConfig:w,isInverted:i}):li(h,N,a,t,d,e,w)}else pr.isArray(h)&&(t.push(Ca(o,N,null,C,i,I)),li(h,N,a,t,d,e,w))})},dR=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o})=>a.forEach((s,u)=>{let l=`${e}.${u}`;l=ss(l,i);const f=s;s=Vm(s,ts);const d=Ia(s),h=Pa(s),{newConfig:g}=_n(s),{collapsed:p,label:x,parent:b,sourceLabel:w,isEdgeAnimated:y,content:E}=g;Qt(s)?!pr.isArray(s)&&Object.keys(h).length?(t.push(Ca(o,l,null,w,n,y)),li(s,l,i,t,u,r,g)):Object.keys(d).length&&!pr.isArray(s)&&!p?ns({chldPth:l,flowConfig:r,itrblObjct:d,path:o,edges:t,nodes:i,isInverted:n,newConfig:g}):pr.isArray(s)&&dR({flowConfig:r,chldPth:l,edges:t,isInverted:n,item:s,nodes:i,path:o}):(t.push(Ca(o,l,null,w,n,y)),i.push(ai($m,l,{label:x||String(s),parent:b},s,f)))}),yl="root",aw=r=>r==="#"||r.startsWith("{")||/^\s\d*$/.test(r);function fi(r){const e=r.split(".");for(e[0]===yl&&e.shift();e.length&&aw(e[e.length-1]);)e.pop();return e.filter(t=>!aw(t))}function Hq(r){if(r==null||typeof r!="object")return r;const{arrayObject:e}=_n(r);return Array.isArray(e)&&e.length?e:r}function mm(r,e){return fi(e).reduce((t,n)=>{var a;if(t!=null)return(a=Hq(t))==null?void 0:a[n]},r)}function Kq(r){return Array.isArray(r)?[...r]:{...r}}function pi(r,e,t){const n=fi(e),a=(i,o)=>{if(o===n.length)return t(i);const s=n[o],{arrayObject:u}=_n(i),l=Array.isArray(u)&&u.length>0,f=l?u:i;if(f==null||typeof f!="object")return i;const d=Kq(f);return d[s]=a(f[s],o+1),l?{...i,$:d}:d};return a(r,0)}function Gm(r,e,t){const n=t===""||t===void 0||t===null;if(Array.isArray(r))return n?r:{[e]:t,$:[...r]};const a=r!=null&&typeof r=="object"?{...r}:{};return r!=null&&typeof r!="object"&&(a.$label=String(r)),n?delete a[e]:a[e]=t,a}function no(r,e,t,n){return pi(r,e,a=>Gm(a,t,n))}const vR=(r,e,t)=>no(r,e,"$collapsed",t||void 0);function ml(r){const e=r.isInverted?r.target:r.source,t=r.isInverted?r.source:r.target,n=fi(e).join("."),a=fi(t).join(".");return a.startsWith(n?n+".":"")&&a!==n?{address:t,kind:"hierarchy"}:n.startsWith(a?a+".":"")&&n!==a?{address:e,kind:"hierarchy"}:{address:e,kind:"target"}}function us(r,e,t,n){const{address:a,kind:i}=ml(e),o=i==="target"&&t==="$sourceLabel"?"$targetLabel":t;return pi(r,a,s=>Gm(s,o,n))}const hR=(r,e,t)=>us(us(r,e,"$isEdgeAnimated",t==="animated"||void 0),e,"$isEdgeDashed",t==="dashed"||void 0);function gR(r,e,t,n){let a=n||"";const i=pi(r,e,s=>{const u=s!=null&&typeof s=="object"&&!Array.isArray(s)?{...s}:s!=null&&typeof s!="object"?{$label:String(s)}:{};if(Array.isArray(s))return a=String(s.length),[...s,t];if(!a){let l=1;for(;`node_${l}`in u;)l++;a=`node_${l}`}return u[a]=t,u}),o=fi(e);return{json:i,address:[yl,...o,a].join(".")}}function pR(r,e){const t=fi(e);if(!t.length)return r;const n=t[t.length-1],a=[yl,...t.slice(0,-1)].join(".");return pi(r,a,i=>{const{arrayObject:o}=_n(i);if(Array.isArray(o)&&o.length)return{...i,$:o.filter((l,f)=>String(f)!==n)};if(Array.isArray(i))return i.filter((l,f)=>String(f)!==n);const{[n]:s,...u}=i;return u})}const yR=(r,e,t,n)=>no(n?pi(r,e,a=>Gm(a,"$targetLabel",n)):r,e,"$target",t);function mR(r,e){const{address:t,kind:n}=ml(e);return n!=="target"?{json:r,removed:!1}:{json:pi(r,t,i=>{const{$target:o,$targetLabel:s,...u}=i||{};return u}),removed:!0}}function bR(r,e={}){const{nodes:t,edges:n}=li(r,yl,[],[],e.title||"untitled",{hideDefaultObject:!!e.hideDefaultObject,sprtObjctKy:!!e.separateObjectKeys,isCntr:!!e.isCenter}),a=t.map(s=>{const u=mm(r,s.data.id);if(!u||typeof u!="object"||Array.isArray(u))return s;const l={...s.data};return typeof u.$label=="string"&&(l.label=u.$label,l.headerTitle=u.$label),(u.$collapsed!==void 0||u.$icon!==void 0)&&(l.config={...l.config||{}},u.$collapsed!==void 0&&(l.config.collapsed=!!u.$collapsed),u.$icon!==void 0&&(l.config.icon=u.$icon)),{data:l}}),i=new Map,o=n.map(s=>{const u=`${s.data.source}->${s.data.target}`,l=i.get(u)??0;i.set(u,l+1);const f=mm(r,ml(s.data).address),d={...s.data,id:l?`${u}#${l}`:u};return f&&typeof f=="object"&&(f.$isEdgeAnimated!==void 0&&(d.isEdgeAnimated=!!f.$isEdgeAnimated),f.$isEdgeDashed!==void 0&&(d.isEdgeDashed=!!f.$isEdgeDashed),f.$edgeColor&&(d.color=f.$edgeColor)),{data:d}});return{nodes:a,edges:o}}function jq(r,e){const t=new Set(r.filter(i=>{var o,s;return(s=(o=i.data)==null?void 0:o.config)==null?void 0:s.collapsed}).map(i=>i.data.id));if(!t.size)return{nodes:r,edges:e};const n=new Map;for(const i of e){const o=i.data.isInverted?i.data.target:i.data.source,s=i.data.isInverted?i.data.source:i.data.target;(n.get(o)??n.set(o,[]).get(o)).push(s)}const a=new Set;for(const i of t){const o=[...n.get(i)||[]];for(;o.length;){const s=o.pop();t.has(s)||a.has(s)||(a.add(s),o.push(...n.get(s)||[]))}}return{nodes:r.filter(i=>!a.has(i.data.id)),edges:e.filter(i=>!a.has(i.data.source)&&!a.has(i.data.target))}}function Yq(r,e){const t=a=>r&&typeof r=="object"&&a in r;let n=1;for(;t(`${e}_${n}`);)n++;return`${e}_${n}`}function wR(r,e,t,n){const a=(o,s)=>{o!==r&&(n==null||n(o,s))},i=o=>{var u;const s=(u=e.find(l=>l.data.id===o))==null?void 0:u.data;return s&&{source:s.source,target:s.target,isInverted:s.isInverted}};return{...t,onNodeLabelChange:(o,s)=>{var u;(u=t.onNodeLabelChange)==null||u.call(t,o,s),a(no(r,o,"$label",s),{type:"nodeLabel",address:o,key:"$label",value:s})},onNodeColorChange:(o,s,u)=>{var f;(f=t.onNodeColorChange)==null||f.call(t,o,s,u);const l=s==="bg"?"$bgColor":"$textColor";a(no(r,o,l,u),{type:"nodeColor",address:o,key:l,value:u})},onNodeIconChange:(o,s)=>{var u;(u=t.onNodeIconChange)==null||u.call(t,o,s),a(no(r,o,"$icon",s),{type:"nodeIcon",address:o,key:"$icon",value:s})},onNodeCollapse:(o,s)=>{var u;(u=t.onNodeCollapse)==null||u.call(t,o,s),a(vR(r,o,s),{type:"nodeCollapse",address:o,key:"$collapsed",value:s})},onNodeCreate:o=>{var d;(d=t.onNodeCreate)==null||d.call(t,o);const s=o.sourceNodeId||"root",l=Yq(s==="root"?r:void 0,o.isArrayMode?"list":"node"),f=gR(r,s,o.isArrayMode?[]:{},l);a(f.json,{type:"nodeCreate",address:f.address,value:o.isArrayMode?"array":"set"})},onNodeDelete:(o,s)=>{var u;(u=t.onNodeDelete)==null||u.call(t,o,s),a(pR(r,o),{type:"nodeDelete",address:o})},onEdgeCreate:(o,s)=>{var u;(u=t.onEdgeCreate)==null||u.call(t,o,s),a(yR(r,o,s),{type:"edgeCreate",address:o,key:"$target",value:s})},onEdgeLabelChange:(o,s)=>{var l;(l=t.onEdgeLabelChange)==null||l.call(t,o,s);const u=i(o);u&&a(us(r,u,"$sourceLabel",s),{type:"edgeLabel",edge:u,key:"$sourceLabel",value:s})},onEdgeStyleChange:(o,s)=>{var l;(l=t.onEdgeStyleChange)==null||l.call(t,o,s);const u=i(o);u&&a(hR(r,u,s),{type:"edgeStyle",edge:u,value:s})},onEdgeColorChange:(o,s)=>{var l;(l=t.onEdgeColorChange)==null||l.call(t,o,s);const u=i(o);u&&a(us(r,u,"$edgeColor",s),{type:"edgeColor",edge:u,key:"$edgeColor",value:s})},onEdgeDelete:(o,s)=>{var f;(f=t.onEdgeDelete)==null||f.call(t,o,s);const u=i(o);if(!u)return;const l=mR(r,u);l.removed&&a(l.json,{type:"edgeDelete",edge:u,key:"$target"})}}}const xR=xe.createContext(null),ER=xe.createContext({nodeById:new Map,edgeById:new Map});function Wm(){return xe.useContext(ER)}function en(){const r=xe.useContext(xR);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function Xq({config:r,callbacks:e,nodes:t=[],edges:n=[],children:a}){const i=xe.useMemo(()=>{var te,ue;const z=new Map;for(const oe of t)(te=oe.data)!=null&&te.id&&z.set(oe.data.id,oe);const Y=new Map;for(const oe of n)(ue=oe.data)!=null&&ue.id&&Y.set(oe.data.id,oe);return{nodeById:z,edgeById:Y}},[t,n]),o=xe.useRef(null),[s,u]=xe.useState([]),[l,f]=xe.useState(null),[d,h]=xe.useState(!0),[g,p]=xe.useState(!1),[x,b]=xe.useState(!0),[w,y]=xe.useState(r.edgeHandles===!0),[E,C]=xe.useState(!1),[S,R]=xe.useState(!0),[_,A]=xe.useState(!1),P=xe.useRef(e);P.current=e;const I=xe.useMemo(()=>{const z=Y=>(...te)=>{var ue,oe;return(oe=(ue=P.current)==null?void 0:ue[Y])==null?void 0:oe.call(ue,...te)};return{onNodeSelect:z("onNodeSelect"),onNodeDeselect:z("onNodeDeselect"),onNodeDoubleClick:z("onNodeDoubleClick"),onNodeCreate:z("onNodeCreate"),onNodeDelete:z("onNodeDelete"),onNodeLabelChange:z("onNodeLabelChange"),onNodeCollapse:z("onNodeCollapse"),onNodeColorChange:z("onNodeColorChange"),onNodeIconChange:z("onNodeIconChange"),onNodeHoverAction:z("onNodeHoverAction"),onEdgeCreate:z("onEdgeCreate"),onEdgeSelect:z("onEdgeSelect"),onEdgeDeselect:z("onEdgeDeselect"),onEdgeRemove:z("onEdgeRemove"),onEdgeDelete:z("onEdgeDelete"),onEdgeColorChange:z("onEdgeColorChange"),onEdgeLabelChange:z("onEdgeLabelChange"),onEdgeStyleChange:z("onEdgeStyleChange"),onViewportChange:z("onViewportChange"),onDirectionChange:z("onDirectionChange"),onArrayModeChange:z("onArrayModeChange"),onCyInit:z("onCyInit"),onJsonChange:z("onJsonChange")}},[]),D=r.themeColor||"blue.500",L=r.edgeColor||"",M=r.colorMode||"light",q=r.direction||"LR",N=r.readOnly??!1,W=JSON.stringify(r.parentNodeStyle??null),V=xe.useMemo(()=>r.parentNodeStyle,[W]),$=r.isZoomMode!==void 0?r.isZoomMode:d,X=r.isMultiSelectMode!==void 0?r.isMultiSelectMode:g,ee=r.isEdgeHandlesEnabled!==void 0?r.isEdgeHandlesEnabled:w,K=r.isDragMode!==void 0?r.isDragMode:x,j=xe.useRef(r);j.current=r;const fe=xe.useMemo(()=>({get direction(){return j.current.direction},get themeColor(){return j.current.themeColor},get colorMode(){return j.current.colorMode},get readOnly(){return j.current.readOnly},get editable(){return j.current.editable},get minZoom(){return j.current.minZoom},get maxZoom(){return j.current.maxZoom},get backgroundPattern(){return j.current.backgroundPattern},get edgeColor(){return j.current.edgeColor},get parentNodeStyle(){return j.current.parentNodeStyle},get backgroundColor(){return j.current.backgroundColor},get edgeHandles(){return j.current.edgeHandles},get initialViewport(){return j.current.initialViewport},get nodeOverlayActions(){return j.current.nodeOverlayActions},get renderNodeOverlay(){return j.current.renderNodeOverlay},get renderSelectedNodeToolbar(){return j.current.renderSelectedNodeToolbar},get renderSelectedEdgeToolbar(){return j.current.renderSelectedEdgeToolbar},get renderBottomBar(){return j.current.renderBottomBar},get selectionToolbar(){return j.current.selectionToolbar},get customViews(){return j.current.customViews},get disableKeyboardShortcuts(){return j.current.disableKeyboardShortcuts},get isZoomMode(){return j.current.isZoomMode},get isMultiSelectMode(){return j.current.isMultiSelectMode},get isEdgeHandlesEnabled(){return j.current.isEdgeHandlesEnabled},get isDragMode(){return j.current.isDragMode}}),[]),G=xe.useMemo(()=>({themeColor:D,edgeColor:L,colorMode:M,direction:q,parentNodeStyle:V,selectedNodeIds:s,setSelectedNodeIds:u,selectedEdgeId:l,setSelectedEdgeId:f,isZoomMode:$,setIsZoomMode:h,isMultiSelectMode:X,setIsMultiSelectMode:p,isDragMode:K,setIsDragMode:b,isEdgeHandlesEnabled:ee,setIsEdgeHandlesEnabled:y,isArrayNodeMode:E,setIsArrayNodeMode:C,isPinned:S,setIsPinned:R,isPerformanceMode:_,setIsPerformanceMode:A,cyRef:o,callbacks:I,config:fe,readOnly:N}),[D,L,M,q,V,s,l,$,X,K,ee,E,S,_,N,I,fe]);return H.jsx(xR.Provider,{value:G,children:H.jsx(ER.Provider,{value:i,children:a})})}function Ju(r,e=.2){const t=r.replace(/^#/,""),n=parseInt(t,16);let a=n>>16&255,i=n>>8&255,o=n&255;return a=Math.max(0,Math.floor(a*(1-e))),i=Math.max(0,Math.floor(i*(1-e))),o=Math.max(0,Math.floor(o*(1-e))),"#"+((1<<24)+(a<<16)+(i<<8)+o).toString(16).slice(1).toUpperCase()}function Zq(r,e,t){const n=s=>{const u=/^#?([0-9a-f]{6})$/i.exec((s==null?void 0:s.trim())??"");return u?parseInt(u[1],16):null},a=n(r),i=n(e);if(a===null||i===null)return null;const o=s=>Math.round((a>>s&255)*(1-t)+(i>>s&255)*t);return"#"+((1<<24)+(o(16)<<16)+(o(8)<<8)+o(0)).toString(16).slice(1).toUpperCase()}const kn=r=>r!=null&&r.startsWith("#")?{background:r,highlight:Ju(r,.1),border:Ju(r,.5),property:"gray.900",boolean:"green.200",string:"gray.900",number:"orange.800"}:r==="gray"?{background:"gray.950",highlight:"gray.800",border:"gray.700",property:"gray.200",boolean:"green.400",string:"gray.200",number:"orange.600"}:r==="white"?{background:"white",highlight:"gray.200",border:"gray.400",property:"gray.900",boolean:"green.400",string:"gray.900",number:"orange.600"}:{background:r+".100",highlight:r+".200",border:r+".700",property:"gray.900",boolean:"green.800",string:"gray.900",number:"orange.800"},CR=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:Ju(r)};let t=String(Number(r.slice(-3))+200);t=r.slice(0,-3).concat(t);let n=String(Number(r.slice(-3))-100);return n=r.slice(0,-3).concat(n),{primary:e,secondary:t,light:n}},iw={red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#EBF8FF",100:"#BEE3F8",200:"#90CDF4",300:"#63B3ED",400:"#4299E1",500:"#3182CE",600:"#2B6CB0",700:"#2C5282",800:"#2A4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923",950:"#0d1117"}},zr=(r,e)=>{var i;if(r!=null&&r.startsWith("#"))return r;if(!r)return"whitesmoke";const t=r.replace(/\./g,"-");try{const s=getComputedStyle(document.documentElement).getPropertyValue(`--chakra-colors-${t}`).trim();if(s&&s!=="")return s}catch{}const[n,a]=r.split(".");return n&&a&&((i=iw[n])!=null&&i[Number(a)])?iw[n][Number(a)]:`var(--chakra-colors-${t})`};function gt(r,e,t){return r?t:e}function bs(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=CR(r),n=kn(e).background,a=kn(e).highlight,i=kn(e).border,o=kn(e).property,s=kn(e).property;let u=kn(e).background,l=kn(e).highlight;return u=zr(u)+50,l=zr(l)+20,{bgColor:n,highlightColor:a,borderColor:i,textColor:o,propertyColor:s,secondary:t,bgColorFaint:u,highlightColorFaint:l}}function Rn(r=null){const{colorMode:e}=en(),t=r==null?void 0:r.includes("gray"),n=e==="dark",a=gt(n,"white","gray.900"),i=gt(n,"gray.100","gray.800"),o=gt(n,"gray.200","blackAlpha.400"),s=gt(n,"gray.200","blackAlpha.600"),u=gt(n,"gray.500","gray.700"),l=gt(n,"gray.700","gray.700"),f=gt(n,"gray.900","gray.900"),d=gt(n,"gray.400","gray.500"),h=gt(n,"gray.400","gray.700"),g=gt(n,"gray.900","gray.200"),p=gt(n,t?"gray.900":"gray.200",t?"gray.200":"gray.900"),x=gt(n,"gray.900","gray.200"),b=gt(n,r&&"#000000",r||"#ffffff"),w=gt(n,r||"#ffffff",r?"#000000":"#ffffff"),y=l,E=gt(n,"gray.300","gray.800"),C=gt(n,"white","blackAlpha.400"),S=gt(n,"green.100","green.700");return{canvas:a,background:i,backgroundSecondary:o,darkBackgroundSecondary:s,border:u,darkColor:f,backgroundWhiteColor:C,borderSecondary:l,colorActive:d,colorInactive:h,iconColor:x,moreIconColor:y,colorText:g,themedColorText:p,logoColor:b,logoColorSecondary:w,darkColorActive:E,greenColor:S}}var jo=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(jo||{});function rt({label:r,children:e}){if(!Re.Tooltip.Root){const t=Re.Tooltip;return H.jsx(t,{label:r,placement:"top",fontSize:"xs",children:e})}return H.jsxs(Re.Tooltip.Root,{positioning:{placement:"top"},children:[H.jsx(Re.Tooltip.Trigger,{asChild:!0,children:e}),H.jsx(Re.Tooltip.Positioner,{children:H.jsx(Re.Tooltip.Content,{fontSize:"xs",children:r})})]})}function yt({icon:r,...e}){return H.jsx(Re.IconButton,{...e,children:r})}const Qq=["blue.500","teal.500","green.500","yellow.500","orange.500","red.500","purple.500","pink.500","gray.500"],Jq=["gray.900","gray.600","gray.200","white"];function _R(){const{config:r}=en(),e=r.selectionToolbar||{},t=new Set(e.hide||[]);return{palette:e.palette||Qq,show:n=>!t.has(n)}}function qn(){const{border:r}=Rn();return H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:r})}function SR({onClick:r}){const{colorText:e}=Rn();return H.jsx(rt,{label:"Close",children:H.jsx(yt,{"aria-label":"Close selection tools",icon:H.jsx(Re.Icon,{as:rr.PiX,boxSize:5}),size:"sm",variant:"ghost",color:e,onClick:r})})}function bm({value:r,placeholder:e,ariaLabel:t,width:n="140px",onCommit:a}){const{colorText:i,border:o}=Rn(),[s,u]=xe.useState(r);xe.useEffect(()=>u(r),[r]);const l=()=>{const f=s.trim();f!==r&&a(f)};return H.jsx(Re.Input,{"aria-label":t,size:"xs",w:n,value:s,placeholder:e,color:i,borderColor:o,borderRadius:"8px",onChange:f=>u(f.target.value),onBlur:l,onKeyDown:f=>{f.key==="Enter"&&(l(),f.target.blur()),f.key==="Escape"&&(u(r),f.target.blur())}})}function wm({colors:r,value:e,label:t,onPick:n,onReset:a}){const{colorInactive:i}=Rn();return H.jsxs(Re.HStack,{gap:1,"aria-label":t,role:"group",children:[r.map(o=>{const s=e===o;return H.jsx(rt,{label:`${t}: ${o}`,children:H.jsx(Re.Box,{as:"button","aria-label":`${t} ${o}`,"aria-pressed":s,w:4,h:4,borderRadius:"full",cursor:"pointer",style:{backgroundColor:zr(o)},outline:s?"2px solid white":"none",outlineOffset:"1px",_hover:{transform:"scale(1.15)"},onClick:()=>n(o)})},o)}),a&&H.jsx(rt,{label:`Reset ${t.toLowerCase()}`,children:H.jsx(yt,{"aria-label":`Reset ${t}`,icon:H.jsx(Re.Icon,{as:rr.PiEraser,boxSize:4}),size:"xs",variant:"ghost",color:i,onClick:a})})]})}function eN({edgeId:r,onClose:e}){var d;const{callbacks:t,themeColor:n}=en(),{colorInactive:a}=Rn(),{edgeById:i}=Wm(),{palette:o,show:s}=_R(),u=(d=i.get(r))==null?void 0:d.data,l=u!=null&&u.isEdgeAnimated?"animated":u!=null&&u.isEdgeDashed?"dashed":"solid",f=[{key:"solid",icon:rr.PiLineSegment,label:"Solid"},{key:"dashed",icon:rr.PiLineSegments,label:"Dashed"},{key:"animated",icon:rr.PiFastForward,label:"Animated"}];return H.jsxs(H.Fragment,{children:[H.jsx(SR,{onClick:e}),s("label")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(bm,{ariaLabel:"Edge label",placeholder:"Edge label",value:(u==null?void 0:u.label)||"",onCommit:h=>{var g;return(g=t.onEdgeLabelChange)==null?void 0:g.call(t,r,h)}})]}),s("style")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),f.map(h=>H.jsx(rt,{label:h.label,children:H.jsx(yt,{"aria-label":`Edge style ${h.key}`,"aria-pressed":l===h.key,icon:H.jsx(Re.Icon,{as:h.icon,boxSize:5}),size:"sm",variant:"ghost",color:l===h.key?n:a,onClick:()=>{var g;return(g=t.onEdgeStyleChange)==null?void 0:g.call(t,r,h.key)}})},h.key))]}),s("color")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(wm,{label:"Edge color",colors:o,value:u==null?void 0:u.color,onPick:h=>{var g;return(g=t.onEdgeColorChange)==null?void 0:g.call(t,r,h)},onReset:()=>{var h;return(h=t.onEdgeColorChange)==null?void 0:h.call(t,r,"")}})]}),s("delete")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(rt,{label:"Delete edge",children:H.jsx(yt,{"aria-label":"Delete edge",icon:H.jsx(Re.Icon,{as:rr.PiTrash,boxSize:5}),size:"sm",variant:"ghost",color:"red.400",onClick:()=>{var h;(h=t.onEdgeDelete)==null||h.call(t,r,u),e()}})})]})]})}function rN({ids:r,onClose:e}){var g,p,x,b,w;const{callbacks:t,colorMode:n}=en(),{colorText:a,colorInactive:i}=Rn(),{nodeById:o}=Wm(),{palette:s,show:u}=_R(),l=r.length===1,f=l?(g=o.get(r[0]))==null?void 0:g.data:void 0,d=(p=f==null?void 0:f.config)==null?void 0:p.collapsed,h=y=>r.forEach(y);return H.jsxs(H.Fragment,{children:[H.jsx(SR,{onClick:e}),H.jsx(qn,{}),l&&u("label")?H.jsx(bm,{ariaLabel:"Node label",placeholder:"Node label",value:(f==null?void 0:f.label)??(f==null?void 0:f.headerTitle)??"",onCommit:y=>{var E;return(E=t.onNodeLabelChange)==null?void 0:E.call(t,r[0],y)}}):H.jsxs(Re.Text,{fontSize:"xs",color:a,whiteSpace:"nowrap",px:1,children:[r.length," selected"]}),u("color")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(wm,{label:"Background",colors:s,value:(x=f==null?void 0:f.viewProps)==null?void 0:x.bgColor,onPick:y=>h(E=>{var C;return(C=t.onNodeColorChange)==null?void 0:C.call(t,E,"bg",y)}),onReset:()=>h(y=>{var E;return(E=t.onNodeColorChange)==null?void 0:E.call(t,y,"bg","")})})]}),u("textColor")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(wm,{label:"Text color",colors:Jq,value:(b=f==null?void 0:f.viewProps)==null?void 0:b.textColor,onPick:y=>h(E=>{var C;return(C=t.onNodeColorChange)==null?void 0:C.call(t,E,"text",y)}),onReset:()=>h(y=>{var E;return(E=t.onNodeColorChange)==null?void 0:E.call(t,y,"text","")})})]}),l&&u("icon")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(bm,{ariaLabel:"Node icon",placeholder:"Icon (e.g. PiGear)",width:"120px",value:((w=f==null?void 0:f.config)==null?void 0:w.icon)||"",onCommit:y=>{var E;return(E=t.onNodeIconChange)==null?void 0:E.call(t,r[0],y)}})]}),l&&u("collapse")&&d!==void 0&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(rt,{label:d?"Expand":"Collapse",children:H.jsx(yt,{"aria-label":d?"Expand node":"Collapse node",icon:H.jsx(Re.Icon,{as:d?rr.PiArrowsOutLineVertical:rr.PiArrowsInLineVertical,boxSize:5}),size:"sm",variant:"ghost",color:i,onClick:()=>{var y;return(y=t.onNodeCollapse)==null?void 0:y.call(t,r[0],!d)}})})]}),u("delete")&&H.jsxs(H.Fragment,{children:[H.jsx(qn,{}),H.jsx(rt,{label:l?"Delete node":`Delete ${r.length} nodes`,children:H.jsx(yt,{"aria-label":"Delete selected nodes",icon:H.jsx(Re.Icon,{as:rr.PiTrash,boxSize:5}),size:"sm",variant:"ghost",color:n==="dark"?"red.300":"red.500",onClick:()=>{h(y=>{var E,C;return(C=t.onNodeDelete)==null?void 0:C.call(t,y,((E=o.get(y))==null?void 0:E.data)||{id:y})}),e()}})})]})]})}const tN=[{value:"BT",label:"Bottom to Up",icon:rr.PiArrowUp,flowType:jo.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:rr.PiArrowDown,flowType:jo.TOP_DOWN},{value:"LR",label:"Left to Right",icon:rr.PiArrowRight,flowType:jo.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:rr.PiArrowLeft,flowType:jo.RIGHT_LEFT}],TR=()=>{const{cyRef:r,themeColor:e,direction:t,selectedNodeIds:n,setSelectedNodeIds:a,selectedEdgeId:i,setSelectedEdgeId:o,isZoomMode:s,setIsZoomMode:u,isMultiSelectMode:l,setIsMultiSelectMode:f,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:x,setIsArrayNodeMode:b,isPinned:w,setIsPinned:y,callbacks:E,config:C,readOnly:S}=en(),{nodeById:R}=Wm(),_=C.colorMode==="dark",{background:A,border:P,colorInactive:I,colorText:D,colorActive:L,darkBackgroundSecondary:M}=Rn(),[q,N]=xe.useState(!0),[W,V]=xe.useState(!1),[$,X]=xe.useState(!0),[ee,K]=xe.useState(!1),[j,fe]=xe.useState(!0);xe.useEffect(()=>{const Se=()=>X(window.innerWidth>=768);return Se(),window.addEventListener("resize",Se),()=>window.removeEventListener("resize",Se)},[]),xe.useEffect(()=>{if(!$){N(!0);return}if(!w){N(!1);return}const Se=re=>{N(window.innerHeight-re.clientY<=250)},Ee=()=>N(!1);return window.addEventListener("mousemove",Se),window.addEventListener("mouseleave",Ee),()=>{window.removeEventListener("mousemove",Se),window.removeEventListener("mouseleave",Ee)}},[$,w]);const G=xe.useCallback(Se=>{const Ee=r.current;if(!Ee)return;const re=C.minZoom??.01,ce=C.maxZoom??1.5,_e=.02,me=Ee.zoomingEnabled(),Te=Ee.userZoomingEnabled();Ee.zoomingEnabled(!0),Ee.userZoomingEnabled(!0);let De=Ee.zoom();switch(Se){case"increase":De=Math.min(ce,De+_e),Ee.zoom(De),Ee.center();break;case"decrease":De=Math.max(re,De-_e),Ee.zoom(De),Ee.center();break;case"reset":Ee.fit(void 0,50);break}Ee.zoomingEnabled(me),Ee.userZoomingEnabled(Te)},[r,C.minZoom,C.maxZoom]),z=C.renderSelectedNodeToolbar,Y=n.length>0&&!!z,te=xe.useMemo(()=>{if(!Y)return[];const Se=r.current;return n.map(Ee=>{var _e;const re=Se==null?void 0:Se.getElementById(Ee);return{...((_e=R.get(Ee))==null?void 0:_e.data)??(re!=null&&re.length?re.data():{id:Ee}),isParent:!!(re!=null&&re.length)&&re.isParent()}})},[Y,n,r,R]),ue=xe.useCallback(()=>{var Se;a([]),(Se=E.onNodeDeselect)==null||Se.call(E)},[a,E]),oe=C.renderSelectedEdgeToolbar,Z=!!i&&!!oe,Q=xe.useMemo(()=>{if(!Z||!i)return null;const Se=r.current;if(!Se)return{id:i};const Ee=Se.getElementById(i);return Ee!=null&&Ee.length?Ee.data():{id:i}},[Z,i,r]),ie=xe.useCallback(()=>{var Ee;o(null);const Se=r.current;Se&&Se.edges().unselect(),(Ee=E.onEdgeDeselect)==null||Ee.call(E)},[o,r,E]),de=C.selectionToolbar!==!1&&!S,we=de&&!!i&&!oe,Ae=de&&!we&&n.length>0&&!z,ve=we||Ae,le=q||W||ee||ve,Me=C.renderBottomBar;return Me?H.jsxs(H.Fragment,{children:[Y&&H.jsx(Re.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:z({selectedNodeIds:n,selectedNodeData:te,onDeselect:ue})}),Z&&Q&&H.jsx(Re.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:oe({edgeId:i,edgeData:Q,onDeselect:ie})}),H.jsx(Re.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",children:Me({zoomIn:()=>G("increase"),zoomOut:()=>G("decrease"),resetZoom:()=>G("reset"),direction:t,isZoomMode:s,setIsZoomMode:u,isMultiSelectMode:l,setIsMultiSelectMode:f,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:x,setIsArrayNodeMode:b,selectedNodeIds:n,selectedNodeData:te,selectedEdgeId:i,selectedEdgeData:Q,onNodeDeselect:ue,onEdgeDeselect:ie,callbacks:E})})]}):H.jsxs(H.Fragment,{children:[Y&&H.jsx(Re.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:z({selectedNodeIds:n,selectedNodeData:te,onDeselect:ue})}),Z&&Q&&H.jsx(Re.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:oe({edgeId:i,edgeData:Q,onDeselect:ie})}),!w&&H.jsx(Re.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:H.jsx(rt,{label:"Show Bottom Bar",children:H.jsx(Re.Flex,{align:"center",bg:A,borderColor:P,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{V(!0),N(!0)},onMouseLeave:()=>V(!1),_hover:{bg:M},children:H.jsx(Re.Icon,{ml:-1,as:rr.PiLineVerticalBold,boxSize:5,color:P})})})}),H.jsx(Re.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",transition:"opacity 0.3s ease-in, transform 0.3s ease",transform:le?"translateY(0)":"translateY(100%)",pointerEvents:le?"auto":"none",opacity:le?1:0,onMouseEnter:()=>{w||N(!0)},onMouseLeave:()=>{w||(N(!1),V(!1))},children:H.jsxs(Re.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[H.jsx(Re.Box,{bg:A,alignContent:"center",h:50,borderColor:P,borderWidth:1,borderRadius:"15px",children:H.jsx(Re.HStack,{px:2,gap:1,children:we?H.jsx(eN,{edgeId:i,onClose:ie}):Ae?H.jsx(rN,{ids:n,onClose:ue}):H.jsxs(H.Fragment,{children:[H.jsx(rt,{label:w?"Unpin":"Pin",children:H.jsx(yt,{"aria-label":"Pin",icon:H.jsx(Re.Icon,{as:w?rr.PiPushPinFill:rr.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:w?e:I,onClick:()=>{const Se=!w;y(Se),N(Se)}})}),H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:"Zoom Out",children:H.jsx(yt,{"aria-label":"Zoom out",icon:H.jsx(Re.Icon,{as:rr.PiMinus,boxSize:5}),size:"sm",variant:"ghost",color:D,onClick:()=>G("decrease")})}),H.jsx(rt,{label:"Zoom In",children:H.jsx(yt,{"aria-label":"Zoom in",icon:H.jsx(Re.Icon,{as:rr.PiPlus,boxSize:5}),size:"sm",variant:"ghost",color:D,onClick:()=>G("increase")})}),H.jsx(rt,{label:"Reset Zoom",children:H.jsx(yt,{"aria-label":"Reset zoom",icon:H.jsx(Re.Icon,{as:rr.PiArrowCounterClockwise,boxSize:5}),size:"sm",variant:"ghost",color:D,onClick:()=>G("reset")})}),!j&&H.jsxs(H.Fragment,{children:[H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:s?"Zoom Mode (z)":"Pan Mode (z)",children:H.jsx(yt,{"aria-label":"Toggle zoom mode",icon:H.jsx(Re.Icon,{as:s?rr.PiMagnifyingGlassPlus:rr.PiArrowsOutCardinal,boxSize:5}),size:"sm",variant:"ghost",color:s?e:I,onClick:()=>u(!s)})}),H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:l?"Multi-Select On (m)":"Multi-Select Off (m)",children:H.jsx(yt,{"aria-label":"Toggle multi-select",icon:H.jsx(Re.Icon,{as:rr.PiSelectionPlus,boxSize:5}),size:"sm",variant:"ghost",color:l?e:I,onClick:()=>f(!l)})}),H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:d?"Drag Mode On (d)":"Drag Mode Off (d)",children:H.jsx(yt,{"aria-label":"Toggle drag mode",icon:H.jsx(Re.Icon,{as:rr.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:d?e:I,onClick:()=>h(!d)})}),C.edgeHandles!==!1&&H.jsxs(H.Fragment,{children:[H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:g?"Draw Mode On":"Draw Mode Off",children:H.jsx(yt,{"aria-label":"Toggle draw mode",icon:H.jsx(Re.Icon,{as:rr.PiPencilSimpleLine,boxSize:5}),size:"sm",variant:"ghost",color:g?e:I,onClick:()=>p(!g)})})]}),H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:x?"Array Mode [ ]":"Set Mode { }",children:H.jsx(yt,{"aria-label":"Toggle array mode",icon:H.jsx(Re.Icon,{as:x?rr.PiBracketsSquare:rr.PiBracketsCurly,boxSize:5}),size:"sm",variant:"ghost",color:x?e:I,onClick:()=>{var Ee;const Se=!x;b(Se),(Ee=E.onArrayModeChange)==null||Ee.call(E,Se)}})})]}),H.jsx(Re.Icon,{mx:-1,as:rr.PiLineVerticalThin,boxSize:5,color:P}),H.jsx(rt,{label:j?"Expand toolbar":"Collapse toolbar",children:H.jsx(yt,{"aria-label":"Toggle toolbar collapse",icon:H.jsx(Re.Icon,{as:j?rr.PiCaretRight:rr.PiCaretLeft,boxSize:5}),size:"sm",variant:"ghost",color:I,onClick:()=>fe(!j)})})]})})}),!ve&&H.jsxs(Re.Box,{position:"relative",ml:"auto",onMouseLeave:()=>K(!1),children:[H.jsx(Re.Box,{bg:A,borderWidth:1,borderColor:P,borderRadius:"15px",h:50,px:3,cursor:"pointer",onClick:()=>K(!ee),children:H.jsxs(Re.Flex,{align:"center",h:"100%",children:[H.jsx(rt,{label:"Flow Direction",children:H.jsx(yt,{"aria-label":"Direction",icon:H.jsx(Re.Icon,{as:rr.PiCaretUp,boxSize:5}),size:"sm",variant:"ghost",color:I})}),H.jsx(Re.Text,{fontSize:"xs",color:_?"whiteAlpha.600":"blackAlpha.500",ml:1,children:t})]})}),ee&&H.jsx(Re.Box,{position:"absolute",bottom:"100%",right:0,pb:"10px",zIndex:200,children:H.jsxs(Re.Box,{bg:A,borderWidth:1,borderColor:P,borderRadius:"15px",p:2,minW:"180px",shadow:"lg",children:[tN.map(Se=>H.jsxs(Re.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:_?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var Ee;(Ee=E.onDirectionChange)==null||Ee.call(E,Se.value),K(!1)},children:[H.jsx(Re.Icon,{as:Se.icon,boxSize:5,color:D}),H.jsx(Re.Text,{fontSize:"sm",color:D,flex:1,whiteSpace:"nowrap",children:Se.label}),t===Se.value&&H.jsx(Re.Icon,{as:rr.PiCheck,boxSize:4,color:L})]},Se.value)),H.jsxs(Re.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:_?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var Se;(Se=E.onDirectionChange)==null||Se.call(E,"C"),K(!1)},children:[H.jsx(Re.Icon,{as:rr.PiAlignCenterHorizontal,boxSize:5,color:D}),H.jsx(Re.Text,{fontSize:"sm",color:D,flex:1,whiteSpace:"nowrap",children:"Center"}),t==="C"&&H.jsx(Re.Icon,{as:rr.PiCheck,boxSize:4,color:L})]})]})})]})]})})]})};TR.displayName="BottomBar";const nN=xe.memo(TR),aN=r=>{const n=1/(Math.cbrt(r)*.8);let a=Math.round(650*n),i=Math.round(350*n);return a=Math.max(40,Math.min(450,a)),i=Math.max(30,Math.min(300,i)),{edgeSep:a,rankSep:i}},ao=new Map;let ii=null;const iN=.1,oN=1e3;function RR(){ii=null;const r=Date.now()*iN%oN,e=new Set;for(const{edge:t}of ao.values())t.removed()||e.add(t.cy());e.forEach(t=>t.startBatch());for(const{edge:t,inverted:n}of ao.values())t.removed()||t.style("line-dash-offset",n?r:-r);e.forEach(t=>t.endBatch()),ao.size&&(ii=requestAnimationFrame(RR))}function ow(r,e,t=!1){if(e){ao.set(r,{edge:e,inverted:t}),ii===null&&(ii=requestAnimationFrame(RR));return}ao.delete(r),!ao.size&&ii!==null&&(cancelAnimationFrame(ii),ii=null)}function wc(r,e,t){let n=2;return r.getElementById(e).length===1&&(n-=1),r.getElementById(t).length===1&&(n-=1),n}function sN({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:u,isPerformanceMode:l,animated:f=!1,inverted:d=!1,edgeData:h}){const g=xe.useRef(null),p=xe.useRef({}),[x,b]=xe.useState(2);function w(S){u&&S.style(u(S,t,a,h))}function y(){const S=r.getElementById(e);S.length===0?(w(r.add({data:{id:e,source:t,target:a,label:i,type:n}})),s()):(S.data({source:t,target:a,label:i,type:n}),w(S))}if(xe.useEffect(()=>{const S=wc(r,t,a);b(S),S===0&&y()},[t,a,e,i,n,r]),xe.useEffect(()=>{function S(_){const A=_.target.id();if(A!==t&&A!==a)return;const P=wc(r,t,a);b(P),P===0&&y()}function R(_){const A=_.target.id();if(A!==t&&A!==a)return;const P=wc(r,t,a);b(P),P>0&&r.getElementById(e).length&&(r.getElementById(e).remove(),s())}return r.on("add","node",S),r.on("remove","node",R),()=>{r.off("add","node",S),r.off("remove","node",R),ow(p.current,null),r.getElementById(e).length&&(r.getElementById(e).remove(),s())}},[]),xe.useEffect(()=>{const S=r.getElementById(e),R=f&&!l&&x===0&&S.length>0;ow(p.current,R?S:null,d)},[f,d,l,x,r,e]),xe.useEffect(()=>{if(x)return;const S=r.getElementById(e);S.length&&w(S)},[u,h,x]),x>0)return null;function E(S){return xe.cloneElement(S,{cytoInstance:r,layout:s})}const C=xe.Children.map(o,E);return H.jsx("div",{ref:g,className:"cytoscape-react-edge",children:C})}var xc,sw;function rn(){if(sw)return xc;sw=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return xc=r,xc}var Ec,uw;function AR(){if(uw)return Ec;uw=1;var r=typeof St=="object"&&St&&St.Object===Object&&St;return Ec=r,Ec}var Cc,lw;function An(){if(lw)return Cc;lw=1;var r=AR(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Cc=t,Cc}var _c,fw;function PR(){if(fw)return _c;fw=1;var r=An(),e=function(){return r.Date.now()};return _c=e,_c}var Sc,cw;function uN(){if(cw)return Sc;cw=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Sc=e,Sc}var Tc,dw;function lN(){if(dw)return Tc;dw=1;var r=uN(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Tc=t,Tc}var Rc,vw;function vo(){if(vw)return Rc;vw=1;var r=An(),e=r.Symbol;return Rc=e,Rc}var Ac,hw;function fN(){if(hw)return Ac;hw=1;var r=vo(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),u=o[a];try{o[a]=void 0;var l=!0}catch{}var f=n.call(o);return l&&(s?o[a]=u:delete o[a]),f}return Ac=i,Ac}var Pc,gw;function cN(){if(gw)return Pc;gw=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Pc=t,Pc}var Ic,pw;function yi(){if(pw)return Ic;pw=1;var r=vo(),e=fN(),t=cN(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return Ic=o,Ic}var Dc,yw;function zn(){if(yw)return Dc;yw=1;function r(e){return e!=null&&typeof e=="object"}return Dc=r,Dc}var Bc,mw;function ho(){if(mw)return Bc;mw=1;var r=yi(),e=zn(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return Bc=n,Bc}var Mc,bw;function IR(){if(bw)return Mc;bw=1;var r=lN(),e=rn(),t=ho(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(t(l))return n;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=r(l);var d=i.test(l);return d||o.test(l)?s(l.slice(2),d?2:8):a.test(l)?n:+l}return Mc=u,Mc}var Lc,ww;function dN(){if(ww)return Lc;ww=1;var r=rn(),e=PR(),t=IR(),n="Expected a function",a=Math.max,i=Math.min;function o(s,u,l){var f,d,h,g,p,x,b=0,w=!1,y=!1,E=!0;if(typeof s!="function")throw new TypeError(n);u=t(u)||0,r(l)&&(w=!!l.leading,y="maxWait"in l,h=y?a(t(l.maxWait)||0,u):h,E="trailing"in l?!!l.trailing:E);function C(M){var q=f,N=d;return f=d=void 0,b=M,g=s.apply(N,q),g}function S(M){return b=M,p=setTimeout(A,u),w?C(M):g}function R(M){var q=M-x,N=M-b,W=u-q;return y?i(W,h-N):W}function _(M){var q=M-x,N=M-b;return x===void 0||q>=u||q<0||y&&N>=h}function A(){var M=e();if(_(M))return P(M);p=setTimeout(A,R(M))}function P(M){return p=void 0,E&&f?C(M):(f=d=void 0,g)}function I(){p!==void 0&&clearTimeout(p),b=0,f=x=d=p=void 0}function D(){return p===void 0?g:P(e())}function L(){var M=e(),q=_(M);if(f=arguments,d=this,x=M,q){if(p===void 0)return S(x);if(y)return clearTimeout(p),p=setTimeout(A,u),C(x)}return p===void 0&&(p=setTimeout(A,u)),g}return L.cancel=I,L.flush=D,L}return Lc=o,Lc}var vN=dN();const xw=gl(vN);function xm(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function hN(r){if(Array.isArray(r))return r}function gN(r){if(Array.isArray(r))return xm(r)}function qa(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function pN(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,BR(n.key),n)}}function Na(r,e,t){return e&&pN(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function Gt(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Um(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(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
28
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,o=!0,s=!1;return{s:function(){t=t.call(r)},n:function(){var u=t.next();return o=u.done,u},e:function(u){s=!0,i=u},f:function(){try{o||t.return==null||t.return()}finally{if(s)throw i}}}}function DR(r,e,t){return(e=BR(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function yN(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function mN(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,a,i,o,s=[],u=!0,l=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=i.call(t)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(f){l=!0,a=f}finally{try{if(!u&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(l)throw a}}return s}}function bN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
29
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wN(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
30
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xr(r,e){return hN(r)||mN(r,e)||Um(r,e)||bN()}function el(r){return gN(r)||yN(r)||Um(r)||wN()}function xN(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}function BR(r){var e=xN(r,"string");return typeof e=="symbol"?e:e+""}function at(r){"@babel/helpers - typeof";return at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},at(r)}function Um(r,e){if(r){if(typeof r=="string")return xm(r,e);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xm(r,e):void 0}}var tt=typeof window>"u"?null:window,Ew=tt?tt.navigator:null;tt&&tt.document;var EN=at(""),MR=at({}),CN=at(function(){}),_N=typeof HTMLElement>"u"?"undefined":at(HTMLElement),ws=function(e){return e&&e.instanceString&&$r(e.instanceString)?e.instanceString():null},Ye=function(e){return e!=null&&at(e)==EN},$r=function(e){return e!=null&&at(e)===CN},Tr=function(e){return!Jt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},yr=function(e){return e!=null&&at(e)===MR&&!Tr(e)&&e.constructor===Object},SN=function(e){return e!=null&&at(e)===MR},qe=function(e){return e!=null&&at(e)===at(1)&&!isNaN(e)},TN=function(e){return qe(e)&&Math.floor(e)===e},rl=function(e){if(_N!=="undefined")return e!=null&&e instanceof HTMLElement},Jt=function(e){return xs(e)||LR(e)},xs=function(e){return ws(e)==="collection"&&e._private.single},LR=function(e){return ws(e)==="collection"&&!e._private.single},Hm=function(e){return ws(e)==="core"},OR=function(e){return ws(e)==="stylesheet"},RN=function(e){return ws(e)==="event"},Da=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},AN=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},PN=function(e){return yr(e)&&qe(e.x1)&&qe(e.x2)&&qe(e.y1)&&qe(e.y2)},IN=function(e){return SN(e)&&$r(e.then)},DN=function(){return Ew&&Ew.userAgent.match(/msie|trident|edge/i)},lo=function(e,t){t||(t=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);return i.join("$")});var n=function(){var i=this,o=arguments,s,u=t.apply(i,o),l=n.cache;return(s=l[u])||(s=l[u]=e.apply(i,o)),s};return n.cache={},n},Km=lo(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),bl=lo(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),kR=lo(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),Cw=function(e){return Da(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},_a=function(e,t){return e.slice(-1*t.length)===t},nt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",BN="rgb[a]?\\(("+nt+"[%]?)\\s*,\\s*("+nt+"[%]?)\\s*,\\s*("+nt+"[%]?)(?:\\s*,\\s*("+nt+"))?\\)",MN="rgb[a]?\\((?:"+nt+"[%]?)\\s*,\\s*(?:"+nt+"[%]?)\\s*,\\s*(?:"+nt+"[%]?)(?:\\s*,\\s*(?:"+nt+"))?\\)",LN="hsl[a]?\\(("+nt+")\\s*,\\s*("+nt+"[%])\\s*,\\s*("+nt+"[%])(?:\\s*,\\s*("+nt+"))?\\)",ON="hsl[a]?\\((?:"+nt+")\\s*,\\s*(?:"+nt+"[%])\\s*,\\s*(?:"+nt+"[%])(?:\\s*,\\s*(?:"+nt+"))?\\)",kN="\\#[0-9a-fA-F]{3}",qN="\\#[0-9a-fA-F]{6}",qR=function(e,t){return e<t?-1:e>t?1:0},NN=function(e,t){return-1*qR(e,t)},Ze=Object.assign!=null?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(n!=null)for(var a=Object.keys(n),i=0;i<a.length;i++){var o=a[i];r[o]=n[o]}}return r},FN=function(e){if(!(!(e.length===4||e.length===7)||e[0]!=="#")){var t=e.length===4,n,a,i,o=16;return t?(n=parseInt(e[1]+e[1],o),a=parseInt(e[2]+e[2],o),i=parseInt(e[3]+e[3],o)):(n=parseInt(e[1]+e[2],o),a=parseInt(e[3]+e[4],o),i=parseInt(e[5]+e[6],o)),[n,a,i]}},zN=function(e){var t,n,a,i,o,s,u,l;function f(p,x,b){return b<0&&(b+=1),b>1&&(b-=1),b<1/6?p+(x-p)*6*b:b<1/2?x:b<2/3?p+(x-p)*(2/3-b)*6:p}var d=new RegExp("^"+LN+"$").exec(e);if(d){if(n=parseInt(d[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n=n%360),n/=360,a=parseFloat(d[2]),a<0||a>100||(a=a/100,i=parseFloat(d[3]),i<0||i>100)||(i=i/100,o=d[4],o!==void 0&&(o=parseFloat(o),o<0||o>1)))return;if(a===0)s=u=l=Math.round(i*255);else{var h=i<.5?i*(1+a):i+a-i*a,g=2*i-h;s=Math.round(255*f(g,h,n+1/3)),u=Math.round(255*f(g,h,n)),l=Math.round(255*f(g,h,n-1/3))}t=[s,u,l,o]}return t},$N=function(e){var t,n=new RegExp("^"+BN+"$").exec(e);if(n){t=[];for(var a=[],i=1;i<=3;i++){var o=n[i];if(o[o.length-1]==="%"&&(a[i]=!0),o=parseFloat(o),a[i]&&(o=o/100*255),o<0||o>255)return;t.push(Math.floor(o))}var s=a[1]||a[2]||a[3],u=a[1]&&a[2]&&a[3];if(s&&!u)return;var l=n[4];if(l!==void 0){if(l=parseFloat(l),l<0||l>1)return;t.push(l)}}return t},VN=function(e){return GN[e.toLowerCase()]},NR=function(e){return(Tr(e)?e:null)||VN(e)||FN(e)||$N(e)||zN(e)},GN={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]},FR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(yr(o))throw Error("Tried to set map with object key");i<n.length-1?(t[o]==null&&(t[o]={}),t=t[o]):t[o]=e.value}},zR=function(e){for(var t=e.map,n=e.keys,a=n.length,i=0;i<a;i++){var o=n[i];if(yr(o))throw Error("Tried to get map with object key");if(t=t[o],t==null)return t}return t},Tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Es(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Oc,_w;function Cs(){if(_w)return Oc;_w=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return Oc=r,Oc}var kc,Sw;function WN(){if(Sw)return kc;Sw=1;var r=typeof Tu=="object"&&Tu&&Tu.Object===Object&&Tu;return kc=r,kc}var qc,Tw;function wl(){if(Tw)return qc;Tw=1;var r=WN(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return qc=t,qc}var Nc,Rw;function UN(){if(Rw)return Nc;Rw=1;var r=wl(),e=function(){return r.Date.now()};return Nc=e,Nc}var Fc,Aw;function HN(){if(Aw)return Fc;Aw=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Fc=e,Fc}var zc,Pw;function KN(){if(Pw)return zc;Pw=1;var r=HN(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return zc=t,zc}var $c,Iw;function jm(){if(Iw)return $c;Iw=1;var r=wl(),e=r.Symbol;return $c=e,$c}var Vc,Dw;function jN(){if(Dw)return Vc;Dw=1;var r=jm(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),u=o[a];try{o[a]=void 0;var l=!0}catch{}var f=n.call(o);return l&&(s?o[a]=u:delete o[a]),f}return Vc=i,Vc}var Gc,Bw;function YN(){if(Bw)return Gc;Bw=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Gc=t,Gc}var Wc,Mw;function $R(){if(Mw)return Wc;Mw=1;var r=jm(),e=jN(),t=YN(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return Wc=o,Wc}var Uc,Lw;function XN(){if(Lw)return Uc;Lw=1;function r(e){return e!=null&&typeof e=="object"}return Uc=r,Uc}var Hc,Ow;function _s(){if(Ow)return Hc;Ow=1;var r=$R(),e=XN(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return Hc=n,Hc}var Kc,kw;function ZN(){if(kw)return Kc;kw=1;var r=KN(),e=Cs(),t=_s(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function u(l){if(typeof l=="number")return l;if(t(l))return n;if(e(l)){var f=typeof l.valueOf=="function"?l.valueOf():l;l=e(f)?f+"":f}if(typeof l!="string")return l===0?l:+l;l=r(l);var d=i.test(l);return d||o.test(l)?s(l.slice(2),d?2:8):a.test(l)?n:+l}return Kc=u,Kc}var jc,qw;function QN(){if(qw)return jc;qw=1;var r=Cs(),e=UN(),t=ZN(),n="Expected a function",a=Math.max,i=Math.min;function o(s,u,l){var f,d,h,g,p,x,b=0,w=!1,y=!1,E=!0;if(typeof s!="function")throw new TypeError(n);u=t(u)||0,r(l)&&(w=!!l.leading,y="maxWait"in l,h=y?a(t(l.maxWait)||0,u):h,E="trailing"in l?!!l.trailing:E);function C(M){var q=f,N=d;return f=d=void 0,b=M,g=s.apply(N,q),g}function S(M){return b=M,p=setTimeout(A,u),w?C(M):g}function R(M){var q=M-x,N=M-b,W=u-q;return y?i(W,h-N):W}function _(M){var q=M-x,N=M-b;return x===void 0||q>=u||q<0||y&&N>=h}function A(){var M=e();if(_(M))return P(M);p=setTimeout(A,R(M))}function P(M){return p=void 0,E&&f?C(M):(f=d=void 0,g)}function I(){p!==void 0&&clearTimeout(p),b=0,f=x=d=p=void 0}function D(){return p===void 0?g:P(e())}function L(){var M=e(),q=_(M);if(f=arguments,d=this,x=M,q){if(p===void 0)return S(x);if(y)return clearTimeout(p),p=setTimeout(A,u),C(x)}return p===void 0&&(p=setTimeout(A,u)),g}return L.cancel=I,L.flush=D,L}return jc=o,jc}var JN=QN(),Ss=Es(JN),Yc=tt?tt.performance:null,VR=Yc&&Yc.now?function(){return Yc.now()}:function(){return Date.now()},eF=(function(){if(tt){if(tt.requestAnimationFrame)return function(r){tt.requestAnimationFrame(r)};if(tt.mozRequestAnimationFrame)return function(r){tt.mozRequestAnimationFrame(r)};if(tt.webkitRequestAnimationFrame)return function(r){tt.webkitRequestAnimationFrame(r)};if(tt.msRequestAnimationFrame)return function(r){tt.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(VR())},1e3/60)}})(),tl=function(e){return eF(e)},ta=VR,oi=9261,GR=65599,Zi=5381,WR=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oi,n=t,a;a=e.next(),!a.done;)n=n*GR+a.value|0;return n},ls=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:oi;return t*GR+e|0},fs=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zi;return(t<<5)+t+e|0},rF=function(e,t){return e*2097152+t},wa=function(e){return e[0]*2097152+e[1]},Ru=function(e,t){return[ls(e[0],t[0]),fs(e[1],t[1])]},Nw=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e[a++]:n.done=!0,n}};return WR(o,t)},ci=function(e,t){var n={value:0,done:!1},a=0,i=e.length,o={next:function(){return a<i?n.value=e.charCodeAt(a++):n.done=!0,n}};return WR(o,t)},UR=function(){return tF(arguments)},tF=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];n===0?t=ci(a):t=ci(a,t)}return t};function nF(r,e,t,n,a){var i=a*Math.PI/180,o=Math.cos(i)*(r-t)-Math.sin(i)*(e-n)+t,s=Math.sin(i)*(r-t)+Math.cos(i)*(e-n)+n;return{x:o,y:s}}var aF=function(e,t,n,a,i,o){return{x:(e-n)*i+n,y:(t-a)*o+a}};function iF(r,e,t){if(t===0)return r;var n=(e.x1+e.x2)/2,a=(e.y1+e.y2)/2,i=e.w/e.h,o=1/i,s=nF(r.x,r.y,n,a,t),u=aF(s.x,s.y,n,a,i,o);return{x:u.x,y:u.y}}var Fw=!0,oF=console.warn!=null,sF=console.trace!=null,Ym=Number.MAX_SAFE_INTEGER||9007199254740991,HR=function(){return!0},nl=function(){return!1},zw=function(){return 0},Xm=function(){},kr=function(e){throw new Error(e)},KR=function(e){if(e!==void 0)Fw=!!e;else return Fw},Cr=function(e){KR()&&(oF?console.warn(e):(console.log(e),sF&&console.trace()))},uF=function(e){return Ze({},e)},Nn=function(e){return e==null?e:Tr(e)?e.slice():yr(e)?uF(e):e},lF=function(e){return e.slice()},jR=function(e,t){for(t=e="";e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return t},fF={},YR=function(){return fF},wt=function(e){var t=Object.keys(e);return function(n){for(var a={},i=0;i<t.length;i++){var o=t[i],s=n==null?void 0:n[o];a[o]=s===void 0?e[o]:s}return a}},Ba=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},Zm=function(e){e.splice(0,e.length)},cF=function(e,t){for(var n=0;n<t.length;n++){var a=t[n];e.push(a)}},$t=function(e,t,n){return n&&(t=kR(n,t)),e[t]},ea=function(e,t,n,a){n&&(t=kR(n,t)),e[t]=a},dF=(function(){function r(){qa(this,r),this._obj={}}return Na(r,[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return this._obj[t]!==void 0}},{key:"get",value:function(t){return this._obj[t]}}])})(),ra=typeof Map<"u"?Map:dF,vF="undefined",hF=(function(){function r(e){if(qa(this,r),this._obj=Object.create(null),this.size=0,e!=null){var t;e.instanceString!=null&&e.instanceString()===this.instanceString()?t=e.toArray():t=e;for(var n=0;n<t.length;n++)this.add(t[n])}}return Na(r,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;n[t]!==1&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;n[t]===1&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return this._obj[t]===1}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])})(),go=(typeof Set>"u"?"undefined":at(Set))!==vF?Set:hF,xl=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Hm(e)){kr("An element must have a core reference and parameters set");return}var a=t.group;if(a==null&&(t.data&&t.data.source!=null&&t.data.target!=null?a="edges":a="nodes"),a!=="nodes"&&a!=="edges"){kr("An element must be of type `nodes` or `edges`; you specified `"+a+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data: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:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?a==="edges":!!t.pannable,active:!1,classes:new go,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(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,s=e.pan(),u=e.zoom();i.position={x:(o.x-s.x)/u,y:(o.y-s.y)/u}}var l=[];Tr(t.classes)?l=t.classes:Ye(t.classes)&&(l=t.classes.split(/\s+/));for(var f=0,d=l.length;f<d;f++){var h=l[f];!h||h===""||i.classes.add(h)}this.createEmitter(),(n===void 0||n)&&this.restore();var g=t.style||t.css;g&&(Cr("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(g))},$w=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;yr(n)&&!Jt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!$r(a)?a:i,a=$r(a)?a:function(){};for(var s=this._private.cy,u=n=Ye(n)?this.filter(n):n,l=[],f=[],d={},h={},g={},p=0,x,b=this.byGroup(),w=b.nodes,y=b.edges,E=0;E<u.length;E++){var C=u[E],S=C.id();C.isNode()&&(l.unshift(C),e.bfs&&(g[S]=!0,f.push(C)),h[S]=0)}for(var R=function(){var M=e.bfs?l.shift():l.pop(),q=M.id();if(e.dfs){if(g[q])return 0;g[q]=!0,f.push(M)}var N=h[q],W=d[q],V=W!=null?W.source():null,$=W!=null?W.target():null,X=W==null?void 0:M.same(V)?$[0]:V[0],ee;if(ee=a(M,W,X,p++,N),ee===!0)return x=M,1;if(ee===!1)return 1;for(var K=M.connectedEdges().filter(function(Y){return(!i||Y.source().same(M))&&y.has(Y)}),j=0;j<K.length;j++){var fe=K[j],G=fe.connectedNodes().filter(function(Y){return!Y.same(M)&&w.has(Y)}),z=G.id();G.length!==0&&!g[z]&&(G=G[0],l.push(G),e.bfs&&(g[z]=!0,f.push(G)),d[z]=fe,h[z]=h[q]+1)}},_;l.length!==0&&(_=R(),!(_!==0&&_===1)););for(var A=s.collection(),P=0;P<f.length;P++){var I=f[P],D=d[I.id()];D!=null&&A.push(D),A.push(I)}return{path:s.collection(A),found:s.collection(x)}}},cs={breadthFirstSearch:$w({bfs:!0}),depthFirstSearch:$w({dfs:!0})};cs.bfs=cs.breadthFirstSearch;cs.dfs=cs.depthFirstSearch;var Fu={exports:{}},gF=Fu.exports,Vw;function pF(){return Vw||(Vw=1,(function(r,e){(function(){var t,n,a,i,o,s,u,l,f,d,h,g,p,x,b;a=Math.floor,d=Math.min,n=function(w,y){return w<y?-1:w>y?1:0},f=function(w,y,E,C,S){var R;if(E==null&&(E=0),S==null&&(S=n),E<0)throw new Error("lo must be non-negative");for(C==null&&(C=w.length);E<C;)R=a((E+C)/2),S(y,w[R])<0?C=R:E=R+1;return[].splice.apply(w,[E,E-E].concat(y)),y},s=function(w,y,E){return E==null&&(E=n),w.push(y),x(w,0,w.length-1,E)},o=function(w,y){var E,C;return y==null&&(y=n),E=w.pop(),w.length?(C=w[0],w[0]=E,b(w,0,y)):C=E,C},l=function(w,y,E){var C;return E==null&&(E=n),C=w[0],w[0]=y,b(w,0,E),C},u=function(w,y,E){var C;return E==null&&(E=n),w.length&&E(w[0],y)<0&&(C=[w[0],y],y=C[0],w[0]=C[1],b(w,0,E)),y},i=function(w,y){var E,C,S,R,_,A;for(y==null&&(y=n),R=(function(){A=[];for(var P=0,I=a(w.length/2);0<=I?P<I:P>I;0<=I?P++:P--)A.push(P);return A}).apply(this).reverse(),_=[],C=0,S=R.length;C<S;C++)E=R[C],_.push(b(w,E,y));return _},p=function(w,y,E){var C;if(E==null&&(E=n),C=w.indexOf(y),C!==-1)return x(w,0,C,E),b(w,C,E)},h=function(w,y,E){var C,S,R,_,A;if(E==null&&(E=n),S=w.slice(0,y),!S.length)return S;for(i(S,E),A=w.slice(y),R=0,_=A.length;R<_;R++)C=A[R],u(S,C,E);return S.sort(E).reverse()},g=function(w,y,E){var C,S,R,_,A,P,I,D,L;if(E==null&&(E=n),y*10<=w.length){if(R=w.slice(0,y).sort(E),!R.length)return R;for(S=R[R.length-1],I=w.slice(y),_=0,P=I.length;_<P;_++)C=I[_],E(C,S)<0&&(f(R,C,0,null,E),R.pop(),S=R[R.length-1]);return R}for(i(w,E),L=[],A=0,D=d(y,w.length);0<=D?A<D:A>D;0<=D?++A:--A)L.push(o(w,E));return L},x=function(w,y,E,C){var S,R,_;for(C==null&&(C=n),S=w[E];E>y;){if(_=E-1>>1,R=w[_],C(S,R)<0){w[E]=R,E=_;continue}break}return w[E]=S},b=function(w,y,E){var C,S,R,_,A;for(E==null&&(E=n),S=w.length,A=y,R=w[y],C=2*y+1;C<S;)_=C+1,_<S&&!(E(w[C],w[_])<0)&&(C=_),w[y]=w[C],y=C,C=2*y+1;return w[y]=R,x(w,A,y,E)},t=(function(){w.push=s,w.pop=o,w.replace=l,w.pushpop=u,w.heapify=i,w.updateItem=p,w.nlargest=h,w.nsmallest=g;function w(y){this.cmp=y??n,this.nodes=[]}return w.prototype.push=function(y){return s(this.nodes,y,this.cmp)},w.prototype.pop=function(){return o(this.nodes,this.cmp)},w.prototype.peek=function(){return this.nodes[0]},w.prototype.contains=function(y){return this.nodes.indexOf(y)!==-1},w.prototype.replace=function(y){return l(this.nodes,y,this.cmp)},w.prototype.pushpop=function(y){return u(this.nodes,y,this.cmp)},w.prototype.heapify=function(){return i(this.nodes,this.cmp)},w.prototype.updateItem=function(y){return p(this.nodes,y,this.cmp)},w.prototype.clear=function(){return this.nodes=[]},w.prototype.empty=function(){return this.nodes.length===0},w.prototype.size=function(){return this.nodes.length},w.prototype.clone=function(){var y;return y=new w,y.nodes=this.nodes.slice(0),y},w.prototype.toArray=function(){return this.nodes.slice(0)},w.prototype.insert=w.prototype.push,w.prototype.top=w.prototype.peek,w.prototype.front=w.prototype.peek,w.prototype.has=w.prototype.contains,w.prototype.copy=w.prototype.clone,w})(),(function(w,y){return r.exports=y()})(this,function(){return t})}).call(gF)})(Fu)),Fu.exports}var Xc,Gw;function yF(){return Gw||(Gw=1,Xc=pF()),Xc}var mF=yF(),Ts=Es(mF),bF=wt({root:null,weight:function(e){return 1},directed:!1}),wF={dijkstra:function(e){if(!yr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=bF(e),a=n.root,i=n.weight,o=n.directed,s=this,u=i,l=Ye(a)?this.filter(a)[0]:a[0],f={},d={},h={},g=this.byGroup(),p=g.nodes,x=g.edges;x.unmergeBy(function(N){return N.isLoop()});for(var b=function(W){return f[W.id()]},w=function(W,V){f[W.id()]=V,y.updateItem(W)},y=new Ts(function(N,W){return b(N)-b(W)}),E=0;E<p.length;E++){var C=p[E];f[C.id()]=C.same(l)?0:1/0,y.push(C)}for(var S=function(W,V){for(var $=(o?W.edgesTo(V):W.edgesWith(V)).intersect(x),X=1/0,ee,K=0;K<$.length;K++){var j=$[K],fe=u(j);(fe<X||!ee)&&(X=fe,ee=j)}return{edge:ee,dist:X}};y.size()>0;){var R=y.pop(),_=b(R),A=R.id();if(h[A]=_,_!==1/0)for(var P=R.neighborhood().intersect(p),I=0;I<P.length;I++){var D=P[I],L=D.id(),M=S(R,D),q=_+M.dist;q<b(D)&&(w(D,q),d[L]={node:R,edge:M.edge})}}return{distanceTo:function(W){var V=Ye(W)?p.filter(W)[0]:W[0];return h[V.id()]},pathTo:function(W){var V=Ye(W)?p.filter(W)[0]:W[0],$=[],X=V,ee=X.id();if(V.length>0)for($.unshift(V);d[ee];){var K=d[ee];$.unshift(K.edge),$.unshift(K.node),X=K.node,ee=X.id()}return s.spawn($)}}}},xF={kruskal:function(e){e=e||function(E){return 1};for(var t=this.byGroup(),n=t.nodes,a=t.edges,i=n.length,o=new Array(i),s=n,u=function(C){for(var S=0;S<o.length;S++){var R=o[S];if(R.has(C))return S}},l=0;l<i;l++)o[l]=this.spawn(n[l]);for(var f=a.sort(function(E,C){return e(E)-e(C)}),d=0;d<f.length;d++){var h=f[d],g=h.source()[0],p=h.target()[0],x=u(g),b=u(p),w=o[x],y=o[b];x!==b&&(s.merge(h),w.merge(y),o.splice(b,1))}return s}},EF=wt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),CF={aStar:function(e){var t=this.cy(),n=EF(e),a=n.root,i=n.goal,o=n.heuristic,s=n.directed,u=n.weight;a=t.collection(a)[0],i=t.collection(i)[0];var l=a.id(),f=i.id(),d={},h={},g={},p=new Ts(function(ee,K){return h[ee.id()]-h[K.id()]}),x=new go,b={},w={},y=function(K,j){p.push(K),x.add(j)},E,C,S=function(){E=p.pop(),C=E.id(),x.delete(C)},R=function(K){return x.has(K)};y(a,l),d[l]=0,h[l]=o(a);for(var _=0;p.size()>0;){if(S(),_++,C===f){for(var A=[],P=i,I=f,D=w[I];A.unshift(P),D!=null&&A.unshift(D),P=b[I],P!=null;)I=P.id(),D=w[I];return{found:!0,distance:d[C],path:this.spawn(A),steps:_}}g[C]=!0;for(var L=E._private.edges,M=0;M<L.length;M++){var q=L[M];if(this.hasElementWithId(q.id())&&!(s&&q.data("source")!==C)){var N=q.source(),W=q.target(),V=N.id()!==C?N:W,$=V.id();if(this.hasElementWithId($)&&!g[$]){var X=d[C]+u(q);if(!R($)){d[$]=X,h[$]=X+o(V),y(V,$),b[$]=E,w[$]=q;continue}X<d[$]&&(d[$]=X,h[$]=X+o(V),b[$]=E,w[$]=q)}}}}return{found:!1,distance:void 0,path:void 0,steps:_}}},_F=wt({weight:function(e){return 1},directed:!1}),SF={floydWarshall:function(e){for(var t=this.cy(),n=_F(e),a=n.weight,i=n.directed,o=a,s=this.byGroup(),u=s.nodes,l=s.edges,f=u.length,d=f*f,h=function(fe){return u.indexOf(fe)},g=function(fe){return u[fe]},p=new Array(d),x=0;x<d;x++){var b=x%f,w=(x-b)/f;w===b?p[x]=0:p[x]=1/0}for(var y=new Array(d),E=new Array(d),C=0;C<l.length;C++){var S=l[C],R=S.source()[0],_=S.target()[0];if(R!==_){var A=h(R),P=h(_),I=A*f+P,D=o(S);if(p[I]>D&&(p[I]=D,y[I]=P,E[I]=S),!i){var L=P*f+A;!i&&p[L]>D&&(p[L]=D,y[L]=A,E[L]=S)}}}for(var M=0;M<f;M++)for(var q=0;q<f;q++)for(var N=q*f+M,W=0;W<f;W++){var V=q*f+W,$=M*f+W;p[N]+p[$]<p[V]&&(p[V]=p[N]+p[$],y[V]=y[N])}var X=function(fe){return(Ye(fe)?t.filter(fe):fe)[0]},ee=function(fe){return h(X(fe))},K={distance:function(fe,G){var z=ee(fe),Y=ee(G);return p[z*f+Y]},path:function(fe,G){var z=ee(fe),Y=ee(G),te=g(z);if(z===Y)return te.collection();if(y[z*f+Y]==null)return t.collection();var ue=t.collection(),oe=z,Z;for(ue.merge(te);z!==Y;)oe=z,z=y[z*f+Y],Z=E[oe*f+z],ue.merge(Z),ue.merge(g(z));return ue}};return K}},TF=wt({weight:function(e){return 1},directed:!1,root:null}),RF={bellmanFord:function(e){var t=this,n=TF(e),a=n.weight,i=n.directed,o=n.root,s=a,u=this,l=this.cy(),f=this.byGroup(),d=f.edges,h=f.nodes,g=h.length,p=new ra,x=!1,b=[];o=l.collection(o)[0],d.unmergeBy(function(le){return le.isLoop()});for(var w=d.length,y=function(Me){var Se=p.get(Me.id());return Se||(Se={},p.set(Me.id(),Se)),Se},E=function(Me){return(Ye(Me)?l.$(Me):Me)[0]},C=function(Me){return y(E(Me)).dist},S=function(Me){for(var Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,Ee=E(Me),re=[],ce=Ee;;){if(ce==null)return t.spawn();var _e=y(ce),me=_e.edge,Te=_e.pred;if(re.unshift(ce[0]),ce.same(Se)&&re.length>0)break;me!=null&&re.unshift(me),ce=Te}return u.spawn(re)},R=0;R<g;R++){var _=h[R],A=y(_);_.same(o)?A.dist=0:A.dist=1/0,A.pred=null,A.edge=null}for(var P=!1,I=function(Me,Se,Ee,re,ce,_e){var me=re.dist+_e;me<ce.dist&&!Ee.same(re.edge)&&(ce.dist=me,ce.pred=Me,ce.edge=Ee,P=!0)},D=1;D<g;D++){P=!1;for(var L=0;L<w;L++){var M=d[L],q=M.source(),N=M.target(),W=s(M),V=y(q),$=y(N);I(q,N,M,V,$,W),i||I(N,q,M,$,V,W)}if(!P)break}if(P)for(var X=[],ee=0;ee<w;ee++){var K=d[ee],j=K.source(),fe=K.target(),G=s(K),z=y(j).dist,Y=y(fe).dist;if(z+G<Y||!i&&Y+G<z)if(x||(Cr("Graph contains a negative weight cycle for Bellman-Ford"),x=!0),e.findNegativeWeightCycles!==!1){var te=[];z+G<Y&&te.push(j),!i&&Y+G<z&&te.push(fe);for(var ue=te.length,oe=0;oe<ue;oe++){var Z=te[oe],Q=[Z];Q.push(y(Z).edge);for(var ie=y(Z).pred;Q.indexOf(ie)===-1;)Q.push(ie),Q.push(y(ie).edge),ie=y(ie).pred;Q=Q.slice(Q.indexOf(ie));for(var de=Q[0].id(),we=0,Ae=2;Ae<Q.length;Ae+=2)Q[Ae].id()<de&&(de=Q[Ae].id(),we=Ae);Q=Q.slice(we).concat(Q.slice(0,we)),Q.push(Q[0]);var ve=Q.map(function(le){return le.id()}).join(",");X.indexOf(ve)===-1&&(b.push(u.spawn(Q)),X.push(ve))}}else break}return{distanceTo:C,pathTo:S,hasNegativeWeightCycle:x,negativeWeightCycles:b}}},AF=Math.sqrt(2),PF=function(e,t,n){n.length===0&&kr("Karger-Stein must be run on a connected (sub)graph");for(var a=n[e],i=a[1],o=a[2],s=t[i],u=t[o],l=n,f=l.length-1;f>=0;f--){var d=l[f],h=d[1],g=d[2];(t[h]===s&&t[g]===u||t[h]===u&&t[g]===s)&&l.splice(f,1)}for(var p=0;p<l.length;p++){var x=l[p];x[1]===u?(l[p]=x.slice(),l[p][1]=s):x[2]===u&&(l[p]=x.slice(),l[p][2]=s)}for(var b=0;b<t.length;b++)t[b]===u&&(t[b]=s);return l},Zc=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=PF(i,e,t),n--}return t},IF={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,a=t.edges;a.unmergeBy(function($){return $.isLoop()});var i=n.length,o=a.length,s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),u=Math.floor(i/AF);if(i<2){kr("At least 2 nodes are required for Karger-Stein algorithm");return}for(var l=[],f=0;f<o;f++){var d=a[f];l.push([f,n.indexOf(d.source()),n.indexOf(d.target())])}for(var h=1/0,g=[],p=new Array(i),x=new Array(i),b=new Array(i),w=function(X,ee){for(var K=0;K<i;K++)ee[K]=X[K]},y=0;y<=s;y++){for(var E=0;E<i;E++)x[E]=E;var C=Zc(x,l.slice(),i,u),S=C.slice();w(x,b);var R=Zc(x,C,u,2),_=Zc(b,S,u,2);R.length<=_.length&&R.length<h?(h=R.length,g=R,w(x,p)):_.length<=R.length&&_.length<h&&(h=_.length,g=_,w(b,p))}for(var A=this.spawn(g.map(function($){return a[$[0]]})),P=this.spawn(),I=this.spawn(),D=p[0],L=0;L<p.length;L++){var M=p[L],q=n[L];M===D?P.merge(q):I.merge(q)}var N=function(X){var ee=e.spawn();return X.forEach(function(K){ee.merge(K),K.connectedEdges().forEach(function(j){e.contains(j)&&!A.contains(j)&&ee.merge(j)})}),ee},W=[N(P),N(I)],V={cut:A,components:W,partition1:P,partition2:I};return V}},Qc,DF=function(e){return{x:e.x,y:e.y}},El=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},XR=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Ji=function(e){return{x:e[0],y:e[1]}},BF=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.min(o,a))}return a},MF=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=-1/0,i=t;i<n;i++){var o=e[i];isFinite(o)&&(a=Math.max(o,a))}return a},LF=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=0,i=0,o=t;o<n;o++){var s=e[o];isFinite(s)&&(a+=s,i++)}return a/i},OF=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;a?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var s=0,u=e.length-1;u>=0;u--){var l=e[u];o?isFinite(l)||(e[u]=-1/0,s++):e.splice(u,1)}i&&e.sort(function(h,g){return h-g});var f=e.length,d=Math.floor(f/2);return f%2!==0?e[d+1+s]:(e[d-1+s]+e[d+s])/2},kF=function(e){return Math.PI*e/180},Au=function(e,t){return Math.atan2(t,e)-Math.PI/2},Qm=Math.log2||function(r){return Math.log(r)/Math.log(2)},Jm=function(e){return e>0?1:e<0?-1:0},di=function(e,t){return Math.sqrt(ti(e,t))},ti=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},qF=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},ut=function(e,t,n,a){return(1-a)*(1-a)*e+2*(1-a)*a*t+a*a*n},io=function(e,t,n,a){return{x:ut(e.x,t.x,n.x,a),y:ut(e.y,t.y,n.y,a)}},NF=function(e,t,n,a){var i={x:t.x-e.x,y:t.y-e.y},o=di(e,t),s={x:i.x/o,y:i.y/o};return n=n??0,a=a??n*o,{x:e.x+s.x*a,y:e.y+s.y*a}},ds=function(e,t,n){return Math.max(e,Math.min(n,t))},Lt=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},FF=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},zF=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},$F=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},ZR=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},zu=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},$u=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,a,i,o;if(t.length===1)n=a=i=o=t[0];else if(t.length===2)n=i=t[0],o=a=t[1];else if(t.length===4){var s=Xr(t,4);n=s[0],a=s[1],i=s[2],o=s[3]}return e.x1-=o,e.x2+=a,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ww=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},e0=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)},Sa=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Uw=function(e,t){return Sa(e,t.x,t.y)},QR=function(e,t){return Sa(e,t.x1,t.y1)&&Sa(e,t.x2,t.y2)},VF=(Qc=Math.hypot)!==null&&Qc!==void 0?Qc:function(r,e){return Math.sqrt(r*r+e*e)};function GF(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(A,P){return{x:A.x+P.x,y:A.y+P.y}},n=function(A,P){return{x:A.x-P.x,y:A.y-P.y}},a=function(A,P){return{x:A.x*P,y:A.y*P}},i=function(A,P){return A.x*P.y-A.y*P.x},o=function(A){var P=VF(A.x,A.y);return P===0?{x:0,y:0}:{x:A.x/P,y:A.y/P}},s=function(A){for(var P=0,I=0;I<A.length;I++){var D=A[I],L=A[(I+1)%A.length];P+=D.x*L.y-L.x*D.y}return P/2},u=function(A,P,I,D){var L=n(P,A),M=n(D,I),q=i(L,M);if(Math.abs(q)<1e-9)return t(A,a(L,.5));var N=i(n(I,A),M)/q;return t(A,a(L,N))},l=r.map(function(_){return{x:_.x,y:_.y}});s(l)<0&&l.reverse();for(var f=l.length,d=[],h=0;h<f;h++){var g=l[h],p=l[(h+1)%f],x=n(p,g),b=o({x:x.y,y:-x.x});d.push(b)}for(var w=d.map(function(_,A){var P=t(l[A],a(_,e)),I=t(l[(A+1)%f],a(_,e));return{p1:P,p2:I}}),y=[],E=0;E<f;E++){var C=w[(E-1+f)%f],S=w[E],R=u(C.p1,C.p2,S.p1,S.p2);y.push(R)}return y}function WF(r,e,t,n,a,i){var o=JF(r,e,t,n,a),s=GF(o,i),u=Lt();return s.forEach(function(l){return ZR(u,l.x,l.y)}),u}var JR=function(e,t,n,a,i,o,s){var u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",l=u==="auto"?Ma(i,o):u,f=i/2,d=o/2;l=Math.min(l,f,d);var h=l!==f,g=l!==d,p;if(h){var x=n-f+l-s,b=a-d-s,w=n+f-l+s,y=b;if(p=Ta(e,t,n,a,x,b,w,y,!1),p.length>0)return p}if(g){var E=n+f+s,C=a-d+l-s,S=E,R=a+d-l+s;if(p=Ta(e,t,n,a,E,C,S,R,!1),p.length>0)return p}if(h){var _=n-f+l-s,A=a+d+s,P=n+f-l+s,I=A;if(p=Ta(e,t,n,a,_,A,P,I,!1),p.length>0)return p}if(g){var D=n-f-s,L=a-d+l-s,M=D,q=a+d-l+s;if(p=Ta(e,t,n,a,D,L,M,q,!1),p.length>0)return p}var N;{var W=n-f+l,V=a-d+l;if(N=Yo(e,t,n,a,W,V,l+s),N.length>0&&N[0]<=W&&N[1]<=V)return[N[0],N[1]]}{var $=n+f-l,X=a-d+l;if(N=Yo(e,t,n,a,$,X,l+s),N.length>0&&N[0]>=$&&N[1]<=X)return[N[0],N[1]]}{var ee=n+f-l,K=a+d-l;if(N=Yo(e,t,n,a,ee,K,l+s),N.length>0&&N[0]>=ee&&N[1]>=K)return[N[0],N[1]]}{var j=n-f+l,fe=a+d-l;if(N=Yo(e,t,n,a,j,fe,l+s),N.length>0&&N[0]<=j&&N[1]>=fe)return[N[0],N[1]]}return[]},UF=function(e,t,n,a,i,o,s){var u=s,l=Math.min(n,i),f=Math.max(n,i),d=Math.min(a,o),h=Math.max(a,o);return l-u<=e&&e<=f+u&&d-u<=t&&t<=h+u},HF=function(e,t,n,a,i,o,s,u,l){var f={x1:Math.min(n,s,i)-l,x2:Math.max(n,s,i)+l,y1:Math.min(a,u,o)-l,y2:Math.max(a,u,o)+l};return!(e<f.x1||e>f.x2||t<f.y1||t>f.y2)},KF=function(e,t,n,a){n-=a;var i=t*t-4*e*n;if(i<0)return[];var o=Math.sqrt(i),s=2*e,u=(-t+o)/s,l=(-t-o)/s;return[u,l]},jF=function(e,t,n,a,i){var o=1e-5;e===0&&(e=o),t/=e,n/=e,a/=e;var s,u,l,f,d,h,g,p;if(u=(3*n-t*t)/9,l=-(27*a)+t*(9*n-2*(t*t)),l/=54,s=u*u*u+l*l,i[1]=0,g=t/3,s>0){d=l+Math.sqrt(s),d=d<0?-Math.pow(-d,1/3):Math.pow(d,1/3),h=l-Math.sqrt(s),h=h<0?-Math.pow(-h,1/3):Math.pow(h,1/3),i[0]=-g+d+h,g+=(d+h)/2,i[4]=i[2]=-g,g=Math.sqrt(3)*(-h+d)/2,i[3]=g,i[5]=-g;return}if(i[5]=i[3]=0,s===0){p=l<0?-Math.pow(-l,1/3):Math.pow(l,1/3),i[0]=-g+2*p,i[4]=i[2]=-(p+g);return}u=-u,f=u*u*u,f=Math.acos(l/Math.sqrt(f)),p=2*Math.sqrt(u),i[0]=-g+p*Math.cos(f/3),i[2]=-g+p*Math.cos((f+2*Math.PI)/3),i[4]=-g+p*Math.cos((f+4*Math.PI)/3)},YF=function(e,t,n,a,i,o,s,u){var l=1*n*n-4*n*i+2*n*s+4*i*i-4*i*s+s*s+a*a-4*a*o+2*a*u+4*o*o-4*o*u+u*u,f=9*n*i-3*n*n-3*n*s-6*i*i+3*i*s+9*a*o-3*a*a-3*a*u-6*o*o+3*o*u,d=3*n*n-6*n*i+n*s-n*e+2*i*i+2*i*e-s*e+3*a*a-6*a*o+a*u-a*t+2*o*o+2*o*t-u*t,h=1*n*i-n*n+n*e-i*e+a*o-a*a+a*t-o*t,g=[];jF(l,f,d,h,g);for(var p=1e-7,x=[],b=0;b<6;b+=2)Math.abs(g[b+1])<p&&g[b]>=0&&g[b]<=1&&x.push(g[b]);x.push(1),x.push(0);for(var w=-1,y,E,C,S=0;S<x.length;S++)y=Math.pow(1-x[S],2)*n+2*(1-x[S])*x[S]*i+x[S]*x[S]*s,E=Math.pow(1-x[S],2)*a+2*(1-x[S])*x[S]*o+x[S]*x[S]*u,C=Math.pow(y-e,2)+Math.pow(E-t,2),w>=0?C<w&&(w=C):w=C;return w},XF=function(e,t,n,a,i,o){var s=[e-n,t-a],u=[i-n,o-a],l=u[0]*u[0]+u[1]*u[1],f=s[0]*s[0]+s[1]*s[1],d=s[0]*u[0]+s[1]*u[1],h=d*d/l;return d<0?f:h>l?(e-i)*(e-i)+(t-o)*(t-o):f-h},Vt=function(e,t,n){for(var a,i,o,s,u,l=0,f=0;f<n.length/2;f++)if(a=n[f*2],i=n[f*2+1],f+1<n.length/2?(o=n[(f+1)*2],s=n[(f+1)*2+1]):(o=n[(f+1-n.length/2)*2],s=n[(f+1-n.length/2)*2+1]),!(a==e&&o==e))if(a>=e&&e>=o||a<=e&&e<=o)u=(e-a)/(o-a)*(s-i)+i,u>t&&l++;else continue;return l%2!==0},na=function(e,t,n,a,i,o,s,u,l){var f=new Array(n.length),d;u[0]!=null?(d=Math.atan(u[1]/u[0]),u[0]<0?d=d+Math.PI/2:d=-d-Math.PI/2):d=u;for(var h=Math.cos(-d),g=Math.sin(-d),p=0;p<f.length/2;p++)f[p*2]=o/2*(n[p*2]*h-n[p*2+1]*g),f[p*2+1]=s/2*(n[p*2+1]*h+n[p*2]*g),f[p*2]+=a,f[p*2+1]+=i;var x;if(l>0){var b=il(f,-l);x=al(b)}else x=f;return Vt(e,t,x)},ZF=function(e,t,n,a,i,o,s,u){for(var l=new Array(n.length*2),f=0;f<u.length;f++){var d=u[f];l[f*4+0]=d.startX,l[f*4+1]=d.startY,l[f*4+2]=d.stopX,l[f*4+3]=d.stopY;var h=Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2);if(h<=Math.pow(d.radius,2))return!0}return Vt(e,t,l)},al=function(e){for(var t=new Array(e.length/2),n,a,i,o,s,u,l,f,d=0;d<e.length/4;d++){n=e[d*4],a=e[d*4+1],i=e[d*4+2],o=e[d*4+3],d<e.length/4-1?(s=e[(d+1)*4],u=e[(d+1)*4+1],l=e[(d+1)*4+2],f=e[(d+1)*4+3]):(s=e[0],u=e[1],l=e[2],f=e[3]);var h=Ta(n,a,i,o,s,u,l,f,!0);t[d*2]=h[0],t[d*2+1]=h[1]}return t},il=function(e,t){for(var n=new Array(e.length*2),a,i,o,s,u=0;u<e.length/2;u++){a=e[u*2],i=e[u*2+1],u<e.length/2-1?(o=e[(u+1)*2],s=e[(u+1)*2+1]):(o=e[0],s=e[1]);var l=s-i,f=-(o-a),d=Math.sqrt(l*l+f*f),h=l/d,g=f/d;n[u*4]=a+h*t,n[u*4+1]=i+g*t,n[u*4+2]=o+h*t,n[u*4+3]=s+g*t}return n},QF=function(e,t,n,a,i,o){var s=n-e,u=a-t;s/=i,u/=o;var l=Math.sqrt(s*s+u*u),f=l-1;if(f<0)return[];var d=f/l;return[(n-e)*d+e,(a-t)*d+t]},ui=function(e,t,n,a,i,o,s){return e-=i,t-=o,e/=n/2+s,t/=a/2+s,e*e+t*t<=1},Yo=function(e,t,n,a,i,o,s){var u=[n-e,a-t],l=[e-i,t-o],f=u[0]*u[0]+u[1]*u[1],d=2*(l[0]*u[0]+l[1]*u[1]),h=l[0]*l[0]+l[1]*l[1]-s*s,g=d*d-4*f*h;if(g<0)return[];var p=(-d+Math.sqrt(g))/(2*f),x=(-d-Math.sqrt(g))/(2*f),b=Math.min(p,x),w=Math.max(p,x),y=[];if(b>=0&&b<=1&&y.push(b),w>=0&&w<=1&&y.push(w),y.length===0)return[];var E=y[0]*u[0]+e,C=y[0]*u[1]+t;if(y.length>1){if(y[0]==y[1])return[E,C];var S=y[1]*u[0]+e,R=y[1]*u[1]+t;return[E,C,S,R]}else return[E,C]},Jc=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},Ta=function(e,t,n,a,i,o,s,u,l){var f=e-i,d=n-e,h=s-i,g=t-o,p=a-t,x=u-o,b=h*g-x*f,w=d*g-p*f,y=x*d-h*p;if(y!==0){var E=b/y,C=w/y,S=.001,R=0-S,_=1+S;return R<=E&&E<=_&&R<=C&&C<=_?[e+E*d,t+E*p]:l?[e+E*d,t+E*p]:[]}else return b===0||w===0?Jc(e,n,s)===s?[s,u]:Jc(e,n,i)===i?[i,o]:Jc(i,s,n)===n?[n,a]:[]:[]},JF=function(e,t,n,a,i){var o=[],s=a/2,u=i/2,l=t,f=n;o.push({x:l+s*e[0],y:f+u*e[1]});for(var d=1;d<e.length/2;d++)o.push({x:l+s*e[d*2],y:f+u*e[d*2+1]});return o},vs=function(e,t,n,a,i,o,s,u){var l=[],f,d=new Array(n.length),h=!0;o==null&&(h=!1);var g;if(h){for(var p=0;p<d.length/2;p++)d[p*2]=n[p*2]*o+a,d[p*2+1]=n[p*2+1]*s+i;if(u>0){var x=il(d,-u);g=al(x)}else g=d}else g=n;for(var b,w,y,E,C=0;C<g.length/2;C++)b=g[C*2],w=g[C*2+1],C<g.length/2-1?(y=g[(C+1)*2],E=g[(C+1)*2+1]):(y=g[0],E=g[1]),f=Ta(e,t,a,i,b,w,y,E),f.length!==0&&l.push(f[0],f[1]);return l},ez=function(e,t,n,a,i,o,s,u,l){var f=[],d,h=new Array(n.length*2);l.forEach(function(y,E){E===0?(h[h.length-2]=y.startX,h[h.length-1]=y.startY):(h[E*4-2]=y.startX,h[E*4-1]=y.startY),h[E*4]=y.stopX,h[E*4+1]=y.stopY,d=Yo(e,t,a,i,y.cx,y.cy,y.radius),d.length!==0&&f.push(d[0],d[1])});for(var g=0;g<h.length/4;g++)d=Ta(e,t,a,i,h[g*4],h[g*4+1],h[g*4+2],h[g*4+3],!1),d.length!==0&&f.push(d[0],d[1]);if(f.length>2){for(var p=[f[0],f[1]],x=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),b=1;b<f.length/2;b++){var w=Math.pow(f[b*2]-e,2)+Math.pow(f[b*2+1]-t,2);w<=x&&(p[0]=f[b*2],p[1]=f[b*2+1],x=w)}return p}return f},Pu=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]),o=(i-n)/i;return o<0&&(o=1e-5),[t[0]+o*a[0],t[1]+o*a[1]]},Mt=function(e,t){var n=Em(e,t);return n=eA(n),n},eA=function(e){for(var t,n,a=e.length/2,i=1/0,o=1/0,s=-1/0,u=-1/0,l=0;l<a;l++)t=e[2*l],n=e[2*l+1],i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),u=Math.max(u,n);for(var f=2/(s-i),d=2/(u-o),h=0;h<a;h++)t=e[2*h]=e[2*h]*f,n=e[2*h+1]=e[2*h+1]*d,i=Math.min(i,t),s=Math.max(s,t),o=Math.min(o,n),u=Math.max(u,n);if(o<-1)for(var g=0;g<a;g++)n=e[2*g+1]=e[2*g+1]+(-1-o);return e},Em=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 i=new Array(e*2),o,s=0;s<e;s++)o=s*n+a,i[2*s]=Math.cos(o),i[2*s+1]=Math.sin(-o);return i},Ma=function(e,t){return Math.min(e/4,t/4,8)},rA=function(e,t){return Math.min(e/10,t/10,8)},r0=function(){return 8},rz=function(e,t,n){return[e-2*t+n,2*(t-e),e]},Cm=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function ed(r,e){function t(d){for(var h=[],g=0;g<d.length;g++){var p=d[g],x=d[(g+1)%d.length],b={x:x.x-p.x,y:x.y-p.y},w={x:-b.y,y:b.x},y=Math.sqrt(w.x*w.x+w.y*w.y);h.push({x:w.x/y,y:w.y/y})}return h}function n(d,h){var g=1/0,p=-1/0,x=Gt(d),b;try{for(x.s();!(b=x.n()).done;){var w=b.value,y=w.x*h.x+w.y*h.y;g=Math.min(g,y),p=Math.max(p,y)}}catch(E){x.e(E)}finally{x.f()}return{min:g,max:p}}function a(d,h){return!(d.max<h.min||h.max<d.min)}var i=[].concat(el(t(r)),el(t(e))),o=Gt(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=n(r,u),f=n(e,u);if(!a(l,f))return!1}}catch(d){o.e(d)}finally{o.f()}return!0}var tz=wt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),nz={pageRank:function(e){for(var t=tz(e),n=t.dampingFactor,a=t.precision,i=t.iterations,o=t.weight,s=this._private.cy,u=this.byGroup(),l=u.nodes,f=u.edges,d=l.length,h=d*d,g=f.length,p=new Array(h),x=new Array(d),b=(1-n)/d,w=0;w<d;w++){for(var y=0;y<d;y++){var E=w*d+y;p[E]=0}x[w]=0}for(var C=0;C<g;C++){var S=f[C],R=S.data("source"),_=S.data("target");if(R!==_){var A=l.indexOfId(R),P=l.indexOfId(_),I=o(S),D=P*d+A;p[D]+=I,x[A]+=I}}for(var L=1/d+b,M=0;M<d;M++)if(x[M]===0)for(var q=0;q<d;q++){var N=q*d+M;p[N]=L}else for(var W=0;W<d;W++){var V=W*d+M;p[V]=p[V]/x[M]+b}for(var $=new Array(d),X=new Array(d),ee,K=0;K<d;K++)$[K]=1;for(var j=0;j<i;j++){for(var fe=0;fe<d;fe++)X[fe]=0;for(var G=0;G<d;G++)for(var z=0;z<d;z++){var Y=G*d+z;X[G]+=p[Y]*$[z]}qF(X),ee=$,$=X,X=ee;for(var te=0,ue=0;ue<d;ue++){var oe=ee[ue]-$[ue];te+=oe*oe}if(te<a)break}var Z={rank:function(ie){return ie=s.collection(ie)[0],$[l.indexOf(ie)]}};return Z}},Hw=wt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),oo={degreeCentralityNormalized:function(e){e=Hw(e);var t=this.cy(),n=this.nodes(),a=n.length;if(e.directed){for(var f={},d={},h=0,g=0,p=0;p<a;p++){var x=n[p],b=x.id();e.root=x;var w=this.degreeCentrality(e);h<w.indegree&&(h=w.indegree),g<w.outdegree&&(g=w.outdegree),f[b]=w.indegree,d[b]=w.outdegree}return{indegree:function(E){return h==0?0:(Ye(E)&&(E=t.filter(E)),f[E.id()]/h)},outdegree:function(E){return g===0?0:(Ye(E)&&(E=t.filter(E)),d[E.id()]/g)}}}else{for(var i={},o=0,s=0;s<a;s++){var u=n[s];e.root=u;var l=this.degreeCentrality(e);o<l.degree&&(o=l.degree),i[u.id()]=l.degree}return{degree:function(E){return o===0?0:(Ye(E)&&(E=t.filter(E)),i[E.id()]/o)}}}},degreeCentrality:function(e){e=Hw(e);var t=this.cy(),n=this,a=e,i=a.root,o=a.weight,s=a.directed,u=a.alpha;if(i=t.collection(i)[0],s){for(var g=i.connectedEdges(),p=g.filter(function(R){return R.target().same(i)&&n.has(R)}),x=g.filter(function(R){return R.source().same(i)&&n.has(R)}),b=p.length,w=x.length,y=0,E=0,C=0;C<p.length;C++)y+=o(p[C]);for(var S=0;S<x.length;S++)E+=o(x[S]);return{indegree:Math.pow(b,1-u)*Math.pow(y,u),outdegree:Math.pow(w,1-u)*Math.pow(E,u)}}else{for(var l=i.connectedEdges().intersection(n),f=l.length,d=0,h=0;h<l.length;h++)d+=o(l[h]);return{degree:Math.pow(f,1-u)*Math.pow(d,u)}}}};oo.dc=oo.degreeCentrality;oo.dcn=oo.degreeCentralityNormalised=oo.degreeCentralityNormalized;var Kw=wt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),so={closenessCentralityNormalized:function(e){for(var t=Kw(e),n=t.harmonic,a=t.weight,i=t.directed,o=this.cy(),s={},u=0,l=this.nodes(),f=this.floydWarshall({weight:a,directed:i}),d=0;d<l.length;d++){for(var h=0,g=l[d],p=0;p<l.length;p++)if(d!==p){var x=f.distance(g,l[p]);n?h+=1/x:h+=x}n||(h=1/h),u<h&&(u=h),s[g.id()]=h}return{closeness:function(w){return u==0?0:(Ye(w)?w=o.filter(w)[0].id():w=w.id(),s[w]/u)}}},closenessCentrality:function(e){var t=Kw(e),n=t.root,a=t.weight,i=t.directed,o=t.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:a,directed:i}),u=0,l=this.nodes(),f=0;f<l.length;f++){var d=l[f];if(!d.same(n)){var h=s.distanceTo(d);o?u+=1/h:u+=h}}return o?u:1/u}};so.cc=so.closenessCentrality;so.ccn=so.closenessCentralityNormalised=so.closenessCentralityNormalized;var az=wt({weight:null,directed:!1}),_m={betweennessCentrality:function(e){for(var t=az(e),n=t.directed,a=t.weight,i=a!=null,o=this.cy(),s=this.nodes(),u={},l={},f=0,d={set:function(E,C){l[E]=C,C>f&&(f=C)},get:function(E){return l[E]}},h=0;h<s.length;h++){var g=s[h],p=g.id();n?u[p]=g.outgoers().nodes():u[p]=g.openNeighborhood().nodes(),d.set(p,0)}for(var x=function(){for(var E=s[b].id(),C=[],S={},R={},_={},A=new Ts(function(G,z){return _[G]-_[z]}),P=0;P<s.length;P++){var I=s[P].id();S[I]=[],R[I]=0,_[I]=1/0}for(R[E]=1,_[E]=0,A.push(E);!A.empty();){var D=A.pop();if(C.push(D),i)for(var L=0;L<u[D].length;L++){var M=u[D][L],q=o.getElementById(D),N=void 0;q.edgesTo(M).length>0?N=q.edgesTo(M)[0]:N=M.edgesTo(q)[0];var W=a(N);M=M.id(),_[M]>_[D]+W&&(_[M]=_[D]+W,A.nodes.indexOf(M)<0?A.push(M):A.updateItem(M),R[M]=0,S[M]=[]),_[M]==_[D]+W&&(R[M]=R[M]+R[D],S[M].push(D))}else for(var V=0;V<u[D].length;V++){var $=u[D][V].id();_[$]==1/0&&(A.push($),_[$]=_[D]+1),_[$]==_[D]+1&&(R[$]=R[$]+R[D],S[$].push(D))}}for(var X={},ee=0;ee<s.length;ee++)X[s[ee].id()]=0;for(;C.length>0;){for(var K=C.pop(),j=0;j<S[K].length;j++){var fe=S[K][j];X[fe]=X[fe]+R[fe]/R[K]*(1+X[K])}K!=s[b].id()&&d.set(K,d.get(K)+X[K])}},b=0;b<s.length;b++)x();var w={betweenness:function(E){var C=o.collection(E).id();return d.get(C)},betweennessNormalized:function(E){if(f==0)return 0;var C=o.collection(E).id();return d.get(C)/f}};return w.betweennessNormalised=w.betweennessNormalized,w}};_m.bc=_m.betweennessCentrality;var iz=wt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),oz=function(e){return iz(e)},sz=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},uz=function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n},tA=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 o=0;o<t;o++)e[o*t+a]=e[o*t+a]/n}},lz=function(e,t,n){for(var a=new Array(n*n),i=0;i<n;i++){for(var o=0;o<n;o++)a[i*n+o]=0;for(var s=0;s<n;s++)for(var u=0;u<n;u++)a[i*n+u]+=e[i*n+s]*t[s*n+u]}return a},fz=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=lz(e,a,t);return e},cz=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 tA(a,t),a},dz=function(e,t,n,a){for(var i=0;i<n;i++){var o=Math.round(e[i]*Math.pow(10,a))/Math.pow(10,a),s=Math.round(t[i]*Math.pow(10,a))/Math.pow(10,a);if(o!==s)return!1}return!0},vz=function(e,t,n,a){for(var i=[],o=0;o<t;o++){for(var s=[],u=0;u<t;u++)Math.round(e[o*t+u]*1e3)/1e3>0&&s.push(n[u]);s.length!==0&&i.push(a.collection(s))}return i},hz=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},gz=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&hz(e[t],e[n])&&e.splice(n,1);return e},jw=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=oz(e),o={},s=0;s<t.length;s++)o[t[s].id()]=s;for(var u=t.length,l=u*u,f=new Array(l),d,h=0;h<l;h++)f[h]=0;for(var g=0;g<n.length;g++){var p=n[g],x=o[p.source().id()],b=o[p.target().id()],w=sz(p,i.attributes);f[x*u+b]+=w,f[b*u+x]+=w}uz(f,u,i.multFactor),tA(f,u);for(var y=!0,E=0;y&&E<i.maxIterations;)y=!1,d=fz(f,u,i.expandFactor),f=cz(d,u,i.inflateFactor),dz(f,d,l,4)||(y=!0),E++;var C=vz(f,u,t,a);return C=gz(C),C},pz={markovClustering:jw,mcl:jw},yz=function(e){return e},nA=function(e,t){return Math.abs(t-e)},Yw=function(e,t,n){return e+nA(t,n)},Xw=function(e,t,n){return e+Math.pow(n-t,2)},mz=function(e){return Math.sqrt(e)},bz=function(e,t,n){return Math.max(e,nA(t,n))},zo=function(e,t,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:yz,s=a,u,l,f=0;f<e;f++)u=t(f),l=n(f),s=i(s,u,l);return o(s)},fo={euclidean:function(e,t,n){return e>=2?zo(e,t,n,0,Xw,mz):zo(e,t,n,0,Yw)},squaredEuclidean:function(e,t,n){return zo(e,t,n,0,Xw)},manhattan:function(e,t,n){return zo(e,t,n,0,Yw)},max:function(e,t,n){return zo(e,t,n,-1/0,bz)}};fo["squared-euclidean"]=fo.squaredEuclidean;fo.squaredeuclidean=fo.squaredEuclidean;function Cl(r,e,t,n,a,i){var o;return $r(r)?o=r:o=fo[r]||fo.euclidean,e===0&&$r(r)?o(a,i):o(e,t,n,a,i)}var wz=wt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),t0=function(e){return wz(e)},ol=function(e,t,n,a,i){var o=i!=="kMedoids",s=o?function(d){return n[d]}:function(d){return a[d](n)},u=function(h){return a[h](t)},l=n,f=t;return Cl(e,a.length,s,u,l,f)},rd=function(e,t,n){for(var a=n.length,i=new Array(a),o=new Array(a),s=new Array(t),u=null,l=0;l<a;l++)i[l]=e.min(n[l]).value,o[l]=e.max(n[l]).value;for(var f=0;f<t;f++){u=[];for(var d=0;d<a;d++)u[d]=Math.random()*(o[d]-i[d])+i[d];s[f]=u}return s},aA=function(e,t,n,a,i){for(var o=1/0,s=0,u=0;u<t.length;u++){var l=ol(n,e,t[u],a,i);l<o&&(o=l,s=u)}return s},iA=function(e,t,n){for(var a=[],i=null,o=0;o<t.length;o++)i=t[o],n[i.id()]===e&&a.push(i);return a},xz=function(e,t,n){return Math.abs(t-e)<=n},Ez=function(e,t,n){for(var a=0;a<e.length;a++)for(var i=0;i<e[a].length;i++){var o=Math.abs(e[a][i]-t[a][i]);if(o>n)return!1}return!0},Cz=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},Zw=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)];Cz(i,n,a);)i=e[Math.floor(Math.random()*e.length)];n[a]=i}else for(var o=0;o<t;o++)n[o]=e[Math.floor(Math.random()*e.length)];return n},Qw=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=ol("manhattan",t[i],e,n,"kMedoids");return a},_z=function(e){var t=this.cy(),n=this.nodes(),a=null,i=t0(e),o=new Array(i.k),s={},u;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,u=rd(n,i.k,i.attributes)):at(i.testCentroids)==="object"?u=i.testCentroids:u=rd(n,i.k,i.attributes):u=rd(n,i.k,i.attributes);for(var l=!0,f=0;l&&f<i.maxIterations;){for(var d=0;d<n.length;d++)a=n[d],s[a.id()]=aA(a,u,i.distance,i.attributes,"kMeans");l=!1;for(var h=0;h<i.k;h++){var g=iA(h,n,s);if(g.length!==0){for(var p=i.attributes.length,x=u[h],b=new Array(p),w=new Array(p),y=0;y<p;y++){w[y]=0;for(var E=0;E<g.length;E++)a=g[E],w[y]+=i.attributes[y](a);b[y]=w[y]/g.length,xz(b[y],x[y],i.sensitivityThreshold)||(l=!0)}u[h]=b,o[h]=t.collection(g)}}f++}return o},Sz=function(e){var t=this.cy(),n=this.nodes(),a=null,i=t0(e),o=new Array(i.k),s,u={},l,f=new Array(i.k);i.testMode?typeof i.testCentroids=="number"||(at(i.testCentroids)==="object"?s=i.testCentroids:s=Zw(n,i.k)):s=Zw(n,i.k);for(var d=!0,h=0;d&&h<i.maxIterations;){for(var g=0;g<n.length;g++)a=n[g],u[a.id()]=aA(a,s,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<s.length;p++){var x=iA(p,n,u);if(x.length!==0){f[p]=Qw(s[p],x,i.attributes);for(var b=0;b<x.length;b++)l=Qw(x[b],x,i.attributes),l<f[p]&&(f[p]=l,s[p]=x[b],d=!0);o[p]=t.collection(x)}}h++}return o},Tz=function(e,t,n,a,i){for(var o,s,u=0;u<t.length;u++)for(var l=0;l<e.length;l++)a[u][l]=Math.pow(n[u][l],i.m);for(var f=0;f<e.length;f++)for(var d=0;d<i.attributes.length;d++){o=0,s=0;for(var h=0;h<t.length;h++)o+=a[h][f]*i.attributes[d](t[h]),s+=a[h][f];e[f][d]=o/s}},Rz=function(e,t,n,a,i){for(var o=0;o<e.length;o++)t[o]=e[o].slice();for(var s,u,l,f=2/(i.m-1),d=0;d<n.length;d++)for(var h=0;h<a.length;h++){s=0;for(var g=0;g<n.length;g++)u=ol(i.distance,a[h],n[d],i.attributes,"cmeans"),l=ol(i.distance,a[h],n[g],i.attributes,"cmeans"),s+=Math.pow(u/l,f);e[h][d]=1/s}},Az=function(e,t,n,a){for(var i=new Array(n.k),o=0;o<i.length;o++)i[o]=[];for(var s,u,l=0;l<t.length;l++){s=-1/0,u=-1;for(var f=0;f<t[0].length;f++)t[l][f]>s&&(s=t[l][f],u=f);i[u].push(e[l])}for(var d=0;d<i.length;d++)i[d]=a.collection(i[d]);return i},Jw=function(e){var t=this.cy(),n=this.nodes(),a=t0(e),i,o,s,u,l;u=new Array(n.length);for(var f=0;f<n.length;f++)u[f]=new Array(a.k);s=new Array(n.length);for(var d=0;d<n.length;d++)s[d]=new Array(a.k);for(var h=0;h<n.length;h++){for(var g=0,p=0;p<a.k;p++)s[h][p]=Math.random(),g+=s[h][p];for(var x=0;x<a.k;x++)s[h][x]=s[h][x]/g}o=new Array(a.k);for(var b=0;b<a.k;b++)o[b]=new Array(a.attributes.length);l=new Array(n.length);for(var w=0;w<n.length;w++)l[w]=new Array(a.k);for(var y=!0,E=0;y&&E<a.maxIterations;)y=!1,Tz(o,n,s,l,a),Rz(s,u,o,n,a),Ez(s,u,a.sensitivityThreshold)||(y=!0),E++;return i=Az(n,s,a,t),{clusters:i,degreeOfMembership:s}},Pz={kMeans:_z,kMedoids:Sz,fuzzyCMeans:Jw,fcm:Jw},Iz=wt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Dz={single:"min",complete:"max"},Bz=function(e){var t=Iz(e),n=Dz[t.linkage];return n!=null&&(t.linkage=n),t},ex=function(e,t,n,a,i){for(var o=0,s=1/0,u,l=i.attributes,f=function(P,I){return Cl(i.distance,l.length,function(D){return l[D](P)},function(D){return l[D](I)},P,I)},d=0;d<e.length;d++){var h=e[d].key,g=n[h][a[h]];g<s&&(o=h,s=g)}if(i.mode==="threshold"&&s>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var p=t[o],x=t[a[o]],b;i.mode==="dendrogram"?b={left:p,right:x,key:p.key}:b={value:p.value.concat(x.value),key:p.key},e[p.index]=b,e.splice(x.index,1),t[p.key]=b;for(var w=0;w<e.length;w++){var y=e[w];p.key===y.key?u=1/0:i.linkage==="min"?(u=n[p.key][y.key],n[p.key][y.key]>n[x.key][y.key]&&(u=n[x.key][y.key])):i.linkage==="max"?(u=n[p.key][y.key],n[p.key][y.key]<n[x.key][y.key]&&(u=n[x.key][y.key])):i.linkage==="mean"?u=(n[p.key][y.key]*p.size+n[x.key][y.key]*x.size)/(p.size+x.size):i.mode==="dendrogram"?u=f(y.value,p.value):u=f(y.value[0],p.value[0]),n[p.key][y.key]=n[y.key][p.key]=u}for(var E=0;E<e.length;E++){var C=e[E].key;if(a[C]===p.key||a[C]===x.key){for(var S=C,R=0;R<e.length;R++){var _=e[R].key;n[C][_]<n[C][S]&&(S=_)}a[C]=S}e[E].index=E}return p.key=x.key=p.index=x.index=null,!0},eo=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&eo(e.left,t),e.right&&eo(e.right,t)))},Sm=function(e,t){if(!e)return"";if(e.left&&e.right){var n=Sm(e.left,t),a=Sm(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()}else if(e.value)return e.value.id()},Tm=function(e,t,n){if(!e)return[];var a=[],i=[],o=[];return t===0?(e.left&&eo(e.left,a),e.right&&eo(e.right,i),o=a.concat(i),[n.collection(o)]):t===1?e.value?[n.collection(e.value)]:(e.left&&eo(e.left,a),e.right&&eo(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=Tm(e.left,t-1,n)),e.right&&(i=Tm(e.right,t-1,n)),a.concat(i))},rx=function(e){for(var t=this.cy(),n=this.nodes(),a=Bz(e),i=a.attributes,o=function(E,C){return Cl(a.distance,i.length,function(S){return i[S](E)},function(S){return i[S](C)},E,C)},s=[],u=[],l=[],f=[],d=0;d<n.length;d++){var h={value:a.mode==="dendrogram"?n[d]:[n[d]],key:d,index:d};s[d]=h,f[d]=h,u[d]=[],l[d]=0}for(var g=0;g<s.length;g++)for(var p=0;p<=g;p++){var x=void 0;a.mode==="dendrogram"?x=g===p?1/0:o(s[g].value,s[p].value):x=g===p?1/0:o(s[g].value[0],s[p].value[0]),u[g][p]=x,u[p][g]=x,x<u[g][l[g]]&&(l[g]=p)}for(var b=ex(s,f,u,l,a);b;)b=ex(s,f,u,l,a);var w;return a.mode==="dendrogram"?(w=Tm(s[0],a.dendrogramDepth,t),a.addDendrogram&&Sm(s[0],t)):(w=new Array(s.length),s.forEach(function(y,E){y.key=y.index=null,w[E]=t.collection(y.value)})),w},Mz={hierarchicalClustering:rx,hca:rx},Lz=wt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),Oz=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||kr("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||qe(n)||kr("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),Lz(e)},kz=function(e,t,n,a){var i=function(s,u){return a[u](s)};return-Cl(e,a.length,function(o){return i(t,o)},function(o){return i(n,o)},t,n)},qz=function(e,t){var n=null;return t==="median"?n=OF(e):t==="mean"?n=LF(e):t==="min"?n=BF(e):t==="max"?n=MF(e):n=t,n},Nz=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},tx=function(e,t,n){for(var a=[],i=0;i<e;i++){for(var o=-1,s=-1/0,u=0;u<n.length;u++){var l=n[u];t[i*e+l]>s&&(o=l,s=t[i*e+l])}o>0&&a.push(o)}for(var f=0;f<n.length;f++)a[n[f]]=n[f];return a},Fz=function(e,t,n){for(var a=tx(e,t,n),i=0;i<n.length;i++){for(var o=[],s=0;s<a.length;s++)a[s]===n[i]&&o.push(s);for(var u=-1,l=-1/0,f=0;f<o.length;f++){for(var d=0,h=0;h<o.length;h++)d+=t[o[h]*e+o[f]];d>l&&(u=f,l=d)}n[i]=o[u]}return a=tx(e,t,n),a},nx=function(e){for(var t=this.cy(),n=this.nodes(),a=Oz(e),i={},o=0;o<n.length;o++)i[n[o].id()]=o;var s,u,l,f,d,h;s=n.length,u=s*s,l=new Array(u);for(var g=0;g<u;g++)l[g]=-1/0;for(var p=0;p<s;p++)for(var x=0;x<s;x++)p!==x&&(l[p*s+x]=kz(a.distance,n[p],n[x],a.attributes));f=qz(l,a.preference);for(var b=0;b<s;b++)l[b*s+b]=f;d=new Array(u);for(var w=0;w<u;w++)d[w]=0;h=new Array(u);for(var y=0;y<u;y++)h[y]=0;for(var E=new Array(s),C=new Array(s),S=new Array(s),R=0;R<s;R++)E[R]=0,C[R]=0,S[R]=0;for(var _=new Array(s*a.minIterations),A=0;A<_.length;A++)_[A]=0;var P;for(P=0;P<a.maxIterations;P++){for(var I=0;I<s;I++){for(var D=-1/0,L=-1/0,M=-1,q=0,N=0;N<s;N++)E[N]=d[I*s+N],q=h[I*s+N]+l[I*s+N],q>=D?(L=D,D=q,M=N):q>L&&(L=q);for(var W=0;W<s;W++)d[I*s+W]=(1-a.damping)*(l[I*s+W]-D)+a.damping*E[W];d[I*s+M]=(1-a.damping)*(l[I*s+M]-L)+a.damping*E[M]}for(var V=0;V<s;V++){for(var $=0,X=0;X<s;X++)E[X]=h[X*s+V],C[X]=Math.max(0,d[X*s+V]),$+=C[X];$-=C[V],C[V]=d[V*s+V],$+=C[V];for(var ee=0;ee<s;ee++)h[ee*s+V]=(1-a.damping)*Math.min(0,$-C[ee])+a.damping*E[ee];h[V*s+V]=(1-a.damping)*($-C[V])+a.damping*E[V]}for(var K=0,j=0;j<s;j++){var fe=h[j*s+j]+d[j*s+j]>0?1:0;_[P%a.minIterations*s+j]=fe,K+=fe}if(K>0&&(P>=a.minIterations-1||P==a.maxIterations-1)){for(var G=0,z=0;z<s;z++){S[z]=0;for(var Y=0;Y<a.minIterations;Y++)S[z]+=_[Y*s+z];(S[z]===0||S[z]===a.minIterations)&&G++}if(G===s)break}}for(var te=Nz(s,d,h),ue=Fz(s,l,te),oe={},Z=0;Z<te.length;Z++)oe[te[Z]]=[];for(var Q=0;Q<n.length;Q++){var ie=i[n[Q].id()],de=ue[ie];de!=null&&oe[de].push(n[Q])}for(var we=new Array(te.length),Ae=0;Ae<te.length;Ae++)we[Ae]=t.collection(oe[te[Ae]]);return we},zz={affinityPropagation:nx,ap:nx},$z=wt({root:void 0,directed:!1}),Vz={hierholzer:function(e){if(!yr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=$z(e),a=n.root,i=n.directed,o=this,s=!1,u,l,f;a&&(f=Ye(a)?this.filter(a)[0].id():a[0].id());var d={},h={};i?o.forEach(function(y){var E=y.id();if(y.isNode()){var C=y.indegree(!0),S=y.outdegree(!0),R=C-S,_=S-C;R==1?u?s=!0:u=E:_==1?l?s=!0:l=E:(_>1||R>1)&&(s=!0),d[E]=[],y.outgoers().forEach(function(A){A.isEdge()&&d[E].push(A.id())})}else h[E]=[void 0,y.target().id()]}):o.forEach(function(y){var E=y.id();if(y.isNode()){var C=y.degree(!0);C%2&&(u?l?s=!0:l=E:u=E),d[E]=[],y.connectedEdges().forEach(function(S){return d[E].push(S.id())})}else h[E]=[y.source().id(),y.target().id()]});var g={found:!1,trail:void 0};if(s)return g;if(l&&u)if(i){if(f&&l!=f)return g;f=l}else{if(f&&l!=f&&u!=f)return g;f||(f=l)}else f||(f=o[0].id());var p=function(E){for(var C=E,S=[E],R,_,A;d[C].length;)R=d[C].shift(),_=h[R][0],A=h[R][1],C!=A?(d[A]=d[A].filter(function(P){return P!=R}),C=A):!i&&C!=_&&(d[_]=d[_].filter(function(P){return P!=R}),C=_),S.unshift(R),S.unshift(C);return S},x=[],b=[];for(b=p(f);b.length!=1;)d[b[0]].length==0?(x.unshift(o.getElementById(b.shift())),x.unshift(o.getElementById(b.shift()))):b=p(b.shift()).concat(b);x.unshift(o.getElementById(b.shift()));for(var w in d)if(d[w].length)return g;return g.found=!0,g.trail=this.spawn(x,!0),g}},Iu=function(){var e=this,t={},n=0,a=0,i=[],o=[],s={},u=function(h,g){for(var p=o.length-1,x=[],b=e.spawn();o[p].x!=h||o[p].y!=g;)x.push(o.pop().edge),p--;x.push(o.pop().edge),x.forEach(function(w){var y=w.connectedNodes().intersection(e);b.merge(w),y.forEach(function(E){var C=E.id(),S=E.connectedEdges().intersection(e);b.merge(E),t[C].cutVertex?b.merge(S.filter(function(R){return R.isLoop()})):b.merge(S)})}),i.push(b)},l=function(h,g,p){h===p&&(a+=1),t[g]={id:n,low:n++,cutVertex:!1};var x=e.getElementById(g).connectedEdges().intersection(e);if(x.size()===0)i.push(e.spawn(e.getElementById(g)));else{var b,w,y,E;x.forEach(function(C){b=C.source().id(),w=C.target().id(),y=b===g?w:b,y!==p&&(E=C.id(),s[E]||(s[E]=!0,o.push({x:g,y,edge:C})),y in t?t[g].low=Math.min(t[g].low,t[y].id):(l(h,y,g),t[g].low=Math.min(t[g].low,t[y].low),t[g].id<=t[y].low&&(t[g].cutVertex=!0,u(g,y))))})}};e.forEach(function(d){if(d.isNode()){var h=d.id();h in t||(a=0,l(h,h),t[h].cutVertex=a>1)}});var f=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(f),components:i}},Gz={hopcroftTarjanBiconnected:Iu,htbc:Iu,htb:Iu,hopcroftTarjanBiconnectedComponents:Iu},Du=function(){var e=this,t={},n=0,a=[],i=[],o=e.spawn(e),s=function(l){i.push(l),t[l]={index:n,low:n++,explored:!1};var f=e.getElementById(l).connectedEdges().intersection(e);if(f.forEach(function(x){var b=x.target().id();b!==l&&(b in t||s(b),t[b].explored||(t[l].low=Math.min(t[l].low,t[b].low)))}),t[l].index===t[l].low){for(var d=e.spawn();;){var h=i.pop();if(d.merge(e.getElementById(h)),t[h].low=t[l].index,t[h].explored=!0,h===l)break}var g=d.edgesWith(d),p=d.merge(g);a.push(p),o=o.difference(p)}};return e.forEach(function(u){if(u.isNode()){var l=u.id();l in t||s(l)}}),{cut:o,components:a}},Wz={tarjanStronglyConnected:Du,tsc:Du,tscc:Du,tarjanStronglyConnectedComponents:Du},oA={};[cs,wF,xF,CF,SF,RF,IF,nz,oo,so,_m,pz,Pz,Mz,zz,Vz,Gz,Wz].forEach(function(r){Ze(oA,r)});/*!
|
|
5
31
|
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
6
32
|
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
7
33
|
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
8
|
-
*/var MR=0,LR=1,OR=2,xn=function(e){if(!(this instanceof xn))return new xn(e);this.id="Thenable/1.0.7",this.state=MR,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};xn.prototype={fulfill:function(e){return Sw(this,LR,"fulfillValue",e)},reject:function(e){return Sw(this,OR,"rejectReason",e)},then:function(e,t){var n=this,a=new xn;return n.onFulfilled.push(Rw(e,a,"fulfill")),n.onRejected.push(Rw(t,a,"reject")),qR(n),a.proxy}};var Sw=function(e,t,n,a){return e.state===MR&&(e.state=t,e[n]=a,qR(e)),e},qR=function(e){e.state===LR?Tw(e,"onFulfilled",e.fulfillValue):e.state===OR&&Tw(e,"onRejected",e.rejectReason)},Tw=function(e,t,n){if(e[t].length!==0){var a=e[t];e[t]=[];var i=function(){for(var s=0;s<a.length;s++)a[s](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},Rw=function(e,t,n){return function(a){if(typeof e!="function")t[n].call(t,a);else{var i;try{i=e(a)}catch(o){t.reject(o);return}NR(t,i)}}},NR=function(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(tt(t)==="object"&&t!==null||typeof t=="function")try{n=t.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(t,function(i){a||(a=!0,i===t?e.reject(new TypeError("circular thenable chain")):NR(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(t)};xn.all=function(r){return new xn(function(e,t){for(var n=new Array(r.length),a=0,i=function(l,u){n[l]=u,a++,a===r.length&&e(n)},o=0;o<r.length;o++)(function(s){var l=r[s],u=l!=null&&l.then!=null;if(u)l.then(function(d){i(s,d)},function(d){t(d)});else{var c=l;i(s,c)}})(o)})};xn.resolve=function(r){return new xn(function(e,t){e(r)})};xn.reject=function(r){return new xn(function(e,t){t(r)})};var oo=typeof Promise<"u"?Promise:xn,gm=function(e,t,n){var a=Im(e),i=!a,o=this._private=Ye({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&Fr(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var l=e.pan();o.startPan={x:l.x,y:l.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},ui=gm.prototype;Ye(ui,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;e.queue?t=n.queue:t=n.current,t.push(this),Zt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];d!=null&&(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],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[a]=s}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case"frame":n=t.frames;break;default:case"complete":case"completed":n=t.completes}return new oo(function(a,i){n.push(function(){a()})})}});ui.complete=ui.completed;ui.run=ui.play;ui.running=ui.playing;var ZF={animated:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var s=a[o];s._private.animation.queue=[]}return this}},delay:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this,l=!i,u=!l;if(!s.styleEnabled())return this;var c=s.style();t=Ye({},t,n);var d=Object.keys(t).length===0;if(d)return new gm(o[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(u&&(t.style=c.getPropsList(t.style||t.css),t.css=void 0),u&&t.renderedPosition!=null){var h=t.renderedPosition,g=s.pan(),p=s.zoom();t.position=CR(h,p,g)}if(l&&t.panBy!=null){var E=t.panBy,m=s.pan();t.pan={x:m.x+E.x,y:m.y+E.y}}var b=t.center||t.centre;if(l&&b!=null){var w=s.getCenterPan(b.eles,t.zoom);w!=null&&(t.pan=w)}if(l&&t.fit!=null){var x=t.fit,C=s.getFitViewport(x.eles||x.boundingBox,x.padding);C!=null&&(t.pan=C.pan,t.zoom=C.zoom)}if(l&&pr(t.zoom)){var T=s.getZoomedViewport(t.zoom);T!=null?(T.zoomed&&(t.zoom=T.zoom),T.panned&&(t.pan=T.pan)):t.zoom=null}return new gm(o[0],t)}},animate:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;n&&(t=Ye({},t,n));for(var l=0;l<o.length;l++){var u=o[l],c=u.animated()&&(t.queue===void 0||t.queue),d=u.animation(t,c?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var l=0;l<o.length;l++){for(var u=o[l],c=u._private,d=c.animation.current,h=0;h<d.length;h++){var g=d[h],p=g._private;n&&(p.duration=0)}t&&(c.animation.queue=[]),n||(c.animation.current=[])}return s.notify("draw"),this}}},kc,Aw;function hl(){if(Aw)return kc;Aw=1;var r=Array.isArray;return kc=r,kc}var Mc,Pw;function XF(){if(Pw)return Mc;Pw=1;var r=hl(),e=ys(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return Mc=a,Mc}var Lc,Dw;function QF(){if(Dw)return Lc;Dw=1;var r=hR(),e=ps(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var l=r(s);return l==n||l==a||l==t||l==i}return Lc=o,Lc}var Oc,Iw;function JF(){if(Iw)return Oc;Iw=1;var r=fl(),e=r["__core-js_shared__"];return Oc=e,Oc}var qc,Bw;function e5(){if(Bw)return qc;Bw=1;var r=JF(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return qc=t,qc}var Nc,kw;function r5(){if(kw)return Nc;kw=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Nc=t,Nc}var Fc,Mw;function t5(){if(Mw)return Fc;Mw=1;var r=QF(),e=e5(),t=ps(),n=r5(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return Fc=d,Fc}var zc,Lw;function n5(){if(Lw)return zc;Lw=1;function r(e,t){return e==null?void 0:e[t]}return zc=r,zc}var $c,Ow;function Vm(){if(Ow)return $c;Ow=1;var r=t5(),e=n5();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return $c=t,$c}var Vc,qw;function gl(){if(qw)return Vc;qw=1;var r=Vm(),e=r(Object,"create");return Vc=e,Vc}var Gc,Nw;function a5(){if(Nw)return Gc;Nw=1;var r=gl();function e(){this.__data__=r?r(null):{},this.size=0}return Gc=e,Gc}var Wc,Fw;function i5(){if(Fw)return Wc;Fw=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Wc=r,Wc}var Uc,zw;function o5(){if(zw)return Uc;zw=1;var r=gl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return Uc=a,Uc}var Hc,$w;function s5(){if($w)return Hc;$w=1;var r=gl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return Hc=n,Hc}var Kc,Vw;function u5(){if(Vw)return Kc;Vw=1;var r=gl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return Kc=t,Kc}var jc,Gw;function l5(){if(Gw)return jc;Gw=1;var r=a5(),e=i5(),t=o5(),n=s5(),a=u5();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];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,jc=i,jc}var Yc,Ww;function f5(){if(Ww)return Yc;Ww=1;function r(){this.__data__=[],this.size=0}return Yc=r,Yc}var Zc,Uw;function FR(){if(Uw)return Zc;Uw=1;function r(e,t){return e===t||e!==e&&t!==t}return Zc=r,Zc}var Xc,Hw;function pl(){if(Hw)return Xc;Hw=1;var r=FR();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Xc=e,Xc}var Qc,Kw;function c5(){if(Kw)return Qc;Kw=1;var r=pl(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return Qc=n,Qc}var Jc,jw;function d5(){if(jw)return Jc;jw=1;var r=pl();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Jc=e,Jc}var ed,Yw;function v5(){if(Yw)return ed;Yw=1;var r=pl();function e(t){return r(this.__data__,t)>-1}return ed=e,ed}var rd,Zw;function h5(){if(Zw)return rd;Zw=1;var r=pl();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}return rd=e,rd}var td,Xw;function g5(){if(Xw)return td;Xw=1;var r=f5(),e=c5(),t=d5(),n=v5(),a=h5();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];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,td=i,td}var nd,Qw;function p5(){if(Qw)return nd;Qw=1;var r=Vm(),e=fl(),t=r(e,"Map");return nd=t,nd}var ad,Jw;function y5(){if(Jw)return ad;Jw=1;var r=l5(),e=g5(),t=p5();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return ad=n,ad}var id,ex;function m5(){if(ex)return id;ex=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return id=r,id}var od,rx;function yl(){if(rx)return od;rx=1;var r=m5();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return od=e,od}var sd,tx;function b5(){if(tx)return sd;tx=1;var r=yl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return sd=e,sd}var ud,nx;function w5(){if(nx)return ud;nx=1;var r=yl();function e(t){return r(this,t).get(t)}return ud=e,ud}var ld,ax;function x5(){if(ax)return ld;ax=1;var r=yl();function e(t){return r(this,t).has(t)}return ld=e,ld}var fd,ix;function E5(){if(ix)return fd;ix=1;var r=yl();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}return fd=e,fd}var cd,ox;function C5(){if(ox)return cd;ox=1;var r=y5(),e=b5(),t=w5(),n=x5(),a=E5();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];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,cd=i,cd}var dd,sx;function _5(){if(sx)return dd;sx=1;var r=C5(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],l=i.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return i.cache=l.set(s,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,dd=t,dd}var vd,ux;function S5(){if(ux)return vd;ux=1;var r=_5(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return vd=t,vd}var hd,lx;function zR(){if(lx)return hd;lx=1;var r=S5(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,l,u){i.push(l?u.replace(t,"$1"):s||o)}),i});return hd=n,hd}var gd,fx;function $R(){if(fx)return gd;fx=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return gd=r,gd}var pd,cx;function T5(){if(cx)return pd;cx=1;var r=km(),e=$R(),t=hl(),n=ys(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return pd=o,pd}var yd,dx;function VR(){if(dx)return yd;dx=1;var r=T5();function e(t){return t==null?"":r(t)}return yd=e,yd}var md,vx;function GR(){if(vx)return md;vx=1;var r=hl(),e=XF(),t=zR(),n=VR();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return md=a,md}var bd,hx;function Gm(){if(hx)return bd;hx=1;var r=ys();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return bd=e,bd}var wd,gx;function R5(){if(gx)return wd;gx=1;var r=GR(),e=Gm();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return wd=t,wd}var xd,px;function A5(){if(px)return xd;px=1;var r=R5();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return xd=e,xd}var P5=A5(),D5=gs(P5),Ed,yx;function I5(){if(yx)return Ed;yx=1;var r=Vm(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Ed=e,Ed}var Cd,mx;function B5(){if(mx)return Cd;mx=1;var r=I5();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Cd=e,Cd}var _d,bx;function k5(){if(bx)return _d;bx=1;var r=B5(),e=FR(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var l=i[o];(!(n.call(i,o)&&e(l,s))||s===void 0&&!(o in i))&&r(i,o,s)}return _d=a,_d}var Sd,wx;function M5(){if(wx)return Sd;wx=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Sd=t,Sd}var Td,xx;function L5(){if(xx)return Td;xx=1;var r=k5(),e=GR(),t=M5(),n=ps(),a=Gm();function i(o,s,l,u){if(!n(o))return o;s=e(s,o);for(var c=-1,d=s.length,h=d-1,g=o;g!=null&&++c<d;){var p=a(s[c]),E=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var m=g[p];E=u?u(m,p,g):void 0,E===void 0&&(E=n(m)?m:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return Td=i,Td}var Rd,Ex;function O5(){if(Ex)return Rd;Ex=1;var r=L5();function e(t,n,a){return t==null?t:r(t,n,a)}return Rd=e,Rd}var q5=O5(),N5=gs(q5),Ad,Cx;function F5(){if(Cx)return Ad;Cx=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return Ad=r,Ad}var Pd,_x;function z5(){if(_x)return Pd;_x=1;var r=$R(),e=F5(),t=hl(),n=ys(),a=zR(),i=Gm(),o=VR();function s(l){return t(l)?r(l,i):n(l)?[l]:e(a(o(l)))}return Pd=s,Pd}var $5=z5(),V5=gs($5),G5={data:function(e){var t={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Ye({},t,e),function(a,i){var o=e,s=this,l=s.length!==void 0,u=l?s:[s],c=l?s[0]:s;if(Ke(a)){var d=a.indexOf(".")!==-1,h=d&&V5(a);if(o.allowGetting&&i===void 0){var g;return c&&(o.beforeGet(c),h&&c._private[o.field][a]===void 0?g=D5(c._private[o.field],h):g=c._private[o.field][a]),g}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var E=aR({},a,i);o.beforeSet(s,E);for(var m=0,b=u.length;m<b;m++){var w=u[m];o.canSet(w)&&(h&&c._private[o.field][a]===void 0?N5(w._private[o.field],h,i):w._private[o.field][a]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&pr(a)){var x=a,C,T,S=Object.keys(x);o.beforeSet(s,x);for(var _=0;_<S.length;_++){C=S[_],T=x[C];var A=!o.immutableKeys[C];if(A)for(var P=0;P<u.length;P++){var D=u[P];o.canSet(D)&&(D._private[o.field][C]=T)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&Fr(a)){var I=a;s.on(o.bindingEvent,I)}else if(o.allowGetting&&a===void 0){var M;return c&&(o.beforeGet(c),M=c._private[o.field]),M}return s}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ye({},t,e),function(a){var i=e,o=this,s=o.length!==void 0,l=s?o:[o];if(Ke(a)){for(var u=a.split(/\s+/),c=u.length,d=0;d<c;d++){var h=u[d];if(!Ta(h)){var g=!i.immutableKeys[h];if(g)for(var p=0,E=l.length;p<E;p++)l[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var m=0,b=l.length;m<b;m++)for(var w=l[m]._private[i.field],x=Object.keys(w),C=0;C<x.length;C++){var T=x[C],S=!i.immutableKeys[T];S&&(w[T]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},W5={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,o=Array.prototype.slice.call(arguments,0);return new oo(function(s,l){var u=function(g){i.off.apply(i,d),s(g)},c=o.concat([u]),d=c.concat([]);i.on.apply(i,c)})}}},xr={};[ZF,G5,W5].forEach(function(r){Ye(xr,r)});var U5={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop()},Lu={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Sr(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new io(e),o=0;o<t.length;o++){for(var s=t[o],l=s._private,u=l.classes,c=!1,d=0;d<e.length;d++){var h=e[d],g=u.has(h);if(!g){c=!0;break}}c||(c=u.size!==e.length),c&&(l.classes=i,a.push(s))}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 t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Sr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=t===void 0,i=[],o=0,s=n.length;o<s;o++)for(var l=n[o],u=l._private.classes,c=!1,d=0;d<e.length;d++){var h=e[d],g=u.has(h),p=!1;t||a&&!g?(u.add(h),p=!0):(!t||a&&g)&&(u.delete(h),p=!0),!c&&p&&(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(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};Lu.className=Lu.classNames=Lu.classes;var gr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:rt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};gr.variable="(?:[\\w-.]|(?:\\\\"+gr.metaChar+"))+";gr.className="(?:[\\w-]|(?:\\\\"+gr.metaChar+"))+";gr.value=gr.string+"|"+gr.number;gr.id=gr.variable;(function(){var r,e,t;for(r=gr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],gr.comparatorOp+="|@"+e;for(r=gr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(gr.comparatorOp+="|\\!"+e)})();var Cr=function(){return{checks:[]}},ze={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},pm=[{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 Gq(r.selector,e.selector)}),H5=(function(){for(var r={},e,t=0;t<pm.length;t++)e=pm[t],r[e.selector]=e.matches;return r})(),K5=function(e,t){return H5[e](t)},j5="("+pm.map(function(r){return r.selector}).join("|")+")",qi=function(e){return e.replace(new RegExp("\\\\("+gr.metaChar+")","g"),function(t,n){return n})},ya=function(e,t,n){e[e.length-1]=n},ym=[{name:"group",query:!0,regex:"("+gr.group+")",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:j5,populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+gr.id+")",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.ID,value:qi(i)})}},{name:"className",query:!0,regex:"\\.("+gr.className+")",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.CLASS,value:qi(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+gr.variable+")\\s*\\]",populate:function(e,t,n){var a=Yr(n,1),i=a[0];t.checks.push({type:ze.DATA_EXIST,field:qi(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+gr.variable+")\\s*("+gr.comparatorOp+")\\s*("+gr.value+")\\s*\\]",populate:function(e,t,n){var a=Yr(n,3),i=a[0],o=a[1],s=a[2],l=new RegExp("^"+gr.string+"$").exec(s)!=null;l?s=s.substring(1,s.length-1):s=parseFloat(s),t.checks.push({type:ze.DATA_COMPARE,field:qi(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+gr.boolOp+")\\s*("+gr.variable+")\\s*\\]",populate:function(e,t,n){var a=Yr(n,2),i=a[0],o=a[1];t.checks.push({type:ze.DATA_BOOL,field:qi(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+gr.meta+")\\s*("+gr.comparatorOp+")\\s*("+gr.number+")\\s*\\]\\]",populate:function(e,t,n){var a=Yr(n,3),i=a[0],o=a[1],s=a[2];t.checks.push({type:ze.META_COMPARE,field:qi(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:gr.separator,populate:function(e,t){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=Cr();return s}},{name:"directedEdge",separator:!0,regex:gr.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=t,i=Cr();return n.checks.push({type:ze.DIRECTED_EDGE,source:a,target:i}),ya(e,t,n),e.edgeCount++,i}else{var o=Cr(),s=t,l=Cr();return o.checks.push({type:ze.NODE_SOURCE,source:s,target:l}),ya(e,t,o),e.edgeCount++,l}}},{name:"undirectedEdge",separator:!0,regex:gr.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=t,i=Cr();return n.checks.push({type:ze.UNDIRECTED_EDGE,nodes:[a,i]}),ya(e,t,n),e.edgeCount++,i}else{var o=Cr(),s=t,l=Cr();return o.checks.push({type:ze.NODE_NEIGHBOR,node:s,neighbor:l}),ya(e,t,o),l}}},{name:"child",separator:!0,regex:gr.child,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=Cr(),i=e[e.length-1];return n.checks.push({type:ze.CHILD,parent:i,child:a}),ya(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=Cr(),s=e[e.length-1],l=Cr(),u=Cr(),c=Cr(),d=Cr();return o.checks.push({type:ze.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=t.checks,t.checks=[{type:ze.TRUE}],d.checks.push({type:ze.TRUE}),l.checks.push({type:ze.PARENT,parent:d,child:c}),ya(e,s,o),e.currentSubject=u,e.compoundCount++,c}else{var h=Cr(),g=Cr(),p=[{type:ze.PARENT,parent:h,child:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"descendant",separator:!0,regex:gr.descendant,populate:function(e,t){if(e.currentSubject==null){var n=Cr(),a=Cr(),i=e[e.length-1];return n.checks.push({type:ze.DESCENDANT,ancestor:i,descendant:a}),ya(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=Cr(),s=e[e.length-1],l=Cr(),u=Cr(),c=Cr(),d=Cr();return o.checks.push({type:ze.COMPOUND_SPLIT,left:s,right:l,subject:u}),u.checks=t.checks,t.checks=[{type:ze.TRUE}],d.checks.push({type:ze.TRUE}),l.checks.push({type:ze.ANCESTOR,ancestor:d,descendant:c}),ya(e,s,o),e.currentSubject=u,e.compoundCount++,c}else{var h=Cr(),g=Cr(),p=[{type:ze.ANCESTOR,ancestor:h,descendant:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"subject",modifier:!0,regex:gr.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Er("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===ze.DIRECTED_EDGE?a.type=ze.NODE_TARGET:i===ze.UNDIRECTED_EDGE&&(a.type=ze.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];ym.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var Y5=function(e){for(var t,n,a,i=0;i<ym.length;i++){var o=ym[i],s=o.name,l=e.match(o.regexObj);if(l!=null){n=l,t=o,a=s;var u=l[0];e=e.substring(u.length);break}}return{expr:t,match:n,name:a,remaining:e}},Z5=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},X5=function(e){var t=this,n=t.inputText=e,a=t[0]=Cr();for(t.length=1,n=Z5(n);;){var i=Y5(n);if(i.expr==null)return Er("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(t,a,o);if(s===!1)return!1;if(s!=null&&(a=s),n=i.remaining,n.match(/^\s*$/))break}var l=t[t.length-1];t.currentSubject!=null&&(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 Er("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Er("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;c.edgeCount===1&&Er("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},Q5=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(c){return c??""},t=function(c){return Ke(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},a=function(c,d){var h=c.type,g=c.value;switch(h){case ze.GROUP:{var p=e(g);return p.substring(0,p.length-1)}case ze.DATA_COMPARE:{var E=c.field,m=c.operator;return"["+E+n(e(m))+t(g)+"]"}case ze.DATA_BOOL:{var b=c.operator,w=c.field;return"["+e(b)+w+"]"}case ze.DATA_EXIST:{var x=c.field;return"["+x+"]"}case ze.META_COMPARE:{var C=c.operator,T=c.field;return"[["+T+n(e(C))+t(g)+"]]"}case ze.STATE:return g;case ze.ID:return"#"+g;case ze.CLASS:return"."+g;case ze.PARENT:case ze.CHILD:return i(c.parent,d)+n(">")+i(c.child,d);case ze.ANCESTOR:case ze.DESCENDANT:return i(c.ancestor,d)+" "+i(c.descendant,d);case ze.COMPOUND_SPLIT:{var S=i(c.left,d),_=i(c.subject,d),A=i(c.right,d);return S+(S.length>0?" ":"")+_+A}case ze.TRUE:return""}},i=function(c,d){return c.checks.reduce(function(h,g,p){return h+(d===c&&p===0?"$":"")+a(g,d)},"")},o="",s=0;s<this.length;s++){var l=this[s];o+=i(l,l.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},J5={parse:X5,toString:Q5},WR=function(e,t,n){var a,i=Ke(e),o=ke(e),s=Ke(n),l,u,c=!1,d=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(i||s||c)&&(l=!i&&!o?"":""+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=l.indexOf(u)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return d&&(e!=null||!h)&&(a=!a),a},ez=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},rz=function(e){return e!==void 0},Wm=function(e,t){return e.data(t)},tz=function(e,t){return e[t]()},Vr=[],Ir=function(e,t){return e.checks.every(function(n){return Vr[n.type](n,t)})};Vr[ze.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};Vr[ze.STATE]=function(r,e){var t=r.value;return K5(t,e)};Vr[ze.ID]=function(r,e){var t=r.value;return e.id()===t};Vr[ze.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};Vr[ze.META_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return WR(tz(e,t),n,a)};Vr[ze.DATA_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return WR(Wm(e,t),n,a)};Vr[ze.DATA_BOOL]=function(r,e){var t=r.field,n=r.operator;return ez(Wm(e,t),n)};Vr[ze.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,rz(Wm(e,t))};Vr[ze.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],n=r.nodes[1],a=e.source(),i=e.target();return Ir(t,a)&&Ir(n,i)||Ir(n,a)&&Ir(t,i)};Vr[ze.NODE_NEIGHBOR]=function(r,e){return Ir(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Ir(r.neighbor,t)})};Vr[ze.DIRECTED_EDGE]=function(r,e){return Ir(r.source,e.source())&&Ir(r.target,e.target())};Vr[ze.NODE_SOURCE]=function(r,e){return Ir(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Ir(r.target,t)})};Vr[ze.NODE_TARGET]=function(r,e){return Ir(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Ir(r.source,t)})};Vr[ze.CHILD]=function(r,e){return Ir(r.child,e)&&Ir(r.parent,e.parent())};Vr[ze.PARENT]=function(r,e){return Ir(r.parent,e)&&e.children().some(function(t){return Ir(r.child,t)})};Vr[ze.DESCENDANT]=function(r,e){return Ir(r.descendant,e)&&e.ancestors().some(function(t){return Ir(r.ancestor,t)})};Vr[ze.ANCESTOR]=function(r,e){return Ir(r.ancestor,e)&&e.descendants().some(function(t){return Ir(r.descendant,t)})};Vr[ze.COMPOUND_SPLIT]=function(r,e){return Ir(r.subject,e)&&Ir(r.left,e)&&Ir(r.right,e)};Vr[ze.TRUE]=function(){return!0};Vr[ze.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};Vr[ze.FILTER]=function(r,e){var t=r.value;return t(e)};var nz=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===ze.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(i){for(var o=0;o<t.length;o++){var s=t[o];if(Ir(s,i))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)},az=function(e){for(var t=this,n=0;n<t.length;n++){var a=t[n];if(Ir(a,e))return!0}return!1},iz={matches:az,filter:nz},Pa=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ke(e)&&e.match(/^\s*$/)||(Zt(e)?this.addQuery({checks:[{type:ze.COLLECTION,value:e.collection()}]}):Fr(e)?this.addQuery({checks:[{type:ze.FILTER,value:e}]}):Ke(e)?this.parse(e)||(this.invalid=!0):Lr("A selector must be created from a string; found "))},Da=Pa.prototype;[J5,iz].forEach(function(r){return Ye(Da,r)});Da.text=function(){return this.inputText};Da.size=function(){return this.length};Da.eq=function(r){return this[r]};Da.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};Da.addQuery=function(r){this[this.length++]=r};Da.selector=Da.toString;var _a={allAre:function(e){var t=new Pa(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new Pa(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length,n=e.length;return t!==n?!1:t===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(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())})}};_a.allAreNeighbours=_a.allAreNeighbors;_a.has=_a.contains;_a.equal=_a.equals=_a.same;var fn=function(e,t){return function(a,i,o,s){var l=a,u=this,c;if(l==null?c="":Zt(l)&&l.length===1&&(c=l.id()),u.length===1&&c){var d=u[0]._private,h=d.traversalCache=d.traversalCache||{},g=h[t]=h[t]||[],p=oi(c),E=g[p];return E||(g[p]=e.call(u,a,i,o,s))}else return e.call(u,a,i,o,s)}},ao={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&t.push(o)}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++){var i=n[a];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var a=this[n],i=a.parents();t=t||i,t=t.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:fn(function(r){for(var e=[],t=0;t<this.length;t++)for(var n=this[t],a=n._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()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];t.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function Um(r,e,t,n){for(var a=[],i=new io,o=r.cy(),s=o.hasCompoundNodes(),l=0;l<r.length;l++){var u=r[l];t?a.push(u):s&&n(a,i,u)}for(;a.length>0;){var c=a.shift();e(c),i.add(c.id()),s&&n(a,i,c)}return r}function UR(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)}}ao.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Um(this,r,e,UR)};function HR(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}ao.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Um(this,r,e,HR)};function oz(r,e,t){HR(r,e,t),UR(r,e,t)}ao.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Um(this,r,e,oz)};ao.ancestors=ao.parents;var is,KR;is=KR={data:xr.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:xr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:xr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:xr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:xr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};is.attr=is.data;is.removeAttr=is.removeData;var sz=KR,ml={};function Dd(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var n=0,a=t[0],i=a._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(n+=r(a,s))}return n}else return}}Ye(ml,{degree:Dd(function(r,e){return e.source().same(e.target())?2:1}),indegree:Dd(function(r,e){return e.target().same(r)?1:0}),outdegree:Dd(function(r,e){return e.source().same(r)?1:0})});function Ni(r,e){return function(t){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],s=o[r](t);s!==void 0&&(n===void 0||e(s,n))&&(n=s)}return n}}Ye(ml,{minDegree:Ni("degree",function(r,e){return r<e}),maxDegree:Ni("degree",function(r,e){return r>e}),minIndegree:Ni("indegree",function(r,e){return r<e}),maxIndegree:Ni("indegree",function(r,e){return r>e}),minOutdegree:Ni("outdegree",function(r,e){return r<e}),maxOutdegree:Ni("outdegree",function(r,e){return r>e})});Ye(ml,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var wn,jR,YR=function(e,t,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,s={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,n),i.dirtyBoundingBoxCache()}}},Sx={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){YR(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};wn=jR={position:xr.data(Sx),silentPosition:xr.data(Ye({},Sx,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){YR(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(pr(e))t?this.silentPosition(e):this.position(e);else if(Fr(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=n(o,i))&&(t?o.silentPosition(s):o.position(s))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var a;if(pr(e)?(a={x:ke(e.x)?e.x:0,y:ke(e.y)?e.y:0},n=t):Ke(e)&&ke(t)&&(a={x:0,y:0},a[e]=t),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var l=s.position(),u={x:l.x+a.x,y:l.y+a.y};n?s.silentPosition(u):s.position(u)}}i.endBatch()}return this},silentShift:function(e,t){return pr(e)?this.shift(e,!0):Ke(e)&&ke(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),s=pr(e)?e:void 0,l=s!==void 0||t!==void 0&&Ke(e);if(n&&n.isNode())if(l)for(var u=0;u<this.length;u++){var c=this[u];t!==void 0?c.position(e,(t-o[e])/i):s!==void 0&&c.position(CR(s,i,o))}else{var d=n.position();return s=dl(d,i,o),e===void 0?s:s[e]}else if(!l)return;return this},relativePosition:function(e,t){var n=this[0],a=this.cy(),i=pr(e)?e:void 0,o=i!==void 0||t!==void 0&&Ke(e),s=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var l=0;l<this.length;l++){var u=this[l],c=s?u.parent():null,d=c&&c.length>0,h=d;d&&(c=c[0]);var g=h?c.position():{x:0,y:0};t!==void 0?u.position(e,t+g[e]):i!==void 0&&u.position({x:i.x+g.x,y:i.y+g.y})}else{var p=n.position(),E=s?n.parent():null,m=E&&E.length>0,b=m;m&&(E=E[0]);var w=b?E.position():{x:0,y:0};return i={x:p.x-w.x,y:p.y-w.y},e===void 0?i:i[e]}else if(!o)return;return this}};wn.modelPosition=wn.point=wn.position;wn.modelPositions=wn.points=wn.positions;wn.renderedPoint=wn.renderedPosition;wn.relativePoint=wn.relativePosition;var uz=jR,Ji,qa;Ji=qa={};qa.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),a=t.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,s=e.y1*n+a.y,l=e.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:l,w:o-i,h:l-s}};qa.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};qa.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(o){if(!o.isParent())return;var s=o._private,l=o.children(),u=o.pstyle("compound-sizing-wrt-labels").value==="include",c={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=s.position;(d.w===0||d.h===0)&&(d={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},d.x1=h.x-d.w/2,d.x2=h.x+d.w/2,d.y1=h.y-d.h/2,d.y2=h.y+d.h/2);function g(P,D,I){var M=0,k=0,N=D+I;return P>0&&N>0&&(M=D/N*P,k=I/N*P),{biasDiff:M,biasComplementDiff:k}}function p(P,D,I,M){if(I.units==="%")switch(M){case"width":return P>0?I.pfValue*P:0;case"height":return D>0?I.pfValue*D:0;case"average":return P>0&&D>0?I.pfValue*(P+D)/2:0;case"min":return P>0&&D>0?P>D?I.pfValue*D:I.pfValue*P:0;case"max":return P>0&&D>0?P>D?I.pfValue*P:I.pfValue*D:0;default:return 0}else return I.units==="px"?I.pfValue:0}var E=c.width.left.value;c.width.left.units==="px"&&c.width.val>0&&(E=E*100/c.width.val);var m=c.width.right.value;c.width.right.units==="px"&&c.width.val>0&&(m=m*100/c.width.val);var b=c.height.top.value;c.height.top.units==="px"&&c.height.val>0&&(b=b*100/c.height.val);var w=c.height.bottom.value;c.height.bottom.units==="px"&&c.height.val>0&&(w=w*100/c.height.val);var x=g(c.width.val-d.w,E,m),C=x.biasDiff,T=x.biasComplementDiff,S=g(c.height.val-d.h,b,w),_=S.biasDiff,A=S.biasComplementDiff;s.autoPadding=p(d.w,d.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,c.width.val),h.x=(-C+d.x1+d.x2+T)/2,s.autoHeight=Math.max(d.h,c.height.val),h.y=(-_+d.y1+d.y2+A)/2}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 un=function(e){return e===1/0||e===-1/0?0:e},bn=function(e,t,n,a,i){a-t===0||i-n===0||t==null||n==null||a==null||i==null||(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)},ba=function(e,t){return t==null?e:bn(e,t.x1,t.y1,t.x2,t.y2)},Mo=function(e,t,n){return Ft(e,t,n)},_u=function(e,t,n){if(!t.cy().headless()){var a=t._private,i=a.rstyle,o=i.arrowWidth/2,s=t.pstyle(n+"-arrow-shape").value,l,u;if(s!=="none"){n==="source"?(l=i.srcX,u=i.srcY):n==="target"?(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-o,d.y1=u-o,d.x2=l+o,d.y2=u+o,d.w=d.x2-d.x1,d.h=d.y2-d.y1,ku(d,1),bn(e,d.x1,d.y1,d.x2,d.y2)}}},Id=function(e,t,n){if(!t.cy().headless()){var a;n?a=n+"-":a="";var i=t._private,o=i.rstyle,s=t.pstyle(a+"label").strValue;if(s){var l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),c=Mo(o,"labelWidth",n),d=Mo(o,"labelHeight",n),h=Mo(o,"labelX",n),g=Mo(o,"labelY",n),p=t.pstyle(a+"text-margin-x").pfValue,E=t.pstyle(a+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(a+"text-rotation"),w=t.pstyle("text-outline-width").pfValue,x=t.pstyle("text-border-width").pfValue,C=x/2,T=t.pstyle("text-background-padding").pfValue,S=2,_=d,A=c,P=A/2,D=_/2,I,M,k,N;if(m)I=h-P,M=h+P,k=g-D,N=g+D;else{switch(l.value){case"left":I=h-A,M=h;break;case"center":I=h-P,M=h+P;break;case"right":I=h,M=h+A;break}switch(u.value){case"top":k=g-_,N=g;break;case"center":k=g-D,N=g+D;break;case"bottom":k=g,N=g+_;break}}var z=p-Math.max(w,C)-T-S,W=p+Math.max(w,C)+T+S,q=E-Math.max(w,C)-T-S,$=E+Math.max(w,C)+T+S;I+=z,M+=W,k+=q,N+=$;var X=n||"main",Y=i.labelBounds,K=Y[X]=Y[X]||{};K.x1=I,K.y1=k,K.x2=M,K.y2=N,K.w=M-I,K.h=N-k,K.leftPad=z,K.rightPad=W,K.topPad=q,K.botPad=$;var ee=m&&b.strValue==="autorotate",le=b.pfValue!=null&&b.pfValue!==0;if(ee||le){var G=ee?Mo(i.rstyle,"labelAngle",n):b.pfValue,V=Math.cos(G),j=Math.sin(G),re=(I+M)/2,ce=(k+N)/2;if(!m){switch(l.value){case"left":re=M;break;case"right":re=I;break}switch(u.value){case"top":ce=N;break;case"bottom":ce=k;break}}var se=function(U,fe){return U=U-re,fe=fe-ce,{x:U*V-fe*j+re,y:U*j+fe*V+ce}},Z=se(I,k),Q=se(I,N),ae=se(M,k),ne=se(M,N);I=Math.min(Z.x,Q.x,ae.x,ne.x),M=Math.max(Z.x,Q.x,ae.x,ne.x),k=Math.min(Z.y,Q.y,ae.y,ne.y),N=Math.max(Z.y,Q.y,ae.y,ne.y)}var de=X+"Rot",Ce=Y[de]=Y[de]||{};Ce.x1=I,Ce.y1=k,Ce.x2=M,Ce.y2=N,Ce.w=M-I,Ce.h=N-k,bn(e,I,k,M,N),bn(i.labelBounds.all,I,k,M,N)}return e}},Tx=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,a=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,o=a+i;ZR(e,t,n,o,"outside",o/2)}},ZR=function(e,t,n,a,i,o){if(!(n===0||a<=0||i==="inside")){var s=t.cy(),l=t.pstyle("shape").value,u=s.renderer().nodeShapes[l],c=t.position(),d=c.x,h=c.y,g=t.width(),p=t.height();if(u.hasMiterBounds){i==="center"&&(a/=2);var E=u.miterBounds(d,h,g,p,a);ba(e,E)}else o!=null&&o>0&&Mu(e,[o,o,o,o])}},lz=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;ZR(e,t,n,a,i)}},fz=function(e,t){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Bt(),s=e._private,l=e.isNode(),u=e.isEdge(),c,d,h,g,p,E,m=s.rstyle,b=l&&a?e.pstyle("bounds-expansion").pfValue:[0],w=function(ve){return ve.pstyle("display").value!=="none"},x=!a||w(e)&&(!u||w(e.source())&&w(e.target()));if(x){var C=0,T=0;a&&t.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(T=e.pstyle("overlay-padding").value));var S=0,_=0;a&&t.includeUnderlays&&(S=e.pstyle("underlay-opacity").value,S!==0&&(_=e.pstyle("underlay-padding").value));var A=Math.max(T,_),P=0,D=0;if(a&&(P=e.pstyle("width").pfValue,D=P/2),l&&t.includeNodes){var I=e.position();p=I.x,E=I.y;var M=e.outerWidth(),k=M/2,N=e.outerHeight(),z=N/2;c=p-k,d=p+k,h=E-z,g=E+z,bn(o,c,h,d,g),a&&Tx(o,e),a&&t.includeOutlines&&!i&&Tx(o,e),a&&lz(o,e)}else if(u&&t.includeEdges)if(a&&!i){var W=e.pstyle("curve-style").strValue;if(c=Math.min(m.srcX,m.midX,m.tgtX),d=Math.max(m.srcX,m.midX,m.tgtX),h=Math.min(m.srcY,m.midY,m.tgtY),g=Math.max(m.srcY,m.midY,m.tgtY),c-=D,d+=D,h-=D,g+=D,bn(o,c,h,d,g),W==="haystack"){var q=m.haystackPts;if(q&&q.length===2){if(c=q[0].x,h=q[0].y,d=q[1].x,g=q[1].y,c>d){var $=c;c=d,d=$}if(h>g){var X=h;h=g,g=X}bn(o,c-D,h-D,d+D,g+D)}}else if(W==="bezier"||W==="unbundled-bezier"||wa(W,"segments")||wa(W,"taxi")){var Y;switch(W){case"bezier":case"unbundled-bezier":Y=m.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":Y=m.linePts;break}if(Y!=null)for(var K=0;K<Y.length;K++){var ee=Y[K];c=ee.x-D,d=ee.x+D,h=ee.y-D,g=ee.y+D,bn(o,c,h,d,g)}}}else{var le=e.source(),G=le.position(),V=e.target(),j=V.position();if(c=G.x,d=j.x,h=G.y,g=j.y,c>d){var re=c;c=d,d=re}if(h>g){var ce=h;h=g,g=ce}c-=D,d+=D,h-=D,g+=D,bn(o,c,h,d,g)}if(a&&t.includeEdges&&u&&(_u(o,e,"mid-source"),_u(o,e,"mid-target"),_u(o,e,"source"),_u(o,e,"target")),a){var se=e.pstyle("ghost").value==="yes";if(se){var Z=e.pstyle("ghost-offset-x").pfValue,Q=e.pstyle("ghost-offset-y").pfValue;bn(o,o.x1+Z,o.y1+Q,o.x2+Z,o.y2+Q)}}var ae=s.bodyBounds=s.bodyBounds||{};cw(ae,o),Mu(ae,b),ku(ae,1),a&&(c=o.x1,d=o.x2,h=o.y1,g=o.y2,bn(o,c-A,h-A,d+A,g+A));var ne=s.overlayBounds=s.overlayBounds||{};cw(ne,o),Mu(ne,b),ku(ne,1);var de=s.labelBounds=s.labelBounds||{};de.all!=null?UN(de.all):de.all=Bt(),a&&t.includeLabels&&(t.includeMainLabels&&Id(o,e,null),u&&(t.includeSourceLabels&&Id(o,e,"source"),t.includeTargetLabels&&Id(o,e,"target")))}return o.x1=un(o.x1),o.y1=un(o.y1),o.x2=un(o.x2),o.y2=un(o.y2),o.w=un(o.x2-o.x1),o.h=un(o.y2-o.y1),o.w>0&&o.h>0&&x&&(Mu(o,b),ku(o,1)),o},XR=function(e){var t=0,n=function(o){return(o?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),a+=n(e.includeOutlines),a},QR=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return iw([t(n.x),t(n.y),t(a.x),t(a.y)])}else{var i=e.position();return iw([t(i.x),t(i.y)])}},Rx=function(e,t){var n=e._private,a,i=e.isEdge(),o=t==null?Ax:XR(t),s=o===Ax;if(n.bbCache==null?(a=fz(e,os),n.bbCache=a,n.bbCachePosKey=QR(e)):a=n.bbCache,!s){var l=e.isNode();a=Bt(),(t.includeNodes&&l||t.includeEdges&&!l)&&(t.includeOverlays?ba(a,n.overlayBounds):ba(a,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ba(a,n.labelBounds.all):(t.includeMainLabels&&ba(a,n.labelBounds.mainRot),t.includeSourceLabels&&ba(a,n.labelBounds.sourceRot),t.includeTargetLabels&&ba(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},os={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Ax=XR(os),Px=yt(os);qa.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,n=to(function(c){var d=c._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==QR(c)},function(c){return c.id()});if(t&&this.length===1&&!n(this[0]))r===void 0?r=os:r=Px(r),e=Rx(this[0],r);else{e=Bt(),r=r||os;var a=Px(r),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),s&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var l=0;l<i.length;l++){var u=i[l];n(u)&&u.dirtyBoundingBoxCache(),ba(e,Rx(u,a))}}return e.x1=un(e.x1),e.y1=un(e.y1),e.x2=un(e.x2),e.y2=un(e.y2),e.w=un(e.x2-e.x1),e.h=un(e.y2-e.y1),e};qa.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};qa.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)),pr(r)){var i=r;r=function(){return i}}var o=function(c,d){return c._private.bbAtOldPos=r(c,d)},s=function(c){return c._private.bbAtOldPos};t.startBatch(),e.forEach(o).silentPositions(r),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var l=WN(this.boundingBox({useCache:!1}));return e.silentPositions(s),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),l};Ji.boundingbox=Ji.bb=Ji.boundingBox;Ji.renderedBoundingbox=Ji.renderedBoundingBox;var cz=qa,$o,ws;$o=ws={};var JR=function(e){e.uppercaseName=W1(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=W1(e.outerName),$o[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var s=n.pstyle(e.name);switch(s.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},$o["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var s=n[e.name](),l=n.pstyle("border-position").value,u;l==="center"?u=n.pstyle("border-width").pfValue:l==="outside"?u=2*n.pstyle("border-width").pfValue:u=0;var c=2*n.padding();return s+u+c}else return 1},$o["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},$o["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};JR({name:"width"});JR({name:"height"});ws.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};ws.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};ws.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var dz=ws,vz=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},hz=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return dl(t(e),n.zoom(),n.pan())}},gz=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return t(e).map(function(o){return dl(o,i,a)})}},pz=function(e){return e.renderer().getControlPoints(e)},yz=function(e){return e.renderer().getSegmentPoints(e)},mz=function(e){return e.renderer().getSourceEndpoint(e)},bz=function(e){return e.renderer().getTargetEndpoint(e)},wz=function(e){return e.renderer().getEdgeMidpoint(e)},Dx={controlPoints:{get:pz,mult:!0},segmentPoints:{get:yz,mult:!0},sourceEndpoint:{get:mz},targetEndpoint:{get:bz},midpoint:{get:wz}},xz=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},Ez=Object.keys(Dx).reduce(function(r,e){var t=Dx[e],n=xz(e);return r[e]=function(){return vz(this,t.get)},t.mult?r[n]=function(){return gz(this,t.get)}:r[n]=function(){return hz(this,t.get)},r},{}),Cz=Ye({},uz,cz,dz,Ez);/*!
|
|
34
|
+
*/var sA=0,uA=1,lA=2,Sn=function(e){if(!(this instanceof Sn))return new Sn(e);this.id="Thenable/1.0.7",this.state=sA,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Sn.prototype={fulfill:function(e){return ax(this,uA,"fulfillValue",e)},reject:function(e){return ax(this,lA,"rejectReason",e)},then:function(e,t){var n=this,a=new Sn;return n.onFulfilled.push(ox(e,a,"fulfill")),n.onRejected.push(ox(t,a,"reject")),fA(n),a.proxy}};var ax=function(e,t,n,a){return e.state===sA&&(e.state=t,e[n]=a,fA(e)),e},fA=function(e){e.state===uA?ix(e,"onFulfilled",e.fulfillValue):e.state===lA&&ix(e,"onRejected",e.rejectReason)},ix=function(e,t,n){if(e[t].length!==0){var a=e[t];e[t]=[];var i=function(){for(var s=0;s<a.length;s++)a[s](n)};typeof setImmediate=="function"?setImmediate(i):setTimeout(i,0)}},ox=function(e,t,n){return function(a){if(typeof e!="function")t[n].call(t,a);else{var i;try{i=e(a)}catch(o){t.reject(o);return}cA(t,i)}}},cA=function(e,t){if(e===t||e.proxy===t){e.reject(new TypeError("cannot resolve promise with itself"));return}var n;if(at(t)==="object"&&t!==null||typeof t=="function")try{n=t.then}catch(i){e.reject(i);return}if(typeof n=="function"){var a=!1;try{n.call(t,function(i){a||(a=!0,i===t?e.reject(new TypeError("circular thenable chain")):cA(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(t)};Sn.all=function(r){return new Sn(function(e,t){for(var n=new Array(r.length),a=0,i=function(u,l){n[u]=l,a++,a===r.length&&e(n)},o=0;o<r.length;o++)(function(s){var u=r[s],l=u!=null&&u.then!=null;if(l)u.then(function(d){i(s,d)},function(d){t(d)});else{var f=u;i(s,f)}})(o)})};Sn.resolve=function(r){return new Sn(function(e,t){e(r)})};Sn.reject=function(r){return new Sn(function(e,t){t(r)})};var po=typeof Promise<"u"?Promise:Sn,Rm=function(e,t,n){var a=Hm(e),i=!a,o=this._private=Ze({duration:1e3},t,n);if(o.target=e,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&$r(o.complete)&&o.completes.push(o.complete),i){var s=e.position();o.startPosition=o.startPosition||{x:s.x,y:s.y},o.startStyle=o.startStyle||e.cy().style().getAnimationStartStyle(e,o.style)}if(a){var u=e.pan();o.startPan={x:u.x,y:u.y},o.startZoom=e.zoom()}this.length=1,this[0]=this},vi=Rm.prototype;Ze(vi,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;e.queue?t=n.queue:t=n.current,t.push(this),Jt(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(l,f){var d=e[l];d!=null&&(e[l]=e[f],e[f]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var a=0;a<e.style.length;a++){var i=e.style[a],o=i.name,s=e.startStyle[o];e.startStyle[o]=i,e.style[a]=s}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case"frame":n=t.frames;break;default:case"complete":case"completed":n=t.completes}return new po(function(a,i){n.push(function(){a()})})}});vi.complete=vi.completed;vi.run=vi.play;vi.running=vi.playing;var Uz={animated:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return!1;var o=a[0];if(o)return o._private.animation.current.length>0}},clearQueue:function(){return function(){var t=this,n=t.length!==void 0,a=n?t:[t],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var o=0;o<a.length;o++){var s=a[o];s._private.animation.queue=[]}return this}},delay:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){var a=this._private.cy||this;return a.styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this,u=!i,l=!u;if(!s.styleEnabled())return this;var f=s.style();t=Ze({},t,n);var d=Object.keys(t).length===0;if(d)return new Rm(o[0],t);switch(t.duration===void 0&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200;break}if(l&&(t.style=f.getPropsList(t.style||t.css),t.css=void 0),l&&t.renderedPosition!=null){var h=t.renderedPosition,g=s.pan(),p=s.zoom();t.position=XR(h,p,g)}if(u&&t.panBy!=null){var x=t.panBy,b=s.pan();t.pan={x:b.x+x.x,y:b.y+x.y}}var w=t.center||t.centre;if(u&&w!=null){var y=s.getCenterPan(w.eles,t.zoom);y!=null&&(t.pan=y)}if(u&&t.fit!=null){var E=t.fit,C=s.getFitViewport(E.eles||E.boundingBox,E.padding);C!=null&&(t.pan=C.pan,t.zoom=C.zoom)}if(u&&yr(t.zoom)){var S=s.getZoomedViewport(t.zoom);S!=null?(S.zoomed&&(t.zoom=S.zoom),S.panned&&(t.pan=S.pan)):t.zoom=null}return new Rm(o[0],t)}},animate:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;n&&(t=Ze({},t,n));for(var u=0;u<o.length;u++){var l=o[u],f=l.animated()&&(t.queue===void 0||t.queue),d=l.animation(t,f?{queue:!0}:void 0);d.play()}return this}},stop:function(){return function(t,n){var a=this,i=a.length!==void 0,o=i?a:[a],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var u=0;u<o.length;u++){for(var l=o[u],f=l._private,d=f.animation.current,h=0;h<d.length;h++){var g=d[h],p=g._private;n&&(p.duration=0)}t&&(f.animation.queue=[]),n||(f.animation.current=[])}return s.notify("draw"),this}}},td,sx;function _l(){if(sx)return td;sx=1;var r=Array.isArray;return td=r,td}var nd,ux;function Hz(){if(ux)return nd;ux=1;var r=_l(),e=_s(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return nd=a,nd}var ad,lx;function Kz(){if(lx)return ad;lx=1;var r=$R(),e=Cs(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=r(s);return u==n||u==a||u==t||u==i}return ad=o,ad}var id,fx;function jz(){if(fx)return id;fx=1;var r=wl(),e=r["__core-js_shared__"];return id=e,id}var od,cx;function Yz(){if(cx)return od;cx=1;var r=jz(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return od=t,od}var sd,dx;function Xz(){if(dx)return sd;dx=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return sd=t,sd}var ud,vx;function Zz(){if(vx)return ud;vx=1;var r=Kz(),e=Yz(),t=Cs(),n=Xz(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?f:i;return g.test(n(h))}return ud=d,ud}var ld,hx;function Qz(){if(hx)return ld;hx=1;function r(e,t){return e==null?void 0:e[t]}return ld=r,ld}var fd,gx;function n0(){if(gx)return fd;gx=1;var r=Zz(),e=Qz();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return fd=t,fd}var cd,px;function Sl(){if(px)return cd;px=1;var r=n0(),e=r(Object,"create");return cd=e,cd}var dd,yx;function Jz(){if(yx)return dd;yx=1;var r=Sl();function e(){this.__data__=r?r(null):{},this.size=0}return dd=e,dd}var vd,mx;function e5(){if(mx)return vd;mx=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return vd=r,vd}var hd,bx;function r5(){if(bx)return hd;bx=1;var r=Sl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return hd=a,hd}var gd,wx;function t5(){if(wx)return gd;wx=1;var r=Sl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return gd=n,gd}var pd,xx;function n5(){if(xx)return pd;xx=1;var r=Sl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return pd=t,pd}var yd,Ex;function a5(){if(Ex)return yd;Ex=1;var r=Jz(),e=e5(),t=r5(),n=t5(),a=n5();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,yd=i,yd}var md,Cx;function i5(){if(Cx)return md;Cx=1;function r(){this.__data__=[],this.size=0}return md=r,md}var bd,_x;function dA(){if(_x)return bd;_x=1;function r(e,t){return e===t||e!==e&&t!==t}return bd=r,bd}var wd,Sx;function Tl(){if(Sx)return wd;Sx=1;var r=dA();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return wd=e,wd}var xd,Tx;function o5(){if(Tx)return xd;Tx=1;var r=Tl(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return xd=n,xd}var Ed,Rx;function s5(){if(Rx)return Ed;Rx=1;var r=Tl();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Ed=e,Ed}var Cd,Ax;function u5(){if(Ax)return Cd;Ax=1;var r=Tl();function e(t){return r(this.__data__,t)>-1}return Cd=e,Cd}var _d,Px;function l5(){if(Px)return _d;Px=1;var r=Tl();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}return _d=e,_d}var Sd,Ix;function f5(){if(Ix)return Sd;Ix=1;var r=i5(),e=o5(),t=s5(),n=u5(),a=l5();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Sd=i,Sd}var Td,Dx;function c5(){if(Dx)return Td;Dx=1;var r=n0(),e=wl(),t=r(e,"Map");return Td=t,Td}var Rd,Bx;function d5(){if(Bx)return Rd;Bx=1;var r=a5(),e=f5(),t=c5();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Rd=n,Rd}var Ad,Mx;function v5(){if(Mx)return Ad;Mx=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Ad=r,Ad}var Pd,Lx;function Rl(){if(Lx)return Pd;Lx=1;var r=v5();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return Pd=e,Pd}var Id,Ox;function h5(){if(Ox)return Id;Ox=1;var r=Rl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return Id=e,Id}var Dd,kx;function g5(){if(kx)return Dd;kx=1;var r=Rl();function e(t){return r(this,t).get(t)}return Dd=e,Dd}var Bd,qx;function p5(){if(qx)return Bd;qx=1;var r=Rl();function e(t){return r(this,t).has(t)}return Bd=e,Bd}var Md,Nx;function y5(){if(Nx)return Md;Nx=1;var r=Rl();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}return Md=e,Md}var Ld,Fx;function m5(){if(Fx)return Ld;Fx=1;var r=d5(),e=h5(),t=g5(),n=p5(),a=y5();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Ld=i,Ld}var Od,zx;function b5(){if(zx)return Od;zx=1;var r=m5(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=n.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(t.Cache||r),i}return t.Cache=r,Od=t,Od}var kd,$x;function w5(){if($x)return kd;$x=1;var r=b5(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return kd=t,kd}var qd,Vx;function vA(){if(Vx)return qd;Vx=1;var r=w5(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,u,l){i.push(u?l.replace(t,"$1"):s||o)}),i});return qd=n,qd}var Nd,Gx;function hA(){if(Gx)return Nd;Gx=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return Nd=r,Nd}var Fd,Wx;function x5(){if(Wx)return Fd;Wx=1;var r=jm(),e=hA(),t=_l(),n=_s(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Fd=o,Fd}var zd,Ux;function gA(){if(Ux)return zd;Ux=1;var r=x5();function e(t){return t==null?"":r(t)}return zd=e,zd}var $d,Hx;function pA(){if(Hx)return $d;Hx=1;var r=_l(),e=Hz(),t=vA(),n=gA();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return $d=a,$d}var Vd,Kx;function a0(){if(Kx)return Vd;Kx=1;var r=_s();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Vd=e,Vd}var Gd,jx;function E5(){if(jx)return Gd;jx=1;var r=pA(),e=a0();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Gd=t,Gd}var Wd,Yx;function C5(){if(Yx)return Wd;Yx=1;var r=E5();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return Wd=e,Wd}var _5=C5(),S5=Es(_5),Ud,Xx;function T5(){if(Xx)return Ud;Xx=1;var r=n0(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Ud=e,Ud}var Hd,Zx;function R5(){if(Zx)return Hd;Zx=1;var r=T5();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Hd=e,Hd}var Kd,Qx;function A5(){if(Qx)return Kd;Qx=1;var r=R5(),e=dA(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var u=i[o];(!(n.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Kd=a,Kd}var jd,Jx;function P5(){if(Jx)return jd;Jx=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return jd=t,jd}var Yd,eE;function I5(){if(eE)return Yd;eE=1;var r=A5(),e=pA(),t=P5(),n=Cs(),a=a0();function i(o,s,u,l){if(!n(o))return o;s=e(s,o);for(var f=-1,d=s.length,h=d-1,g=o;g!=null&&++f<d;){var p=a(s[f]),x=u;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(f!=h){var b=g[p];x=l?l(b,p,g):void 0,x===void 0&&(x=n(b)?b:t(s[f+1])?[]:{})}r(g,p,x),g=g[p]}return o}return Yd=i,Yd}var Xd,rE;function D5(){if(rE)return Xd;rE=1;var r=I5();function e(t,n,a){return t==null?t:r(t,n,a)}return Xd=e,Xd}var B5=D5(),M5=Es(B5),Zd,tE;function L5(){if(tE)return Zd;tE=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return Zd=r,Zd}var Qd,nE;function O5(){if(nE)return Qd;nE=1;var r=hA(),e=L5(),t=_l(),n=_s(),a=vA(),i=a0(),o=gA();function s(u){return t(u)?r(u,i):n(u)?[u]:e(a(o(u)))}return Qd=s,Qd}var k5=O5(),q5=Es(k5),N5={data:function(e){var t={field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(a){},beforeSet:function(a,i){},onSet:function(a){},canSet:function(a){return!0}};return e=Ze({},t,e),function(a,i){var o=e,s=this,u=s.length!==void 0,l=u?s:[s],f=u?s[0]:s;if(Ye(a)){var d=a.indexOf(".")!==-1,h=d&&q5(a);if(o.allowGetting&&i===void 0){var g;return f&&(o.beforeGet(f),h&&f._private[o.field][a]===void 0?g=S5(f._private[o.field],h):g=f._private[o.field][a]),g}else if(o.allowSetting&&i!==void 0){var p=!o.immutableKeys[a];if(p){var x=DR({},a,i);o.beforeSet(s,x);for(var b=0,w=l.length;b<w;b++){var y=l[b];o.canSet(y)&&(h&&f._private[o.field][a]===void 0?M5(y._private[o.field],h,i):y._private[o.field][a]=i)}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}}}else if(o.allowSetting&&yr(a)){var E=a,C,S,R=Object.keys(E);o.beforeSet(s,E);for(var _=0;_<R.length;_++){C=R[_],S=E[C];var A=!o.immutableKeys[C];if(A)for(var P=0;P<l.length;P++){var I=l[P];o.canSet(I)&&(I._private[o.field][C]=S)}}o.updateStyle&&s.updateStyle(),o.onSet(s),o.settingTriggersEvent&&s[o.triggerFnName](o.settingEvent)}else if(o.allowBinding&&$r(a)){var D=a;s.on(o.bindingEvent,D)}else if(o.allowGetting&&a===void 0){var L;return f&&(o.beforeGet(f),L=f._private[o.field]),L}return s}},removeData:function(e){var t={field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}};return e=Ze({},t,e),function(a){var i=e,o=this,s=o.length!==void 0,u=s?o:[o];if(Ye(a)){for(var l=a.split(/\s+/),f=l.length,d=0;d<f;d++){var h=l[d];if(!Da(h)){var g=!i.immutableKeys[h];if(g)for(var p=0,x=u.length;p<x;p++)u[p]._private[i.field][h]=void 0}}i.triggerEvent&&o[i.triggerFnName](i.event)}else if(a===void 0){for(var b=0,w=u.length;b<w;b++)for(var y=u[b]._private[i.field],E=Object.keys(y),C=0;C<E.length;C++){var S=E[C],R=!i.immutableKeys[S];R&&(y[S]=void 0)}i.triggerEvent&&o[i.triggerFnName](i.event)}return o}}},F5={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,o=Array.prototype.slice.call(arguments,0);return new po(function(s,u){var l=function(g){i.off.apply(i,d),s(g)},f=o.concat([l]),d=f.concat([]);i.on.apply(i,f)})}}},Er={};[Uz,N5,F5].forEach(function(r){Ze(Er,r)});var z5={animate:Er.animate(),animation:Er.animation(),animated:Er.animated(),clearQueue:Er.clearQueue(),delay:Er.delay(),delayAnimation:Er.delayAnimation(),stop:Er.stop()},Vu={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(p){return n.push(p)}),n}else Tr(e)||(e=(e||"").match(/\S+/g)||[]);for(var a=[],i=new go(e),o=0;o<t.length;o++){for(var s=t[o],u=s._private,l=u.classes,f=!1,d=0;d<e.length;d++){var h=e[d],g=l.has(h);if(!g){f=!0;break}}f||(f=l.size!==e.length),f&&(u.classes=i,a.push(s))}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 t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){Tr(e)||(e=e.match(/\S+/g)||[]);for(var n=this,a=t===void 0,i=[],o=0,s=n.length;o<s;o++)for(var u=n[o],l=u._private.classes,f=!1,d=0;d<e.length;d++){var h=e[d],g=l.has(h),p=!1;t||a&&!g?(l.add(h),p=!0):(!t||a&&g)&&(l.delete(h),p=!0),!f&&p&&(i.push(u),f=!0)}return i.length>0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};Vu.className=Vu.classNames=Vu.classes;var gr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:nt,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};gr.variable="(?:[\\w-.]|(?:\\\\"+gr.metaChar+"))+";gr.className="(?:[\\w-]|(?:\\\\"+gr.metaChar+"))+";gr.value=gr.string+"|"+gr.number;gr.id=gr.variable;(function(){var r,e,t;for(r=gr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],gr.comparatorOp+="|@"+e;for(r=gr.comparatorOp.split("|"),t=0;t<r.length;t++)e=r[t],!(e.indexOf("!")>=0)&&e!=="="&&(gr.comparatorOp+="|\\!"+e)})();var _r=function(){return{checks:[]}},Ue={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},Am=[{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 NN(r.selector,e.selector)}),$5=(function(){for(var r={},e,t=0;t<Am.length;t++)e=Am[t],r[e.selector]=e.matches;return r})(),V5=function(e,t){return $5[e](t)},G5="("+Am.map(function(r){return r.selector}).join("|")+")",Gi=function(e){return e.replace(new RegExp("\\\\("+gr.metaChar+")","g"),function(t,n){return n})},xa=function(e,t,n){e[e.length-1]=n},Pm=[{name:"group",query:!0,regex:"("+gr.group+")",populate:function(e,t,n){var a=Xr(n,1),i=a[0];t.checks.push({type:Ue.GROUP,value:i==="*"?i:i+"s"})}},{name:"state",query:!0,regex:G5,populate:function(e,t,n){var a=Xr(n,1),i=a[0];t.checks.push({type:Ue.STATE,value:i})}},{name:"id",query:!0,regex:"\\#("+gr.id+")",populate:function(e,t,n){var a=Xr(n,1),i=a[0];t.checks.push({type:Ue.ID,value:Gi(i)})}},{name:"className",query:!0,regex:"\\.("+gr.className+")",populate:function(e,t,n){var a=Xr(n,1),i=a[0];t.checks.push({type:Ue.CLASS,value:Gi(i)})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+gr.variable+")\\s*\\]",populate:function(e,t,n){var a=Xr(n,1),i=a[0];t.checks.push({type:Ue.DATA_EXIST,field:Gi(i)})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+gr.variable+")\\s*("+gr.comparatorOp+")\\s*("+gr.value+")\\s*\\]",populate:function(e,t,n){var a=Xr(n,3),i=a[0],o=a[1],s=a[2],u=new RegExp("^"+gr.string+"$").exec(s)!=null;u?s=s.substring(1,s.length-1):s=parseFloat(s),t.checks.push({type:Ue.DATA_COMPARE,field:Gi(i),operator:o,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+gr.boolOp+")\\s*("+gr.variable+")\\s*\\]",populate:function(e,t,n){var a=Xr(n,2),i=a[0],o=a[1];t.checks.push({type:Ue.DATA_BOOL,field:Gi(o),operator:i})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+gr.meta+")\\s*("+gr.comparatorOp+")\\s*("+gr.number+")\\s*\\]\\]",populate:function(e,t,n){var a=Xr(n,3),i=a[0],o=a[1],s=a[2];t.checks.push({type:Ue.META_COMPARE,field:Gi(i),operator:o,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:gr.separator,populate:function(e,t){var n=e.currentSubject,a=e.edgeCount,i=e.compoundCount,o=e[e.length-1];n!=null&&(o.subject=n,e.currentSubject=null),o.edgeCount=a,o.compoundCount=i,e.edgeCount=0,e.compoundCount=0;var s=e[e.length++]=_r();return s}},{name:"directedEdge",separator:!0,regex:gr.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=t,i=_r();return n.checks.push({type:Ue.DIRECTED_EDGE,source:a,target:i}),xa(e,t,n),e.edgeCount++,i}else{var o=_r(),s=t,u=_r();return o.checks.push({type:Ue.NODE_SOURCE,source:s,target:u}),xa(e,t,o),e.edgeCount++,u}}},{name:"undirectedEdge",separator:!0,regex:gr.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=t,i=_r();return n.checks.push({type:Ue.UNDIRECTED_EDGE,nodes:[a,i]}),xa(e,t,n),e.edgeCount++,i}else{var o=_r(),s=t,u=_r();return o.checks.push({type:Ue.NODE_NEIGHBOR,node:s,neighbor:u}),xa(e,t,o),u}}},{name:"child",separator:!0,regex:gr.child,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=_r(),i=e[e.length-1];return n.checks.push({type:Ue.CHILD,parent:i,child:a}),xa(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=_r(),s=e[e.length-1],u=_r(),l=_r(),f=_r(),d=_r();return o.checks.push({type:Ue.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:Ue.TRUE}],d.checks.push({type:Ue.TRUE}),u.checks.push({type:Ue.PARENT,parent:d,child:f}),xa(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var h=_r(),g=_r(),p=[{type:Ue.PARENT,parent:h,child:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"descendant",separator:!0,regex:gr.descendant,populate:function(e,t){if(e.currentSubject==null){var n=_r(),a=_r(),i=e[e.length-1];return n.checks.push({type:Ue.DESCENDANT,ancestor:i,descendant:a}),xa(e,t,n),e.compoundCount++,a}else if(e.currentSubject===t){var o=_r(),s=e[e.length-1],u=_r(),l=_r(),f=_r(),d=_r();return o.checks.push({type:Ue.COMPOUND_SPLIT,left:s,right:u,subject:l}),l.checks=t.checks,t.checks=[{type:Ue.TRUE}],d.checks.push({type:Ue.TRUE}),u.checks.push({type:Ue.ANCESTOR,ancestor:d,descendant:f}),xa(e,s,o),e.currentSubject=l,e.compoundCount++,f}else{var h=_r(),g=_r(),p=[{type:Ue.ANCESTOR,ancestor:h,descendant:g}];return h.checks=t.checks,t.checks=p,e.compoundCount++,g}}},{name:"subject",modifier:!0,regex:gr.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return Cr("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1],a=n.checks[0],i=a==null?null:a.type;i===Ue.DIRECTED_EDGE?a.type=Ue.NODE_TARGET:i===Ue.UNDIRECTED_EDGE&&(a.type=Ue.NODE_NEIGHBOR,a.node=a.nodes[1],a.neighbor=a.nodes[0],a.nodes=null)}}];Pm.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var W5=function(e){for(var t,n,a,i=0;i<Pm.length;i++){var o=Pm[i],s=o.name,u=e.match(o.regexObj);if(u!=null){n=u,t=o,a=s;var l=u[0];e=e.substring(l.length);break}}return{expr:t,match:n,name:a,remaining:e}},U5=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},H5=function(e){var t=this,n=t.inputText=e,a=t[0]=_r();for(t.length=1,n=U5(n);;){var i=W5(n);if(i.expr==null)return Cr("The selector `"+e+"`is invalid"),!1;var o=i.match.slice(1),s=i.expr.populate(t,a,o);if(s===!1)return!1;if(s!=null&&(a=s),n=i.remaining,n.match(/^\s*$/))break}var u=t[t.length-1];t.currentSubject!=null&&(u.subject=t.currentSubject),u.edgeCount=t.edgeCount,u.compoundCount=t.compoundCount;for(var l=0;l<t.length;l++){var f=t[l];if(f.compoundCount>0&&f.edgeCount>0)return Cr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(f.edgeCount>1)return Cr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;f.edgeCount===1&&Cr("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},K5=function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(f){return f??""},t=function(f){return Ye(f)?'"'+f+'"':e(f)},n=function(f){return" "+f+" "},a=function(f,d){var h=f.type,g=f.value;switch(h){case Ue.GROUP:{var p=e(g);return p.substring(0,p.length-1)}case Ue.DATA_COMPARE:{var x=f.field,b=f.operator;return"["+x+n(e(b))+t(g)+"]"}case Ue.DATA_BOOL:{var w=f.operator,y=f.field;return"["+e(w)+y+"]"}case Ue.DATA_EXIST:{var E=f.field;return"["+E+"]"}case Ue.META_COMPARE:{var C=f.operator,S=f.field;return"[["+S+n(e(C))+t(g)+"]]"}case Ue.STATE:return g;case Ue.ID:return"#"+g;case Ue.CLASS:return"."+g;case Ue.PARENT:case Ue.CHILD:return i(f.parent,d)+n(">")+i(f.child,d);case Ue.ANCESTOR:case Ue.DESCENDANT:return i(f.ancestor,d)+" "+i(f.descendant,d);case Ue.COMPOUND_SPLIT:{var R=i(f.left,d),_=i(f.subject,d),A=i(f.right,d);return R+(R.length>0?" ":"")+_+A}case Ue.TRUE:return""}},i=function(f,d){return f.checks.reduce(function(h,g,p){return h+(d===f&&p===0?"$":"")+a(g,d)},"")},o="",s=0;s<this.length;s++){var u=this[s];o+=i(u,u.subject),this.length>1&&s<this.length-1&&(o+=", ")}return this.toStringCache=o,o},j5={parse:H5,toString:K5},yA=function(e,t,n){var a,i=Ye(e),o=qe(e),s=Ye(n),u,l,f=!1,d=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),f=!0),(i||s||f)&&(u=!i&&!o?"":""+e,l=""+n),f&&(e=u=u.toLowerCase(),n=l=l.toLowerCase()),t){case"*=":a=u.indexOf(l)>=0;break;case"$=":a=u.indexOf(l,u.length-l.length)>=0;break;case"^=":a=u.indexOf(l)===0;break;case"=":a=e===n;break;case">":h=!0,a=e>n;break;case">=":h=!0,a=e>=n;break;case"<":h=!0,a=e<n;break;case"<=":h=!0,a=e<=n;break;default:a=!1;break}return d&&(e!=null||!h)&&(a=!a),a},Y5=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},X5=function(e){return e!==void 0},i0=function(e,t){return e.data(t)},Z5=function(e,t){return e[t]()},Wr=[],Br=function(e,t){return e.checks.every(function(n){return Wr[n.type](n,t)})};Wr[Ue.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};Wr[Ue.STATE]=function(r,e){var t=r.value;return V5(t,e)};Wr[Ue.ID]=function(r,e){var t=r.value;return e.id()===t};Wr[Ue.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};Wr[Ue.META_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return yA(Z5(e,t),n,a)};Wr[Ue.DATA_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return yA(i0(e,t),n,a)};Wr[Ue.DATA_BOOL]=function(r,e){var t=r.field,n=r.operator;return Y5(i0(e,t),n)};Wr[Ue.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,X5(i0(e,t))};Wr[Ue.UNDIRECTED_EDGE]=function(r,e){var t=r.nodes[0],n=r.nodes[1],a=e.source(),i=e.target();return Br(t,a)&&Br(n,i)||Br(n,a)&&Br(t,i)};Wr[Ue.NODE_NEIGHBOR]=function(r,e){return Br(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Br(r.neighbor,t)})};Wr[Ue.DIRECTED_EDGE]=function(r,e){return Br(r.source,e.source())&&Br(r.target,e.target())};Wr[Ue.NODE_SOURCE]=function(r,e){return Br(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Br(r.target,t)})};Wr[Ue.NODE_TARGET]=function(r,e){return Br(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Br(r.source,t)})};Wr[Ue.CHILD]=function(r,e){return Br(r.child,e)&&Br(r.parent,e.parent())};Wr[Ue.PARENT]=function(r,e){return Br(r.parent,e)&&e.children().some(function(t){return Br(r.child,t)})};Wr[Ue.DESCENDANT]=function(r,e){return Br(r.descendant,e)&&e.ancestors().some(function(t){return Br(r.ancestor,t)})};Wr[Ue.ANCESTOR]=function(r,e){return Br(r.ancestor,e)&&e.descendants().some(function(t){return Br(r.descendant,t)})};Wr[Ue.COMPOUND_SPLIT]=function(r,e){return Br(r.subject,e)&&Br(r.left,e)&&Br(r.right,e)};Wr[Ue.TRUE]=function(){return!0};Wr[Ue.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};Wr[Ue.FILTER]=function(r,e){var t=r.value;return t(e)};var Q5=function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===Ue.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(i){for(var o=0;o<t.length;o++){var s=t[o];if(Br(s,i))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)},J5=function(e){for(var t=this,n=0;n<t.length;n++){var a=t[n];if(Br(a,e))return!0}return!1},e$={matches:J5,filter:Q5},La=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ye(e)&&e.match(/^\s*$/)||(Jt(e)?this.addQuery({checks:[{type:Ue.COLLECTION,value:e.collection()}]}):$r(e)?this.addQuery({checks:[{type:Ue.FILTER,value:e}]}):Ye(e)?this.parse(e)||(this.invalid=!0):kr("A selector must be created from a string; found "))},Oa=La.prototype;[j5,e$].forEach(function(r){return Ze(Oa,r)});Oa.text=function(){return this.inputText};Oa.size=function(){return this.length};Oa.eq=function(r){return this[r]};Oa.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};Oa.addQuery=function(r){this[this.length++]=r};Oa.selector=Oa.toString;var Ra={allAre:function(e){var t=new La(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new La(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(a)return!0}return!1},every:function(e,t){for(var n=0;n<this.length;n++){var a=t?e.apply(t,[this[n],n,this]):e(this[n],n,this);if(!a)return!1}return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length,n=e.length;return t!==n?!1:t===1?this[0]===e[0]:this.every(function(a){return e.hasElementWithId(a.id())})},anySame:function(e){return e=this.cy().collection(e),this.some(function(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())})}};Ra.allAreNeighbours=Ra.allAreNeighbors;Ra.has=Ra.contains;Ra.equal=Ra.equals=Ra.same;var hn=function(e,t){return function(a,i,o,s){var u=a,l=this,f;if(u==null?f="":Jt(u)&&u.length===1&&(f=u.id()),l.length===1&&f){var d=l[0]._private,h=d.traversalCache=d.traversalCache||{},g=h[t]=h[t]||[],p=ci(f),x=g[p];return x||(g[p]=e.call(l,a,i,o,s))}else return e.call(l,a,i,o,s)}},co={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var a=0;a<this.length;a++){var i=this[a],o=i._private.parent;o&&t.push(o)}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++){var i=n[a];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var a=this[n],i=a.parents();t=t||i,t=t.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:hn(function(r){for(var e=[],t=0;t<this.length;t++)for(var n=this[t],a=n._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()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(a){for(var i=0;i<a.length;i++){var o=a[i];t.push(o),o.children().nonempty()&&n(o.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function o0(r,e,t,n){for(var a=[],i=new go,o=r.cy(),s=o.hasCompoundNodes(),u=0;u<r.length;u++){var l=r[u];t?a.push(l):s&&n(a,i,l)}for(;a.length>0;){var f=a.shift();e(f),i.add(f.id()),s&&n(a,i,f)}return r}function mA(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)}}co.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return o0(this,r,e,mA)};function bA(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}co.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return o0(this,r,e,bA)};function r$(r,e,t){bA(r,e,t),mA(r,e,t)}co.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return o0(this,r,e,r$)};co.ancestors=co.parents;var hs,wA;hs=wA={data:Er.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:Er.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Er.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Er.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Er.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Er.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}};hs.attr=hs.data;hs.removeAttr=hs.removeData;var t$=wA,Al={};function Jd(r){return function(e){var t=this;if(e===void 0&&(e=!0),t.length!==0)if(t.isNode()&&!t.removed()){for(var n=0,a=t[0],i=a._private.edges,o=0;o<i.length;o++){var s=i[o];!e&&s.isLoop()||(n+=r(a,s))}return n}else return}}Ze(Al,{degree:Jd(function(r,e){return e.source().same(e.target())?2:1}),indegree:Jd(function(r,e){return e.target().same(r)?1:0}),outdegree:Jd(function(r,e){return e.source().same(r)?1:0})});function Wi(r,e){return function(t){for(var n,a=this.nodes(),i=0;i<a.length;i++){var o=a[i],s=o[r](t);s!==void 0&&(n===void 0||e(s,n))&&(n=s)}return n}}Ze(Al,{minDegree:Wi("degree",function(r,e){return r<e}),maxDegree:Wi("degree",function(r,e){return r>e}),minIndegree:Wi("indegree",function(r,e){return r<e}),maxIndegree:Wi("indegree",function(r,e){return r>e}),minOutdegree:Wi("outdegree",function(r,e){return r<e}),maxOutdegree:Wi("outdegree",function(r,e){return r>e})});Ze(Al,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var Cn,xA,EA=function(e,t,n){for(var a=0;a<e.length;a++){var i=e[a];if(!i.locked()){var o=i._private.position,s={x:t.x!=null?t.x-o.x:0,y:t.y!=null?t.y-o.y:0};i.isParent()&&!(s.x===0&&s.y===0)&&i.children().shift(s,n),i.dirtyBoundingBoxCache()}}},aE={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){EA(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};Cn=xA={position:Er.data(aE),silentPosition:Er.data(Ze({},aE,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){EA(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(yr(e))t?this.silentPosition(e):this.position(e);else if($r(e)){var n=e,a=this.cy();a.startBatch();for(var i=0;i<this.length;i++){var o=this[i],s=void 0;(s=n(o,i))&&(t?o.silentPosition(s):o.position(s))}a.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var a;if(yr(e)?(a={x:qe(e.x)?e.x:0,y:qe(e.y)?e.y:0},n=t):Ye(e)&&qe(t)&&(a={x:0,y:0},a[e]=t),a!=null){var i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s=this[o];if(!(i.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var u=s.position(),l={x:u.x+a.x,y:u.y+a.y};n?s.silentPosition(l):s.position(l)}}i.endBatch()}return this},silentShift:function(e,t){return yr(e)?this.shift(e,!0):Ye(e)&&qe(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],a=this.cy(),i=a.zoom(),o=a.pan(),s=yr(e)?e:void 0,u=s!==void 0||t!==void 0&&Ye(e);if(n&&n.isNode())if(u)for(var l=0;l<this.length;l++){var f=this[l];t!==void 0?f.position(e,(t-o[e])/i):s!==void 0&&f.position(XR(s,i,o))}else{var d=n.position();return s=El(d,i,o),e===void 0?s:s[e]}else if(!u)return;return this},relativePosition:function(e,t){var n=this[0],a=this.cy(),i=yr(e)?e:void 0,o=i!==void 0||t!==void 0&&Ye(e),s=a.hasCompoundNodes();if(n&&n.isNode())if(o)for(var u=0;u<this.length;u++){var l=this[u],f=s?l.parent():null,d=f&&f.length>0,h=d;d&&(f=f[0]);var g=h?f.position():{x:0,y:0};t!==void 0?l.position(e,t+g[e]):i!==void 0&&l.position({x:i.x+g.x,y:i.y+g.y})}else{var p=n.position(),x=s?n.parent():null,b=x&&x.length>0,w=b;b&&(x=x[0]);var y=w?x.position():{x:0,y:0};return i={x:p.x-y.x,y:p.y-y.y},e===void 0?i:i[e]}else if(!o)return;return this}};Cn.modelPosition=Cn.point=Cn.position;Cn.modelPositions=Cn.points=Cn.positions;Cn.renderedPoint=Cn.renderedPosition;Cn.relativePoint=Cn.relativePosition;var n$=xA,uo,Fa;uo=Fa={};Fa.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),a=t.pan(),i=e.x1*n+a.x,o=e.x2*n+a.x,s=e.y1*n+a.y,u=e.y2*n+a.y;return{x1:i,x2:o,y1:s,y2:u,w:o-i,h:u-s}};Fa.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this)};Fa.updateCompoundBounds=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(o){if(!o.isParent())return;var s=o._private,u=o.children(),l=o.pstyle("compound-sizing-wrt-labels").value==="include",f={width:{val:o.pstyle("min-width").pfValue,left:o.pstyle("min-width-bias-left"),right:o.pstyle("min-width-bias-right")},height:{val:o.pstyle("min-height").pfValue,top:o.pstyle("min-height-bias-top"),bottom:o.pstyle("min-height-bias-bottom")}},d=u.boundingBox({includeLabels:l,includeOverlays:!1,useCache:!1}),h=s.position;(d.w===0||d.h===0)&&(d={w:o.pstyle("width").pfValue,h:o.pstyle("height").pfValue},d.x1=h.x-d.w/2,d.x2=h.x+d.w/2,d.y1=h.y-d.h/2,d.y2=h.y+d.h/2);function g(P,I,D){var L=0,M=0,q=I+D;return P>0&&q>0&&(L=I/q*P,M=D/q*P),{biasDiff:L,biasComplementDiff:M}}function p(P,I,D,L){if(D.units==="%")switch(L){case"width":return P>0?D.pfValue*P:0;case"height":return I>0?D.pfValue*I:0;case"average":return P>0&&I>0?D.pfValue*(P+I)/2:0;case"min":return P>0&&I>0?P>I?D.pfValue*I:D.pfValue*P:0;case"max":return P>0&&I>0?P>I?D.pfValue*P:D.pfValue*I:0;default:return 0}else return D.units==="px"?D.pfValue:0}var x=f.width.left.value;f.width.left.units==="px"&&f.width.val>0&&(x=x*100/f.width.val);var b=f.width.right.value;f.width.right.units==="px"&&f.width.val>0&&(b=b*100/f.width.val);var w=f.height.top.value;f.height.top.units==="px"&&f.height.val>0&&(w=w*100/f.height.val);var y=f.height.bottom.value;f.height.bottom.units==="px"&&f.height.val>0&&(y=y*100/f.height.val);var E=g(f.width.val-d.w,x,b),C=E.biasDiff,S=E.biasComplementDiff,R=g(f.height.val-d.h,w,y),_=R.biasDiff,A=R.biasComplementDiff;s.autoPadding=p(d.w,d.h,o.pstyle("padding"),o.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,f.width.val),h.x=(-C+d.x1+d.x2+S)/2,s.autoHeight=Math.max(d.h,f.height.val),h.y=(-_+d.y1+d.y2+A)/2}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 dn=function(e){return e===1/0||e===-1/0?0:e},En=function(e,t,n,a,i){a-t===0||i-n===0||t==null||n==null||a==null||i==null||(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)},Ea=function(e,t){return t==null?e:En(e,t.x1,t.y1,t.x2,t.y2)},$o=function(e,t,n){return $t(e,t,n)},Bu=function(e,t,n){if(!t.cy().headless()){var a=t._private,i=a.rstyle,o=i.arrowWidth/2,s=t.pstyle(n+"-arrow-shape").value,u,l;if(s!=="none"){n==="source"?(u=i.srcX,l=i.srcY):n==="target"?(u=i.tgtX,l=i.tgtY):(u=i.midX,l=i.midY);var f=a.arrowBounds=a.arrowBounds||{},d=f[n]=f[n]||{};d.x1=u-o,d.y1=l-o,d.x2=u+o,d.y2=l+o,d.w=d.x2-d.x1,d.h=d.y2-d.y1,zu(d,1),En(e,d.x1,d.y1,d.x2,d.y2)}}},ev=function(e,t,n){if(!t.cy().headless()){var a;n?a=n+"-":a="";var i=t._private,o=i.rstyle,s=t.pstyle(a+"label").strValue;if(s){var u=t.pstyle("text-halign"),l=t.pstyle("text-valign"),f=$o(o,"labelWidth",n),d=$o(o,"labelHeight",n),h=$o(o,"labelX",n),g=$o(o,"labelY",n),p=t.pstyle(a+"text-margin-x").pfValue,x=t.pstyle(a+"text-margin-y").pfValue,b=t.isEdge(),w=t.pstyle(a+"text-rotation"),y=t.pstyle("text-outline-width").pfValue,E=t.pstyle("text-border-width").pfValue,C=E/2,S=t.pstyle("text-background-padding").pfValue,R=2,_=d,A=f,P=A/2,I=_/2,D,L,M,q;if(b)D=h-P,L=h+P,M=g-I,q=g+I;else{switch(u.value){case"left":D=h-A,L=h;break;case"center":D=h-P,L=h+P;break;case"right":D=h,L=h+A;break}switch(l.value){case"top":M=g-_,q=g;break;case"center":M=g-I,q=g+I;break;case"bottom":M=g,q=g+_;break}}var N=p-Math.max(y,C)-S-R,W=p+Math.max(y,C)+S+R,V=x-Math.max(y,C)-S-R,$=x+Math.max(y,C)+S+R;D+=N,L+=W,M+=V,q+=$;var X=n||"main",ee=i.labelBounds,K=ee[X]=ee[X]||{};K.x1=D,K.y1=M,K.x2=L,K.y2=q,K.w=L-D,K.h=q-M,K.leftPad=N,K.rightPad=W,K.topPad=V,K.botPad=$;var j=b&&w.strValue==="autorotate",fe=w.pfValue!=null&&w.pfValue!==0;if(j||fe){var G=j?$o(i.rstyle,"labelAngle",n):w.pfValue,z=Math.cos(G),Y=Math.sin(G),te=(D+L)/2,ue=(M+q)/2;if(!b){switch(u.value){case"left":te=L;break;case"right":te=D;break}switch(l.value){case"top":ue=q;break;case"bottom":ue=M;break}}var oe=function(le,Me){return le=le-te,Me=Me-ue,{x:le*z-Me*Y+te,y:le*Y+Me*z+ue}},Z=oe(D,M),Q=oe(D,q),ie=oe(L,M),de=oe(L,q);D=Math.min(Z.x,Q.x,ie.x,de.x),L=Math.max(Z.x,Q.x,ie.x,de.x),M=Math.min(Z.y,Q.y,ie.y,de.y),q=Math.max(Z.y,Q.y,ie.y,de.y)}var we=X+"Rot",Ae=ee[we]=ee[we]||{};Ae.x1=D,Ae.y1=M,Ae.x2=L,Ae.y2=q,Ae.w=L-D,Ae.h=q-M,En(e,D,M,L,q),En(i.labelBounds.all,D,M,L,q)}return e}},iE=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,a=t.pstyle("outline-width").value,i=t.pstyle("outline-offset").value,o=a+i;CA(e,t,n,o,"outside",o/2)}},CA=function(e,t,n,a,i,o){if(!(n===0||a<=0||i==="inside")){var s=t.cy(),u=t.pstyle("shape").value,l=s.renderer().nodeShapes[u],f=t.position(),d=f.x,h=f.y,g=t.width(),p=t.height();if(l.hasMiterBounds){i==="center"&&(a/=2);var x=l.miterBounds(d,h,g,p,a);Ea(e,x)}else o!=null&&o>0&&$u(e,[o,o,o,o])}},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;CA(e,t,n,a,i)}},i$=function(e,t){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=Lt(),s=e._private,u=e.isNode(),l=e.isEdge(),f,d,h,g,p,x,b=s.rstyle,w=u&&a?e.pstyle("bounds-expansion").pfValue:[0],y=function(ve){return ve.pstyle("display").value!=="none"},E=!a||y(e)&&(!l||y(e.source())&&y(e.target()));if(E){var C=0,S=0;a&&t.includeOverlays&&(C=e.pstyle("overlay-opacity").value,C!==0&&(S=e.pstyle("overlay-padding").value));var R=0,_=0;a&&t.includeUnderlays&&(R=e.pstyle("underlay-opacity").value,R!==0&&(_=e.pstyle("underlay-padding").value));var A=Math.max(S,_),P=0,I=0;if(a&&(P=e.pstyle("width").pfValue,I=P/2),u&&t.includeNodes){var D=e.position();p=D.x,x=D.y;var L=e.outerWidth(),M=L/2,q=e.outerHeight(),N=q/2;f=p-M,d=p+M,h=x-N,g=x+N,En(o,f,h,d,g),a&&iE(o,e),a&&t.includeOutlines&&!i&&iE(o,e),a&&a$(o,e)}else if(l&&t.includeEdges)if(a&&!i){var W=e.pstyle("curve-style").strValue;if(f=Math.min(b.srcX,b.midX,b.tgtX),d=Math.max(b.srcX,b.midX,b.tgtX),h=Math.min(b.srcY,b.midY,b.tgtY),g=Math.max(b.srcY,b.midY,b.tgtY),f-=I,d+=I,h-=I,g+=I,En(o,f,h,d,g),W==="haystack"){var V=b.haystackPts;if(V&&V.length===2){if(f=V[0].x,h=V[0].y,d=V[1].x,g=V[1].y,f>d){var $=f;f=d,d=$}if(h>g){var X=h;h=g,g=X}En(o,f-I,h-I,d+I,g+I)}}else if(W==="bezier"||W==="unbundled-bezier"||_a(W,"segments")||_a(W,"taxi")){var ee;switch(W){case"bezier":case"unbundled-bezier":ee=b.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":ee=b.linePts;break}if(ee!=null)for(var K=0;K<ee.length;K++){var j=ee[K];f=j.x-I,d=j.x+I,h=j.y-I,g=j.y+I,En(o,f,h,d,g)}}}else{var fe=e.source(),G=fe.position(),z=e.target(),Y=z.position();if(f=G.x,d=Y.x,h=G.y,g=Y.y,f>d){var te=f;f=d,d=te}if(h>g){var ue=h;h=g,g=ue}f-=I,d+=I,h-=I,g+=I,En(o,f,h,d,g)}if(a&&t.includeEdges&&l&&(Bu(o,e,"mid-source"),Bu(o,e,"mid-target"),Bu(o,e,"source"),Bu(o,e,"target")),a){var oe=e.pstyle("ghost").value==="yes";if(oe){var Z=e.pstyle("ghost-offset-x").pfValue,Q=e.pstyle("ghost-offset-y").pfValue;En(o,o.x1+Z,o.y1+Q,o.x2+Z,o.y2+Q)}}var ie=s.bodyBounds=s.bodyBounds||{};Ww(ie,o),$u(ie,w),zu(ie,1),a&&(f=o.x1,d=o.x2,h=o.y1,g=o.y2,En(o,f-A,h-A,d+A,g+A));var de=s.overlayBounds=s.overlayBounds||{};Ww(de,o),$u(de,w),zu(de,1);var we=s.labelBounds=s.labelBounds||{};we.all!=null?zF(we.all):we.all=Lt(),a&&t.includeLabels&&(t.includeMainLabels&&ev(o,e,null),l&&(t.includeSourceLabels&&ev(o,e,"source"),t.includeTargetLabels&&ev(o,e,"target")))}return o.x1=dn(o.x1),o.y1=dn(o.y1),o.x2=dn(o.x2),o.y2=dn(o.y2),o.w=dn(o.x2-o.x1),o.h=dn(o.y2-o.y1),o.w>0&&o.h>0&&E&&($u(o,w),zu(o,1)),o},_A=function(e){var t=0,n=function(o){return(o?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),a+=n(e.includeOutlines),a},SA=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return Nw([t(n.x),t(n.y),t(a.x),t(a.y)])}else{var i=e.position();return Nw([t(i.x),t(i.y)])}},oE=function(e,t){var n=e._private,a,i=e.isEdge(),o=t==null?sE:_A(t),s=o===sE;if(n.bbCache==null?(a=i$(e,gs),n.bbCache=a,n.bbCachePosKey=SA(e)):a=n.bbCache,!s){var u=e.isNode();a=Lt(),(t.includeNodes&&u||t.includeEdges&&!u)&&(t.includeOverlays?Ea(a,n.overlayBounds):Ea(a,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?Ea(a,n.labelBounds.all):(t.includeMainLabels&&Ea(a,n.labelBounds.mainRot),t.includeSourceLabels&&Ea(a,n.labelBounds.sourceRot),t.includeTargetLabels&&Ea(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},gs={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},sE=_A(gs),uE=wt(gs);Fa.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,n=lo(function(f){var d=f._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==SA(f)},function(f){return f.id()});if(t&&this.length===1&&!n(this[0]))r===void 0?r=gs:r=uE(r),e=oE(this[0],r);else{e=Lt(),r=r||gs;var a=uE(r),i=this,o=i.cy(),s=o.styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),s&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var u=0;u<i.length;u++){var l=i[u];n(l)&&l.dirtyBoundingBoxCache(),Ea(e,oE(l,a))}}return e.x1=dn(e.x1),e.y1=dn(e.y1),e.x2=dn(e.x2),e.y2=dn(e.y2),e.w=dn(e.x2-e.x1),e.h=dn(e.y2-e.y1),e};Fa.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};Fa.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),a=t.collection();if(n&&(a=e.filter(function(l){return l.isParent()}),e=e.not(a)),yr(r)){var i=r;r=function(){return i}}var o=function(f,d){return f._private.bbAtOldPos=r(f,d)},s=function(f){return f._private.bbAtOldPos};t.startBatch(),e.forEach(o).silentPositions(r),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0));var u=FF(this.boundingBox({useCache:!1}));return e.silentPositions(s),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),u};uo.boundingbox=uo.bb=uo.boundingBox;uo.renderedBoundingbox=uo.renderedBoundingBox;var o$=Fa,Xo,Rs;Xo=Rs={};var TA=function(e){e.uppercaseName=Cw(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=Cw(e.outerName),Xo[e.name]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){if(n.isParent())return n.updateCompoundBounds(),a[e.autoName]||0;var s=n.pstyle(e.name);switch(s.strValue){case"label":return n.recalculateRenderedStyle(),a.rstyle[e.labelName]||0;default:return s.pfValue}}else return 1},Xo["outer"+e.uppercaseName]=function(){var n=this[0],a=n._private,i=a.cy,o=i._private.styleEnabled;if(n)if(o){var s=n[e.name](),u=n.pstyle("border-position").value,l;u==="center"?l=n.pstyle("border-width").pfValue:u==="outside"?l=2*n.pstyle("border-width").pfValue:l=0;var f=2*n.padding();return s+l+f}else return 1},Xo["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},Xo["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};TA({name:"width"});TA({name:"height"});Rs.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),e.autoPadding!==void 0?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue};Rs.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};Rs.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var s$=Rs,u$=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},l$=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return El(t(e),n.zoom(),n.pan())}},f$=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),a=n.pan(),i=n.zoom();return t(e).map(function(o){return El(o,i,a)})}},c$=function(e){return e.renderer().getControlPoints(e)},d$=function(e){return e.renderer().getSegmentPoints(e)},v$=function(e){return e.renderer().getSourceEndpoint(e)},h$=function(e){return e.renderer().getTargetEndpoint(e)},g$=function(e){return e.renderer().getEdgeMidpoint(e)},lE={controlPoints:{get:c$,mult:!0},segmentPoints:{get:d$,mult:!0},sourceEndpoint:{get:v$},targetEndpoint:{get:h$},midpoint:{get:g$}},p$=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},y$=Object.keys(lE).reduce(function(r,e){var t=lE[e],n=p$(e);return r[e]=function(){return u$(this,t.get)},t.mult?r[n]=function(){return f$(this,t.get)}:r[n]=function(){return l$(this,t.get)},r},{}),m$=Ze({},n$,o$,s$,y$);/*!
|
|
9
35
|
Event object based on jQuery events, MIT license
|
|
10
36
|
|
|
11
37
|
https://jquery.org/license/
|
|
12
38
|
https://tldrlegal.com/license/mit-license
|
|
13
39
|
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
14
|
-
*/var eA=function(e,t){this.recycle(e,t)};function Lo(){return!1}function Su(){return!0}eA.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Lo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Su:Lo):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,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=Su;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Su;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Su,this.stopPropagation()},isDefaultPrevented:Lo,isPropagationStopped:Lo,isImmediatePropagationStopped:Lo};var rA=/^([^.]+)(\.(?:[^.]+))?$/,_z=".*",tA={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},Ix=Object.keys(tA),Sz={};function bl(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sz,e=arguments.length>1?arguments[1]:void 0,t=0;t<Ix.length;t++){var n=Ix[t];this[n]=r[n]||tA[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ia=bl.prototype,nA=function(e,t,n,a,i,o,s){Fr(a)&&(i=a,a=null),s&&(o==null?o=s:o=Ye({},o,s));for(var l=Sr(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!Ta(c)){var d=c.match(rA);if(d){var h=d[1],g=d[2]?d[2]:null,p=t(e,c,h,g,a,i,o);if(p===!1)break}}}},Bx=function(e,t){return e.addEventFields(e.context,t),new eA(t.type,t)},Tz=function(e,t,n){if(Bq(n)){t(e,n);return}else if(pr(n)){t(e,Bx(e,n));return}for(var a=Sr(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!Ta(o)){var s=o.match(rA);if(s){var l=s[1],u=s[2]?s[2]:null,c=Bx(e,{type:l,namespace:u,target:e.context});t(e,c)}}}};Ia.on=Ia.addListener=function(r,e,t,n,a){return nA(this,function(i,o,s,l,u,c,d){Fr(c)&&i.listeners.push({event:o,callback:c,type:s,namespace:l,qualifier:u,conf:d})},r,e,t,n,a),this};Ia.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})};Ia.removeListener=Ia.off=function(r,e,t,n){var a=this;this.emitting!==0&&(this.listeners=hN(this.listeners));for(var i=this.listeners,o=function(u){var c=i[u];nA(a,function(d,h,g,p,E,m){if((c.type===g||r==="*")&&(!p&&c.namespace!==".*"||c.namespace===p)&&(!E||d.qualifierCompare(c.qualifier,E))&&(!m||c.callback===m))return i.splice(u,1),!1},r,e,t,n)},s=i.length-1;s>=0;s--)o(s);return this};Ia.removeAllListeners=function(){return this.removeListener("*")};Ia.emit=Ia.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Sr(e)||(e=[e]),Tz(this,function(i,o){t!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:t}],a=n.length);for(var s=function(){var c=n[l];if(c.type===o.type&&(!c.namespace||c.namespace===o.namespace||c.namespace===_z)&&i.eventMatches(i.context,c,o)){var d=[o];e!=null&&pN(d,e),i.beforeEmit(i.context,c,o),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==c}));var h=i.callbackContext(i.context,c,o),g=c.callback.apply(h,d);i.afterEmit(i.context,c,o),g===!1&&(o.stopPropagation(),o.preventDefault())}},l=0;l<a;l++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},r),this.emitting--,this};var Rz={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&hs(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Tu=function(e){return Ke(e)?new Pa(e):e},aA={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new bl(Rz,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=Tu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,t,n){for(var a=Tu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var a=Tu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,t,n){for(var a=Tu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};xr.eventAliasesOn(aA);var iA={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(e===void 0)return this;if(Ke(e)||Zt(e))return new Pa(e).filter(this);if(Fr(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);s&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ke(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||t.push(a)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ke(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,s=o?a:i,l=o?i:a,u=0;u<s.length;u++){var c=s[u];l.has(c)&&n.push(c)}return n},xor:function(e){var t=this._private.cy;Ke(e)&&(e=t.$(e));var n=this.spawn(),a=this,i=e,o=function(l,u){for(var c=0;c<l.length;c++){var d=l[c],h=d._private.data.id,g=u.hasElementWithId(h);g||n.push(d)}};return o(a,i),o(i,a),n},diff:function(e){var t=this._private.cy;Ke(e)&&(e=t.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,s=e,l=function(c,d,h){for(var g=0;g<c.length;g++){var p=c[g],E=p._private.data.id,m=d.hasElementWithId(E);m?i.merge(p):h.push(p)}};return l(o,s,n),l(s,o,a),{left:n,right:a,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(Ke(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&a.push(o)}return a},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&Ke(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=t.map,o=0;o<e.length;o++){var s=e[o],l=s._private.data.id,u=!i.has(l);if(u){var c=this.length++;this[c]=s,i.set(l,{ele:s,index:c})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,a=t.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&Ke(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--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);n.push(s)}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 n=-1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],l=t?e.apply(t,[s,o,i]):e(s,o,i);l>n&&(n=l,a=s)}return{value:n,ele:a}},min:function(e,t){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],l=t?e.apply(t,[s,o,i]):e(s,o,i);l<n&&(n=l,a=s)}return{value:n,ele:a}}},yr=iA;yr.u=yr["|"]=yr["+"]=yr.union=yr.or=yr.add;yr["\\"]=yr["!"]=yr["-"]=yr.difference=yr.relativeComplement=yr.subtract=yr.not;yr.n=yr["&"]=yr["."]=yr.and=yr.intersection=yr.intersect;yr["^"]=yr["(+)"]=yr["(-)"]=yr.symmetricDifference=yr.symdiff=yr.xor;yr.fnFilter=yr.filterFn=yr.stdFilter=yr.filter;yr.complement=yr.abscomp=yr.absoluteComplement;var Az={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},oA=function(e,t){var n=e.cy(),a=n.hasCompoundNodes();function i(c){var d=c.pstyle("z-compound-depth");return d.value==="auto"?a?c.zDepth():0:d.value==="bottom"?-1:d.value==="top"?Mm:0}var o=i(e)-i(t);if(o!==0)return o;function s(c){var d=c.pstyle("z-index-compare");return d.value==="auto"&&c.isNode()?1:0}var l=s(e)-s(t);if(l!==0)return l;var u=e.pstyle("z-index").value-t.pstyle("z-index").value;return u!==0?u:e.poolIndex()-t.poolIndex()},Ju={forEach:function(e,t){if(Fr(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=t?e.apply(t,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],a=this.length;t==null&&(t=a),e==null&&(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 this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!Fr(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(oA)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var a=t.data.parent?e.parents().size():0;return e.isParent()?a:Mm-1}else{var i=t.source,o=t.target,s=i.zDepth(),l=o.zDepth();return Math.max(s,l,0)}}}};Ju.each=Ju.forEach;var Pz=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":tt(Symbol))!=e&&tt(Symbol.iterator)!=e;t&&(Ju[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return aR({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};Pz();var Dz=yt({nodeDimensionsIncludeLabels:!1}),Ou={layoutDimensions:function(e){e=Dz(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var a=this.nodes().filter(function(T){return!T.isParent()}),i=this.cy(),o=t.eles,s=function(S){return S.id()},l=to(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var u=function(S,_,A){var P={x:_.x1+_.w/2,y:_.y1+_.h/2},D={x:(A.x-P.x)*S,y:(A.y-P.y)*S};return{x:P.x+D.x,y:P.y+D.y}},c=t.spacingFactor&&t.spacingFactor!==1,d=function(){if(!c)return null;for(var S=Bt(),_=0;_<a.length;_++){var A=a[_],P=l(A,_);_R(S,P.x,P.y)}return S},h=d(),g=to(function(T,S){var _=l(T,S);if(c){var A=Math.abs(t.spacingFactor);_=u(A,h,_)}return t.transform!=null&&(_=t.transform(T,_)),_},s);if(t.animate){for(var p=0;p<a.length;p++){var E=a[p],m=g(E,p),b=t.animateFilter==null||t.animateFilter(E,p);if(b){var w=E.animation({position:m,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(w)}else E.position(m)}if(t.fit){var x=i.animation({fit:{boundingBox:o.boundingBoxAt(g),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(x)}else if(t.zoom!==void 0&&t.pan!==void 0){var C=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(C)}e.animations.forEach(function(T){return T.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),oo.all(e.animations.map(function(T){return T.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(g),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&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){var t=this.cy();return t.makeLayout(Ye({},e,{eles:this}))}};Ou.createLayout=Ou.makeLayout=Ou.layout;function sA(r,e,t){var n=t._private,a=n.styleCache=n.styleCache||[],i;return(i=a[r])!=null||(i=a[r]=e(t)),i}function wl(r,e){return r=oi(r),function(n){return sA(r,e,n)}}function xl(r,e){r=oi(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return sA(r,t,a)}}var gt={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),a=t.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(a){t(a),a.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var a=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(t?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(pr(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ke(e))if(t===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,t,a),this.emitAndNotify("style");else if(e===void 0){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(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var l=0;l<i.length;l++){var u=i[l];a.removeBypasses(u,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 o=a.data.parent?n.parents():null;if(o)for(var s=0;s<o.length;s++){var l=o[s],u=l.pstyle("opacity").value;i=u*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function Bd(r,e){var t=r._private,n=t.data.parent?r.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function Hm(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],o=a.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||Bd(i,n);var l=s.source,u=s.target;return t(l)&&(!o||Bd(l,t))&&(l===u||t(u)&&(!o||Bd(u,t)))}}}var so=wl("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});gt.takesUpSpace=xl("takesUpSpace",Hm({ok:so}));var Iz=wl("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&so(r)}),Bz=wl("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&so(r)});gt.interactive=xl("interactive",Hm({ok:Iz,parentOk:Bz,edgeOkViaNode:so}));gt.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var kz=wl("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&so(r)}),Mz=so;gt.visible=xl("visible",Hm({ok:kz,edgeOkViaNode:Mz}));gt.hidden=function(){var r=this[0];if(r)return!r.visible()};gt.isBundledBezier=xl("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});gt.bypass=gt.css=gt.style;gt.renderedCss=gt.renderedStyle;gt.removeBypass=gt.removeCss=gt.removeStyle;gt.pstyle=gt.parsedStyle;var Sa={};function kx(r){return function(){var e=arguments,t=[];if(e.length===2){var n=e[0],a=e[1];this.on(r.event,n,a)}else if(e.length===1&&Fr(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Sr(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var l=this[s],u=!r.ableField||l._private[r.ableField],c=l._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(l);if(d!==void 0&&(u=d,!d))return this}u&&(l._private[r.field]=r.value,c&&t.push(l))}var h=this.spawn(t);h.updateStyle(),h.emit(r.event),o&&h.emit(o)}return this}}function uo(r){Sa[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},Sa[r.on]=kx({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),Sa[r.off]=kx({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}uo({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});uo({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});uo({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});uo({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Sa.deselect=Sa.unselect;Sa.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};uo({field:"active",on:"activate",off:"unactivate"});uo({field:"pannable",on:"panify",off:"unpanify"});Sa.inactive=function(){var r=this[0];if(r)return!r._private.active};var _t={},Mx=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var s=a[o];if(s.isNode()){for(var l=!1,u=s.connectedEdges(),c=0;c<u.length;c++){var d=u[c],h=d.source(),g=d.target();if(e.noIncomingEdges&&g===s&&h!==s||e.noOutgoingEdges&&h===s&&g!==s){l=!0;break}}l||i.push(s)}}return this.spawn(i,!0).filter(n)}},Lx=function(e){return function(t){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var s=o.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.source(),d=u.target();e.outgoing&&c===o?(a.push(u),a.push(d)):e.incoming&&d===o&&(a.push(u),a.push(c))}}return this.spawn(a,!0).filter(t)}},Ox=function(e){return function(t){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var s=!1,l=0;l<o.length;l++){var u=o[l],c=u.id();i[c]||(i[c]=!0,a.push(u),s=!0)}if(!s)break;n=o}return this.spawn(a,!0).filter(t)}};_t.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};Ye(_t,{roots:Mx({noIncomingEdges:!0}),leaves:Mx({noOutgoingEdges:!0}),outgoers:fn(Lx({outgoing:!0}),"outgoers"),successors:Ox({outgoing:!0}),incomers:fn(Lx({incoming:!0}),"incomers"),predecessors:Ox({})});Ye(_t,{neighborhood:fn(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var a=t[n],i=a.connectedEdges(),o=0;o<i.length;o++){var s=i[o],l=s.source(),u=s.target(),c=a===l?u:l;c.length>0&&e.push(c[0]),e.push(s[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)}});_t.neighbourhood=_t.neighborhood;_t.closedNeighbourhood=_t.closedNeighborhood;_t.openNeighbourhood=_t.openNeighborhood;Ye(_t,{source:fn(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:fn(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:qx({attr:"source"}),targets:qx({attr:"target"})});function qx(r){return function(t){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[r.attr];o&&n.push(o)}return this.spawn(n,!0).filter(t)}}Ye(_t,{edgesWith:fn(Nx(),"edgesWith"),edgesTo:fn(Nx({thisIsSrc:!0}),"edgesTo")});function Nx(r){return function(t){var n=[],a=this._private.cy,i=r||{};Ke(t)&&(t=a.$(t));for(var o=0;o<t.length;o++)for(var s=t[o]._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data,d=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),h=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target),g=d||h;g&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}Ye(_t,{connectedEdges:fn(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:fn(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:fn(Fx(),"parallelEdges"),codirectedEdges:fn(Fx({codirected:!0}),"codirectedEdges")});function Fx(r){var e={codirected:!1};return r=Ye({},e,r),function(n){for(var a=[],i=this.edges(),o=r,s=0;s<i.length;s++)for(var l=i[s],u=l._private,c=u.source,d=c._private.data.id,h=u.data.target,g=c._private.edges,p=0;p<g.length;p++){var E=g[p],m=E._private.data,b=m.target,w=m.source,x=b===h&&w===d,C=d===b&&h===w;(o.codirected&&x||!o.codirected&&(x||C))&&a.push(E)}return this.spawn(a,!0).filter(n)}}Ye(_t,{components:function(e){var t=this,n=t.cy(),a=n.collection(),i=e==null?t.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=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();o.push(c);var d=i[0];s(d,c),t.bfs({directed:!1,roots:d,visit:function(g){return s(g,c)}}),c.forEach(function(h){h.connectedEdges().forEach(function(g){t.has(g)&&c.has(g.source())&&c.has(g.target())&&c.merge(g)})})};do l();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});_t.componentsOf=_t.components;var pt=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Lr("A collection must have a reference to the core");return}var i=new Xn,o=!1;if(!t)t=[];else if(t.length>0&&pr(t[0])&&!hs(t[0])){o=!0;for(var s=[],l=new io,u=0,c=t.length;u<c;u++){var d=t[u];d.data==null&&(d.data={});var h=d.data;if(h.id==null)h.id=xR();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var g=new cl(e,d,!1);s.push(g),l.add(h.id)}t=s}this.length=0;for(var p=0,E=t.length;p<E;p++){var m=t[p][0];if(m!=null){var b=m._private.data.id;(!n||!i.has(b))&&(n&&i.set(b,{index:this.length,ele:m}),this[this.length]=m,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(w){this.lazyMap=w},rebuildMap:function(){for(var x=this.lazyMap=new Xn,C=this.eles,T=0;T<C.length;T++){var S=C[T];x.set(S.id(),{index:T,ele:S})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Pr=cl.prototype=pt.prototype=Object.create(Array.prototype);Pr.instanceString=function(){return"collection"};Pr.spawn=function(r,e){return new pt(this.cy(),r,e)};Pr.spawnSelf=function(){return this.spawn(this)};Pr.cy=function(){return this._private.cy};Pr.renderer=function(){return this._private.cy.renderer()};Pr.element=function(){return this[0]};Pr.collection=function(){return sR(this)?this:new pt(this._private.cy,[this])};Pr.unique=function(){return new pt(this._private.cy,this,!0)};Pr.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};Pr.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new pt(e)};Pr.$id=Pr.getElementById;Pr.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};Pr.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};Pr.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};Pr.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var n=e._private;if(pr(r)){if(t.startBatch(),r.data){e.data(r.data);var a=n.data;if(e.isEdge()){var i=!1,o={},s=r.data.source,l=r.data.target;s!=null&&s!=a.source&&(o.source=""+s,i=!0),l!=null&&l!=a.target&&(o.target=""+l,i=!0),i&&(e=e.move(o))}else{var u="parent"in r.data,c=r.data.parent;u&&(c!=null||a.parent!=null)&&c!=a.parent&&(c===void 0&&(c=null),c!=null&&(c=""+c),e=e.move({parent:c}))}}r.position&&e.position(r.position);var d=function(E,m,b){var w=r[E];w!=null&&w!==n[E]&&(w?e[m]():e[b]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var h={data:Bn(n.data),position:Bn(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var g=0;return n.classes.forEach(function(p){return h.classes+=g++===0?p:" "+p}),h}}};Pr.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],n=t.json();r.push(n)}return r};Pr.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var n=this[t],a=n.json(),i=new cl(r,a,!1);e.push(i)}return new pt(r,e)};Pr.copy=Pr.clone;Pr.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=t.cy(),a=n._private,i=[],o=[],s,l=0,u=t.length;l<u;l++){var c=t[l];e&&!c.removed()||(c.isNode()?i.push(c):o.push(c))}s=i.concat(o);var d,h=function(){s.splice(d,1),d--};for(d=0;d<s.length;d++){var g=s[d],p=g._private,E=p.data;if(g.clearTraversalCache(),!(!e&&!p.removed)){if(E.id===void 0)E.id=xR();else if(ke(E.id))E.id=""+E.id;else if(Ta(E.id)||!Ke(E.id)){Lr("Can not create element with invalid string ID `"+E.id+"`"),h();continue}else if(n.hasElementWithId(E.id)){Lr("Can not create second element with ID `"+E.id+"`"),h();continue}}var m=E.id;if(g.isNode()){var b=p.position;b.x==null&&(b.x=0),b.y==null&&(b.y=0)}if(g.isEdge()){for(var w=g,x=["source","target"],C=x.length,T=!1,S=0;S<C;S++){var _=x[S],A=E[_];ke(A)&&(A=E[_]=""+E[_]),A==null||A===""?(Lr("Can not create edge `"+m+"` with unspecified "+_),T=!0):n.hasElementWithId(A)||(Lr("Can not create edge `"+m+"` with nonexistant "+_+" `"+A+"`"),T=!0)}if(T){h();continue}var P=n.getElementById(E.source),D=n.getElementById(E.target);P.same(D)?P._private.edges.push(w):(P._private.edges.push(w),D._private.edges.push(w)),w._private.source=P,w._private.target=D}p.map=new Xn,p.map.set(m,{ele:g,index:0}),p.removed=!1,e&&n.addToPool(g)}for(var I=0;I<i.length;I++){var M=i[I],k=M._private.data;ke(k.parent)&&(k.parent=""+k.parent);var N=k.parent,z=N!=null;if(z||M._private.parent){var W=M._private.parent?n.collection().merge(M._private.parent):n.getElementById(N);if(W.empty())k.parent=void 0;else if(W[0].removed())Er("Node added with missing parent, reference to parent removed"),k.parent=void 0,M._private.parent=null;else{for(var q=!1,$=W;!$.empty();){if(M.same($)){q=!0,k.parent=void 0;break}$=$.parent()}q||(W[0]._private.children.push(M),M._private.parent=W[0],a.hasCompoundNodes=!0)}}}if(s.length>0){for(var X=s.length===t.length?t:new pt(n,s),Y=0;Y<X.length;Y++){var K=X[Y];K.isNode()||(K.parallelEdges().clearTraversalCache(),K.source().clearTraversalCache(),K.target().clearTraversalCache())}var ee;a.hasCompoundNodes?ee=n.collection().merge(X).merge(X.connectedNodes()).merge(X.parent()):ee=X,ee.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?X.emitAndNotify("add"):e&&X.emit("add")}return t};Pr.removed=function(){var r=this[0];return r&&r._private.removed};Pr.inside=function(){var r=this[0];return r&&!r._private.removed};Pr.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=[],a={},i=t._private.cy;function o(N){for(var z=N._private.edges,W=0;W<z.length;W++)l(z[W])}function s(N){for(var z=N._private.children,W=0;W<z.length;W++)l(z[W])}function l(N){var z=a[N.id()];e&&N.removed()||z||(a[N.id()]=!0,N.isNode()?(n.push(N),o(N),s(N)):n.unshift(N))}for(var u=0,c=t.length;u<c;u++){var d=t[u];l(d)}function h(N,z){var W=N._private.edges;Ra(W,z),N.clearTraversalCache()}function g(N){N.clearTraversalCache()}var p=[];p.ids={};function E(N,z){z=z[0],N=N[0];var W=N._private.children,q=N.id();Ra(W,z),z._private.parent=null,p.ids[q]||(p.ids[q]=!0,p.push(N))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var m=0;m<n.length;m++){var b=n[m];if(b.isEdge()){var w=b.source()[0],x=b.target()[0];h(w,b),h(x,b);for(var C=b.parallelEdges(),T=0;T<C.length;T++){var S=C[T];g(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var _=b.parent();_.length!==0&&E(_,b)}e&&(b._private.removed=!0)}var A=i._private.elements;i._private.hasCompoundNodes=!1;for(var P=0;P<A.length;P++){var D=A[P];if(D.isParent()){i._private.hasCompoundNodes=!0;break}}var I=new pt(this.cy(),n);I.size()>0&&(r?I.emitAndNotify("remove"):e&&I.emit("remove"));for(var M=0;M<p.length;M++){var k=p[M];(!e||!k.removed())&&k.updateStyle()}return I};Pr.move=function(r){var e=this._private.cy,t=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(r.source!==void 0||r.target!==void 0){var o=i(r.source),s=i(r.target),l=o!=null&&e.hasElementWithId(o),u=s!=null&&e.hasElementWithId(s);(l||u)&&(e.batch(function(){t.remove(n,a),t.emitAndNotify("moveout");for(var g=0;g<t.length;g++){var p=t[g],E=p._private.data;p.isEdge()&&(l&&(E.source=o),u&&(E.target=s))}t.restore(n,a)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var c=i(r.parent),d=c===null||e.hasElementWithId(c);if(d){var h=c===null?void 0:c;e.batch(function(){var g=t.remove(n,a);g.emitAndNotify("moveout");for(var p=0;p<t.length;p++){var E=t[p],m=E._private.data;E.isNode()&&(m.parent=h)}g.restore(n,a)}),t.emitAndNotify("move")}}return this};[kR,U5,Lu,_a,ao,sz,ml,Cz,aA,iA,Az,Ju,Ou,gt,Sa,_t].forEach(function(r){Ye(Pr,r)});var Lz={add:function(e){var t,n=this;if(Zt(e)){var a=e;if(a._private.cy===n)t=a.restore();else{for(var i=[],o=0;o<a.length;o++){var s=a[o];i.push(s.json())}t=new pt(n,i)}}else if(Sr(e)){var l=e;t=new pt(n,l)}else if(pr(e)&&(Sr(e.nodes)||Sr(e.edges))){for(var u=e,c=[],d=["nodes","edges"],h=0,g=d.length;h<g;h++){var p=d[h],E=u[p];if(Sr(E))for(var m=0,b=E.length;m<b;m++){var w=Ye({group:p},E[m]);c.push(w)}}t=new pt(n,c)}else{var x=e;t=new cl(n,x).collection()}return t},remove:function(e){if(!Zt(e)){if(Ke(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function Oz(r,e,t,n){var a=4,i=.001,o=1e-7,s=10,l=11,u=1/(l-1),c=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var h=c?new Float32Array(l):new Array(l);function g(D,I){return 1-3*I+3*D}function p(D,I){return 3*I-6*D}function E(D){return 3*D}function m(D,I,M){return((g(I,M)*D+p(I,M))*D+E(I))*D}function b(D,I,M){return 3*g(I,M)*D*D+2*p(I,M)*D+E(I)}function w(D,I){for(var M=0;M<a;++M){var k=b(I,r,t);if(k===0)return I;var N=m(I,r,t)-D;I-=N/k}return I}function x(){for(var D=0;D<l;++D)h[D]=m(D*u,r,t)}function C(D,I,M){var k,N,z=0;do N=I+(M-I)/2,k=m(N,r,t)-D,k>0?M=N:I=N;while(Math.abs(k)>o&&++z<s);return N}function T(D){for(var I=0,M=1,k=l-1;M!==k&&h[M]<=D;++M)I+=u;--M;var N=(D-h[M])/(h[M+1]-h[M]),z=I+N*u,W=b(z,r,t);return W>=i?w(D,z):W===0?z:C(D,I,I+u)}var S=!1;function _(){S=!0,(r!==e||t!==n)&&x()}var A=function(I){return S||_(),r===e&&t===n?I:I===0?0:I===1?1:m(T(I),e,n)};A.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var P="generateBezier("+[r,e,t,n]+")";return A.toString=function(){return P},A}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var qz=(function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:r(o)}}function t(n,a){var i={dx:n.v,dv:r(n)},o=e(n,a*.5,i),s=e(n,a*.5,o),l=e(n,a,s),u=1/6*(i.dx+2*(o.dx+s.dx)+l.dx),c=1/6*(i.dv+2*(o.dv+s.dv)+l.dv);return n.x=n.x+u*a,n.v=n.v+c*a,n}return function n(a,i,o){var s={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1/1e4,d=16/1e3,h,g,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,s.tension=a,s.friction=i,h=o!==null,h?(u=n(a,i),g=u/o*d):g=d;p=t(p||s,g),l.push(1+p.x),u+=16,Math.abs(p.x)>c&&Math.abs(p.v)>c;);return h?function(E){return l[E*(l.length-1)|0]}:u}})(),Ar=function(e,t,n,a){var i=Oz(e,t,n,a);return function(o,s,l){return o+(s-o)*i(l)}},qu={linear:function(e,t,n){return e+(t-e)*n},ease:Ar(.25,.1,.25,1),"ease-in":Ar(.42,0,1,1),"ease-out":Ar(0,0,.58,1),"ease-in-out":Ar(.42,0,.58,1),"ease-in-sine":Ar(.47,0,.745,.715),"ease-out-sine":Ar(.39,.575,.565,1),"ease-in-out-sine":Ar(.445,.05,.55,.95),"ease-in-quad":Ar(.55,.085,.68,.53),"ease-out-quad":Ar(.25,.46,.45,.94),"ease-in-out-quad":Ar(.455,.03,.515,.955),"ease-in-cubic":Ar(.55,.055,.675,.19),"ease-out-cubic":Ar(.215,.61,.355,1),"ease-in-out-cubic":Ar(.645,.045,.355,1),"ease-in-quart":Ar(.895,.03,.685,.22),"ease-out-quart":Ar(.165,.84,.44,1),"ease-in-out-quart":Ar(.77,0,.175,1),"ease-in-quint":Ar(.755,.05,.855,.06),"ease-out-quint":Ar(.23,1,.32,1),"ease-in-out-quint":Ar(.86,0,.07,1),"ease-in-expo":Ar(.95,.05,.795,.035),"ease-out-expo":Ar(.19,1,.22,1),"ease-in-out-expo":Ar(1,0,0,1),"ease-in-circ":Ar(.6,.04,.98,.335),"ease-out-circ":Ar(.075,.82,.165,1),"ease-in-out-circ":Ar(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return qu.linear;var a=qz(e,t,n);return function(i,o,s){return i+(o-i)*a(s)}},"cubic-bezier":Ar};function zx(r,e,t,n,a){if(n===1||e===t)return t;var i=a(e,t,n);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function $x(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Fi(r,e,t,n,a){var i=a!=null?a.type:null;t<0?t=0:t>1&&(t=1);var o=$x(r,a),s=$x(e,a);if(ke(o)&&ke(s))return zx(i,o,s,t,n);if(Sr(o)&&Sr(s)){for(var l=[],u=0;u<s.length;u++){var c=o[u],d=s[u];if(c!=null&&d!=null){var h=zx(i,c,d,t,n);l.push(h)}else l.push(d)}return l}}function Nz(r,e,t,n){var a=!n,i=r._private,o=e._private,s=o.easing,l=o.startTime,u=n?r:r.cy(),c=u.style();if(!o.easingImpl)if(s==null)o.easingImpl=qu.linear;else{var d;if(Ke(s)){var h=c.parse("transition-timing-function",s);d=h.value}else d=s;var g,p;Ke(d)?(g=d,p=[]):(g=d[1],p=d.slice(2).map(function(X){return+X})),p.length>0?(g==="spring"&&p.push(o.duration),o.easingImpl=qu[g].apply(null,p)):o.easingImpl=qu[g]}var E=o.easingImpl,m;if(o.duration===0?m=1:m=(t-l)/o.duration,o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var b=o.startPosition,w=o.position;if(w&&a&&!r.locked()){var x={};Oo(b.x,w.x)&&(x.x=Fi(b.x,w.x,m,E)),Oo(b.y,w.y)&&(x.y=Fi(b.y,w.y,m,E)),r.position(x)}var C=o.startPan,T=o.pan,S=i.pan,_=T!=null&&n;_&&(Oo(C.x,T.x)&&(S.x=Fi(C.x,T.x,m,E)),Oo(C.y,T.y)&&(S.y=Fi(C.y,T.y,m,E)),r.emit("pan"));var A=o.startZoom,P=o.zoom,D=P!=null&&n;D&&(Oo(A,P)&&(i.zoom=ns(i.minZoom,Fi(A,P,m,E),i.maxZoom)),r.emit("zoom")),(_||D)&&r.emit("viewport");var I=o.style;if(I&&I.length>0&&a){for(var M=0;M<I.length;M++){var k=I[M],N=k.name,z=k,W=o.startStyle[N],q=c.properties[W.name],$=Fi(W,z,m,E,q);c.overrideBypass(r,N,$)}r.emit("style")}}return o.progress=m,m}function Oo(r,e){return r==null||e==null?!1:ke(r)&&ke(e)?!0:!!(r&&e)}function Fz(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function Vx(r,e){var t=e._private.aniEles,n=[];function a(c,d){var h=c._private,g=h.animation.current,p=h.animation.queue,E=!1;if(g.length===0){var m=p.shift();m&&g.push(m)}for(var b=function(S){for(var _=S.length-1;_>=0;_--){var A=S[_];A()}S.splice(0,S.length)},w=g.length-1;w>=0;w--){var x=g[w],C=x._private;if(C.stopped){g.splice(w,1),C.hooked=!1,C.playing=!1,C.started=!1,b(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||Fz(c,x,r),Nz(c,x,r,d),C.applying&&(C.applying=!1),b(C.frames),C.step!=null&&C.step(r),x.completed()&&(g.splice(w,1),C.hooked=!1,C.playing=!1,C.started=!1,b(C.completes)),E=!0)}return!d&&g.length===0&&p.length===0&&n.push(c),E}for(var i=!1,o=0;o<t.length;o++){var s=t[o],l=a(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 zz={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&ju(function(i){Vx(i,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){Vx(o,e)},n.beforeRenderPriorities.animations):t()}},$z={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&hs(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},Ru=function(e){return Ke(e)?new Pa(e):e},uA={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new bl($z,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Ru(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Ru(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Ru(t),n),this},once:function(e,t,n){return this.emitter().one(e,Ru(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}};xr.eventAliasesOn(uA);var mm={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};mm.jpeg=mm.jpg;var Nu={layout:function(e){var t=this;if(e==null){Lr("Layout options must be specified to make a layout");return}if(e.name==null){Lr("A `name` must be specified to make a layout");return}var n=e.name,a=t.extension("layout",n);if(a==null){Lr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ke(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var o=new a(Ye({},e,{cy:t,eles:i}));return o}};Nu.createLayout=Nu.makeLayout=Nu.layout;var Vz={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();t!=null&&a.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var 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],o=e[i],s=t.getElementById(i);s.data(o)}})}},Gz=yt({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]}),bm={renderTo:function(e,t,n,a){var i=this._private.renderer;return i.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(n==null){Lr("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Er("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=Gz(e);a.cy=t,t._private.renderer=new n(a),this.notify("init")},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)}};bm.invalidateDimensions=bm.resize;var Fu={collection:function(e,t){return Ke(e)?this.$(e):Zt(e)?e.collection():Sr(e)?(t||(t={}),new pt(this,e,t.unique,t.removed)):new pt(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}};Fu.elements=Fu.filter=Fu.$;var ut={},jo="t",Wz="f";ut.apply=function(r){for(var e=this,t=e._private,n=t.cy,a=n.collection(),i=0;i<r.length;i++){var o=r[i],s=e.getContextMeta(o);if(!s.empty){var l=e.getContextStyle(s),u=e.applyContextStyle(s,l,o);o._private.appliedInitStyle?e.updateTransitions(o,u.diffProps):o._private.appliedInitStyle=!0;var c=e.updateStyleHints(o);c&&a.push(o)}}return a};ut.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 o=[],s={},l=0;l<t.length;l++){var u=t[l],c=r[l]===jo,d=e[l]===jo,h=c!==d,g=u.mappedProperties.length>0;if(h||d&&g){var p=void 0;h&&g||h?p=u.properties:g&&(p=u.mappedProperties);for(var E=0;E<p.length;E++){for(var m=p[E],b=m.name,w=!1,x=l+1;x<t.length;x++){var C=t[x],T=e[x]===jo;if(T&&(w=C.properties[m.name]!=null,w))break}!s[b]&&!w&&(s[b]=!0,o.push(b))}}}return n[a]=o,o};ut.getContextMeta=function(r){for(var e=this,t="",n,a=r._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(r);s?t+=jo:t+=Wz}return n=e.getPropertiesDiff(a,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:n.length===0}};ut.getContextStyle=function(r){var e=r.key,t=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<t.length;i++){var o=t[i],s=e[i]===jo;if(s)for(var l=0;l<o.properties.length;l++){var u=o.properties[l];a[u.name]=u}}return n[e]=a,a};ut.applyContextStyle=function(r,e,t){for(var n=this,a=r.diffPropNames,i={},o=n.types,s=0;s<a.length;s++){var l=a[s],u=e[l],c=t.pstyle(l);if(!u)if(c)c.bypass?u={name:l,deleteBypassed:!0}:u={name:l,delete:!0};else continue;if(c!==u){if(u.mapped===o.fn&&c!=null&&c.mapping!=null&&c.mapping.value===u.value){var d=c.mapping,h=d.fnValue=u.value(t);if(h===d.prevFnValue)continue}var g=i[l]={prev:c};n.applyParsedProperty(t,u),g.next=t.pstyle(l),g.next&&g.next.bypass&&(g.next=g.next.bypassed)}}return{diffProps:i}};ut.updateStyleHints=function(r){var e=r._private,t=this,n=t.propertyGroupNames,a=t.propertyGroupKeys,i=function(ae,ne,de){return t.getPropertiesHash(ae,ne,de)},o=e.styleKey;if(r.removed())return!1;var s=e.group==="nodes",l=r._private.style;n=Object.keys(l);for(var u=0;u<a.length;u++){var c=a[u];e.styleKeys[c]=[ti,Ui]}for(var d=function(ae,ne){return e.styleKeys[ne][0]=es(ae,e.styleKeys[ne][0])},h=function(ae,ne){return e.styleKeys[ne][1]=rs(ae,e.styleKeys[ne][1])},g=function(ae,ne){d(ae,ne),h(ae,ne)},p=function(ae,ne){for(var de=0;de<ae.length;de++){var Ce=ae.charCodeAt(de);d(Ce,ne),h(Ce,ne)}},E=2e9,m=function(ae){return-128<ae&&ae<128&&Math.floor(ae)!==ae?E-(ae*1024|0):ae},b=0;b<n.length;b++){var w=n[b],x=l[w];if(x!=null){var C=this.properties[w],T=C.type,S=C.groupKey,_=void 0;C.hashOverride!=null?_=C.hashOverride(r,x):x.pfValue!=null&&(_=x.pfValue);var A=C.enums==null?x.value:null,P=_!=null,D=A!=null,I=P||D,M=x.units;if(T.number&&I&&!T.multiple){var k=P?_:A;g(m(k),S),!P&&M!=null&&p(M,S)}else p(x.strValue,S)}}for(var N=[ti,Ui],z=0;z<a.length;z++){var W=a[z],q=e.styleKeys[W];N[0]=es(q[0],N[0]),N[1]=rs(q[1],N[1])}e.styleKey=oN(N[0],N[1]);var $=e.styleKeys;e.labelDimsKey=pa($.labelDimensions);var X=i(r,["label"],$.labelDimensions);if(e.labelKey=pa(X),e.labelStyleKey=pa(bu($.commonLabel,X)),!s){var Y=i(r,["source-label"],$.labelDimensions);e.sourceLabelKey=pa(Y),e.sourceLabelStyleKey=pa(bu($.commonLabel,Y));var K=i(r,["target-label"],$.labelDimensions);e.targetLabelKey=pa(K),e.targetLabelStyleKey=pa(bu($.commonLabel,K))}if(s){var ee=e.styleKeys,le=ee.nodeBody,G=ee.nodeBorder,V=ee.nodeOutline,j=ee.backgroundImage,re=ee.compound,ce=ee.pie,se=ee.stripe,Z=[le,G,V,j,re,ce,se].filter(function(Q){return Q!=null}).reduce(bu,[ti,Ui]);e.nodeKey=pa(Z),e.hasPie=ce!=null&&ce[0]!==ti&&ce[1]!==Ui,e.hasStripe=se!=null&&se[0]!==ti&&se[1]!==Ui}return o!==e.styleKey};ut.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};ut.applyParsedProperty=function(r,e){var t=this,n=e,a=r._private.style,i,o=t.types,s=t.properties[n.name].type,l=n.bypass,u=a[n.name],c=u&&u.bypass,d=r._private,h="mapping",g=function(le){return le==null?null:le.pfValue!=null?le.pfValue:le.value},p=function(){var le=g(u),G=g(n);t.checkTriggers(r,n.name,le,G)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return u?u.bypass?(u.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return u?u.bypass?(a[n.name]=u.bypassed,p(),!0):!1:(p(),!0);var E=function(){Er("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 o.mapData:{for(var m=n.field.split("."),b=d.data,w=0;w<m.length&&b;w++){var x=m[w];b=b[x]}if(b==null)return E(),!1;var C;if(ke(b)){var T=n.fieldMax-n.fieldMin;T===0?C=0:C=(b-n.fieldMin)/T}else return Er("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+b+"` for `"+r.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),s.color){var S=n.valueMin[0],_=n.valueMax[0],A=n.valueMin[1],P=n.valueMax[1],D=n.valueMin[2],I=n.valueMax[2],M=n.valueMin[3]==null?1:n.valueMin[3],k=n.valueMax[3]==null?1:n.valueMax[3],N=[Math.round(S+(_-S)*C),Math.round(A+(P-A)*C),Math.round(D+(I-D)*C),Math.round(M+(k-M)*C)];i={bypass:n.bypass,name:n.name,value:N,strValue:"rgb("+N[0]+", "+N[1]+", "+N[2]+")"}}else if(s.number){var z=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,z,n.bypass,h)}else return!1;if(!i)return E(),!1;i.mapping=n,n=i;break}case o.data:{for(var W=n.field.split("."),q=d.data,$=0;$<W.length&&q;$++){var X=W[$];q=q[X]}if(q!=null&&(i=this.parse(n.name,q,n.bypass,h)),!i)return E(),!1;i.mapping=n,n=i;break}case o.fn:{var Y=n.value,K=n.fnValue!=null?n.fnValue:Y(r);if(n.prevFnValue=K,K==null)return Er("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(n.name,K,n.bypass,h),!i)return Er("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=Bn(n),n=i;break}case void 0:break;default:return!1}return l?(c?n.bypassed=u.bypassed:n.bypassed=u,a[n.name]=n):c?u.bypassed=n:a[n.name]=n,p(),!0};ut.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)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],l=a[s];l!=null&&(l.bypass?l.bypassed=null:a[s]=null)}}};ut.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};ut.updateTransitions=function(r,e){var t=this,n=r._private,a=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,o=r.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var s={},l=!1,u=0;u<a.length;u++){var c=a[u],d=r.pstyle(c),h=e[c];if(h){var g=h.prev,p=g,E=h.next!=null?h.next:d,m=!1,b=void 0,w=1e-6;p&&(ke(p.pfValue)&&ke(E.pfValue)?(m=E.pfValue-p.pfValue,b=p.pfValue+w*m):ke(p.value)&&ke(E.value)?(m=E.value-p.value,b=p.value+w*m):Sr(p.value)&&Sr(E.value)&&(m=p.value[0]!==E.value[0]||p.value[1]!==E.value[1]||p.value[2]!==E.value[2],b=p.strValue),m&&(s[c]=E.strValue,this.applyBypass(r,c,b),l=!0))}}if(!l)return;n.transitioning=!0,new oo(function(x){o>0?r.delayAnimation(o).play().promise().then(x):x()}).then(function(){return r.animation({style:s,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)};ut.checkTrigger=function(r,e,t,n,a,i){var o=this.properties[e],s=a(o);r.removed()||s!=null&&s(t,n,r)&&i(o)};ut.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)})};ut.checkBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBounds},function(a){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};ut.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()})})};ut.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()})})};ut.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)};var xs={};xs.applyBypass=function(r,e,t,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var s=0;s<a.properties.length;s++){var l=a.properties[s],u=l.name,c=this.parse(u,t,!0);c&&i.push(c)}}else if(Ke(e)){var d=this.parse(e,t,!0);d&&i.push(d)}else if(pr(e)){var h=e;n=t;for(var g=Object.keys(h),p=0;p<g.length;p++){var E=g[p],m=h[E];if(m===void 0&&(m=h[ll(E)]),m!==void 0){var b=this.parse(E,m,!0);b&&i.push(b)}}}else return!1;if(i.length===0)return!1;for(var w=!1,x=0;x<r.length;x++){for(var C=r[x],T={},S=void 0,_=0;_<i.length;_++){var A=i[_];if(n){var P=C.pstyle(A.name);S=T[A.name]={prev:P}}w=this.applyParsedProperty(C,Bn(A))||w,n&&(S.next=C.pstyle(A.name))}w&&this.updateStyleHints(C),n&&this.updateTransitions(C,T,o)}return w};xs.overrideBypass=function(r,e,t){e=Bm(e);for(var n=0;n<r.length;n++){var a=r[n],i=a._private.style[e],o=this.properties[e].type,s=o.color,l=o.mutiple,u=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),s?i.strValue="rgb("+t.join(",")+")":l?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(a)),this.checkTriggers(a,e,u,t)}};xs.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};xs.removeBypasses=function(r,e,t){for(var n=!0,a=0;a<r.length;a++){for(var i=r[a],o={},s=0;s<e.length;s++){var l=e[s],u=this.properties[l],c=i.pstyle(u.name);if(!(!c||!c.bypass)){var d="",h=this.parse(l,d,!0),g=o[u.name]={prev:c};this.applyParsedProperty(i,h),g.next=i.pstyle(u.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,o,n)}};var Km={};Km.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};Km.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)};var kn={};kn.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};kn.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var n={},a=0;a<t.properties.length;a++){var i=t.properties[a],o=t.getStylePropertyValue(r,i.name,e);o!=null&&(n[i.name]=o,n[ll(i.name)]=o)}return n}};kn.getIndexedStyle=function(r,e,t,n){var a=r.pstyle(e)[t][n];return a??r.cy().style().getDefaultProperty(e)[t][0]};kn.getStylePropertyValue=function(r,e,t){var n=this;if(r=r[0],r){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=r.pstyle(a.name);if(o){var s=o.value,l=o.units,u=o.strValue;if(t&&i.number&&s!=null&&ke(s)){var c=r.cy().zoom(),d=function(m){return m*c},h=function(m,b){return d(m)+b},g=Sr(s),p=g?l.every(function(E){return E!=null}):l!=null;return p?g?s.map(function(E,m){return h(E,l[m])}).join(" "):h(s,l):g?s.map(function(E){return Ke(E)?E:""+d(E)}).join(" "):""+d(s)}else if(u!=null)return u}return null}};kn.getAnimationStartStyle=function(r,e){for(var t={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=r.pstyle(i);o!==void 0&&(pr(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(t[i]=o)}return t};kn.getPropsList=function(r){var e=this,t=[],n=r,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],l=n[s],u=a[s]||a[Bm(s)],c=this.parse(u.name,l);c&&t.push(c)}return t};kn.getNonDefaultPropertiesHash=function(r,e,t){var n=t.slice(),a,i,o,s,l,u;for(l=0;l<e.length;l++)if(a=e[l],i=r.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=es(s,n[0]),n[1]=rs(s,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)s=o.charCodeAt(u),n[0]=es(s,n[0]),n[1]=rs(s,n[1]);return n};kn.getPropertiesHash=kn.getNonDefaultPropertiesHash;var El={};El.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,o=Object.keys(i);e.selector(a);for(var s=0;s<o.length;s++){var l=o[s],u=i[l];e.css(l,u)}}return e};El.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};El.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,a=t.properties,i={},o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}r.push({selector:n?n.toString():"core",style:i})}return r};var jm={};jm.appendFromString=function(r){var e=this,t=this,n=""+r,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){n.length>a.length?n=n.substr(a.length):n=""}function l(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var u=n.match(/^\s*$/);if(u)break;var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Er("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(d!=="core"){var h=new Pa(d);if(h.invalid){Er("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),s();continue}}var g=c[2],p=!1;i=g;for(var E=[];;){var m=i.match(/^\s*$/);if(m)break;var b=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!b){Er("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+g),p=!0;break}o=b[0];var w=b[1],x=b[2],C=e.properties[w];if(!C){Er("Skipping property: Invalid property name in: "+o),l();continue}var T=t.parse(w,x);if(!T){Er("Skipping property: Invalid property definition in: "+o),l();continue}E.push({name:w,val:x}),l()}if(p){s();break}t.selector(d);for(var S=0;S<E.length;S++){var _=E[S];t.css(_.name,_.val)}s()}return t};jm.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var jr={};(function(){var r=rt,e=Nq,t=zq,n=$q,a=Vq,i=function(Q){return"^"+Q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(Q){var ae=r+"|\\w+|"+e+"|"+t+"|"+n+"|"+a;return"^"+Q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+ae+")\\s*\\,\\s*("+ae+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];jr.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","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(Q,ae){switch(Q.length){case 2:return ae[0]!=="deg"&&ae[0]!=="rad"&&ae[1]!=="deg"&&ae[1]!=="rad";case 1:return Ke(Q[0])||ae[0]==="deg"||ae[0]==="rad";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(Q){var ae=Q.length;return ae===1||ae===2||ae===4}}};var l={zeroNonZero:function(Q,ae){return(Q==null||ae==null)&&Q!==ae||Q==0&&ae!=0?!0:Q!=0&&ae==0},any:function(Q,ae){return Q!=ae},emptyNonEmpty:function(Q,ae){var ne=Ta(Q),de=Ta(ae);return ne&&!de||!ne&&de}},u=jr.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}],h=[{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}],g=[{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}],p=[{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:"box-select-labels",type:u.bool,triggersBounds:l.any}],E=[{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}],m=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(Q,ae,ne){return Q===ae?!1:ne.pstyle("curve-style").value==="bezier"}},{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}],b=[{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}],x=[{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}],C=function(Q,ae){return ae.value==="label"?-Q.poolIndex():ae.pfValue},T=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:C},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:C},{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}],S=[{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}],_=[{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}],A=[{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}],P=[{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}],D=[{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(Q,ae){return Q===ae?!1:Q==="bezier"||ae==="bezier"}},{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}],I=[{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}],M=[{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}],k=[];jr.pieBackgroundN=16,k.push({name:"pie-size",type:u.sizeMaybePercent}),k.push({name:"pie-hole",type:u.sizeMaybePercent}),k.push({name:"pie-start-angle",type:u.angle});for(var N=1;N<=jr.pieBackgroundN;N++)k.push({name:"pie-"+N+"-background-color",type:u.color}),k.push({name:"pie-"+N+"-background-size",type:u.percent}),k.push({name:"pie-"+N+"-background-opacity",type:u.zeroOneNumber});var z=[];jr.stripeBackgroundN=16,z.push({name:"stripe-size",type:u.sizeMaybePercent}),z.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var W=1;W<=jr.stripeBackgroundN;W++)z.push({name:"stripe-"+W+"-background-color",type:u.color}),z.push({name:"stripe-"+W+"-background-size",type:u.percent}),z.push({name:"stripe-"+W+"-background-opacity",type:u.zeroOneNumber});var q=[],$=jr.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(Z){$.forEach(function(Q){var ae=Q+"-"+Z.name,ne=Z.type,de=Z.triggersBounds;q.push({name:ae,type:ne,triggersBounds:de})})},{});var X=jr.properties=[].concat(E,x,m,b,w,I,p,g,c,d,h,T,S,_,A,k,z,P,D,q,M),Y=jr.propertyGroups={behavior:E,transition:x,visibility:m,overlay:b,underlay:w,ghost:I,commonLabel:p,labelDimensions:g,mainLabel:c,sourceLabel:d,targetLabel:h,nodeBody:T,nodeBorder:S,nodeOutline:_,backgroundImage:A,pie:k,stripe:z,compound:P,edgeLine:D,edgeArrow:q,core:M},K=jr.propertyGroupNames={},ee=jr.propertyGroupKeys=Object.keys(Y);ee.forEach(function(Z){K[Z]=Y[Z].map(function(Q){return Q.name}),Y[Z].forEach(function(Q){return Q.groupKey=Z})});var le=jr.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"}];jr.propertyNames=X.map(function(Z){return Z.name});for(var G=0;G<X.length;G++){var V=X[G];X[V.name]=V}for(var j=0;j<le.length;j++){var re=le[j],ce=X[re.pointsTo],se={name:re.name,alias:!0,pointsTo:ce};X.push(se),X[re.name]=se}})();jr.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};jr.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=Ye({"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","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<=jr.pieBackgroundN;c++){var d=u.name.replace("{{i}}",c),h=u.value;l[d]=h}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<=jr.stripeBackgroundN;c++){var d=u.name.replace("{{i}}",c),h=u.value;l[d]=h}return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return jr.arrowPrefixes.forEach(function(c){var d=c+"-"+u.name,h=u.value;l[d]=h}),l},{})),t={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],s=this.parse(i,o);t[i]=s}}return r.defaultProperties=t,r.defaultProperties};jr.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 Cl={};Cl.parse=function(r,e,t,n){var a=this;if(Fr(e))return a.parseImplWarn(r,e,t,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=t?"t":"f",s=""+e,l=mR(r,s,o,i),u=a.propCache=a.propCache||[],c;return(c=u[l])||(c=u[l]=a.parseImplWarn(r,e,t,n)),(t||n==="mapping")&&(c=Bn(c),c&&(c.value=Bn(c.value))),c};Cl.parseImplWarn=function(r,e,t,n){var a=this.parseImpl(r,e,t,n);return!a&&e!=null&&Er("The style property `".concat(r,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Er("The style value of `label` is deprecated for `"+a.name+"`"),a};Cl.parseImpl=function(r,e,t,n){var a=this;r=Bm(r);var i=a.properties[r],o=e,s=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var l=Ke(e);l&&(e=e.trim());var u=i.type;if(!u)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(Fr(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};var c,d;if(!(!l||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(c=new RegExp(s.data.regex).exec(e))){if(t)return!1;var h=s.data;return{name:r,value:c,strValue:""+e,mapped:h,field:c[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(s.mapData.regex).exec(e))){if(t||u.multiple)return!1;var g=s.mapData;if(!(u.color||u.number))return!1;var p=this.parse(r,d[4]);if(!p||p.mapped)return!1;var E=this.parse(r,d[5]);if(!E||E.mapped)return!1;if(p.pfValue===E.pfValue||p.strValue===E.strValue)return Er("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+p.strValue+"`"),this.parse(r,p.strValue);if(u.color){var m=p.value,b=E.value,w=m[0]===b[0]&&m[1]===b[1]&&m[2]===b[2]&&(m[3]===b[3]||(m[3]==null||m[3]===1)&&(b[3]==null||b[3]===1));if(w)return!1}return{name:r,value:d,strValue:""+e,mapped:g,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:p.value,valueMax:E.value,bypass:t}}}if(u.multiple&&n!=="multiple"){var x;if(l?x=e.split(/\s+/):Sr(e)?x=e:x=[e],u.evenMultiple&&x.length%2!==0)return null;for(var C=[],T=[],S=[],_="",A=!1,P=0;P<x.length;P++){var D=a.parse(r,x[P],t,"multiple");A=A||Ke(D.value),C.push(D.value),S.push(D.pfValue!=null?D.pfValue:D.value),T.push(D.units),_+=(P>0?" ":"")+D.strValue}return u.validate&&!u.validate(C,T)?null:u.singleEnum&&A?C.length===1&&Ke(C[0])?{name:r,value:C[0],strValue:C[0],bypass:t}:null:{name:r,value:C,pfValue:S,strValue:_,bypass:t,units:T}}var I=function(){for(var se=0;se<u.enums.length;se++){var Z=u.enums[se];if(Z===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(u.number){var M,k="px";if(u.units&&(M=u.units),u.implicitUnits&&(k=u.implicitUnits),!u.unitless)if(l){var N="px|em"+(u.allowPercent?"|\\%":"");M&&(N=M);var z=e.match("^("+rt+")("+N+")?$");z&&(e=z[1],M=z[2]||k)}else(!M||u.implicitUnits)&&(M=k);if(e=parseFloat(e),isNaN(e)&&u.enums===void 0)return null;if(isNaN(e)&&u.enums!==void 0)return e=o,I();if(u.integer&&!Iq(e)||u.min!==void 0&&(e<u.min||u.strictMin&&e===u.min)||u.max!==void 0&&(e>u.max||u.strictMax&&e===u.max))return null;var W={name:r,value:e,strValue:""+e+(M||""),units:M,bypass:t};return u.unitless||M!=="px"&&M!=="em"?W.pfValue=e:W.pfValue=M==="px"||!M?e:this.getEmSizeInPixels()*e,(M==="ms"||M==="s")&&(W.pfValue=M==="ms"?e:1e3*e),(M==="deg"||M==="rad")&&(W.pfValue=M==="rad"?e:$N(e)),M==="%"&&(W.pfValue=e/100),W}else if(u.propList){var q=[],$=""+e;if($!=="none"){for(var X=$.split(/\s*,\s*|\s+/),Y=0;Y<X.length;Y++){var K=X[Y].trim();a.properties[K]?q.push(K):Er("`"+K+"` is not a valid property name")}if(q.length===0)return null}return{name:r,value:q,strValue:q.length===0?"none":q.join(" "),bypass:t}}else if(u.color){var ee=cR(e);return ee?{name:r,value:ee,pfValue:ee,strValue:"rgb("+ee[0]+","+ee[1]+","+ee[2]+")",bypass:t}:null}else if(u.regex||u.regexes){if(u.enums){var le=I();if(le)return le}for(var G=u.regexes?u.regexes:[u.regex],V=0;V<G.length;V++){var j=new RegExp(G[V]),re=j.exec(e);if(re)return{name:r,value:u.singleRegexMatchValue?re[1]:re,strValue:""+e,bypass:t}}return null}else return u.string?{name:r,value:""+e,strValue:""+e,bypass:t}:u.enums?I():null};var st=function(e){if(!(this instanceof st))return new st(e);if(!Im(e)){Lr("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},St=st.prototype;St.instanceString=function(){return"style"};St.clear=function(){for(var r=this._private,e=r.cy,t=e.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};St.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};St.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};St.selector=function(r){var e=r==="core"?null:new Pa(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};St.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],n=0;n<r.properties.length;n++){var a=r.properties[n],i=t[a.name];i===void 0&&(i=t[ll(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};St.style=St.css;St.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);var a=!this[n].selector;a&&(this._private.coreStyle[t.name]=t)}return this};St.append=function(r){return uR(r)?r.appendToStyle(this):Sr(r)?this.appendFromJson(r):Ke(r)&&this.appendFromString(r),this};st.fromJson=function(r,e){var t=new st(r);return t.fromJson(e),t};st.fromString=function(r,e){return new st(r).fromString(e)};[ut,xs,Km,kn,El,jm,jr,Cl].forEach(function(r){Ye(St,r)});st.types=St.types;st.properties=St.properties;st.propertyGroups=St.propertyGroups;st.propertyGroupNames=St.propertyGroupNames;st.propertyGroupKeys=St.propertyGroupKeys;var Uz={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return uR(e)?t.style=e.generateStyle(this):Sr(e)?t.style=st.fromJson(this,e):Ke(e)?t.style=st.fromString(this,e):t.style=st(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Hz="single",li={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=Hz),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,a,i,o,s;switch(e.length){case 0:return t;case 1:if(Ke(e[0]))return n=e[0],t[n];if(pr(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,ke(o)&&(t.x=o),ke(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&ke(a)&&(t[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,a=this._private.pan,i,o,s,l,u;if(!this._private.panningEnabled)return this;switch(n.length){case 1:pr(e)&&(s=n[0],l=s.x,u=s.y,ke(l)&&(a.x+=l),ke(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&ke(o)&&(a[i]+=o),this.emit("pan viewport");break}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){if(ke(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ke(e)){var a=e;e=this.$(a)}else if(Mq(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Zt(e)||(e=this.mutableElements());if(!(Zt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),s=this.height(),l;if(t=ke(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){l=Math.min((o-2*t)/n.w,(s-2*t)/n.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l<this._private.minZoom?this._private.minZoom:l;var u={x:(o-l*(n.x1+n.x2))/2,y:(s-l*(n.y1+n.y2))/2};return{zoom:l,pan:u}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var a=e;e=a.min,t=a.max}return ke(e)&&ke(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):ke(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:ke(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,a=t.zoom,i,o,s=!1;if(t.zoomingEnabled||(s=!0),ke(e)?o=e:pr(e)&&(o=e.level,e.position!=null?i=dl(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(s=!0)),o=o>t.maxZoom?t.maxZoom:o,o=o<t.minZoom?t.minZoom:o,s||!ke(o)||o===a||i!=null&&(!ke(i.x)||!ke(i.y)))return null;if(i!=null){var l=n,u=a,c=o,d={x:-c/u*(i.x-l.x)+i.x,y:-c/u*(i.y-l.y)+i.y};return{zoomed:!0,panned:!0,zoom:c,pan:d}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(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)},viewport:function(e){var t=this._private,n=!0,a=!0,i=[],o=!1,s=!1;if(!e)return this;if(ke(e.zoom)||(n=!1),pr(e.pan)||(a=!1),!n&&!a)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=l,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;ke(u.x)&&(t.pan.x=u.x,s=!1),ke(u.y)&&(t.pan.y=u.y,s=!1),s||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(Ke(e)){var n=e;e=this.mutableElements().filter(n)}else Zt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();t=t===void 0?this._private.zoom:t;var s={x:(i-t*(a.x1+a.x2))/2,y:(o-t*(a.y1+a.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?(function(){var a=n.window().getComputedStyle(t),i=function(s){return parseFloat(a.getPropertyValue(s))};return{width:t.clientWidth-i("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){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};li.centre=li.center;li.autolockNodes=li.autolock;li.autoungrabifyNodes=li.autoungrabify;var ss={data:xr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:xr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:xr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:xr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ss.attr=ss.data;ss.removeAttr=ss.removeData;var us=function(e){var t=this;e=Ye({},e);var n=e.container;n&&!Ku(n)&&Ku(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=t;var o=et!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=Ye({name:o?"grid":"null"},s.layout),s.renderer=Ye({name:o?"canvas":"null"},s.renderer);var l=function(p,E,m){return E!==void 0?E:m!==void 0?m:p},u=this._private={container:n,ready:!1,options:s,elements:new pt(this),listeners:[],aniEles:new pt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:ke(s.zoom)?s.zoom:1,pan:{x:pr(s.pan)&&ke(s.pan.x)?s.pan.x:0,y:pr(s.pan)&&ke(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var c=function(p,E){var m=p.some(Lq);if(m)return oo.all(p).then(E);E(p)};u.styleEnabled&&t.setStyle([]);var d=Ye({},s,s.renderer);t.initRenderer(d);var h=function(p,E,m){t.notifications(!1);var b=t.mutableElements();b.length>0&&b.remove(),p!=null&&(pr(p)||Sr(p))&&t.add(p),t.one("layoutready",function(x){t.notifications(!0),t.emit(x),t.one("load",E),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",m),t.emit("done")});var w=Ye({},t._private.options.layout);w.eles=t.elements(),t.layout(w).run()};c([s.style,s.elements],function(g){var p=g[0],E=g[1];u.styleEnabled&&t.style().append(p),h(E,function(){t.startAnimationLoop(),u.ready=!0,Fr(s.ready)&&t.on("ready",s.ready);for(var m=0;m<i.length;m++){var b=i[m];t.on("ready",b)}a&&(a.readies=[]),t.emit("ready")},s.done)})},el=us.prototype;Ye(el,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return et;var t=this._private.container.ownerDocument;return t===void 0||t==null?et:t.defaultView||et},mount:function(e){if(e!=null){var t=this,n=t._private,a=n.options;return!Ku(e)&&Ku(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Ye({},a,a.renderer,{name:a.renderer.name==="null"?"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 Bn(this._private.options)},json:function(e){var t=this,n=t._private,a=t.mutableElements(),i=function(C){return t.getElementById(C.id())};if(pr(e)){if(t.startBatch(),e.elements){var o={},s=function(C,T){for(var S=[],_=[],A=0;A<C.length;A++){var P=C[A];if(!P.data.id){Er("cy.json() cannot handle elements without an ID attribute");continue}var D=""+P.data.id,I=t.getElementById(D);o[D]=!0,I.length!==0?_.push({ele:I,json:P}):(T&&(P.group=T),S.push(P))}t.add(S);for(var M=0;M<_.length;M++){var k=_[M],N=k.ele,z=k.json;N.json(z)}};if(Sr(e.elements))s(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];Sr(d)&&s(d,c)}var h=t.collection();a.filter(function(x){return!o[x.id()]}).forEach(function(x){x.isParent()?h.merge(x):x.remove()}),h.forEach(function(x){return x.children().move({parent:null})}),h.forEach(function(x){return i(x).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var g=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<g.length;p++){var E=g[p];e[E]!=null&&t[E](e[E])}return t.endBatch(),this}else{var m=!!e,b={};m?b.elements=this.elements().map(function(x){return x.json()}):(b.elements={},a.forEach(function(x){var C=x.group();b.elements[C]||(b.elements[C]=[]),b.elements[C].push(x.json())})),this._private.styleEnabled&&(b.style=t.style().json()),b.data=Bn(t.data());var w=n.options;return b.zoomingEnabled=n.zoomingEnabled,b.userZoomingEnabled=n.userZoomingEnabled,b.zoom=n.zoom,b.minZoom=n.minZoom,b.maxZoom=n.maxZoom,b.panningEnabled=n.panningEnabled,b.userPanningEnabled=n.userPanningEnabled,b.pan=Bn(n.pan),b.boxSelectionEnabled=n.boxSelectionEnabled,b.renderer=Bn(w.renderer),b.hideEdgesOnViewport=w.hideEdgesOnViewport,b.textureOnViewport=w.textureOnViewport,b.wheelSensitivity=w.wheelSensitivity,b.motionBlur=w.motionBlur,b.multiClickDebounceTime=w.multiClickDebounceTime,b}}});el.$id=el.getElementById;[Lz,zz,uA,mm,Nu,Vz,bm,Fu,Uz,li,ss].forEach(function(r){Ye(el,r)});var Kz={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}},jz={maximal:!1,acyclic:!1},zi=function(e){return e.scratch("breadthfirst")},Gx=function(e,t){return e.scratch("breadthfirst",t)};function lA(r){this.options=Ye({},Kz,jz,r)}lA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(we){return we.isChildless()}),a=t,i=r.directed,o=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,l=Bt(s?r.boundingBox:structuredClone(e.extent())),u;if(Zt(r.roots))u=r.roots;else if(Sr(r.roots)){for(var c=[],d=0;d<r.roots.length;d++){var h=r.roots[d],g=e.getElementById(h);c.push(g)}u=e.collection(c)}else if(Ke(r.roots))u=e.$(r.roots);else if(i)u=n.roots();else{var p=t.components();u=e.collection();for(var E=function(){var ge=p[m],me=ge.maxDegree(!1),Re=ge.filter(function(Ie){return Ie.degree(!1)===me});u=u.add(Re)},m=0;m<p.length;m++)E()}var b=[],w={},x=function(ge,me){b[me]==null&&(b[me]=[]);var Re=b[me].length;b[me].push(ge),Gx(ge,{index:Re,depth:me})},C=function(ge,me){var Re=zi(ge),Ie=Re.depth,Be=Re.index;b[Ie][Be]=null,ge.isChildless()&&x(ge,me)};a.bfs({roots:u,directed:r.directed,visit:function(ge,me,Re,Ie,Be){var Oe=ge[0],He=Oe.id();Oe.isChildless()&&x(Oe,Be),w[He]=!0}});for(var T=[],S=0;S<n.length;S++){var _=n[S];w[_.id()]||T.push(_)}var A=function(ge){for(var me=b[ge],Re=0;Re<me.length;Re++){var Ie=me[Re];if(Ie==null){me.splice(Re,1),Re--;continue}Gx(Ie,{depth:ge,index:Re})}},P=function(ge,me){for(var Re=zi(ge),Ie=ge.incomers().filter(function($e){return $e.isNode()&&t.has($e)}),Be=-1,Oe=ge.id(),He=0;He<Ie.length;He++){var Ve=Ie[He],Xe=zi(Ve);Be=Math.max(Be,Xe.depth)}if(Re.depth<=Be){if(!r.acyclic&&me[Oe])return null;var er=Be+1;return C(ge,er),me[Oe]=er,!0}return!1};if(i&&o){var D=[],I={},M=function(ge){return D.push(ge)},k=function(){return D.shift()};for(n.forEach(function(we){return D.push(we)});D.length>0;){var N=k(),z=P(N,I);if(z)N.outgoers().filter(function(we){return we.isNode()&&t.has(we)}).forEach(M);else if(z===null){Er("Detected double maximal shift for node `"+N.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var W=0;if(r.avoidOverlap)for(var q=0;q<n.length;q++){var $=n[q],X=$.layoutDimensions(r),Y=X.w,K=X.h;W=Math.max(W,Y,K)}var ee={},le=function(ge){if(ee[ge.id()])return ee[ge.id()];for(var me=zi(ge).depth,Re=ge.neighborhood(),Ie=0,Be=0,Oe=0;Oe<Re.length;Oe++){var He=Re[Oe];if(!(He.isEdge()||He.isParent()||!n.has(He))){var Ve=zi(He);if(Ve!=null){var Xe=Ve.index,er=Ve.depth;if(!(Xe==null||er==null)){var $e=b[er].length;er<me&&(Ie+=Xe/$e,Be++)}}}}return Be=Math.max(1,Be),Ie=Ie/Be,Be===0&&(Ie=0),ee[ge.id()]=Ie,Ie},G=function(ge,me){var Re=le(ge),Ie=le(me),Be=Re-Ie;return Be===0?fR(ge.id(),me.id()):Be};r.depthSort!==void 0&&(G=r.depthSort);for(var V=b.length,j=0;j<V;j++)b[j].sort(G),A(j);for(var re=[],ce=0;ce<T.length;ce++)re.push(T[ce]);var se=function(){for(var ge=0;ge<V;ge++)A(ge)};re.length&&(b.unshift(re),V=b.length,se());for(var Z=0,Q=0;Q<V;Q++)Z=Math.max(b[Q].length,Z);var ae={x:l.x1+l.w/2,y:l.y1+l.h/2},ne=n.reduce(function(we,ge){return(function(me){return{w:we.w===-1?me.w:(we.w+me.w)/2,h:we.h===-1?me.h:(we.h+me.h)/2}})(ge.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),de=Math.max(V===1?0:s?(l.h-r.padding*2-ne.h)/(V-1):(l.h-r.padding*2-ne.h)/(V+1),W),Ce=b.reduce(function(we,ge){return Math.max(we,ge.length)},0),ve=function(ge){var me=zi(ge),Re=me.depth,Ie=me.index;if(r.circle){var Be=Math.min(l.w/2/V,l.h/2/V);Be=Math.max(Be,W);var Oe=Be*Re+Be-(V>0&&b[0].length<=3?Be/2:0),He=2*Math.PI/b[Re].length*Ie;return Re===0&&b[0].length===1&&(Oe=1),{x:ae.x+Oe*Math.cos(He),y:ae.y+Oe*Math.sin(He)}}else{var Ve=b[Re].length,Xe=Math.max(Ve===1?0:s?(l.w-r.padding*2-ne.w)/((r.grid?Ce:Ve)-1):(l.w-r.padding*2-ne.w)/((r.grid?Ce:Ve)+1),W),er={x:ae.x+(Ie+1-(Ve+1)/2)*Xe,y:ae.y+(Re+1-(V+1)/2)*de};return er}},U={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(U).indexOf(r.direction)===-1&&Lr("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(U).join(", ")));var fe=function(ge){return fN(ve(ge),l,U[r.direction])};return t.nodes().layoutPositions(this,r,fe),this};var Yz={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function fA(r){this.options=Ye({},Yz,r)}fA.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Bt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),c,d=0,h=0;h<i.length;h++){var g=i[h],p=g.layoutDimensions(e),E=p.w,m=p.h;d=Math.max(d,E,m)}if(ke(e.radius)?c=e.radius:i.length<=1?c=0:c=Math.min(o.h,o.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var b=Math.cos(u)-Math.cos(0),w=Math.sin(u)-Math.sin(0),x=Math.sqrt(d*d/(b*b+w*w));c=Math.max(x,c)}var C=function(S,_){var A=e.startAngle+_*u*(a?1:-1),P=c*Math.cos(A),D=c*Math.sin(A),I={x:s.x+P,y:s.y+D};return I};return n.nodes().layoutPositions(this,e,C),this};var Zz={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cA(r){this.options=Ye({},Zz,r)}cA.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=r.cy,a=e.eles,i=a.nodes().not(":parent"),o=Bt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},l=[],u=0,c=0;c<i.length;c++){var d=i[c],h=void 0;h=e.concentric(d),l.push({value:h,node:d}),d._private.scratch.concentric=h}i.updateStyle();for(var g=0;g<i.length;g++){var p=i[g],E=p.layoutDimensions(e);u=Math.max(u,E.w,E.h)}l.sort(function(de,Ce){return Ce.value-de.value});for(var m=e.levelWidth(i),b=[[]],w=b[0],x=0;x<l.length;x++){var C=l[x];if(w.length>0){var T=Math.abs(w[0].value-C.value);T>=m&&(w=[],b.push(w))}w.push(C)}var S=u+e.minNodeSpacing;if(!e.avoidOverlap){var _=b.length>0&&b[0].length>1,A=Math.min(o.w,o.h)/2-S,P=A/(b.length+_?1:0);S=Math.min(S,P)}for(var D=0,I=0;I<b.length;I++){var M=b[I],k=e.sweep===void 0?2*Math.PI-2*Math.PI/M.length:e.sweep,N=M.dTheta=k/Math.max(1,M.length-1);if(M.length>1&&e.avoidOverlap){var z=Math.cos(N)-Math.cos(0),W=Math.sin(N)-Math.sin(0),q=Math.sqrt(S*S/(z*z+W*W));D=Math.max(q,D)}M.r=D,D+=S}if(e.equidistant){for(var $=0,X=0,Y=0;Y<b.length;Y++){var K=b[Y],ee=K.r-X;$=Math.max($,ee)}X=0;for(var le=0;le<b.length;le++){var G=b[le];le===0&&(X=G.r),G.r=X,X+=$}}for(var V={},j=0;j<b.length;j++)for(var re=b[j],ce=re.dTheta,se=re.r,Z=0;Z<re.length;Z++){var Q=re[Z],ae=e.startAngle+(t?1:-1)*ce*Z,ne={x:s.x+se*Math.cos(ae),y:s.y+se*Math.sin(ae)};V[Q.node.id()]=ne}return a.nodes().layoutPositions(this,e,function(de){var Ce=de.id();return V[Ce]}),this};var kd,Xz={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 _l(r){this.options=Ye({},Xz,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),n=t.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),s=e.some(function(u){return u.data("id")===i}),l=e.some(function(u){return u.data("id")===o});return!s||!l});this.options.eles=this.options.eles.not(n)}_l.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?kd=!0:kd=!1;var n=Qz(e,t,r);kd&&e$(n),r.randomize&&r$(n);var a=Qn(),i=function(){t$(n,e,r),r.fit===!0&&e.fit(r.padding)},o=function(h){return!(t.stopped||h>=r.numIter||(n$(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},s=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var h=r.eles.nodes(),g=vA(n,r,h);h.layoutPositions(t,r,g)}},l=0,u=!0;if(r.animate===!0){var c=function(){for(var h=0;u&&h<r.refresh;)u=o(l),l++,h++;if(!u)Ux(n,r),s();else{var g=Qn();g-a>=r.animationThreshold&&i(),ju(c)}};c()}else{for(;u;)u=o(l),l++;Ux(n,r),s()}return this};_l.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};_l.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Qz=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Bt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],h=0;h<d.length;h++){var g=d[h];u[g.id()]=c}for(var c=0;c<s.nodeSize;c++){var p=i[c],E=p.layoutDimensions(n),m={};m.isLocked=p.locked(),m.id=p.data("id"),m.parentId=p.data("parent"),m.cmptId=u[p.id()],m.children=[],m.positionX=p.position("x"),m.positionY=p.position("y"),m.offsetX=0,m.offsetY=0,m.height=E.w,m.width=E.h,m.maxX=m.positionX+m.width/2,m.minX=m.positionX-m.width/2,m.maxY=m.positionY+m.height/2,m.minY=m.positionY-m.height/2,m.padLeft=parseFloat(p.style("padding")),m.padRight=parseFloat(p.style("padding")),m.padTop=parseFloat(p.style("padding")),m.padBottom=parseFloat(p.style("padding")),m.nodeRepulsion=Fr(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,s.layoutNodes.push(m),s.idToIndex[m.id]=c}for(var b=[],w=0,x=-1,C=[],c=0;c<s.nodeSize;c++){var p=s.layoutNodes[c],T=p.parentId;T!=null?s.layoutNodes[s.idToIndex[T]].children.push(p.id):(b[++x]=p.id,C.push(p.id))}for(s.graphSet.push(C);w<=x;){var S=b[w++],_=s.idToIndex[S],g=s.layoutNodes[_],A=g.children;if(A.length>0){s.graphSet.push(A);for(var c=0;c<A.length;c++)b[++x]=A[c]}}for(var c=0;c<s.graphSet.length;c++)for(var P=s.graphSet[c],h=0;h<P.length;h++){var D=s.idToIndex[P[h]];s.indexToGraph[D]=c}for(var c=0;c<s.edgeSize;c++){var I=a[c],M={};M.id=I.data("id"),M.sourceId=I.data("source"),M.targetId=I.data("target");var k=Fr(n.idealEdgeLength)?n.idealEdgeLength(I):n.idealEdgeLength,N=Fr(n.edgeElasticity)?n.edgeElasticity(I):n.edgeElasticity,z=s.idToIndex[M.sourceId],W=s.idToIndex[M.targetId],q=s.indexToGraph[z],$=s.indexToGraph[W];if(q!=$){for(var X=Jz(M.sourceId,M.targetId,s),Y=s.graphSet[X],K=0,m=s.layoutNodes[z];Y.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],K++;for(m=s.layoutNodes[W];Y.indexOf(m.id)===-1;)m=s.layoutNodes[s.idToIndex[m.parentId]],K++;k*=K*n.nestingFactor}M.idealLength=k,M.elasticity=N,s.layoutEdges.push(M)}return s},Jz=function(e,t,n){var a=dA(e,t,0,n);return 2>a.count?0:a.graph},dA=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 o=0,s=0;s<i.length;s++){var l=i[s],u=a.idToIndex[l],c=a.layoutNodes[u].children;if(c.length!==0){var d=a.indexToGraph[a.idToIndex[c[0]]],h=dA(e,t,d,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},e$,r$=function(e,t){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},vA=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(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var l=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var u=i.w===0?.5:(l.positionX-i.x1)/i.w,c=i.h===0?.5:(l.positionY-i.y1)/i.h;return{x:a.x1+u*a.w,y:a.y1+c*a.h}}else return{x:l.positionX,y:l.positionY}}},t$=function(e,t,n){var a=n.layout,i=n.eles.nodes(),o=vA(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},n$=function(e,t,n){a$(e,t),s$(e),u$(e,t),l$(e),f$(e)},a$=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[a[o]]],l=o+1;l<i;l++){var u=e.layoutNodes[e.idToIndex[a[l]]];i$(s,u,e,t)}},Wx=function(e){return-1+2*e*Math.random()},i$=function(e,t,n,a){var i=e.cmptId,o=t.cmptId;if(!(i!==o&&!n.isCompound)){var s=t.positionX-e.positionX,l=t.positionY-e.positionY,u=1;s===0&&l===0&&(s=Wx(u),l=Wx(u));var c=o$(e,t,s,l);if(c>0)var d=a.nodeOverlap*c,h=Math.sqrt(s*s+l*l),g=d*s/h,p=d*l/h;else var E=rl(e,s,l),m=rl(t,-1*s,-1*l),b=m.x-E.x,w=m.y-E.y,x=b*b+w*w,h=Math.sqrt(x),d=(e.nodeRepulsion+t.nodeRepulsion)/x,g=d*b/h,p=d*w/h;e.isLocked||(e.offsetX-=g,e.offsetY-=p),t.isLocked||(t.offsetX+=g,t.offsetY+=p)}},o$=function(e,t,n,a){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(a>0)var o=e.maxY-t.minY;else var o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},rl=function(e,t,n){var a=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,l=n/t,u=o/s,c={};return t===0&&0<n||t===0&&0>n?(c.x=a,c.y=i+o/2,c):0<t&&-1*u<=l&&l<=u?(c.x=a+s/2,c.y=i+s*n/2/t,c):0>t&&-1*u<=l&&l<=u?(c.x=a-s/2,c.y=i-s*n/2/t,c):0<n&&(l<=-1*u||l>=u)?(c.x=a+o*t/2/n,c.y=i+o/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=a-o*t/2/n,c.y=i-o/2),c)},s$=function(e,t){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],s=e.idToIndex[a.targetId],l=e.layoutNodes[s],u=l.positionX-o.positionX,c=l.positionY-o.positionY;if(!(u===0&&c===0)){var d=rl(o,u,c),h=rl(l,-1*u,-1*c),g=h.x-d.x,p=h.y-d.y,E=Math.sqrt(g*g+p*p),m=Math.pow(a.idealLength-E,2)/a.elasticity;if(E!==0)var b=m*g/E,w=m*p/E;else var b=0,w=0;o.isLocked||(o.offsetX+=b,o.offsetY+=w),l.isLocked||(l.offsetX-=b,l.offsetY-=w)}}},u$=function(e,t){if(t.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var s=e.clientHeight/2,l=e.clientWidth/2;else var u=e.layoutNodes[e.idToIndex[i[0]]],c=e.layoutNodes[e.idToIndex[u.parentId]],s=c.positionX,l=c.positionY;for(var d=0;d<o;d++){var h=e.layoutNodes[e.idToIndex[i[d]]];if(!h.isLocked){var g=s-h.positionX,p=l-h.positionY,E=Math.sqrt(g*g+p*p);if(E>n){var m=t.gravity*g/E,b=t.gravity*p/E;h.offsetX+=m,h.offsetY+=b}}}}},l$=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 o=n[a++],s=e.idToIndex[o],l=e.layoutNodes[s],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,h=0;h<u.length;h++){var g=e.layoutNodes[e.idToIndex[u[h]]];g.offsetX+=c,g.offsetY+=d,n[++i]=u[h]}l.offsetX=0,l.offsetY=0}}},f$=function(e,t){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=c$(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,hA(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},c$=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 var i={x:e,y:t};return i},hA=function(e,t){var n=e.parentId;if(n!=null){var a=t.layoutNodes[t.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return hA(a,t)}},Ux=function(e,t){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],s=o.cmptId,l=a[s]=a[s]||[];l.push(o)}for(var u=0,i=0;i<a.length;i++){var c=a[i];if(c){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 h=c[d];c.x1=Math.min(c.x1,h.positionX-h.width/2),c.x2=Math.max(c.x2,h.positionX+h.width/2),c.y1=Math.min(c.y1,h.positionY-h.height/2),c.y2=Math.max(c.y2,h.positionY+h.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}}a.sort(function(w,x){return x.w*x.h-w.w*w.h});for(var g=0,p=0,E=0,m=0,b=Math.sqrt(u)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var c=a[i];if(c){for(var d=0;d<c.length;d++){var h=c[d];h.isLocked||(h.positionX+=g-c.x1,h.positionY+=p-c.y1)}g+=c.w+t.componentSpacing,E+=c.w+t.componentSpacing,m=Math.max(m,c.h),E>b&&(p+=m+t.componentSpacing,g=0,E=0,m=0)}}},d$={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 gA(r){this.options=Ye({},d$,r)}gA.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=Bt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(le){return{x:i.x1,y:i.y1}});else{var o=a.size(),s=Math.sqrt(o*i.h/i.w),l=Math.round(s),u=Math.round(i.w/i.h*s),c=function(G){if(G==null)return Math.min(l,u);var V=Math.min(l,u);V==l?l=G:u=G},d=function(G){if(G==null)return Math.max(l,u);var V=Math.max(l,u);V==l?l=G:u=G},h=e.rows,g=e.cols!=null?e.cols:e.columns;if(h!=null&&g!=null)l=h,u=g;else if(h!=null&&g==null)l=h,u=Math.ceil(o/l);else if(h==null&&g!=null)u=g,l=Math.ceil(o/u);else if(u*l>o){var p=c(),E=d();(p-1)*E>=o?c(p-1):(E-1)*p>=o&&d(E-1)}else for(;u*l<o;){var m=c(),b=d();(b+1)*m>=o?d(b+1):c(m+1)}var w=i.w/u,x=i.h/l;if(e.condense&&(w=0,x=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var T=a[C],S=T._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var _=T.layoutDimensions(e),A=e.avoidOverlapPadding,P=_.w+A,D=_.h+A;w=Math.max(w,P),x=Math.max(x,D)}for(var I={},M=function(G,V){return!!I["c-"+G+"-"+V]},k=function(G,V){I["c-"+G+"-"+V]=!0},N=0,z=0,W=function(){z++,z>=u&&(z=0,N++)},q={},$=0;$<a.length;$++){var X=a[$],Y=e.position(X);if(Y&&(Y.row!==void 0||Y.col!==void 0)){var K={row:Y.row,col:Y.col};if(K.col===void 0)for(K.col=0;M(K.row,K.col);)K.col++;else if(K.row===void 0)for(K.row=0;M(K.row,K.col);)K.row++;q[X.id()]=K,k(K.row,K.col)}}var ee=function(G,V){var j,re;if(G.locked()||G.isParent())return!1;var ce=q[G.id()];if(ce)j=ce.col*w+w/2+i.x1,re=ce.row*x+x/2+i.y1;else{for(;M(N,z);)W();j=z*w+w/2+i.x1,re=N*x+x/2+i.y1,k(N,z),W()}return{x:j,y:re}};a.layoutPositions(this,e,ee)}return this};var v$={ready:function(){},stop:function(){}};function Ym(r){this.options=Ye({},v$,r)}Ym.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,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};Ym.prototype.stop=function(){return this};var h$={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 pA(r){this.options=Ye({},h$,r)}pA.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),n=Fr(r.positions);function a(i){if(r.positions==null)return ON(i.position());if(n)return r.positions(i);var o=r.positions[i._private.data.id];return o??null}return t.layoutPositions(this,r,function(i,o){var s=a(i);return i.locked()||s==null?!1:s}),this};var g$={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 yA(r){this.options=Ye({},g$,r)}yA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=Bt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,s){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return t.nodes().layoutPositions(this,r,a),this};var p$=[{name:"breadthfirst",impl:lA},{name:"circle",impl:fA},{name:"concentric",impl:cA},{name:"cose",impl:_l},{name:"grid",impl:gA},{name:"null",impl:Ym},{name:"preset",impl:pA},{name:"random",impl:yA}];function mA(r){this.options=r,this.notifications=0}var Hx=function(){},Kx=function(){throw new Error("A headless instance can not render images")};mA.prototype={recalculateRenderedStyle:Hx,notify:function(){this.notifications++},init:Hx,isHeadless:function(){return!0},png:Kx,jpg:Kx};var Zm={};Zm.arrowShapeWidth=.3;Zm.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(u,c,d,h,g,p,E){var m=g.x-d/2-E,b=g.x+d/2+E,w=g.y-d/2-E,x=g.y+d/2+E,C=m<=u&&u<=b&&w<=c&&c<=x;return C},n=function(u,c,d,h,g){var p=u*Math.cos(h)-c*Math.sin(h),E=u*Math.sin(h)+c*Math.cos(h),m=p*d,b=E*d,w=m+g.x,x=b+g.y;return{x:w,y:x}},a=function(u,c,d,h){for(var g=[],p=0;p<u.length;p+=2){var E=u[p],m=u[p+1];g.push(n(E,m,c,d,h))}return g},i=function(u){for(var c=[],d=0;d<u.length;d++){var h=u[d];c.push(h.x,h.y)}return c},o=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},s=function(u,c){Ke(c)&&(c=r[c]),r[u]=Ye({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,g,p,E,m,b){var w=i(a(this.points,p+2*b,E,m)),x=zt(h,g,w);return x},roughCollide:t,draw:function(h,g,p,E){var m=a(this.points,g,p,E);e.arrowShapeImpl("polygon")(h,m)},spacing:function(h){return 0},gap:o},c)};s("none",{collide:Yu,roughCollide:Yu,draw:Lm,spacing:sw,gap:sw}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(u,c,d,h,g){var p=a(this.points,c,d,h),E=this.controlPoint,m=n(E[0],E[1],c,d,h);e.arrowShapeImpl(this.name)(u,p,m)},gap:function(u){return o(u)*.8}}),s("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,h,g,p,E){var m=i(a(this.points,d+2*E,h,g)),b=i(a(this.pointsTee,d+2*E,h,g)),w=zt(u,c,m)||zt(u,c,b);return w},draw:function(u,c,d,h,g){var p=a(this.points,c,d,h),E=a(this.pointsTee,c,d,h);e.arrowShapeImpl(this.name)(u,p,E)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,h,g,p,E){var m=g,b=Math.pow(m.x-u,2)+Math.pow(m.y-c,2)<=Math.pow((d+2*E)*this.radius,2),w=i(a(this.points,d+2*E,h,g));return zt(u,c,w)||b},draw:function(u,c,d,h,g){var p=a(this.pointsTr,c,d,h);e.arrowShapeImpl(this.name)(u,p,h.x,h.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,c){var d=this.baseCrossLinePts.slice(),h=c/u,g=3,p=5;return d[g]=d[g]-h,d[p]=d[p]-h,d},collide:function(u,c,d,h,g,p,E){var m=i(a(this.points,d+2*E,h,g)),b=i(a(this.crossLinePts(d,p),d+2*E,h,g)),w=zt(u,c,m)||zt(u,c,b);return w},draw:function(u,c,d,h,g){var p=a(this.points,c,d,h),E=a(this.crossLinePts(c,g),c,d,h);e.arrowShapeImpl(this.name)(u,p,E)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return o(u)*.525}}),s("circle",{radius:.15,collide:function(u,c,d,h,g,p,E){var m=g,b=Math.pow(m.x-u,2)+Math.pow(m.y-c,2)<=Math.pow((d+2*E)*this.radius,2);return b},draw:function(u,c,d,h,g){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),s("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}})};var ci={};ci.projectIntoViewport=function(r,e){var t=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],s=t.pan(),l=t.zoom(),u=((r-a)/o-s.x)/l,c=((e-i)/o-s.y)/l;return[u,c]};ci.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(b){return parseFloat(t.getPropertyValue(b))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=r.clientWidth,s=r.clientHeight,l=a.left+a.right,u=a.top+a.bottom,c=i.left+i.right,d=e.width/(o+c),h=o-l,g=s-u,p=e.left+a.left+i.left,E=e.top+a.top+i.top;return this.containerBB=[p,E,h,g,d]};ci.invalidateContainerClientCoordsCache=function(){this.containerBB=null};ci.findNearestElement=function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]};ci.findNearestElements=function(r,e,t,n){var a=this,i=this,o=i.getCachedZSortedEles(),s=[],l=i.cy.zoom(),u=i.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,h=(n?8:2)/l,g=1/0,p,E;t&&(o=o.interactive);function m(_,A){if(_.isNode()){if(E)return;E=_,s.push(_)}if(_.isEdge()&&(A==null||A<g))if(p){if(p.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value){for(var P=0;P<s.length;P++)if(s[P].isEdge()){s[P]=_,p=_,g=A??g;break}}}else s.push(_),p=_,g=A??g}function b(_){var A=_.outerWidth()+2*d,P=_.outerHeight()+2*d,D=A/2,I=P/2,M=_.position(),k=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,N=_._private.rscratch;if(M.x-D<=r&&r<=M.x+D&&M.y-I<=e&&e<=M.y+I){var z=i.nodeShapes[a.getNodeShape(_)];if(z.checkPoint(r,e,0,A,P,M.x,M.y,k,N))return m(_,0),!0}}function w(_){var A=_._private,P=A.rscratch,D=_.pstyle("width").pfValue,I=_.pstyle("arrow-scale").value,M=D/2+c,k=M*M,N=M*2,$=A.source,X=A.target,z;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var W=P.allpts,q=0;q+3<W.length;q+=2)if(ZN(r,e,W[q],W[q+1],W[q+2],W[q+3],N)&&k>(z=rF(r,e,W[q],W[q+1],W[q+2],W[q+3])))return m(_,z),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(var W=P.allpts,q=0;q+5<P.allpts.length;q+=4)if(XN(r,e,W[q],W[q+1],W[q+2],W[q+3],W[q+4],W[q+5],N)&&k>(z=eF(r,e,W[q],W[q+1],W[q+2],W[q+3],W[q+4],W[q+5])))return m(_,z),!0}for(var $=$||A.source,X=X||A.target,Y=a.getArrowWidth(D,I),K=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}],q=0;q<K.length;q++){var ee=K[q],le=i.arrowShapes[_.pstyle(ee.name+"-arrow-shape").value],G=_.pstyle("width").pfValue;if(le.roughCollide(r,e,Y,ee.angle,{x:ee.x,y:ee.y},G,c)&&le.collide(r,e,Y,ee.angle,{x:ee.x,y:ee.y},G,c))return m(_),!0}u&&s.length>0&&(b($),b(X))}function x(_,A,P){return Ft(_,A,P)}function C(_,A){var P=_._private,D=h,I;A?I=A+"-":I="",_.boundingBox();var M=P.labelBounds[A||"main"],k=_.pstyle(I+"label").value,N=_.pstyle("text-events").strValue==="yes";if(!(!N||!k)){var z=x(P.rscratch,"labelX",A),W=x(P.rscratch,"labelY",A),q=x(P.rscratch,"labelAngle",A),$=_.pstyle(I+"text-margin-x").pfValue,X=_.pstyle(I+"text-margin-y").pfValue,Y=M.x1-D-$,K=M.x2+D-$,ee=M.y1-D-X,le=M.y2+D-X;if(q){var G=Math.cos(q),V=Math.sin(q),j=function(ne,de){return ne=ne-z,de=de-W,{x:ne*G-de*V+z,y:ne*V+de*G+W}},re=j(Y,ee),ce=j(Y,le),se=j(K,ee),Z=j(K,le),Q=[re.x+$,re.y+X,se.x+$,se.y+X,Z.x+$,Z.y+X,ce.x+$,ce.y+X];if(zt(r,e,Q))return m(_),!0}else if(xa(M,r,e))return m(_),!0}}for(var T=o.length-1;T>=0;T--){var S=o[T];S.isNode()?b(S)||C(S):w(S)||C(S)||C(S,"source")||C(S,"target")}return s};ci.getAllInBox=function(r,e,t,n){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],l=Math.min(r,t),u=Math.max(r,t),c=Math.min(e,n),d=Math.max(e,n);r=l,t=u,e=c,n=d;var h=Bt({x1:r,y1:e,x2:t,y2:n}),g=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]],[g[3],g[0]]];function E(ne,de,Ce){return Ft(ne,de,Ce)}function m(ne,de){var Ce=ne._private,ve=o,U="";ne.boundingBox();var fe=Ce.labelBounds.main;if(!fe)return null;var we=E(Ce.rscratch,"labelX",de),ge=E(Ce.rscratch,"labelY",de),me=E(Ce.rscratch,"labelAngle",de),Re=ne.pstyle(U+"text-margin-x").pfValue,Ie=ne.pstyle(U+"text-margin-y").pfValue,Be=fe.x1-ve-Re,Oe=fe.x2+ve-Re,He=fe.y1-ve-Ie,Ve=fe.y2+ve-Ie;if(me){var Xe=Math.cos(me),er=Math.sin(me),$e=function(pe,L){return pe=pe-we,L=L-ge,{x:pe*Xe-L*er+we,y:pe*er+L*Xe+ge}};return[$e(Be,He),$e(Oe,He),$e(Oe,Ve),$e(Be,Ve)]}else return[{x:Be,y:He},{x:Oe,y:He},{x:Oe,y:Ve},{x:Be,y:Ve}]}function b(ne,de,Ce,ve){function U(fe,we,ge){return(ge.y-fe.y)*(we.x-fe.x)>(we.y-fe.y)*(ge.x-fe.x)}return U(ne,Ce,ve)!==U(de,Ce,ve)&&U(ne,de,Ce)!==U(ne,de,ve)}for(var w=0;w<a.length;w++){var x=a[w];if(x.isNode()){var C=x,T=C.pstyle("text-events").strValue==="yes",S=C.pstyle("box-selection").strValue,_=C.pstyle("box-select-labels").strValue==="yes";if(S==="none")continue;var A=(S==="overlap"||_)&&T,P=C.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:A});if(S==="contain"){var D=!1;if(_&&T){var I=m(C);I&&Ic(I,g)&&(s.push(C),D=!0)}!D&&SR(h,P)&&s.push(C)}else if(S==="overlap"&&Fm(h,P)){var M=C.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),k=[{x:M.x1,y:M.y1},{x:M.x2,y:M.y1},{x:M.x2,y:M.y2},{x:M.x1,y:M.y2}];if(Ic(k,g))s.push(C);else{var N=m(C);N&&Ic(N,g)&&s.push(C)}}}else{var z=x,W=z._private,q=W.rscratch,$=z.pstyle("box-selection").strValue;if($==="none")continue;if($==="contain"){if(q.startX!=null&&q.startY!=null&&!xa(h,q.startX,q.startY)||q.endX!=null&&q.endY!=null&&!xa(h,q.endX,q.endY))continue;if(q.edgeType==="bezier"||q.edgeType==="multibezier"||q.edgeType==="self"||q.edgeType==="compound"||q.edgeType==="segments"||q.edgeType==="haystack"){for(var X=W.rstyle.bezierPts||W.rstyle.linePts||W.rstyle.haystackPts,Y=!0,K=0;K<X.length;K++)if(!dw(h,X[K])){Y=!1;break}Y&&s.push(z)}else q.edgeType==="straight"&&s.push(z)}else if($==="overlap"){var ee=!1;if(q.startX!=null&&q.startY!=null&&q.endX!=null&&q.endY!=null&&(xa(h,q.startX,q.startY)||xa(h,q.endX,q.endY)))s.push(z),ee=!0;else if(!ee&&q.edgeType==="haystack"){for(var le=W.rstyle.haystackPts,G=0;G<le.length;G++)if(dw(h,le[G])){s.push(z),ee=!0;break}}if(!ee){var V=W.rstyle.bezierPts||W.rstyle.linePts||W.rstyle.haystackPts;if((!V||V.length<2)&&q.edgeType==="straight"&&q.startX!=null&&q.startY!=null&&q.endX!=null&&q.endY!=null&&(V=[{x:q.startX,y:q.startY},{x:q.endX,y:q.endY}]),!V||V.length<2)continue;for(var j=0;j<V.length-1;j++){for(var re=V[j],ce=V[j+1],se=0;se<p.length;se++){var Z=Yr(p[se],2),Q=Z[0],ae=Z[1];if(b(re,ce,Q,ae)){s.push(z),ee=!0;break}}if(ee)break}}}}}return s};var tl={};tl.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",l,u,c,d,h,g,b,w;if(t?(c=e.haystackPts[0],d=e.haystackPts[1],h=e.haystackPts[2],g=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,h=e.arrowEndX,g=e.arrowEndY),b=e.midX,w=e.midY,i)l=c-e.segpts[0],u=d-e.segpts[1];else if(a||o||s||n){var p=e.allpts,E=ot(p[0],p[2],p[4],.1),m=ot(p[1],p[3],p[5],.1);l=c-E,u=d-m}else l=c-b,u=d-w;e.srcArrowAngle=wu(l,u);var b=e.midX,w=e.midY;if(t&&(b=(c+h)/2,w=(d+g)/2),l=h-c,u=g-d,i){var p=e.allpts;if(p.length/2%2===0){var x=p.length/2,C=x-2;l=p[x]-p[C],u=p[x+1]-p[C+1]}else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var x=p.length/2-1,C=x-2;l=p[x]-p[C],u=p[x+1]-p[C+1]}}else if(a||o||s){var p=e.allpts,T=e.ctrlpts,S,_,A,P;if(T.length/2%2===0){var D=p.length/2-1,I=D+2,M=I+2;S=ot(p[D],p[I],p[M],0),_=ot(p[D+1],p[I+1],p[M+1],0),A=ot(p[D],p[I],p[M],1e-4),P=ot(p[D+1],p[I+1],p[M+1],1e-4)}else{var I=p.length/2-1,D=I-2,M=I+2;S=ot(p[D],p[I],p[M],.4999),_=ot(p[D+1],p[I+1],p[M+1],.4999),A=ot(p[D],p[I],p[M],.5),P=ot(p[D+1],p[I+1],p[M+1],.5)}l=A-S,u=P-_}if(e.midtgtArrowAngle=wu(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var x=p.length/2-1,k=x+2;l=-(p[k]-p[x]),u=-(p[k+1]-p[x+1])}}}if(e.midsrcArrowAngle=wu(l,u),i)l=h-e.segpts[e.segpts.length-2],u=g-e.segpts[e.segpts.length-1];else if(a||o||s||n){var p=e.allpts,N=p.length,E=ot(p[N-6],p[N-4],p[N-2],.9),m=ot(p[N-5],p[N-3],p[N-1],.9);l=h-E,u=g-m}else l=h-b,u=g-w;e.tgtArrowAngle=wu(l,u)};tl.getArrowWidth=tl.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=n,n)};var wm,xm,Dn={},sn={},jx,Yx,ni,zu,jn,Qa,ri,An,$i,Au,bA,wA,Em,Cm,Zx,Xx=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)},y$=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},m$=function(e,t,n,a,i){if(e!==Zx?Xx(t,e,Dn):y$(sn,Dn),Xx(t,n,sn),jx=Dn.nx*sn.ny-Dn.ny*sn.nx,Yx=Dn.nx*sn.nx-Dn.ny*-sn.ny,jn=Math.asin(Math.max(-1,Math.min(1,jx))),Math.abs(jn)<1e-6){wm=t.x,xm=t.y,ri=$i=0;return}ni=1,zu=!1,Yx<0?jn<0?jn=Math.PI+jn:(jn=Math.PI-jn,ni=-1,zu=!0):jn>0&&(ni=-1,zu=!0),t.radius!==void 0?$i=t.radius:$i=a,Qa=jn/2,Au=Math.min(Dn.len/2,sn.len/2),i?(An=Math.abs(Math.cos(Qa)*$i/Math.sin(Qa)),An>Au?(An=Au,ri=Math.abs(An*Math.sin(Qa)/Math.cos(Qa))):ri=$i):(An=Math.min(Au,$i),ri=Math.abs(An*Math.sin(Qa)/Math.cos(Qa))),Em=t.x+sn.nx*An,Cm=t.y+sn.ny*An,wm=Em-sn.ny*ri*ni,xm=Cm+sn.nx*ri*ni,bA=t.x+Dn.nx*An,wA=t.y+Dn.ny*An,Zx=t};function xA(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function Xm(r,e,t,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(m$(r,e,t,n,a),{cx:wm,cy:xm,radius:ri,startX:bA,startY:wA,stopX:Em,stopY:Cm,startAngle:Dn.ang+Math.PI/2*ni,endAngle:sn.ang-Math.PI/2*ni,counterClockwise:zu})}var ls=.01,b$=Math.sqrt(2*ls),Tt={};Tt.findMidptPtsEtc=function(r,e){var t=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),l=o.units!=null&&s.units!=null,u=function(T,S,_,A){var P=A-S,D=_-T,I=Math.sqrt(D*D+P*P);return{x:-P/I,y:D/I}},c=r.pstyle("edge-distances").value;switch(c){case"node-position":i=t;break;case"intersection":i=n;break;case"endpoints":{if(l){var d=this.manualEndptToPx(r.source()[0],o),h=Yr(d,2),g=h[0],p=h[1],E=this.manualEndptToPx(r.target()[0],s),m=Yr(E,2),b=m[0],w=m[1],x={x1:g,y1:p,x2:b,y2:w};a=u(g,p,b,w),i=x}else Er("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;break}}return{midptPts:i,vectorNormInverse:a}};Tt.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=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,s=n.target,l=o.position(),u=s.position(),c=o.width(),d=s.width(),h=o.height(),g=s.height(),p=t.pstyle("haystack-radius").value,E=p/2;a.haystackPts=a.allpts=[a.source.x*c*E+l.x,a.source.y*h*E+l.y,a.target.x*d*E+u.x,a.target.y*g*E+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)}};Tt.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),a=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),o=r.pstyle("radius-type"),s=Math.min(n.pfValue.length,a.pfValue.length),l=i.pfValue[i.pfValue.length-1],u=o.pfValue[o.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var c=0;c<s;c++){var d=n.pfValue[c],h=a.pfValue[c],g=1-d,p=d,E=this.findMidptPtsEtc(r,e),m=E.midptPts,b=E.vectorNormInverse,w={x:m.x1*g+m.x2*p,y:m.y1*g+m.y2*p};t.segpts.push(w.x+b.x*h,w.y+b.y*h),t.radii.push(i.pfValue[c]!==void 0?i.pfValue[c]:l),t.isArcRadius.push((o.pfValue[c]!==void 0?o.pfValue[c]:u)==="arc-radius")}};Tt.findLoopPoints=function(r,e,t,n){var a=r._private.rscratch,i=e.dirCounts,o=e.srcPos,s=r.pstyle("control-point-distances"),l=s?s.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 h=t,g=d;n&&(h=0,g=l);var p=u-Math.PI/2,E=p-c/2,m=p+c/2,b=u+"_"+c;h=i[b]===void 0?i[b]=0:++i[b],a.ctrlpts=[o.x+Math.cos(E)*1.4*g*(h/3+1),o.y+Math.sin(E)*1.4*g*(h/3+1),o.x+Math.cos(m)*1.4*g*(h/3+1),o.y+Math.sin(m)*1.4*g*(h/3+1)]};Tt.findCompoundLoopPoints=function(r,e,t,n){var a=r._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,h=r.pstyle("control-point-distances"),g=h?h.pfValue[0]:void 0,p=t,E=d;n&&(p=0,E=g);var m=50,b={x:i.x-s/2,y:i.y-l/2},w={x:o.x-u/2,y:o.y-c/2},x={x:Math.min(b.x,w.x),y:Math.min(b.y,w.y)},C=.5,T=Math.max(C,Math.log(s*ls)),S=Math.max(C,Math.log(u*ls));a.ctrlpts=[x.x,x.y-(1+Math.pow(m,1.12)/100)*E*(p/3+1)*T,x.x-(1+Math.pow(m,1.12)/100)*E*(p/3+1)*S,x.y]};Tt.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};Tt.findBezierPoints=function(r,e,t,n,a){var i=r._private.rscratch,o=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,c=s?s.pfValue[0]:void 0,d=l.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var g=0;g<u;g++){var p=(.5-e.eles.length/2+t)*o*(a?-1:1),E=void 0,m=Nm(p);h&&(c=s?s.pfValue[g]:o,d=l.value[g]),n?E=c:E=c!==void 0?m*c:void 0;var b=E!==void 0?E:p,w=1-d,x=d,C=this.findMidptPtsEtc(r,e),T=C.midptPts,S=C.vectorNormInverse,_={x:T.x1*w+T.x2*x,y:T.y1*w+T.y2*x};i.ctrlpts.push(_.x+S.x*b,_.y+S.y*b)}};Tt.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",s="downward",l="upward",u="auto",c=e.posPts,d=e.srcW,h=e.srcH,g=e.tgtW,p=e.tgtH,E=r.pstyle("edge-distances").value,m=E!=="node-position",b=r.pstyle("taxi-direction").value,w=b,x=r.pstyle("taxi-turn"),C=x.units==="%",T=x.pfValue,S=T<0,_=r.pstyle("taxi-turn-min-distance").pfValue,A=m?(d+g)/2:0,P=m?(h+p)/2:0,D=c.x2-c.x1,I=c.y2-c.y1,M=function(L,oe){return L>0?Math.max(L-oe,0):Math.min(L+oe,0)},k=M(D,A),N=M(I,P),z=!1;w===u?b=Math.abs(k)>Math.abs(N)?a:n:w===l||w===s?(b=n,z=!0):(w===i||w===o)&&(b=a,z=!0);var W=b===n,q=W?N:k,$=W?I:D,X=Nm($),Y=!1;!(z&&(C||S))&&(w===s&&$<0||w===l&&$>0||w===i&&$>0||w===o&&$<0)&&(X*=-1,q=X*Math.abs(q),Y=!0);var K;if(C){var ee=T<0?1+T:T;K=ee*q}else{var le=T<0?q:0;K=le+T*X}var G=function(L){return Math.abs(L)<_||Math.abs(L)>=Math.abs(q)},V=G(K),j=G(Math.abs(q)-Math.abs(K)),re=V||j;if(re&&!Y)if(W){var ce=Math.abs($)<=h/2,se=Math.abs(D)<=g/2;if(ce){var Z=(c.x1+c.x2)/2,Q=c.y1,ae=c.y2;t.segpts=[Z,Q,Z,ae]}else if(se){var ne=(c.y1+c.y2)/2,de=c.x1,Ce=c.x2;t.segpts=[de,ne,Ce,ne]}else t.segpts=[c.x1,c.y2]}else{var ve=Math.abs($)<=d/2,U=Math.abs(I)<=p/2;if(ve){var fe=(c.y1+c.y2)/2,we=c.x1,ge=c.x2;t.segpts=[we,fe,ge,fe]}else if(U){var me=(c.x1+c.x2)/2,Re=c.y1,Ie=c.y2;t.segpts=[me,Re,me,Ie]}else t.segpts=[c.x2,c.y1]}else if(W){var Be=c.y1+K+(m?h/2*X:0),Oe=c.x1,He=c.x2;t.segpts=[Oe,Be,He,Be]}else{var Ve=c.x1+K+(m?d/2*X:0),Xe=c.y1,er=c.y2;t.segpts=[Ve,Xe,Ve,er]}if(t.isRound){var $e=r.pstyle("taxi-radius").value,Me=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill($e),t.isArcRadius=new Array(t.segpts.length/2).fill(Me)}};Tt.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,h=e.tgtCornerRadius,g=e.srcRs,p=e.tgtRs,E=!ke(t.startX)||!ke(t.startY),m=!ke(t.arrowStartX)||!ke(t.arrowStartY),b=!ke(t.endX)||!ke(t.endY),w=!ke(t.arrowEndX)||!ke(t.arrowEndY),x=3,C=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=x*C,S=si({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),_=S<T,A=si({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),P=A<T,D=!1;if(E||m||_){D=!0;var I={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},M=Math.sqrt(I.x*I.x+I.y*I.y),k={x:I.x/M,y:I.y/M},N=Math.max(i,o),z={x:t.ctrlpts[0]+k.x*2*N,y:t.ctrlpts[1]+k.y*2*N},W=u.intersectLine(n.x,n.y,i,o,z.x,z.y,0,d,g);_?(t.ctrlpts[0]=t.ctrlpts[0]+k.x*(T-S),t.ctrlpts[1]=t.ctrlpts[1]+k.y*(T-S)):(t.ctrlpts[0]=W[0]+k.x*T,t.ctrlpts[1]=W[1]+k.y*T)}if(b||w||P){D=!0;var q={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},$=Math.sqrt(q.x*q.x+q.y*q.y),X={x:q.x/$,y:q.y/$},Y=Math.max(i,o),K={x:t.ctrlpts[0]+X.x*2*Y,y:t.ctrlpts[1]+X.y*2*Y},ee=c.intersectLine(a.x,a.y,s,l,K.x,K.y,0,h,p);P?(t.ctrlpts[0]=t.ctrlpts[0]+X.x*(T-A),t.ctrlpts[1]=t.ctrlpts[1]+X.y*(T-A)):(t.ctrlpts[0]=ee[0]+X.x*T,t.ctrlpts[1]=ee[1]+X.y*T)}D&&this.findEndpoints(r)}};Tt.storeAllpts=function(r){var e=r._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var 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);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=ot(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=ot(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(Xm({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}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)e.midX=e.segpts[c],e.midY=e.segpts[c+1];else{var d={x:e.segpts[c],y:e.segpts[c+1]},h=e.roundCorners[c/2];if(h.radius===0){var g={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-g.y,g.x-d.x]}else{var p=[d.x-h.cx,d.y-h.cy],E=h.radius/Math.sqrt(Math.pow(p[0],2)+Math.pow(p[1],2));p=p.map(function(m){return m*E}),e.midX=h.cx+p[0],e.midY=h.cy+p[1],e.midVector=p}}}}};Tt.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||ke(e.startX)&&ke(e.startY)&&ke(e.endX)&&ke(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Er("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."))};Tt.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,n=t.cy,a=n.hasCompoundNodes(),i=new Xn,o=function(P,D){return[].concat(Hu(P),[D?1:0]).join("-")},s=[],l=[],u=0;u<r.length;u++){var c=r[u],d=c._private,h=c.pstyle("curve-style").value;if(!(c.removed()||!c.takesUpSpace())){if(h==="haystack"){l.push(c);continue}var g=h==="unbundled-bezier"||wa(h,"segments")||h==="straight"||h==="straight-triangle"||wa(h,"taxi"),p=h==="unbundled-bezier"||h==="bezier",E=d.source,m=d.target,b=E.poolIndex(),w=m.poolIndex(),x=[b,w].sort(),C=o(x,g),T=i.get(C);T==null&&(T={eles:[]},s.push({pairId:x,edgeIsUnbundled:g}),i.set(C,T)),T.eles.push(c),g&&(T.hasUnbundled=!0),p&&(T.hasBezier=!0)}}for(var S=function(){var P=s[_],D=P.pairId,I=P.edgeIsUnbundled,M=o(D,I),k=i.get(M),N;if(!k.hasUnbundled){var z=k.eles[0].parallelEdges().filter(function(Me){return Me.isBundledBezier()});Om(k.eles),z.forEach(function(Me){return k.eles.push(Me)}),k.eles.sort(function(Me,pe){return Me.poolIndex()-pe.poolIndex()})}var W=k.eles[0],q=W.source(),$=W.target();if(q.poolIndex()>$.poolIndex()){var X=q;q=$,$=X}var Y=k.srcPos=q.position(),K=k.tgtPos=$.position(),ee=k.srcW=q.outerWidth(),le=k.srcH=q.outerHeight(),G=k.tgtW=$.outerWidth(),V=k.tgtH=$.outerHeight(),j=k.srcShape=t.nodeShapes[e.getNodeShape(q)],re=k.tgtShape=t.nodeShapes[e.getNodeShape($)],ce=k.srcCornerRadius=q.pstyle("corner-radius").value==="auto"?"auto":q.pstyle("corner-radius").pfValue,se=k.tgtCornerRadius=$.pstyle("corner-radius").value==="auto"?"auto":$.pstyle("corner-radius").pfValue,Z=k.tgtRs=$._private.rscratch,Q=k.srcRs=q._private.rscratch;k.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ae=0;ae<k.eles.length;ae++){var ne=k.eles[ae],de=ne[0]._private.rscratch,Ce=ne.pstyle("curve-style").value,ve=Ce==="unbundled-bezier"||wa(Ce,"segments")||wa(Ce,"taxi"),U=!q.same(ne.source());if(!k.calculatedIntersection&&q!==$&&(k.hasBezier||k.hasUnbundled)){k.calculatedIntersection=!0;var fe=j.intersectLine(Y.x,Y.y,ee,le,K.x,K.y,0,ce,Q),we=k.srcIntn=fe,ge=re.intersectLine(K.x,K.y,G,V,Y.x,Y.y,0,se,Z),me=k.tgtIntn=ge,Re=k.intersectionPts={x1:fe[0],x2:ge[0],y1:fe[1],y2:ge[1]},Ie=k.posPts={x1:Y.x,x2:K.x,y1:Y.y,y2:K.y},Be=ge[1]-fe[1],Oe=ge[0]-fe[0],He=Math.sqrt(Oe*Oe+Be*Be);ke(He)&&He>=b$||(He=Math.sqrt(Math.max(Oe*Oe,ls)+Math.max(Be*Be,ls)));var Ve=k.vector={x:Oe,y:Be},Xe=k.vectorNorm={x:Ve.x/He,y:Ve.y/He},er={x:-Xe.y,y:Xe.x};k.nodesOverlap=!ke(He)||re.checkPoint(fe[0],fe[1],0,G,V,K.x,K.y,se,Z)||j.checkPoint(ge[0],ge[1],0,ee,le,Y.x,Y.y,ce,Q),k.vectorNormInverse=er,N={nodesOverlap:k.nodesOverlap,dirCounts:k.dirCounts,calculatedIntersection:!0,hasBezier:k.hasBezier,hasUnbundled:k.hasUnbundled,eles:k.eles,srcPos:K,srcRs:Z,tgtPos:Y,tgtRs:Q,srcW:G,srcH:V,tgtW:ee,tgtH:le,srcIntn:me,tgtIntn:we,srcShape:re,tgtShape:j,posPts:{x1:Ie.x2,y1:Ie.y2,x2:Ie.x1,y2:Ie.y1},intersectionPts:{x1:Re.x2,y1:Re.y2,x2:Re.x1,y2:Re.y1},vector:{x:-Ve.x,y:-Ve.y},vectorNorm:{x:-Xe.x,y:-Xe.y},vectorNormInverse:{x:-er.x,y:-er.y}}}var $e=U?N:k;de.nodesOverlap=$e.nodesOverlap,de.srcIntn=$e.srcIntn,de.tgtIntn=$e.tgtIntn,de.isRound=Ce.startsWith("round"),a&&(q.isParent()||q.isChild()||$.isParent()||$.isChild())&&(q.parents().anySame($)||$.parents().anySame(q)||q.same($)&&q.isParent())?e.findCompoundLoopPoints(ne,$e,ae,ve):q===$?e.findLoopPoints(ne,$e,ae,ve):Ce.endsWith("segments")?e.findSegmentsPoints(ne,$e):Ce.endsWith("taxi")?e.findTaxiPoints(ne,$e):Ce==="straight"||!ve&&k.eles.length%2===1&&ae===Math.floor(k.eles.length/2)?e.findStraightEdgePoints(ne):e.findBezierPoints(ne,$e,ae,ve,U),e.findEndpoints(ne),e.tryToCorrectInvalidPoints(ne,$e),e.checkForInvalidEdgeWarning(ne),e.storeAllpts(ne),e.storeEdgeProjections(ne),e.calculateArrowAngles(ne),e.recalculateEdgeLabelProjections(ne),e.calculateLabelAngles(ne)}},_=0;_<s.length;_++)S();this.findHaystackPoints(l)}};function EA(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var n=r[t],a=r[t+1];e.push({x:n,y:a})}return e}}Tt.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return EA(e.segpts)};Tt.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return EA(e.ctrlpts)};Tt.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Es={};Es.manualEndptToPx=function(r,e){var t=this,n=r.position(),a=r.outerWidth(),i=r.outerHeight(),o=r._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*a),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=n.x,s[1]+=n.y,s}else{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 t.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,a,i,c[0],c[1],0,r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,o)}};Es.findEndpoints=function(r){var e,t,n,a,i=this,o,s=r.source()[0],l=r.target()[0],u=s.position(),c=l.position(),d=r.pstyle("target-arrow-shape").value,h=r.pstyle("source-arrow-shape").value,g=r.pstyle("target-distance-from-node").pfValue,p=r.pstyle("source-distance-from-node").pfValue,E=s._private.rscratch,m=l._private.rscratch,b=r.pstyle("curve-style").value,w=r._private.rscratch,x=w.edgeType,C=wa(b,"taxi"),T=x==="self"||x==="compound",S=x==="bezier"||x==="multibezier"||T,_=x!=="bezier",A=x==="straight"||x==="segments",P=x==="segments",D=S||_||A,I=T||C,M=r.pstyle("source-endpoint"),k=I?"outside-to-node":M.value,N=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,z=r.pstyle("target-endpoint"),W=I?"outside-to-node":z.value,q=l.pstyle("corner-radius").value==="auto"?"auto":l.pstyle("corner-radius").pfValue;w.srcManEndpt=M,w.tgtManEndpt=z;var $,X,Y,K,ee=(e=(z==null||(t=z.pfValue)===null||t===void 0?void 0:t.length)===2?z.pfValue:null)!==null&&e!==void 0?e:[0,0],le=(n=(M==null||(a=M.pfValue)===null||a===void 0?void 0:a.length)===2?M.pfValue:null)!==null&&n!==void 0?n:[0,0];if(S){var G=[w.ctrlpts[0],w.ctrlpts[1]],V=_?[w.ctrlpts[w.ctrlpts.length-2],w.ctrlpts[w.ctrlpts.length-1]]:G;$=V,X=G}else if(A){var j=P?w.segpts.slice(0,2):[c.x+ee[0],c.y+ee[1]],re=P?w.segpts.slice(w.segpts.length-2):[u.x+le[0],u.y+le[1]];$=re,X=j}if(W==="inside-to-node")o=[c.x,c.y];else if(z.units)o=this.manualEndptToPx(l,z);else if(W==="outside-to-line")o=w.tgtIntn;else if(W==="outside-to-node"||W==="outside-to-node-or-label"?Y=$:(W==="outside-to-line"||W==="outside-to-line-or-label")&&(Y=[u.x,u.y]),o=i.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),Y[0],Y[1],0,q,m),W==="outside-to-node-or-label"||W==="outside-to-line-or-label"){var ce=l._private.rscratch,se=ce.labelWidth,Z=ce.labelHeight,Q=ce.labelX,ae=ce.labelY,ne=se/2,de=Z/2,Ce=l.pstyle("text-valign").value;Ce==="top"?ae-=de:Ce==="bottom"&&(ae+=de);var ve=l.pstyle("text-halign").value;ve==="left"?Q-=ne:ve==="right"&&(Q+=ne);var U=as(Y[0],Y[1],[Q-ne,ae-de,Q+ne,ae-de,Q+ne,ae+de,Q-ne,ae+de],c.x,c.y);if(U.length>0){var fe=u,we=ei(fe,Hi(o)),ge=ei(fe,Hi(U)),me=we;if(ge<we&&(o=U,me=ge),U.length>2){var Re=ei(fe,{x:U[2],y:U[3]});Re<me&&(o=[U[2],U[3]])}}}var Ie=xu(o,$,i.arrowShapes[d].spacing(r)+g),Be=xu(o,$,i.arrowShapes[d].gap(r)+g);if(w.endX=Be[0],w.endY=Be[1],w.arrowEndX=Ie[0],w.arrowEndY=Ie[1],k==="inside-to-node")o=[u.x,u.y];else if(M.units)o=this.manualEndptToPx(s,M);else if(k==="outside-to-line")o=w.srcIntn;else if(k==="outside-to-node"||k==="outside-to-node-or-label"?K=X:(k==="outside-to-line"||k==="outside-to-line-or-label")&&(K=[c.x,c.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),K[0],K[1],0,N,E),k==="outside-to-node-or-label"||k==="outside-to-line-or-label"){var Oe=s._private.rscratch,He=Oe.labelWidth,Ve=Oe.labelHeight,Xe=Oe.labelX,er=Oe.labelY,$e=He/2,Me=Ve/2,pe=s.pstyle("text-valign").value;pe==="top"?er-=Me:pe==="bottom"&&(er+=Me);var L=s.pstyle("text-halign").value;L==="left"?Xe-=$e:L==="right"&&(Xe+=$e);var oe=as(K[0],K[1],[Xe-$e,er-Me,Xe+$e,er-Me,Xe+$e,er+Me,Xe-$e,er+Me],u.x,u.y);if(oe.length>0){var ye=c,be=ei(ye,Hi(o)),Ee=ei(ye,Hi(oe)),qe=be;if(Ee<be&&(o=[oe[0],oe[1]],qe=Ee),oe.length>2){var Ae=ei(ye,{x:oe[2],y:oe[3]});Ae<qe&&(o=[oe[2],oe[3]])}}}var Ge=xu(o,X,i.arrowShapes[h].spacing(r)+p),Fe=xu(o,X,i.arrowShapes[h].gap(r)+p);w.startX=Fe[0],w.startY=Fe[1],w.arrowStartX=Ge[0],w.arrowStartY=Ge[1],D&&(!ke(w.startX)||!ke(w.startY)||!ke(w.endX)||!ke(w.endY)?w.badLine=!0:w.badLine=!1)};Es.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};Es.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var Qm={};function w$(r,e,t){for(var n=function(u,c,d,h){return ot(u,c,d,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<r.bezierProjPcts.length;o++){var s=r.bezierProjPcts[o];i.push({x:n(t[0],t[2],t[4],s),y:n(t[1],t[3],t[5],s)})}}Qm.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,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<t.allpts.length;a+=4)w$(this,r,t.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<t.allpts.length;a+=2)i.push({x:t.allpts[a],y:t.allpts[a+1]});else if(n==="haystack"){var o=t.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth};Qm.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Ln={};Ln.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!Ta(e)){var t,n,a=r._private,i=r.width(),o=r.height(),s=r.padding(),l=r.position(),u=r.pstyle("text-halign").strValue,c=r.pstyle("text-valign").strValue,d=a.rscratch,h=a.rstyle;switch(u){case"left":t=l.x-i/2-s;break;case"right":t=l.x+i/2+s;break;default:t=l.x}switch(c){case"top":n=l.y-o/2-s;break;case"bottom":n=l.y+o/2+s;break;default:n=l.y}d.labelX=t,d.labelY=n,h.labelX=t,h.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var CA=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},_A=function(e,t){var n=t.x-e.x,a=t.y-e.y;return CA(n,a)},x$=function(e,t,n,a){var i=ns(0,a-.001,1),o=ns(0,a+.001,1),s=Zi(e,t,n,i),l=Zi(e,t,n,o);return _A(s,l)};Ln.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){e={x:n.midX,y:n.midY};var o=function(d,h,g){Zn(t.rscratch,d,h,g),Zn(t.rstyle,d,h,g)};o("labelX",null,e.x),o("labelY",null,e.y);var s=CA(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var l=function(){if(l.cache)return l.cache;for(var d=[],h=0;h+5<n.allpts.length;h+=4){var g={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},E={x:n.allpts[h+4],y:n.allpts[h+5]};d.push({p0:g,p1:p,p2:E,startDist:0,length:0,segments:[]})}var m=t.rstyle.bezierPts,b=a.bezierProjPcts.length;function w(_,A,P,D,I){var M=si(A,P),k=_.segments[_.segments.length-1],N={p0:A,p1:P,t0:D,t1:I,startDist:k?k.startDist+k.length:0,length:M};_.segments.push(N),_.length+=M}for(var x=0;x<d.length;x++){var C=d[x],T=d[x-1];T&&(C.startDist=T.startDist+T.length),w(C,C.p0,m[x*b],0,a.bezierProjPcts[0]);for(var S=0;S<b-1;S++)w(C,m[x*b+S],m[x*b+S+1],a.bezierProjPcts[S],a.bezierProjPcts[S+1]);w(C,m[x*b+b-1],C.p2,a.bezierProjPcts[b-1],1)}return l.cache=d},u=function(d){var h,g=d==="source";if(i[d]){var p=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var E=l(),m,b=0,w=0,x=0;x<E.length;x++){for(var C=E[g?x:E.length-1-x],T=0;T<C.segments.length;T++){var S=C.segments[g?T:C.segments.length-1-T],_=x===E.length-1&&T===C.segments.length-1;if(b=w,w+=S.length,w>=p||_){m={cp:C,segment:S};break}}if(m)break}var A=m.cp,P=m.segment,D=(p-b)/P.length,I=P.t1-P.t0,M=g?P.t0+I*D:P.t1-I*D;M=ns(0,M,1),e=Zi(A.p0,A.p1,A.p2,M),h=x$(A.p0,A.p1,A.p2,M);break}case"straight":case"segments":case"haystack":{for(var k=0,N,z,W,q,$=n.allpts.length,X=0;X+3<$&&(g?(W={x:n.allpts[X],y:n.allpts[X+1]},q={x:n.allpts[X+2],y:n.allpts[X+3]}):(W={x:n.allpts[$-2-X],y:n.allpts[$-1-X]},q={x:n.allpts[$-4-X],y:n.allpts[$-3-X]}),N=si(W,q),z=k,k+=N,!(k>=p));X+=2);var Y=p-z,K=Y/N;K=ns(0,K,1),e=GN(W,q,K),h=_A(W,q);break}}o("labelX",d,e.x),o("labelY",d,e.y),o("labelAutoAngle",d,h)}};u("source"),u("target"),this.applyLabelDimensions(r)}};Ln.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Ln.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=oi(n,r._private.labelDimsKey);if(Ft(t.rscratch,"prefixedLabelDimsKey",e)!==a){Zn(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),o=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,l=Ft(t.rscratch,"labelWrapCachedLines",e)||[],u=s!=="wrap"?1:Math.max(l.length,1),c=i.height/u,d=c*o,h=i.width,g=i.height+(u-1)*(o-1)*c;Zn(t.rstyle,"labelWidth",e,h),Zn(t.rscratch,"labelWidth",e,h),Zn(t.rstyle,"labelHeight",e,g),Zn(t.rscratch,"labelHeight",e,g),Zn(t.rscratch,"labelLineHeight",e,d)}};Ln.getLabelText=function(r,e){var t=r._private,n=e?e+"-":"",a=r.pstyle(n+"label").strValue,i=r.pstyle("text-transform").value,o=function(le,G){return G?(Zn(t.rscratch,le,e,G),G):Ft(t.rscratch,le,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var s=r.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l)return o("labelWrapCachedText");for(var u="",c=a.split(`
|
|
15
|
-
`),d=r.pstyle("text-max-width").pfValue,h=r.pstyle("text-overflow-wrap").value,g=h==="anywhere",p=[],
|
|
16
|
-
`)),o("labelWrapKey",
|
|
17
|
-
`),m=0;m<E.length;m++){var b=E[m],w=d.measureText(b),x=Math.ceil(w.width),C=s;g=Math.max(x,g),p+=C}return g+=i,p+=i,{width:g,height:p}};Ln.calculateLabelAngle=function(r,e){var t=r._private,n=t.rscratch,a=r.isEdge(),i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:a&&s==="autorotate"?n.labelAutoAngle:s==="autorotate"?0:o.pfValue};Ln.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),n=r._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(r),t&&(a.sourceLabelAngle=e.calculateLabelAngle(r,"source"),a.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var SA={},Qx=28,Jx=!1;SA.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Qx||r.height()<Qx))return Jx||(Er("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Jx=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var n=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return t};var Sl={};Sl.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,n=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var l=0;l<o.length;l++){var u=o[l],c=u._private,d=c.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(o){var s=o.target;n(s)}).on("style.* background.*",function(o){var s=o.target;n(s,!1)});var a=function(o){if(o){var s=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(s)for(var d=0;d<s.length;d++){var h=s[d];h(o,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){a(!0)},t.beforeRender(a,t.beforeRenderPriorities.eleCalcs)};Sl.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};Sl.recalculateRenderedStyle=function(r,e){var t=function(C){return C._private.rstyle.cleanConnected};if(r.length!==0){var n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var o=r[i],s=o._private,l=s.rstyle;o.isEdge()&&(!t(o.source())||!t(o.target()))&&(l.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(x){return!x._private.rstyle.clean&&x.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?a.push(o):n.push(o),l.clean=!0)}for(var u=0;u<a.length;u++){var c=a[u],d=c._private,h=d.rstyle,g=c.position();this.recalculateNodeLabelProjection(c),h.nodeX=g.x,h.nodeY=g.y,h.nodeW=c.pstyle("width").pfValue,h.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var E=n[p],m=E._private,b=m.rstyle,w=m.rscratch;b.srcX=w.arrowStartX,b.srcY=w.arrowStartY,b.tgtX=w.arrowEndX,b.tgtY=w.arrowEndY,b.midX=w.midX,b.midY=w.midY,b.labelAngle=w.labelAngle,b.sourceLabelAngle=w.sourceLabelAngle,b.targetLabelAngle=w.targetLabelAngle}}}};var Tl={};Tl.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var n=r[t],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(var t=0;t<e.length;t++){var n=e[t];r.drag.push(n)}}};Tl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};Tl.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(oA),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var TA={};[ci,tl,Tt,Es,Qm,Ln,SA,Sl,Tl].forEach(function(r){Ye(TA,r)});var RA={};RA.getCachedImage=function(r,e,t){var n=this,a=n.imageCache=n.imageCache||{},i=a[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=a[r]=a[r]||{};var o=i.image=new Image;o.addEventListener("load",t),o.addEventListener("error",function(){o.error=!0});var s="data:",l=r.substring(0,s.length).toLowerCase()===s;return l||(e=e==="null"?null:e,o.crossOrigin=e),o.src=r,o};var lo={};lo.registerBinding=function(r,e,t,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],o=0;o<r.length;o++){var s=r[o];if(s!==void 0){var l=this.binder(s);i.push(l.on.apply(l,a))}}return i}var l=this.binder(r);return l.on.apply(l,a)};lo.binder=function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||kq(r);if(e.supportsPassiveEvents==null){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 o=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:o,addEventListener:o,addListener:o,bind:o}};lo.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};lo.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};lo.load=function(){var r=this,e=r.cy.window(),t=function(L){return L.selected()},n=function(L){var oe=L.getRootNode();if(oe&&oe.nodeType===11&&oe.host!==void 0)return oe},a=function(L,oe,ye,be){L==null&&(L=r.cy);for(var Ee=0;Ee<oe.length;Ee++){var qe=oe[Ee];L.emit({originalEvent:ye,type:qe,position:be})}},i=function(L){return L.shiftKey||L.metaKey||L.ctrlKey},o=function(L,oe){var ye=!0;if(r.cy.hasCompoundNodes()&&L&&L.pannable())for(var be=0;oe&&be<oe.length;be++){var L=oe[be];if(L.isNode()&&L.isParent()&&!L.pannable()){ye=!1;break}}else ye=!0;return ye},s=function(L){L[0]._private.grabbed=!0},l=function(L){L[0]._private.grabbed=!1},u=function(L){L[0]._private.rscratch.inDragLayer=!0},c=function(L){L[0]._private.rscratch.inDragLayer=!1},d=function(L){L[0]._private.rscratch.isGrabTarget=!0},h=function(L){L[0]._private.rscratch.isGrabTarget=!1},g=function(L,oe){var ye=oe.addToList,be=ye.has(L);!be&&L.grabbable()&&!L.locked()&&(ye.merge(L),s(L))},p=function(L,oe){if(L.cy().hasCompoundNodes()&&!(oe.inDragLayer==null&&oe.addToList==null)){var ye=L.descendants();oe.inDragLayer&&(ye.forEach(u),ye.connectedEdges().forEach(u)),oe.addToList&&g(ye,oe)}},E=function(L,oe){oe=oe||{};var ye=L.cy().hasCompoundNodes();oe.inDragLayer&&(L.forEach(u),L.neighborhood().stdFilter(function(be){return!ye||be.isEdge()}).forEach(u)),oe.addToList&&L.forEach(function(be){g(be,oe)}),p(L,oe),w(L,{inDragLayer:oe.inDragLayer}),r.updateCachedGrabbedEles()},m=E,b=function(L){L&&(r.getCachedZSortedEles().forEach(function(oe){l(oe),c(oe),h(oe)}),r.updateCachedGrabbedEles())},w=function(L,oe){if(!(oe.inDragLayer==null&&oe.addToList==null)&&L.cy().hasCompoundNodes()){var ye=L.ancestors().orphans();if(!ye.same(L)){var be=ye.descendants().spawnSelf().merge(ye).unmerge(L).unmerge(L.descendants()),Ee=be.connectedEdges();oe.inDragLayer&&(Ee.forEach(u),be.forEach(u)),oe.addToList&&be.forEach(function(qe){g(qe,oe)})}}},x=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},C=typeof MutationObserver<"u",T=typeof ResizeObserver<"u";C?(r.removeObserver=new MutationObserver(function(pe){for(var L=0;L<pe.length;L++){var oe=pe[L],ye=oe.removedNodes;if(ye)for(var be=0;be<ye.length;be++){var Ee=ye[be];if(Ee===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(pe){r.destroy()});var S=ms(function(){r.cy.resize()},100);C&&(r.styleObserver=new MutationObserver(S),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",S),T&&(r.resizeObserver=new ResizeObserver(S),r.resizeObserver.observe(r.container));var _=function(L,oe){for(;L!=null;)oe(L),L=L.parentNode},A=function(){r.invalidateContainerClientCoordsCache()};_(r.container,function(pe){r.registerBinding(pe,"transitionend",A),r.registerBinding(pe,"animationend",A),r.registerBinding(pe,"scroll",A)}),r.registerBinding(r.container,"contextmenu",function(pe){pe.preventDefault()});var P=function(){return r.selection[4]!==0},D=function(L){for(var oe=r.findContainerClientCoords(),ye=oe[0],be=oe[1],Ee=oe[2],qe=oe[3],Ae=L.touches?L.touches:[L],Ge=!1,Fe=0;Fe<Ae.length;Fe++){var je=Ae[Fe];if(ye<=je.clientX&&je.clientX<=ye+Ee&&be<=je.clientY&&je.clientY<=be+qe){Ge=!0;break}}if(!Ge)return!1;for(var or=r.container,nr=L.target,We=nr.parentNode,ur=!1;We;){if(We===or){ur=!0;break}We=We.parentNode}return!!ur};r.registerBinding(r.container,"mousedown",function(L){if(D(L)&&!(r.hoverData.which===1&&L.which!==1)){L.preventDefault(),x(),r.hoverData.capture=!0,r.hoverData.which=L.which;var oe=r.cy,ye=[L.clientX,L.clientY],be=r.projectIntoViewport(ye[0],ye[1]),Ee=r.selection,qe=r.findNearestElements(be[0],be[1],!0,!1),Ae=qe[0],Ge=r.dragData.possibleDragElements;r.hoverData.mdownPos=be,r.hoverData.mdownGPos=ye;var Fe=function(ar){return{originalEvent:L,type:ar,position:{x:be[0],y:be[1]}}},je=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var ar=r.hoverData.down;ar?ar.emit(Fe("taphold")):oe.emit(Fe("taphold"))}},r.tapholdDuration)};if(L.which==3){r.hoverData.cxtStarted=!0;var or={originalEvent:L,type:"cxttapstart",position:{x:be[0],y:be[1]}};Ae?(Ae.activate(),Ae.emit(or),r.hoverData.down=Ae):oe.emit(or),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(L.which==1){Ae&&Ae.activate();{if(Ae!=null&&r.nodeIsGrabbable(Ae)){var nr=function(ar){ar.emit(Fe("grab"))};if(d(Ae),!Ae.selected())Ge=r.dragData.possibleDragElements=oe.collection(),m(Ae,{addToList:Ge}),Ae.emit(Fe("grabon")).emit(Fe("grab"));else{Ge=r.dragData.possibleDragElements=oe.collection();var We=oe.$(function(ur){return ur.isNode()&&ur.selected()&&r.nodeIsGrabbable(ur)});E(We,{addToList:Ge}),Ae.emit(Fe("grabon")),We.forEach(nr)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Ae,r.hoverData.downs=qe,r.hoverData.downTime=new Date().getTime()}a(Ae,["mousedown","tapstart","vmousedown"],L,{x:be[0],y:be[1]}),Ae==null?(Ee[4]=1,r.data.bgActivePosistion={x:be[0],y:be[1]},r.redrawHint("select",!0),r.redraw()):Ae.pannable()&&(Ee[4]=1),je()}Ee[0]=Ee[2]=be[0],Ee[1]=Ee[3]=be[1]}},!1);var I=n(r.container);r.registerBinding([e,I],"mousemove",function(L){var oe=r.hoverData.capture;if(!(!oe&&!D(L))){var ye=!1,be=r.cy,Ee=be.zoom(),qe=[L.clientX,L.clientY],Ae=r.projectIntoViewport(qe[0],qe[1]),Ge=r.hoverData.mdownPos,Fe=r.hoverData.mdownGPos,je=r.selection,or=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(or=r.findNearestElement(Ae[0],Ae[1],!0,!1));var nr=r.hoverData.last,We=r.hoverData.down,ur=[Ae[0]-je[2],Ae[1]-je[3]],ar=r.dragData.possibleDragElements,Gr;if(Fe){var Br=qe[0]-Fe[0],lt=Br*Br,kr=qe[1]-Fe[1],Kr=kr*kr,qr=lt+Kr;r.hoverData.isOverThresholdDrag=Gr=qr>=r.desktopTapThreshold2}var Xr=i(L);Gr&&(r.hoverData.tapholdCancelled=!0);var _n=function(){var Mt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];Mt.length===0?(Mt.push(ur[0]),Mt.push(ur[1])):(Mt[0]+=ur[0],Mt[1]+=ur[1])};ye=!0,a(or,["mousemove","vmousemove","tapdrag"],L,{x:Ae[0],y:Ae[1]});var zr=function(Mt){return{originalEvent:L,type:Mt,position:{x:Ae[0],y:Ae[1]}}},vn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||be.emit(zr("boxstart")),je[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Gr){var hn=zr("cxtdrag");We?We.emit(hn):be.emit(hn),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||or!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(zr("cxtdragout")),r.hoverData.cxtOver=or,or&&or.emit(zr("cxtdragover")))}}else if(r.hoverData.dragging){if(ye=!0,be.panningEnabled()&&be.userPanningEnabled()){var aa;if(r.hoverData.justStartedPan){var yi=r.hoverData.mdownPos;aa={x:(Ae[0]-yi[0])*Ee,y:(Ae[1]-yi[1])*Ee},r.hoverData.justStartedPan=!1}else aa={x:ur[0]*Ee,y:ur[1]*Ee};be.panBy(aa),be.emit(zr("dragpan")),r.hoverData.dragged=!0}Ae=r.projectIntoViewport(L.clientX,L.clientY)}else if(je[4]==1&&(We==null||We.pannable())){if(Gr){if(!r.hoverData.dragging&&be.boxSelectionEnabled()&&(Xr||!be.panningEnabled()||!be.userPanningEnabled()))vn();else if(!r.hoverData.selecting&&be.panningEnabled()&&be.userPanningEnabled()){var Nn=o(We,r.hoverData.downs);Nn&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,je[4]=0,r.data.bgActivePosistion=Hi(Ge),r.redrawHint("select",!0),r.redraw())}We&&We.pannable()&&We.active()&&We.unactivate()}}else{if(We&&We.pannable()&&We.active()&&We.unactivate(),(!We||!We.grabbed())&&or!=nr&&(nr&&a(nr,["mouseout","tapdragout"],L,{x:Ae[0],y:Ae[1]}),or&&a(or,["mouseover","tapdragover"],L,{x:Ae[0],y:Ae[1]}),r.hoverData.last=or),We)if(Gr){if(be.boxSelectionEnabled()&&Xr)We&&We.grabbed()&&(b(ar),We.emit(zr("freeon")),ar.emit(zr("free")),r.dragData.didDrag&&(We.emit(zr("dragfreeon")),ar.emit(zr("dragfree")))),vn();else if(We&&We.grabbed()&&r.nodeIsDraggable(We)){var ft=!r.dragData.didDrag;ft&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||E(ar,{inDragLayer:!0});var at={x:0,y:0};if(ke(ur[0])&&ke(ur[1])&&(at.x+=ur[0],at.y+=ur[1],ft)){var bt=r.hoverData.dragDelta;bt&&ke(bt[0])&&ke(bt[1])&&(at.x+=bt[0],at.y+=bt[1])}r.hoverData.draggingEles=!0,ar.silentShift(at).emit(zr("position")).emit(zr("drag")),r.redrawHint("drag",!0),r.redraw()}}else _n();ye=!0}if(je[2]=Ae[0],je[3]=Ae[1],ye)return L.stopPropagation&&L.stopPropagation(),L.preventDefault&&L.preventDefault(),!1}},!1);var M,k,N;r.registerBinding(e,"mouseup",function(L){if(!(r.hoverData.which===1&&L.which!==1&&r.hoverData.capture)){var oe=r.hoverData.capture;if(oe){r.hoverData.capture=!1;var ye=r.cy,be=r.projectIntoViewport(L.clientX,L.clientY),Ee=r.selection,qe=r.findNearestElement(be[0],be[1],!0,!1),Ae=r.dragData.possibleDragElements,Ge=r.hoverData.down,Fe=i(L);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,Ge&&Ge.unactivate();var je=function(Br){return{originalEvent:L,type:Br,position:{x:be[0],y:be[1]}}};if(r.hoverData.which===3){var or=je("cxttapend");if(Ge?Ge.emit(or):ye.emit(or),!r.hoverData.cxtDragged){var nr=je("cxttap");Ge?Ge.emit(nr):ye.emit(nr)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(a(qe,["mouseup","tapend","vmouseup"],L,{x:be[0],y:be[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(Ge,["click","tap","vclick"],L,{x:be[0],y:be[1]}),k=!1,L.timeStamp-N<=ye.multiClickDebounceTime()?(M&&clearTimeout(M),k=!0,N=null,a(Ge,["dblclick","dbltap","vdblclick"],L,{x:be[0],y:be[1]})):(M=setTimeout(function(){k||a(Ge,["oneclick","onetap","voneclick"],L,{x:be[0],y:be[1]})},ye.multiClickDebounceTime()),N=L.timeStamp)),Ge==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(L)&&(ye.$(t).unselect(["tapunselect"]),Ae.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Ae=ye.collection()),qe==Ge&&!r.dragData.didDrag&&!r.hoverData.selecting&&qe!=null&&qe._private.selectable&&(r.hoverData.dragging||(ye.selectionType()==="additive"||Fe?qe.selected()?qe.unselect(["tapunselect"]):qe.select(["tapselect"]):Fe||(ye.$(t).unmerge(qe).unselect(["tapunselect"]),qe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var We=ye.collection(r.getAllInBox(Ee[0],Ee[1],Ee[2],Ee[3]));r.redrawHint("select",!0),We.length>0&&r.redrawHint("eles",!0),ye.emit(je("boxend"));var ur=function(Br){return Br.selectable()&&!Br.selected()};ye.selectionType()==="additive"||Fe||ye.$(t).unmerge(We).unselect(),We.emit(je("box")).stdFilter(ur).select().emit(je("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!Ee[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var ar=Ge&&Ge.grabbed();b(Ae),ar&&(Ge.emit(je("freeon")),Ae.emit(je("free")),r.dragData.didDrag&&(Ge.emit(je("dragfreeon")),Ae.emit(je("dragfree"))))}}Ee[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 z=[],W=4,q,$=1e5,X=function(L,oe){for(var ye=0;ye<L.length;ye++)if(L[ye]%oe!==0)return!1;return!0},Y=function(L){for(var oe=Math.abs(L[0]),ye=1;ye<L.length;ye++)if(Math.abs(L[ye])!==oe)return!1;return!0},K=function(L){var oe=!1,ye=L.deltaY;if(ye==null&&(L.wheelDeltaY!=null?ye=L.wheelDeltaY/4:L.wheelDelta!=null&&(ye=L.wheelDelta/4)),ye!==0){if(q==null)if(z.length>=W){var be=z;if(q=X(be,5),!q){var Ee=Math.abs(be[0]);q=Y(be)&&Ee>5}if(q)for(var qe=0;qe<be.length;qe++)$=Math.min(Math.abs(be[qe]),$)}else z.push(ye),oe=!0;else q&&($=Math.min(Math.abs(ye),$));if(!r.scrollingPage){var Ae=r.cy,Ge=Ae.zoom(),Fe=Ae.pan(),je=r.projectIntoViewport(L.clientX,L.clientY),or=[je[0]*Ge+Fe.x,je[1]*Ge+Fe.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||P()){L.preventDefault();return}if(Ae.panningEnabled()&&Ae.userPanningEnabled()&&Ae.zoomingEnabled()&&Ae.userZoomingEnabled()){L.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);var nr;oe&&Math.abs(ye)>5&&(ye=Nm(ye)*5),nr=ye/-250,q&&(nr/=$,nr*=3),nr=nr*r.wheelSensitivity;var We=L.deltaMode===1;We&&(nr*=33);var ur=Ae.zoom()*Math.pow(10,nr);L.type==="gesturechange"&&(ur=r.gestureStartZoom*L.scale),Ae.zoom({level:ur,renderedPosition:{x:or[0],y:or[1]}}),Ae.emit({type:L.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:L,position:{x:je[0],y:je[1]}})}}}};r.registerBinding(r.container,"wheel",K,!0),r.registerBinding(e,"scroll",function(L){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(L){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||L.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(pe){r.hasTouchStarted||K(pe)},!0),r.registerBinding(r.container,"mouseout",function(L){var oe=r.projectIntoViewport(L.clientX,L.clientY);r.cy.emit({originalEvent:L,type:"mouseout",position:{x:oe[0],y:oe[1]}})},!1),r.registerBinding(r.container,"mouseover",function(L){var oe=r.projectIntoViewport(L.clientX,L.clientY);r.cy.emit({originalEvent:L,type:"mouseover",position:{x:oe[0],y:oe[1]}})},!1);var ee,le,G,V,j,re,ce,se,Z,Q,ae,ne,de,Ce=function(L,oe,ye,be){return Math.sqrt((ye-L)*(ye-L)+(be-oe)*(be-oe))},ve=function(L,oe,ye,be){return(ye-L)*(ye-L)+(be-oe)*(be-oe)},U;r.registerBinding(r.container,"touchstart",U=function(L){if(r.hasTouchStarted=!0,!!D(L)){x(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var oe=r.cy,ye=r.touchData.now,be=r.touchData.earlier;if(L.touches[0]){var Ee=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);ye[0]=Ee[0],ye[1]=Ee[1]}if(L.touches[1]){var Ee=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);ye[2]=Ee[0],ye[3]=Ee[1]}if(L.touches[2]){var Ee=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);ye[4]=Ee[0],ye[5]=Ee[1]}var qe=function(Xr){return{originalEvent:L,type:Xr,position:{x:ye[0],y:ye[1]}}};if(L.touches[1]){r.touchData.singleTouchMoved=!0,b(r.dragData.touchDragEles);var Ae=r.findContainerClientCoords();Z=Ae[0],Q=Ae[1],ae=Ae[2],ne=Ae[3],ee=L.touches[0].clientX-Z,le=L.touches[0].clientY-Q,G=L.touches[1].clientX-Z,V=L.touches[1].clientY-Q,de=0<=ee&&ee<=ae&&0<=G&&G<=ae&&0<=le&&le<=ne&&0<=V&&V<=ne;var Ge=oe.pan(),Fe=oe.zoom();j=Ce(ee,le,G,V),re=ve(ee,le,G,V),ce=[(ee+G)/2,(le+V)/2],se=[(ce[0]-Ge.x)/Fe,(ce[1]-Ge.y)/Fe];var je=200,or=je*je;if(re<or&&!L.touches[2]){var nr=r.findNearestElement(ye[0],ye[1],!0,!0),We=r.findNearestElement(ye[2],ye[3],!0,!0);nr&&nr.isNode()?(nr.activate().emit(qe("cxttapstart")),r.touchData.start=nr):We&&We.isNode()?(We.activate().emit(qe("cxttapstart")),r.touchData.start=We):oe.emit(qe("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(L.touches[2])oe.boxSelectionEnabled()&&L.preventDefault();else if(!L.touches[1]){if(L.touches[0]){var ur=r.findNearestElements(ye[0],ye[1],!0,!0),ar=ur[0];if(ar!=null&&(ar.activate(),r.touchData.start=ar,r.touchData.starts=ur,r.nodeIsGrabbable(ar))){var Gr=r.dragData.touchDragEles=oe.collection(),Br=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),ar.selected()?(Br=oe.$(function(qr){return qr.selected()&&r.nodeIsGrabbable(qr)}),E(Br,{addToList:Gr})):m(ar,{addToList:Gr}),d(ar),ar.emit(qe("grabon")),Br?Br.forEach(function(qr){qr.emit(qe("grab"))}):ar.emit(qe("grab"))}a(ar,["touchstart","tapstart","vmousedown"],L,{x:ye[0],y:ye[1]}),ar==null&&(r.data.bgActivePosistion={x:Ee[0],y:Ee[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(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],L,{x:ye[0],y:ye[1]})},r.tapholdDuration)}}if(L.touches.length>=1){for(var lt=r.touchData.startPosition=[null,null,null,null,null,null],kr=0;kr<ye.length;kr++)lt[kr]=be[kr]=ye[kr];var Kr=L.touches[0];r.touchData.startGPosition=[Kr.clientX,Kr.clientY]}}},!1);var fe;r.registerBinding(e,"touchmove",fe=function(L){var oe=r.touchData.capture;if(!(!oe&&!D(L))){var ye=r.selection,be=r.cy,Ee=r.touchData.now,qe=r.touchData.earlier,Ae=be.zoom();if(L.touches[0]){var Ge=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ee[0]=Ge[0],Ee[1]=Ge[1]}if(L.touches[1]){var Ge=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Ee[2]=Ge[0],Ee[3]=Ge[1]}if(L.touches[2]){var Ge=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Ee[4]=Ge[0],Ee[5]=Ge[1]}var Fe=function(Ei){return{originalEvent:L,type:Ei,position:{x:Ee[0],y:Ee[1]}}},je=r.touchData.startGPosition,or;if(oe&&L.touches[0]&&je){for(var nr=[],We=0;We<Ee.length;We++)nr[We]=Ee[We]-qe[We];var ur=L.touches[0].clientX-je[0],ar=ur*ur,Gr=L.touches[0].clientY-je[1],Br=Gr*Gr,lt=ar+Br;or=lt>=r.touchTapThreshold2}if(oe&&r.touchData.cxt){L.preventDefault();var kr=L.touches[0].clientX-Z,Kr=L.touches[0].clientY-Q,qr=L.touches[1].clientX-Z,Xr=L.touches[1].clientY-Q,_n=ve(kr,Kr,qr,Xr),zr=_n/re,vn=150,hn=vn*vn,aa=1.5,yi=aa*aa;if(zr>=yi||_n>=hn){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Nn=Fe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(Nn),r.touchData.start=null):be.emit(Nn)}}if(oe&&r.touchData.cxt){var Nn=Fe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Nn):be.emit(Nn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var ft=r.findNearestElement(Ee[0],Ee[1],!0,!0);(!r.touchData.cxtOver||ft!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(Fe("cxtdragout")),r.touchData.cxtOver=ft,ft&&ft.emit(Fe("cxtdragover")))}else if(oe&&L.touches[2]&&be.boxSelectionEnabled())L.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||be.emit(Fe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,ye[4]=1,!ye||ye.length===0||ye[0]===void 0?(ye[0]=(Ee[0]+Ee[2]+Ee[4])/3,ye[1]=(Ee[1]+Ee[3]+Ee[5])/3,ye[2]=(Ee[0]+Ee[2]+Ee[4])/3+1,ye[3]=(Ee[1]+Ee[3]+Ee[5])/3+1):(ye[2]=(Ee[0]+Ee[2]+Ee[4])/3,ye[3]=(Ee[1]+Ee[3]+Ee[5])/3),r.redrawHint("select",!0),r.redraw();else if(oe&&L.touches[1]&&!r.touchData.didSelect&&be.zoomingEnabled()&&be.panningEnabled()&&be.userZoomingEnabled()&&be.userPanningEnabled()){L.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var at=r.dragData.touchDragEles;if(at){r.redrawHint("drag",!0);for(var bt=0;bt<at.length;bt++){var $a=at[bt]._private;$a.grabbed=!1,$a.rscratch.inDragLayer=!1}}var Mt=r.touchData.start,kr=L.touches[0].clientX-Z,Kr=L.touches[0].clientY-Q,qr=L.touches[1].clientX-Z,Xr=L.touches[1].clientY-Q,Ds=Ce(kr,Kr,qr,Xr),Hl=Ds/j;if(de){var mi=kr-ee,Kl=Kr-le,bi=qr-G,jl=Xr-V,Yl=(mi+bi)/2,Zl=(Kl+jl)/2,ia=be.zoom(),wi=ia*Hl,Va=be.pan(),Is=se[0]*ia+Va.x,Bs=se[1]*ia+Va.y,Xl={x:-wi/ia*(Is-Va.x-Yl)+Is,y:-wi/ia*(Bs-Va.y-Zl)+Bs};if(Mt&&Mt.active()){var at=r.dragData.touchDragEles;b(at),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Mt.unactivate().emit(Fe("freeon")),at.emit(Fe("free")),r.dragData.didDrag&&(Mt.emit(Fe("dragfreeon")),at.emit(Fe("dragfree")))}be.viewport({zoom:wi,pan:Xl,cancelOnFailedZoom:!0}),be.emit(Fe("pinchzoom")),j=Ds,ee=kr,le=Kr,G=qr,V=Xr,r.pinching=!0}if(L.touches[0]){var Ge=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ee[0]=Ge[0],Ee[1]=Ge[1]}if(L.touches[1]){var Ge=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Ee[2]=Ge[0],Ee[3]=Ge[1]}if(L.touches[2]){var Ge=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Ee[4]=Ge[0],Ee[5]=Ge[1]}}else if(L.touches[0]&&!r.touchData.didSelect){var Gt=r.touchData.start,xi=r.touchData.last,ft;if(!r.hoverData.draggingEles&&!r.swipePanning&&(ft=r.findNearestElement(Ee[0],Ee[1],!0,!0)),oe&&Gt!=null&&L.preventDefault(),oe&&Gt!=null&&r.nodeIsDraggable(Gt))if(or){var at=r.dragData.touchDragEles,yo=!r.dragData.didDrag;yo&&E(at,{inDragLayer:!0}),r.dragData.didDrag=!0;var oa={x:0,y:0};if(ke(nr[0])&&ke(nr[1])&&(oa.x+=nr[0],oa.y+=nr[1],yo)){r.redrawHint("eles",!0);var Rt=r.touchData.dragDelta;Rt&&ke(Rt[0])&&ke(Rt[1])&&(oa.x+=Rt[0],oa.y+=Rt[1])}r.hoverData.draggingEles=!0,at.silentShift(oa).emit(Fe("position")).emit(Fe("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==qe[0]&&r.touchData.startPosition[1]==qe[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Rt=r.touchData.dragDelta=r.touchData.dragDelta||[];Rt.length===0?(Rt.push(nr[0]),Rt.push(nr[1])):(Rt[0]+=nr[0],Rt[1]+=nr[1])}if(a(Gt||ft,["touchmove","tapdrag","vmousemove"],L,{x:Ee[0],y:Ee[1]}),(!Gt||!Gt.grabbed())&&ft!=xi&&(xi&&xi.emit(Fe("tapdragout")),ft&&ft.emit(Fe("tapdragover"))),r.touchData.last=ft,oe)for(var bt=0;bt<Ee.length;bt++)Ee[bt]&&r.touchData.startPosition[bt]&&or&&(r.touchData.singleTouchMoved=!0);if(oe&&(Gt==null||Gt.pannable())&&be.panningEnabled()&&be.userPanningEnabled()){var Ql=o(Gt,r.touchData.starts);Ql&&(L.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Hi(r.touchData.startPosition)),r.swipePanning?(be.panBy({x:nr[0]*Ae,y:nr[1]*Ae}),be.emit(Fe("dragpan"))):or&&(r.swipePanning=!0,be.panBy({x:ur*Ae,y:Gr*Ae}),be.emit(Fe("dragpan")),Gt&&(Gt.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var Ge=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ee[0]=Ge[0],Ee[1]=Ge[1]}}for(var We=0;We<Ee.length;We++)qe[We]=Ee[We];oe&&L.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var we;r.registerBinding(e,"touchcancel",we=function(L){var oe=r.touchData.start;r.touchData.capture=!1,oe&&oe.unactivate()});var ge,me,Re,Ie;if(r.registerBinding(e,"touchend",ge=function(L){var oe=r.touchData.start,ye=r.touchData.capture;if(ye)L.touches.length===0&&(r.touchData.capture=!1),L.preventDefault();else return;var be=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var Ee=r.cy,qe=Ee.zoom(),Ae=r.touchData.now,Ge=r.touchData.earlier;if(L.touches[0]){var Fe=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ae[0]=Fe[0],Ae[1]=Fe[1]}if(L.touches[1]){var Fe=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Ae[2]=Fe[0],Ae[3]=Fe[1]}if(L.touches[2]){var Fe=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Ae[4]=Fe[0],Ae[5]=Fe[1]}var je=function(hn){return{originalEvent:L,type:hn,position:{x:Ae[0],y:Ae[1]}}};oe&&oe.unactivate();var or;if(r.touchData.cxt){if(or=je("cxttapend"),oe?oe.emit(or):Ee.emit(or),!r.touchData.cxtDragged){var nr=je("cxttap");oe?oe.emit(nr):Ee.emit(nr)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!L.touches[2]&&Ee.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var We=Ee.collection(r.getAllInBox(be[0],be[1],be[2],be[3]));be[0]=void 0,be[1]=void 0,be[2]=void 0,be[3]=void 0,be[4]=0,r.redrawHint("select",!0),Ee.emit(je("boxend"));var ur=function(hn){return hn.selectable()&&!hn.selected()};We.emit(je("box")).stdFilter(ur).select().emit(je("boxselect")),We.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(oe!=null&&oe.unactivate(),L.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!L.touches[1]){if(!L.touches[0]){if(!L.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ar=r.dragData.touchDragEles;if(oe!=null){var Gr=oe._private.grabbed;b(ar),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Gr&&(oe.emit(je("freeon")),ar.emit(je("free")),r.dragData.didDrag&&(oe.emit(je("dragfreeon")),ar.emit(je("dragfree")))),a(oe,["touchend","tapend","vmouseup","tapdragout"],L,{x:Ae[0],y:Ae[1]}),oe.unactivate(),r.touchData.start=null}else{var Br=r.findNearestElement(Ae[0],Ae[1],!0,!0);a(Br,["touchend","tapend","vmouseup","tapdragout"],L,{x:Ae[0],y:Ae[1]})}var lt=r.touchData.startPosition[0]-Ae[0],kr=lt*lt,Kr=r.touchData.startPosition[1]-Ae[1],qr=Kr*Kr,Xr=kr+qr,_n=Xr*qe*qe;r.touchData.singleTouchMoved||(oe||Ee.$(":selected").unselect(["tapunselect"]),a(oe,["tap","vclick"],L,{x:Ae[0],y:Ae[1]}),me=!1,L.timeStamp-Ie<=Ee.multiClickDebounceTime()?(Re&&clearTimeout(Re),me=!0,Ie=null,a(oe,["dbltap","vdblclick"],L,{x:Ae[0],y:Ae[1]})):(Re=setTimeout(function(){me||a(oe,["onetap","voneclick"],L,{x:Ae[0],y:Ae[1]})},Ee.multiClickDebounceTime()),Ie=L.timeStamp)),oe!=null&&!r.dragData.didDrag&&oe._private.selectable&&_n<r.touchTapThreshold2&&!r.pinching&&(Ee.selectionType()==="single"?(Ee.$(t).unmerge(oe).unselect(["tapunselect"]),oe.select(["tapselect"])):oe.selected()?oe.unselect(["tapunselect"]):oe.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var zr=0;zr<Ae.length;zr++)Ge[zr]=Ae[zr];r.dragData.didDrag=!1,L.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),L.touches.length<2&&(L.touches.length===1&&(r.touchData.startGPosition=[L.touches[0].clientX,L.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var Be=[],Oe=function(L){return{clientX:L.clientX,clientY:L.clientY,force:1,identifier:L.pointerId,pageX:L.pageX,pageY:L.pageY,radiusX:L.width/2,radiusY:L.height/2,screenX:L.screenX,screenY:L.screenY,target:L.target}},He=function(L){return{event:L,touch:Oe(L)}},Ve=function(L){Be.push(He(L))},Xe=function(L){for(var oe=0;oe<Be.length;oe++){var ye=Be[oe];if(ye.event.pointerId===L.pointerId){Be.splice(oe,1);return}}},er=function(L){var oe=Be.filter(function(ye){return ye.event.pointerId===L.pointerId})[0];oe.event=L,oe.touch=Oe(L)},$e=function(L){L.touches=Be.map(function(oe){return oe.touch})},Me=function(L){return L.pointerType==="mouse"||L.pointerType===4};r.registerBinding(r.container,"pointerdown",function(pe){Me(pe)||(pe.preventDefault(),Ve(pe),$e(pe),U(pe))}),r.registerBinding(r.container,"pointerup",function(pe){Me(pe)||(Xe(pe),$e(pe),ge(pe))}),r.registerBinding(r.container,"pointercancel",function(pe){Me(pe)||(Xe(pe),$e(pe),we(pe))}),r.registerBinding(r.container,"pointermove",function(pe){Me(pe)||(pe.preventDefault(),er(pe),$e(pe),fe(pe))})}};var ea={};ea.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,a,i,o,s,l){this.renderer.nodeShapeImpl("polygon",n,a,i,o,s,this.points)},intersectLine:function(n,a,i,o,s,l,u,c){return as(s,l,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,s,l,u,c){return Jn(n,a,this.points,l,u,o,s,[0,-1],i)},hasMiterBounds:r!=="rectangle",miterBounds:function(n,a,i,o,s,l){return YN(this.points,n,a,i,o,s)}}};ea.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,l){return nF(i,o,e,t,n/2+s,a/2+s)},checkPoint:function(e,t,n,a,i,o,s,l){return ii(e,t,a,i,o,s,n)}}};ea.generateRoundPolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,a,i,o,s,l,u){if(l[u]!==void 0&&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=o/2;s=s==="auto"?AR(i,o):s;for(var h=new Array(e.length/2),g=0;g<e.length/2;g++)h[g]={x:n+c*e[g*2],y:a+d*e[g*2+1]};var p,E,m,b,w=h.length;for(E=h[w-1],p=0;p<w;p++)m=h[p%w],b=h[(p+1)%w],l[u][p]=Xm(E,m,b,s),E=m,m=b;return l[u]},draw:function(n,a,i,o,s,l,u){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,s,this.points,this.getOrCreateCorners(a,i,o,s,l,u,"drawCorners"))},intersectLine:function(n,a,i,o,s,l,u,c,d){return iF(s,l,this.points,n,a,i,o,u,this.getOrCreateCorners(n,a,i,o,c,d,"corners"))},checkPoint:function(n,a,i,o,s,l,u,c,d){return tF(n,a,this.points,l,u,o,s,this.getOrCreateCorners(l,u,o,s,c,d,"corners"))}}};ea.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,l){return TR(i,o,e,t,n,a,s,l)},checkPoint:function(e,t,n,a,i,o,s,l){var u=a/2,c=i/2;l=l==="auto"?Aa(a,i):l,l=Math.min(u,c,l);var d=l*2;return!!(Jn(e,t,this.points,o,s,a,i-d,[0,-1],n)||Jn(e,t,this.points,o,s,a-d,i,[0,-1],n)||ii(e,t,d,d,o-u+l,s-c+l,n)||ii(e,t,d,d,o+u-l,s-c+l,n)||ii(e,t,d,d,o+u-l,s+c-l,n)||ii(e,t,d,d,o-u+l,s+c-l,n))}}};ea.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:zm(),points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,null,o)},generateCutTrianglePts:function(e,t,n,a,i){var o=i==="auto"?this.cornerLength:i,s=t/2,l=e/2,u=n-l,c=n+l,d=a-s,h=a+s;return{topLeft:[u,d+o,u+o,d,u+o,d+o],topRight:[c-o,d,c,d+o,c-o,d+o],bottomRight:[c,h-o,c-o,h,c-o,h-o],bottomLeft:[u+o,h,u,h-o,u+o,h-o]}},intersectLine:function(e,t,n,a,i,o,s,l){var u=this.generateCutTrianglePts(n+2*s,a+2*s,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 as(i,o,c,e,t)},checkPoint:function(e,t,n,a,i,o,s,l){var u=l==="auto"?this.cornerLength:l;if(Jn(e,t,this.points,o,s,a,i-2*u,[0,-1],n)||Jn(e,t,this.points,o,s,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,o,s);return zt(e,t,c.topLeft)||zt(e,t,c.topRight)||zt(e,t,c.bottomRight)||zt(e,t,c.bottomLeft)}}};ea.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,l){var u=.15,c=.5,d=.85,h=this.generateBarrelBezierPts(n+2*s,a+2*s,e,t),g=function(m){var b=Zi({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),w=Zi({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},c),x=Zi({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},d);return[m[0],m[1],b.x,b.y,w.x,w.y,x.x,x.y,m[4],m[5]]},p=[].concat(g(h.topLeft),g(h.topRight),g(h.bottomRight),g(h.bottomLeft));return as(i,o,p,e,t)},generateBarrelBezierPts:function(e,t,n,a){var i=t/2,o=e/2,s=n-o,l=n+o,u=a-i,c=a+i,d=cm(e,t),h=d.heightOffset,g=d.widthOffset,p=d.ctrlPtOffsetPct*e,E={topLeft:[s,u+h,s+p,u,s+g,u],topRight:[l-g,u,l-p,u,l,u+h],bottomRight:[l,c-h,l-p,c,l-g,c],bottomLeft:[s+g,c,s+p,c,s,c-h]};return E.topLeft.isTop=!0,E.topRight.isTop=!0,E.bottomLeft.isBottom=!0,E.bottomRight.isBottom=!0,E},checkPoint:function(e,t,n,a,i,o,s,l){var u=cm(a,i),c=u.heightOffset,d=u.widthOffset;if(Jn(e,t,this.points,o,s,a,i-2*c,[0,-1],n)||Jn(e,t,this.points,o,s,a-2*d,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,s),g=function(A,P,D){var I=D[4],M=D[2],k=D[0],N=D[5],z=D[1],W=Math.min(I,k),q=Math.max(I,k),$=Math.min(N,z),X=Math.max(N,z);if(W<=A&&A<=q&&$<=P&&P<=X){var Y=oF(I,M,k),K=QN(Y[0],Y[1],Y[2],A),ee=K.filter(function(le){return 0<=le&&le<=1});if(ee.length>0)return ee[0]}return null},p=Object.keys(h),E=0;E<p.length;E++){var m=p[E],b=h[m],w=g(e,t,b);if(w!=null){var x=b[5],C=b[3],T=b[1],S=ot(x,C,T,w);if(b.isTop&&S<=t||b.isBottom&&t<=S)return!0}}return!1}}};ea.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:It(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,l){var u=e-(n/2+s),c=t-(a/2+s),d=c,h=e+(n/2+s),g=Ea(i,o,e,t,u,c,h,d,!1);return g.length>0?g:TR(i,o,e,t,n,a,s,l)},checkPoint:function(e,t,n,a,i,o,s,l){l=l==="auto"?Aa(a,i):l;var u=2*l;if(Jn(e,t,this.points,o,s,a,i-u,[0,-1],n)||Jn(e,t,this.points,o,s,a-u,i,[0,-1],n))return!0;var c=a/2+2*n,d=i/2+2*n,h=[o-c,s-d,o-c,s,o+c,s,o+c,s-d];return!!(zt(e,t,h)||ii(e,t,u,u,o+a/2-l,s+i/2-l,n)||ii(e,t,u,u,o-a/2+l,s+i/2-l,n))}}};ea.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",It(3,0)),this.generateRoundPolygon("round-triangle",It(3,0)),this.generatePolygon("rectangle",It(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",It(5,0)),this.generateRoundPolygon("round-pentagon",It(5,0)),this.generatePolygon("hexagon",It(6,0)),this.generateRoundPolygon("round-hexagon",It(6,0)),this.generatePolygon("heptagon",It(7,0)),this.generateRoundPolygon("round-heptagon",It(7,0)),this.generatePolygon("octagon",It(8,0)),this.generateRoundPolygon("round-octagon",It(8,0));var n=new Array(20);{var a=fm(5,0),i=fm(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)n[s*4]=a[s*2],n[s*4+1]=a[s*2+1],n[s*4+2]=i[s*2],n[s*4+3]=i[s*2+1]}n=RR(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 c=u.join("$"),d="polygon-"+c,h;return(h=this[d])?h:e.generatePolygon(d,u)}};var Cs={};Cs.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Cs.redraw=function(r){r=r||ER();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r};Cs.beforeRender=function(r,e){if(!this.destroyed){e==null&&Lr("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})}};var eE=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};Cs.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){eE(r,!0,a);var i=Qn();r.render(r.renderOptions);var o=r.lastDrawTime=Qn();r.averageRedrawTime===void 0&&(r.averageRedrawTime=o-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var s=o-i;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2,r.requestedFrame=!1}else eE(r,!1,a);r.skipFrame=!1,ju(t)}};ju(t)}};var E$=function(e){this.init(e)},AA=E$,fo=AA.prototype;fo.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];fo.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,o="__________cytoscape_stylesheet",s="__________cytoscape_container",l=a.getElementById(o)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!l){var u=a.createElement("style");u.id=o,u.textContent="."+s+" { position: relative; }",i.insertBefore(u,i.children[0])}var c=n.getComputedStyle(t),d=c.getPropertyValue("position");d==="static"&&Er("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=ke(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()};fo.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&n.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),r==="gc"&&t.redrawHint("gc",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};fo.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],n=t,a=n.target;(a.off||a.removeEventListener).apply(a,n.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{}};fo.isHeadless=function(){return!1};[Zm,TA,RA,lo,ea,Cs].forEach(function(r){Ye(fo,r)});var Md=1e3/60,PA={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=ms(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,c){var d=Qn(),h=a.averageRedrawTime,g=a.lastRedrawTime,p=[],E=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var b=Qn(),w=b-d,x=b-c;if(g<Md){var C=Md-(u?h:0);if(x>=e.deqFastCost*C)break}else if(u){if(w>=e.deqCost*g||w>=e.deqAvgCost*h)break}else if(x>=e.deqNoDrawCost*Md)break;var T=e.deq(n,m,E);if(T.length>0)for(var S=0;S<T.length;S++)p.push(T[S]);else break}p.length>0&&(e.onDeqd(n,p),!u&&e.shouldRedraw(n,p,m,E)&&i())},s=e.priority||Lm;a.beforeRender(o,s(n))}}}},C$=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Yu;La(this,r),this.idsByKey=new Xn,this.keyForId=new Xn,this.cachesByLvl=new Xn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return Oa(r,[{key:"getIdsFor",value:function(t){t==null&&Lr("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new io,n.set(t,a)),a}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),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(),a=this.keyForId.get(n),i=this.getKey(t);return a!==i}},{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 Xn,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 i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,n){var a=this.keyForId.get(t.id()),i=this.getCache(a,n);return i}},{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||this.getNumberOfIdsForKey(a)===0}}])})(),rE=25,Pu=50,$u=-4,_m=3,DA=7.99,_$=8,S$=1024,T$=1024,R$=1024,A$=.2,P$=.8,D$=10,I$=.15,B$=.1,k$=.9,M$=.9,L$=100,O$=1,ji={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},q$=yt({getKey:null,doesEleInvalidateKey:Yu,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:bR,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Vo=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=q$(t);Ye(n,a),n.lookup=new C$(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},nt=Vo.prototype;nt.reasons=ji;nt.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};nt.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=t[r]=t[r]||[];return n};nt.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new bs(function(t,n){return n.reqs-t.reqs});return e};nt.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};nt.getElement=function(r,e,t,n,a){var i=this,o=this.renderer,s=o.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(n==null&&(n=Math.ceil(qm(s*t))),n<$u)n=$u;else if(s>=DA||n>_m)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,h=o.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,h))return null;var g=l.get(r,n);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var p;if(c<=rE?p=rE:c<=Pu?p=Pu:p=Math.ceil(c/Pu)*Pu,c>R$||d>T$)return null;var E=i.getTextureQueue(p),m=E[E.length-2],b=function(){return i.recycleTexture(p,d)||i.addTexture(p,d)};m||(m=E[E.length-1]),m||(m=b()),m.width-m.usedWidth<d&&(m=b());for(var w=function(W){return W&&W.scaledLabelShown===h},x=a&&a===ji.dequeue,C=a&&a===ji.highQuality,T=a&&a===ji.downscale,S,_=n+1;_<=_m;_++){var A=l.get(r,_);if(A){S=A;break}}var P=S&&S.level===n+1?S:null,D=function(){m.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,m.usedWidth,0,d,c)};if(m.context.setTransform(1,0,0,1,0,0),m.context.clearRect(m.usedWidth,0,d,p),w(P))D();else if(w(S))if(C){for(var I=S.level;I>n;I--)P=i.getElement(r,e,t,I,ji.downscale);D()}else return i.queueElement(r,S.level-1),S;else{var M;if(!x&&!C&&!T)for(var k=n-1;k>=$u;k--){var N=l.get(r,k);if(N){M=N;break}}if(w(M))return i.queueElement(r,n),M;m.context.translate(m.usedWidth,0),m.context.scale(u,u),this.drawElement(m.context,r,e,h,!1),m.context.scale(1/u,1/u),m.context.translate(-m.usedWidth,0)}return g={x:m.usedWidth,texture:m,level:n,scale:u,width:d,height:c,scaledLabelShown:h},m.usedWidth+=Math.ceil(d+_$),m.eleCaches.push(g),l.set(r,n,g),i.checkTextureFullness(m),g};nt.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};nt.invalidateElement=function(r){var e=this,t=e.lookup,n=[],a=t.isInvalid(r);if(a){for(var i=$u;i<=_m;i++){var o=t.getForCachedKey(r,i);o&&n.push(o)}var s=t.invalidate(r);if(s)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)}};nt.checkTextureUtility=function(r){r.invalidatedWidth>=A$*r.width&&this.retireTexture(r)};nt.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>P$&&r.fullnessChecks>=D$?Ra(t,r):r.fullnessChecks++};nt.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),a=this.lookup;Ra(n,r),r.retired=!0;for(var i=r.eleCaches,o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}Om(i);var l=e.getRetiredTextureQueue(t);l.push(r)};nt.addTexture=function(r,e){var t=this,n=t.getTextureQueue(r),a={};return n.push(a),a.eleCaches=[],a.height=r,a.width=Math.max(S$,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=t.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};nt.recycleTexture=function(r,e){for(var t=this,n=t.getTextureQueue(r),a=t.getRetiredTextureQueue(r),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Om(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ra(a,o),n.push(o),o}};nt.queueElement=function(r,e){var t=this,n=t.getElementQueue(),a=t.getElementKeyToQueue(),i=this.getKey(r),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(r),o.reqs++,n.updateItem(o);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:i};n.push(s),a[i]=s}};nt.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<O$&&t.size()>0;o++){var s=t.pop(),l=s.key,u=s.eles[0],c=i.hasCache(u,s.level);if(n[l]=null,c)continue;a.push(s);var d=e.getBoundingBox(u);e.getElement(u,d,r,s.level,ji.dequeue)}return a};nt.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(r),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Mm,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))};nt.onDequeue=function(r){this.onDequeues.push(r)};nt.offDequeue=function(r){Ra(this.onDequeues,r)};nt.setupDequeueing=PA.setupDequeueing({deqRedrawThreshold:L$,deqCost:I$,deqAvgCost:B$,deqNoDrawCost:k$,deqFastCost:M$,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(t)}},shouldRedraw:function(e,t,n,a){for(var i=0;i<t.length;i++)for(var o=t[i].eles,s=0;s<o.length;s++){var l=o[s].boundingBox();if(Fm(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var N$=1,Yo=-4,nl=2,F$=3.99,z$=50,$$=50,V$=.15,G$=.1,W$=.9,U$=.9,H$=1,tE=250,K$=4e3*4e3,nE=32767,j$=!0,IA=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Qn()-2*tE,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=ms(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},$$),n.beforeRender(function(o,s){s-t.lastInvalidationTime<=tE?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(s,l){return l.reqs-s.reqs};t.layersQueue=new bs(i),t.setupDequeueing()},mt=IA.prototype,aE=0,Y$=Math.pow(2,53)-1;mt.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),o={id:aE=++aE%Y$,bb:r,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,l=-o.bb.x1,u=-o.bb.y1;return s.scale(t,t),s.translate(l,u),o};mt.getLayers=function(r,e,t){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),s=n.firstGet;if(n.firstGet=!1,t==null){if(t=Math.ceil(qm(o*e)),t<Yo)t=Yo;else if(o>=F$||t>nl)return null}n.validateLayersElesOrdering(t,r);var l=n.layersByLevel,u=Math.pow(2,t),c=l[t]=l[t]||[],d,h=n.levelIsComplete(t,r),g,p=function(){var D=function(z){if(n.validateLayersElesOrdering(z,r),n.levelIsComplete(z,r))return g=l[z],!0},I=function(z){if(!g)for(var W=t+z;Yo<=W&&W<=nl&&!D(W);W+=z);};I(1),I(-1);for(var M=c.length-1;M>=0;M--){var k=c[M];k.invalid&&Ra(c,k)}};if(!h)p();else return c;var E=function(){if(!d){d=Bt();for(var D=0;D<r.length;D++)HN(d,r[D].boundingBox())}return d},m=function(D){D=D||{};var I=D.after;E();var M=Math.ceil(d.w*u),k=Math.ceil(d.h*u);if(M>nE||k>nE)return null;var N=M*k;if(N>K$)return null;var z=n.makeLayer(d,t);if(I!=null){var W=c.indexOf(I)+1;c.splice(W,0,z)}else(D.insert===void 0||D.insert)&&c.unshift(z);return z};if(n.skipping&&!s)return null;for(var b=null,w=r.length/N$,x=!s,C=0;C<r.length;C++){var T=r[C],S=T._private.rscratch,_=S.imgLayerCaches=S.imgLayerCaches||{},A=_[t];if(A){b=A;continue}if((!b||b.eles.length>=w||!SR(b.bb,T.boundingBox()))&&(b=m({insert:!0,after:b}),!b))return null;g||x?n.queueLayer(b,T):n.drawEleInLayer(b,T,t,e),b.eles.push(T),_[t]=b}return g||(x?null:c)};mt.getEleLevelForLayerLevel=function(r,e){return r};mt.drawEleInLayer=function(r,e,t,n){var a=this,i=this.renderer,o=r.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(t=a.getEleLevelForLayerLevel(t,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,t,j$),i.setImgSmoothing(o,!0))};mt.levelIsComplete=function(r,e){var t=this,n=t.layersByLevel[r];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length};mt.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,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var s=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[s+o]){this.invalidateLayer(a);break}}};mt.updateElementsInLayers=function(r,e){for(var t=this,n=hs(r[0]),a=0;a<r.length;a++)for(var i=n?null:r[a],o=n?r[a]:r[a].ele,s=o._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=Yo;u<=nl;u++){var c=l[u];c&&(i&&t.getEleLevelForLayerLevel(c.level)!==i.level||e(c,o,i))}};mt.haveLayers=function(){for(var r=this,e=!1,t=Yo;t<=nl;t++){var n=r.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e};mt.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=Qn(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))};mt.invalidateLayer=function(r){if(this.lastInvalidationTime=Qn(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];Ra(n,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)}}};mt.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};mt.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};mt.queueLayer=function(r,e){var t=this,n=t.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))}};mt.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],a=0;a<H$&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,r),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};mt.applyLayerReplacement=function(r){var e=this,t=e.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 o=r.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[r.level]=r)}e.requestRedraw()}};mt.requestRedraw=ms(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);mt.setupDequeueing=PA.setupDequeueing({deqRedrawThreshold:z$,deqCost:V$,deqAvgCost:G$,deqNoDrawCost:W$,deqFastCost:U$,deq:function(e,t){return e.dequeue(t)},onDeqd:Lm,shouldRedraw:bR,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var BA={},iE;function Z$(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function X$(r,e,t){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function oE(r,e,t){r.beginPath&&r.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];r.lineTo(i.x,i.y)}var o=t,s=t[0];r.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function Q$(r,e,t,n,a){r.beginPath&&r.beginPath(),r.arc(t,n,a,0,Math.PI*2,!1);var i=e,o=i[0];r.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var l=i[s];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function J$(r,e,t,n){r.arc(e,t,n,0,Math.PI*2,!1)}BA.arrowShapeImpl=function(r){return(iE||(iE={polygon:Z$,"triangle-backcurve":X$,"triangle-tee":oE,"circle-triangle":Q$,"triangle-cross":oE,circle:J$}))[r]};var On={};On.drawElement=function(r,e,t,n,a,i){var o=this;e.isNode()?o.drawNode(r,e,t,n,a,i):o.drawEdge(r,e,t,n,a,i)};On.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};On.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};On.drawCachedElementPortion=function(r,e,t,n,a,i,o,s){var l=this,u=t.getBoundingBox(e);if(!(u.w===0||u.h===0)){var c=t.getElement(e,u,n,a,i);if(c!=null){var d=s(l,e);if(d===0)return;var h=o(l,e),g=u.x1,p=u.y1,E=u.w,m=u.h,b,w,x,C,T;if(h!==0){var S=t.getRotationPoint(e);x=S.x,C=S.y,r.translate(x,C),r.rotate(h),T=l.getImgSmoothing(r),T||l.setImgSmoothing(r,!0);var _=t.getRotationOffset(e);b=_.x,w=_.y}else b=g,w=p;var A;d!==1&&(A=r.globalAlpha,r.globalAlpha=A*d),r.drawImage(c.texture.canvas,c.x,0,c.width,c.height,b,w,E,m),d!==1&&(r.globalAlpha=A),h!==0&&(r.rotate(-h),r.translate(-x,-C),T||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var e3=function(){return 0},r3=function(e,t){return e.getTextAngle(t,null)},t3=function(e,t){return e.getTextAngle(t,"source")},n3=function(e,t){return e.getTextAngle(t,"target")},a3=function(e,t){return t.effectiveOpacity()},Ld=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};On.drawCachedElement=function(r,e,t,n,a,i){var o=this,s=o.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,h=e.boundingBox(),g=i===!0?l.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||Fm(h,n))){var p=e.isEdge(),E=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,l,t,a,g,e3,a3),(!p||!E)&&o.drawCachedElementPortion(r,e,u,t,a,g,r3,Ld),p&&!E&&(o.drawCachedElementPortion(r,e,c,t,a,g,t3,Ld),o.drawCachedElementPortion(r,e,d,t,a,g,n3,Ld)),o.drawElementOverlay(r,e)}};On.drawElements=function(r,e){for(var t=this,n=0;n<e.length;n++){var a=e[n];t.drawElement(r,a)}};On.drawCachedElements=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(r,o,t,n)}};On.drawCachedNodes=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(r,o,t,n)}};On.drawLayeredElements=function(r,e,t,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,t);if(i)for(var o=0;o<i.length;o++){var s=i[o],l=s.bb;l.w===0||l.h===0||r.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else a.drawCachedElements(r,e,t,n)};var ra={};ra.drawEdge=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var l;t&&(l=t,r.translate(-l.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,h=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,E=e.pstyle("line-outline-width").value,m=e.pstyle("line-outline-color").value,b=u*c,w=u*c,x=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;d==="straight-triangle"?(o.eleStrokeStyle(r,e,z),o.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=g,r.lineCap=p,o.eleStrokeStyle(r,e,z),o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},C=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;if(r.lineWidth=g+E,r.lineCap=p,E>0)o.colorStrokeStyle(r,m[0],m[1],m[2],z);else{r.lineCap="butt";return}d==="straight-triangle"?o.drawEdgeTrianglePath(e,r,s.allpts):(o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},T=function(){a&&o.drawEdgeOverlay(r,e)},S=function(){a&&o.drawEdgeUnderlay(r,e)},_=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;o.drawArrowheads(r,e,z)},A=function(){o.drawElementText(r,e,null,n)};r.lineJoin="round";var P=e.pstyle("ghost").value==="yes";if(P){var D=e.pstyle("ghost-offset-x").pfValue,I=e.pstyle("ghost-offset-y").pfValue,M=e.pstyle("ghost-opacity").value,k=b*M;r.translate(D,I),x(k),_(k),r.translate(-D,-I)}else C();S(),x(),_(),T(),A(),t&&r.translate(l.x1,l.y1)}};var kA=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(a!==0){var i=this,o=i.usePaths(),s=n._private.rscratch,l=n.pstyle("".concat(e,"-padding")).pfValue,u=2*l,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=u,s.edgeType==="self"&&!o?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,c[0],c[1],c[2],a),i.drawEdgePath(n,t,s.allpts,"solid")}}}};ra.drawEdgeOverlay=kA("overlay");ra.drawEdgeUnderlay=kA("underlay");ra.drawEdgePath=function(r,e,t,n){var a=r._private.rscratch,i=e,o,s=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,c=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$"),h=a.pathCacheKey&&a.pathCacheKey===d;h?(o=e=a.pathCache,s=!0):(o=e=new Path2D,a.pathCacheKey=d,a.pathCache=o)}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([]);break}if(!s&&!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 g=2;g+3<t.length;g+=4)e.quadraticCurveTo(t[g],t[g+1],t[g+2],t[g+3]);break;case"straight":case"haystack":for(var p=2;p+1<t.length;p+=2)e.lineTo(t[p],t[p+1]);break;case"segments":if(a.isRound){var E=$t(a.roundCorners),m;try{for(E.s();!(m=E.n()).done;){var b=m.value;xA(e,b)}}catch(x){E.e(x)}finally{E.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]);break}e=i,l?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};ra.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]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],l=[s[0]*n/2,s[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()}};ra.drawArrowheads=function(r,e,t){var n=e._private.rscratch,a=n.edgeType==="haystack";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)};ra.drawArrowhead=function(r,e,t,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var s=this,l=e.pstyle(t+"-arrow-shape").value;if(l!=="none"){var u=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",c=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,h=e.pstyle(t+"-arrow-width"),g=h.value==="match-line"?d:h.pfValue;h.units==="%"&&(g*=d);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var E=r.globalCompositeOperation;(o!==1||c==="hollow")&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,255,255,255,1),s.colorStrokeStyle(r,255,255,255,1),s.drawArrowShape(e,r,u,d,l,g,n,a,i),r.globalCompositeOperation=E);var m=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,m[0],m[1],m[2],o),s.colorStrokeStyle(r,m[0],m[1],m[2],o),s.drawArrowShape(e,r,c,d,l,g,n,a,i)}}};ra.drawArrowShape=function(r,e,t,n,a,i,o,s,l){var u=this,c=this.usePaths()&&a!=="triangle-cross",d=!1,h,g=e,p={x:o,y:s},E=r.pstyle("arrow-scale").value,m=this.getArrowWidth(n,E),b=u.arrowShapes[a];if(c){var w=u.arrowPathCache=u.arrowPathCache||[],x=oi(a),C=w[x];C!=null?(h=e=C,d=!0):(h=e=new Path2D,w[x]=h)}d||(e.beginPath&&e.beginPath(),c?b.draw(e,1,0,{x:0,y:0},1):b.draw(e,m,l,p,n),e.closePath&&e.closePath()),e=g,c&&(e.translate(o,s),e.rotate(l),e.scale(m,m)),(t==="filled"||t==="both")&&(c?e.fill(h):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=i/(c?m:1),e.lineJoin="miter",c?e.stroke(h):e.stroke()),c&&(e.scale(1/m,1/m),e.rotate(-l),e.translate(-o,-s))};var Jm={};Jm.safeDrawImage=function(r,e,t,n,a,i,o,s,l,u){if(!(a<=0||i<=0||l<=0||u<=0))try{r.drawImage(e,t,n,a,i,o,s,l,u)}catch(c){Er(c)}};Jm.drawInscribedImage=function(r,e,t,n,a){var i=this,o=t.position(),s=o.x,l=o.y,u=t.cy().style(),c=u.getIndexedStyle.bind(u),d=c(t,"background-fit","value",n),h=c(t,"background-repeat","value",n),g=t.width(),p=t.height(),E=t.padding()*2,m=g+(c(t,"background-width-relative-to","value",n)==="inner"?0:E),b=p+(c(t,"background-height-relative-to","value",n)==="inner"?0:E),w=t._private.rscratch,x=c(t,"background-clip","value",n),C=x==="node",T=c(t,"background-image-opacity","value",n)*a,S=c(t,"background-image-smoothing","value",n),_=t.pstyle("corner-radius").value;_!=="auto"&&(_=t.pstyle("corner-radius").pfValue);var A=e.width||e.cachedW,P=e.height||e.cachedH;(A==null||P==null)&&(document.body.appendChild(e),A=e.cachedW=e.width||e.offsetWidth,P=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var D=A,I=P;if(c(t,"background-width","value",n)!=="auto"&&(c(t,"background-width","units",n)==="%"?D=c(t,"background-width","pfValue",n)*m:D=c(t,"background-width","pfValue",n)),c(t,"background-height","value",n)!=="auto"&&(c(t,"background-height","units",n)==="%"?I=c(t,"background-height","pfValue",n)*b:I=c(t,"background-height","pfValue",n)),!(D===0||I===0)){if(d==="contain"){var M=Math.min(m/D,b/I);D*=M,I*=M}else if(d==="cover"){var M=Math.max(m/D,b/I);D*=M,I*=M}var k=s-m/2,N=c(t,"background-position-x","units",n),z=c(t,"background-position-x","pfValue",n);N==="%"?k+=(m-D)*z:k+=z;var W=c(t,"background-offset-x","units",n),q=c(t,"background-offset-x","pfValue",n);W==="%"?k+=(m-D)*q:k+=q;var $=l-b/2,X=c(t,"background-position-y","units",n),Y=c(t,"background-position-y","pfValue",n);X==="%"?$+=(b-I)*Y:$+=Y;var K=c(t,"background-offset-y","units",n),ee=c(t,"background-offset-y","pfValue",n);K==="%"?$+=(b-I)*ee:$+=ee,w.pathCache&&(k-=s,$-=l,s=0,l=0);var le=r.globalAlpha;r.globalAlpha=T;var G=i.getImgSmoothing(r),V=!1;if(S==="no"&&G?(i.setImgSmoothing(r,!1),V=!0):S==="yes"&&!G&&(i.setImgSmoothing(r,!0),V=!0),h==="no-repeat")C&&(r.save(),w.pathCache?r.clip(w.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,s,l,m,b,_,w),r.clip())),i.safeDrawImage(r,e,0,0,A,P,k,$,D,I),C&&r.restore();else{var j=r.createPattern(e,h);r.fillStyle=j,i.nodeShapes[i.getNodeShape(t)].draw(r,s,l,m,b,_,w),r.translate(k,$),r.fill(),r.translate(-k,-$)}r.globalAlpha=le,V&&i.setImgSmoothing(r,G)}};var di={};di.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(qm(t*n));e=Math.pow(2,a)}var i=r.pstyle("font-size").pfValue*e,o=r.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};di.drawElementText=function(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=o.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,c=e.pstyle("label"),d=e.pstyle("source-label"),h=e.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var g=!t,p;t&&(p=t,r.translate(-p.x1,-p.y1)),a==null?(o.drawText(r,e,null,g,i),e.isEdge()&&(o.drawText(r,e,"source",g,i),o.drawText(r,e,"target",g,i))):o.drawText(r,e,a,g,i),t&&r.translate(p.x1,p.y1)};di.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};di.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;r.font=n+" "+o+" "+a+" "+i,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],s),this.colorStrokeStyle(r,c[0],c[1],c[2],l)};function i3(r,e,t,n,a){var i=Math.min(n,a),o=i/2,s=e+n/2,l=t+a/2;r.beginPath(),r.arc(s,l,o,0,Math.PI*2),r.closePath()}function sE(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,n/2,a/2);r.beginPath(),r.moveTo(e+o,t),r.lineTo(e+n-o,t),r.quadraticCurveTo(e+n,t,e+n,t+o),r.lineTo(e+n,t+a-o),r.quadraticCurveTo(e+n,t+a,e+n-o,t+a),r.lineTo(e+o,t+a),r.quadraticCurveTo(e,t+a,e,t+a-o),r.lineTo(e,t+o),r.quadraticCurveTo(e,t,e+o,t),r.closePath()}di.getTextAngle=function(r,e){var t,n=r._private,a=n.rscratch,i=e?e+"-":"",o=r.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=Ft(a,"labelAngle",e);t=r.isEdge()?s:0}else o.strValue==="none"?t=0:t=o.pfValue;return t};di.drawText=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=a?e.effectiveOpacity():1;if(!(a&&(s===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var l=Ft(o,"labelX",t),u=Ft(o,"labelY",t),c,d,h=this.getLabelText(e,t);if(h!=null&&h!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,a);var g=t?t+"-":"",p=Ft(o,"labelWidth",t),E=Ft(o,"labelHeight",t),m=e.pstyle(g+"text-margin-x").pfValue,b=e.pstyle(g+"text-margin-y").pfValue,w=e.isEdge(),x=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;w&&(x="center",C="center"),l+=m,u+=b;var T;switch(n?T=this.getTextAngle(e,t):T=0,T!==0&&(c=l,d=u,r.translate(c,d),r.rotate(T),l=0,u=0),C){case"top":break;case"center":u+=E/2;break;case"bottom":u+=E;break}var S=e.pstyle("text-background-opacity").value,_=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,D=e.pstyle("text-background-shape").strValue,I=D==="round-rectangle"||D==="roundrectangle",M=D==="circle",k=2;if(S>0||A>0&&_>0){var N=r.fillStyle,z=r.strokeStyle,W=r.lineWidth,q=e.pstyle("text-background-color").value,$=e.pstyle("text-border-color").value,X=e.pstyle("text-border-style").value,Y=S>0,K=A>0&&_>0,ee=l-P;switch(x){case"left":ee-=p;break;case"center":ee-=p/2;break}var le=u-E-P,G=p+2*P,V=E+2*P;if(Y&&(r.fillStyle="rgba(".concat(q[0],",").concat(q[1],",").concat(q[2],",").concat(S*s,")")),K&&(r.strokeStyle="rgba(".concat($[0],",").concat($[1],",").concat($[2],",").concat(_*s,")"),r.lineWidth=A,r.setLineDash))switch(X){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=A/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(I?(r.beginPath(),sE(r,ee,le,G,V,k)):M?(r.beginPath(),i3(r,ee,le,G,V)):(r.beginPath(),r.rect(ee,le,G,V)),Y&&r.fill(),K&&r.stroke(),K&&X==="double"){var j=A/2;r.beginPath(),I?sE(r,ee+j,le+j,G-2*j,V-2*j,k):r.rect(ee+j,le+j,G-2*j,V-2*j),r.stroke()}r.fillStyle=N,r.strokeStyle=z,r.lineWidth=W,r.setLineDash&&r.setLineDash([])}var re=2*e.pstyle("text-outline-width").pfValue;if(re>0&&(r.lineWidth=re),e.pstyle("text-wrap").value==="wrap"){var ce=Ft(o,"labelWrapCachedLines",t),se=Ft(o,"labelLineHeight",t),Z=p/2,Q=this.getLabelJustification(e);switch(Q==="auto"||(x==="left"?Q==="left"?l+=-p:Q==="center"&&(l+=-Z):x==="center"?Q==="left"?l+=-Z:Q==="right"&&(l+=Z):x==="right"&&(Q==="center"?l+=Z:Q==="right"&&(l+=p))),C){case"top":u-=(ce.length-1)*se;break;case"center":case"bottom":u-=(ce.length-1)*se;break}for(var ae=0;ae<ce.length;ae++)re>0&&r.strokeText(ce[ae],l,u),r.fillText(ce[ae],l,u),u+=se}else re>0&&r.strokeText(h,l,u),r.fillText(h,l,u);T!==0&&(r.rotate(-T),r.translate(-c,-d))}}};var Na={};Na.drawNode=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,l,u=e._private,c=u.rscratch,d=e.position();if(!(!ke(d.x)||!ke(d.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,g=o.usePaths(),p,E=!1,m=e.padding();s=e.width()+2*m,l=e.height()+2*m;var b;t&&(b=t,r.translate(-b.x1,-b.y1));for(var w=e.pstyle("background-image"),x=w.value,C=new Array(x.length),T=new Array(x.length),S=0,_=0;_<x.length;_++){var A=x[_],P=C[_]=A!=null&&A!=="none";if(P){var D=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",_);S++,T[_]=o.getCachedImage(A,D,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var I=e.pstyle("background-blacken").value,M=e.pstyle("border-width").pfValue,k=e.pstyle("background-opacity").value*h,N=e.pstyle("border-color").value,z=e.pstyle("border-style").value,W=e.pstyle("border-join").value,q=e.pstyle("border-cap").value,$=e.pstyle("border-position").value,X=e.pstyle("border-dash-pattern").pfValue,Y=e.pstyle("border-dash-offset").pfValue,K=e.pstyle("border-opacity").value*h,ee=e.pstyle("outline-width").pfValue,le=e.pstyle("outline-color").value,G=e.pstyle("outline-style").value,V=e.pstyle("outline-opacity").value*h,j=e.pstyle("outline-offset").value,re=e.pstyle("corner-radius").value;re!=="auto"&&(re=e.pstyle("corner-radius").pfValue);var ce=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k;o.eleFillStyle(r,e,Me)},se=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:K;o.colorStrokeStyle(r,N[0],N[1],N[2],Me)},Z=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(r,le[0],le[1],le[2],Me)},Q=function(Me,pe,L,oe){var ye=o.nodePathCache=o.nodePathCache||[],be=mR(L==="polygon"?L+","+oe.join(","):L,""+pe,""+Me,""+re),Ee=ye[be],qe,Ae=!1;return Ee!=null?(qe=Ee,Ae=!0,c.pathCache=qe):(qe=new Path2D,ye[be]=c.pathCache=qe),{path:qe,cacheHit:Ae}},ae=e.pstyle("shape").strValue,ne=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(d.x,d.y);var de=Q(s,l,ae,ne);p=de.path,E=de.cacheHit}var Ce=function(){if(!E){var Me=d;g&&(Me={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||r,Me.x,Me.y,s,l,re,c)}g?r.fill(p):r.fill()},ve=function(){for(var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,L=u.backgrounding,oe=0,ye=0;ye<T.length;ye++){var be=e.cy().style().getIndexedStyle(e,"background-image-containment","value",ye);if(pe&&be==="over"||!pe&&be==="inside"){oe++;continue}C[ye]&&T[ye].complete&&!T[ye].error&&(oe++,o.drawInscribedImage(r,T[ye],e,ye,Me))}u.backgrounding=oe!==S,L!==u.backgrounding&&e.updateStyle(!1)},U=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(r,e,pe),Me&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c)))},fe=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasStripe(e)&&(r.save(),g?r.clip(c.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c),r.clip()),o.drawStripe(r,e,pe),r.restore(),Me&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c)))},we=function(){var Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,pe=(I>0?I:-I)*Me,L=I>0?0:255;I!==0&&(o.colorFillStyle(r,L,L,L,pe),g?r.fill(p):r.fill())},ge=function(){if(M>0){if(r.lineWidth=M,r.lineCap=q,r.lineJoin=W,r.setLineDash)switch(z){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(X),r.lineDashOffset=Y;break;case"solid":case"double":r.setLineDash([]);break}if($!=="center"){if(r.save(),r.lineWidth*=2,$==="inside")g?r.clip(p):r.clip();else{var Me=new Path2D;Me.rect(-s/2-M,-l/2-M,s+2*M,l+2*M),Me.addPath(p),r.clip(Me,"evenodd")}g?r.stroke(p):r.stroke(),r.restore()}else g?r.stroke(p):r.stroke();if(z==="double"){r.lineWidth=M/3;var pe=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(p):r.stroke(),r.globalCompositeOperation=pe}r.setLineDash&&r.setLineDash([])}},me=function(){if(ee>0){if(r.lineWidth=ee,r.lineCap="butt",r.setLineDash)switch(G){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var Me=d;g&&(Me={x:0,y:0});var pe=o.getNodeShape(e),L=M;$==="inside"&&(L=0),$==="outside"&&(L*=2);var oe=(s+L+(ee+j))/s,ye=(l+L+(ee+j))/l,be=s*oe,Ee=l*ye,qe=o.nodeShapes[pe].points,Ae;if(g){var Ge=Q(be,Ee,pe,qe);Ae=Ge.path}if(pe==="ellipse")o.drawEllipsePath(Ae||r,Me.x,Me.y,be,Ee);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(pe)){var Fe=0,je=0,or=0;pe==="round-diamond"?Fe=(L+j+ee)*1.4:pe==="round-heptagon"?(Fe=(L+j+ee)*1.075,or=-(L/2+j+ee)/35):pe==="round-hexagon"?Fe=(L+j+ee)*1.12:pe==="round-pentagon"?(Fe=(L+j+ee)*1.13,or=-(L/2+j+ee)/15):pe==="round-tag"?(Fe=(L+j+ee)*1.12,je=(L/2+ee+j)*.07):pe==="round-triangle"&&(Fe=(L+j+ee)*(Math.PI/2),or=-(L+j/2+ee)/Math.PI),Fe!==0&&(oe=(s+Fe)/s,be=s*oe,["round-hexagon","round-tag"].includes(pe)||(ye=(l+Fe)/l,Ee=l*ye)),re=re==="auto"?AR(be,Ee):re;for(var nr=be/2,We=Ee/2,ur=re+(L+ee+j)/2,ar=new Array(qe.length/2),Gr=new Array(qe.length/2),Br=0;Br<qe.length/2;Br++)ar[Br]={x:Me.x+je+nr*qe[Br*2],y:Me.y+or+We*qe[Br*2+1]};var lt,kr,Kr,qr,Xr=ar.length;for(kr=ar[Xr-1],lt=0;lt<Xr;lt++)Kr=ar[lt%Xr],qr=ar[(lt+1)%Xr],Gr[lt]=Xm(kr,Kr,qr,ur),kr=Kr,Kr=qr;o.drawRoundPolygonPath(Ae||r,Me.x+je,Me.y+or,s*oe,l*ye,qe,Gr)}else if(["roundrectangle","round-rectangle"].includes(pe))re=re==="auto"?Aa(be,Ee):re,o.drawRoundRectanglePath(Ae||r,Me.x,Me.y,be,Ee,re+(L+ee+j)/2);else if(["cutrectangle","cut-rectangle"].includes(pe))re=re==="auto"?zm():re,o.drawCutRectanglePath(Ae||r,Me.x,Me.y,be,Ee,null,re+(L+ee+j)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(pe))re=re==="auto"?Aa(be,Ee):re,o.drawBottomRoundRectanglePath(Ae||r,Me.x,Me.y,be,Ee,re+(L+ee+j)/2);else if(pe==="barrel")o.drawBarrelPath(Ae||r,Me.x,Me.y,be,Ee);else if(pe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(pe)){var _n=(L+ee+j)/s;qe=Zu(Xu(qe,_n)),o.drawPolygonPath(Ae||r,Me.x,Me.y,s,l,qe)}else{var zr=(L+ee+j)/s;qe=Zu(Xu(qe,-zr)),o.drawPolygonPath(Ae||r,Me.x,Me.y,s,l,qe)}if(g?r.stroke(Ae):r.stroke(),G==="double"){r.lineWidth=L/3;var vn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(Ae):r.stroke(),r.globalCompositeOperation=vn}r.setLineDash&&r.setLineDash([])}},Re=function(){a&&o.drawNodeOverlay(r,e,d,s,l)},Ie=function(){a&&o.drawNodeUnderlay(r,e,d,s,l)},Be=function(){o.drawElementText(r,e,null,n)},Oe=e.pstyle("ghost").value==="yes";if(Oe){var He=e.pstyle("ghost-offset-x").pfValue,Ve=e.pstyle("ghost-offset-y").pfValue,Xe=e.pstyle("ghost-opacity").value,er=Xe*h;r.translate(He,Ve),Z(),me(),ce(Xe*k),Ce(),ve(er,!0),se(Xe*K),ge(),U(I!==0||M!==0),fe(I!==0||M!==0),ve(er,!1),we(er),r.translate(-He,-Ve)}g&&r.translate(-d.x,-d.y),Ie(),g&&r.translate(d.x,d.y),Z(),me(),ce(),Ce(),ve(h,!0),se(),ge(),U(I!==0||M!==0),fe(I!==0||M!==0),ve(h,!1),we(),g&&r.translate(-d.x,-d.y),Be(),Re(),t&&r.translate(b.x1,b.y1)}};var MA=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,a,i,o){var s=this;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,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(a=a||n.position(),i==null||o==null){var g=n.padding();i=n.width()+2*g,o=n.height()+2*g}s.colorFillStyle(t,c[0],c[1],c[2],u),s.nodeShapes[d].draw(t,a.x,a.y,i+l*2,o+l*2,h),t.fill()}}}};Na.drawNodeOverlay=MA("overlay");Na.drawNodeUnderlay=MA("underlay");Na.hasPie=function(r){return r=r[0],r._private.hasPie};Na.hasStripe=function(r){return r=r[0],r._private.hasStripe};Na.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),h=Math.min(c,d)/2,g,p=0,E=this.usePaths();if(E&&(l=0,u=0),i.units==="%"?h=h*i.pfValue:i.pfValue!==void 0&&(h=i.pfValue/2),o.units==="%"?g=h*o.pfValue:o.pfValue!==void 0&&(g=o.pfValue/2),!(g>=h))for(var m=1;m<=a.pieBackgroundN;m++){var b=e.pstyle("pie-"+m+"-background-size").value,w=e.pstyle("pie-"+m+"-background-color").value,x=e.pstyle("pie-"+m+"-background-opacity").value*t,C=b/100;C+p>1&&(C=1-p);var T=1.5*Math.PI+2*Math.PI*p;T+=s;var S=2*Math.PI*C,_=T+S;b===0||p>=1||p+C>1||(g===0?(r.beginPath(),r.moveTo(l,u),r.arc(l,u,h,T,_),r.closePath()):(r.beginPath(),r.arc(l,u,h,T,_),r.arc(l,u,g,_,T,!0),r.closePath()),this.colorFillStyle(r,w[0],w[1],w[2],x),r.fill(),p+=C)}};Na.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,o=n.y,s=e.width(),l=e.height(),u=0,c=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var g=s,p=l;h.units==="%"?(g=g*h.pfValue,p=p*h.pfValue):h.pfValue!==void 0&&(g=h.pfValue,p=h.pfValue),c&&(i=0,o=0),o-=g/2,i-=p/2;for(var E=1;E<=a.stripeBackgroundN;E++){var m=e.pstyle("stripe-"+E+"-background-size").value,b=e.pstyle("stripe-"+E+"-background-color").value,w=e.pstyle("stripe-"+E+"-background-opacity").value*t,x=m/100;x+u>1&&(x=1-u),!(m===0||u>=1||u+x>1)&&(r.beginPath(),r.rect(i,o+p*u,g,p*x),r.closePath(),this.colorFillStyle(r,b[0],b[1],b[2],w),r.fill(),u+=x)}r.restore()};var kt={},o3=100;kt.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};kt.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===r){t=!1;break}return t&&(n={context:r},e.push(n)),n};kt.createGradientStyleFor=function(r,e,t,n,a){var i,o=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(t.isEdge()){var u=t.sourceEndpoint(),c=t.targetEndpoint(),d=t.midpoint(),h=si(u,d),g=si(c,d);i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,g))}else{var p=o?{x:0,y:0}:t.position(),E=t.paddedWidth(),m=t.paddedHeight();i=r.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(E,m))}else if(t.isEdge()){var b=t.sourceEndpoint(),w=t.targetEndpoint();i=r.createLinearGradient(b.x,b.y,w.x,w.y)}else{var x=o?{x:0,y:0}:t.position(),C=t.paddedWidth(),T=t.paddedHeight(),S=C/2,_=T/2,A=t.pstyle("background-gradient-direction").value;switch(A){case"to-bottom":i=r.createLinearGradient(x.x,x.y-_,x.x,x.y+_);break;case"to-top":i=r.createLinearGradient(x.x,x.y+_,x.x,x.y-_);break;case"to-left":i=r.createLinearGradient(x.x+S,x.y,x.x-S,x.y);break;case"to-right":i=r.createLinearGradient(x.x-S,x.y,x.x+S,x.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(x.x-S,x.y-_,x.x+S,x.y+_);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(x.x-S,x.y+_,x.x+S,x.y-_);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(x.x+S,x.y-_,x.x-S,x.y+_);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(x.x+S,x.y+_,x.x-S,x.y-_);break}}if(!i)return null;for(var P=l.length===s.length,D=s.length,I=0;I<D;I++)i.addColorStop(P?l[I]:I/(D-1),"rgba("+s[I][0]+","+s[I][1]+","+s[I][2]+","+a+")");return i};kt.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a};kt.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"};kt.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(r,e,n,t);else{var a=e.pstyle("background-color").value;this.colorFillStyle(r,a[0],a[1],a[2],t)}};kt.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a};kt.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"};kt.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(r,e,n,t);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(r,a[0],a[1],a[2],t)}};kt.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var l=a*o,u=i*o,c;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 h=0;h<e.CANVAS_LAYERS;h++)c=t.canvases[h],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)c=t.bufferCanvases[h],c.width=l,c.height=u,c.style.width=a+"px",c.style.height=i+"px";e.textureMult=1,o<=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=o}};kt.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})};kt.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])};kt.render=function(r){var e=this;r=r||ER();var t=e.cy,n=r.forcedContext,a=r.drawAllLayers,i=r.drawOnlyNodeLayer,o=r.forcedZoom,s=r.forcedPan,l=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=r.motionBlur!==void 0?r.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,p=t.hasCompoundNodes(),E=e.hoverData.draggingEles,m=!!(e.hoverData.selecting||e.touchData.selecting);h=h&&!n&&e.motionBlurEnabled&&!m;var b=h;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),h&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(b=!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(),x=t.zoom(),C=o!==void 0?o:x,T=t.pan(),S={x:T.x,y:T.y},_={zoom:x,pan:{x:T.x,y:T.y}},A=e.prevViewport,P=A===void 0||_.zoom!==A.zoom||_.pan.x!==A.pan.x||_.pan.y!==A.pan.y;!P&&!(E&&!p)&&(e.motionBlurPxRatio=1),s&&(S=s),C*=l,S.x*=l,S.y*=l;var D=e.getCachedZSortedEles();function I(se,Z,Q,ae,ne){var de=se.globalCompositeOperation;se.globalCompositeOperation="destination-out",e.colorFillStyle(se,255,255,255,e.motionBlurTransparency),se.fillRect(Z,Q,ae,ne),se.globalCompositeOperation=de}function M(se,Z){var Q,ae,ne,de;!e.clearingMotionBlur&&(se===u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||se===u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(Q={x:T.x*g,y:T.y*g},ae=x*g,ne=e.canvasWidth*g,de=e.canvasHeight*g):(Q=S,ae=C,ne=e.canvasWidth,de=e.canvasHeight),se.setTransform(1,0,0,1,0,0),Z==="motionBlur"?I(se,0,0,ne,de):!n&&(Z===void 0||Z)&&se.clearRect(0,0,ne,de),a||(se.translate(Q.x,Q.y),se.scale(ae,ae)),s&&se.translate(s.x,s.y),o&&se.scale(o,o)}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 k=e.data.bufferContexts[e.TEXTURE_BUFFER];k.setTransform(1,0,0,1,0,0),k.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:k,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult});var _=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var N=u.contexts[e.NODE],z=e.textureCache.texture,_=e.textureCache.viewport;N.setTransform(1,0,0,1,0,0),h?I(N,0,0,_.width,_.height):N.clearRect(0,0,_.width,_.height);var W=w.core("outside-texture-bg-color").value,q=w.core("outside-texture-bg-opacity").value;e.colorFillStyle(N,W[0],W[1],W[2],q),N.fillRect(0,0,_.width,_.height);var x=t.zoom();M(N,!1),N.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l),N.drawImage(z,_.mpan.x,_.mpan.y,_.width/_.zoom/l,_.height/_.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var $=t.extent(),X=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),Y=e.hideEdgesOnViewport&&X,K=[];if(K[e.NODE]=!c[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,K[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),K[e.DRAG]=!c[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,K[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||a||i||K[e.NODE]){var ee=h&&!K[e.NODE]&&g!==1,N=n||(ee?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),le=h&&!ee?"motionBlur":void 0;M(N,le),Y?e.drawCachedNodes(N,D.nondrag,l,$):e.drawLayeredElements(N,D.nondrag,l,$),e.debug&&e.drawDebugPoints(N,D.nondrag),!a&&!h&&(c[e.NODE]=!1)}if(!i&&(c[e.DRAG]||a||K[e.DRAG])){var ee=h&&!K[e.DRAG]&&g!==1,N=n||(ee?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]);M(N,h&&!ee?"motionBlur":void 0),Y?e.drawCachedNodes(N,D.drag,l,$):e.drawCachedElements(N,D.drag,l,$),e.debug&&e.drawDebugPoints(N,D.drag),!a&&!h&&(c[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,M),h&&g!==1){var G=u.contexts[e.NODE],V=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],j=u.contexts[e.DRAG],re=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ce=function(Z,Q,ae){Z.setTransform(1,0,0,1,0,0),ae||!b?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):I(Z,0,0,e.canvasWidth,e.canvasHeight);var ne=g;Z.drawImage(Q,0,0,e.canvasWidth*ne,e.canvasHeight*ne,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||K[e.NODE])&&(ce(G,V,K[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||K[e.DRAG])&&(ce(j,re,K[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=_,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),h&&(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()},o3)),n||t.emit("render")};var qo;kt.drawSelectionRectangle=function(r,e){var t=this,n=t.cy,a=t.data,i=n.style(),o=r.drawOnlyNodeLayer,s=r.drawAllLayers,l=a.canvasNeedsRedraw,u=r.forcedContext;if(t.showFps||!o&&l[t.SELECT_BOX]&&!s){var c=u||a.contexts[t.SELECT_BOX];if(e(c),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),h=i.core("selection-box-border-width").value/d;c.lineWidth=h,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]),h>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){var d=t.cy.zoom(),g=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(g.x,g.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var p=t.lastRedrawTime;if(t.showFps&&p){p=Math.round(p);var E=Math.round(1e3/p),m="1 frame = "+p+" ms = "+E+" 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",!qo){var b=c.measureText(m);qo=b.actualBoundingBoxAscent}c.fillText(m,0,qo);var w=60;c.strokeRect(0,qo+10,250,20),c.fillRect(0,qo+10,250*Math.min(E/w,1),20)}s||(l[t.SELECT_BOX]=!1)}};function uE(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 s3(r,e,t){var n=uE(r,r.VERTEX_SHADER,e),a=uE(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}function u3(r,e,t){t===void 0&&(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 e0(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 l3(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function f3(r,e,t,n,a){var i=n*t+e.x,o=a*t+e.y;return o=Math.round(r.canvasHeight-o),[i,o]}function c3(r){return r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function d3(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 Ja(r,e,t){var n=r[0]/255,a=r[1]/255,i=r[2]/255,o=e,s=t||new Array(4);return s[0]=n*o,s[1]=a*o,s[2]=i*o,s[3]=o,s}function Vi(r,e){var t=e||new Array(4);return t[0]=(r>>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function v3(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function h3(r,e){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}function LA(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 OA(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function g3(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 p3(r,e,t,n){var a=LA(r,e),i=Yr(a,2),o=i[0],s=i[1],l=OA(r,s,n),u=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),s===r.FLOAT?r.vertexAttribPointer(t,o,s,!1,0,0):s===r.INT&&r.vertexAttribIPointer(t,o,s,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),u}function Pn(r,e,t,n){var a=LA(r,t),i=Yr(a,3),o=i[0],s=i[1],l=i[2],u=OA(r,s,e*o),c=o*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*c,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),s===r.FLOAT?r.vertexAttribPointer(n,o,s,!1,c,0):s===r.INT&&r.vertexAttribIPointer(n,o,s,c,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var h=new Array(e),g=0;g<e;g++)h[g]=g3(r,s,u,c,o,g);return d.dataArray=u,d.stride=c,d.size=o,d.getView=function(p){return h[p]},d.setPoint=function(p,E,m){var b=h[p];b[0]=E,b[1]=m},d.bufferSubData=function(p){r.bindBuffer(r.ARRAY_BUFFER,d),p?r.bufferSubData(r.ARRAY_BUFFER,0,u,0,p*o):r.bufferSubData(r.ARRAY_BUFFER,0,u)},d}function y3(r,e,t){for(var n=9,a=new Float32Array(e*n),i=new Array(e),o=0;o<e;o++){var s=o*n*4;i[o]=new Float32Array(a.buffer,s,n)}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,u*12),r.vertexAttribDivisor(c,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),l.getMatrixView=function(d){return i[d]},l.setData=function(d,h){i[h].set(d,0)},l.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferSubData(r.ARRAY_BUFFER,0,a)},l}function m3(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}var lE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});function Od(){var r=new lE(9);return lE!=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 fE(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 b3(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=t[0],g=t[1],p=t[2],E=t[3],m=t[4],b=t[5],w=t[6],x=t[7],C=t[8];return r[0]=h*n+g*o+p*u,r[1]=h*a+g*s+p*c,r[2]=h*i+g*l+p*d,r[3]=E*n+m*o+b*u,r[4]=E*a+m*s+b*c,r[5]=E*i+m*l+b*d,r[6]=w*n+x*o+C*u,r[7]=w*a+x*s+C*c,r[8]=w*i+x*l+C*d,r}function Vu(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=t[0],g=t[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=s,r[5]=l,r[6]=h*n+g*o+u,r[7]=h*a+g*s+c,r[8]=h*i+g*l+d,r}function cE(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=Math.sin(t),g=Math.cos(t);return r[0]=g*n+h*o,r[1]=g*a+h*s,r[2]=g*i+h*l,r[3]=g*o-h*n,r[4]=g*s-h*a,r[5]=g*l-h*i,r[6]=u,r[7]=c,r[8]=d,r}function Sm(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}function w3(r,e,t){return 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,r}var x3=(function(){function r(e,t,n,a){La(this,r),this.debugID=Math.floor(Math.random()*1e4),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")}return Oa(r,[{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,i=this.texHeight,o=this.texSize,s=i/a,l=n*s,u=a*s;return l>o&&(s=o/n,l=n*s,u=a*s),{scale:s,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 o=this.texSize,s=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,h=u.texH,g=function(x,C){if(a&&C){var T=C.context,S=x.x,_=x.row,A=S,P=l*_;T.save(),T.translate(A,P),T.scale(c,c),a(T,n),T.restore()}},p=[null,null],E=function(){g(i.freePointer,i.canvas),p[0]={x:i.freePointer.x,y:i.freePointer.row*l,w:d,h},p[1]={x:i.freePointer.x+d,y:i.freePointer.row*l,w:0,h},i.freePointer.x+=d,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},m=function(){var x=i.scratch,C=i.canvas;x.clear(),g({x:0,row:0},x);var T=o-i.freePointer.x,S=d-T,_=l;{var A=i.freePointer.x,P=i.freePointer.row*l,D=T;C.context.drawImage(x,0,0,D,_,A,P,D,_),p[0]={x:A,y:P,w:D,h}}{var I=T,M=(i.freePointer.row+1)*l,k=S;C&&C.context.drawImage(x,I,0,k,_,0,M,k,_),p[1]={x:0,y:M,w:k,h}}i.freePointer.x=S,i.freePointer.row++},b=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=o)E();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(b(),E()):this.enableWrapping?m():(b(),E())}return this.keyToLocation.set(t,p),this.needsBuffer=!0,p}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(t),o=i.texW;return this.freePointer.x+o>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=h3(t,this.debugID)),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}}])})(),E3=(function(){function r(e,t,n,a){La(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Oa(r,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new x3(t,n,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas,o=Math.floor(n/a);this.scratch=i(t,n,o,"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||!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(n.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,o=null,s=$t(this.atlases),l;try{var u=function(){var d=l.value,h=d.getKeys(),g=C3(n,h);if(g.size===0)return a.push(d),h.forEach(function(T){return i.set(T,d)}),1;o||(o=t._createAtlas(),a.push(o));var p=$t(h),E;try{for(p.s();!(E=p.n()).done;){var m=E.value;if(!g.has(m)){var b=d.getOffsets(m),w=Yr(b,2),x=w[0],C=w[1];o.canFit({w:x.w+C.w,h:x.h})||(o.lock(),o=t._createAtlas(),a.push(o)),d.canvas&&(t._copyTextureToNewAtlas(m,d,o),i.set(m,o))}}}catch(T){p.e(T)}finally{p.f()}d.dispose()};for(s.s();!(l=s.n()).done;)u()}catch(c){s.e(c)}finally{s.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(t,n,a){var i=n.getOffsets(t),o=Yr(i,2),s=o[0],l=o[1];if(l.w===0)a.draw(t,s,function(h){h.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,s.w,0,l.w,l.h);var c=s.w+l.w,d=s.h;a.draw(t,{w:c,h:d},function(h){h.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}}}])})();function C3(r,e){return r.intersection?r.intersection(e):new Set(Hu(r).filter(function(t){return e.has(t)}))}var _3=(function(){function r(e,t){La(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}return Oa(r,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var a=this.globalOptions,i=a.webglTexSize,o=a.createTextureCanvas,s=n.texRows,l=this._cacheScratchCanvas(o),u=new E3(this.r,i,s,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),o=Ye({type:t,atlasCollection:i},n);this.renderTypes.set(t,o)}},{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(o,s,l,u){return u?((!i||s!=n||l!=a)&&(n=s,a=l,i=t(o,s,l)),i):t(o,s,l)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,o=i===void 0?!1:i,s=a.filterEle,l=s===void 0?function(){return!0}:s,u=a.filterType,c=u===void 0?function(){return!0}:u,d=!1,h=!1,g=$t(t),p;try{for(g.s();!(p=g.n()).done;){var E=p.value;if(l(E)){var m=$t(this.renderTypes.values()),b;try{var w=function(){var C=b.value,T=C.type;if(c(T)){var S=n.collections.get(C.collection),_=C.getKey(E),A=Array.isArray(_)?_:[_];if(o)A.forEach(function(M){return S.markKeyForGC(M)}),h=!0;else{var P=C.getID?C.getID(E):E.id(),D=n._key(T,P),I=n.typeAndIdToKey.get(D);I!==void 0&&!d3(A,I)&&(d=!0,n.typeAndIdToKey.delete(D),I.forEach(function(M){return S.markKeyForGC(M)}))}}};for(m.s();!(b=m.n()).done;)w()}catch(x){m.e(x)}finally{m.f()}}}}catch(x){g.e(x)}finally{g.f()}return h&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var t=$t(this.collections.values()),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,a,i){var o=this.renderTypes.get(n),s=this.collections.get(o.collection),l=!1,u=s.draw(i,a,function(h){o.drawClipped?(h.save(),h.beginPath(),h.rect(0,0,a.w,a.h),h.clip(),o.drawElement(h,t,a,!0,!0),h.restore()):o.drawElement(h,t,a,!0,!0),l=!0});if(l){var c=o.getID?o.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),o=i.getKey(t),s=Array.isArray(o)?o:[o];return s.map(function(l){var u=i.getBoundingBox(t,l),c=a.getOrCreateAtlas(t,n,u,l),d=c.getOffsets(l),h=Yr(d,2),g=h[0],p=h[1];return{atlas:c,tex:g,tex1:g,tex2:p,bb:u}})}},{key:"getDebugInfo",value:function(){var t=[],n=$t(this.collections),a;try{for(n.s();!(a=n.n()).done;){var i=Yr(a.value,2),o=i[0],s=i[1],l=s.getCounts(),u=l.keyCount,c=l.atlasCount;t.push({type:o,keyCount:u,atlasCount:c})}}catch(d){n.e(d)}finally{n.f()}return t}}])})(),S3=(function(){function r(e){La(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Oa(r,[{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):!0}},{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}}])})(),T3=`
|
|
40
|
+
*/var RA=function(e,t){this.recycle(e,t)};function Vo(){return!1}function Mu(){return!0}RA.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Vo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Mu:Vo):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type!=null?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,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=Mu;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Mu;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Mu,this.stopPropagation()},isDefaultPrevented:Vo,isPropagationStopped:Vo,isImmediatePropagationStopped:Vo};var AA=/^([^.]+)(\.(?:[^.]+))?$/,b$=".*",PA={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},fE=Object.keys(PA),w$={};function Pl(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w$,e=arguments.length>1?arguments[1]:void 0,t=0;t<fE.length;t++){var n=fE[t];this[n]=r[n]||PA[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var ka=Pl.prototype,IA=function(e,t,n,a,i,o,s){$r(a)&&(i=a,a=null),s&&(o==null?o=s:o=Ze({},o,s));for(var u=Tr(n)?n:n.split(/\s+/),l=0;l<u.length;l++){var f=u[l];if(!Da(f)){var d=f.match(AA);if(d){var h=d[1],g=d[2]?d[2]:null,p=t(e,f,h,g,a,i,o);if(p===!1)break}}}},cE=function(e,t){return e.addEventFields(e.context,t),new RA(t.type,t)},x$=function(e,t,n){if(RN(n)){t(e,n);return}else if(yr(n)){t(e,cE(e,n));return}for(var a=Tr(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!Da(o)){var s=o.match(AA);if(s){var u=s[1],l=s[2]?s[2]:null,f=cE(e,{type:u,namespace:l,target:e.context});t(e,f)}}}};ka.on=ka.addListener=function(r,e,t,n,a){return IA(this,function(i,o,s,u,l,f,d){$r(f)&&i.listeners.push({event:o,callback:f,type:s,namespace:u,qualifier:l,conf:d})},r,e,t,n,a),this};ka.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})};ka.removeListener=ka.off=function(r,e,t,n){var a=this;this.emitting!==0&&(this.listeners=lF(this.listeners));for(var i=this.listeners,o=function(l){var f=i[l];IA(a,function(d,h,g,p,x,b){if((f.type===g||r==="*")&&(!p&&f.namespace!==".*"||f.namespace===p)&&(!x||d.qualifierCompare(f.qualifier,x))&&(!b||f.callback===b))return i.splice(l,1),!1},r,e,t,n)},s=i.length-1;s>=0;s--)o(s);return this};ka.removeAllListeners=function(){return this.removeListener("*")};ka.emit=ka.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Tr(e)||(e=[e]),x$(this,function(i,o){t!=null&&(n=[{event:o.event,type:o.type,namespace:o.namespace,callback:t}],a=n.length);for(var s=function(){var f=n[u];if(f.type===o.type&&(!f.namespace||f.namespace===o.namespace||f.namespace===b$)&&i.eventMatches(i.context,f,o)){var d=[o];e!=null&&cF(d,e),i.beforeEmit(i.context,f,o),f.conf&&f.conf.one&&(i.listeners=i.listeners.filter(function(p){return p!==f}));var h=i.callbackContext(i.context,f,o),g=f.callback.apply(h,d);i.afterEmit(i.context,f,o),g===!1&&(o.stopPropagation(),o.preventDefault())}},u=0;u<a;u++)s();i.bubble(i.context)&&!o.isPropagationStopped()&&i.parent(i.context).emit(o,e)},r),this.emitting--,this};var E$={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&xs(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Lu=function(e){return Ye(e)?new La(e):e},DA={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Pl(E$,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=Lu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n)}return this},removeListener:function(e,t,n){for(var a=Lu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().removeListener(e,a,n)}return this},removeAllListeners:function(){for(var e=0;e<this.length;e++){var t=this[e];t.emitter().removeAllListeners()}return this},one:function(e,t,n){for(var a=Lu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().one(e,a,n)}return this},once:function(e,t,n){for(var a=Lu(t),i=0;i<this.length;i++){var o=this[i];o.emitter().on(e,a,n,{once:!0,onceCollection:this})}},emit:function(e,t){for(var n=0;n<this.length;n++){var a=this[n];a.emitter().emit(e,t)}return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};Er.eventAliasesOn(DA);var BA={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(e===void 0)return this;if(Ye(e)||Jt(e))return new La(e).filter(this);if($r(e)){for(var n=this.spawn(),a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);s&&n.push(o)}return n}return this.spawn()},not:function(e){if(e){Ye(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var a=this[n],i=e.has(a);i||t.push(a)}return t}else return this},absoluteComplement:function(){var e=this.cy();return e.mutableElements().not(this)},intersect:function(e){if(Ye(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),a=this,i=e,o=this.length<e.length,s=o?a:i,u=o?i:a,l=0;l<s.length;l++){var f=s[l];u.has(f)&&n.push(f)}return n},xor:function(e){var t=this._private.cy;Ye(e)&&(e=t.$(e));var n=this.spawn(),a=this,i=e,o=function(u,l){for(var f=0;f<u.length;f++){var d=u[f],h=d._private.data.id,g=l.hasElementWithId(h);g||n.push(d)}};return o(a,i),o(i,a),n},diff:function(e){var t=this._private.cy;Ye(e)&&(e=t.$(e));var n=this.spawn(),a=this.spawn(),i=this.spawn(),o=this,s=e,u=function(f,d,h){for(var g=0;g<f.length;g++){var p=f[g],x=p._private.data.id,b=d.hasElementWithId(x);b?i.merge(p):h.push(p)}};return u(o,s,n),u(s,o,a),{left:n,right:a,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(Ye(e)){var n=e;e=t.mutableElements().filter(n)}for(var a=this.spawnSelf(),i=0;i<e.length;i++){var o=e[i],s=!this.has(o);s&&a.push(o)}return a},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&Ye(e)){var a=e;e=n.mutableElements().filter(a)}for(var i=t.map,o=0;o<e.length;o++){var s=e[o],u=s._private.data.id,l=!i.has(u);if(l){var f=this.length++;this[f]=s,i.set(u,{ele:s,index:f})}}return this},unmergeAt:function(e){var t=this[e],n=t.id(),a=this._private,i=a.map;this[e]=void 0,i.delete(n);var o=e===this.length-1;if(this.length>1&&!o){var s=this.length-1,u=this[s],l=u._private.data.id;this[s]=void 0,this[e]=u,i.set(l,{ele:u,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,a=t.map,i=a.get(n);if(!i)return this;var o=i.index;return this.unmergeAt(o),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&Ye(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--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],a=this,i=0;i<a.length;i++){var o=a[i],s=t?e.apply(t,[o,i,a]):e(o,i,a);n.push(s)}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 n=-1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],u=t?e.apply(t,[s,o,i]):e(s,o,i);u>n&&(n=u,a=s)}return{value:n,ele:a}},min:function(e,t){for(var n=1/0,a,i=this,o=0;o<i.length;o++){var s=i[o],u=t?e.apply(t,[s,o,i]):e(s,o,i);u<n&&(n=u,a=s)}return{value:n,ele:a}}},mr=BA;mr.u=mr["|"]=mr["+"]=mr.union=mr.or=mr.add;mr["\\"]=mr["!"]=mr["-"]=mr.difference=mr.relativeComplement=mr.subtract=mr.not;mr.n=mr["&"]=mr["."]=mr.and=mr.intersection=mr.intersect;mr["^"]=mr["(+)"]=mr["(-)"]=mr.symmetricDifference=mr.symdiff=mr.xor;mr.fnFilter=mr.filterFn=mr.stdFilter=mr.filter;mr.complement=mr.abscomp=mr.absoluteComplement;var C$={isNode:function(){return this.group()==="nodes"},isEdge:function(){return this.group()==="edges"},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},MA=function(e,t){var n=e.cy(),a=n.hasCompoundNodes();function i(f){var d=f.pstyle("z-compound-depth");return d.value==="auto"?a?f.zDepth():0:d.value==="bottom"?-1:d.value==="top"?Ym:0}var o=i(e)-i(t);if(o!==0)return o;function s(f){var d=f.pstyle("z-index-compare");return d.value==="auto"&&f.isNode()?1:0}var u=s(e)-s(t);if(u!==0)return u;var l=e.pstyle("z-index").value-t.pstyle("z-index").value;return l!==0?l:e.poolIndex()-t.poolIndex()},sl={forEach:function(e,t){if($r(e))for(var n=this.length,a=0;a<n;a++){var i=this[a],o=t?e.apply(t,[i,a,this]):e(i,a,this);if(o===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],a=this.length;t==null&&(t=a),e==null&&(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 this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!$r(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(MA)},zDepth:function(){var e=this[0];if(e){var t=e._private,n=t.group;if(n==="nodes"){var a=t.data.parent?e.parents().size():0;return e.isParent()?a:Ym-1}else{var i=t.source,o=t.target,s=i.zDepth(),u=o.zDepth();return Math.max(s,u,0)}}}};sl.each=sl.forEach;var _$=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":at(Symbol))!=e&&at(Symbol.iterator)!=e;t&&(sl[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return DR({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};_$();var S$=wt({nodeDimensionsIncludeLabels:!1}),Gu={layoutDimensions:function(e){e=S$(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var a=this.nodes().filter(function(S){return!S.isParent()}),i=this.cy(),o=t.eles,s=function(R){return R.id()},u=lo(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var l=function(R,_,A){var P={x:_.x1+_.w/2,y:_.y1+_.h/2},I={x:(A.x-P.x)*R,y:(A.y-P.y)*R};return{x:P.x+I.x,y:P.y+I.y}},f=t.spacingFactor&&t.spacingFactor!==1,d=function(){if(!f)return null;for(var R=Lt(),_=0;_<a.length;_++){var A=a[_],P=u(A,_);ZR(R,P.x,P.y)}return R},h=d(),g=lo(function(S,R){var _=u(S,R);if(f){var A=Math.abs(t.spacingFactor);_=l(A,h,_)}return t.transform!=null&&(_=t.transform(S,_)),_},s);if(t.animate){for(var p=0;p<a.length;p++){var x=a[p],b=g(x,p),w=t.animateFilter==null||t.animateFilter(x,p);if(w){var y=x.animation({position:b,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(y)}else x.position(b)}if(t.fit){var E=i.animation({fit:{boundingBox:o.boundingBoxAt(g),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(E)}else if(t.zoom!==void 0&&t.pan!==void 0){var C=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(C)}e.animations.forEach(function(S){return S.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),po.all(e.animations.map(function(S){return S.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else a.positions(g),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&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){var t=this.cy();return t.makeLayout(Ze({},e,{eles:this}))}};Gu.createLayout=Gu.makeLayout=Gu.layout;function LA(r,e,t){var n=t._private,a=n.styleCache=n.styleCache||[],i;return(i=a[r])!=null||(i=a[r]=e(t)),i}function Il(r,e){return r=ci(r),function(n){return LA(r,e,n)}}function Dl(r,e){r=ci(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return LA(r,t,a)}}var mt={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),a=t.styleEnabled();return n&&a&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(i){return i._private.styleCache=null};if(e.hasCompoundNodes()){var n;n=this.spawnSelf().merge(this.descendants()).merge(this.parents()),n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(a){t(a),a.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching()){var n=t._private.batchStyleEles;return n.merge(this),this}var a=t.hasCompoundNodes(),i=this;e=!!(e||e===void 0),a&&(i=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var o=i;return e?o.emitAndNotify("style"):o.emit("style"),i.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],a=n.cy();if(a.styleEnabled()&&n){n._private.styleDirty&&(n._private.styleDirty=!1,a.style().apply(n));var i=n._private.style[e];return i??(t?a.style().getDefaultProperty(e):null)}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue!==void 0?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var a=!1,i=n.style();if(yr(e)){var o=e;i.applyBypass(this,o,a),this.emitAndNotify("style")}else if(Ye(e))if(t===void 0){var s=this[0];return s?i.getStylePropertyValue(s,e):void 0}else i.applyBypass(this,e,t,a),this.emitAndNotify("style");else if(e===void 0){var u=this[0];return u?i.getRawStyle(u):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,a=t.style(),i=this;if(e===void 0)for(var o=0;o<i.length;o++){var s=i[o];a.removeAllBypasses(s,n)}else{e=e.split(/\s+/);for(var u=0;u<i.length;u++){var l=i[u];a.removeBypasses(l,e,n)}}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var a=n._private,i=n.pstyle("opacity").value;if(!t)return i;var o=a.data.parent?n.parents():null;if(o)for(var s=0;s<o.length;s++){var u=o[s],l=u.pstyle("opacity").value;i=l*i}return i}},transparent:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();if(t)return n?t.effectiveOpacity()===0:t.pstyle("opacity").value===0},backgrounding:function(){var e=this.cy();if(!e.styleEnabled())return!1;var t=this[0];return!!t._private.backgrounding}};function rv(r,e){var t=r._private,n=t.data.parent?r.parents():null;if(n)for(var a=0;a<n.length;a++){var i=n[a];if(!e(i))return!1}return!0}function s0(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],o=a.hasCompoundNodes();if(i){var s=i._private;if(!e(i))return!1;if(i.isNode())return!o||rv(i,n);var u=s.source,l=s.target;return t(u)&&(!o||rv(u,t))&&(u===l||t(l)&&(!o||rv(l,t)))}}}var yo=Il("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});mt.takesUpSpace=Dl("takesUpSpace",s0({ok:yo}));var T$=Il("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&yo(r)}),R$=Il("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&yo(r)});mt.interactive=Dl("interactive",s0({ok:T$,parentOk:R$,edgeOkViaNode:yo}));mt.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var A$=Il("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&yo(r)}),P$=yo;mt.visible=Dl("visible",s0({ok:A$,edgeOkViaNode:P$}));mt.hidden=function(){var r=this[0];if(r)return!r.visible()};mt.isBundledBezier=Dl("isBundledBezier",function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle("curve-style").value==="bezier"&&this.takesUpSpace():!1});mt.bypass=mt.css=mt.style;mt.renderedCss=mt.renderedStyle;mt.removeBypass=mt.removeCss=mt.removeStyle;mt.pstyle=mt.parsedStyle;var Aa={};function dE(r){return function(){var e=arguments,t=[];if(e.length===2){var n=e[0],a=e[1];this.on(r.event,n,a)}else if(e.length===1&&$r(e[0])){var i=e[0];this.on(r.event,i)}else if(e.length===0||e.length===1&&Tr(e[0])){for(var o=e.length===1?e[0]:null,s=0;s<this.length;s++){var u=this[s],l=!r.ableField||u._private[r.ableField],f=u._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(u);if(d!==void 0&&(l=d,!d))return this}l&&(u._private[r.field]=r.value,f&&t.push(u))}var h=this.spawn(t);h.updateStyle(),h.emit(r.event),o&&h.emit(o)}return this}}function mo(r){Aa[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(t!==void 0)return t}return e._private[r.field]}},Aa[r.on]=dE({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),Aa[r.off]=dE({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}mo({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});mo({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});mo({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});mo({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});Aa.deselect=Aa.unselect;Aa.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};mo({field:"active",on:"activate",off:"unactivate"});mo({field:"pannable",on:"panify",off:"unpanify"});Aa.inactive=function(){var r=this[0];if(r)return!r._private.active};var Tt={},vE=function(e){return function(n){for(var a=this,i=[],o=0;o<a.length;o++){var s=a[o];if(s.isNode()){for(var u=!1,l=s.connectedEdges(),f=0;f<l.length;f++){var d=l[f],h=d.source(),g=d.target();if(e.noIncomingEdges&&g===s&&h!==s||e.noOutgoingEdges&&h===s&&g!==s){u=!0;break}}u||i.push(s)}}return this.spawn(i,!0).filter(n)}},hE=function(e){return function(t){for(var n=this,a=[],i=0;i<n.length;i++){var o=n[i];if(o.isNode())for(var s=o.connectedEdges(),u=0;u<s.length;u++){var l=s[u],f=l.source(),d=l.target();e.outgoing&&f===o?(a.push(l),a.push(d)):e.incoming&&d===o&&(a.push(l),a.push(f))}}return this.spawn(a,!0).filter(t)}},gE=function(e){return function(t){for(var n=this,a=[],i={};;){var o=e.outgoing?n.outgoers():n.incomers();if(o.length===0)break;for(var s=!1,u=0;u<o.length;u++){var l=o[u],f=l.id();i[f]||(i[f]=!0,a.push(l),s=!0)}if(!s)break;n=o}return this.spawn(a,!0).filter(t)}};Tt.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};Ze(Tt,{roots:vE({noIncomingEdges:!0}),leaves:vE({noOutgoingEdges:!0}),outgoers:hn(hE({outgoing:!0}),"outgoers"),successors:gE({outgoing:!0}),incomers:hn(hE({incoming:!0}),"incomers"),predecessors:gE({})});Ze(Tt,{neighborhood:hn(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var a=t[n],i=a.connectedEdges(),o=0;o<i.length;o++){var s=i[o],u=s.source(),l=s.target(),f=a===u?l:u;f.length>0&&e.push(f[0]),e.push(s[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)}});Tt.neighbourhood=Tt.neighborhood;Tt.closedNeighbourhood=Tt.closedNeighborhood;Tt.openNeighbourhood=Tt.openNeighborhood;Ze(Tt,{source:hn(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:hn(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:pE({attr:"source"}),targets:pE({attr:"target"})});function pE(r){return function(t){for(var n=[],a=0;a<this.length;a++){var i=this[a],o=i._private[r.attr];o&&n.push(o)}return this.spawn(n,!0).filter(t)}}Ze(Tt,{edgesWith:hn(yE(),"edgesWith"),edgesTo:hn(yE({thisIsSrc:!0}),"edgesTo")});function yE(r){return function(t){var n=[],a=this._private.cy,i=r||{};Ye(t)&&(t=a.$(t));for(var o=0;o<t.length;o++)for(var s=t[o]._private.edges,u=0;u<s.length;u++){var l=s[u],f=l._private.data,d=this.hasElementWithId(f.source)&&t.hasElementWithId(f.target),h=t.hasElementWithId(f.source)&&this.hasElementWithId(f.target),g=d||h;g&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!d||i.thisIsTgt&&!h)||n.push(l))}return this.spawn(n,!0)}}Ze(Tt,{connectedEdges:hn(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];if(a.isNode())for(var i=a._private.edges,o=0;o<i.length;o++){var s=i[o];e.push(s)}}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:hn(function(r){for(var e=[],t=this,n=0;n<t.length;n++){var a=t[n];a.isEdge()&&(e.push(a.source()[0]),e.push(a.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:hn(mE(),"parallelEdges"),codirectedEdges:hn(mE({codirected:!0}),"codirectedEdges")});function mE(r){var e={codirected:!1};return r=Ze({},e,r),function(n){for(var a=[],i=this.edges(),o=r,s=0;s<i.length;s++)for(var u=i[s],l=u._private,f=l.source,d=f._private.data.id,h=l.data.target,g=f._private.edges,p=0;p<g.length;p++){var x=g[p],b=x._private.data,w=b.target,y=b.source,E=w===h&&y===d,C=d===w&&h===y;(o.codirected&&E||!o.codirected&&(E||C))&&a.push(x)}return this.spawn(a,!0).filter(n)}}Ze(Tt,{components:function(e){var t=this,n=t.cy(),a=n.collection(),i=e==null?t.nodes():e.nodes(),o=[];e!=null&&i.empty()&&(i=e.sources());var s=function(f,d){a.merge(f),i.unmerge(f),d.merge(f)};if(i.empty())return t.spawn();var u=function(){var f=n.collection();o.push(f);var d=i[0];s(d,f),t.bfs({directed:!1,roots:d,visit:function(g){return s(g,f)}}),f.forEach(function(h){h.connectedEdges().forEach(function(g){t.has(g)&&f.has(g.source())&&f.has(g.target())&&f.merge(g)})})};do u();while(i.length>0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}});Tt.componentsOf=Tt.components;var bt=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){kr("A collection must have a reference to the core");return}var i=new ra,o=!1;if(!t)t=[];else if(t.length>0&&yr(t[0])&&!xs(t[0])){o=!0;for(var s=[],u=new go,l=0,f=t.length;l<f;l++){var d=t[l];d.data==null&&(d.data={});var h=d.data;if(h.id==null)h.id=jR();else if(e.hasElementWithId(h.id)||u.has(h.id))continue;var g=new xl(e,d,!1);s.push(g),u.add(h.id)}t=s}this.length=0;for(var p=0,x=t.length;p<x;p++){var b=t[p][0];if(b!=null){var w=b._private.data.id;(!n||!i.has(w))&&(n&&i.set(w,{index:this.length,ele:b}),this[this.length]=b,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap==null&&this.rebuildMap(),this.lazyMap},set map(y){this.lazyMap=y},rebuildMap:function(){for(var E=this.lazyMap=new ra,C=this.eles,S=0;S<C.length;S++){var R=C[S];E.set(R.id(),{index:S,ele:R})}}},n&&(this._private.map=i),o&&!a&&this.restore()},Ir=xl.prototype=bt.prototype=Object.create(Array.prototype);Ir.instanceString=function(){return"collection"};Ir.spawn=function(r,e){return new bt(this.cy(),r,e)};Ir.spawnSelf=function(){return this.spawn(this)};Ir.cy=function(){return this._private.cy};Ir.renderer=function(){return this._private.cy.renderer()};Ir.element=function(){return this[0]};Ir.collection=function(){return LR(this)?this:new bt(this._private.cy,[this])};Ir.unique=function(){return new bt(this._private.cy,this,!0)};Ir.hasElementWithId=function(r){return r=""+r,this._private.map.has(r)};Ir.getElementById=function(r){r=""+r;var e=this._private.cy,t=this._private.map.get(r);return t?t.ele:new bt(e)};Ir.$id=Ir.getElementById;Ir.poolIndex=function(){var r=this._private.cy,e=r._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index};Ir.indexOf=function(r){var e=r[0]._private.data.id;return this._private.map.get(e).index};Ir.indexOfId=function(r){return r=""+r,this._private.map.get(r).index};Ir.json=function(r){var e=this.element(),t=this.cy();if(e==null&&r)return this;if(e!=null){var n=e._private;if(yr(r)){if(t.startBatch(),r.data){e.data(r.data);var a=n.data;if(e.isEdge()){var i=!1,o={},s=r.data.source,u=r.data.target;s!=null&&s!=a.source&&(o.source=""+s,i=!0),u!=null&&u!=a.target&&(o.target=""+u,i=!0),i&&(e=e.move(o))}else{var l="parent"in r.data,f=r.data.parent;l&&(f!=null||a.parent!=null)&&f!=a.parent&&(f===void 0&&(f=null),f!=null&&(f=""+f),e=e.move({parent:f}))}}r.position&&e.position(r.position);var d=function(x,b,w){var y=r[x];y!=null&&y!==n[x]&&(y?e[b]():e[w]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),r.classes!=null&&e.classes(r.classes),t.endBatch(),this}else if(r===void 0){var h={data:Nn(n.data),position:Nn(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:null};h.classes="";var g=0;return n.classes.forEach(function(p){return h.classes+=g++===0?p:" "+p}),h}}};Ir.jsons=function(){for(var r=[],e=0;e<this.length;e++){var t=this[e],n=t.json();r.push(n)}return r};Ir.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var n=this[t],a=n.json(),i=new xl(r,a,!1);e.push(i)}return new bt(r,e)};Ir.copy=Ir.clone;Ir.restore=function(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=t.cy(),a=n._private,i=[],o=[],s,u=0,l=t.length;u<l;u++){var f=t[u];e&&!f.removed()||(f.isNode()?i.push(f):o.push(f))}s=i.concat(o);var d,h=function(){s.splice(d,1),d--};for(d=0;d<s.length;d++){var g=s[d],p=g._private,x=p.data;if(g.clearTraversalCache(),!(!e&&!p.removed)){if(x.id===void 0)x.id=jR();else if(qe(x.id))x.id=""+x.id;else if(Da(x.id)||!Ye(x.id)){kr("Can not create element with invalid string ID `"+x.id+"`"),h();continue}else if(n.hasElementWithId(x.id)){kr("Can not create second element with ID `"+x.id+"`"),h();continue}}var b=x.id;if(g.isNode()){var w=p.position;w.x==null&&(w.x=0),w.y==null&&(w.y=0)}if(g.isEdge()){for(var y=g,E=["source","target"],C=E.length,S=!1,R=0;R<C;R++){var _=E[R],A=x[_];qe(A)&&(A=x[_]=""+x[_]),A==null||A===""?(kr("Can not create edge `"+b+"` with unspecified "+_),S=!0):n.hasElementWithId(A)||(kr("Can not create edge `"+b+"` with nonexistant "+_+" `"+A+"`"),S=!0)}if(S){h();continue}var P=n.getElementById(x.source),I=n.getElementById(x.target);P.same(I)?P._private.edges.push(y):(P._private.edges.push(y),I._private.edges.push(y)),y._private.source=P,y._private.target=I}p.map=new ra,p.map.set(b,{ele:g,index:0}),p.removed=!1,e&&n.addToPool(g)}for(var D=0;D<i.length;D++){var L=i[D],M=L._private.data;qe(M.parent)&&(M.parent=""+M.parent);var q=M.parent,N=q!=null;if(N||L._private.parent){var W=L._private.parent?n.collection().merge(L._private.parent):n.getElementById(q);if(W.empty())M.parent=void 0;else if(W[0].removed())Cr("Node added with missing parent, reference to parent removed"),M.parent=void 0,L._private.parent=null;else{for(var V=!1,$=W;!$.empty();){if(L.same($)){V=!0,M.parent=void 0;break}$=$.parent()}V||(W[0]._private.children.push(L),L._private.parent=W[0],a.hasCompoundNodes=!0)}}}if(s.length>0){for(var X=s.length===t.length?t:new bt(n,s),ee=0;ee<X.length;ee++){var K=X[ee];K.isNode()||(K.parallelEdges().clearTraversalCache(),K.source().clearTraversalCache(),K.target().clearTraversalCache())}var j;a.hasCompoundNodes?j=n.collection().merge(X).merge(X.connectedNodes()).merge(X.parent()):j=X,j.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?X.emitAndNotify("add"):e&&X.emit("add")}return t};Ir.removed=function(){var r=this[0];return r&&r._private.removed};Ir.inside=function(){var r=this[0];return r&&!r._private.removed};Ir.remove=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,t=this,n=[],a={},i=t._private.cy;function o(q){for(var N=q._private.edges,W=0;W<N.length;W++)u(N[W])}function s(q){for(var N=q._private.children,W=0;W<N.length;W++)u(N[W])}function u(q){var N=a[q.id()];e&&q.removed()||N||(a[q.id()]=!0,q.isNode()?(n.push(q),o(q),s(q)):n.unshift(q))}for(var l=0,f=t.length;l<f;l++){var d=t[l];u(d)}function h(q,N){var W=q._private.edges;Ba(W,N),q.clearTraversalCache()}function g(q){q.clearTraversalCache()}var p=[];p.ids={};function x(q,N){N=N[0],q=q[0];var W=q._private.children,V=q.id();Ba(W,N),N._private.parent=null,p.ids[V]||(p.ids[V]=!0,p.push(q))}t.dirtyCompoundBoundsCache(),e&&i.removeFromPool(n);for(var b=0;b<n.length;b++){var w=n[b];if(w.isEdge()){var y=w.source()[0],E=w.target()[0];h(y,w),h(E,w);for(var C=w.parallelEdges(),S=0;S<C.length;S++){var R=C[S];g(R),R.isBundledBezier()&&R.dirtyBoundingBoxCache()}}else{var _=w.parent();_.length!==0&&x(_,w)}e&&(w._private.removed=!0)}var A=i._private.elements;i._private.hasCompoundNodes=!1;for(var P=0;P<A.length;P++){var I=A[P];if(I.isParent()){i._private.hasCompoundNodes=!0;break}}var D=new bt(this.cy(),n);D.size()>0&&(r?D.emitAndNotify("remove"):e&&D.emit("remove"));for(var L=0;L<p.length;L++){var M=p[L];(!e||!M.removed())&&M.updateStyle()}return D};Ir.move=function(r){var e=this._private.cy,t=this,n=!1,a=!1,i=function(p){return p==null?p:""+p};if(r.source!==void 0||r.target!==void 0){var o=i(r.source),s=i(r.target),u=o!=null&&e.hasElementWithId(o),l=s!=null&&e.hasElementWithId(s);(u||l)&&(e.batch(function(){t.remove(n,a),t.emitAndNotify("moveout");for(var g=0;g<t.length;g++){var p=t[g],x=p._private.data;p.isEdge()&&(u&&(x.source=o),l&&(x.target=s))}t.restore(n,a)}),t.emitAndNotify("move"))}else if(r.parent!==void 0){var f=i(r.parent),d=f===null||e.hasElementWithId(f);if(d){var h=f===null?void 0:f;e.batch(function(){var g=t.remove(n,a);g.emitAndNotify("moveout");for(var p=0;p<t.length;p++){var x=t[p],b=x._private.data;x.isNode()&&(b.parent=h)}g.restore(n,a)}),t.emitAndNotify("move")}}return this};[oA,z5,Vu,Ra,co,t$,Al,m$,DA,BA,C$,sl,Gu,mt,Aa,Tt].forEach(function(r){Ze(Ir,r)});var I$={add:function(e){var t,n=this;if(Jt(e)){var a=e;if(a._private.cy===n)t=a.restore();else{for(var i=[],o=0;o<a.length;o++){var s=a[o];i.push(s.json())}t=new bt(n,i)}}else if(Tr(e)){var u=e;t=new bt(n,u)}else if(yr(e)&&(Tr(e.nodes)||Tr(e.edges))){for(var l=e,f=[],d=["nodes","edges"],h=0,g=d.length;h<g;h++){var p=d[h],x=l[p];if(Tr(x))for(var b=0,w=x.length;b<w;b++){var y=Ze({group:p},x[b]);f.push(y)}}t=new bt(n,f)}else{var E=e;t=new xl(n,E).collection()}return t},remove:function(e){if(!Jt(e)){if(Ye(e)){var t=e;e=this.$(t)}}return e.remove()}};/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */function D$(r,e,t,n){var a=4,i=.001,o=1e-7,s=10,u=11,l=1/(u-1),f=typeof Float32Array<"u";if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!="number"||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var h=f?new Float32Array(u):new Array(u);function g(I,D){return 1-3*D+3*I}function p(I,D){return 3*D-6*I}function x(I){return 3*I}function b(I,D,L){return((g(D,L)*I+p(D,L))*I+x(D))*I}function w(I,D,L){return 3*g(D,L)*I*I+2*p(D,L)*I+x(D)}function y(I,D){for(var L=0;L<a;++L){var M=w(D,r,t);if(M===0)return D;var q=b(D,r,t)-I;D-=q/M}return D}function E(){for(var I=0;I<u;++I)h[I]=b(I*l,r,t)}function C(I,D,L){var M,q,N=0;do q=D+(L-D)/2,M=b(q,r,t)-I,M>0?L=q:D=q;while(Math.abs(M)>o&&++N<s);return q}function S(I){for(var D=0,L=1,M=u-1;L!==M&&h[L]<=I;++L)D+=l;--L;var q=(I-h[L])/(h[L+1]-h[L]),N=D+q*l,W=w(N,r,t);return W>=i?y(I,N):W===0?N:C(I,D,D+l)}var R=!1;function _(){R=!0,(r!==e||t!==n)&&E()}var A=function(D){return R||_(),r===e&&t===n?D:D===0?0:D===1?1:b(S(D),e,n)};A.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var P="generateBezier("+[r,e,t,n]+")";return A.toString=function(){return P},A}/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */var B$=(function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,a,i){var o={x:n.x+i.dx*a,v:n.v+i.dv*a,tension:n.tension,friction:n.friction};return{dx:o.v,dv:r(o)}}function t(n,a){var i={dx:n.v,dv:r(n)},o=e(n,a*.5,i),s=e(n,a*.5,o),u=e(n,a,s),l=1/6*(i.dx+2*(o.dx+s.dx)+u.dx),f=1/6*(i.dv+2*(o.dv+s.dv)+u.dv);return n.x=n.x+l*a,n.v=n.v+f*a,n}return function n(a,i,o){var s={x:-1,v:0,tension:null,friction:null},u=[0],l=0,f=1/1e4,d=16/1e3,h,g,p;for(a=parseFloat(a)||500,i=parseFloat(i)||20,o=o||null,s.tension=a,s.friction=i,h=o!==null,h?(l=n(a,i),g=l/o*d):g=d;p=t(p||s,g),u.push(1+p.x),l+=16,Math.abs(p.x)>f&&Math.abs(p.v)>f;);return h?function(x){return u[x*(u.length-1)|0]}:l}})(),Pr=function(e,t,n,a){var i=D$(e,t,n,a);return function(o,s,u){return o+(s-o)*i(u)}},Wu={linear:function(e,t,n){return e+(t-e)*n},ease:Pr(.25,.1,.25,1),"ease-in":Pr(.42,0,1,1),"ease-out":Pr(0,0,.58,1),"ease-in-out":Pr(.42,0,.58,1),"ease-in-sine":Pr(.47,0,.745,.715),"ease-out-sine":Pr(.39,.575,.565,1),"ease-in-out-sine":Pr(.445,.05,.55,.95),"ease-in-quad":Pr(.55,.085,.68,.53),"ease-out-quad":Pr(.25,.46,.45,.94),"ease-in-out-quad":Pr(.455,.03,.515,.955),"ease-in-cubic":Pr(.55,.055,.675,.19),"ease-out-cubic":Pr(.215,.61,.355,1),"ease-in-out-cubic":Pr(.645,.045,.355,1),"ease-in-quart":Pr(.895,.03,.685,.22),"ease-out-quart":Pr(.165,.84,.44,1),"ease-in-out-quart":Pr(.77,0,.175,1),"ease-in-quint":Pr(.755,.05,.855,.06),"ease-out-quint":Pr(.23,1,.32,1),"ease-in-out-quint":Pr(.86,0,.07,1),"ease-in-expo":Pr(.95,.05,.795,.035),"ease-out-expo":Pr(.19,1,.22,1),"ease-in-out-expo":Pr(1,0,0,1),"ease-in-circ":Pr(.6,.04,.98,.335),"ease-out-circ":Pr(.075,.82,.165,1),"ease-in-out-circ":Pr(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return Wu.linear;var a=B$(e,t,n);return function(i,o,s){return i+(o-i)*a(s)}},"cubic-bezier":Pr};function bE(r,e,t,n,a){if(n===1||e===t)return t;var i=a(e,t,n);return r==null||((r.roundValue||r.color)&&(i=Math.round(i)),r.min!==void 0&&(i=Math.max(i,r.min)),r.max!==void 0&&(i=Math.min(i,r.max))),i}function wE(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Ui(r,e,t,n,a){var i=a!=null?a.type:null;t<0?t=0:t>1&&(t=1);var o=wE(r,a),s=wE(e,a);if(qe(o)&&qe(s))return bE(i,o,s,t,n);if(Tr(o)&&Tr(s)){for(var u=[],l=0;l<s.length;l++){var f=o[l],d=s[l];if(f!=null&&d!=null){var h=bE(i,f,d,t,n);u.push(h)}else u.push(d)}return u}}function M$(r,e,t,n){var a=!n,i=r._private,o=e._private,s=o.easing,u=o.startTime,l=n?r:r.cy(),f=l.style();if(!o.easingImpl)if(s==null)o.easingImpl=Wu.linear;else{var d;if(Ye(s)){var h=f.parse("transition-timing-function",s);d=h.value}else d=s;var g,p;Ye(d)?(g=d,p=[]):(g=d[1],p=d.slice(2).map(function(X){return+X})),p.length>0?(g==="spring"&&p.push(o.duration),o.easingImpl=Wu[g].apply(null,p)):o.easingImpl=Wu[g]}var x=o.easingImpl,b;if(o.duration===0?b=1:b=(t-u)/o.duration,o.applying&&(b=o.progress),b<0?b=0:b>1&&(b=1),o.delay==null){var w=o.startPosition,y=o.position;if(y&&a&&!r.locked()){var E={};Go(w.x,y.x)&&(E.x=Ui(w.x,y.x,b,x)),Go(w.y,y.y)&&(E.y=Ui(w.y,y.y,b,x)),r.position(E)}var C=o.startPan,S=o.pan,R=i.pan,_=S!=null&&n;_&&(Go(C.x,S.x)&&(R.x=Ui(C.x,S.x,b,x)),Go(C.y,S.y)&&(R.y=Ui(C.y,S.y,b,x)),r.emit("pan"));var A=o.startZoom,P=o.zoom,I=P!=null&&n;I&&(Go(A,P)&&(i.zoom=ds(i.minZoom,Ui(A,P,b,x),i.maxZoom)),r.emit("zoom")),(_||I)&&r.emit("viewport");var D=o.style;if(D&&D.length>0&&a){for(var L=0;L<D.length;L++){var M=D[L],q=M.name,N=M,W=o.startStyle[q],V=f.properties[W.name],$=Ui(W,N,b,x,V);f.overrideBypass(r,q,$)}r.emit("style")}}return o.progress=b,b}function Go(r,e){return r==null||e==null?!1:qe(r)&&qe(e)?!0:!!(r&&e)}function L$(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function xE(r,e){var t=e._private.aniEles,n=[];function a(f,d){var h=f._private,g=h.animation.current,p=h.animation.queue,x=!1;if(g.length===0){var b=p.shift();b&&g.push(b)}for(var w=function(R){for(var _=R.length-1;_>=0;_--){var A=R[_];A()}R.splice(0,R.length)},y=g.length-1;y>=0;y--){var E=g[y],C=E._private;if(C.stopped){g.splice(y,1),C.hooked=!1,C.playing=!1,C.started=!1,w(C.frames);continue}!C.playing&&!C.applying||(C.playing&&C.applying&&(C.applying=!1),C.started||L$(f,E,r),M$(f,E,r,d),C.applying&&(C.applying=!1),w(C.frames),C.step!=null&&C.step(r),E.completed()&&(g.splice(y,1),C.hooked=!1,C.playing=!1,C.started=!1,w(C.completes)),x=!0)}return!d&&g.length===0&&p.length===0&&n.push(f),x}for(var i=!1,o=0;o<t.length;o++){var s=t[o],u=a(s);i=i||u}var l=a(e,!0);(i||l)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var O$={animate:Er.animate(),animation:Er.animation(),animated:Er.animated(),clearQueue:Er.clearQueue(),delay:Er.delay(),delayAnimation:Er.delayAnimation(),stop:Er.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&tl(function(i){xE(i,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){xE(o,e)},n.beforeRenderPriorities.animations):t()}},k$={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var a=t.qualifier;return a!=null?e!==n.target&&xs(n.target)&&a.matches(n.target):!0},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier!=null?n.target:e}},Ou=function(e){return Ye(e)?new La(e):e},OA={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Pl(k$,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Ou(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Ou(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Ou(t),n),this},once:function(e,t,n){return this.emitter().one(e,Ou(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}};Er.eventAliasesOn(OA);var Im={png:function(e){var t=this._private.renderer;return e=e||{},t.png(e)},jpg:function(e){var t=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",t.jpg(e)}};Im.jpeg=Im.jpg;var Uu={layout:function(e){var t=this;if(e==null){kr("Layout options must be specified to make a layout");return}if(e.name==null){kr("A `name` must be specified to make a layout");return}var n=e.name,a=t.extension("layout",n);if(a==null){kr("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;Ye(e.eles)?i=t.$(e.eles):i=e.eles!=null?e.eles:t.$();var o=new a(Ze({},e,{cy:t,eles:i}));return o}};Uu.createLayout=Uu.makeLayout=Uu.layout;var q$={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();t!=null&&a.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var 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],o=e[i],s=t.getElementById(i);s.data(o)}})}},N$=wt({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]}),Dm={renderTo:function(e,t,n,a){var i=this._private.renderer;return i.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(n==null){kr("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"));return}e.wheelSensitivity!==void 0&&Cr("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=N$(e);a.cy=t,t._private.renderer=new n(a),this.notify("init")},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)}};Dm.invalidateDimensions=Dm.resize;var Hu={collection:function(e,t){return Ye(e)?this.$(e):Jt(e)?e.collection():Tr(e)?(t||(t={}),new bt(this,e,t.unique,t.removed)):new bt(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}};Hu.elements=Hu.filter=Hu.$;var ft={},as="t",F$="f";ft.apply=function(r){for(var e=this,t=e._private,n=t.cy,a=n.collection(),i=0;i<r.length;i++){var o=r[i],s=e.getContextMeta(o);if(!s.empty){var u=e.getContextStyle(s),l=e.applyContextStyle(s,u,o);o._private.appliedInitStyle?e.updateTransitions(o,l.diffProps):o._private.appliedInitStyle=!0;var f=e.updateStyleHints(o);f&&a.push(o)}}return a};ft.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 o=[],s={},u=0;u<t.length;u++){var l=t[u],f=r[u]===as,d=e[u]===as,h=f!==d,g=l.mappedProperties.length>0;if(h||d&&g){var p=void 0;h&&g||h?p=l.properties:g&&(p=l.mappedProperties);for(var x=0;x<p.length;x++){for(var b=p[x],w=b.name,y=!1,E=u+1;E<t.length;E++){var C=t[E],S=e[E]===as;if(S&&(y=C.properties[b.name]!=null,y))break}!s[w]&&!y&&(s[w]=!0,o.push(w))}}}return n[a]=o,o};ft.getContextMeta=function(r){for(var e=this,t="",n,a=r._private.styleCxtKey||"",i=0;i<e.length;i++){var o=e[i],s=o.selector&&o.selector.matches(r);s?t+=as:t+=F$}return n=e.getPropertiesDiff(a,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:n.length===0}};ft.getContextStyle=function(r){var e=r.key,t=this,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var a={_private:{key:e}},i=0;i<t.length;i++){var o=t[i],s=e[i]===as;if(s)for(var u=0;u<o.properties.length;u++){var l=o.properties[u];a[l.name]=l}}return n[e]=a,a};ft.applyContextStyle=function(r,e,t){for(var n=this,a=r.diffPropNames,i={},o=n.types,s=0;s<a.length;s++){var u=a[s],l=e[u],f=t.pstyle(u);if(!l)if(f)f.bypass?l={name:u,deleteBypassed:!0}:l={name:u,delete:!0};else continue;if(f!==l){if(l.mapped===o.fn&&f!=null&&f.mapping!=null&&f.mapping.value===l.value){var d=f.mapping,h=d.fnValue=l.value(t);if(h===d.prevFnValue)continue}var g=i[u]={prev:f};n.applyParsedProperty(t,l),g.next=t.pstyle(u),g.next&&g.next.bypass&&(g.next=g.next.bypassed)}}return{diffProps:i}};ft.updateStyleHints=function(r){var e=r._private,t=this,n=t.propertyGroupNames,a=t.propertyGroupKeys,i=function(ie,de,we){return t.getPropertiesHash(ie,de,we)},o=e.styleKey;if(r.removed())return!1;var s=e.group==="nodes",u=r._private.style;n=Object.keys(u);for(var l=0;l<a.length;l++){var f=a[l];e.styleKeys[f]=[oi,Zi]}for(var d=function(ie,de){return e.styleKeys[de][0]=ls(ie,e.styleKeys[de][0])},h=function(ie,de){return e.styleKeys[de][1]=fs(ie,e.styleKeys[de][1])},g=function(ie,de){d(ie,de),h(ie,de)},p=function(ie,de){for(var we=0;we<ie.length;we++){var Ae=ie.charCodeAt(we);d(Ae,de),h(Ae,de)}},x=2e9,b=function(ie){return-128<ie&&ie<128&&Math.floor(ie)!==ie?x-(ie*1024|0):ie},w=0;w<n.length;w++){var y=n[w],E=u[y];if(E!=null){var C=this.properties[y],S=C.type,R=C.groupKey,_=void 0;C.hashOverride!=null?_=C.hashOverride(r,E):E.pfValue!=null&&(_=E.pfValue);var A=C.enums==null?E.value:null,P=_!=null,I=A!=null,D=P||I,L=E.units;if(S.number&&D&&!S.multiple){var M=P?_:A;g(b(M),R),!P&&L!=null&&p(L,R)}else p(E.strValue,R)}}for(var q=[oi,Zi],N=0;N<a.length;N++){var W=a[N],V=e.styleKeys[W];q[0]=ls(V[0],q[0]),q[1]=fs(V[1],q[1])}e.styleKey=rF(q[0],q[1]);var $=e.styleKeys;e.labelDimsKey=wa($.labelDimensions);var X=i(r,["label"],$.labelDimensions);if(e.labelKey=wa(X),e.labelStyleKey=wa(Ru($.commonLabel,X)),!s){var ee=i(r,["source-label"],$.labelDimensions);e.sourceLabelKey=wa(ee),e.sourceLabelStyleKey=wa(Ru($.commonLabel,ee));var K=i(r,["target-label"],$.labelDimensions);e.targetLabelKey=wa(K),e.targetLabelStyleKey=wa(Ru($.commonLabel,K))}if(s){var j=e.styleKeys,fe=j.nodeBody,G=j.nodeBorder,z=j.nodeOutline,Y=j.backgroundImage,te=j.compound,ue=j.pie,oe=j.stripe,Z=[fe,G,z,Y,te,ue,oe].filter(function(Q){return Q!=null}).reduce(Ru,[oi,Zi]);e.nodeKey=wa(Z),e.hasPie=ue!=null&&ue[0]!==oi&&ue[1]!==Zi,e.hasStripe=oe!=null&&oe[0]!==oi&&oe[1]!==Zi}return o!==e.styleKey};ft.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};ft.applyParsedProperty=function(r,e){var t=this,n=e,a=r._private.style,i,o=t.types,s=t.properties[n.name].type,u=n.bypass,l=a[n.name],f=l&&l.bypass,d=r._private,h="mapping",g=function(fe){return fe==null?null:fe.pfValue!=null?fe.pfValue:fe.value},p=function(){var fe=g(l),G=g(n);t.checkTriggers(r,n.name,fe,G)};if(e.name==="curve-style"&&r.isEdge()&&(e.value!=="bezier"&&r.isLoop()||e.value==="haystack"&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",u)),n.delete)return a[n.name]=void 0,p(),!0;if(n.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,p(),!0):!1:(p(),!0);if(n.deleteBypass)return l?l.bypass?(a[n.name]=l.bypassed,p(),!0):!1:(p(),!0);var x=function(){Cr("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 o.mapData:{for(var b=n.field.split("."),w=d.data,y=0;y<b.length&&w;y++){var E=b[y];w=w[E]}if(w==null)return x(),!1;var C;if(qe(w)){var S=n.fieldMax-n.fieldMin;S===0?C=0:C=(w-n.fieldMin)/S}else return Cr("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+w+"` for `"+r.id()+"` is non-numeric)"),!1;if(C<0?C=0:C>1&&(C=1),s.color){var R=n.valueMin[0],_=n.valueMax[0],A=n.valueMin[1],P=n.valueMax[1],I=n.valueMin[2],D=n.valueMax[2],L=n.valueMin[3]==null?1:n.valueMin[3],M=n.valueMax[3]==null?1:n.valueMax[3],q=[Math.round(R+(_-R)*C),Math.round(A+(P-A)*C),Math.round(I+(D-I)*C),Math.round(L+(M-L)*C)];i={bypass:n.bypass,name:n.name,value:q,strValue:"rgb("+q[0]+", "+q[1]+", "+q[2]+")"}}else if(s.number){var N=n.valueMin+(n.valueMax-n.valueMin)*C;i=this.parse(n.name,N,n.bypass,h)}else return!1;if(!i)return x(),!1;i.mapping=n,n=i;break}case o.data:{for(var W=n.field.split("."),V=d.data,$=0;$<W.length&&V;$++){var X=W[$];V=V[X]}if(V!=null&&(i=this.parse(n.name,V,n.bypass,h)),!i)return x(),!1;i.mapping=n,n=i;break}case o.fn:{var ee=n.value,K=n.fnValue!=null?n.fnValue:ee(r);if(n.prevFnValue=K,K==null)return Cr("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(i=this.parse(n.name,K,n.bypass,h),!i)return Cr("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=Nn(n),n=i;break}case void 0:break;default:return!1}return u?(f?n.bypassed=l.bypassed:n.bypassed=l,a[n.name]=n):f?l.bypassed=n:a[n.name]=n,p(),!0};ft.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)n._private.style={};else for(var a=n._private.style,i=Object.keys(a),o=0;o<i.length;o++){var s=i[o],u=a[s];u!=null&&(u.bypass?u.bypassed=null:a[s]=null)}}};ft.update=function(){var r=this._private.cy,e=r.mutableElements();e.updateStyle()};ft.updateTransitions=function(r,e){var t=this,n=r._private,a=r.pstyle("transition-property").value,i=r.pstyle("transition-duration").pfValue,o=r.pstyle("transition-delay").pfValue;if(a.length>0&&i>0){for(var s={},u=!1,l=0;l<a.length;l++){var f=a[l],d=r.pstyle(f),h=e[f];if(h){var g=h.prev,p=g,x=h.next!=null?h.next:d,b=!1,w=void 0,y=1e-6;p&&(qe(p.pfValue)&&qe(x.pfValue)?(b=x.pfValue-p.pfValue,w=p.pfValue+y*b):qe(p.value)&&qe(x.value)?(b=x.value-p.value,w=p.value+y*b):Tr(p.value)&&Tr(x.value)&&(b=p.value[0]!==x.value[0]||p.value[1]!==x.value[1]||p.value[2]!==x.value[2],w=p.strValue),b&&(s[f]=x.strValue,this.applyBypass(r,f,w),u=!0))}}if(!u)return;n.transitioning=!0,new po(function(E){o>0?r.delayAnimation(o).play().promise().then(E):E()}).then(function(){return r.animation({style:s,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)};ft.checkTrigger=function(r,e,t,n,a,i){var o=this.properties[e],s=a(o);r.removed()||s!=null&&s(t,n,r)&&i(o)};ft.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)})};ft.checkBoundsTrigger=function(r,e,t,n){this.checkTrigger(r,e,t,n,function(a){return a.triggersBounds},function(a){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})};ft.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()})})};ft.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()})})};ft.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)};var As={};As.applyBypass=function(r,e,t,n){var a=this,i=[],o=!0;if(e==="*"||e==="**"){if(t!==void 0)for(var s=0;s<a.properties.length;s++){var u=a.properties[s],l=u.name,f=this.parse(l,t,!0);f&&i.push(f)}}else if(Ye(e)){var d=this.parse(e,t,!0);d&&i.push(d)}else if(yr(e)){var h=e;n=t;for(var g=Object.keys(h),p=0;p<g.length;p++){var x=g[p],b=h[x];if(b===void 0&&(b=h[bl(x)]),b!==void 0){var w=this.parse(x,b,!0);w&&i.push(w)}}}else return!1;if(i.length===0)return!1;for(var y=!1,E=0;E<r.length;E++){for(var C=r[E],S={},R=void 0,_=0;_<i.length;_++){var A=i[_];if(n){var P=C.pstyle(A.name);R=S[A.name]={prev:P}}y=this.applyParsedProperty(C,Nn(A))||y,n&&(R.next=C.pstyle(A.name))}y&&this.updateStyleHints(C),n&&this.updateTransitions(C,S,o)}return y};As.overrideBypass=function(r,e,t){e=Km(e);for(var n=0;n<r.length;n++){var a=r[n],i=a._private.style[e],o=this.properties[e].type,s=o.color,u=o.mutiple,l=i?i.pfValue!=null?i.pfValue:i.value:null;!i||!i.bypass?this.applyBypass(a,e,t):(i.value=t,i.pfValue!=null&&(i.pfValue=t),s?i.strValue="rgb("+t.join(",")+")":u?i.strValue=t.join(" "):i.strValue=""+t,this.updateStyleHints(a)),this.checkTriggers(a,e,l,t)}};As.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};As.removeBypasses=function(r,e,t){for(var n=!0,a=0;a<r.length;a++){for(var i=r[a],o={},s=0;s<e.length;s++){var u=e[s],l=this.properties[u],f=i.pstyle(l.name);if(!(!f||!f.bypass)){var d="",h=this.parse(u,d,!0),g=o[l.name]={prev:f};this.applyParsedProperty(i,h),g.next=i.pstyle(l.name)}}this.updateStyleHints(i),t&&this.updateTransitions(i,o,n)}};var u0={};u0.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};u0.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)};var Fn={};Fn.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};Fn.getRawStyle=function(r,e){var t=this;if(r=r[0],r){for(var n={},a=0;a<t.properties.length;a++){var i=t.properties[a],o=t.getStylePropertyValue(r,i.name,e);o!=null&&(n[i.name]=o,n[bl(i.name)]=o)}return n}};Fn.getIndexedStyle=function(r,e,t,n){var a=r.pstyle(e)[t][n];return a??r.cy().style().getDefaultProperty(e)[t][0]};Fn.getStylePropertyValue=function(r,e,t){var n=this;if(r=r[0],r){var a=n.properties[e];a.alias&&(a=a.pointsTo);var i=a.type,o=r.pstyle(a.name);if(o){var s=o.value,u=o.units,l=o.strValue;if(t&&i.number&&s!=null&&qe(s)){var f=r.cy().zoom(),d=function(b){return b*f},h=function(b,w){return d(b)+w},g=Tr(s),p=g?u.every(function(x){return x!=null}):u!=null;return p?g?s.map(function(x,b){return h(x,u[b])}).join(" "):h(s,u):g?s.map(function(x){return Ye(x)?x:""+d(x)}).join(" "):""+d(s)}else if(l!=null)return l}return null}};Fn.getAnimationStartStyle=function(r,e){for(var t={},n=0;n<e.length;n++){var a=e[n],i=a.name,o=r.pstyle(i);o!==void 0&&(yr(o)?o=this.parse(i,o.strValue):o=this.parse(i,o)),o&&(t[i]=o)}return t};Fn.getPropsList=function(r){var e=this,t=[],n=r,a=e.properties;if(n)for(var i=Object.keys(n),o=0;o<i.length;o++){var s=i[o],u=n[s],l=a[s]||a[Km(s)],f=this.parse(l.name,u);f&&t.push(f)}return t};Fn.getNonDefaultPropertiesHash=function(r,e,t){var n=t.slice(),a,i,o,s,u,l;for(u=0;u<e.length;u++)if(a=e[u],i=r.pstyle(a,!1),i!=null)if(i.pfValue!=null)n[0]=ls(s,n[0]),n[1]=fs(s,n[1]);else for(o=i.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),n[0]=ls(s,n[0]),n[1]=fs(s,n[1]);return n};Fn.getPropertiesHash=Fn.getNonDefaultPropertiesHash;var Bl={};Bl.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,o=Object.keys(i);e.selector(a);for(var s=0;s<o.length;s++){var u=o[s],l=i[u];e.css(u,l)}}return e};Bl.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};Bl.json=function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,a=t.properties,i={},o=0;o<a.length;o++){var s=a[o];i[s.name]=s.strValue}r.push({selector:n?n.toString():"core",style:i})}return r};var l0={};l0.appendFromString=function(r){var e=this,t=this,n=""+r,a,i,o;n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");function s(){n.length>a.length?n=n.substr(a.length):n=""}function u(){i.length>o.length?i=i.substr(o.length):i=""}for(;;){var l=n.match(/^\s*$/);if(l)break;var f=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!f){Cr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}a=f[0];var d=f[1];if(d!=="core"){var h=new La(d);if(h.invalid){Cr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),s();continue}}var g=f[2],p=!1;i=g;for(var x=[];;){var b=i.match(/^\s*$/);if(b)break;var w=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!w){Cr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+g),p=!0;break}o=w[0];var y=w[1],E=w[2],C=e.properties[y];if(!C){Cr("Skipping property: Invalid property name in: "+o),u();continue}var S=t.parse(y,E);if(!S){Cr("Skipping property: Invalid property definition in: "+o),u();continue}x.push({name:y,val:E}),u()}if(p){s();break}t.selector(d);for(var R=0;R<x.length;R++){var _=x[R];t.css(_.name,_.val)}s()}return t};l0.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var Yr={};(function(){var r=nt,e=MN,t=ON,n=kN,a=qN,i=function(Q){return"^"+Q+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},o=function(Q){var ie=r+"|\\w+|"+e+"|"+t+"|"+n+"|"+a;return"^"+Q+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+ie+")\\s*\\,\\s*("+ie+")\\)$"},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,"^(none)$","^(.+)$"];Yr.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","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:i("data")},layoutData:{mapping:!0,regex:i("layoutData")},scratch:{mapping:!0,regex:i("scratch")},mapData:{mapping:!0,regex:o("mapData")},mapLayoutData:{mapping:!0,regex:o("mapLayoutData")},mapScratch:{mapping:!0,regex:o("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(Q,ie){switch(Q.length){case 2:return ie[0]!=="deg"&&ie[0]!=="rad"&&ie[1]!=="deg"&&ie[1]!=="rad";case 1:return Ye(Q[0])||ie[0]==="deg"||ie[0]==="rad";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(Q){var ie=Q.length;return ie===1||ie===2||ie===4}}};var u={zeroNonZero:function(Q,ie){return(Q==null||ie==null)&&Q!==ie||Q==0&&ie!=0?!0:Q!=0&&ie==0},any:function(Q,ie){return Q!=ie},emptyNonEmpty:function(Q,ie){var de=Da(Q),we=Da(ie);return de&&!we||!de&&we}},l=Yr.types,f=[{name:"label",type:l.text,triggersBounds:u.any,triggersZOrder:u.emptyNonEmpty},{name:"text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any}],d=[{name:"source-label",type:l.text,triggersBounds:u.any},{name:"source-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"source-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"source-text-offset",type:l.size,triggersBounds:u.any}],h=[{name:"target-label",type:l.text,triggersBounds:u.any},{name:"target-text-rotation",type:l.textRotation,triggersBounds:u.any},{name:"target-text-margin-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-margin-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"target-text-offset",type:l.size,triggersBounds:u.any}],g=[{name:"font-family",type:l.fontFamily,triggersBounds:u.any},{name:"font-style",type:l.fontStyle,triggersBounds:u.any},{name:"font-weight",type:l.fontWeight,triggersBounds:u.any},{name:"font-size",type:l.size,triggersBounds:u.any},{name:"text-transform",type:l.textTransform,triggersBounds:u.any},{name:"text-wrap",type:l.textWrap,triggersBounds:u.any},{name:"text-overflow-wrap",type:l.textOverflowWrap,triggersBounds:u.any},{name:"text-max-width",type:l.size,triggersBounds:u.any},{name:"text-outline-width",type:l.size,triggersBounds:u.any},{name:"line-height",type:l.positiveNumber,triggersBounds:u.any}],p=[{name:"text-valign",type:l.valign,triggersBounds:u.any},{name:"text-halign",type:l.halign,triggersBounds:u.any},{name:"color",type:l.color},{name:"text-outline-color",type:l.color},{name:"text-outline-opacity",type:l.zeroOneNumber},{name:"text-background-color",type:l.color},{name:"text-background-opacity",type:l.zeroOneNumber},{name:"text-background-padding",type:l.size,triggersBounds:u.any},{name:"text-border-opacity",type:l.zeroOneNumber},{name:"text-border-color",type:l.color},{name:"text-border-width",type:l.size,triggersBounds:u.any},{name:"text-border-style",type:l.borderStyle,triggersBounds:u.any},{name:"text-background-shape",type:l.textBackgroundShape,triggersBounds:u.any},{name:"text-justification",type:l.justification},{name:"box-select-labels",type:l.bool,triggersBounds:u.any}],x=[{name:"events",type:l.bool,triggersZOrder:u.any},{name:"text-events",type:l.bool,triggersZOrder:u.any},{name:"box-selection",type:l.boxSelection,triggersZOrder:u.any}],b=[{name:"display",type:l.display,triggersZOrder:u.any,triggersBounds:u.any,triggersBoundsOfConnectedEdges:u.any,triggersBoundsOfParallelEdges:function(Q,ie,de){return Q===ie?!1:de.pstyle("curve-style").value==="bezier"}},{name:"visibility",type:l.visibility,triggersZOrder:u.any},{name:"opacity",type:l.zeroOneNumber,triggersZOrder:u.zeroNonZero},{name:"text-opacity",type:l.zeroOneNumber},{name:"min-zoomed-font-size",type:l.size},{name:"z-compound-depth",type:l.zCompoundDepth,triggersZOrder:u.any},{name:"z-index-compare",type:l.zIndexCompare,triggersZOrder:u.any},{name:"z-index",type:l.number,triggersZOrder:u.any}],w=[{name:"overlay-padding",type:l.size,triggersBounds:u.any},{name:"overlay-color",type:l.color},{name:"overlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"overlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"overlay-corner-radius",type:l.cornerRadius}],y=[{name:"underlay-padding",type:l.size,triggersBounds:u.any},{name:"underlay-color",type:l.color},{name:"underlay-opacity",type:l.zeroOneNumber,triggersBounds:u.zeroNonZero},{name:"underlay-shape",type:l.overlayShape,triggersBounds:u.any},{name:"underlay-corner-radius",type:l.cornerRadius}],E=[{name:"transition-property",type:l.propList},{name:"transition-duration",type:l.time},{name:"transition-delay",type:l.time},{name:"transition-timing-function",type:l.easing}],C=function(Q,ie){return ie.value==="label"?-Q.poolIndex():ie.pfValue},S=[{name:"height",type:l.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"width",type:l.nodeSize,triggersBounds:u.any,hashOverride:C},{name:"shape",type:l.nodeShape,triggersBounds:u.any},{name:"shape-polygon-points",type:l.polygonPointList,triggersBounds:u.any},{name:"corner-radius",type:l.cornerRadius},{name:"background-color",type:l.color},{name:"background-fill",type:l.fill},{name:"background-opacity",type:l.zeroOneNumber},{name:"background-blacken",type:l.nOneOneNumber},{name:"background-gradient-stop-colors",type:l.colors},{name:"background-gradient-stop-positions",type:l.percentages},{name:"background-gradient-direction",type:l.gradientDirection},{name:"padding",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"padding-relative-to",type:l.paddingRelativeTo,triggersBounds:u.any},{name:"bounds-expansion",type:l.boundsExpansion,triggersBounds:u.any}],R=[{name:"border-color",type:l.color},{name:"border-opacity",type:l.zeroOneNumber},{name:"border-width",type:l.size,triggersBounds:u.any},{name:"border-style",type:l.borderStyle},{name:"border-cap",type:l.lineCap},{name:"border-join",type:l.lineJoin},{name:"border-dash-pattern",type:l.numbers},{name:"border-dash-offset",type:l.number},{name:"border-position",type:l.linePosition}],_=[{name:"outline-color",type:l.color},{name:"outline-opacity",type:l.zeroOneNumber},{name:"outline-width",type:l.size,triggersBounds:u.any},{name:"outline-style",type:l.borderStyle},{name:"outline-offset",type:l.size,triggersBounds:u.any}],A=[{name:"background-image",type:l.urls},{name:"background-image-crossorigin",type:l.bgCrossOrigin},{name:"background-image-opacity",type:l.zeroOneNumbers},{name:"background-image-containment",type:l.bgContainment},{name:"background-image-smoothing",type:l.bools},{name:"background-position-x",type:l.bgPos},{name:"background-position-y",type:l.bgPos},{name:"background-width-relative-to",type:l.bgRelativeTo},{name:"background-height-relative-to",type:l.bgRelativeTo},{name:"background-repeat",type:l.bgRepeat},{name:"background-fit",type:l.bgFit},{name:"background-clip",type:l.bgClip},{name:"background-width",type:l.bgWH},{name:"background-height",type:l.bgWH},{name:"background-offset-x",type:l.bgPos},{name:"background-offset-y",type:l.bgPos}],P=[{name:"position",type:l.position,triggersBounds:u.any},{name:"compound-sizing-wrt-labels",type:l.compoundIncludeLabels,triggersBounds:u.any},{name:"min-width",type:l.size,triggersBounds:u.any},{name:"min-width-bias-left",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-width-bias-right",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height",type:l.size,triggersBounds:u.any},{name:"min-height-bias-top",type:l.sizeMaybePercent,triggersBounds:u.any},{name:"min-height-bias-bottom",type:l.sizeMaybePercent,triggersBounds:u.any}],I=[{name:"line-style",type:l.lineStyle},{name:"line-color",type:l.color},{name:"line-fill",type:l.fill},{name:"line-cap",type:l.lineCap},{name:"line-opacity",type:l.zeroOneNumber},{name:"line-dash-pattern",type:l.numbers},{name:"line-dash-offset",type:l.number},{name:"line-outline-width",type:l.size},{name:"line-outline-color",type:l.color},{name:"line-gradient-stop-colors",type:l.colors},{name:"line-gradient-stop-positions",type:l.percentages},{name:"curve-style",type:l.curveStyle,triggersBounds:u.any,triggersBoundsOfParallelEdges:function(Q,ie){return Q===ie?!1:Q==="bezier"||ie==="bezier"}},{name:"haystack-radius",type:l.zeroOneNumber,triggersBounds:u.any},{name:"source-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"target-endpoint",type:l.edgeEndpoint,triggersBounds:u.any},{name:"control-point-step-size",type:l.size,triggersBounds:u.any},{name:"control-point-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"control-point-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-distances",type:l.bidirectionalSizes,triggersBounds:u.any},{name:"segment-weights",type:l.numbers,triggersBounds:u.any},{name:"segment-radii",type:l.numbers,triggersBounds:u.any},{name:"radius-type",type:l.radiusType,triggersBounds:u.any},{name:"taxi-turn",type:l.bidirectionalSizeMaybePercent,triggersBounds:u.any},{name:"taxi-turn-min-distance",type:l.size,triggersBounds:u.any},{name:"taxi-direction",type:l.axisDirection,triggersBounds:u.any},{name:"taxi-radius",type:l.number,triggersBounds:u.any},{name:"edge-distances",type:l.edgeDistances,triggersBounds:u.any},{name:"arrow-scale",type:l.positiveNumber,triggersBounds:u.any},{name:"loop-direction",type:l.angle,triggersBounds:u.any},{name:"loop-sweep",type:l.angle,triggersBounds:u.any},{name:"source-distance-from-node",type:l.size,triggersBounds:u.any},{name:"target-distance-from-node",type:l.size,triggersBounds:u.any}],D=[{name:"ghost",type:l.bool,triggersBounds:u.any},{name:"ghost-offset-x",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-offset-y",type:l.bidirectionalSize,triggersBounds:u.any},{name:"ghost-opacity",type:l.zeroOneNumber}],L=[{name:"selection-box-color",type:l.color},{name:"selection-box-opacity",type:l.zeroOneNumber},{name:"selection-box-border-color",type:l.color},{name:"selection-box-border-width",type:l.size},{name:"active-bg-color",type:l.color},{name:"active-bg-opacity",type:l.zeroOneNumber},{name:"active-bg-size",type:l.size},{name:"outside-texture-bg-color",type:l.color},{name:"outside-texture-bg-opacity",type:l.zeroOneNumber}],M=[];Yr.pieBackgroundN=16,M.push({name:"pie-size",type:l.sizeMaybePercent}),M.push({name:"pie-hole",type:l.sizeMaybePercent}),M.push({name:"pie-start-angle",type:l.angle});for(var q=1;q<=Yr.pieBackgroundN;q++)M.push({name:"pie-"+q+"-background-color",type:l.color}),M.push({name:"pie-"+q+"-background-size",type:l.percent}),M.push({name:"pie-"+q+"-background-opacity",type:l.zeroOneNumber});var N=[];Yr.stripeBackgroundN=16,N.push({name:"stripe-size",type:l.sizeMaybePercent}),N.push({name:"stripe-direction",type:l.axisDirectionPrimary});for(var W=1;W<=Yr.stripeBackgroundN;W++)N.push({name:"stripe-"+W+"-background-color",type:l.color}),N.push({name:"stripe-"+W+"-background-size",type:l.percent}),N.push({name:"stripe-"+W+"-background-opacity",type:l.zeroOneNumber});var V=[],$=Yr.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:l.arrowShape,triggersBounds:u.any},{name:"arrow-color",type:l.color},{name:"arrow-fill",type:l.arrowFill},{name:"arrow-width",type:l.arrowWidth}].forEach(function(Z){$.forEach(function(Q){var ie=Q+"-"+Z.name,de=Z.type,we=Z.triggersBounds;V.push({name:ie,type:de,triggersBounds:we})})},{});var X=Yr.properties=[].concat(x,E,b,w,y,D,p,g,f,d,h,S,R,_,A,M,N,P,I,V,L),ee=Yr.propertyGroups={behavior:x,transition:E,visibility:b,overlay:w,underlay:y,ghost:D,commonLabel:p,labelDimensions:g,mainLabel:f,sourceLabel:d,targetLabel:h,nodeBody:S,nodeBorder:R,nodeOutline:_,backgroundImage:A,pie:M,stripe:N,compound:P,edgeLine:I,edgeArrow:V,core:L},K=Yr.propertyGroupNames={},j=Yr.propertyGroupKeys=Object.keys(ee);j.forEach(function(Z){K[Z]=ee[Z].map(function(Q){return Q.name}),ee[Z].forEach(function(Q){return Q.groupKey=Z})});var fe=Yr.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"}];Yr.propertyNames=X.map(function(Z){return Z.name});for(var G=0;G<X.length;G++){var z=X[G];X[z.name]=z}for(var Y=0;Y<fe.length;Y++){var te=fe[Y],ue=X[te.pointsTo],oe={name:te.name,alias:!0,pointsTo:ue};X.push(oe),X[te.name]=oe}})();Yr.getDefaultProperty=function(r){return this.getDefaultProperties()[r]};Yr.getDefaultProperties=function(){var r=this._private;if(r.defaultProperties!=null)return r.defaultProperties;for(var e=Ze({"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","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(u,l){for(var f=1;f<=Yr.pieBackgroundN;f++){var d=l.name.replace("{{i}}",f),h=l.value;u[d]=h}return u},{}),{"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(u,l){for(var f=1;f<=Yr.stripeBackgroundN;f++){var d=l.name.replace("{{i}}",f),h=l.value;u[d]=h}return u},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(u,l){return Yr.arrowPrefixes.forEach(function(f){var d=f+"-"+l.name,h=l.value;u[d]=h}),u},{})),t={},n=0;n<this.properties.length;n++){var a=this.properties[n];if(!a.pointsTo){var i=a.name,o=e[i],s=this.parse(i,o);t[i]=s}}return r.defaultProperties=t,r.defaultProperties};Yr.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 Ml={};Ml.parse=function(r,e,t,n){var a=this;if($r(e))return a.parseImplWarn(r,e,t,n);var i=n==="mapping"||n===!0||n===!1||n==null?"dontcare":n,o=t?"t":"f",s=""+e,u=UR(r,s,o,i),l=a.propCache=a.propCache||[],f;return(f=l[u])||(f=l[u]=a.parseImplWarn(r,e,t,n)),(t||n==="mapping")&&(f=Nn(f),f&&(f.value=Nn(f.value))),f};Ml.parseImplWarn=function(r,e,t,n){var a=this.parseImpl(r,e,t,n);return!a&&e!=null&&Cr("The style property `".concat(r,": ").concat(e,"` is invalid")),a&&(a.name==="width"||a.name==="height")&&e==="label"&&Cr("The style value of `label` is deprecated for `"+a.name+"`"),a};Ml.parseImpl=function(r,e,t,n){var a=this;r=Km(r);var i=a.properties[r],o=e,s=a.types;if(!i||e===void 0)return null;i.alias&&(i=i.pointsTo,r=i.name);var u=Ye(e);u&&(e=e.trim());var l=i.type;if(!l)return null;if(t&&(e===""||e===null))return{name:r,value:e,bypass:!0,deleteBypass:!0};if($r(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};var f,d;if(!(!u||n||e.length<7||e[1]!=="a")){if(e.length>=7&&e[0]==="d"&&(f=new RegExp(s.data.regex).exec(e))){if(t)return!1;var h=s.data;return{name:r,value:f,strValue:""+e,mapped:h,field:f[1],bypass:t}}else if(e.length>=10&&e[0]==="m"&&(d=new RegExp(s.mapData.regex).exec(e))){if(t||l.multiple)return!1;var g=s.mapData;if(!(l.color||l.number))return!1;var p=this.parse(r,d[4]);if(!p||p.mapped)return!1;var x=this.parse(r,d[5]);if(!x||x.mapped)return!1;if(p.pfValue===x.pfValue||p.strValue===x.strValue)return Cr("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+p.strValue+"`"),this.parse(r,p.strValue);if(l.color){var b=p.value,w=x.value,y=b[0]===w[0]&&b[1]===w[1]&&b[2]===w[2]&&(b[3]===w[3]||(b[3]==null||b[3]===1)&&(w[3]==null||w[3]===1));if(y)return!1}return{name:r,value:d,strValue:""+e,mapped:g,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:p.value,valueMax:x.value,bypass:t}}}if(l.multiple&&n!=="multiple"){var E;if(u?E=e.split(/\s+/):Tr(e)?E=e:E=[e],l.evenMultiple&&E.length%2!==0)return null;for(var C=[],S=[],R=[],_="",A=!1,P=0;P<E.length;P++){var I=a.parse(r,E[P],t,"multiple");A=A||Ye(I.value),C.push(I.value),R.push(I.pfValue!=null?I.pfValue:I.value),S.push(I.units),_+=(P>0?" ":"")+I.strValue}return l.validate&&!l.validate(C,S)?null:l.singleEnum&&A?C.length===1&&Ye(C[0])?{name:r,value:C[0],strValue:C[0],bypass:t}:null:{name:r,value:C,pfValue:R,strValue:_,bypass:t,units:S}}var D=function(){for(var oe=0;oe<l.enums.length;oe++){var Z=l.enums[oe];if(Z===e)return{name:r,value:e,strValue:""+e,bypass:t}}return null};if(l.number){var L,M="px";if(l.units&&(L=l.units),l.implicitUnits&&(M=l.implicitUnits),!l.unitless)if(u){var q="px|em"+(l.allowPercent?"|\\%":"");L&&(q=L);var N=e.match("^("+nt+")("+q+")?$");N&&(e=N[1],L=N[2]||M)}else(!L||l.implicitUnits)&&(L=M);if(e=parseFloat(e),isNaN(e)&&l.enums===void 0)return null;if(isNaN(e)&&l.enums!==void 0)return e=o,D();if(l.integer&&!TN(e)||l.min!==void 0&&(e<l.min||l.strictMin&&e===l.min)||l.max!==void 0&&(e>l.max||l.strictMax&&e===l.max))return null;var W={name:r,value:e,strValue:""+e+(L||""),units:L,bypass:t};return l.unitless||L!=="px"&&L!=="em"?W.pfValue=e:W.pfValue=L==="px"||!L?e:this.getEmSizeInPixels()*e,(L==="ms"||L==="s")&&(W.pfValue=L==="ms"?e:1e3*e),(L==="deg"||L==="rad")&&(W.pfValue=L==="rad"?e:kF(e)),L==="%"&&(W.pfValue=e/100),W}else if(l.propList){var V=[],$=""+e;if($!=="none"){for(var X=$.split(/\s*,\s*|\s+/),ee=0;ee<X.length;ee++){var K=X[ee].trim();a.properties[K]?V.push(K):Cr("`"+K+"` is not a valid property name")}if(V.length===0)return null}return{name:r,value:V,strValue:V.length===0?"none":V.join(" "),bypass:t}}else if(l.color){var j=NR(e);return j?{name:r,value:j,pfValue:j,strValue:"rgb("+j[0]+","+j[1]+","+j[2]+")",bypass:t}:null}else if(l.regex||l.regexes){if(l.enums){var fe=D();if(fe)return fe}for(var G=l.regexes?l.regexes:[l.regex],z=0;z<G.length;z++){var Y=new RegExp(G[z]),te=Y.exec(e);if(te)return{name:r,value:l.singleRegexMatchValue?te[1]:te,strValue:""+e,bypass:t}}return null}else return l.string?{name:r,value:""+e,strValue:""+e,bypass:t}:l.enums?D():null};var lt=function(e){if(!(this instanceof lt))return new lt(e);if(!Hm(e)){kr("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},Rt=lt.prototype;Rt.instanceString=function(){return"style"};Rt.clear=function(){for(var r=this._private,e=r.cy,t=e.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};Rt.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};Rt.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};Rt.selector=function(r){var e=r==="core"?null:new La(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};Rt.css=function(){var r=this,e=arguments;if(e.length===1)for(var t=e[0],n=0;n<r.properties.length;n++){var a=r.properties[n],i=t[a.name];i===void 0&&(i=t[bl(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};Rt.style=Rt.css;Rt.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);var a=!this[n].selector;a&&(this._private.coreStyle[t.name]=t)}return this};Rt.append=function(r){return OR(r)?r.appendToStyle(this):Tr(r)?this.appendFromJson(r):Ye(r)&&this.appendFromString(r),this};lt.fromJson=function(r,e){var t=new lt(r);return t.fromJson(e),t};lt.fromString=function(r,e){return new lt(r).fromString(e)};[ft,As,u0,Fn,Bl,l0,Yr,Ml].forEach(function(r){Ze(Rt,r)});lt.types=Rt.types;lt.properties=Rt.properties;lt.propertyGroups=Rt.propertyGroups;lt.propertyGroupNames=Rt.propertyGroupNames;lt.propertyGroupKeys=Rt.propertyGroupKeys;var z$={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return OR(e)?t.style=e.generateStyle(this):Tr(e)?t.style=lt.fromJson(this,e):Ye(e)?t.style=lt.fromString(this,e):t.style=lt(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},$$="single",hi={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType==null&&(t.selectionType=$$),e!==void 0)(e==="additive"||e==="single")&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,a,i,o,s;switch(e.length){case 0:return t;case 1:if(Ye(e[0]))return n=e[0],t[n];if(yr(e[0])){if(!this._private.panningEnabled)return this;i=e[0],o=i.x,s=i.y,qe(o)&&(t.x=o),qe(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],a=e[1],(n==="x"||n==="y")&&qe(a)&&(t[n]=a),this.emit("pan viewport");break}return this.notify("viewport"),this},panBy:function(e,t){var n=arguments,a=this._private.pan,i,o,s,u,l;if(!this._private.panningEnabled)return this;switch(n.length){case 1:yr(e)&&(s=n[0],u=s.x,l=s.y,qe(u)&&(a.x+=u),qe(l)&&(a.y+=l),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&qe(o)&&(a[i]+=o),this.emit("pan viewport");break}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){if(qe(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(Ye(e)){var a=e;e=this.$(a)}else if(PN(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else Jt(e)||(e=this.mutableElements());if(!(Jt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),s=this.height(),u;if(t=qe(t)?t:0,!isNaN(o)&&!isNaN(s)&&o>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){u=Math.min((o-2*t)/n.w,(s-2*t)/n.h),u=u>this._private.maxZoom?this._private.maxZoom:u,u=u<this._private.minZoom?this._private.minZoom:u;var l={x:(o-u*(n.x1+n.x2))/2,y:(s-u*(n.y1+n.y2))/2};return{zoom:u,pan:l}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var a=e;e=a.min,t=a.max}return qe(e)&&qe(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):qe(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:qe(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,a=t.zoom,i,o,s=!1;if(t.zoomingEnabled||(s=!0),qe(e)?o=e:yr(e)&&(o=e.level,e.position!=null?i=El(e.position,a,n):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!t.panningEnabled&&(s=!0)),o=o>t.maxZoom?t.maxZoom:o,o=o<t.minZoom?t.minZoom:o,s||!qe(o)||o===a||i!=null&&(!qe(i.x)||!qe(i.y)))return null;if(i!=null){var u=n,l=a,f=o,d={x:-f/l*(i.x-u.x)+i.x,y:-f/l*(i.y-u.y)+i.y};return{zoomed:!0,panned:!0,zoom:f,pan:d}}else return{zoomed:!0,panned:!1,zoom:o,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(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)},viewport:function(e){var t=this._private,n=!0,a=!0,i=[],o=!1,s=!1;if(!e)return this;if(qe(e.zoom)||(n=!1),yr(e.pan)||(a=!1),!n&&!a)return this;if(n){var u=e.zoom;u<t.minZoom||u>t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=u,i.push("zoom"))}if(a&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;qe(l.x)&&(t.pan.x=l.x,s=!1),qe(l.y)&&(t.pan.y=l.y,s=!1),s||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(Ye(e)){var n=e;e=this.mutableElements().filter(n)}else Jt(e)||(e=this.mutableElements());if(e.length!==0){var a=e.boundingBox(),i=this.width(),o=this.height();t=t===void 0?this._private.zoom:t;var s={x:(i-t*(a.x1+a.x2))/2,y:(o-t*(a.y1+a.y2))/2};return s}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?(function(){var a=n.window().getComputedStyle(t),i=function(s){return parseFloat(a.getPropertyValue(s))};return{width:t.clientWidth-i("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){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};hi.centre=hi.center;hi.autolockNodes=hi.autolock;hi.autoungrabifyNodes=hi.autoungrabify;var ps={data:Er.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Er.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Er.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Er.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ps.attr=ps.data;ps.removeAttr=ps.removeData;var ys=function(e){var t=this;e=Ze({},e);var n=e.container;n&&!rl(n)&&rl(n[0])&&(n=n[0]);var a=n?n._cyreg:null;a=a||{},a&&a.cy&&(a.cy.destroy(),a={});var i=a.readies=a.readies||[];n&&(n._cyreg=a),a.cy=t;var o=tt!==void 0&&n!==void 0&&!e.headless,s=e;s.layout=Ze({name:o?"grid":"null"},s.layout),s.renderer=Ze({name:o?"canvas":"null"},s.renderer);var u=function(p,x,b){return x!==void 0?x:b!==void 0?b:p},l=this._private={container:n,ready:!1,options:s,elements:new bt(this),listeners:[],aniEles:new bt(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:u(!0,s.zoomingEnabled),userZoomingEnabled:u(!0,s.userZoomingEnabled),panningEnabled:u(!0,s.panningEnabled),userPanningEnabled:u(!0,s.userPanningEnabled),boxSelectionEnabled:u(!0,s.boxSelectionEnabled),autolock:u(!1,s.autolock,s.autolockNodes),autoungrabify:u(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:u(!1,s.autounselectify),styleEnabled:s.styleEnabled===void 0?o:s.styleEnabled,zoom:qe(s.zoom)?s.zoom:1,pan:{x:yr(s.pan)&&qe(s.pan.x)?s.pan.x:0,y:yr(s.pan)&&qe(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:u(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom});var f=function(p,x){var b=p.some(IN);if(b)return po.all(p).then(x);x(p)};l.styleEnabled&&t.setStyle([]);var d=Ze({},s,s.renderer);t.initRenderer(d);var h=function(p,x,b){t.notifications(!1);var w=t.mutableElements();w.length>0&&w.remove(),p!=null&&(yr(p)||Tr(p))&&t.add(p),t.one("layoutready",function(E){t.notifications(!0),t.emit(E),t.one("load",x),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",b),t.emit("done")});var y=Ze({},t._private.options.layout);y.eles=t.elements(),t.layout(y).run()};f([s.style,s.elements],function(g){var p=g[0],x=g[1];l.styleEnabled&&t.style().append(p),h(x,function(){t.startAnimationLoop(),l.ready=!0,$r(s.ready)&&t.on("ready",s.ready);for(var b=0;b<i.length;b++){var w=i[b];t.on("ready",w)}a&&(a.readies=[]),t.emit("ready")},s.done)})},ul=ys.prototype;Ze(ul,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){var e=this._private.container;if(e==null)return tt;var t=this._private.container.ownerDocument;return t===void 0||t==null?tt:t.defaultView||tt},mount:function(e){if(e!=null){var t=this,n=t._private,a=n.options;return!rl(e)&&rl(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(Ze({},a,a.renderer,{name:a.renderer.name==="null"?"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 Nn(this._private.options)},json:function(e){var t=this,n=t._private,a=t.mutableElements(),i=function(C){return t.getElementById(C.id())};if(yr(e)){if(t.startBatch(),e.elements){var o={},s=function(C,S){for(var R=[],_=[],A=0;A<C.length;A++){var P=C[A];if(!P.data.id){Cr("cy.json() cannot handle elements without an ID attribute");continue}var I=""+P.data.id,D=t.getElementById(I);o[I]=!0,D.length!==0?_.push({ele:D,json:P}):(S&&(P.group=S),R.push(P))}t.add(R);for(var L=0;L<_.length;L++){var M=_[L],q=M.ele,N=M.json;q.json(N)}};if(Tr(e.elements))s(e.elements);else for(var u=["nodes","edges"],l=0;l<u.length;l++){var f=u[l],d=e.elements[f];Tr(d)&&s(d,f)}var h=t.collection();a.filter(function(E){return!o[E.id()]}).forEach(function(E){E.isParent()?h.merge(E):E.remove()}),h.forEach(function(E){return E.children().move({parent:null})}),h.forEach(function(E){return i(E).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var g=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],p=0;p<g.length;p++){var x=g[p];e[x]!=null&&t[x](e[x])}return t.endBatch(),this}else{var b=!!e,w={};b?w.elements=this.elements().map(function(E){return E.json()}):(w.elements={},a.forEach(function(E){var C=E.group();w.elements[C]||(w.elements[C]=[]),w.elements[C].push(E.json())})),this._private.styleEnabled&&(w.style=t.style().json()),w.data=Nn(t.data());var y=n.options;return w.zoomingEnabled=n.zoomingEnabled,w.userZoomingEnabled=n.userZoomingEnabled,w.zoom=n.zoom,w.minZoom=n.minZoom,w.maxZoom=n.maxZoom,w.panningEnabled=n.panningEnabled,w.userPanningEnabled=n.userPanningEnabled,w.pan=Nn(n.pan),w.boxSelectionEnabled=n.boxSelectionEnabled,w.renderer=Nn(y.renderer),w.hideEdgesOnViewport=y.hideEdgesOnViewport,w.textureOnViewport=y.textureOnViewport,w.wheelSensitivity=y.wheelSensitivity,w.motionBlur=y.motionBlur,w.multiClickDebounceTime=y.multiClickDebounceTime,w}}});ul.$id=ul.getElementById;[I$,O$,OA,Im,Uu,q$,Dm,Hu,z$,hi,ps].forEach(function(r){Ze(ul,r)});var V$={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}},G$={maximal:!1,acyclic:!1},Hi=function(e){return e.scratch("breadthfirst")},EE=function(e,t){return e.scratch("breadthfirst",t)};function kA(r){this.options=Ze({},V$,G$,r)}kA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(Se){return Se.isChildless()}),a=t,i=r.directed,o=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,u=Lt(s?r.boundingBox:structuredClone(e.extent())),l;if(Jt(r.roots))l=r.roots;else if(Tr(r.roots)){for(var f=[],d=0;d<r.roots.length;d++){var h=r.roots[d],g=e.getElementById(h);f.push(g)}l=e.collection(f)}else if(Ye(r.roots))l=e.$(r.roots);else if(i)l=n.roots();else{var p=t.components();l=e.collection();for(var x=function(){var Ee=p[b],re=Ee.maxDegree(!1),ce=Ee.filter(function(_e){return _e.degree(!1)===re});l=l.add(ce)},b=0;b<p.length;b++)x()}var w=[],y={},E=function(Ee,re){w[re]==null&&(w[re]=[]);var ce=w[re].length;w[re].push(Ee),EE(Ee,{index:ce,depth:re})},C=function(Ee,re){var ce=Hi(Ee),_e=ce.depth,me=ce.index;w[_e][me]=null,Ee.isChildless()&&E(Ee,re)};a.bfs({roots:l,directed:r.directed,visit:function(Ee,re,ce,_e,me){var Te=Ee[0],De=Te.id();Te.isChildless()&&E(Te,me),y[De]=!0}});for(var S=[],R=0;R<n.length;R++){var _=n[R];y[_.id()]||S.push(_)}var A=function(Ee){for(var re=w[Ee],ce=0;ce<re.length;ce++){var _e=re[ce];if(_e==null){re.splice(ce,1),ce--;continue}EE(_e,{depth:Ee,index:ce})}},P=function(Ee,re){for(var ce=Hi(Ee),_e=Ee.incomers().filter(function(ke){return ke.isNode()&&t.has(ke)}),me=-1,Te=Ee.id(),De=0;De<_e.length;De++){var Ne=_e[De],ze=Hi(Ne);me=Math.max(me,ze.depth)}if(ce.depth<=me){if(!r.acyclic&&re[Te])return null;var $e=me+1;return C(Ee,$e),re[Te]=$e,!0}return!1};if(i&&o){var I=[],D={},L=function(Ee){return I.push(Ee)},M=function(){return I.shift()};for(n.forEach(function(Se){return I.push(Se)});I.length>0;){var q=M(),N=P(q,D);if(N)q.outgoers().filter(function(Se){return Se.isNode()&&t.has(Se)}).forEach(L);else if(N===null){Cr("Detected double maximal shift for node `"+q.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var W=0;if(r.avoidOverlap)for(var V=0;V<n.length;V++){var $=n[V],X=$.layoutDimensions(r),ee=X.w,K=X.h;W=Math.max(W,ee,K)}var j={},fe=function(Ee){if(j[Ee.id()])return j[Ee.id()];for(var re=Hi(Ee).depth,ce=Ee.neighborhood(),_e=0,me=0,Te=0;Te<ce.length;Te++){var De=ce[Te];if(!(De.isEdge()||De.isParent()||!n.has(De))){var Ne=Hi(De);if(Ne!=null){var ze=Ne.index,$e=Ne.depth;if(!(ze==null||$e==null)){var ke=w[$e].length;$e<re&&(_e+=ze/ke,me++)}}}}return me=Math.max(1,me),_e=_e/me,me===0&&(_e=0),j[Ee.id()]=_e,_e},G=function(Ee,re){var ce=fe(Ee),_e=fe(re),me=ce-_e;return me===0?qR(Ee.id(),re.id()):me};r.depthSort!==void 0&&(G=r.depthSort);for(var z=w.length,Y=0;Y<z;Y++)w[Y].sort(G),A(Y);for(var te=[],ue=0;ue<S.length;ue++)te.push(S[ue]);var oe=function(){for(var Ee=0;Ee<z;Ee++)A(Ee)};te.length&&(w.unshift(te),z=w.length,oe());for(var Z=0,Q=0;Q<z;Q++)Z=Math.max(w[Q].length,Z);var ie={x:u.x1+u.w/2,y:u.y1+u.h/2},de=n.reduce(function(Se,Ee){return(function(re){return{w:Se.w===-1?re.w:(Se.w+re.w)/2,h:Se.h===-1?re.h:(Se.h+re.h)/2}})(Ee.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),we=Math.max(z===1?0:s?(u.h-r.padding*2-de.h)/(z-1):(u.h-r.padding*2-de.h)/(z+1),W),Ae=w.reduce(function(Se,Ee){return Math.max(Se,Ee.length)},0),ve=function(Ee){var re=Hi(Ee),ce=re.depth,_e=re.index;if(r.circle){var me=Math.min(u.w/2/z,u.h/2/z);me=Math.max(me,W);var Te=me*ce+me-(z>0&&w[0].length<=3?me/2:0),De=2*Math.PI/w[ce].length*_e;return ce===0&&w[0].length===1&&(Te=1),{x:ie.x+Te*Math.cos(De),y:ie.y+Te*Math.sin(De)}}else{var Ne=w[ce].length,ze=Math.max(Ne===1?0:s?(u.w-r.padding*2-de.w)/((r.grid?Ae:Ne)-1):(u.w-r.padding*2-de.w)/((r.grid?Ae:Ne)+1),W),$e={x:ie.x+(_e+1-(Ne+1)/2)*ze,y:ie.y+(ce+1-(z+1)/2)*we};return $e}},le={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(le).indexOf(r.direction)===-1&&kr("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(le).join(", ")));var Me=function(Ee){return iF(ve(Ee),u,le[r.direction])};return t.nodes().layoutPositions(this,r,Me),this};var W$={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function qA(r){this.options=Ze({},W$,r)}qA.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,a=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var o=Lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,l=u/Math.max(1,i.length-1),f,d=0,h=0;h<i.length;h++){var g=i[h],p=g.layoutDimensions(e),x=p.w,b=p.h;d=Math.max(d,x,b)}if(qe(e.radius)?f=e.radius:i.length<=1?f=0:f=Math.min(o.h,o.w)/2-d,i.length>1&&e.avoidOverlap){d*=1.75;var w=Math.cos(l)-Math.cos(0),y=Math.sin(l)-Math.sin(0),E=Math.sqrt(d*d/(w*w+y*y));f=Math.max(E,f)}var C=function(R,_){var A=e.startAngle+_*l*(a?1:-1),P=f*Math.cos(A),I=f*Math.sin(A),D={x:s.x+P,y:s.y+I};return D};return n.nodes().layoutPositions(this,e,C),this};var U$={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function NA(r){this.options=Ze({},U$,r)}NA.prototype.run=function(){for(var r=this.options,e=r,t=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,n=r.cy,a=e.eles,i=a.nodes().not(":parent"),o=Lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},u=[],l=0,f=0;f<i.length;f++){var d=i[f],h=void 0;h=e.concentric(d),u.push({value:h,node:d}),d._private.scratch.concentric=h}i.updateStyle();for(var g=0;g<i.length;g++){var p=i[g],x=p.layoutDimensions(e);l=Math.max(l,x.w,x.h)}u.sort(function(we,Ae){return Ae.value-we.value});for(var b=e.levelWidth(i),w=[[]],y=w[0],E=0;E<u.length;E++){var C=u[E];if(y.length>0){var S=Math.abs(y[0].value-C.value);S>=b&&(y=[],w.push(y))}y.push(C)}var R=l+e.minNodeSpacing;if(!e.avoidOverlap){var _=w.length>0&&w[0].length>1,A=Math.min(o.w,o.h)/2-R,P=A/(w.length+_?1:0);R=Math.min(R,P)}for(var I=0,D=0;D<w.length;D++){var L=w[D],M=e.sweep===void 0?2*Math.PI-2*Math.PI/L.length:e.sweep,q=L.dTheta=M/Math.max(1,L.length-1);if(L.length>1&&e.avoidOverlap){var N=Math.cos(q)-Math.cos(0),W=Math.sin(q)-Math.sin(0),V=Math.sqrt(R*R/(N*N+W*W));I=Math.max(V,I)}L.r=I,I+=R}if(e.equidistant){for(var $=0,X=0,ee=0;ee<w.length;ee++){var K=w[ee],j=K.r-X;$=Math.max($,j)}X=0;for(var fe=0;fe<w.length;fe++){var G=w[fe];fe===0&&(X=G.r),G.r=X,X+=$}}for(var z={},Y=0;Y<w.length;Y++)for(var te=w[Y],ue=te.dTheta,oe=te.r,Z=0;Z<te.length;Z++){var Q=te[Z],ie=e.startAngle+(t?1:-1)*ue*Z,de={x:s.x+oe*Math.cos(ie),y:s.y+oe*Math.sin(ie)};z[Q.node.id()]=de}return a.nodes().layoutPositions(this,e,function(we){var Ae=we.id();return z[Ae]}),this};var tv,H$={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 Ll(r){this.options=Ze({},H$,r),this.options.layout=this;var e=this.options.eles.nodes(),t=this.options.eles.edges(),n=t.filter(function(a){var i=a.source().data("id"),o=a.target().data("id"),s=e.some(function(l){return l.data("id")===i}),u=e.some(function(l){return l.data("id")===o});return!s||!u});this.options.eles=this.options.eles.not(n)}Ll.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(r.animate===!0||r.animate===!1)&&t.emit({type:"layoutstart",layout:t}),r.debug===!0?tv=!0:tv=!1;var n=K$(e,t,r);tv&&Y$(n),r.randomize&&X$(n);var a=ta(),i=function(){Z$(n,e,r),r.fit===!0&&e.fit(r.padding)},o=function(h){return!(t.stopped||h>=r.numIter||(Q$(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},s=function(){if(r.animate===!0||r.animate===!1)i(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var h=r.eles.nodes(),g=zA(n,r,h);h.layoutPositions(t,r,g)}},u=0,l=!0;if(r.animate===!0){var f=function(){for(var h=0;l&&h<r.refresh;)l=o(u),u++,h++;if(!l)_E(n,r),s();else{var g=ta();g-a>=r.animationThreshold&&i(),tl(f)}};f()}else{for(;l;)l=o(u),u++;_E(n,r),s()}return this};Ll.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};Ll.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var K$=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=Lt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:a.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},u=n.eles.components(),l={},f=0;f<u.length;f++)for(var d=u[f],h=0;h<d.length;h++){var g=d[h];l[g.id()]=f}for(var f=0;f<s.nodeSize;f++){var p=i[f],x=p.layoutDimensions(n),b={};b.isLocked=p.locked(),b.id=p.data("id"),b.parentId=p.data("parent"),b.cmptId=l[p.id()],b.children=[],b.positionX=p.position("x"),b.positionY=p.position("y"),b.offsetX=0,b.offsetY=0,b.height=x.w,b.width=x.h,b.maxX=b.positionX+b.width/2,b.minX=b.positionX-b.width/2,b.maxY=b.positionY+b.height/2,b.minY=b.positionY-b.height/2,b.padLeft=parseFloat(p.style("padding")),b.padRight=parseFloat(p.style("padding")),b.padTop=parseFloat(p.style("padding")),b.padBottom=parseFloat(p.style("padding")),b.nodeRepulsion=$r(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,s.layoutNodes.push(b),s.idToIndex[b.id]=f}for(var w=[],y=0,E=-1,C=[],f=0;f<s.nodeSize;f++){var p=s.layoutNodes[f],S=p.parentId;S!=null?s.layoutNodes[s.idToIndex[S]].children.push(p.id):(w[++E]=p.id,C.push(p.id))}for(s.graphSet.push(C);y<=E;){var R=w[y++],_=s.idToIndex[R],g=s.layoutNodes[_],A=g.children;if(A.length>0){s.graphSet.push(A);for(var f=0;f<A.length;f++)w[++E]=A[f]}}for(var f=0;f<s.graphSet.length;f++)for(var P=s.graphSet[f],h=0;h<P.length;h++){var I=s.idToIndex[P[h]];s.indexToGraph[I]=f}for(var f=0;f<s.edgeSize;f++){var D=a[f],L={};L.id=D.data("id"),L.sourceId=D.data("source"),L.targetId=D.data("target");var M=$r(n.idealEdgeLength)?n.idealEdgeLength(D):n.idealEdgeLength,q=$r(n.edgeElasticity)?n.edgeElasticity(D):n.edgeElasticity,N=s.idToIndex[L.sourceId],W=s.idToIndex[L.targetId],V=s.indexToGraph[N],$=s.indexToGraph[W];if(V!=$){for(var X=j$(L.sourceId,L.targetId,s),ee=s.graphSet[X],K=0,b=s.layoutNodes[N];ee.indexOf(b.id)===-1;)b=s.layoutNodes[s.idToIndex[b.parentId]],K++;for(b=s.layoutNodes[W];ee.indexOf(b.id)===-1;)b=s.layoutNodes[s.idToIndex[b.parentId]],K++;M*=K*n.nestingFactor}L.idealLength=M,L.elasticity=q,s.layoutEdges.push(L)}return s},j$=function(e,t,n){var a=FA(e,t,0,n);return 2>a.count?0:a.graph},FA=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 o=0,s=0;s<i.length;s++){var u=i[s],l=a.idToIndex[u],f=a.layoutNodes[l].children;if(f.length!==0){var d=a.indexToGraph[a.idToIndex[f[0]]],h=FA(e,t,d,a);if(h.count!==0)if(h.count===1){if(o++,o===2)break}else return h}}return{count:o,graph:n}},Y$,X$=function(e,t){for(var n=e.clientWidth,a=e.clientHeight,i=0;i<e.nodeSize;i++){var o=e.layoutNodes[i];o.children.length===0&&!o.isLocked&&(o.positionX=Math.random()*n,o.positionY=Math.random()*a)}},zA=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(o){var s=e.layoutNodes[e.idToIndex[o.data("id")]];i.x1=Math.min(i.x1,s.positionX),i.x2=Math.max(i.x2,s.positionX),i.y1=Math.min(i.y1,s.positionY),i.y2=Math.max(i.y2,s.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(o,s){var u=e.layoutNodes[e.idToIndex[o.data("id")]];if(t.boundingBox){var l=i.w===0?.5:(u.positionX-i.x1)/i.w,f=i.h===0?.5:(u.positionY-i.y1)/i.h;return{x:a.x1+l*a.w,y:a.y1+f*a.h}}else return{x:u.positionX,y:u.positionY}}},Z$=function(e,t,n){var a=n.layout,i=n.eles.nodes(),o=zA(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},Q$=function(e,t,n){J$(e,t),t3(e),n3(e,t),a3(e),i3(e)},J$=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var a=e.graphSet[n],i=a.length,o=0;o<i;o++)for(var s=e.layoutNodes[e.idToIndex[a[o]]],u=o+1;u<i;u++){var l=e.layoutNodes[e.idToIndex[a[u]]];e3(s,l,e,t)}},CE=function(e){return-1+2*e*Math.random()},e3=function(e,t,n,a){var i=e.cmptId,o=t.cmptId;if(!(i!==o&&!n.isCompound)){var s=t.positionX-e.positionX,u=t.positionY-e.positionY,l=1;s===0&&u===0&&(s=CE(l),u=CE(l));var f=r3(e,t,s,u);if(f>0)var d=a.nodeOverlap*f,h=Math.sqrt(s*s+u*u),g=d*s/h,p=d*u/h;else var x=ll(e,s,u),b=ll(t,-1*s,-1*u),w=b.x-x.x,y=b.y-x.y,E=w*w+y*y,h=Math.sqrt(E),d=(e.nodeRepulsion+t.nodeRepulsion)/E,g=d*w/h,p=d*y/h;e.isLocked||(e.offsetX-=g,e.offsetY-=p),t.isLocked||(t.offsetX+=g,t.offsetY+=p)}},r3=function(e,t,n,a){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(a>0)var o=e.maxY-t.minY;else var o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},ll=function(e,t,n){var a=e.positionX,i=e.positionY,o=e.height||1,s=e.width||1,u=n/t,l=o/s,f={};return t===0&&0<n||t===0&&0>n?(f.x=a,f.y=i+o/2,f):0<t&&-1*l<=u&&u<=l?(f.x=a+s/2,f.y=i+s*n/2/t,f):0>t&&-1*l<=u&&u<=l?(f.x=a-s/2,f.y=i-s*n/2/t,f):0<n&&(u<=-1*l||u>=l)?(f.x=a+o*t/2/n,f.y=i+o/2,f):(0>n&&(u<=-1*l||u>=l)&&(f.x=a-o*t/2/n,f.y=i-o/2),f)},t3=function(e,t){for(var n=0;n<e.edgeSize;n++){var a=e.layoutEdges[n],i=e.idToIndex[a.sourceId],o=e.layoutNodes[i],s=e.idToIndex[a.targetId],u=e.layoutNodes[s],l=u.positionX-o.positionX,f=u.positionY-o.positionY;if(!(l===0&&f===0)){var d=ll(o,l,f),h=ll(u,-1*l,-1*f),g=h.x-d.x,p=h.y-d.y,x=Math.sqrt(g*g+p*p),b=Math.pow(a.idealLength-x,2)/a.elasticity;if(x!==0)var w=b*g/x,y=b*p/x;else var w=0,y=0;o.isLocked||(o.offsetX+=w,o.offsetY+=y),u.isLocked||(u.offsetX-=w,u.offsetY-=y)}}},n3=function(e,t){if(t.gravity!==0)for(var n=1,a=0;a<e.graphSet.length;a++){var i=e.graphSet[a],o=i.length;if(a===0)var s=e.clientHeight/2,u=e.clientWidth/2;else var l=e.layoutNodes[e.idToIndex[i[0]]],f=e.layoutNodes[e.idToIndex[l.parentId]],s=f.positionX,u=f.positionY;for(var d=0;d<o;d++){var h=e.layoutNodes[e.idToIndex[i[d]]];if(!h.isLocked){var g=s-h.positionX,p=u-h.positionY,x=Math.sqrt(g*g+p*p);if(x>n){var b=t.gravity*g/x,w=t.gravity*p/x;h.offsetX+=b,h.offsetY+=w}}}}},a3=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 o=n[a++],s=e.idToIndex[o],u=e.layoutNodes[s],l=u.children;if(0<l.length&&!u.isLocked){for(var f=u.offsetX,d=u.offsetY,h=0;h<l.length;h++){var g=e.layoutNodes[e.idToIndex[l[h]]];g.offsetX+=f,g.offsetY+=d,n[++i]=l[h]}u.offsetX=0,u.offsetY=0}}},i3=function(e,t){for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&(a.maxX=void 0,a.minX=void 0,a.maxY=void 0,a.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];if(!(0<a.children.length||a.isLocked)){var i=o3(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,$A(a,e)}}for(var n=0;n<e.nodeSize;n++){var a=e.layoutNodes[n];0<a.children.length&&!a.isLocked&&(a.positionX=(a.maxX+a.minX)/2,a.positionY=(a.maxY+a.minY)/2,a.width=a.maxX-a.minX,a.height=a.maxY-a.minY)}},o3=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 var i={x:e,y:t};return i},$A=function(e,t){var n=e.parentId;if(n!=null){var a=t.layoutNodes[t.idToIndex[n]],i=!1;if((a.maxX==null||e.maxX+a.padRight>a.maxX)&&(a.maxX=e.maxX+a.padRight,i=!0),(a.minX==null||e.minX-a.padLeft<a.minX)&&(a.minX=e.minX-a.padLeft,i=!0),(a.maxY==null||e.maxY+a.padBottom>a.maxY)&&(a.maxY=e.maxY+a.padBottom,i=!0),(a.minY==null||e.minY-a.padTop<a.minY)&&(a.minY=e.minY-a.padTop,i=!0),i)return $A(a,t)}},_E=function(e,t){for(var n=e.layoutNodes,a=[],i=0;i<n.length;i++){var o=n[i],s=o.cmptId,u=a[s]=a[s]||[];u.push(o)}for(var l=0,i=0;i<a.length;i++){var f=a[i];if(f){f.x1=1/0,f.x2=-1/0,f.y1=1/0,f.y2=-1/0;for(var d=0;d<f.length;d++){var h=f[d];f.x1=Math.min(f.x1,h.positionX-h.width/2),f.x2=Math.max(f.x2,h.positionX+h.width/2),f.y1=Math.min(f.y1,h.positionY-h.height/2),f.y2=Math.max(f.y2,h.positionY+h.height/2)}f.w=f.x2-f.x1,f.h=f.y2-f.y1,l+=f.w*f.h}}a.sort(function(y,E){return E.w*E.h-y.w*y.h});for(var g=0,p=0,x=0,b=0,w=Math.sqrt(l)*e.clientWidth/e.clientHeight,i=0;i<a.length;i++){var f=a[i];if(f){for(var d=0;d<f.length;d++){var h=f[d];h.isLocked||(h.positionX+=g-f.x1,h.positionY+=p-f.y1)}g+=f.w+t.componentSpacing,x+=f.w+t.componentSpacing,b=Math.max(b,f.h),x>w&&(p+=b+t.componentSpacing,g=0,x=0,b=0)}}},s3={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 VA(r){this.options=Ze({},s3,r)}VA.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=Lt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(i.h===0||i.w===0)n.nodes().layoutPositions(this,e,function(fe){return{x:i.x1,y:i.y1}});else{var o=a.size(),s=Math.sqrt(o*i.h/i.w),u=Math.round(s),l=Math.round(i.w/i.h*s),f=function(G){if(G==null)return Math.min(u,l);var z=Math.min(u,l);z==u?u=G:l=G},d=function(G){if(G==null)return Math.max(u,l);var z=Math.max(u,l);z==u?u=G:l=G},h=e.rows,g=e.cols!=null?e.cols:e.columns;if(h!=null&&g!=null)u=h,l=g;else if(h!=null&&g==null)u=h,l=Math.ceil(o/u);else if(h==null&&g!=null)l=g,u=Math.ceil(o/l);else if(l*u>o){var p=f(),x=d();(p-1)*x>=o?f(p-1):(x-1)*p>=o&&d(x-1)}else for(;l*u<o;){var b=f(),w=d();(w+1)*b>=o?d(w+1):f(b+1)}var y=i.w/l,E=i.h/u;if(e.condense&&(y=0,E=0),e.avoidOverlap)for(var C=0;C<a.length;C++){var S=a[C],R=S._private.position;(R.x==null||R.y==null)&&(R.x=0,R.y=0);var _=S.layoutDimensions(e),A=e.avoidOverlapPadding,P=_.w+A,I=_.h+A;y=Math.max(y,P),E=Math.max(E,I)}for(var D={},L=function(G,z){return!!D["c-"+G+"-"+z]},M=function(G,z){D["c-"+G+"-"+z]=!0},q=0,N=0,W=function(){N++,N>=l&&(N=0,q++)},V={},$=0;$<a.length;$++){var X=a[$],ee=e.position(X);if(ee&&(ee.row!==void 0||ee.col!==void 0)){var K={row:ee.row,col:ee.col};if(K.col===void 0)for(K.col=0;L(K.row,K.col);)K.col++;else if(K.row===void 0)for(K.row=0;L(K.row,K.col);)K.row++;V[X.id()]=K,M(K.row,K.col)}}var j=function(G,z){var Y,te;if(G.locked()||G.isParent())return!1;var ue=V[G.id()];if(ue)Y=ue.col*y+y/2+i.x1,te=ue.row*E+E/2+i.y1;else{for(;L(q,N);)W();Y=N*y+y/2+i.x1,te=q*E+E/2+i.y1,M(q,N),W()}return{x:Y,y:te}};a.layoutPositions(this,e,j)}return this};var u3={ready:function(){},stop:function(){}};function f0(r){this.options=Ze({},u3,r)}f0.prototype.run=function(){var r=this.options,e=r.eles,t=this;return r.cy,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};f0.prototype.stop=function(){return this};var l3={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 GA(r){this.options=Ze({},l3,r)}GA.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),n=$r(r.positions);function a(i){if(r.positions==null)return DF(i.position());if(n)return r.positions(i);var o=r.positions[i._private.data.id];return o??null}return t.layoutPositions(this,r,function(i,o){var s=a(i);return i.locked()||s==null?!1:s}),this};var f3={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 WA(r){this.options=Ze({},f3,r)}WA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=Lt(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a=function(o,s){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}};return t.nodes().layoutPositions(this,r,a),this};var c3=[{name:"breadthfirst",impl:kA},{name:"circle",impl:qA},{name:"concentric",impl:NA},{name:"cose",impl:Ll},{name:"grid",impl:VA},{name:"null",impl:f0},{name:"preset",impl:GA},{name:"random",impl:WA}];function UA(r){this.options=r,this.notifications=0}var SE=function(){},TE=function(){throw new Error("A headless instance can not render images")};UA.prototype={recalculateRenderedStyle:SE,notify:function(){this.notifications++},init:SE,isHeadless:function(){return!0},png:TE,jpg:TE};var c0={};c0.arrowShapeWidth=.3;c0.registerArrowShapes=function(){var r=this.arrowShapes={},e=this,t=function(l,f,d,h,g,p,x){var b=g.x-d/2-x,w=g.x+d/2+x,y=g.y-d/2-x,E=g.y+d/2+x,C=b<=l&&l<=w&&y<=f&&f<=E;return C},n=function(l,f,d,h,g){var p=l*Math.cos(h)-f*Math.sin(h),x=l*Math.sin(h)+f*Math.cos(h),b=p*d,w=x*d,y=b+g.x,E=w+g.y;return{x:y,y:E}},a=function(l,f,d,h){for(var g=[],p=0;p<l.length;p+=2){var x=l[p],b=l[p+1];g.push(n(x,b,f,d,h))}return g},i=function(l){for(var f=[],d=0;d<l.length;d++){var h=l[d];f.push(h.x,h.y)}return f},o=function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").pfValue*2},s=function(l,f){Ye(f)&&(f=r[f]),r[l]=Ze({name:l,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,g,p,x,b,w){var y=i(a(this.points,p+2*w,x,b)),E=Vt(h,g,y);return E},roughCollide:t,draw:function(h,g,p,x){var b=a(this.points,g,p,x);e.arrowShapeImpl("polygon")(h,b)},spacing:function(h){return 0},gap:o},f)};s("none",{collide:nl,roughCollide:nl,draw:Xm,spacing:zw,gap:zw}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(l,f,d,h,g){var p=a(this.points,f,d,h),x=this.controlPoint,b=n(x[0],x[1],f,d,h);e.arrowShapeImpl(this.name)(l,p,b)},gap:function(l){return o(l)*.8}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(l,f,d,h,g,p,x){var b=i(a(this.points,d+2*x,h,g)),w=i(a(this.pointsTee,d+2*x,h,g)),y=Vt(l,f,b)||Vt(l,f,w);return y},draw:function(l,f,d,h,g){var p=a(this.points,f,d,h),x=a(this.pointsTee,f,d,h);e.arrowShapeImpl(this.name)(l,p,x)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(l,f,d,h,g,p,x){var b=g,w=Math.pow(b.x-l,2)+Math.pow(b.y-f,2)<=Math.pow((d+2*x)*this.radius,2),y=i(a(this.points,d+2*x,h,g));return Vt(l,f,y)||w},draw:function(l,f,d,h,g){var p=a(this.pointsTr,f,d,h);e.arrowShapeImpl(this.name)(l,p,h.x,h.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(l,f){var d=this.baseCrossLinePts.slice(),h=f/l,g=3,p=5;return d[g]=d[g]-h,d[p]=d[p]-h,d},collide:function(l,f,d,h,g,p,x){var b=i(a(this.points,d+2*x,h,g)),w=i(a(this.crossLinePts(d,p),d+2*x,h,g)),y=Vt(l,f,b)||Vt(l,f,w);return y},draw:function(l,f,d,h,g){var p=a(this.points,f,d,h),x=a(this.crossLinePts(f,g),f,d,h);e.arrowShapeImpl(this.name)(l,p,x)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(l){return o(l)*.525}}),s("circle",{radius:.15,collide:function(l,f,d,h,g,p,x){var b=g,w=Math.pow(b.x-l,2)+Math.pow(b.y-f,2)<=Math.pow((d+2*x)*this.radius,2);return w},draw:function(l,f,d,h,g){e.arrowShapeImpl(this.name)(l,h.x,h.y,this.radius*f)},spacing:function(l){return e.getArrowWidth(l.pstyle("width").pfValue,l.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(l){return 1},gap:function(l){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(l){return l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(l){return .95*l.pstyle("width").pfValue*l.pstyle("arrow-scale").value}})};var mi={};mi.projectIntoViewport=function(r,e){var t=this.cy,n=this.findContainerClientCoords(),a=n[0],i=n[1],o=n[4],s=t.pan(),u=t.zoom(),l=((r-a)/o-s.x)/u,f=((e-i)/o-s.y)/u;return[l,f]};mi.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(w){return parseFloat(t.getPropertyValue(w))},a={left:n("padding-left"),right:n("padding-right"),top:n("padding-top"),bottom:n("padding-bottom")},i={left:n("border-left-width"),right:n("border-right-width"),top:n("border-top-width"),bottom:n("border-bottom-width")},o=r.clientWidth,s=r.clientHeight,u=a.left+a.right,l=a.top+a.bottom,f=i.left+i.right,d=e.width/(o+f),h=o-u,g=s-l,p=e.left+a.left+i.left,x=e.top+a.top+i.top;return this.containerBB=[p,x,h,g,d]};mi.invalidateContainerClientCoordsCache=function(){this.containerBB=null};mi.findNearestElement=function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]};mi.findNearestElements=function(r,e,t,n){var a=this,i=this,o=i.getCachedZSortedEles(),s=[],u=i.cy.zoom(),l=i.cy.hasCompoundNodes(),f=(n?24:8)/u,d=(n?8:2)/u,h=(n?8:2)/u,g=1/0,p,x;t&&(o=o.interactive);function b(_,A){if(_.isNode()){if(x)return;x=_,s.push(_)}if(_.isEdge()&&(A==null||A<g))if(p){if(p.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value&&p.pstyle("z-compound-depth").value===_.pstyle("z-compound-depth").value){for(var P=0;P<s.length;P++)if(s[P].isEdge()){s[P]=_,p=_,g=A??g;break}}}else s.push(_),p=_,g=A??g}function w(_){var A=_.outerWidth()+2*d,P=_.outerHeight()+2*d,I=A/2,D=P/2,L=_.position(),M=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,q=_._private.rscratch;if(L.x-I<=r&&r<=L.x+I&&L.y-D<=e&&e<=L.y+D){var N=i.nodeShapes[a.getNodeShape(_)];if(N.checkPoint(r,e,0,A,P,L.x,L.y,M,q))return b(_,0),!0}}function y(_){var A=_._private,P=A.rscratch,I=_.pstyle("width").pfValue,D=_.pstyle("arrow-scale").value,L=I/2+f,M=L*L,q=L*2,$=A.source,X=A.target,N;if(P.edgeType==="segments"||P.edgeType==="straight"||P.edgeType==="haystack"){for(var W=P.allpts,V=0;V+3<W.length;V+=2)if(UF(r,e,W[V],W[V+1],W[V+2],W[V+3],q)&&M>(N=XF(r,e,W[V],W[V+1],W[V+2],W[V+3])))return b(_,N),!0}else if(P.edgeType==="bezier"||P.edgeType==="multibezier"||P.edgeType==="self"||P.edgeType==="compound"){for(var W=P.allpts,V=0;V+5<P.allpts.length;V+=4)if(HF(r,e,W[V],W[V+1],W[V+2],W[V+3],W[V+4],W[V+5],q)&&M>(N=YF(r,e,W[V],W[V+1],W[V+2],W[V+3],W[V+4],W[V+5])))return b(_,N),!0}for(var $=$||A.source,X=X||A.target,ee=a.getArrowWidth(I,D),K=[{name:"source",x:P.arrowStartX,y:P.arrowStartY,angle:P.srcArrowAngle},{name:"target",x:P.arrowEndX,y:P.arrowEndY,angle:P.tgtArrowAngle},{name:"mid-source",x:P.midX,y:P.midY,angle:P.midsrcArrowAngle},{name:"mid-target",x:P.midX,y:P.midY,angle:P.midtgtArrowAngle}],V=0;V<K.length;V++){var j=K[V],fe=i.arrowShapes[_.pstyle(j.name+"-arrow-shape").value],G=_.pstyle("width").pfValue;if(fe.roughCollide(r,e,ee,j.angle,{x:j.x,y:j.y},G,f)&&fe.collide(r,e,ee,j.angle,{x:j.x,y:j.y},G,f))return b(_),!0}l&&s.length>0&&(w($),w(X))}function E(_,A,P){return $t(_,A,P)}function C(_,A){var P=_._private,I=h,D;A?D=A+"-":D="",_.boundingBox();var L=P.labelBounds[A||"main"],M=_.pstyle(D+"label").value,q=_.pstyle("text-events").strValue==="yes";if(!(!q||!M)){var N=E(P.rscratch,"labelX",A),W=E(P.rscratch,"labelY",A),V=E(P.rscratch,"labelAngle",A),$=_.pstyle(D+"text-margin-x").pfValue,X=_.pstyle(D+"text-margin-y").pfValue,ee=L.x1-I-$,K=L.x2+I-$,j=L.y1-I-X,fe=L.y2+I-X;if(V){var G=Math.cos(V),z=Math.sin(V),Y=function(de,we){return de=de-N,we=we-W,{x:de*G-we*z+N,y:de*z+we*G+W}},te=Y(ee,j),ue=Y(ee,fe),oe=Y(K,j),Z=Y(K,fe),Q=[te.x+$,te.y+X,oe.x+$,oe.y+X,Z.x+$,Z.y+X,ue.x+$,ue.y+X];if(Vt(r,e,Q))return b(_),!0}else if(Sa(L,r,e))return b(_),!0}}for(var S=o.length-1;S>=0;S--){var R=o[S];R.isNode()?w(R)||C(R):y(R)||C(R)||C(R,"source")||C(R,"target")}return s};mi.getAllInBox=function(r,e,t,n){var a=this.getCachedZSortedEles().interactive,i=this.cy.zoom(),o=2/i,s=[],u=Math.min(r,t),l=Math.max(r,t),f=Math.min(e,n),d=Math.max(e,n);r=u,t=l,e=f,n=d;var h=Lt({x1:r,y1:e,x2:t,y2:n}),g=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],p=[[g[0],g[1]],[g[1],g[2]],[g[2],g[3]],[g[3],g[0]]];function x(de,we,Ae){return $t(de,we,Ae)}function b(de,we){var Ae=de._private,ve=o,le="";de.boundingBox();var Me=Ae.labelBounds.main;if(!Me)return null;var Se=x(Ae.rscratch,"labelX",we),Ee=x(Ae.rscratch,"labelY",we),re=x(Ae.rscratch,"labelAngle",we),ce=de.pstyle(le+"text-margin-x").pfValue,_e=de.pstyle(le+"text-margin-y").pfValue,me=Me.x1-ve-ce,Te=Me.x2+ve-ce,De=Me.y1-ve-_e,Ne=Me.y2+ve-_e;if(re){var ze=Math.cos(re),$e=Math.sin(re),ke=function(ye,O){return ye=ye-Se,O=O-Ee,{x:ye*ze-O*$e+Se,y:ye*$e+O*ze+Ee}};return[ke(me,De),ke(Te,De),ke(Te,Ne),ke(me,Ne)]}else return[{x:me,y:De},{x:Te,y:De},{x:Te,y:Ne},{x:me,y:Ne}]}function w(de,we,Ae,ve){function le(Me,Se,Ee){return(Ee.y-Me.y)*(Se.x-Me.x)>(Se.y-Me.y)*(Ee.x-Me.x)}return le(de,Ae,ve)!==le(we,Ae,ve)&&le(de,we,Ae)!==le(de,we,ve)}for(var y=0;y<a.length;y++){var E=a[y];if(E.isNode()){var C=E,S=C.pstyle("text-events").strValue==="yes",R=C.pstyle("box-selection").strValue,_=C.pstyle("box-select-labels").strValue==="yes";if(R==="none")continue;var A=(R==="overlap"||_)&&S,P=C.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:A});if(R==="contain"){var I=!1;if(_&&S){var D=b(C);D&&ed(D,g)&&(s.push(C),I=!0)}!I&&QR(h,P)&&s.push(C)}else if(R==="overlap"&&e0(h,P)){var L=C.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),M=[{x:L.x1,y:L.y1},{x:L.x2,y:L.y1},{x:L.x2,y:L.y2},{x:L.x1,y:L.y2}];if(ed(M,g))s.push(C);else{var q=b(C);q&&ed(q,g)&&s.push(C)}}}else{var N=E,W=N._private,V=W.rscratch,$=N.pstyle("box-selection").strValue;if($==="none")continue;if($==="contain"){if(V.startX!=null&&V.startY!=null&&!Sa(h,V.startX,V.startY)||V.endX!=null&&V.endY!=null&&!Sa(h,V.endX,V.endY))continue;if(V.edgeType==="bezier"||V.edgeType==="multibezier"||V.edgeType==="self"||V.edgeType==="compound"||V.edgeType==="segments"||V.edgeType==="haystack"){for(var X=W.rstyle.bezierPts||W.rstyle.linePts||W.rstyle.haystackPts,ee=!0,K=0;K<X.length;K++)if(!Uw(h,X[K])){ee=!1;break}ee&&s.push(N)}else V.edgeType==="straight"&&s.push(N)}else if($==="overlap"){var j=!1;if(V.startX!=null&&V.startY!=null&&V.endX!=null&&V.endY!=null&&(Sa(h,V.startX,V.startY)||Sa(h,V.endX,V.endY)))s.push(N),j=!0;else if(!j&&V.edgeType==="haystack"){for(var fe=W.rstyle.haystackPts,G=0;G<fe.length;G++)if(Uw(h,fe[G])){s.push(N),j=!0;break}}if(!j){var z=W.rstyle.bezierPts||W.rstyle.linePts||W.rstyle.haystackPts;if((!z||z.length<2)&&V.edgeType==="straight"&&V.startX!=null&&V.startY!=null&&V.endX!=null&&V.endY!=null&&(z=[{x:V.startX,y:V.startY},{x:V.endX,y:V.endY}]),!z||z.length<2)continue;for(var Y=0;Y<z.length-1;Y++){for(var te=z[Y],ue=z[Y+1],oe=0;oe<p.length;oe++){var Z=Xr(p[oe],2),Q=Z[0],ie=Z[1];if(w(te,ue,Q,ie)){s.push(N),j=!0;break}}if(j)break}}}}}return s};var fl={};fl.calculateArrowAngles=function(r){var e=r._private.rscratch,t=e.edgeType==="haystack",n=e.edgeType==="bezier",a=e.edgeType==="multibezier",i=e.edgeType==="segments",o=e.edgeType==="compound",s=e.edgeType==="self",u,l,f,d,h,g,w,y;if(t?(f=e.haystackPts[0],d=e.haystackPts[1],h=e.haystackPts[2],g=e.haystackPts[3]):(f=e.arrowStartX,d=e.arrowStartY,h=e.arrowEndX,g=e.arrowEndY),w=e.midX,y=e.midY,i)u=f-e.segpts[0],l=d-e.segpts[1];else if(a||o||s||n){var p=e.allpts,x=ut(p[0],p[2],p[4],.1),b=ut(p[1],p[3],p[5],.1);u=f-x,l=d-b}else u=f-w,l=d-y;e.srcArrowAngle=Au(u,l);var w=e.midX,y=e.midY;if(t&&(w=(f+h)/2,y=(d+g)/2),u=h-f,l=g-d,i){var p=e.allpts;if(p.length/2%2===0){var E=p.length/2,C=E-2;u=p[E]-p[C],l=p[E+1]-p[C+1]}else if(e.isRound)u=e.midVector[1],l=-e.midVector[0];else{var E=p.length/2-1,C=E-2;u=p[E]-p[C],l=p[E+1]-p[C+1]}}else if(a||o||s){var p=e.allpts,S=e.ctrlpts,R,_,A,P;if(S.length/2%2===0){var I=p.length/2-1,D=I+2,L=D+2;R=ut(p[I],p[D],p[L],0),_=ut(p[I+1],p[D+1],p[L+1],0),A=ut(p[I],p[D],p[L],1e-4),P=ut(p[I+1],p[D+1],p[L+1],1e-4)}else{var D=p.length/2-1,I=D-2,L=D+2;R=ut(p[I],p[D],p[L],.4999),_=ut(p[I+1],p[D+1],p[L+1],.4999),A=ut(p[I],p[D],p[L],.5),P=ut(p[I+1],p[D+1],p[L+1],.5)}u=A-R,l=P-_}if(e.midtgtArrowAngle=Au(u,l),e.midDispX=u,e.midDispY=l,u*=-1,l*=-1,i){var p=e.allpts;if(p.length/2%2!==0){if(!e.isRound){var E=p.length/2-1,M=E+2;u=-(p[M]-p[E]),l=-(p[M+1]-p[E+1])}}}if(e.midsrcArrowAngle=Au(u,l),i)u=h-e.segpts[e.segpts.length-2],l=g-e.segpts[e.segpts.length-1];else if(a||o||s||n){var p=e.allpts,q=p.length,x=ut(p[q-6],p[q-4],p[q-2],.9),b=ut(p[q-5],p[q-3],p[q-1],.9);u=h-x,l=g-b}else u=h-w,l=g-y;e.tgtArrowAngle=Au(u,l)};fl.getArrowWidth=fl.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(r*13.37,.9),29)*e,t[r+", "+e]=n,n)};var Bm,Mm,On={},cn={},RE,AE,si,Ku,Jn,ei,ni,Mn,Ki,ku,HA,KA,Lm,Om,PE,IE=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)},d3=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},v3=function(e,t,n,a,i){if(e!==PE?IE(t,e,On):d3(cn,On),IE(t,n,cn),RE=On.nx*cn.ny-On.ny*cn.nx,AE=On.nx*cn.nx-On.ny*-cn.ny,Jn=Math.asin(Math.max(-1,Math.min(1,RE))),Math.abs(Jn)<1e-6){Bm=t.x,Mm=t.y,ni=Ki=0;return}si=1,Ku=!1,AE<0?Jn<0?Jn=Math.PI+Jn:(Jn=Math.PI-Jn,si=-1,Ku=!0):Jn>0&&(si=-1,Ku=!0),t.radius!==void 0?Ki=t.radius:Ki=a,ei=Jn/2,ku=Math.min(On.len/2,cn.len/2),i?(Mn=Math.abs(Math.cos(ei)*Ki/Math.sin(ei)),Mn>ku?(Mn=ku,ni=Math.abs(Mn*Math.sin(ei)/Math.cos(ei))):ni=Ki):(Mn=Math.min(ku,Ki),ni=Math.abs(Mn*Math.sin(ei)/Math.cos(ei))),Lm=t.x+cn.nx*Mn,Om=t.y+cn.ny*Mn,Bm=Lm-cn.ny*ni*si,Mm=Om+cn.nx*ni*si,HA=t.x+On.nx*Mn,KA=t.y+On.ny*Mn,PE=t};function jA(r,e){e.radius===0?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function d0(r,e,t,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return n===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(v3(r,e,t,n,a),{cx:Bm,cy:Mm,radius:ni,startX:HA,startY:KA,stopX:Lm,stopY:Om,startAngle:On.ang+Math.PI/2*si,endAngle:cn.ang-Math.PI/2*si,counterClockwise:Ku})}var ms=.01,h3=Math.sqrt(2*ms),At={};At.findMidptPtsEtc=function(r,e){var t=e.posPts,n=e.intersectionPts,a=e.vectorNormInverse,i,o=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),u=o.units!=null&&s.units!=null,l=function(S,R,_,A){var P=A-R,I=_-S,D=Math.sqrt(I*I+P*P);return{x:-P/D,y:I/D}},f=r.pstyle("edge-distances").value;switch(f){case"node-position":i=t;break;case"intersection":i=n;break;case"endpoints":{if(u){var d=this.manualEndptToPx(r.source()[0],o),h=Xr(d,2),g=h[0],p=h[1],x=this.manualEndptToPx(r.target()[0],s),b=Xr(x,2),w=b[0],y=b[1],E={x1:g,y1:p,x2:w,y2:y};a=l(g,p,w,y),i=E}else Cr("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;break}}return{midptPts:i,vectorNormInverse:a}};At.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=Math.random()*2*Math.PI;a.source={x:Math.cos(i),y:Math.sin(i)},i=Math.random()*2*Math.PI,a.target={x:Math.cos(i),y:Math.sin(i)}}var o=n.source,s=n.target,u=o.position(),l=s.position(),f=o.width(),d=s.width(),h=o.height(),g=s.height(),p=t.pstyle("haystack-radius").value,x=p/2;a.haystackPts=a.allpts=[a.source.x*f*x+u.x,a.source.y*h*x+u.y,a.target.x*d*x+l.x,a.target.y*g*x+l.y],a.midX=(a.allpts[0]+a.allpts[2])/2,a.midY=(a.allpts[1]+a.allpts[3])/2,a.edgeType="haystack",a.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}};At.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),a=r.pstyle("segment-distances"),i=r.pstyle("segment-radii"),o=r.pstyle("radius-type"),s=Math.min(n.pfValue.length,a.pfValue.length),u=i.pfValue[i.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var f=0;f<s;f++){var d=n.pfValue[f],h=a.pfValue[f],g=1-d,p=d,x=this.findMidptPtsEtc(r,e),b=x.midptPts,w=x.vectorNormInverse,y={x:b.x1*g+b.x2*p,y:b.y1*g+b.y2*p};t.segpts.push(y.x+w.x*h,y.y+w.y*h),t.radii.push(i.pfValue[f]!==void 0?i.pfValue[f]:u),t.isArcRadius.push((o.pfValue[f]!==void 0?o.pfValue[f]:l)==="arc-radius")}};At.findLoopPoints=function(r,e,t,n){var a=r._private.rscratch,i=e.dirCounts,o=e.srcPos,s=r.pstyle("control-point-distances"),u=s?s.pfValue[0]:void 0,l=r.pstyle("loop-direction").pfValue,f=r.pstyle("loop-sweep").pfValue,d=r.pstyle("control-point-step-size").pfValue;a.edgeType="self";var h=t,g=d;n&&(h=0,g=u);var p=l-Math.PI/2,x=p-f/2,b=p+f/2,w=l+"_"+f;h=i[w]===void 0?i[w]=0:++i[w],a.ctrlpts=[o.x+Math.cos(x)*1.4*g*(h/3+1),o.y+Math.sin(x)*1.4*g*(h/3+1),o.x+Math.cos(b)*1.4*g*(h/3+1),o.y+Math.sin(b)*1.4*g*(h/3+1)]};At.findCompoundLoopPoints=function(r,e,t,n){var a=r._private.rscratch;a.edgeType="compound";var i=e.srcPos,o=e.tgtPos,s=e.srcW,u=e.srcH,l=e.tgtW,f=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,h=r.pstyle("control-point-distances"),g=h?h.pfValue[0]:void 0,p=t,x=d;n&&(p=0,x=g);var b=50,w={x:i.x-s/2,y:i.y-u/2},y={x:o.x-l/2,y:o.y-f/2},E={x:Math.min(w.x,y.x),y:Math.min(w.y,y.y)},C=.5,S=Math.max(C,Math.log(s*ms)),R=Math.max(C,Math.log(l*ms));a.ctrlpts=[E.x,E.y-(1+Math.pow(b,1.12)/100)*x*(p/3+1)*S,E.x-(1+Math.pow(b,1.12)/100)*x*(p/3+1)*R,E.y]};At.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};At.findBezierPoints=function(r,e,t,n,a){var i=r._private.rscratch,o=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),u=r.pstyle("control-point-weights"),l=s&&u?Math.min(s.value.length,u.value.length):1,f=s?s.pfValue[0]:void 0,d=u.value[0],h=n;i.edgeType=h?"multibezier":"bezier",i.ctrlpts=[];for(var g=0;g<l;g++){var p=(.5-e.eles.length/2+t)*o*(a?-1:1),x=void 0,b=Jm(p);h&&(f=s?s.pfValue[g]:o,d=u.value[g]),n?x=f:x=f!==void 0?b*f:void 0;var w=x!==void 0?x:p,y=1-d,E=d,C=this.findMidptPtsEtc(r,e),S=C.midptPts,R=C.vectorNormInverse,_={x:S.x1*y+S.x2*E,y:S.y1*y+S.y2*E};i.ctrlpts.push(_.x+R.x*w,_.y+R.y*w)}};At.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",a="horizontal",i="leftward",o="rightward",s="downward",u="upward",l="auto",f=e.posPts,d=e.srcW,h=e.srcH,g=e.tgtW,p=e.tgtH,x=r.pstyle("edge-distances").value,b=x!=="node-position",w=r.pstyle("taxi-direction").value,y=w,E=r.pstyle("taxi-turn"),C=E.units==="%",S=E.pfValue,R=S<0,_=r.pstyle("taxi-turn-min-distance").pfValue,A=b?(d+g)/2:0,P=b?(h+p)/2:0,I=f.x2-f.x1,D=f.y2-f.y1,L=function(O,ne){return O>0?Math.max(O-ne,0):Math.min(O+ne,0)},M=L(I,A),q=L(D,P),N=!1;y===l?w=Math.abs(M)>Math.abs(q)?a:n:y===u||y===s?(w=n,N=!0):(y===i||y===o)&&(w=a,N=!0);var W=w===n,V=W?q:M,$=W?D:I,X=Jm($),ee=!1;!(N&&(C||R))&&(y===s&&$<0||y===u&&$>0||y===i&&$>0||y===o&&$<0)&&(X*=-1,V=X*Math.abs(V),ee=!0);var K;if(C){var j=S<0?1+S:S;K=j*V}else{var fe=S<0?V:0;K=fe+S*X}var G=function(O){return Math.abs(O)<_||Math.abs(O)>=Math.abs(V)},z=G(K),Y=G(Math.abs(V)-Math.abs(K)),te=z||Y;if(te&&!ee)if(W){var ue=Math.abs($)<=h/2,oe=Math.abs(I)<=g/2;if(ue){var Z=(f.x1+f.x2)/2,Q=f.y1,ie=f.y2;t.segpts=[Z,Q,Z,ie]}else if(oe){var de=(f.y1+f.y2)/2,we=f.x1,Ae=f.x2;t.segpts=[we,de,Ae,de]}else t.segpts=[f.x1,f.y2]}else{var ve=Math.abs($)<=d/2,le=Math.abs(D)<=p/2;if(ve){var Me=(f.y1+f.y2)/2,Se=f.x1,Ee=f.x2;t.segpts=[Se,Me,Ee,Me]}else if(le){var re=(f.x1+f.x2)/2,ce=f.y1,_e=f.y2;t.segpts=[re,ce,re,_e]}else t.segpts=[f.x2,f.y1]}else if(W){var me=f.y1+K+(b?h/2*X:0),Te=f.x1,De=f.x2;t.segpts=[Te,me,De,me]}else{var Ne=f.x1+K+(b?d/2*X:0),ze=f.y1,$e=f.y2;t.segpts=[Ne,ze,Ne,$e]}if(t.isRound){var ke=r.pstyle("taxi-radius").value,Oe=r.pstyle("radius-type").value[0]==="arc-radius";t.radii=new Array(t.segpts.length/2).fill(ke),t.isArcRadius=new Array(t.segpts.length/2).fill(Oe)}};At.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if(t.edgeType==="bezier"){var n=e.srcPos,a=e.tgtPos,i=e.srcW,o=e.srcH,s=e.tgtW,u=e.tgtH,l=e.srcShape,f=e.tgtShape,d=e.srcCornerRadius,h=e.tgtCornerRadius,g=e.srcRs,p=e.tgtRs,x=!qe(t.startX)||!qe(t.startY),b=!qe(t.arrowStartX)||!qe(t.arrowStartY),w=!qe(t.endX)||!qe(t.endY),y=!qe(t.arrowEndX)||!qe(t.arrowEndY),E=3,C=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,S=E*C,R=di({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),_=R<S,A=di({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),P=A<S,I=!1;if(x||b||_){I=!0;var D={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},L=Math.sqrt(D.x*D.x+D.y*D.y),M={x:D.x/L,y:D.y/L},q=Math.max(i,o),N={x:t.ctrlpts[0]+M.x*2*q,y:t.ctrlpts[1]+M.y*2*q},W=l.intersectLine(n.x,n.y,i,o,N.x,N.y,0,d,g);_?(t.ctrlpts[0]=t.ctrlpts[0]+M.x*(S-R),t.ctrlpts[1]=t.ctrlpts[1]+M.y*(S-R)):(t.ctrlpts[0]=W[0]+M.x*S,t.ctrlpts[1]=W[1]+M.y*S)}if(w||y||P){I=!0;var V={x:t.ctrlpts[0]-a.x,y:t.ctrlpts[1]-a.y},$=Math.sqrt(V.x*V.x+V.y*V.y),X={x:V.x/$,y:V.y/$},ee=Math.max(i,o),K={x:t.ctrlpts[0]+X.x*2*ee,y:t.ctrlpts[1]+X.y*2*ee},j=f.intersectLine(a.x,a.y,s,u,K.x,K.y,0,h,p);P?(t.ctrlpts[0]=t.ctrlpts[0]+X.x*(S-A),t.ctrlpts[1]=t.ctrlpts[1]+X.y*(S-A)):(t.ctrlpts[0]=j[0]+X.x*S,t.ctrlpts[1]=j[1]+X.y*S)}I&&this.findEndpoints(r)}};At.storeAllpts=function(r){var e=r._private.rscratch;if(e.edgeType==="multibezier"||e.edgeType==="bezier"||e.edgeType==="self"||e.edgeType==="compound"){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var 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);e.allpts.push(e.endX,e.endY);var n,a;e.ctrlpts.length/2%2===0?(n=e.allpts.length/2-1,e.midX=e.allpts[n],e.midY=e.allpts[n+1]):(n=e.allpts.length/2-3,a=.5,e.midX=ut(e.allpts[n],e.allpts[n+2],e.allpts[n+4],a),e.midY=ut(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],a))}else if(e.edgeType==="straight")e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if(e.edgeType==="segments"){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var i=2;i+3<e.allpts.length;i+=2){var o=e.radii[i/2-1],s=e.isArcRadius[i/2-1];e.roundCorners.push(d0({x:e.allpts[i-2],y:e.allpts[i-1]},{x:e.allpts[i],y:e.allpts[i+1],radius:o},{x:e.allpts[i+2],y:e.allpts[i+3]},o,s))}}if(e.segpts.length%4===0){var u=e.segpts.length/2,l=u-2;e.midX=(e.segpts[l]+e.segpts[u])/2,e.midY=(e.segpts[l+1]+e.segpts[u+1])/2}else{var f=e.segpts.length/2-1;if(!e.isRound)e.midX=e.segpts[f],e.midY=e.segpts[f+1];else{var d={x:e.segpts[f],y:e.segpts[f+1]},h=e.roundCorners[f/2];if(h.radius===0){var g={x:e.segpts[f+2],y:e.segpts[f+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-g.y,g.x-d.x]}else{var p=[d.x-h.cx,d.y-h.cy],x=h.radius/Math.sqrt(Math.pow(p[0],2)+Math.pow(p[1],2));p=p.map(function(b){return b*x}),e.midX=h.cx+p[0],e.midY=h.cy+p[1],e.midVector=p}}}}};At.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||qe(e.startX)&&qe(e.startY)&&qe(e.endX)&&qe(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Cr("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."))};At.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,n=t.cy,a=n.hasCompoundNodes(),i=new ra,o=function(P,I){return[].concat(el(P),[I?1:0]).join("-")},s=[],u=[],l=0;l<r.length;l++){var f=r[l],d=f._private,h=f.pstyle("curve-style").value;if(!(f.removed()||!f.takesUpSpace())){if(h==="haystack"){u.push(f);continue}var g=h==="unbundled-bezier"||_a(h,"segments")||h==="straight"||h==="straight-triangle"||_a(h,"taxi"),p=h==="unbundled-bezier"||h==="bezier",x=d.source,b=d.target,w=x.poolIndex(),y=b.poolIndex(),E=[w,y].sort(),C=o(E,g),S=i.get(C);S==null&&(S={eles:[]},s.push({pairId:E,edgeIsUnbundled:g}),i.set(C,S)),S.eles.push(f),g&&(S.hasUnbundled=!0),p&&(S.hasBezier=!0)}}for(var R=function(){var P=s[_],I=P.pairId,D=P.edgeIsUnbundled,L=o(I,D),M=i.get(L),q;if(!M.hasUnbundled){var N=M.eles[0].parallelEdges().filter(function(Oe){return Oe.isBundledBezier()});Zm(M.eles),N.forEach(function(Oe){return M.eles.push(Oe)}),M.eles.sort(function(Oe,ye){return Oe.poolIndex()-ye.poolIndex()})}var W=M.eles[0],V=W.source(),$=W.target();if(V.poolIndex()>$.poolIndex()){var X=V;V=$,$=X}var ee=M.srcPos=V.position(),K=M.tgtPos=$.position(),j=M.srcW=V.outerWidth(),fe=M.srcH=V.outerHeight(),G=M.tgtW=$.outerWidth(),z=M.tgtH=$.outerHeight(),Y=M.srcShape=t.nodeShapes[e.getNodeShape(V)],te=M.tgtShape=t.nodeShapes[e.getNodeShape($)],ue=M.srcCornerRadius=V.pstyle("corner-radius").value==="auto"?"auto":V.pstyle("corner-radius").pfValue,oe=M.tgtCornerRadius=$.pstyle("corner-radius").value==="auto"?"auto":$.pstyle("corner-radius").pfValue,Z=M.tgtRs=$._private.rscratch,Q=M.srcRs=V._private.rscratch;M.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ie=0;ie<M.eles.length;ie++){var de=M.eles[ie],we=de[0]._private.rscratch,Ae=de.pstyle("curve-style").value,ve=Ae==="unbundled-bezier"||_a(Ae,"segments")||_a(Ae,"taxi"),le=!V.same(de.source());if(!M.calculatedIntersection&&V!==$&&(M.hasBezier||M.hasUnbundled)){M.calculatedIntersection=!0;var Me=Y.intersectLine(ee.x,ee.y,j,fe,K.x,K.y,0,ue,Q),Se=M.srcIntn=Me,Ee=te.intersectLine(K.x,K.y,G,z,ee.x,ee.y,0,oe,Z),re=M.tgtIntn=Ee,ce=M.intersectionPts={x1:Me[0],x2:Ee[0],y1:Me[1],y2:Ee[1]},_e=M.posPts={x1:ee.x,x2:K.x,y1:ee.y,y2:K.y},me=Ee[1]-Me[1],Te=Ee[0]-Me[0],De=Math.sqrt(Te*Te+me*me);qe(De)&&De>=h3||(De=Math.sqrt(Math.max(Te*Te,ms)+Math.max(me*me,ms)));var Ne=M.vector={x:Te,y:me},ze=M.vectorNorm={x:Ne.x/De,y:Ne.y/De},$e={x:-ze.y,y:ze.x};M.nodesOverlap=!qe(De)||te.checkPoint(Me[0],Me[1],0,G,z,K.x,K.y,oe,Z)||Y.checkPoint(Ee[0],Ee[1],0,j,fe,ee.x,ee.y,ue,Q),M.vectorNormInverse=$e,q={nodesOverlap:M.nodesOverlap,dirCounts:M.dirCounts,calculatedIntersection:!0,hasBezier:M.hasBezier,hasUnbundled:M.hasUnbundled,eles:M.eles,srcPos:K,srcRs:Z,tgtPos:ee,tgtRs:Q,srcW:G,srcH:z,tgtW:j,tgtH:fe,srcIntn:re,tgtIntn:Se,srcShape:te,tgtShape:Y,posPts:{x1:_e.x2,y1:_e.y2,x2:_e.x1,y2:_e.y1},intersectionPts:{x1:ce.x2,y1:ce.y2,x2:ce.x1,y2:ce.y1},vector:{x:-Ne.x,y:-Ne.y},vectorNorm:{x:-ze.x,y:-ze.y},vectorNormInverse:{x:-$e.x,y:-$e.y}}}var ke=le?q:M;we.nodesOverlap=ke.nodesOverlap,we.srcIntn=ke.srcIntn,we.tgtIntn=ke.tgtIntn,we.isRound=Ae.startsWith("round"),a&&(V.isParent()||V.isChild()||$.isParent()||$.isChild())&&(V.parents().anySame($)||$.parents().anySame(V)||V.same($)&&V.isParent())?e.findCompoundLoopPoints(de,ke,ie,ve):V===$?e.findLoopPoints(de,ke,ie,ve):Ae.endsWith("segments")?e.findSegmentsPoints(de,ke):Ae.endsWith("taxi")?e.findTaxiPoints(de,ke):Ae==="straight"||!ve&&M.eles.length%2===1&&ie===Math.floor(M.eles.length/2)?e.findStraightEdgePoints(de):e.findBezierPoints(de,ke,ie,ve,le),e.findEndpoints(de),e.tryToCorrectInvalidPoints(de,ke),e.checkForInvalidEdgeWarning(de),e.storeAllpts(de),e.storeEdgeProjections(de),e.calculateArrowAngles(de),e.recalculateEdgeLabelProjections(de),e.calculateLabelAngles(de)}},_=0;_<s.length;_++)R();this.findHaystackPoints(u)}};function YA(r){var e=[];if(r!=null){for(var t=0;t<r.length;t+=2){var n=r[t],a=r[t+1];e.push({x:n,y:a})}return e}}At.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return YA(e.segpts)};At.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="bezier"||t==="multibezier"||t==="self"||t==="compound")return YA(e.ctrlpts)};At.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Ps={};Ps.manualEndptToPx=function(r,e){var t=this,n=r.position(),a=r.outerWidth(),i=r.outerHeight(),o=r._private.rscratch;if(e.value.length===2){var s=[e.pfValue[0],e.pfValue[1]];return e.units[0]==="%"&&(s[0]=s[0]*a),e.units[1]==="%"&&(s[1]=s[1]*i),s[0]+=n.x,s[1]+=n.y,s}else{var u=e.pfValue[0];u=-Math.PI/2+u;var l=2*Math.max(a,i),f=[n.x+Math.cos(u)*l,n.y+Math.sin(u)*l];return t.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,a,i,f[0],f[1],0,r.pstyle("corner-radius").value==="auto"?"auto":r.pstyle("corner-radius").pfValue,o)}};Ps.findEndpoints=function(r){var e,t,n,a,i=this,o,s=r.source()[0],u=r.target()[0],l=s.position(),f=u.position(),d=r.pstyle("target-arrow-shape").value,h=r.pstyle("source-arrow-shape").value,g=r.pstyle("target-distance-from-node").pfValue,p=r.pstyle("source-distance-from-node").pfValue,x=s._private.rscratch,b=u._private.rscratch,w=r.pstyle("curve-style").value,y=r._private.rscratch,E=y.edgeType,C=_a(w,"taxi"),S=E==="self"||E==="compound",R=E==="bezier"||E==="multibezier"||S,_=E!=="bezier",A=E==="straight"||E==="segments",P=E==="segments",I=R||_||A,D=S||C,L=r.pstyle("source-endpoint"),M=D?"outside-to-node":L.value,q=s.pstyle("corner-radius").value==="auto"?"auto":s.pstyle("corner-radius").pfValue,N=r.pstyle("target-endpoint"),W=D?"outside-to-node":N.value,V=u.pstyle("corner-radius").value==="auto"?"auto":u.pstyle("corner-radius").pfValue;y.srcManEndpt=L,y.tgtManEndpt=N;var $,X,ee,K,j=(e=(N==null||(t=N.pfValue)===null||t===void 0?void 0:t.length)===2?N.pfValue:null)!==null&&e!==void 0?e:[0,0],fe=(n=(L==null||(a=L.pfValue)===null||a===void 0?void 0:a.length)===2?L.pfValue:null)!==null&&n!==void 0?n:[0,0];if(R){var G=[y.ctrlpts[0],y.ctrlpts[1]],z=_?[y.ctrlpts[y.ctrlpts.length-2],y.ctrlpts[y.ctrlpts.length-1]]:G;$=z,X=G}else if(A){var Y=P?y.segpts.slice(0,2):[f.x+j[0],f.y+j[1]],te=P?y.segpts.slice(y.segpts.length-2):[l.x+fe[0],l.y+fe[1]];$=te,X=Y}if(W==="inside-to-node")o=[f.x,f.y];else if(N.units)o=this.manualEndptToPx(u,N);else if(W==="outside-to-line")o=y.tgtIntn;else if(W==="outside-to-node"||W==="outside-to-node-or-label"?ee=$:(W==="outside-to-line"||W==="outside-to-line-or-label")&&(ee=[l.x,l.y]),o=i.nodeShapes[this.getNodeShape(u)].intersectLine(f.x,f.y,u.outerWidth(),u.outerHeight(),ee[0],ee[1],0,V,b),W==="outside-to-node-or-label"||W==="outside-to-line-or-label"){var ue=u._private.rscratch,oe=ue.labelWidth,Z=ue.labelHeight,Q=ue.labelX,ie=ue.labelY,de=oe/2,we=Z/2,Ae=u.pstyle("text-valign").value;Ae==="top"?ie-=we:Ae==="bottom"&&(ie+=we);var ve=u.pstyle("text-halign").value;ve==="left"?Q-=de:ve==="right"&&(Q+=de);var le=vs(ee[0],ee[1],[Q-de,ie-we,Q+de,ie-we,Q+de,ie+we,Q-de,ie+we],f.x,f.y);if(le.length>0){var Me=l,Se=ti(Me,Ji(o)),Ee=ti(Me,Ji(le)),re=Se;if(Ee<Se&&(o=le,re=Ee),le.length>2){var ce=ti(Me,{x:le[2],y:le[3]});ce<re&&(o=[le[2],le[3]])}}}var _e=Pu(o,$,i.arrowShapes[d].spacing(r)+g),me=Pu(o,$,i.arrowShapes[d].gap(r)+g);if(y.endX=me[0],y.endY=me[1],y.arrowEndX=_e[0],y.arrowEndY=_e[1],M==="inside-to-node")o=[l.x,l.y];else if(L.units)o=this.manualEndptToPx(s,L);else if(M==="outside-to-line")o=y.srcIntn;else if(M==="outside-to-node"||M==="outside-to-node-or-label"?K=X:(M==="outside-to-line"||M==="outside-to-line-or-label")&&(K=[f.x,f.y]),o=i.nodeShapes[this.getNodeShape(s)].intersectLine(l.x,l.y,s.outerWidth(),s.outerHeight(),K[0],K[1],0,q,x),M==="outside-to-node-or-label"||M==="outside-to-line-or-label"){var Te=s._private.rscratch,De=Te.labelWidth,Ne=Te.labelHeight,ze=Te.labelX,$e=Te.labelY,ke=De/2,Oe=Ne/2,ye=s.pstyle("text-valign").value;ye==="top"?$e-=Oe:ye==="bottom"&&($e+=Oe);var O=s.pstyle("text-halign").value;O==="left"?ze-=ke:O==="right"&&(ze+=ke);var ne=vs(K[0],K[1],[ze-ke,$e-Oe,ze+ke,$e-Oe,ze+ke,$e+Oe,ze-ke,$e+Oe],l.x,l.y);if(ne.length>0){var he=f,ge=ti(he,Ji(o)),be=ti(he,Ji(ne)),Ve=ge;if(be<ge&&(o=[ne[0],ne[1]],Ve=be),ne.length>2){var Be=ti(he,{x:ne[2],y:ne[3]});Be<Ve&&(o=[ne[2],ne[3]])}}}var He=Pu(o,X,i.arrowShapes[h].spacing(r)+p),We=Pu(o,X,i.arrowShapes[h].gap(r)+p);y.startX=We[0],y.startY=We[1],y.arrowStartX=He[0],y.arrowStartY=He[1],I&&(!qe(y.startX)||!qe(y.startY)||!qe(y.endX)||!qe(y.endY)?y.badLine=!0:y.badLine=!1)};Ps.getSourceEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[0],y:e.haystackPts[1]};default:return{x:e.arrowStartX,y:e.arrowStartY}}};Ps.getTargetEndpoint=function(r){var e=r[0]._private.rscratch;switch(this.recalculateRenderedStyle(r),e.edgeType){case"haystack":return{x:e.haystackPts[2],y:e.haystackPts[3]};default:return{x:e.arrowEndX,y:e.arrowEndY}}};var v0={};function g3(r,e,t){for(var n=function(l,f,d,h){return ut(l,f,d,h)},a=e._private,i=a.rstyle.bezierPts,o=0;o<r.bezierProjPcts.length;o++){var s=r.bezierProjPcts[o];i.push({x:n(t[0],t[2],t[4],s),y:n(t[1],t[3],t[5],s)})}}v0.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,n==="multibezier"||n==="bezier"||n==="self"||n==="compound"){e.rstyle.bezierPts=[];for(var a=0;a+5<t.allpts.length;a+=4)g3(this,r,t.allpts.slice(a,a+6))}else if(n==="segments")for(var i=e.rstyle.linePts=[],a=0;a+1<t.allpts.length;a+=2)i.push({x:t.allpts[a],y:t.allpts[a+1]});else if(n==="haystack"){var o=t.haystackPts;e.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth};v0.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var $n={};$n.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!Da(e)){var t,n,a=r._private,i=r.width(),o=r.height(),s=r.padding(),u=r.position(),l=r.pstyle("text-halign").strValue,f=r.pstyle("text-valign").strValue,d=a.rscratch,h=a.rstyle;switch(l){case"left":t=u.x-i/2-s;break;case"right":t=u.x+i/2+s;break;default:t=u.x}switch(f){case"top":n=u.y-o/2-s;break;case"bottom":n=u.y+o/2+s;break;default:n=u.y}d.labelX=t,d.labelY=n,h.labelX=t,h.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}};var XA=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},ZA=function(e,t){var n=t.x-e.x,a=t.y-e.y;return XA(n,a)},p3=function(e,t,n,a){var i=ds(0,a-.001,1),o=ds(0,a+.001,1),s=io(e,t,n,i),u=io(e,t,n,o);return ZA(s,u)};$n.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){e={x:n.midX,y:n.midY};var o=function(d,h,g){ea(t.rscratch,d,h,g),ea(t.rstyle,d,h,g)};o("labelX",null,e.x),o("labelY",null,e.y);var s=XA(n.midDispX,n.midDispY);o("labelAutoAngle",null,s);var u=function(){if(u.cache)return u.cache;for(var d=[],h=0;h+5<n.allpts.length;h+=4){var g={x:n.allpts[h],y:n.allpts[h+1]},p={x:n.allpts[h+2],y:n.allpts[h+3]},x={x:n.allpts[h+4],y:n.allpts[h+5]};d.push({p0:g,p1:p,p2:x,startDist:0,length:0,segments:[]})}var b=t.rstyle.bezierPts,w=a.bezierProjPcts.length;function y(_,A,P,I,D){var L=di(A,P),M=_.segments[_.segments.length-1],q={p0:A,p1:P,t0:I,t1:D,startDist:M?M.startDist+M.length:0,length:L};_.segments.push(q),_.length+=L}for(var E=0;E<d.length;E++){var C=d[E],S=d[E-1];S&&(C.startDist=S.startDist+S.length),y(C,C.p0,b[E*w],0,a.bezierProjPcts[0]);for(var R=0;R<w-1;R++)y(C,b[E*w+R],b[E*w+R+1],a.bezierProjPcts[R],a.bezierProjPcts[R+1]);y(C,b[E*w+w-1],C.p2,a.bezierProjPcts[w-1],1)}return u.cache=d},l=function(d){var h,g=d==="source";if(i[d]){var p=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":{for(var x=u(),b,w=0,y=0,E=0;E<x.length;E++){for(var C=x[g?E:x.length-1-E],S=0;S<C.segments.length;S++){var R=C.segments[g?S:C.segments.length-1-S],_=E===x.length-1&&S===C.segments.length-1;if(w=y,y+=R.length,y>=p||_){b={cp:C,segment:R};break}}if(b)break}var A=b.cp,P=b.segment,I=(p-w)/P.length,D=P.t1-P.t0,L=g?P.t0+D*I:P.t1-D*I;L=ds(0,L,1),e=io(A.p0,A.p1,A.p2,L),h=p3(A.p0,A.p1,A.p2,L);break}case"straight":case"segments":case"haystack":{for(var M=0,q,N,W,V,$=n.allpts.length,X=0;X+3<$&&(g?(W={x:n.allpts[X],y:n.allpts[X+1]},V={x:n.allpts[X+2],y:n.allpts[X+3]}):(W={x:n.allpts[$-2-X],y:n.allpts[$-1-X]},V={x:n.allpts[$-4-X],y:n.allpts[$-3-X]}),q=di(W,V),N=M,M+=q,!(M>=p));X+=2);var ee=p-N,K=ee/q;K=ds(0,K,1),e=NF(W,V,K),h=ZA(W,V);break}}o("labelX",d,e.x),o("labelY",d,e.y),o("labelAutoAngle",d,h)}};l("source"),l("target"),this.applyLabelDimensions(r)}};$n.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};$n.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=ci(n,r._private.labelDimsKey);if($t(t.rscratch,"prefixedLabelDimsKey",e)!==a){ea(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),o=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,u=$t(t.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(u.length,1),f=i.height/l,d=f*o,h=i.width,g=i.height+(l-1)*(o-1)*f;ea(t.rstyle,"labelWidth",e,h),ea(t.rscratch,"labelWidth",e,h),ea(t.rstyle,"labelHeight",e,g),ea(t.rscratch,"labelHeight",e,g),ea(t.rscratch,"labelLineHeight",e,d)}};$n.getLabelText=function(r,e){var t=r._private,n=e?e+"-":"",a=r.pstyle(n+"label").strValue,i=r.pstyle("text-transform").value,o=function(fe,G){return G?(ea(t.rscratch,fe,e,G),G):$t(t.rscratch,fe,e)};if(!a)return"";i=="none"||(i=="uppercase"?a=a.toUpperCase():i=="lowercase"&&(a=a.toLowerCase()));var s=r.pstyle("text-wrap").value;if(s==="wrap"){var u=o("labelKey");if(u!=null&&o("labelWrapKey")===u)return o("labelWrapCachedText");for(var l="",f=a.split(`
|
|
41
|
+
`),d=r.pstyle("text-max-width").pfValue,h=r.pstyle("text-overflow-wrap").value,g=h==="anywhere",p=[],x=/[\s\u200b]+|$/g,b=0;b<f.length;b++){var w=f[b],y=this.calculateLabelDimensions(r,w),E=y.width;if(g){var C=w.split("").join(l);w=C}if(E>d){var S=w.matchAll(x),R="",_=0,A=Gt(S),P;try{for(A.s();!(P=A.n()).done;){var I=P.value,D=I[0],L=w.substring(_,I.index);_=I.index+D.length;var M=R.length===0?L:R+L+D,q=this.calculateLabelDimensions(r,M),N=q.width;N<=d?R+=L+D:(R&&p.push(R),R=L+D)}}catch(j){A.e(j)}finally{A.f()}R.match(/^[\s\u200b]+$/)||p.push(R)}else p.push(w)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
|
|
42
|
+
`)),o("labelWrapKey",u)}else if(s==="ellipsis"){var W=r.pstyle("text-max-width").pfValue,V="",$="…",X=!1;if(this.calculateLabelDimensions(r,a).width<W)return a;for(var ee=0;ee<a.length;ee++){var K=this.calculateLabelDimensions(r,V+a[ee]+$).width;if(K>W)break;V+=a[ee],ee===a.length-1&&(X=!0)}return X||(V+=$),V}return a};$n.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if(e==="auto")if(r.isNode())switch(t){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};$n.calculateLabelDimensions=function(r,e){var t=this,n=t.cy.window(),a=n.document,i=0,o=r.pstyle("font-style").strValue,s=r.pstyle("font-size").pfValue,u=r.pstyle("font-family").strValue,l=r.pstyle("font-weight").strValue,f=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!f){f=this.labelCalcCanvas=a.createElement("canvas"),d=this.labelCalcCanvasContext=f.getContext("2d");var h=f.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}d.font="".concat(o," ").concat(l," ").concat(s,"px ").concat(u);for(var g=0,p=0,x=e.split(`
|
|
43
|
+
`),b=0;b<x.length;b++){var w=x[b],y=d.measureText(w),E=Math.ceil(y.width),C=s;g=Math.max(E,g),p+=C}return g+=i,p+=i,{width:g,height:p}};$n.calculateLabelAngle=function(r,e){var t=r._private,n=t.rscratch,a=r.isEdge(),i=e?e+"-":"",o=r.pstyle(i+"text-rotation"),s=o.strValue;return s==="none"?0:a&&s==="autorotate"?n.labelAutoAngle:s==="autorotate"?0:o.pfValue};$n.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),n=r._private,a=n.rscratch;a.labelAngle=e.calculateLabelAngle(r),t&&(a.sourceLabelAngle=e.calculateLabelAngle(r,"source"),a.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var QA={},DE=28,BE=!1;QA.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<DE||r.height()<DE))return BE||(Cr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),BE=!0),"rectangle";if(r.isParent())return t==="rectangle"||t==="roundrectangle"||t==="round-rectangle"||t==="cutrectangle"||t==="cut-rectangle"||t==="barrel"?t:"rectangle";if(t==="polygon"){var n=r.pstyle("shape-polygon-points").value;return e.nodeShapes.makePolygon(n).name}return t};var Ol={};Ol.registerCalculationListeners=function(){var r=this.cy,e=r.collection(),t=this,n=function(o){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(o),s)for(var u=0;u<o.length;u++){var l=o[u],f=l._private,d=f.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(o){var s=o.target;n(s)}).on("style.* background.*",function(o){var s=o.target;n(s,!1)});var a=function(o){if(o){var s=t.onUpdateEleCalcsFns;e.cleanStyle();for(var u=0;u<e.length;u++){var l=e[u],f=l._private.rstyle;l.isNode()&&!f.cleanConnected&&(n(l.connectedEdges()),f.cleanConnected=!0)}if(s)for(var d=0;d<s.length;d++){var h=s[d];h(o,e)}t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){a(!0)},t.beforeRender(a,t.beforeRenderPriorities.eleCalcs)};Ol.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};Ol.recalculateRenderedStyle=function(r,e){var t=function(C){return C._private.rstyle.cleanConnected};if(r.length!==0){var n=[],a=[];if(!this.destroyed){e===void 0&&(e=!0);for(var i=0;i<r.length;i++){var o=r[i],s=o._private,u=s.rstyle;o.isEdge()&&(!t(o.source())||!t(o.target()))&&(u.clean=!1),o.isEdge()&&o.isBundledBezier()&&o.parallelEdges().some(function(E){return!E._private.rstyle.clean&&E.isBundledBezier()})&&(u.clean=!1),!(e&&u.clean||o.removed())&&o.pstyle("display").value!=="none"&&(s.group==="nodes"?a.push(o):n.push(o),u.clean=!0)}for(var l=0;l<a.length;l++){var f=a[l],d=f._private,h=d.rstyle,g=f.position();this.recalculateNodeLabelProjection(f),h.nodeX=g.x,h.nodeY=g.y,h.nodeW=f.pstyle("width").pfValue,h.nodeH=f.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var p=0;p<n.length;p++){var x=n[p],b=x._private,w=b.rstyle,y=b.rscratch;w.srcX=y.arrowStartX,w.srcY=y.arrowStartY,w.tgtX=y.arrowEndX,w.tgtY=y.arrowEndY,w.midX=y.midX,w.midY=y.midY,w.labelAngle=y.labelAngle,w.sourceLabelAngle=y.sourceLabelAngle,w.targetLabelAngle=y.targetLabelAngle}}}};var kl={};kl.updateCachedGrabbedEles=function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var n=r[t],a=n._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):a.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(var t=0;t<e.length;t++){var n=e[t];r.drag.push(n)}}};kl.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};kl.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(MA),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var JA={};[mi,fl,At,Ps,v0,$n,QA,Ol,kl].forEach(function(r){Ze(JA,r)});var eP={};eP.getCachedImage=function(r,e,t){var n=this,a=n.imageCache=n.imageCache||{},i=a[r];if(i)return i.image.complete||i.image.addEventListener("load",t),i.image;i=a[r]=a[r]||{};var o=i.image=new Image;o.addEventListener("load",t),o.addEventListener("error",function(){o.error=!0});var s="data:",u=r.substring(0,s.length).toLowerCase()===s;return u||(e=e==="null"?null:e,o.crossOrigin=e),o.src=r,o};var bo={};bo.registerBinding=function(r,e,t,n){var a=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var i=[],o=0;o<r.length;o++){var s=r[o];if(s!==void 0){var u=this.binder(s);i.push(u.on.apply(u,a))}}return i}var u=this.binder(r);return u.on.apply(u,a)};bo.binder=function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||AN(r);if(e.supportsPassiveEvents==null){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 o=function(u,l,f){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:f??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:d}),(r.addEventListener||r.on).apply(r,d),this};return{on:o,addEventListener:o,addListener:o,bind:o}};bo.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};bo.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};bo.load=function(){var r=this,e=r.cy.window(),t=function(O){return O.selected()},n=function(O){var ne=O.getRootNode();if(ne&&ne.nodeType===11&&ne.host!==void 0)return ne},a=function(O,ne,he,ge){O==null&&(O=r.cy);for(var be=0;be<ne.length;be++){var Ve=ne[be];O.emit({originalEvent:he,type:Ve,position:ge})}},i=function(O){return O.shiftKey||O.metaKey||O.ctrlKey},o=function(O,ne){var he=!0;if(r.cy.hasCompoundNodes()&&O&&O.pannable())for(var ge=0;ne&&ge<ne.length;ge++){var O=ne[ge];if(O.isNode()&&O.isParent()&&!O.pannable()){he=!1;break}}else he=!0;return he},s=function(O){O[0]._private.grabbed=!0},u=function(O){O[0]._private.grabbed=!1},l=function(O){O[0]._private.rscratch.inDragLayer=!0},f=function(O){O[0]._private.rscratch.inDragLayer=!1},d=function(O){O[0]._private.rscratch.isGrabTarget=!0},h=function(O){O[0]._private.rscratch.isGrabTarget=!1},g=function(O,ne){var he=ne.addToList,ge=he.has(O);!ge&&O.grabbable()&&!O.locked()&&(he.merge(O),s(O))},p=function(O,ne){if(O.cy().hasCompoundNodes()&&!(ne.inDragLayer==null&&ne.addToList==null)){var he=O.descendants();ne.inDragLayer&&(he.forEach(l),he.connectedEdges().forEach(l)),ne.addToList&&g(he,ne)}},x=function(O,ne){ne=ne||{};var he=O.cy().hasCompoundNodes();ne.inDragLayer&&(O.forEach(l),O.neighborhood().stdFilter(function(ge){return!he||ge.isEdge()}).forEach(l)),ne.addToList&&O.forEach(function(ge){g(ge,ne)}),p(O,ne),y(O,{inDragLayer:ne.inDragLayer}),r.updateCachedGrabbedEles()},b=x,w=function(O){O&&(r.getCachedZSortedEles().forEach(function(ne){u(ne),f(ne),h(ne)}),r.updateCachedGrabbedEles())},y=function(O,ne){if(!(ne.inDragLayer==null&&ne.addToList==null)&&O.cy().hasCompoundNodes()){var he=O.ancestors().orphans();if(!he.same(O)){var ge=he.descendants().spawnSelf().merge(he).unmerge(O).unmerge(O.descendants()),be=ge.connectedEdges();ne.inDragLayer&&(be.forEach(l),ge.forEach(l)),ne.addToList&&ge.forEach(function(Ve){g(Ve,ne)})}}},E=function(){document.activeElement!=null&&document.activeElement.blur!=null&&document.activeElement.blur()},C=typeof MutationObserver<"u",S=typeof ResizeObserver<"u";C?(r.removeObserver=new MutationObserver(function(ye){for(var O=0;O<ye.length;O++){var ne=ye[O],he=ne.removedNodes;if(he)for(var ge=0;ge<he.length;ge++){var be=he[ge];if(be===r.container){r.destroy();break}}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(ye){r.destroy()});var R=Ss(function(){r.cy.resize()},100);C&&(r.styleObserver=new MutationObserver(R),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",R),S&&(r.resizeObserver=new ResizeObserver(R),r.resizeObserver.observe(r.container));var _=function(O,ne){for(;O!=null;)ne(O),O=O.parentNode},A=function(){r.invalidateContainerClientCoordsCache()};_(r.container,function(ye){r.registerBinding(ye,"transitionend",A),r.registerBinding(ye,"animationend",A),r.registerBinding(ye,"scroll",A)}),r.registerBinding(r.container,"contextmenu",function(ye){ye.preventDefault()});var P=function(){return r.selection[4]!==0},I=function(O){for(var ne=r.findContainerClientCoords(),he=ne[0],ge=ne[1],be=ne[2],Ve=ne[3],Be=O.touches?O.touches:[O],He=!1,We=0;We<Be.length;We++){var Xe=Be[We];if(he<=Xe.clientX&&Xe.clientX<=he+be&&ge<=Xe.clientY&&Xe.clientY<=ge+Ve){He=!0;break}}if(!He)return!1;for(var sr=r.container,ar=O.target,Ke=ar.parentNode,lr=!1;Ke;){if(Ke===sr){lr=!0;break}Ke=Ke.parentNode}return!!lr};r.registerBinding(r.container,"mousedown",function(O){if(I(O)&&!(r.hoverData.which===1&&O.which!==1)){O.preventDefault(),E(),r.hoverData.capture=!0,r.hoverData.which=O.which;var ne=r.cy,he=[O.clientX,O.clientY],ge=r.projectIntoViewport(he[0],he[1]),be=r.selection,Ve=r.findNearestElements(ge[0],ge[1],!0,!1),Be=Ve[0],He=r.dragData.possibleDragElements;r.hoverData.mdownPos=ge,r.hoverData.mdownGPos=he;var We=function(ir){return{originalEvent:O,type:ir,position:{x:ge[0],y:ge[1]}}},Xe=function(){r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var ir=r.hoverData.down;ir?ir.emit(We("taphold")):ne.emit(We("taphold"))}},r.tapholdDuration)};if(O.which==3){r.hoverData.cxtStarted=!0;var sr={originalEvent:O,type:"cxttapstart",position:{x:ge[0],y:ge[1]}};Be?(Be.activate(),Be.emit(sr),r.hoverData.down=Be):ne.emit(sr),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(O.which==1){Be&&Be.activate();{if(Be!=null&&r.nodeIsGrabbable(Be)){var ar=function(ir){ir.emit(We("grab"))};if(d(Be),!Be.selected())He=r.dragData.possibleDragElements=ne.collection(),b(Be,{addToList:He}),Be.emit(We("grabon")).emit(We("grab"));else{He=r.dragData.possibleDragElements=ne.collection();var Ke=ne.$(function(lr){return lr.isNode()&&lr.selected()&&r.nodeIsGrabbable(lr)});x(Ke,{addToList:He}),Be.emit(We("grabon")),Ke.forEach(ar)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Be,r.hoverData.downs=Ve,r.hoverData.downTime=new Date().getTime()}a(Be,["mousedown","tapstart","vmousedown"],O,{x:ge[0],y:ge[1]}),Be==null?(be[4]=1,r.data.bgActivePosistion={x:ge[0],y:ge[1]},r.redrawHint("select",!0),r.redraw()):Be.pannable()&&(be[4]=1),Xe()}be[0]=be[2]=ge[0],be[1]=be[3]=ge[1]}},!1);var D=n(r.container);r.registerBinding([e,D],"mousemove",function(O){var ne=r.hoverData.capture;if(!(!ne&&!I(O))){var he=!1,ge=r.cy,be=ge.zoom(),Ve=[O.clientX,O.clientY],Be=r.projectIntoViewport(Ve[0],Ve[1]),He=r.hoverData.mdownPos,We=r.hoverData.mdownGPos,Xe=r.selection,sr=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(sr=r.findNearestElement(Be[0],Be[1],!0,!1));var ar=r.hoverData.last,Ke=r.hoverData.down,lr=[Be[0]-Xe[2],Be[1]-Xe[3]],ir=r.dragData.possibleDragElements,Ur;if(We){var Mr=Ve[0]-We[0],ct=Mr*Mr,Lr=Ve[1]-We[1],jr=Lr*Lr,Nr=ct+jr;r.hoverData.isOverThresholdDrag=Ur=Nr>=r.desktopTapThreshold2}var Qr=i(O);Ur&&(r.hoverData.tapholdCancelled=!0);var Pn=function(){var kt=r.hoverData.dragDelta=r.hoverData.dragDelta||[];kt.length===0?(kt.push(lr[0]),kt.push(lr[1])):(kt[0]+=lr[0],kt[1]+=lr[1])};he=!0,a(sr,["mousemove","vmousemove","tapdrag"],O,{x:Be[0],y:Be[1]});var Vr=function(kt){return{originalEvent:O,type:kt,position:{x:Be[0],y:Be[1]}}},pn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||ge.emit(Vr("boxstart")),Xe[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Ur){var yn=Vr("cxtdrag");Ke?Ke.emit(yn):ge.emit(yn),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||sr!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(Vr("cxtdragout")),r.hoverData.cxtOver=sr,sr&&sr.emit(Vr("cxtdragover")))}}else if(r.hoverData.dragging){if(he=!0,ge.panningEnabled()&&ge.userPanningEnabled()){var ua;if(r.hoverData.justStartedPan){var Ci=r.hoverData.mdownPos;ua={x:(Be[0]-Ci[0])*be,y:(Be[1]-Ci[1])*be},r.hoverData.justStartedPan=!1}else ua={x:lr[0]*be,y:lr[1]*be};ge.panBy(ua),ge.emit(Vr("dragpan")),r.hoverData.dragged=!0}Be=r.projectIntoViewport(O.clientX,O.clientY)}else if(Xe[4]==1&&(Ke==null||Ke.pannable())){if(Ur){if(!r.hoverData.dragging&&ge.boxSelectionEnabled()&&(Qr||!ge.panningEnabled()||!ge.userPanningEnabled()))pn();else if(!r.hoverData.selecting&&ge.panningEnabled()&&ge.userPanningEnabled()){var Gn=o(Ke,r.hoverData.downs);Gn&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,Xe[4]=0,r.data.bgActivePosistion=Ji(He),r.redrawHint("select",!0),r.redraw())}Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate()}}else{if(Ke&&Ke.pannable()&&Ke.active()&&Ke.unactivate(),(!Ke||!Ke.grabbed())&&sr!=ar&&(ar&&a(ar,["mouseout","tapdragout"],O,{x:Be[0],y:Be[1]}),sr&&a(sr,["mouseover","tapdragover"],O,{x:Be[0],y:Be[1]}),r.hoverData.last=sr),Ke)if(Ur){if(ge.boxSelectionEnabled()&&Qr)Ke&&Ke.grabbed()&&(w(ir),Ke.emit(Vr("freeon")),ir.emit(Vr("free")),r.dragData.didDrag&&(Ke.emit(Vr("dragfreeon")),ir.emit(Vr("dragfree")))),pn();else if(Ke&&Ke.grabbed()&&r.nodeIsDraggable(Ke)){var dt=!r.dragData.didDrag;dt&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||x(ir,{inDragLayer:!0});var ot={x:0,y:0};if(qe(lr[0])&&qe(lr[1])&&(ot.x+=lr[0],ot.y+=lr[1],dt)){var Et=r.hoverData.dragDelta;Et&&qe(Et[0])&&qe(Et[1])&&(ot.x+=Et[0],ot.y+=Et[1])}r.hoverData.draggingEles=!0,ir.silentShift(ot).emit(Vr("position")).emit(Vr("drag")),r.redrawHint("drag",!0),r.redraw()}}else Pn();he=!0}if(Xe[2]=Be[0],Xe[3]=Be[1],he)return O.stopPropagation&&O.stopPropagation(),O.preventDefault&&O.preventDefault(),!1}},!1);var L,M,q;r.registerBinding(e,"mouseup",function(O){if(!(r.hoverData.which===1&&O.which!==1&&r.hoverData.capture)){var ne=r.hoverData.capture;if(ne){r.hoverData.capture=!1;var he=r.cy,ge=r.projectIntoViewport(O.clientX,O.clientY),be=r.selection,Ve=r.findNearestElement(ge[0],ge[1],!0,!1),Be=r.dragData.possibleDragElements,He=r.hoverData.down,We=i(O);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,He&&He.unactivate();var Xe=function(Mr){return{originalEvent:O,type:Mr,position:{x:ge[0],y:ge[1]}}};if(r.hoverData.which===3){var sr=Xe("cxttapend");if(He?He.emit(sr):he.emit(sr),!r.hoverData.cxtDragged){var ar=Xe("cxttap");He?He.emit(ar):he.emit(ar)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(a(Ve,["mouseup","tapend","vmouseup"],O,{x:ge[0],y:ge[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(He,["click","tap","vclick"],O,{x:ge[0],y:ge[1]}),M=!1,O.timeStamp-q<=he.multiClickDebounceTime()?(L&&clearTimeout(L),M=!0,q=null,a(He,["dblclick","dbltap","vdblclick"],O,{x:ge[0],y:ge[1]})):(L=setTimeout(function(){M||a(He,["oneclick","onetap","voneclick"],O,{x:ge[0],y:ge[1]})},he.multiClickDebounceTime()),q=O.timeStamp)),He==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(O)&&(he.$(t).unselect(["tapunselect"]),Be.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Be=he.collection()),Ve==He&&!r.dragData.didDrag&&!r.hoverData.selecting&&Ve!=null&&Ve._private.selectable&&(r.hoverData.dragging||(he.selectionType()==="additive"||We?Ve.selected()?Ve.unselect(["tapunselect"]):Ve.select(["tapselect"]):We||(he.$(t).unmerge(Ve).unselect(["tapunselect"]),Ve.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var Ke=he.collection(r.getAllInBox(be[0],be[1],be[2],be[3]));r.redrawHint("select",!0),Ke.length>0&&r.redrawHint("eles",!0),he.emit(Xe("boxend"));var lr=function(Mr){return Mr.selectable()&&!Mr.selected()};he.selectionType()==="additive"||We||he.$(t).unmerge(Ke).unselect(),Ke.emit(Xe("box")).stdFilter(lr).select().emit(Xe("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!be[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var ir=He&&He.grabbed();w(Be),ir&&(He.emit(Xe("freeon")),Be.emit(Xe("free")),r.dragData.didDrag&&(He.emit(Xe("dragfreeon")),Be.emit(Xe("dragfree"))))}}be[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 N=[],W=4,V,$=1e5,X=function(O,ne){for(var he=0;he<O.length;he++)if(O[he]%ne!==0)return!1;return!0},ee=function(O){for(var ne=Math.abs(O[0]),he=1;he<O.length;he++)if(Math.abs(O[he])!==ne)return!1;return!0},K=function(O){var ne=!1,he=O.deltaY;if(he==null&&(O.wheelDeltaY!=null?he=O.wheelDeltaY/4:O.wheelDelta!=null&&(he=O.wheelDelta/4)),he!==0){if(V==null)if(N.length>=W){var ge=N;if(V=X(ge,5),!V){var be=Math.abs(ge[0]);V=ee(ge)&&be>5}if(V)for(var Ve=0;Ve<ge.length;Ve++)$=Math.min(Math.abs(ge[Ve]),$)}else N.push(he),ne=!0;else V&&($=Math.min(Math.abs(he),$));if(!r.scrollingPage){var Be=r.cy,He=Be.zoom(),We=Be.pan(),Xe=r.projectIntoViewport(O.clientX,O.clientY),sr=[Xe[0]*He+We.x,Xe[1]*He+We.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||P()){O.preventDefault();return}if(Be.panningEnabled()&&Be.userPanningEnabled()&&Be.zoomingEnabled()&&Be.userZoomingEnabled()){O.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);var ar;ne&&Math.abs(he)>5&&(he=Jm(he)*5),ar=he/-250,V&&(ar/=$,ar*=3),ar=ar*r.wheelSensitivity;var Ke=O.deltaMode===1;Ke&&(ar*=33);var lr=Be.zoom()*Math.pow(10,ar);O.type==="gesturechange"&&(lr=r.gestureStartZoom*O.scale),Be.zoom({level:lr,renderedPosition:{x:sr[0],y:sr[1]}}),Be.emit({type:O.type==="gesturechange"?"pinchzoom":"scrollzoom",originalEvent:O,position:{x:Xe[0],y:Xe[1]}})}}}};r.registerBinding(r.container,"wheel",K,!0),r.registerBinding(e,"scroll",function(O){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(O){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||O.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(ye){r.hasTouchStarted||K(ye)},!0),r.registerBinding(r.container,"mouseout",function(O){var ne=r.projectIntoViewport(O.clientX,O.clientY);r.cy.emit({originalEvent:O,type:"mouseout",position:{x:ne[0],y:ne[1]}})},!1),r.registerBinding(r.container,"mouseover",function(O){var ne=r.projectIntoViewport(O.clientX,O.clientY);r.cy.emit({originalEvent:O,type:"mouseover",position:{x:ne[0],y:ne[1]}})},!1);var j,fe,G,z,Y,te,ue,oe,Z,Q,ie,de,we,Ae=function(O,ne,he,ge){return Math.sqrt((he-O)*(he-O)+(ge-ne)*(ge-ne))},ve=function(O,ne,he,ge){return(he-O)*(he-O)+(ge-ne)*(ge-ne)},le;r.registerBinding(r.container,"touchstart",le=function(O){if(r.hasTouchStarted=!0,!!I(O)){E(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var ne=r.cy,he=r.touchData.now,ge=r.touchData.earlier;if(O.touches[0]){var be=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);he[0]=be[0],he[1]=be[1]}if(O.touches[1]){var be=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);he[2]=be[0],he[3]=be[1]}if(O.touches[2]){var be=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);he[4]=be[0],he[5]=be[1]}var Ve=function(Qr){return{originalEvent:O,type:Qr,position:{x:he[0],y:he[1]}}};if(O.touches[1]){r.touchData.singleTouchMoved=!0,w(r.dragData.touchDragEles);var Be=r.findContainerClientCoords();Z=Be[0],Q=Be[1],ie=Be[2],de=Be[3],j=O.touches[0].clientX-Z,fe=O.touches[0].clientY-Q,G=O.touches[1].clientX-Z,z=O.touches[1].clientY-Q,we=0<=j&&j<=ie&&0<=G&&G<=ie&&0<=fe&&fe<=de&&0<=z&&z<=de;var He=ne.pan(),We=ne.zoom();Y=Ae(j,fe,G,z),te=ve(j,fe,G,z),ue=[(j+G)/2,(fe+z)/2],oe=[(ue[0]-He.x)/We,(ue[1]-He.y)/We];var Xe=200,sr=Xe*Xe;if(te<sr&&!O.touches[2]){var ar=r.findNearestElement(he[0],he[1],!0,!0),Ke=r.findNearestElement(he[2],he[3],!0,!0);ar&&ar.isNode()?(ar.activate().emit(Ve("cxttapstart")),r.touchData.start=ar):Ke&&Ke.isNode()?(Ke.activate().emit(Ve("cxttapstart")),r.touchData.start=Ke):ne.emit(Ve("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,r.redraw();return}}if(O.touches[2])ne.boxSelectionEnabled()&&O.preventDefault();else if(!O.touches[1]){if(O.touches[0]){var lr=r.findNearestElements(he[0],he[1],!0,!0),ir=lr[0];if(ir!=null&&(ir.activate(),r.touchData.start=ir,r.touchData.starts=lr,r.nodeIsGrabbable(ir))){var Ur=r.dragData.touchDragEles=ne.collection(),Mr=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),ir.selected()?(Mr=ne.$(function(Nr){return Nr.selected()&&r.nodeIsGrabbable(Nr)}),x(Mr,{addToList:Ur})):b(ir,{addToList:Ur}),d(ir),ir.emit(Ve("grabon")),Mr?Mr.forEach(function(Nr){Nr.emit(Ve("grab"))}):ir.emit(Ve("grab"))}a(ir,["touchstart","tapstart","vmousedown"],O,{x:he[0],y:he[1]}),ir==null&&(r.data.bgActivePosistion={x:be[0],y:be[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(){r.touchData.singleTouchMoved===!1&&!r.pinching&&!r.touchData.selecting&&a(r.touchData.start,["taphold"],O,{x:he[0],y:he[1]})},r.tapholdDuration)}}if(O.touches.length>=1){for(var ct=r.touchData.startPosition=[null,null,null,null,null,null],Lr=0;Lr<he.length;Lr++)ct[Lr]=ge[Lr]=he[Lr];var jr=O.touches[0];r.touchData.startGPosition=[jr.clientX,jr.clientY]}}},!1);var Me;r.registerBinding(e,"touchmove",Me=function(O){var ne=r.touchData.capture;if(!(!ne&&!I(O))){var he=r.selection,ge=r.cy,be=r.touchData.now,Ve=r.touchData.earlier,Be=ge.zoom();if(O.touches[0]){var He=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);be[0]=He[0],be[1]=He[1]}if(O.touches[1]){var He=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);be[2]=He[0],be[3]=He[1]}if(O.touches[2]){var He=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);be[4]=He[0],be[5]=He[1]}var We=function(Ai){return{originalEvent:O,type:Ai,position:{x:be[0],y:be[1]}}},Xe=r.touchData.startGPosition,sr;if(ne&&O.touches[0]&&Xe){for(var ar=[],Ke=0;Ke<be.length;Ke++)ar[Ke]=be[Ke]-Ve[Ke];var lr=O.touches[0].clientX-Xe[0],ir=lr*lr,Ur=O.touches[0].clientY-Xe[1],Mr=Ur*Ur,ct=ir+Mr;sr=ct>=r.touchTapThreshold2}if(ne&&r.touchData.cxt){O.preventDefault();var Lr=O.touches[0].clientX-Z,jr=O.touches[0].clientY-Q,Nr=O.touches[1].clientX-Z,Qr=O.touches[1].clientY-Q,Pn=ve(Lr,jr,Nr,Qr),Vr=Pn/te,pn=150,yn=pn*pn,ua=1.5,Ci=ua*ua;if(Vr>=Ci||Pn>=yn){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Gn=We("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(Gn),r.touchData.start=null):ge.emit(Gn)}}if(ne&&r.touchData.cxt){var Gn=We("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(Gn):ge.emit(Gn),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var dt=r.findNearestElement(be[0],be[1],!0,!0);(!r.touchData.cxtOver||dt!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit(We("cxtdragout")),r.touchData.cxtOver=dt,dt&&dt.emit(We("cxtdragover")))}else if(ne&&O.touches[2]&&ge.boxSelectionEnabled())O.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||ge.emit(We("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,he[4]=1,!he||he.length===0||he[0]===void 0?(he[0]=(be[0]+be[2]+be[4])/3,he[1]=(be[1]+be[3]+be[5])/3,he[2]=(be[0]+be[2]+be[4])/3+1,he[3]=(be[1]+be[3]+be[5])/3+1):(he[2]=(be[0]+be[2]+be[4])/3,he[3]=(be[1]+be[3]+be[5])/3),r.redrawHint("select",!0),r.redraw();else if(ne&&O.touches[1]&&!r.touchData.didSelect&&ge.zoomingEnabled()&&ge.panningEnabled()&&ge.userZoomingEnabled()&&ge.userPanningEnabled()){O.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ot=r.dragData.touchDragEles;if(ot){r.redrawHint("drag",!0);for(var Et=0;Et<ot.length;Et++){var Ga=ot[Et]._private;Ga.grabbed=!1,Ga.rscratch.inDragLayer=!1}}var kt=r.touchData.start,Lr=O.touches[0].clientX-Z,jr=O.touches[0].clientY-Q,Nr=O.touches[1].clientX-Z,Qr=O.touches[1].clientY-Q,qs=Ae(Lr,jr,Nr,Qr),rf=qs/Y;if(we){var _i=Lr-j,tf=jr-fe,Si=Nr-G,nf=Qr-z,af=(_i+Si)/2,of=(tf+nf)/2,la=ge.zoom(),Ti=la*rf,Wa=ge.pan(),Ns=oe[0]*la+Wa.x,Fs=oe[1]*la+Wa.y,sf={x:-Ti/la*(Ns-Wa.x-af)+Ns,y:-Ti/la*(Fs-Wa.y-of)+Fs};if(kt&&kt.active()){var ot=r.dragData.touchDragEles;w(ot),r.redrawHint("drag",!0),r.redrawHint("eles",!0),kt.unactivate().emit(We("freeon")),ot.emit(We("free")),r.dragData.didDrag&&(kt.emit(We("dragfreeon")),ot.emit(We("dragfree")))}ge.viewport({zoom:Ti,pan:sf,cancelOnFailedZoom:!0}),ge.emit(We("pinchzoom")),Y=qs,j=Lr,fe=jr,G=Nr,z=Qr,r.pinching=!0}if(O.touches[0]){var He=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);be[0]=He[0],be[1]=He[1]}if(O.touches[1]){var He=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);be[2]=He[0],be[3]=He[1]}if(O.touches[2]){var He=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);be[4]=He[0],be[5]=He[1]}}else if(O.touches[0]&&!r.touchData.didSelect){var Ut=r.touchData.start,Ri=r.touchData.last,dt;if(!r.hoverData.draggingEles&&!r.swipePanning&&(dt=r.findNearestElement(be[0],be[1],!0,!0)),ne&&Ut!=null&&O.preventDefault(),ne&&Ut!=null&&r.nodeIsDraggable(Ut))if(sr){var ot=r.dragData.touchDragEles,_o=!r.dragData.didDrag;_o&&x(ot,{inDragLayer:!0}),r.dragData.didDrag=!0;var fa={x:0,y:0};if(qe(ar[0])&&qe(ar[1])&&(fa.x+=ar[0],fa.y+=ar[1],_o)){r.redrawHint("eles",!0);var Pt=r.touchData.dragDelta;Pt&&qe(Pt[0])&&qe(Pt[1])&&(fa.x+=Pt[0],fa.y+=Pt[1])}r.hoverData.draggingEles=!0,ot.silentShift(fa).emit(We("position")).emit(We("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==Ve[0]&&r.touchData.startPosition[1]==Ve[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Pt=r.touchData.dragDelta=r.touchData.dragDelta||[];Pt.length===0?(Pt.push(ar[0]),Pt.push(ar[1])):(Pt[0]+=ar[0],Pt[1]+=ar[1])}if(a(Ut||dt,["touchmove","tapdrag","vmousemove"],O,{x:be[0],y:be[1]}),(!Ut||!Ut.grabbed())&&dt!=Ri&&(Ri&&Ri.emit(We("tapdragout")),dt&&dt.emit(We("tapdragover"))),r.touchData.last=dt,ne)for(var Et=0;Et<be.length;Et++)be[Et]&&r.touchData.startPosition[Et]&&sr&&(r.touchData.singleTouchMoved=!0);if(ne&&(Ut==null||Ut.pannable())&&ge.panningEnabled()&&ge.userPanningEnabled()){var uf=o(Ut,r.touchData.starts);uf&&(O.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Ji(r.touchData.startPosition)),r.swipePanning?(ge.panBy({x:ar[0]*Be,y:ar[1]*Be}),ge.emit(We("dragpan"))):sr&&(r.swipePanning=!0,ge.panBy({x:lr*Be,y:Ur*Be}),ge.emit(We("dragpan")),Ut&&(Ut.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var He=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);be[0]=He[0],be[1]=He[1]}}for(var Ke=0;Ke<be.length;Ke++)Ve[Ke]=be[Ke];ne&&O.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&r.data.bgActivePosistion!=null&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1);var Se;r.registerBinding(e,"touchcancel",Se=function(O){var ne=r.touchData.start;r.touchData.capture=!1,ne&&ne.unactivate()});var Ee,re,ce,_e;if(r.registerBinding(e,"touchend",Ee=function(O){var ne=r.touchData.start,he=r.touchData.capture;if(he)O.touches.length===0&&(r.touchData.capture=!1),O.preventDefault();else return;var ge=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var be=r.cy,Ve=be.zoom(),Be=r.touchData.now,He=r.touchData.earlier;if(O.touches[0]){var We=r.projectIntoViewport(O.touches[0].clientX,O.touches[0].clientY);Be[0]=We[0],Be[1]=We[1]}if(O.touches[1]){var We=r.projectIntoViewport(O.touches[1].clientX,O.touches[1].clientY);Be[2]=We[0],Be[3]=We[1]}if(O.touches[2]){var We=r.projectIntoViewport(O.touches[2].clientX,O.touches[2].clientY);Be[4]=We[0],Be[5]=We[1]}var Xe=function(yn){return{originalEvent:O,type:yn,position:{x:Be[0],y:Be[1]}}};ne&&ne.unactivate();var sr;if(r.touchData.cxt){if(sr=Xe("cxttapend"),ne?ne.emit(sr):be.emit(sr),!r.touchData.cxtDragged){var ar=Xe("cxttap");ne?ne.emit(ar):be.emit(ar)}r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,r.redraw();return}if(!O.touches[2]&&be.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var Ke=be.collection(r.getAllInBox(ge[0],ge[1],ge[2],ge[3]));ge[0]=void 0,ge[1]=void 0,ge[2]=void 0,ge[3]=void 0,ge[4]=0,r.redrawHint("select",!0),be.emit(Xe("boxend"));var lr=function(yn){return yn.selectable()&&!yn.selected()};Ke.emit(Xe("box")).stdFilter(lr).select().emit(Xe("boxselect")),Ke.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if(ne!=null&&ne.unactivate(),O.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!O.touches[1]){if(!O.touches[0]){if(!O.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var ir=r.dragData.touchDragEles;if(ne!=null){var Ur=ne._private.grabbed;w(ir),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Ur&&(ne.emit(Xe("freeon")),ir.emit(Xe("free")),r.dragData.didDrag&&(ne.emit(Xe("dragfreeon")),ir.emit(Xe("dragfree")))),a(ne,["touchend","tapend","vmouseup","tapdragout"],O,{x:Be[0],y:Be[1]}),ne.unactivate(),r.touchData.start=null}else{var Mr=r.findNearestElement(Be[0],Be[1],!0,!0);a(Mr,["touchend","tapend","vmouseup","tapdragout"],O,{x:Be[0],y:Be[1]})}var ct=r.touchData.startPosition[0]-Be[0],Lr=ct*ct,jr=r.touchData.startPosition[1]-Be[1],Nr=jr*jr,Qr=Lr+Nr,Pn=Qr*Ve*Ve;r.touchData.singleTouchMoved||(ne||be.$(":selected").unselect(["tapunselect"]),a(ne,["tap","vclick"],O,{x:Be[0],y:Be[1]}),re=!1,O.timeStamp-_e<=be.multiClickDebounceTime()?(ce&&clearTimeout(ce),re=!0,_e=null,a(ne,["dbltap","vdblclick"],O,{x:Be[0],y:Be[1]})):(ce=setTimeout(function(){re||a(ne,["onetap","voneclick"],O,{x:Be[0],y:Be[1]})},be.multiClickDebounceTime()),_e=O.timeStamp)),ne!=null&&!r.dragData.didDrag&&ne._private.selectable&&Pn<r.touchTapThreshold2&&!r.pinching&&(be.selectionType()==="single"?(be.$(t).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"])):ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}}}for(var Vr=0;Vr<Be.length;Vr++)He[Vr]=Be[Vr];r.dragData.didDrag=!1,O.touches.length===0&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),O.touches.length<2&&(O.touches.length===1&&(r.touchData.startGPosition=[O.touches[0].clientX,O.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())},!1),typeof TouchEvent>"u"){var me=[],Te=function(O){return{clientX:O.clientX,clientY:O.clientY,force:1,identifier:O.pointerId,pageX:O.pageX,pageY:O.pageY,radiusX:O.width/2,radiusY:O.height/2,screenX:O.screenX,screenY:O.screenY,target:O.target}},De=function(O){return{event:O,touch:Te(O)}},Ne=function(O){me.push(De(O))},ze=function(O){for(var ne=0;ne<me.length;ne++){var he=me[ne];if(he.event.pointerId===O.pointerId){me.splice(ne,1);return}}},$e=function(O){var ne=me.filter(function(he){return he.event.pointerId===O.pointerId})[0];ne.event=O,ne.touch=Te(O)},ke=function(O){O.touches=me.map(function(ne){return ne.touch})},Oe=function(O){return O.pointerType==="mouse"||O.pointerType===4};r.registerBinding(r.container,"pointerdown",function(ye){Oe(ye)||(ye.preventDefault(),Ne(ye),ke(ye),le(ye))}),r.registerBinding(r.container,"pointerup",function(ye){Oe(ye)||(ze(ye),ke(ye),Ee(ye))}),r.registerBinding(r.container,"pointercancel",function(ye){Oe(ye)||(ze(ye),ke(ye),Se(ye))}),r.registerBinding(r.container,"pointermove",function(ye){Oe(ye)||(ye.preventDefault(),$e(ye),ke(ye),Me(ye))})}};var aa={};aa.generatePolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,a,i,o,s,u){this.renderer.nodeShapeImpl("polygon",n,a,i,o,s,this.points)},intersectLine:function(n,a,i,o,s,u,l,f){return vs(s,u,this.points,n,a,i/2,o/2,l)},checkPoint:function(n,a,i,o,s,u,l,f){return na(n,a,this.points,u,l,o,s,[0,-1],i)},hasMiterBounds:r!=="rectangle",miterBounds:function(n,a,i,o,s,u){return WF(this.points,n,a,i,o,s)}}};aa.generateEllipse=function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,u){return QF(i,o,e,t,n/2+s,a/2+s)},checkPoint:function(e,t,n,a,i,o,s,u){return ui(e,t,a,i,o,s,n)}}};aa.generateRoundPolygon=function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,a,i,o,s,u,l){if(u[l]!==void 0&&u[l+"-cx"]===n&&u[l+"-cy"]===a)return u[l];u[l]=new Array(e.length/2),u[l+"-cx"]=n,u[l+"-cy"]=a;var f=i/2,d=o/2;s=s==="auto"?rA(i,o):s;for(var h=new Array(e.length/2),g=0;g<e.length/2;g++)h[g]={x:n+f*e[g*2],y:a+d*e[g*2+1]};var p,x,b,w,y=h.length;for(x=h[y-1],p=0;p<y;p++)b=h[p%y],w=h[(p+1)%y],u[l][p]=d0(x,b,w,s),x=b,b=w;return u[l]},draw:function(n,a,i,o,s,u,l){this.renderer.nodeShapeImpl("round-polygon",n,a,i,o,s,this.points,this.getOrCreateCorners(a,i,o,s,u,l,"drawCorners"))},intersectLine:function(n,a,i,o,s,u,l,f,d){return ez(s,u,this.points,n,a,i,o,l,this.getOrCreateCorners(n,a,i,o,f,d,"corners"))},checkPoint:function(n,a,i,o,s,u,l,f,d){return ZF(n,a,this.points,u,l,o,s,this.getOrCreateCorners(u,l,o,s,f,d,"corners"))}}};aa.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Mt(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,u){return JR(i,o,e,t,n,a,s,u)},checkPoint:function(e,t,n,a,i,o,s,u){var l=a/2,f=i/2;u=u==="auto"?Ma(a,i):u,u=Math.min(l,f,u);var d=u*2;return!!(na(e,t,this.points,o,s,a,i-d,[0,-1],n)||na(e,t,this.points,o,s,a-d,i,[0,-1],n)||ui(e,t,d,d,o-l+u,s-f+u,n)||ui(e,t,d,d,o+l-u,s-f+u,n)||ui(e,t,d,d,o+l-u,s+f-u,n)||ui(e,t,d,d,o-l+u,s+f-u,n))}}};aa.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:r0(),points:Mt(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,null,o)},generateCutTrianglePts:function(e,t,n,a,i){var o=i==="auto"?this.cornerLength:i,s=t/2,u=e/2,l=n-u,f=n+u,d=a-s,h=a+s;return{topLeft:[l,d+o,l+o,d,l+o,d+o],topRight:[f-o,d,f,d+o,f-o,d+o],bottomRight:[f,h-o,f-o,h,f-o,h-o],bottomLeft:[l+o,h,l,h-o,l+o,h-o]}},intersectLine:function(e,t,n,a,i,o,s,u){var l=this.generateCutTrianglePts(n+2*s,a+2*s,e,t,u),f=[].concat.apply([],[l.topLeft.splice(0,4),l.topRight.splice(0,4),l.bottomRight.splice(0,4),l.bottomLeft.splice(0,4)]);return vs(i,o,f,e,t)},checkPoint:function(e,t,n,a,i,o,s,u){var l=u==="auto"?this.cornerLength:u;if(na(e,t,this.points,o,s,a,i-2*l,[0,-1],n)||na(e,t,this.points,o,s,a-2*l,i,[0,-1],n))return!0;var f=this.generateCutTrianglePts(a,i,o,s);return Vt(e,t,f.topLeft)||Vt(e,t,f.topRight)||Vt(e,t,f.bottomRight)||Vt(e,t,f.bottomLeft)}}};aa.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Mt(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i)},intersectLine:function(e,t,n,a,i,o,s,u){var l=.15,f=.5,d=.85,h=this.generateBarrelBezierPts(n+2*s,a+2*s,e,t),g=function(b){var w=io({x:b[0],y:b[1]},{x:b[2],y:b[3]},{x:b[4],y:b[5]},l),y=io({x:b[0],y:b[1]},{x:b[2],y:b[3]},{x:b[4],y:b[5]},f),E=io({x:b[0],y:b[1]},{x:b[2],y:b[3]},{x:b[4],y:b[5]},d);return[b[0],b[1],w.x,w.y,y.x,y.y,E.x,E.y,b[4],b[5]]},p=[].concat(g(h.topLeft),g(h.topRight),g(h.bottomRight),g(h.bottomLeft));return vs(i,o,p,e,t)},generateBarrelBezierPts:function(e,t,n,a){var i=t/2,o=e/2,s=n-o,u=n+o,l=a-i,f=a+i,d=Cm(e,t),h=d.heightOffset,g=d.widthOffset,p=d.ctrlPtOffsetPct*e,x={topLeft:[s,l+h,s+p,l,s+g,l],topRight:[u-g,l,u-p,l,u,l+h],bottomRight:[u,f-h,u-p,f,u-g,f],bottomLeft:[s+g,f,s+p,f,s,f-h]};return x.topLeft.isTop=!0,x.topRight.isTop=!0,x.bottomLeft.isBottom=!0,x.bottomRight.isBottom=!0,x},checkPoint:function(e,t,n,a,i,o,s,u){var l=Cm(a,i),f=l.heightOffset,d=l.widthOffset;if(na(e,t,this.points,o,s,a,i-2*f,[0,-1],n)||na(e,t,this.points,o,s,a-2*d,i,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(a,i,o,s),g=function(A,P,I){var D=I[4],L=I[2],M=I[0],q=I[5],N=I[1],W=Math.min(D,M),V=Math.max(D,M),$=Math.min(q,N),X=Math.max(q,N);if(W<=A&&A<=V&&$<=P&&P<=X){var ee=rz(D,L,M),K=KF(ee[0],ee[1],ee[2],A),j=K.filter(function(fe){return 0<=fe&&fe<=1});if(j.length>0)return j[0]}return null},p=Object.keys(h),x=0;x<p.length;x++){var b=p[x],w=h[b],y=g(e,t,w);if(y!=null){var E=w[5],C=w[3],S=w[1],R=ut(E,C,S,y);if(w.isTop&&R<=t||w.isBottom&&t<=R)return!0}}return!1}}};aa.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Mt(4,0),draw:function(e,t,n,a,i,o){this.renderer.nodeShapeImpl(this.name,e,t,n,a,i,this.points,o)},intersectLine:function(e,t,n,a,i,o,s,u){var l=e-(n/2+s),f=t-(a/2+s),d=f,h=e+(n/2+s),g=Ta(i,o,e,t,l,f,h,d,!1);return g.length>0?g:JR(i,o,e,t,n,a,s,u)},checkPoint:function(e,t,n,a,i,o,s,u){u=u==="auto"?Ma(a,i):u;var l=2*u;if(na(e,t,this.points,o,s,a,i-l,[0,-1],n)||na(e,t,this.points,o,s,a-l,i,[0,-1],n))return!0;var f=a/2+2*n,d=i/2+2*n,h=[o-f,s-d,o-f,s,o+f,s,o+f,s-d];return!!(Vt(e,t,h)||ui(e,t,l,l,o+a/2-u,s+i/2-u,n)||ui(e,t,l,l,o-a/2+u,s+i/2-u,n))}}};aa.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Mt(3,0)),this.generateRoundPolygon("round-triangle",Mt(3,0)),this.generatePolygon("rectangle",Mt(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",Mt(5,0)),this.generateRoundPolygon("round-pentagon",Mt(5,0)),this.generatePolygon("hexagon",Mt(6,0)),this.generateRoundPolygon("round-hexagon",Mt(6,0)),this.generatePolygon("heptagon",Mt(7,0)),this.generateRoundPolygon("round-heptagon",Mt(7,0)),this.generatePolygon("octagon",Mt(8,0)),this.generateRoundPolygon("round-octagon",Mt(8,0));var n=new Array(20);{var a=Em(5,0),i=Em(5,Math.PI/5),o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s<i.length/2;s++)i[s*2]*=o,i[s*2+1]*=o;for(var s=0;s<20/4;s++)n[s*4]=a[s*2],n[s*4+1]=a[s*2+1],n[s*4+2]=i[s*2],n[s*4+3]=i[s*2+1]}n=eA(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);{var u=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",u),this.generateRoundPolygon("round-tag",u)}r.makePolygon=function(l){var f=l.join("$"),d="polygon-"+f,h;return(h=this[d])?h:e.generatePolygon(d,l)}};var Is={};Is.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};Is.redraw=function(r){r=r||YR();var e=this;e.averageRedrawTime===void 0&&(e.averageRedrawTime=0),e.lastRedrawTime===void 0&&(e.lastRedrawTime=0),e.lastDrawTime===void 0&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r};Is.beforeRender=function(r,e){if(!this.destroyed){e==null&&kr("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})}};var ME=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};Is.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){ME(r,!0,a);var i=ta();r.render(r.renderOptions);var o=r.lastDrawTime=ta();r.averageRedrawTime===void 0&&(r.averageRedrawTime=o-i),r.redrawCount===void 0&&(r.redrawCount=0),r.redrawCount++,r.redrawTotalTime===void 0&&(r.redrawTotalTime=0);var s=o-i;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2,r.requestedFrame=!1}else ME(r,!1,a);r.skipFrame=!1,tl(t)}};tl(t)}};var y3=function(e){this.init(e)},rP=y3,wo=rP.prototype;wo.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];wo.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,o="__________cytoscape_stylesheet",s="__________cytoscape_container",u=a.getElementById(o)!=null;if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!u){var l=a.createElement("style");l.id=o,l.textContent="."+s+" { position: relative; }",i.insertBefore(l,i.children[0])}var f=n.getComputedStyle(t),d=f.getPropertyValue("position");d==="static"&&Cr("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=qe(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()};wo.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if(r==="init"){t.load();return}if(r==="destroy"){t.destroy();return}(r==="add"||r==="remove"||r==="move"&&n.hasCompoundNodes()||r==="load"||r==="zorder"||r==="mount")&&t.invalidateCachedZSortedEles(),r==="viewport"&&t.redrawHint("select",!0),r==="gc"&&t.redrawHint("gc",!0),(r==="load"||r==="resize"||r==="mount")&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}};wo.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],n=t,a=n.target;(a.off||a.removeEventListener).apply(a,n.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{}};wo.isHeadless=function(){return!1};[c0,JA,eP,bo,aa,Is].forEach(function(r){Ze(wo,r)});var nv=1e3/60,tP={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=Ss(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(l,f){var d=ta(),h=a.averageRedrawTime,g=a.lastRedrawTime,p=[],x=a.cy.extent(),b=a.getPixelRatio();for(l||a.flushRenderedStyleQueue();;){var w=ta(),y=w-d,E=w-f;if(g<nv){var C=nv-(l?h:0);if(E>=e.deqFastCost*C)break}else if(l){if(y>=e.deqCost*g||y>=e.deqAvgCost*h)break}else if(E>=e.deqNoDrawCost*nv)break;var S=e.deq(n,b,x);if(S.length>0)for(var R=0;R<S.length;R++)p.push(S[R]);else break}p.length>0&&(e.onDeqd(n,p),!l&&e.shouldRedraw(n,p,b,x)&&i())},s=e.priority||Xm;a.beforeRender(o,s(n))}}}},m3=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nl;qa(this,r),this.idsByKey=new ra,this.keyForId=new ra,this.cachesByLvl=new ra,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return Na(r,[{key:"getIdsFor",value:function(t){t==null&&kr("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new go,n.set(t,a)),a}},{key:"addIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){t!=null&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return t==null?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),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(),a=this.keyForId.get(n),i=this.getKey(t);return a!==i}},{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 ra,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 i!=null&&this.updateKeyMappingFor(t),i}},{key:"getForCachedKey",value:function(t,n){var a=this.keyForId.get(t.id()),i=this.getCache(a,n);return i}},{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||this.getNumberOfIdsForKey(a)===0}}])})(),LE=25,qu=50,ju=-4,km=3,nP=7.99,b3=8,w3=1024,x3=1024,E3=1024,C3=.2,_3=.8,S3=10,T3=.15,R3=.1,A3=.9,P3=.9,I3=100,D3=1,ro={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},B3=wt({getKey:null,doesEleInvalidateKey:nl,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:HR,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Zo=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=B3(t);Ze(n,a),n.lookup=new m3(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},it=Zo.prototype;it.reasons=ro;it.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]};it.getRetiredTextureQueue=function(r){var e=this,t=e.eleImgCaches.retired=e.eleImgCaches.retired||{},n=t[r]=t[r]||[];return n};it.getElementQueue=function(){var r=this,e=r.eleCacheQueue=r.eleCacheQueue||new Ts(function(t,n){return n.reqs-t.reqs});return e};it.getElementKeyToQueue=function(){var r=this,e=r.eleKeyToCacheQueue=r.eleKeyToCacheQueue||{};return e};it.getElement=function(r,e,t,n,a){var i=this,o=this.renderer,s=o.cy.zoom(),u=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!i.allowEdgeTxrCaching&&r.isEdge()||!i.allowParentTxrCaching&&r.isParent())return null;if(n==null&&(n=Math.ceil(Qm(s*t))),n<ju)n=ju;else if(s>=nP||n>km)return null;var l=Math.pow(2,n),f=e.h*l,d=e.w*l,h=o.eleTextBiggerThanMin(r,l);if(!this.isVisible(r,h))return null;var g=u.get(r,n);if(g&&g.invalidated&&(g.invalidated=!1,g.texture.invalidatedWidth-=g.width),g)return g;var p;if(f<=LE?p=LE:f<=qu?p=qu:p=Math.ceil(f/qu)*qu,f>E3||d>x3)return null;var x=i.getTextureQueue(p),b=x[x.length-2],w=function(){return i.recycleTexture(p,d)||i.addTexture(p,d)};b||(b=x[x.length-1]),b||(b=w()),b.width-b.usedWidth<d&&(b=w());for(var y=function(W){return W&&W.scaledLabelShown===h},E=a&&a===ro.dequeue,C=a&&a===ro.highQuality,S=a&&a===ro.downscale,R,_=n+1;_<=km;_++){var A=u.get(r,_);if(A){R=A;break}}var P=R&&R.level===n+1?R:null,I=function(){b.context.drawImage(P.texture.canvas,P.x,0,P.width,P.height,b.usedWidth,0,d,f)};if(b.context.setTransform(1,0,0,1,0,0),b.context.clearRect(b.usedWidth,0,d,p),y(P))I();else if(y(R))if(C){for(var D=R.level;D>n;D--)P=i.getElement(r,e,t,D,ro.downscale);I()}else return i.queueElement(r,R.level-1),R;else{var L;if(!E&&!C&&!S)for(var M=n-1;M>=ju;M--){var q=u.get(r,M);if(q){L=q;break}}if(y(L))return i.queueElement(r,n),L;b.context.translate(b.usedWidth,0),b.context.scale(l,l),this.drawElement(b.context,r,e,h,!1),b.context.scale(1/l,1/l),b.context.translate(-b.usedWidth,0)}return g={x:b.usedWidth,texture:b,level:n,scale:l,width:d,height:f,scaledLabelShown:h},b.usedWidth+=Math.ceil(d+b3),b.eleCaches.push(g),u.set(r,n,g),i.checkTextureFullness(b),g};it.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])};it.invalidateElement=function(r){var e=this,t=e.lookup,n=[],a=t.isInvalid(r);if(a){for(var i=ju;i<=km;i++){var o=t.getForCachedKey(r,i);o&&n.push(o)}var s=t.invalidate(r);if(s)for(var u=0;u<n.length;u++){var l=n[u],f=l.texture;f.invalidatedWidth+=l.width,l.invalidated=!0,e.checkTextureUtility(f)}e.removeFromQueue(r)}};it.checkTextureUtility=function(r){r.invalidatedWidth>=C3*r.width&&this.retireTexture(r)};it.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>_3&&r.fullnessChecks>=S3?Ba(t,r):r.fullnessChecks++};it.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),a=this.lookup;Ba(n,r),r.retired=!0;for(var i=r.eleCaches,o=0;o<i.length;o++){var s=i[o];a.deleteCache(s.key,s.level)}Zm(i);var u=e.getRetiredTextureQueue(t);u.push(r)};it.addTexture=function(r,e){var t=this,n=t.getTextureQueue(r),a={};return n.push(a),a.eleCaches=[],a.height=r,a.width=Math.max(w3,e),a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,a.canvas=t.renderer.makeOffscreenCanvas(a.width,a.height),a.context=a.canvas.getContext("2d"),a};it.recycleTexture=function(r,e){for(var t=this,n=t.getTextureQueue(r),a=t.getRetiredTextureQueue(r),i=0;i<a.length;i++){var o=a[i];if(o.width>=e)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,Zm(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ba(a,o),n.push(o),o}};it.queueElement=function(r,e){var t=this,n=t.getElementQueue(),a=t.getElementKeyToQueue(),i=this.getKey(r),o=a[i];if(o)o.level=Math.max(o.level,e),o.eles.merge(r),o.reqs++,n.updateItem(o);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:i};n.push(s),a[i]=s}};it.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=[],i=e.lookup,o=0;o<D3&&t.size()>0;o++){var s=t.pop(),u=s.key,l=s.eles[0],f=i.hasCache(l,s.level);if(n[u]=null,f)continue;a.push(s);var d=e.getBoundingBox(l);e.getElement(l,d,r,s.level,ro.dequeue)}return a};it.removeFromQueue=function(r){var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),a=this.getKey(r),i=n[a];i!=null&&(i.eles.length===1?(i.reqs=Ym,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))};it.onDequeue=function(r){this.onDequeues.push(r)};it.offDequeue=function(r){Ba(this.onDequeues,r)};it.setupDequeueing=tP.setupDequeueing({deqRedrawThreshold:I3,deqCost:T3,deqAvgCost:R3,deqNoDrawCost:A3,deqFastCost:P3,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++){var a=e.onDequeues[n];a(t)}},shouldRedraw:function(e,t,n,a){for(var i=0;i<t.length;i++)for(var o=t[i].eles,s=0;s<o.length;s++){var u=o[s].boundingBox();if(e0(u,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var M3=1,is=-4,cl=2,L3=3.99,O3=50,k3=50,q3=.15,N3=.1,F3=.9,z3=.9,$3=1,OE=250,V3=4e3*4e3,kE=32767,G3=!0,aP=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=ta()-2*OE,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=Ss(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},k3),n.beforeRender(function(o,s){s-t.lastInvalidationTime<=OE?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(s,u){return u.reqs-s.reqs};t.layersQueue=new Ts(i),t.setupDequeueing()},xt=aP.prototype,qE=0,W3=Math.pow(2,53)-1;xt.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),o={id:qE=++qE%W3,bb:r,level:e,width:n,height:a,canvas:i,context:i.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=o.context,u=-o.bb.x1,l=-o.bb.y1;return s.scale(t,t),s.translate(u,l),o};xt.getLayers=function(r,e,t){var n=this,a=n.renderer,i=a.cy,o=i.zoom(),s=n.firstGet;if(n.firstGet=!1,t==null){if(t=Math.ceil(Qm(o*e)),t<is)t=is;else if(o>=L3||t>cl)return null}n.validateLayersElesOrdering(t,r);var u=n.layersByLevel,l=Math.pow(2,t),f=u[t]=u[t]||[],d,h=n.levelIsComplete(t,r),g,p=function(){var I=function(N){if(n.validateLayersElesOrdering(N,r),n.levelIsComplete(N,r))return g=u[N],!0},D=function(N){if(!g)for(var W=t+N;is<=W&&W<=cl&&!I(W);W+=N);};D(1),D(-1);for(var L=f.length-1;L>=0;L--){var M=f[L];M.invalid&&Ba(f,M)}};if(!h)p();else return f;var x=function(){if(!d){d=Lt();for(var I=0;I<r.length;I++)$F(d,r[I].boundingBox())}return d},b=function(I){I=I||{};var D=I.after;x();var L=Math.ceil(d.w*l),M=Math.ceil(d.h*l);if(L>kE||M>kE)return null;var q=L*M;if(q>V3)return null;var N=n.makeLayer(d,t);if(D!=null){var W=f.indexOf(D)+1;f.splice(W,0,N)}else(I.insert===void 0||I.insert)&&f.unshift(N);return N};if(n.skipping&&!s)return null;for(var w=null,y=r.length/M3,E=!s,C=0;C<r.length;C++){var S=r[C],R=S._private.rscratch,_=R.imgLayerCaches=R.imgLayerCaches||{},A=_[t];if(A){w=A;continue}if((!w||w.eles.length>=y||!QR(w.bb,S.boundingBox()))&&(w=b({insert:!0,after:w}),!w))return null;g||E?n.queueLayer(w,S):n.drawEleInLayer(w,S,t,e),w.eles.push(S),_[t]=w}return g||(E?null:f)};xt.getEleLevelForLayerLevel=function(r,e){return r};xt.drawEleInLayer=function(r,e,t,n){var a=this,i=this.renderer,o=r.context,s=e.boundingBox();s.w===0||s.h===0||!e.visible()||(t=a.getEleLevelForLayerLevel(t,n),i.setImgSmoothing(o,!1),i.drawCachedElement(o,e,null,null,t,G3),i.setImgSmoothing(o,!0))};xt.levelIsComplete=function(r,e){var t=this,n=t.layersByLevel[r];if(!n||n.length===0)return!1;for(var a=0,i=0;i<n.length;i++){var o=n[i];if(o.reqs>0||o.invalid)return!1;a+=o.eles.length}return a===e.length};xt.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,o=0;o<e.length;o++)if(a.eles[0]===e[o]){i=o;break}if(i<0){this.invalidateLayer(a);continue}for(var s=i,o=0;o<a.eles.length;o++)if(a.eles[o]!==e[s+o]){this.invalidateLayer(a);break}}};xt.updateElementsInLayers=function(r,e){for(var t=this,n=xs(r[0]),a=0;a<r.length;a++)for(var i=n?null:r[a],o=n?r[a]:r[a].ele,s=o._private.rscratch,u=s.imgLayerCaches=s.imgLayerCaches||{},l=is;l<=cl;l++){var f=u[l];f&&(i&&t.getEleLevelForLayerLevel(f.level)!==i.level||e(f,o,i))}};xt.haveLayers=function(){for(var r=this,e=!1,t=is;t<=cl;t++){var n=r.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e};xt.invalidateElements=function(r){var e=this;r.length!==0&&(e.lastInvalidationTime=ta(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))};xt.invalidateLayer=function(r){if(this.lastInvalidationTime=ta(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];Ba(n,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)}}};xt.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,a,i){var o=n.replacement;if(o||(o=n.replacement=e.makeLayer(n.bb,n.level),o.replaces=n,o.eles=n.eles),!o.reqs)for(var s=0;s<o.eles.length;s++)e.queueLayer(o,o.eles[s])})};xt.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()};xt.queueLayer=function(r,e){var t=this,n=t.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))}};xt.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],a=0;a<$3&&t.size()!==0;){var i=t.peek();if(i.replacement){t.pop();continue}if(i.replaces&&i!==i.replaces.replacement){t.pop();continue}if(i.invalid){t.pop();continue}var o=i.elesQueue.shift();o&&(e.drawEleInLayer(i,o,i.level,r),a++),n.length===0&&n.push(!0),i.elesQueue.length===0&&(t.pop(),i.reqs=0,i.replaces&&e.applyLayerReplacement(i),e.requestRedraw())}return n};xt.applyLayerReplacement=function(r){var e=this,t=e.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 o=r.eles[i]._private,s=o.imgLayerCaches=o.imgLayerCaches||{};s&&(s[r.level]=r)}e.requestRedraw()}};xt.requestRedraw=Ss(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);xt.setupDequeueing=tP.setupDequeueing({deqRedrawThreshold:O3,deqCost:q3,deqAvgCost:N3,deqNoDrawCost:F3,deqFastCost:z3,deq:function(e,t){return e.dequeue(t)},onDeqd:Xm,shouldRedraw:HR,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var iP={},NE;function U3(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function H3(r,e,t){for(var n,a=0;a<e.length;a++){var i=e[a];a===0&&(n=i),r.lineTo(i.x,i.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function FE(r,e,t){r.beginPath&&r.beginPath();for(var n=e,a=0;a<n.length;a++){var i=n[a];r.lineTo(i.x,i.y)}var o=t,s=t[0];r.moveTo(s.x,s.y);for(var a=1;a<o.length;a++){var i=o[a];r.lineTo(i.x,i.y)}r.closePath&&r.closePath()}function K3(r,e,t,n,a){r.beginPath&&r.beginPath(),r.arc(t,n,a,0,Math.PI*2,!1);var i=e,o=i[0];r.moveTo(o.x,o.y);for(var s=0;s<i.length;s++){var u=i[s];r.lineTo(u.x,u.y)}r.closePath&&r.closePath()}function j3(r,e,t,n){r.arc(e,t,n,0,Math.PI*2,!1)}iP.arrowShapeImpl=function(r){return(NE||(NE={polygon:U3,"triangle-backcurve":H3,"triangle-tee":FE,"circle-triangle":K3,"triangle-cross":FE,circle:j3}))[r]};var Vn={};Vn.drawElement=function(r,e,t,n,a,i){var o=this;e.isNode()?o.drawNode(r,e,t,n,a,i):o.drawEdge(r,e,t,n,a,i)};Vn.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};Vn.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};Vn.drawCachedElementPortion=function(r,e,t,n,a,i,o,s){var u=this,l=t.getBoundingBox(e);if(!(l.w===0||l.h===0)){var f=t.getElement(e,l,n,a,i);if(f!=null){var d=s(u,e);if(d===0)return;var h=o(u,e),g=l.x1,p=l.y1,x=l.w,b=l.h,w,y,E,C,S;if(h!==0){var R=t.getRotationPoint(e);E=R.x,C=R.y,r.translate(E,C),r.rotate(h),S=u.getImgSmoothing(r),S||u.setImgSmoothing(r,!0);var _=t.getRotationOffset(e);w=_.x,y=_.y}else w=g,y=p;var A;d!==1&&(A=r.globalAlpha,r.globalAlpha=A*d),r.drawImage(f.texture.canvas,f.x,0,f.width,f.height,w,y,x,b),d!==1&&(r.globalAlpha=A),h!==0&&(r.rotate(-h),r.translate(-E,-C),S||u.setImgSmoothing(r,!1))}else t.drawElement(r,e)}};var Y3=function(){return 0},X3=function(e,t){return e.getTextAngle(t,null)},Z3=function(e,t){return e.getTextAngle(t,"source")},Q3=function(e,t){return e.getTextAngle(t,"target")},J3=function(e,t){return t.effectiveOpacity()},av=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Vn.drawCachedElement=function(r,e,t,n,a,i){var o=this,s=o.data,u=s.eleTxrCache,l=s.lblTxrCache,f=s.slbTxrCache,d=s.tlbTxrCache,h=e.boundingBox(),g=i===!0?u.reasons.highQuality:null;if(!(h.w===0||h.h===0||!e.visible())&&(!n||e0(h,n))){var p=e.isEdge(),x=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,u,t,a,g,Y3,J3),(!p||!x)&&o.drawCachedElementPortion(r,e,l,t,a,g,X3,av),p&&!x&&(o.drawCachedElementPortion(r,e,f,t,a,g,Z3,av),o.drawCachedElementPortion(r,e,d,t,a,g,Q3,av)),o.drawElementOverlay(r,e)}};Vn.drawElements=function(r,e){for(var t=this,n=0;n<e.length;n++){var a=e[n];t.drawElement(r,a)}};Vn.drawCachedElements=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];a.drawCachedElement(r,o,t,n)}};Vn.drawCachedNodes=function(r,e,t,n){for(var a=this,i=0;i<e.length;i++){var o=e[i];o.isNode()&&a.drawCachedElement(r,o,t,n)}};Vn.drawLayeredElements=function(r,e,t,n){var a=this,i=a.data.lyrTxrCache.getLayers(e,t);if(i)for(var o=0;o<i.length;o++){var s=i[o],u=s.bb;u.w===0||u.h===0||r.drawImage(s.canvas,u.x1,u.y1,u.w,u.h)}else a.drawCachedElements(r,e,t,n)};var ia={};ia.drawEdge=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s=e._private.rscratch;if(!(i&&!e.visible())&&!(s.badLine||s.allpts==null||isNaN(s.allpts[0]))){var u;t&&(u=t,r.translate(-u.x1,-u.y1));var l=i?e.pstyle("opacity").value:1,f=i?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,g=e.pstyle("width").pfValue,p=e.pstyle("line-cap").value,x=e.pstyle("line-outline-width").value,b=e.pstyle("line-outline-color").value,w=l*f,y=l*f,E=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;d==="straight-triangle"?(o.eleStrokeStyle(r,e,N),o.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=g,r.lineCap=p,o.eleStrokeStyle(r,e,N),o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},C=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:w;if(r.lineWidth=g+x,r.lineCap=p,x>0)o.colorStrokeStyle(r,b[0],b[1],b[2],N);else{r.lineCap="butt";return}d==="straight-triangle"?o.drawEdgeTrianglePath(e,r,s.allpts):(o.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},S=function(){a&&o.drawEdgeOverlay(r,e)},R=function(){a&&o.drawEdgeUnderlay(r,e)},_=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y;o.drawArrowheads(r,e,N)},A=function(){o.drawElementText(r,e,null,n)};r.lineJoin="round";var P=e.pstyle("ghost").value==="yes";if(P){var I=e.pstyle("ghost-offset-x").pfValue,D=e.pstyle("ghost-offset-y").pfValue,L=e.pstyle("ghost-opacity").value,M=w*L;r.translate(I,D),E(M),_(M),r.translate(-I,-D)}else C();R(),E(),_(),S(),A(),t&&r.translate(u.x1,u.y1)}};var oP=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(a!==0){var i=this,o=i.usePaths(),s=n._private.rscratch,u=n.pstyle("".concat(e,"-padding")).pfValue,l=2*u,f=n.pstyle("".concat(e,"-color")).value;t.lineWidth=l,s.edgeType==="self"&&!o?t.lineCap="butt":t.lineCap="round",i.colorStrokeStyle(t,f[0],f[1],f[2],a),i.drawEdgePath(n,t,s.allpts,"solid")}}}};ia.drawEdgeOverlay=oP("overlay");ia.drawEdgeUnderlay=oP("underlay");ia.drawEdgePath=function(r,e,t,n){var a=r._private.rscratch,i=e,o,s=!1,u=this.usePaths(),l=r.pstyle("line-dash-pattern").pfValue,f=r.pstyle("line-dash-offset").pfValue;if(u){var d=t.join("$"),h=a.pathCacheKey&&a.pathCacheKey===d;h?(o=e=a.pathCache,s=!0):(o=e=new Path2D,a.pathCacheKey=d,a.pathCache=o)}if(i.setLineDash)switch(n){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(l),i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}if(!s&&!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 g=2;g+3<t.length;g+=4)e.quadraticCurveTo(t[g],t[g+1],t[g+2],t[g+3]);break;case"straight":case"haystack":for(var p=2;p+1<t.length;p+=2)e.lineTo(t[p],t[p+1]);break;case"segments":if(a.isRound){var x=Gt(a.roundCorners),b;try{for(x.s();!(b=x.n()).done;){var w=b.value;jA(e,w)}}catch(E){x.e(E)}finally{x.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var y=2;y+1<t.length;y+=2)e.lineTo(t[y],t[y+1]);break}e=i,u?e.stroke(o):e.stroke(),e.setLineDash&&e.setLineDash([])};ia.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]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),s=[i[1]/o,-i[0]/o],u=[s[0]*n/2,s[1]*n/2];e.beginPath(),e.moveTo(t[a]-u[0],t[a+1]-u[1]),e.lineTo(t[a]+u[0],t[a+1]+u[1]),e.lineTo(t[a+2],t[a+3]),e.closePath(),e.fill()}};ia.drawArrowheads=function(r,e,t){var n=e._private.rscratch,a=n.edgeType==="haystack";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)};ia.drawArrowhead=function(r,e,t,n,a,i,o){if(!(isNaN(n)||n==null||isNaN(a)||a==null||isNaN(i)||i==null)){var s=this,u=e.pstyle(t+"-arrow-shape").value;if(u!=="none"){var l=e.pstyle(t+"-arrow-fill").value==="hollow"?"both":"filled",f=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,h=e.pstyle(t+"-arrow-width"),g=h.value==="match-line"?d:h.pfValue;h.units==="%"&&(g*=d);var p=e.pstyle("opacity").value;o===void 0&&(o=p);var x=r.globalCompositeOperation;(o!==1||f==="hollow")&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,255,255,255,1),s.colorStrokeStyle(r,255,255,255,1),s.drawArrowShape(e,r,l,d,u,g,n,a,i),r.globalCompositeOperation=x);var b=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,b[0],b[1],b[2],o),s.colorStrokeStyle(r,b[0],b[1],b[2],o),s.drawArrowShape(e,r,f,d,u,g,n,a,i)}}};ia.drawArrowShape=function(r,e,t,n,a,i,o,s,u){var l=this,f=this.usePaths()&&a!=="triangle-cross",d=!1,h,g=e,p={x:o,y:s},x=r.pstyle("arrow-scale").value,b=this.getArrowWidth(n,x),w=l.arrowShapes[a];if(f){var y=l.arrowPathCache=l.arrowPathCache||[],E=ci(a),C=y[E];C!=null?(h=e=C,d=!0):(h=e=new Path2D,y[E]=h)}d||(e.beginPath&&e.beginPath(),f?w.draw(e,1,0,{x:0,y:0},1):w.draw(e,b,u,p,n),e.closePath&&e.closePath()),e=g,f&&(e.translate(o,s),e.rotate(u),e.scale(b,b)),(t==="filled"||t==="both")&&(f?e.fill(h):e.fill()),(t==="hollow"||t==="both")&&(e.lineWidth=i/(f?b:1),e.lineJoin="miter",f?e.stroke(h):e.stroke()),f&&(e.scale(1/b,1/b),e.rotate(-u),e.translate(-o,-s))};var h0={};h0.safeDrawImage=function(r,e,t,n,a,i,o,s,u,l){if(!(a<=0||i<=0||u<=0||l<=0))try{r.drawImage(e,t,n,a,i,o,s,u,l)}catch(f){Cr(f)}};h0.drawInscribedImage=function(r,e,t,n,a){var i=this,o=t.position(),s=o.x,u=o.y,l=t.cy().style(),f=l.getIndexedStyle.bind(l),d=f(t,"background-fit","value",n),h=f(t,"background-repeat","value",n),g=t.width(),p=t.height(),x=t.padding()*2,b=g+(f(t,"background-width-relative-to","value",n)==="inner"?0:x),w=p+(f(t,"background-height-relative-to","value",n)==="inner"?0:x),y=t._private.rscratch,E=f(t,"background-clip","value",n),C=E==="node",S=f(t,"background-image-opacity","value",n)*a,R=f(t,"background-image-smoothing","value",n),_=t.pstyle("corner-radius").value;_!=="auto"&&(_=t.pstyle("corner-radius").pfValue);var A=e.width||e.cachedW,P=e.height||e.cachedH;(A==null||P==null)&&(document.body.appendChild(e),A=e.cachedW=e.width||e.offsetWidth,P=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var I=A,D=P;if(f(t,"background-width","value",n)!=="auto"&&(f(t,"background-width","units",n)==="%"?I=f(t,"background-width","pfValue",n)*b:I=f(t,"background-width","pfValue",n)),f(t,"background-height","value",n)!=="auto"&&(f(t,"background-height","units",n)==="%"?D=f(t,"background-height","pfValue",n)*w:D=f(t,"background-height","pfValue",n)),!(I===0||D===0)){if(d==="contain"){var L=Math.min(b/I,w/D);I*=L,D*=L}else if(d==="cover"){var L=Math.max(b/I,w/D);I*=L,D*=L}var M=s-b/2,q=f(t,"background-position-x","units",n),N=f(t,"background-position-x","pfValue",n);q==="%"?M+=(b-I)*N:M+=N;var W=f(t,"background-offset-x","units",n),V=f(t,"background-offset-x","pfValue",n);W==="%"?M+=(b-I)*V:M+=V;var $=u-w/2,X=f(t,"background-position-y","units",n),ee=f(t,"background-position-y","pfValue",n);X==="%"?$+=(w-D)*ee:$+=ee;var K=f(t,"background-offset-y","units",n),j=f(t,"background-offset-y","pfValue",n);K==="%"?$+=(w-D)*j:$+=j,y.pathCache&&(M-=s,$-=u,s=0,u=0);var fe=r.globalAlpha;r.globalAlpha=S;var G=i.getImgSmoothing(r),z=!1;if(R==="no"&&G?(i.setImgSmoothing(r,!1),z=!0):R==="yes"&&!G&&(i.setImgSmoothing(r,!0),z=!0),h==="no-repeat")C&&(r.save(),y.pathCache?r.clip(y.pathCache):(i.nodeShapes[i.getNodeShape(t)].draw(r,s,u,b,w,_,y),r.clip())),i.safeDrawImage(r,e,0,0,A,P,M,$,I,D),C&&r.restore();else{var Y=r.createPattern(e,h);r.fillStyle=Y,i.nodeShapes[i.getNodeShape(t)].draw(r,s,u,b,w,_,y),r.translate(M,$),r.fill(),r.translate(-M,-$)}r.globalAlpha=fe,z&&i.setImgSmoothing(r,G)}};var bi={};bi.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(Qm(t*n));e=Math.pow(2,a)}var i=r.pstyle("font-size").pfValue*e,o=r.pstyle("min-zoomed-font-size").pfValue;return!(i<o)};bi.drawElementText=function(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this;if(n==null){if(i&&!o.eleTextBiggerThanMin(e))return}else if(n===!1)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var u=o.getLabelJustification(e);r.textAlign=u,r.textBaseline="bottom"}else{var l=e.element()._private.rscratch.badLine,f=e.pstyle("label"),d=e.pstyle("source-label"),h=e.pstyle("target-label");if(l||(!f||!f.value)&&(!d||!d.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var g=!t,p;t&&(p=t,r.translate(-p.x1,-p.y1)),a==null?(o.drawText(r,e,null,g,i),e.isEdge()&&(o.drawText(r,e,"source",g,i),o.drawText(r,e,"target",g,i))):o.drawText(r,e,a,g,i),t&&r.translate(p.x1,p.y1)};bi.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if(e=this.fontCaches[t],e.context===r)return e;return e={context:r},this.fontCaches.push(e),e};bi.setupTextStyle=function(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=e.pstyle("font-style").strValue,a=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,o=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,u=e.pstyle("text-outline-opacity").value*s,l=e.pstyle("color").value,f=e.pstyle("text-outline-color").value;r.font=n+" "+o+" "+a+" "+i,r.lineJoin="round",this.colorFillStyle(r,l[0],l[1],l[2],s),this.colorStrokeStyle(r,f[0],f[1],f[2],u)};function eV(r,e,t,n,a){var i=Math.min(n,a),o=i/2,s=e+n/2,u=t+a/2;r.beginPath(),r.arc(s,u,o,0,Math.PI*2),r.closePath()}function zE(r,e,t,n,a){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,o=Math.min(i,n/2,a/2);r.beginPath(),r.moveTo(e+o,t),r.lineTo(e+n-o,t),r.quadraticCurveTo(e+n,t,e+n,t+o),r.lineTo(e+n,t+a-o),r.quadraticCurveTo(e+n,t+a,e+n-o,t+a),r.lineTo(e+o,t+a),r.quadraticCurveTo(e,t+a,e,t+a-o),r.lineTo(e,t+o),r.quadraticCurveTo(e,t,e+o,t),r.closePath()}bi.getTextAngle=function(r,e){var t,n=r._private,a=n.rscratch,i=e?e+"-":"",o=r.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=$t(a,"labelAngle",e);t=r.isEdge()?s:0}else o.strValue==="none"?t=0:t=o.pfValue;return t};bi.drawText=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,o=i.rscratch,s=a?e.effectiveOpacity():1;if(!(a&&(s===0||e.pstyle("text-opacity").value===0))){t==="main"&&(t=null);var u=$t(o,"labelX",t),l=$t(o,"labelY",t),f,d,h=this.getLabelText(e,t);if(h!=null&&h!==""&&!isNaN(u)&&!isNaN(l)){this.setupTextStyle(r,e,a);var g=t?t+"-":"",p=$t(o,"labelWidth",t),x=$t(o,"labelHeight",t),b=e.pstyle(g+"text-margin-x").pfValue,w=e.pstyle(g+"text-margin-y").pfValue,y=e.isEdge(),E=e.pstyle("text-halign").value,C=e.pstyle("text-valign").value;y&&(E="center",C="center"),u+=b,l+=w;var S;switch(n?S=this.getTextAngle(e,t):S=0,S!==0&&(f=u,d=l,r.translate(f,d),r.rotate(S),u=0,l=0),C){case"top":break;case"center":l+=x/2;break;case"bottom":l+=x;break}var R=e.pstyle("text-background-opacity").value,_=e.pstyle("text-border-opacity").value,A=e.pstyle("text-border-width").pfValue,P=e.pstyle("text-background-padding").pfValue,I=e.pstyle("text-background-shape").strValue,D=I==="round-rectangle"||I==="roundrectangle",L=I==="circle",M=2;if(R>0||A>0&&_>0){var q=r.fillStyle,N=r.strokeStyle,W=r.lineWidth,V=e.pstyle("text-background-color").value,$=e.pstyle("text-border-color").value,X=e.pstyle("text-border-style").value,ee=R>0,K=A>0&&_>0,j=u-P;switch(E){case"left":j-=p;break;case"center":j-=p/2;break}var fe=l-x-P,G=p+2*P,z=x+2*P;if(ee&&(r.fillStyle="rgba(".concat(V[0],",").concat(V[1],",").concat(V[2],",").concat(R*s,")")),K&&(r.strokeStyle="rgba(".concat($[0],",").concat($[1],",").concat($[2],",").concat(_*s,")"),r.lineWidth=A,r.setLineDash))switch(X){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=A/4,r.setLineDash([]);break;case"solid":default:r.setLineDash([]);break}if(D?(r.beginPath(),zE(r,j,fe,G,z,M)):L?(r.beginPath(),eV(r,j,fe,G,z)):(r.beginPath(),r.rect(j,fe,G,z)),ee&&r.fill(),K&&r.stroke(),K&&X==="double"){var Y=A/2;r.beginPath(),D?zE(r,j+Y,fe+Y,G-2*Y,z-2*Y,M):r.rect(j+Y,fe+Y,G-2*Y,z-2*Y),r.stroke()}r.fillStyle=q,r.strokeStyle=N,r.lineWidth=W,r.setLineDash&&r.setLineDash([])}var te=2*e.pstyle("text-outline-width").pfValue;if(te>0&&(r.lineWidth=te),e.pstyle("text-wrap").value==="wrap"){var ue=$t(o,"labelWrapCachedLines",t),oe=$t(o,"labelLineHeight",t),Z=p/2,Q=this.getLabelJustification(e);switch(Q==="auto"||(E==="left"?Q==="left"?u+=-p:Q==="center"&&(u+=-Z):E==="center"?Q==="left"?u+=-Z:Q==="right"&&(u+=Z):E==="right"&&(Q==="center"?u+=Z:Q==="right"&&(u+=p))),C){case"top":l-=(ue.length-1)*oe;break;case"center":case"bottom":l-=(ue.length-1)*oe;break}for(var ie=0;ie<ue.length;ie++)te>0&&r.strokeText(ue[ie],u,l),r.fillText(ue[ie],u,l),l+=oe}else te>0&&r.strokeText(h,u,l),r.fillText(h,u,l);S!==0&&(r.rotate(-S),r.translate(-f,-d))}}};var za={};za.drawNode=function(r,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,o=this,s,u,l=e._private,f=l.rscratch,d=e.position();if(!(!qe(d.x)||!qe(d.y))&&!(i&&!e.visible())){var h=i?e.effectiveOpacity():1,g=o.usePaths(),p,x=!1,b=e.padding();s=e.width()+2*b,u=e.height()+2*b;var w;t&&(w=t,r.translate(-w.x1,-w.y1));for(var y=e.pstyle("background-image"),E=y.value,C=new Array(E.length),S=new Array(E.length),R=0,_=0;_<E.length;_++){var A=E[_],P=C[_]=A!=null&&A!=="none";if(P){var I=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",_);R++,S[_]=o.getCachedImage(A,I,function(){l.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var D=e.pstyle("background-blacken").value,L=e.pstyle("border-width").pfValue,M=e.pstyle("background-opacity").value*h,q=e.pstyle("border-color").value,N=e.pstyle("border-style").value,W=e.pstyle("border-join").value,V=e.pstyle("border-cap").value,$=e.pstyle("border-position").value,X=e.pstyle("border-dash-pattern").pfValue,ee=e.pstyle("border-dash-offset").pfValue,K=e.pstyle("border-opacity").value*h,j=e.pstyle("outline-width").pfValue,fe=e.pstyle("outline-color").value,G=e.pstyle("outline-style").value,z=e.pstyle("outline-opacity").value*h,Y=e.pstyle("outline-offset").value,te=e.pstyle("corner-radius").value;te!=="auto"&&(te=e.pstyle("corner-radius").pfValue);var ue=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M;o.eleFillStyle(r,e,Oe)},oe=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:K;o.colorStrokeStyle(r,q[0],q[1],q[2],Oe)},Z=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:z;o.colorStrokeStyle(r,fe[0],fe[1],fe[2],Oe)},Q=function(Oe,ye,O,ne){var he=o.nodePathCache=o.nodePathCache||[],ge=UR(O==="polygon"?O+","+ne.join(","):O,""+ye,""+Oe,""+te),be=he[ge],Ve,Be=!1;return be!=null?(Ve=be,Be=!0,f.pathCache=Ve):(Ve=new Path2D,he[ge]=f.pathCache=Ve),{path:Ve,cacheHit:Be}},ie=e.pstyle("shape").strValue,de=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(d.x,d.y);var we=Q(s,u,ie,de);p=we.path,x=we.cacheHit}var Ae=function(){if(!x){var Oe=d;g&&(Oe={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||r,Oe.x,Oe.y,s,u,te,f)}g?r.fill(p):r.fill()},ve=function(){for(var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=l.backgrounding,ne=0,he=0;he<S.length;he++){var ge=e.cy().style().getIndexedStyle(e,"background-image-containment","value",he);if(ye&&ge==="over"||!ye&&ge==="inside"){ne++;continue}C[he]&&S[he].complete&&!S[he].error&&(ne++,o.drawInscribedImage(r,S[he],e,he,Oe))}l.backgrounding=ne!==R,O!==l.backgrounding&&e.updateStyle(!1)},le=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasPie(e)&&(o.drawPie(r,e,ye),Oe&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,u,te,f)))},Me=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h;o.hasStripe(e)&&(r.save(),g?r.clip(f.pathCache):(o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,u,te,f),r.clip()),o.drawStripe(r,e,ye),r.restore(),Oe&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,u,te,f)))},Se=function(){var Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,ye=(D>0?D:-D)*Oe,O=D>0?0:255;D!==0&&(o.colorFillStyle(r,O,O,O,ye),g?r.fill(p):r.fill())},Ee=function(){if(L>0){if(r.lineWidth=L,r.lineCap=V,r.lineJoin=W,r.setLineDash)switch(N){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(X),r.lineDashOffset=ee;break;case"solid":case"double":r.setLineDash([]);break}if($!=="center"){if(r.save(),r.lineWidth*=2,$==="inside")g?r.clip(p):r.clip();else{var Oe=new Path2D;Oe.rect(-s/2-L,-u/2-L,s+2*L,u+2*L),Oe.addPath(p),r.clip(Oe,"evenodd")}g?r.stroke(p):r.stroke(),r.restore()}else g?r.stroke(p):r.stroke();if(N==="double"){r.lineWidth=L/3;var ye=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(p):r.stroke(),r.globalCompositeOperation=ye}r.setLineDash&&r.setLineDash([])}},re=function(){if(j>0){if(r.lineWidth=j,r.lineCap="butt",r.setLineDash)switch(G){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([]);break}var Oe=d;g&&(Oe={x:0,y:0});var ye=o.getNodeShape(e),O=L;$==="inside"&&(O=0),$==="outside"&&(O*=2);var ne=(s+O+(j+Y))/s,he=(u+O+(j+Y))/u,ge=s*ne,be=u*he,Ve=o.nodeShapes[ye].points,Be;if(g){var He=Q(ge,be,ye,Ve);Be=He.path}if(ye==="ellipse")o.drawEllipsePath(Be||r,Oe.x,Oe.y,ge,be);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ye)){var We=0,Xe=0,sr=0;ye==="round-diamond"?We=(O+Y+j)*1.4:ye==="round-heptagon"?(We=(O+Y+j)*1.075,sr=-(O/2+Y+j)/35):ye==="round-hexagon"?We=(O+Y+j)*1.12:ye==="round-pentagon"?(We=(O+Y+j)*1.13,sr=-(O/2+Y+j)/15):ye==="round-tag"?(We=(O+Y+j)*1.12,Xe=(O/2+j+Y)*.07):ye==="round-triangle"&&(We=(O+Y+j)*(Math.PI/2),sr=-(O+Y/2+j)/Math.PI),We!==0&&(ne=(s+We)/s,ge=s*ne,["round-hexagon","round-tag"].includes(ye)||(he=(u+We)/u,be=u*he)),te=te==="auto"?rA(ge,be):te;for(var ar=ge/2,Ke=be/2,lr=te+(O+j+Y)/2,ir=new Array(Ve.length/2),Ur=new Array(Ve.length/2),Mr=0;Mr<Ve.length/2;Mr++)ir[Mr]={x:Oe.x+Xe+ar*Ve[Mr*2],y:Oe.y+sr+Ke*Ve[Mr*2+1]};var ct,Lr,jr,Nr,Qr=ir.length;for(Lr=ir[Qr-1],ct=0;ct<Qr;ct++)jr=ir[ct%Qr],Nr=ir[(ct+1)%Qr],Ur[ct]=d0(Lr,jr,Nr,lr),Lr=jr,jr=Nr;o.drawRoundPolygonPath(Be||r,Oe.x+Xe,Oe.y+sr,s*ne,u*he,Ve,Ur)}else if(["roundrectangle","round-rectangle"].includes(ye))te=te==="auto"?Ma(ge,be):te,o.drawRoundRectanglePath(Be||r,Oe.x,Oe.y,ge,be,te+(O+j+Y)/2);else if(["cutrectangle","cut-rectangle"].includes(ye))te=te==="auto"?r0():te,o.drawCutRectanglePath(Be||r,Oe.x,Oe.y,ge,be,null,te+(O+j+Y)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(ye))te=te==="auto"?Ma(ge,be):te,o.drawBottomRoundRectanglePath(Be||r,Oe.x,Oe.y,ge,be,te+(O+j+Y)/2);else if(ye==="barrel")o.drawBarrelPath(Be||r,Oe.x,Oe.y,ge,be);else if(ye.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ye)){var Pn=(O+j+Y)/s;Ve=al(il(Ve,Pn)),o.drawPolygonPath(Be||r,Oe.x,Oe.y,s,u,Ve)}else{var Vr=(O+j+Y)/s;Ve=al(il(Ve,-Vr)),o.drawPolygonPath(Be||r,Oe.x,Oe.y,s,u,Ve)}if(g?r.stroke(Be):r.stroke(),G==="double"){r.lineWidth=O/3;var pn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(Be):r.stroke(),r.globalCompositeOperation=pn}r.setLineDash&&r.setLineDash([])}},ce=function(){a&&o.drawNodeOverlay(r,e,d,s,u)},_e=function(){a&&o.drawNodeUnderlay(r,e,d,s,u)},me=function(){o.drawElementText(r,e,null,n)},Te=e.pstyle("ghost").value==="yes";if(Te){var De=e.pstyle("ghost-offset-x").pfValue,Ne=e.pstyle("ghost-offset-y").pfValue,ze=e.pstyle("ghost-opacity").value,$e=ze*h;r.translate(De,Ne),Z(),re(),ue(ze*M),Ae(),ve($e,!0),oe(ze*K),Ee(),le(D!==0||L!==0),Me(D!==0||L!==0),ve($e,!1),Se($e),r.translate(-De,-Ne)}g&&r.translate(-d.x,-d.y),_e(),g&&r.translate(d.x,d.y),Z(),re(),ue(),Ae(),ve(h,!0),oe(),Ee(),le(D!==0||L!==0),Me(D!==0||L!==0),ve(h,!1),Se(),g&&r.translate(-d.x,-d.y),me(),ce(),t&&r.translate(w.x1,w.y1)}};var sP=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,a,i,o){var s=this;if(n.visible()){var u=n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-opacity")).value,f=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(l>0){if(a=a||n.position(),i==null||o==null){var g=n.padding();i=n.width()+2*g,o=n.height()+2*g}s.colorFillStyle(t,f[0],f[1],f[2],l),s.nodeShapes[d].draw(t,a.x,a.y,i+u*2,o+u*2,h),t.fill()}}}};za.drawNodeOverlay=sP("overlay");za.drawNodeUnderlay=sP("underlay");za.hasPie=function(r){return r=r[0],r._private.hasPie};za.hasStripe=function(r){return r=r[0],r._private.hasStripe};za.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=e.pstyle("pie-size"),o=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,u=n.x,l=n.y,f=e.width(),d=e.height(),h=Math.min(f,d)/2,g,p=0,x=this.usePaths();if(x&&(u=0,l=0),i.units==="%"?h=h*i.pfValue:i.pfValue!==void 0&&(h=i.pfValue/2),o.units==="%"?g=h*o.pfValue:o.pfValue!==void 0&&(g=o.pfValue/2),!(g>=h))for(var b=1;b<=a.pieBackgroundN;b++){var w=e.pstyle("pie-"+b+"-background-size").value,y=e.pstyle("pie-"+b+"-background-color").value,E=e.pstyle("pie-"+b+"-background-opacity").value*t,C=w/100;C+p>1&&(C=1-p);var S=1.5*Math.PI+2*Math.PI*p;S+=s;var R=2*Math.PI*C,_=S+R;w===0||p>=1||p+C>1||(g===0?(r.beginPath(),r.moveTo(u,l),r.arc(u,l,h,S,_),r.closePath()):(r.beginPath(),r.arc(u,l,h,S,_),r.arc(u,l,g,_,S,!0),r.closePath()),this.colorFillStyle(r,y[0],y[1],y[2],E),r.fill(),p+=C)}};za.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var a=e.cy().style(),i=n.x,o=n.y,s=e.width(),u=e.height(),l=0,f=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2);break}var g=s,p=u;h.units==="%"?(g=g*h.pfValue,p=p*h.pfValue):h.pfValue!==void 0&&(g=h.pfValue,p=h.pfValue),f&&(i=0,o=0),o-=g/2,i-=p/2;for(var x=1;x<=a.stripeBackgroundN;x++){var b=e.pstyle("stripe-"+x+"-background-size").value,w=e.pstyle("stripe-"+x+"-background-color").value,y=e.pstyle("stripe-"+x+"-background-opacity").value*t,E=b/100;E+l>1&&(E=1-l),!(b===0||l>=1||l+E>1)&&(r.beginPath(),r.rect(i,o+p*l,g,p*E),r.closePath(),this.colorFillStyle(r,w[0],w[1],w[2],y),r.fill(),l+=E)}r.restore()};var Ot={},rV=100;Ot.getPixelRatio=function(){var r=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),t=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/t};Ot.paintCache=function(r){for(var e=this.paintCaches=this.paintCaches||[],t=!0,n,a=0;a<e.length;a++)if(n=e[a],n.context===r){t=!1;break}return t&&(n={context:r},e.push(n)),n};Ot.createGradientStyleFor=function(r,e,t,n,a){var i,o=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,u=t.pstyle(e+"-gradient-stop-positions").pfValue;if(n==="radial-gradient")if(t.isEdge()){var l=t.sourceEndpoint(),f=t.targetEndpoint(),d=t.midpoint(),h=di(l,d),g=di(f,d);i=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,g))}else{var p=o?{x:0,y:0}:t.position(),x=t.paddedWidth(),b=t.paddedHeight();i=r.createRadialGradient(p.x,p.y,0,p.x,p.y,Math.max(x,b))}else if(t.isEdge()){var w=t.sourceEndpoint(),y=t.targetEndpoint();i=r.createLinearGradient(w.x,w.y,y.x,y.y)}else{var E=o?{x:0,y:0}:t.position(),C=t.paddedWidth(),S=t.paddedHeight(),R=C/2,_=S/2,A=t.pstyle("background-gradient-direction").value;switch(A){case"to-bottom":i=r.createLinearGradient(E.x,E.y-_,E.x,E.y+_);break;case"to-top":i=r.createLinearGradient(E.x,E.y+_,E.x,E.y-_);break;case"to-left":i=r.createLinearGradient(E.x+R,E.y,E.x-R,E.y);break;case"to-right":i=r.createLinearGradient(E.x-R,E.y,E.x+R,E.y);break;case"to-bottom-right":case"to-right-bottom":i=r.createLinearGradient(E.x-R,E.y-_,E.x+R,E.y+_);break;case"to-top-right":case"to-right-top":i=r.createLinearGradient(E.x-R,E.y+_,E.x+R,E.y-_);break;case"to-bottom-left":case"to-left-bottom":i=r.createLinearGradient(E.x+R,E.y-_,E.x-R,E.y+_);break;case"to-top-left":case"to-left-top":i=r.createLinearGradient(E.x+R,E.y+_,E.x-R,E.y-_);break}}if(!i)return null;for(var P=u.length===s.length,I=s.length,D=0;D<I;D++)i.addColorStop(P?u[D]:D/(I-1),"rgba("+s[D][0]+","+s[D][1]+","+s[D][2]+","+a+")");return i};Ot.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a};Ot.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"};Ot.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientFillStyle(r,e,n,t);else{var a=e.pstyle("background-color").value;this.colorFillStyle(r,a[0],a[1],a[2],t)}};Ot.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a};Ot.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"};Ot.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if(n==="linear-gradient"||n==="radial-gradient")this.gradientStrokeStyle(r,e,n,t);else{var a=e.pstyle("line-color").value;this.colorStrokeStyle(r,a[0],a[1],a[2],t)}};Ot.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),a=n[2],i=n[3],o=e.getPixelRatio(),s=e.motionBlurPxRatio;(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(o=s);var u=a*o,l=i*o,f;if(!(u===e.canvasWidth&&l===e.canvasHeight)){e.fontCaches=null;var d=t.canvasContainer;d.style.width=a+"px",d.style.height=i+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)f=t.canvases[h],f.width=u,f.height=l,f.style.width=a+"px",f.style.height=i+"px";for(var h=0;h<e.BUFFER_COUNT;h++)f=t.bufferCanvases[h],f.width=u,f.height=l,f.style.width=a+"px",f.style.height=i+"px";e.textureMult=1,o<=1&&(f=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,f.width=u*e.textureMult,f.height=l*e.textureMult),e.canvasWidth=u,e.canvasHeight=l,e.pixelRatio=o}};Ot.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})};Ot.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])};Ot.render=function(r){var e=this;r=r||YR();var t=e.cy,n=r.forcedContext,a=r.drawAllLayers,i=r.drawOnlyNodeLayer,o=r.forcedZoom,s=r.forcedPan,u=r.forcedPxRatio===void 0?this.getPixelRatio():r.forcedPxRatio,l=e.data,f=l.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=r.motionBlur!==void 0?r.motionBlur:e.motionBlur,g=e.motionBlurPxRatio,p=t.hasCompoundNodes(),x=e.hoverData.draggingEles,b=!!(e.hoverData.selecting||e.touchData.selecting);h=h&&!n&&e.motionBlurEnabled&&!b;var w=h;n||(e.prevPxRatio!==u&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=u),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),h&&(e.mbFrames==null&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(w=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(f[e.NODE]=!0,f[e.SELECT_BOX]=!0);var y=t.style(),E=t.zoom(),C=o!==void 0?o:E,S=t.pan(),R={x:S.x,y:S.y},_={zoom:E,pan:{x:S.x,y:S.y}},A=e.prevViewport,P=A===void 0||_.zoom!==A.zoom||_.pan.x!==A.pan.x||_.pan.y!==A.pan.y;!P&&!(x&&!p)&&(e.motionBlurPxRatio=1),s&&(R=s),C*=u,R.x*=u,R.y*=u;var I=e.getCachedZSortedEles();function D(oe,Z,Q,ie,de){var we=oe.globalCompositeOperation;oe.globalCompositeOperation="destination-out",e.colorFillStyle(oe,255,255,255,e.motionBlurTransparency),oe.fillRect(Z,Q,ie,de),oe.globalCompositeOperation=we}function L(oe,Z){var Q,ie,de,we;!e.clearingMotionBlur&&(oe===l.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]||oe===l.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG])?(Q={x:S.x*g,y:S.y*g},ie=E*g,de=e.canvasWidth*g,we=e.canvasHeight*g):(Q=R,ie=C,de=e.canvasWidth,we=e.canvasHeight),oe.setTransform(1,0,0,1,0,0),Z==="motionBlur"?D(oe,0,0,de,we):!n&&(Z===void 0||Z)&&oe.clearRect(0,0,de,we),a||(oe.translate(Q.x,Q.y),oe.scale(ie,ie)),s&&oe.translate(s.x,s.y),o&&oe.scale(o,o)}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 M=e.data.bufferContexts[e.TEXTURE_BUFFER];M.setTransform(1,0,0,1,0,0),M.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:M,drawOnlyNodeLayer:!0,forcedPxRatio:u*e.textureMult});var _=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight};_.mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}f[e.DRAG]=!1,f[e.NODE]=!1;var q=l.contexts[e.NODE],N=e.textureCache.texture,_=e.textureCache.viewport;q.setTransform(1,0,0,1,0,0),h?D(q,0,0,_.width,_.height):q.clearRect(0,0,_.width,_.height);var W=y.core("outside-texture-bg-color").value,V=y.core("outside-texture-bg-opacity").value;e.colorFillStyle(q,W[0],W[1],W[2],V),q.fillRect(0,0,_.width,_.height);var E=t.zoom();L(q,!1),q.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/u,_.height/_.zoom/u),q.drawImage(N,_.mpan.x,_.mpan.y,_.width/_.zoom/u,_.height/_.zoom/u)}else e.textureOnViewport&&!n&&(e.textureCache=null);var $=t.extent(),X=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),ee=e.hideEdgesOnViewport&&X,K=[];if(K[e.NODE]=!f[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,K[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),K[e.DRAG]=!f[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,K[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),f[e.NODE]||a||i||K[e.NODE]){var j=h&&!K[e.NODE]&&g!==1,q=n||(j?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:l.contexts[e.NODE]),fe=h&&!j?"motionBlur":void 0;L(q,fe),ee?e.drawCachedNodes(q,I.nondrag,u,$):e.drawLayeredElements(q,I.nondrag,u,$),e.debug&&e.drawDebugPoints(q,I.nondrag),!a&&!h&&(f[e.NODE]=!1)}if(!i&&(f[e.DRAG]||a||K[e.DRAG])){var j=h&&!K[e.DRAG]&&g!==1,q=n||(j?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:l.contexts[e.DRAG]);L(q,h&&!j?"motionBlur":void 0),ee?e.drawCachedNodes(q,I.drag,u,$):e.drawCachedElements(q,I.drag,u,$),e.debug&&e.drawDebugPoints(q,I.drag),!a&&!h&&(f[e.DRAG]=!1)}if(this.drawSelectionRectangle(r,L),h&&g!==1){var G=l.contexts[e.NODE],z=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],Y=l.contexts[e.DRAG],te=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],ue=function(Z,Q,ie){Z.setTransform(1,0,0,1,0,0),ie||!w?Z.clearRect(0,0,e.canvasWidth,e.canvasHeight):D(Z,0,0,e.canvasWidth,e.canvasHeight);var de=g;Z.drawImage(Q,0,0,e.canvasWidth*de,e.canvasHeight*de,0,0,e.canvasWidth,e.canvasHeight)};(f[e.NODE]||K[e.NODE])&&(ue(G,z,K[e.NODE]),f[e.NODE]=!1),(f[e.DRAG]||K[e.DRAG])&&(ue(Y,te,K[e.DRAG]),f[e.DRAG]=!1)}e.prevViewport=_,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),h&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,f[e.NODE]=!0,f[e.DRAG]=!0,e.redraw()},rV)),n||t.emit("render")};var Wo;Ot.drawSelectionRectangle=function(r,e){var t=this,n=t.cy,a=t.data,i=n.style(),o=r.drawOnlyNodeLayer,s=r.drawAllLayers,u=a.canvasNeedsRedraw,l=r.forcedContext;if(t.showFps||!o&&u[t.SELECT_BOX]&&!s){var f=l||a.contexts[t.SELECT_BOX];if(e(f),t.selection[4]==1&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),h=i.core("selection-box-border-width").value/d;f.lineWidth=h,f.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")",f.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),h>0&&(f.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")",f.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(a.bgActivePosistion&&!t.hoverData.selecting){var d=t.cy.zoom(),g=a.bgActivePosistion;f.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")",f.beginPath(),f.arc(g.x,g.y,i.core("active-bg-size").pfValue/d,0,2*Math.PI),f.fill()}var p=t.lastRedrawTime;if(t.showFps&&p){p=Math.round(p);var x=Math.round(1e3/p),b="1 frame = "+p+" ms = "+x+" fps";if(f.setTransform(1,0,0,1,0,0),f.fillStyle="rgba(255, 0, 0, 0.75)",f.strokeStyle="rgba(255, 0, 0, 0.75)",f.font="30px Arial",!Wo){var w=f.measureText(b);Wo=w.actualBoundingBoxAscent}f.fillText(b,0,Wo);var y=60;f.strokeRect(0,Wo+10,250,20),f.fillRect(0,Wo+10,250*Math.min(x/y,1),20)}s||(u[t.SELECT_BOX]=!1)}};function $E(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 tV(r,e,t){var n=$E(r,r.VERTEX_SHADER,e),a=$E(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}function nV(r,e,t){t===void 0&&(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 g0(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 aV(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function iV(r,e,t,n,a){var i=n*t+e.x,o=a*t+e.y;return o=Math.round(r.canvasHeight-o),[i,o]}function oV(r){return r.pstyle("background-fill").value!=="solid"||r.pstyle("background-image").strValue!=="none"?!1:r.pstyle("border-width").value===0||r.pstyle("border-opacity").value===0?!0:r.pstyle("border-style").value==="solid"}function sV(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 ri(r,e,t){var n=r[0]/255,a=r[1]/255,i=r[2]/255,o=e,s=t||new Array(4);return s[0]=n*o,s[1]=a*o,s[2]=i*o,s[3]=o,s}function ji(r,e){var t=e||new Array(4);return t[0]=(r>>0&255)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function uV(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function lV(r,e){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}function uP(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 lP(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function fV(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 cV(r,e,t,n){var a=uP(r,e),i=Xr(a,2),o=i[0],s=i[1],u=lP(r,s,n),l=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,u,r.STATIC_DRAW),s===r.FLOAT?r.vertexAttribPointer(t,o,s,!1,0,0):s===r.INT&&r.vertexAttribIPointer(t,o,s,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null),l}function Ln(r,e,t,n){var a=uP(r,t),i=Xr(a,3),o=i[0],s=i[1],u=i[2],l=lP(r,s,e*o),f=o*u,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*f,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),s===r.FLOAT?r.vertexAttribPointer(n,o,s,!1,f,0):s===r.INT&&r.vertexAttribIPointer(n,o,s,f,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var h=new Array(e),g=0;g<e;g++)h[g]=fV(r,s,l,f,o,g);return d.dataArray=l,d.stride=f,d.size=o,d.getView=function(p){return h[p]},d.setPoint=function(p,x,b){var w=h[p];w[0]=x,w[1]=b},d.bufferSubData=function(p){r.bindBuffer(r.ARRAY_BUFFER,d),p?r.bufferSubData(r.ARRAY_BUFFER,0,l,0,p*o):r.bufferSubData(r.ARRAY_BUFFER,0,l)},d}function dV(r,e,t){for(var n=9,a=new Float32Array(e*n),i=new Array(e),o=0;o<e;o++){var s=o*n*4;i[o]=new Float32Array(a.buffer,s,n)}var u=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,a.byteLength,r.DYNAMIC_DRAW);for(var l=0;l<3;l++){var f=t+l;r.enableVertexAttribArray(f),r.vertexAttribPointer(f,3,r.FLOAT,!1,36,l*12),r.vertexAttribDivisor(f,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),u.getMatrixView=function(d){return i[d]},u.setData=function(d,h){i[h].set(d,0)},u.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferSubData(r.ARRAY_BUFFER,0,a)},u}function vV(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}var VE=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});function iv(){var r=new VE(9);return VE!=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 GE(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 hV(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],d=e[8],h=t[0],g=t[1],p=t[2],x=t[3],b=t[4],w=t[5],y=t[6],E=t[7],C=t[8];return r[0]=h*n+g*o+p*l,r[1]=h*a+g*s+p*f,r[2]=h*i+g*u+p*d,r[3]=x*n+b*o+w*l,r[4]=x*a+b*s+w*f,r[5]=x*i+b*u+w*d,r[6]=y*n+E*o+C*l,r[7]=y*a+E*s+C*f,r[8]=y*i+E*u+C*d,r}function Yu(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],d=e[8],h=t[0],g=t[1];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=s,r[5]=u,r[6]=h*n+g*o+l,r[7]=h*a+g*s+f,r[8]=h*i+g*u+d,r}function WE(r,e,t){var n=e[0],a=e[1],i=e[2],o=e[3],s=e[4],u=e[5],l=e[6],f=e[7],d=e[8],h=Math.sin(t),g=Math.cos(t);return r[0]=g*n+h*o,r[1]=g*a+h*s,r[2]=g*i+h*u,r[3]=g*o-h*n,r[4]=g*s-h*a,r[5]=g*u-h*i,r[6]=l,r[7]=f,r[8]=d,r}function qm(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}function gV(r,e,t){return 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,r}var pV=(function(){function r(e,t,n,a){qa(this,r),this.debugID=Math.floor(Math.random()*1e4),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")}return Na(r,[{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,i=this.texHeight,o=this.texSize,s=i/a,u=n*s,l=a*s;return u>o&&(s=o/n,u=n*s,l=a*s),{scale:s,texW:u,texH:l}}},{key:"draw",value:function(t,n,a){var i=this;if(this.locked)throw new Error("can't draw, atlas is locked");var o=this.texSize,s=this.texRows,u=this.texHeight,l=this.getScale(n),f=l.scale,d=l.texW,h=l.texH,g=function(E,C){if(a&&C){var S=C.context,R=E.x,_=E.row,A=R,P=u*_;S.save(),S.translate(A,P),S.scale(f,f),a(S,n),S.restore()}},p=[null,null],x=function(){g(i.freePointer,i.canvas),p[0]={x:i.freePointer.x,y:i.freePointer.row*u,w:d,h},p[1]={x:i.freePointer.x+d,y:i.freePointer.row*u,w:0,h},i.freePointer.x+=d,i.freePointer.x==o&&(i.freePointer.x=0,i.freePointer.row++)},b=function(){var E=i.scratch,C=i.canvas;E.clear(),g({x:0,row:0},E);var S=o-i.freePointer.x,R=d-S,_=u;{var A=i.freePointer.x,P=i.freePointer.row*u,I=S;C.context.drawImage(E,0,0,I,_,A,P,I,_),p[0]={x:A,y:P,w:I,h}}{var D=S,L=(i.freePointer.row+1)*u,M=R;C&&C.context.drawImage(E,D,0,M,_,0,L,M,_),p[1]={x:0,y:L,w:M,h}}i.freePointer.x=R,i.freePointer.row++},w=function(){i.freePointer.x=0,i.freePointer.row++};if(this.freePointer.x+d<=o)x();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===o?(w(),x()):this.enableWrapping?b():(w(),x())}return this.keyToLocation.set(t,p),this.needsBuffer=!0,p}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,a=this.texRows,i=this.getScale(t),o=i.texW;return this.freePointer.x+o>n?this.freePointer.row<a-1:!0}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=lV(t,this.debugID)),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}}])})(),yV=(function(){function r(e,t,n,a){qa(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=a,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set}return Na(r,[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas;return new pV(t,n,a,i)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,a=this.texRows,i=this.createTextureCanvas,o=Math.floor(n/a);this.scratch=i(t,n,o,"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||!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(n.size===0){console.log("nothing to garbage collect");return}var a=[],i=new Map,o=null,s=Gt(this.atlases),u;try{var l=function(){var d=u.value,h=d.getKeys(),g=mV(n,h);if(g.size===0)return a.push(d),h.forEach(function(S){return i.set(S,d)}),1;o||(o=t._createAtlas(),a.push(o));var p=Gt(h),x;try{for(p.s();!(x=p.n()).done;){var b=x.value;if(!g.has(b)){var w=d.getOffsets(b),y=Xr(w,2),E=y[0],C=y[1];o.canFit({w:E.w+C.w,h:E.h})||(o.lock(),o=t._createAtlas(),a.push(o)),d.canvas&&(t._copyTextureToNewAtlas(b,d,o),i.set(b,o))}}}catch(S){p.e(S)}finally{p.f()}d.dispose()};for(s.s();!(u=s.n()).done;)l()}catch(f){s.e(f)}finally{s.f()}this.atlases=a,this.styleKeyToAtlas=i,this.markedKeys=new Set}},{key:"_copyTextureToNewAtlas",value:function(t,n,a){var i=n.getOffsets(t),o=Xr(i,2),s=o[0],u=o[1];if(u.w===0)a.draw(t,s,function(h){h.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var l=this._getScratchCanvas();l.clear(),l.context.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),l.context.drawImage(n.canvas,u.x,u.y,u.w,u.h,s.w,0,u.w,u.h);var f=s.w+u.w,d=s.h;a.draw(t,{w:f,h:d},function(h){h.drawImage(l,0,0,f,d,0,0,f,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])})();function mV(r,e){return r.intersection?r.intersection(e):new Set(el(r).filter(function(t){return e.has(t)}))}var bV=(function(){function r(e,t){qa(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}return Na(r,[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var a=this.globalOptions,i=a.webglTexSize,o=a.createTextureCanvas,s=n.texRows,u=this._cacheScratchCanvas(o),l=new yV(this.r,i,s,u);this.collections.set(t,l)}},{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),o=Ze({type:t,atlasCollection:i},n);this.renderTypes.set(t,o)}},{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(o,s,u,l){return l?((!i||s!=n||u!=a)&&(n=s,a=u,i=t(o,s,u)),i):t(o,s,u)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var n=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=a.forceRedraw,o=i===void 0?!1:i,s=a.filterEle,u=s===void 0?function(){return!0}:s,l=a.filterType,f=l===void 0?function(){return!0}:l,d=!1,h=!1,g=Gt(t),p;try{for(g.s();!(p=g.n()).done;){var x=p.value;if(u(x)){var b=Gt(this.renderTypes.values()),w;try{var y=function(){var C=w.value,S=C.type;if(f(S)){var R=n.collections.get(C.collection),_=C.getKey(x),A=Array.isArray(_)?_:[_];if(o)A.forEach(function(L){return R.markKeyForGC(L)}),h=!0;else{var P=C.getID?C.getID(x):x.id(),I=n._key(S,P),D=n.typeAndIdToKey.get(I);D!==void 0&&!sV(A,D)&&(d=!0,n.typeAndIdToKey.delete(I),D.forEach(function(L){return R.markKeyForGC(L)}))}}};for(b.s();!(w=b.n()).done;)y()}catch(E){b.e(E)}finally{b.f()}}}}catch(E){g.e(E)}finally{g.f()}return h&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var t=Gt(this.collections.values()),n;try{for(t.s();!(n=t.n()).done;){var a=n.value;a.gc()}}catch(i){t.e(i)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,a,i){var o=this.renderTypes.get(n),s=this.collections.get(o.collection),u=!1,l=s.draw(i,a,function(h){o.drawClipped?(h.save(),h.beginPath(),h.rect(0,0,a.w,a.h),h.clip(),o.drawElement(h,t,a,!0,!0),h.restore()):o.drawElement(h,t,a,!0,!0),u=!0});if(u){var f=o.getID?o.getID(t):t.id(),d=this._key(n,f);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(i):this.typeAndIdToKey.set(d,[i])}return l}},{key:"getAtlasInfo",value:function(t,n){var a=this,i=this.renderTypes.get(n),o=i.getKey(t),s=Array.isArray(o)?o:[o];return s.map(function(u){var l=i.getBoundingBox(t,u),f=a.getOrCreateAtlas(t,n,l,u),d=f.getOffsets(u),h=Xr(d,2),g=h[0],p=h[1];return{atlas:f,tex:g,tex1:g,tex2:p,bb:l}})}},{key:"getDebugInfo",value:function(){var t=[],n=Gt(this.collections),a;try{for(n.s();!(a=n.n()).done;){var i=Xr(a.value,2),o=i[0],s=i[1],u=s.getCounts(),l=u.keyCount,f=u.atlasCount;t.push({type:o,keyCount:l,atlasCount:f})}}catch(d){n.e(d)}finally{n.f()}return t}}])})(),wV=(function(){function r(e){qa(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Na(r,[{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):!0}},{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}}])})(),xV=`
|
|
18
44
|
float circleSD(vec2 p, float r) {
|
|
19
45
|
return distance(vec2(0), p) - r; // signed distance
|
|
20
46
|
}
|
|
21
|
-
`,
|
|
47
|
+
`,EV=`
|
|
22
48
|
float rectangleSD(vec2 p, vec2 b) {
|
|
23
49
|
vec2 d = abs(p)-b;
|
|
24
50
|
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
25
51
|
}
|
|
26
|
-
`,
|
|
52
|
+
`,CV=`
|
|
27
53
|
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
28
54
|
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
29
55
|
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
30
56
|
vec2 q = abs(p) - b + cr.x;
|
|
31
57
|
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
32
58
|
}
|
|
33
|
-
`,
|
|
59
|
+
`,_V=`
|
|
34
60
|
float ellipseSD(vec2 p, vec2 ab) {
|
|
35
61
|
p = abs( p ); // symmetry
|
|
36
62
|
|
|
@@ -50,7 +76,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
50
76
|
// return signed distance
|
|
51
77
|
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
52
78
|
}
|
|
53
|
-
`,
|
|
79
|
+
`,os={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},dl={IGNORE:1,USE_BB:2},ov=0,UE=1,HE=2,sv=3,Yi=4,Nu=5,Uo=6,Ho=7,SV=(function(){function r(e,t,n){qa(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=nV,this.atlasManager=new bV(e,n),this.batchManager=new wV(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(os.SCREEN),this.pickingProgram=this._createShaderProgram(os.PICKING),this.vao=this._createVAO()}return Na(r,[{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 n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.type,i=this.atlasManager;return a?i.invalidate(t,{filterType:function(s){return s===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
|
|
54
80
|
precision highp float;
|
|
55
81
|
|
|
56
82
|
uniform mat3 uPanZoomMatrix;
|
|
@@ -97,7 +123,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
97
123
|
int vid = gl_VertexID;
|
|
98
124
|
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
99
125
|
|
|
100
|
-
if(aVertType == `.concat(
|
|
126
|
+
if(aVertType == `.concat(ov,`) {
|
|
101
127
|
float texX = aTex.x; // texture coordinates
|
|
102
128
|
float texY = aTex.y;
|
|
103
129
|
float texW = aTex.z;
|
|
@@ -115,8 +141,8 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
115
141
|
|
|
116
142
|
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
117
143
|
}
|
|
118
|
-
else if(aVertType == `).concat(
|
|
119
|
-
|| aVertType == `).concat(
|
|
144
|
+
else if(aVertType == `).concat(Yi," || aVertType == ").concat(Ho,`
|
|
145
|
+
|| aVertType == `).concat(Nu," || aVertType == ").concat(Uo,`) { // simple shapes
|
|
120
146
|
|
|
121
147
|
// the bounding box is needed by the fragment shader
|
|
122
148
|
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
@@ -131,7 +157,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
131
157
|
|
|
132
158
|
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
133
159
|
}
|
|
134
|
-
else if(aVertType == `).concat(
|
|
160
|
+
else if(aVertType == `).concat(UE,`) {
|
|
135
161
|
vec2 source = aPointAPointB.xy;
|
|
136
162
|
vec2 target = aPointAPointB.zw;
|
|
137
163
|
|
|
@@ -146,7 +172,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
146
172
|
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
147
173
|
vColor = aColor;
|
|
148
174
|
}
|
|
149
|
-
else if(aVertType == `).concat(
|
|
175
|
+
else if(aVertType == `).concat(HE,`) {
|
|
150
176
|
vec2 pointA = aPointAPointB.xy;
|
|
151
177
|
vec2 pointB = aPointAPointB.zw;
|
|
152
178
|
vec2 pointC = aPointCPointD.xy;
|
|
@@ -195,7 +221,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
195
221
|
|
|
196
222
|
vColor = aColor;
|
|
197
223
|
}
|
|
198
|
-
else if(aVertType == `).concat(
|
|
224
|
+
else if(aVertType == `).concat(sv,` && vid < 3) {
|
|
199
225
|
// massage the first triangle into an edge arrow
|
|
200
226
|
if(vid == 0)
|
|
201
227
|
position = vec2(-0.15, -0.3);
|
|
@@ -219,7 +245,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
219
245
|
precision highp float;
|
|
220
246
|
|
|
221
247
|
// declare texture unit for each texture atlas in the batch
|
|
222
|
-
`.concat(i.map(function(
|
|
248
|
+
`.concat(i.map(function(l){return"uniform sampler2D uTexture".concat(l,";")}).join(`
|
|
223
249
|
`),`
|
|
224
250
|
|
|
225
251
|
uniform vec4 uBGColor;
|
|
@@ -240,10 +266,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
240
266
|
|
|
241
267
|
out vec4 outColor;
|
|
242
268
|
|
|
243
|
-
`).concat(
|
|
244
|
-
`).concat(
|
|
245
|
-
`).concat(
|
|
246
|
-
`).concat(
|
|
269
|
+
`).concat(xV,`
|
|
270
|
+
`).concat(EV,`
|
|
271
|
+
`).concat(CV,`
|
|
272
|
+
`).concat(_V,`
|
|
247
273
|
|
|
248
274
|
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
249
275
|
return vec4(
|
|
@@ -259,21 +285,21 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
259
285
|
}
|
|
260
286
|
|
|
261
287
|
void main(void) {
|
|
262
|
-
if(vVertType == `).concat(
|
|
288
|
+
if(vVertType == `).concat(ov,`) {
|
|
263
289
|
// look up the texel from the texture unit
|
|
264
|
-
`).concat(i.map(function(
|
|
290
|
+
`).concat(i.map(function(l){return"if(vAtlasId == ".concat(l,") outColor = texture(uTexture").concat(l,", vTexCoord);")}).join(`
|
|
265
291
|
else `),`
|
|
266
292
|
}
|
|
267
|
-
else if(vVertType == `).concat(
|
|
293
|
+
else if(vVertType == `).concat(sv,`) {
|
|
268
294
|
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
269
295
|
outColor = blend(vColor, uBGColor);
|
|
270
296
|
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
271
297
|
}
|
|
272
|
-
else if(vVertType == `).concat(
|
|
298
|
+
else if(vVertType == `).concat(Yi,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
273
299
|
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
274
300
|
}
|
|
275
|
-
else if(vVertType == `).concat(
|
|
276
|
-
|| vVertType == `).concat(
|
|
301
|
+
else if(vVertType == `).concat(Yi," || vVertType == ").concat(Ho,`
|
|
302
|
+
|| vVertType == `).concat(Nu," || vVertType == ").concat(Uo,`) { // use SDF
|
|
277
303
|
|
|
278
304
|
float outerBorder = vBorderWidth[0];
|
|
279
305
|
float innerBorder = vBorderWidth[1];
|
|
@@ -284,11 +310,11 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
284
310
|
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
285
311
|
|
|
286
312
|
float d; // signed distance
|
|
287
|
-
if(vVertType == `).concat(
|
|
313
|
+
if(vVertType == `).concat(Yi,`) {
|
|
288
314
|
d = rectangleSD(p, b);
|
|
289
|
-
} else if(vVertType == `).concat(
|
|
315
|
+
} else if(vVertType == `).concat(Ho,` && w == h) {
|
|
290
316
|
d = circleSD(p, b.x); // faster than ellipse
|
|
291
|
-
} else if(vVertType == `).concat(
|
|
317
|
+
} else if(vVertType == `).concat(Ho,`) {
|
|
292
318
|
d = ellipseSD(p, b);
|
|
293
319
|
} else {
|
|
294
320
|
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
@@ -328,31 +354,5 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
328
354
|
`).concat(t.picking?`if(outColor.a == 0.0) discard;
|
|
329
355
|
else outColor = vIndex;`:"",`
|
|
330
356
|
}
|
|
331
|
-
`),s=s3(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(l)));return s}},{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,o=a.createVertexArray();return a.bindVertexArray(o),p3(a,"vec2",i.aPosition,t),this.transformBuffer=y3(a,n,i.aTransform),this.indexBuffer=Pn(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Pn(a,n,"int",i.aVertType),this.atlasIdBuffer=Pn(a,n,"int",i.aAtlasId),this.texBuffer=Pn(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Pn(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Pn(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Pn(a,n,"vec2",i.aLineWidth),this.colorBuffer=Pn(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Pn(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Pn(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return wa(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Zo.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):!0:!1}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(a);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(t);if(l===al.IGNORE)return;if(l==al.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=$t(u),d;try{for(c.s();!(d=c.n()).done;){var h=d.value,g=h.atlas,p=h.tex1,E=h.tex2;o.canAddToCurrentBatch(g)||this.endBatch();for(var m=o.getAtlasIndexForBatch(g),b=0,w=[[p,!0],[E,!1]];b<w.length;b++){var x=Yr(w[b],2),C=x[0],T=x[1];if(C.w!=0){var S=this.instanceCount;this.vertTypeBuffer.getView(S)[0]=qd;var _=this.indexBuffer.getView(S);Vi(n,_);var A=this.atlasIdBuffer.getView(S);A[0]=m;var P=this.texBuffer.getView(S);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var D=this.transformBuffer.getMatrixView(S);this.setTransformMatrix(t,D,s,h,T),this.instanceCount++,T||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(I){c.e(I)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(a.shapeProps&&a.shapeProps.padding&&(s=t.pstyle(a.shapeProps.padding).pfValue),i){var l=i.bb,u=i.tex1,c=i.tex2,d=u.w/(u.w+c.w);o||(d=1-d);var h=this._getAdjustedBB(l,s,o,d);this._applyTransformMatrix(n,h,a,t)}else{var g=a.getBoundingBox(t),p=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(n,p,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var o,s;fE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;Vu(t,t,[c,d]),cE(t,t,l);var h=a.getRotationOffset(i);o=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else o=n.x1,s=n.y1;Vu(t,t,[o,s]),Sm(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var o=t.x1,s=t.y1,l=t.w,u=t.h,c=t.yOffset;n&&(o-=n,s-=n,l+=2*n,u+=2*n);var d=0,h=l*i;return a&&i<1?l=h:!a&&i<1&&(d=l-h,o+=d,l=h),{x1:o,y1:s,w:l,h:u,xOffset:d,yOffset:c}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=Gi;var s=this.indexBuffer.getView(o);Vi(n,s);var l=this.colorBuffer.getView(o);Ja([0,0,0],1,l);var u=this.transformBuffer.getMatrixView(o);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 o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,n,a);return}var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=s,s===Du||s===No){var u=i.getBoundingBox(t),c=this._getCornerRadius(t,o.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,s===No&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);Vi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Ja(g,p,E);var m=this.lineWidthBuffer.getView(l);if(m[0]=0,m[1]=0,o.border){var b=t.pstyle("border-width").value;if(b>0){var w=t.pstyle("border-color").value,x=t.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(l);Ja(w,x,C);var T=t.pstyle("border-position").value;if(T==="inside")m[0]=0,m[1]=-b;else if(T==="outside")m[0]=b,m[1]=0;else{var S=b/2;m[0]=S,m[1]=-S}}}var _=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,_,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var a=t.pstyle(n).value;switch(a){case"rectangle":return Gi;case"ellipse":return Fo;case"roundrectangle":case"round-rectangle":return Du;case"bottom-round-rectangle":return No;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Aa(i,o);var s=t.pstyle(n).pfValue,l=i/2,u=o/2;return Math.min(s,u,l)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var i=t._private.rscratch,o,s,l;if(a==="source"?(o=i.arrowStartX,s=i.arrowStartY,l=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,l=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(l)||l==null)){var u=t.pstyle(a+"-arrow-shape").value;if(u!=="none"){var c=t.pstyle(a+"-arrow-color").value,d=t.pstyle("opacity").value,h=t.pstyle("line-opacity").value,g=d*h,p=t.pstyle("width").pfValue,E=t.pstyle("arrow-scale").value,m=this.r.getArrowWidth(p,E),b=this.instanceCount,w=this.transformBuffer.getMatrixView(b);fE(w),Vu(w,w,[o,s]),Sm(w,w,[m,m]),cE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Nd;var x=this.indexBuffer.getView(b);Vi(n,x);var C=this.colorBuffer.getView(b);Ja(c,g,C),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,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=i*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=dE;var d=this.indexBuffer.getView(c);Vi(n,d);var h=this.colorBuffer.getView(c);Ja(l,u,h);var g=this.lineWidthBuffer.getView(c);g[0]=s;var p=this.pointAPointBBuffer.getView(c);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var E=0;E<a.length-2;E+=2){var m=this.instanceCount;this.vertTypeBuffer.getView(m)[0]=vE;var b=this.indexBuffer.getView(m);Vi(n,b);var w=this.colorBuffer.getView(m);Ja(l,u,w);var x=this.lineWidthBuffer.getView(m);x[0]=s;var C=a[E-2],T=a[E-1],S=a[E],_=a[E+1],A=a[E+2],P=a[E+3],D=a[E+4],I=a[E+5];E==0&&(C=2*S-A+.001,T=2*_-P+.001),E==a.length-4&&(D=2*A-S+.001,I=2*P-_+.001);var M=this.pointAPointBBuffer.getView(m);M[0]=C,M[1]=T,M[2]=S,M[3]=_;var k=this.pointCPointDBuffer.getView(m);k[0]=A,k[1]=P,k[2]=D,k[3]=I,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=t[0],a[1]=t[1];else if(i==n)a[i*2]=t[t.length-2],a[i*2+1]=t[t.length-1];else{var o=i/n;this._setCurvePoint(t,o,a,i*2)}return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(t.length<=2)a[i]=t[0],a[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var l=(1-n)*t[s]+n*t[s+2],u=(1-n)*t[s+1]+n*t[s+3];o[s]=l,o[s+1]=u}return this._setCurvePoint(o,n,a,i)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(n);var s=$t(this.buffers),l;try{for(s.s();!(l=s.n()).done;){var u=l.value;u.bufferSubData(i)}}catch(p){s.e(p)}finally{s.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var h=0;h<c.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,c[h].texture),t.uniform1i(o.uTextures[h],h);t.uniform1f(o.uZoom,l3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Ja(this.bgColor,1);t.uniform4fv(o.uBGColor,g),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(o,s){return o+s.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),qA={};qA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=I3(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=m3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new D3(t,n,r);var a=function(d){return function(h){return t.getTextAngle(h,d)}},i=function(d){return function(h){var g=h.pstyle(d);return g&&g.value}},o=function(d){return function(h){return h.pstyle("".concat(d,"-opacity")).value>0}},s=function(d){var h=d.pstyle("text-events").strValue==="yes";return h?al.USE_BB:al.IGNORE},l=function(d){var h=d.position(),g=h.x,p=h.y,E=d.outerWidth(),m=d.outerHeight();return{w:E,h:m,x1:g-E/2,y1:p-m/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:c3,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:o("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:o("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:s,getKey:Fd(e.getLabelKey,null),getBoundingBox:zd(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:s,getKey:Fd(e.getSourceLabelKey,"source"),getBoundingBox:zd(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:s,getKey:Fd(e.getTargetLabelKey,"target"),getBoundingBox:zd(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=ms(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var h=!1;d&&d.length>0&&(h|=t.drawing.invalidate(d)),h&&u()}),B3(t)};function I3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return cR(t)}function NA(r,e){var t=r._private.rscratch;return Ft(t,"labelWrapCachedLines",e)||[]}var Fd=function(e,t){return function(n){var a=e(n),i=NA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},zd=function(e,t){return function(n,a){var i=e(n);if(typeof a=="string"){var o=a.indexOf("_");if(o>0){var s=Number(a.substring(o+1)),l=NA(n,t),u=i.h/l.length,c=u*s,d=i.y1+c;return{x1:i.x1,w:i.w,y1:d,h:u,yOffset:c}}}return i}};function B3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>DA?(k3(r),e.call(r,i)):(M3(r),zA(r,i,Zo.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,o,s,l){return z3(r,i,o)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var a=r.notify;r.notify=function(i,o){a.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function k3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function M3(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])}function L3(r){var e=r.canvasWidth,t=r.canvasHeight,n=e0(r),a=n.pan,i=n.zoom,o=Od();Vu(o,o,[a.x,a.y]),Sm(o,o,[i,i]);var s=Od();w3(s,e,t);var l=Od();return b3(l,s,o),l}function FA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=e0(r),i=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(o,o)}function O3(r,e){r.drawSelectionRectangle(e,function(t){return FA(r,t)})}function q3(r){var e=r.data.contexts[r.NODE];e.save(),FA(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()}function N3(r){var e=function(a,i,o){for(var s=a.atlasManager.getAtlasCollection(i),l=r.data.contexts[r.NODE],u=s.atlases,c=0;c<u.length;c++){var d=u[c],h=d.canvas;if(h){var g=h.width,p=h.height,E=g*c,m=h.height*o,b=.4;l.save(),l.scale(b,b),l.drawImage(h,E,m),l.strokeStyle="black",l.rect(E,m,g,p),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function F3(r,e,t,n,a){var i,o,s,l,u=e0(r),c=u.pan,d=u.zoom;{var h=f3(r,c,d,e,t),g=Yr(h,2),p=g[0],E=g[1],m=6;i=p-m/2,o=E-m/2,s=m,l=m}if(s===0||l===0)return[];var b=r.data.contexts[r.WEBGL];b.bindFramebuffer(b.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(b.viewport(0,0,b.canvas.width,b.canvas.height),zA(r,null,Zo.PICKING),r.pickingFrameBuffer.needsDraw=!1);var w=s*l,x=new Uint8Array(w*4);b.readPixels(i,o,s,l,b.RGBA,b.UNSIGNED_BYTE,x),b.bindFramebuffer(b.FRAMEBUFFER,null);for(var C=new Set,T=0;T<w;T++){var S=x.slice(T*4,T*4+4),_=v3(S)-1;_>=0&&C.add(_)}return C}function z3(r,e,t){var n=F3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=$t(n),l;try{for(s.s();!(l=s.n()).done;){var u=l.value,c=a[u];if(!i&&c.isNode()&&(i=c),!o&&c.isEdge()&&(o=c),i&&o)break}}catch(d){s.e(d)}finally{s.f()}return[i,o].filter(Boolean)}function $d(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 zA(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]&&O3(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=L3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)$d(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)$d(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)$d(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(q3(r),N3(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=!1,p=Math.ceil(h-n),E=a.getDebugInfo(),m=["".concat(i," elements"),"".concat(E.totalInstances," instances"),"".concat(E.batchCount," batches"),"".concat(E.totalAtlases," atlases"),"".concat(E.wrappedCount," wrapped textures"),"".concat(E.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(p,"ms, ").concat(m));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(m)),console.log("Texture Atlases Used:");var b=E.atlasInfo,w=$t(b),x;try{for(w.s();!(x=w.n()).done;){var C=x.value;console.log(" ".concat(C.type,": ").concat(C.keyCount," keys, ").concat(C.atlasCount," atlases"))}}catch(T){w.e(T)}finally{w.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}var Fa={};Fa.drawPolygonPath=function(r,e,t,n,a,i){var o=n/2,s=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var l=1;l<i.length/2;l++)r.lineTo(e+o*i[l*2],t+s*i[l*2+1]);r.closePath()};Fa.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return xA(r,s)}),r.closePath()};Fa.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Aa(n,a):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,l),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.arcTo(e-o,t-s,e,t-s,l),r.lineTo(e,t-s),r.closePath()};Fa.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?Aa(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,l),r.arcTo(e-o,t+s,e-o,t,l),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};Fa.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?zm():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+u,t-l),r.lineTo(e+s-u,t-l),r.lineTo(e+s,t-l+u),r.lineTo(e+s,t+l-u),r.lineTo(e+s-u,t+l),r.lineTo(e-s+u,t+l),r.lineTo(e-s,t+l-u),r.lineTo(e-s,t-l+u),r.closePath()};Fa.drawBarrelPath=function(r,e,t,n,a){var i=n/2,o=a/2,s=e-i,l=e+i,u=t-o,c=t+o,d=cm(n,a),h=d.widthOffset,g=d.heightOffset,p=d.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,u+g),r.lineTo(s,c-g),r.quadraticCurveTo(s+p,c,s+h,c),r.lineTo(l-h,c),r.quadraticCurveTo(l-p,c,l,c-g),r.lineTo(l,u+g),r.quadraticCurveTo(l-p,u,l-h,u),r.lineTo(s+h,u),r.quadraticCurveTo(s+p,u,s,u+g),r.closePath()};var hE=Math.sin(0),gE=Math.cos(0),Tm={},Rm={},$A=Math.PI/40;for(var Wi=0*Math.PI;Wi<2*Math.PI;Wi+=$A)Tm[Wi]=Math.sin(Wi),Rm[Wi]=Math.cos(Wi);Fa.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,o,s=n/2,l=a/2,u=0*Math.PI;u<2*Math.PI;u+=$A)i=e-s*Tm[u]*hE+s*Rm[u]*gE,o=t+l*Rm[u]*hE+l*Tm[u]*gE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var _s={};_s.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};_s.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],o=r.full?Math.ceil(n.h):a[3],s=ke(r.maxWidth)||ke(r.maxHeight),l=this.getPixelRatio(),u=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,u=r.scale;else if(s){var c=1/0,d=1/0;ke(r.maxWidth)&&(c=u*r.maxWidth/i),ke(r.maxHeight)&&(d=u*r.maxHeight/o),u=Math.min(c,d),i*=u,o*=u}s||(i*=l,o*=l,u*=l);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var g=h.getContext("2d");if(i>0&&o>0){g.clearRect(0,0,i,o),g.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*u,-n.y1*u),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(n.x1*u,n.y1*u);else{var E=e.pan(),m={x:E.x*u,y:E.y*u};u*=e.zoom(),g.translate(m.x,m.y),g.scale(u,u),this.drawElements(g,p),g.scale(1/u,1/u),g.translate(-m.x,-m.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function $3(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})}function pE(r){var e=r.indexOf(",");return r.substr(e+1)}function VA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new oo(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return $3(pE(n()),t);case"base64":return pE(n());case"base64uri":default:return n()}}_s.png=function(r){return VA(r,this.bufferCanvasImage(r),"image/png")};_s.jpg=function(r){return VA(r,this.bufferCanvasImage(r),"image/jpeg")};var GA={};GA.nodeShapeImpl=function(r,e,t,n,a,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,s);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}};var V3=WA,fr=WA.prototype;fr.CANVAS_LAYERS=3;fr.SELECT_BOX=0;fr.DRAG=1;fr.NODE=2;fr.WEBGL=3;fr.CANVAS_TYPES=["2d","2d","2d","webgl2"];fr.BUFFER_COUNT=3;fr.TEXTURE_BUFFER=0;fr.MOTIONBLUR_BUFFER_NODE=1;fr.MOTIONBLUR_BUFFER_DRAG=2;function WA(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(fr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(fr.CANVAS_LAYERS),contexts:new Array(fr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(fr.CANVAS_LAYERS),bufferCanvases:new Array(fr.BUFFER_COUNT),bufferContexts:new Array(fr.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.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"};Oq()&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<fr.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=fr.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||Lr("Could not create canvas of type "+d),Object.keys(l).forEach(function(se){c.style[se]=l[se]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(fr.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[fr.NODE].setAttribute("data-id","layer"+fr.NODE+"-node"),e.data.canvases[fr.SELECT_BOX].setAttribute("data-id","layer"+fr.SELECT_BOX+"-selectbox"),e.data.canvases[fr.DRAG].setAttribute("data-id","layer"+fr.DRAG+"-drag"),e.data.canvases[fr.WEBGL]&&e.data.canvases[fr.WEBGL].setAttribute("data-id","layer"+fr.WEBGL+"-webgl");for(var u=0;u<fr.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 h=Bt(),g=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},p=function(Z){return{x:-Z.w/2,y:-Z.h/2}},E=function(Z){var Q=Z[0]._private,ae=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ae},m=function(Z){return Z[0]._private.nodeKey},b=function(Z){return Z[0]._private.labelStyleKey},w=function(Z){return Z[0]._private.sourceLabelStyleKey},x=function(Z){return Z[0]._private.targetLabelStyleKey},C=function(Z,Q,ae,ne,de){return e.drawElement(Z,Q,ae,!1,!1,de)},T=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"main",de)},S=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"source",de)},_=function(Z,Q,ae,ne,de){return e.drawElementText(Z,Q,ae,ne,"target",de)},A=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},P=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||h},D=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||h},I=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||h},M=function(Z,Q){return Q},k=function(Z){return g(A(Z))},N=function(Z,Q,ae){var ne=Z?Z+"-":"";return{x:Q.x+ae.pstyle(ne+"text-margin-x").pfValue,y:Q.y+ae.pstyle(ne+"text-margin-y").pfValue}},z=function(Z,Q,ae){var ne=Z[0]._private.rscratch;return{x:ne[Q],y:ne[ae]}},W=function(Z){return N("",z(Z,"labelX","labelY"),Z)},q=function(Z){return N("source",z(Z,"sourceLabelX","sourceLabelY"),Z)},$=function(Z){return N("target",z(Z,"targetLabelX","targetLabelY"),Z)},X=function(Z){return p(A(Z))},Y=function(Z){return p(D(Z))},K=function(Z){return p(I(Z))},ee=function(Z){var Q=P(Z),ae=p(P(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":ae.x=-Q.w-(Q.leftPad||0);break;case"right":ae.x=-(Q.rightPad||0);break}switch(Z.pstyle("text-valign").value){case"top":ae.y=-Q.h-(Q.topPad||0);break;case"bottom":ae.y=-(Q.botPad||0);break}}return ae},le=e.data.eleTxrCache=new Vo(e,{getKey:m,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:k,getRotationOffset:X,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),G=e.data.lblTxrCache=new Vo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:W,getRotationOffset:ee,isVisible:M}),V=e.data.slbTxrCache=new Vo(e,{getKey:w,drawElement:S,getBoundingBox:D,getRotationPoint:q,getRotationOffset:Y,isVisible:M}),j=e.data.tlbTxrCache=new Vo(e,{getKey:x,drawElement:_,getBoundingBox:I,getRotationPoint:$,getRotationOffset:K,isVisible:M}),re=e.data.lyrTxrCache=new IA(e);e.onUpdateEleCalcs(function(Z,Q){le.invalidateElements(Q),G.invalidateElements(Q),V.invalidateElements(Q),j.invalidateElements(Q),re.invalidateElements(Q);for(var ae=0;ae<Q.length;ae++){var ne=Q[ae]._private;ne.oldBackgroundTimestamp=ne.backgroundTimestamp}});var ce=function(Z){for(var Q=0;Q<Z.length;Q++)re.enqueueElementRefinement(Z[Q].ele)};le.onDequeue(ce),G.onDequeue(ce),V.onDequeue(ce),j.onDequeue(ce),r.webgl&&e.initWebgl(r,{getStyleKey:m,getLabelKey:b,getSourceLabelKey:w,getTargetLabelKey:x,drawElement:C,drawLabel:T,drawSourceLabel:S,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:D,getTargetLabelBox:I,getElementRotationPoint:k,getElementRotationOffset:X,getLabelRotationPoint:W,getSourceLabelRotationPoint:q,getTargetLabelRotationPoint:$,getLabelRotationOffset:ee,getSourceLabelRotationOffset:Y,getTargetLabelRotationOffset:K})}fr.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[fr.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[fr.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[fr.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var G3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return G3&&this.pathsEnabled};fr.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};fr.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};fr.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":tt(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),a=n.document;t=a.createElement("canvas"),t.width=r,t.height=e}return t};[BA,On,ra,Jm,di,Na,kt,qA,Fa,_s,GA].forEach(function(r){Ye(fr,r)});var W3=[{name:"null",impl:mA},{name:"base",impl:AA},{name:"canvas",impl:V3}],U3=[{type:"layout",extensions:p$},{type:"renderer",extensions:W3}],UA={},HA={};function KA(r,e,t){var n=t,a=function(A){Er("Can not register `"+e+"` for `"+r+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(us.prototype[e])return a(e);us.prototype[e]=t}else if(r==="collection"){if(pt.prototype[e])return a(e);pt.prototype[e]=t}else if(r==="layout"){for(var i=function(A){this.options=A,t.call(this,A),pr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],l=0;l<s.length;l++){var u=s[l];o[u]=o[u]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var c=t.prototype.stop;o.stop=function(){var _=this.options;if(_&&_.animate){var A=this.animations;if(A)for(var P=0;P<A.length;P++)A[P].stop()}return c?c.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var d=function(A){return A._private.cy},h={addEventFields:function(A,P){P.layout=A,P.cy=d(A),P.target=A},bubble:function(){return!0},parent:function(A){return d(A)}};Ye(o,{createEmitter:function(){return this._private.emitter=new bl(h,this),this},emitter:function(){return this._private.emitter},on:function(A,P){return this.emitter().on(A,P),this},one:function(A,P){return this.emitter().one(A,P),this},once:function(A,P){return this.emitter().one(A,P),this},removeListener:function(A,P){return this.emitter().removeListener(A,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,P){return this.emitter().emit(A,P),this}}),xr.eventAliasesOn(o),n=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=jA("renderer","base"),p=g.prototype,E=t,m=t.prototype,b=function(){g.apply(this,arguments),E.apply(this,arguments)},w=b.prototype;for(var x in p){var C=p[x],T=m[x]!=null;if(T)return a(x);w[x]=C}for(var S in m)w[S]=m[S];p.clientFunctions.forEach(function(_){w[_]=w[_]||function(){Lr("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=b}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Lr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return dR({map:UA,keys:[r,e],value:n})}function jA(r,e){return vR({map:UA,keys:[r,e]})}function H3(r,e,t,n,a){return dR({map:HA,keys:[r,e,t,n],value:a})}function K3(r,e,t,n){return vR({map:HA,keys:[r,e,t,n]})}var Am=function(){if(arguments.length===2)return jA.apply(null,arguments);if(arguments.length===3)return KA.apply(null,arguments);if(arguments.length===4)return K3.apply(null,arguments);if(arguments.length===5)return H3.apply(null,arguments);Lr("Invalid extension access syntax")};us.prototype.extension=Am;U3.forEach(function(r){r.extensions.forEach(function(e){KA(r.type,e.name,e.impl)})});var il=function(){if(!(this instanceof il))return new il;this.length=0},fi=il.prototype;fi.instanceString=function(){return"stylesheet"};fi.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};fi.css=function(r,e){var t=this.length-1;if(Ke(r))this[t].properties.push({name:r,value:e});else if(pr(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var l=st.properties[o]||st.properties[ll(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};fi.style=fi.css;fi.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};fi.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,a=t.properties;r.selector(n);for(var i=0;i<a.length;i++){var o=a[i];r.css(o.name,o.value)}}return r};var j3="3.33.1",ln=function(e){if(e===void 0&&(e={}),pr(e))return new us(e);if(Ke(e))return Am.apply(Am,arguments)};ln.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(ln),r.apply(null,e),this};ln.warnings=function(r){return wR(r)};ln.version=j3;ln.stylesheet=ln.Stylesheet=il;var Ct=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Gu={exports:{}};function r0(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vd,yE;function Y3(){if(yE)return Vd;yE=1;function r(){this.__data__=[],this.size=0}return Vd=r,Vd}var Gd,mE;function co(){if(mE)return Gd;mE=1;function r(e,t){return e===t||e!==e&&t!==t}return Gd=r,Gd}var Wd,bE;function Al(){if(bE)return Wd;bE=1;var r=co();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return Wd=e,Wd}var Ud,wE;function Z3(){if(wE)return Ud;wE=1;var r=Al(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return Ud=n,Ud}var Hd,xE;function X3(){if(xE)return Hd;xE=1;var r=Al();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Hd=e,Hd}var Kd,EE;function Q3(){if(EE)return Kd;EE=1;var r=Al();function e(t){return r(this.__data__,t)>-1}return Kd=e,Kd}var jd,CE;function J3(){if(CE)return jd;CE=1;var r=Al();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}return jd=e,jd}var Yd,_E;function Pl(){if(_E)return Yd;_E=1;var r=Y3(),e=Z3(),t=X3(),n=Q3(),a=J3();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];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,Yd=i,Yd}var Zd,SE;function eV(){if(SE)return Zd;SE=1;var r=Pl();function e(){this.__data__=new r,this.size=0}return Zd=e,Zd}var Xd,TE;function rV(){if(TE)return Xd;TE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return Xd=r,Xd}var Qd,RE;function tV(){if(RE)return Qd;RE=1;function r(e){return this.__data__.get(e)}return Qd=r,Qd}var Jd,AE;function nV(){if(AE)return Jd;AE=1;function r(e){return this.__data__.has(e)}return Jd=r,Jd}var ev,PE;function YA(){if(PE)return ev;PE=1;var r=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct;return ev=r,ev}var rv,DE;function Cn(){if(DE)return rv;DE=1;var r=YA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return rv=t,rv}var tv,IE;function vo(){if(IE)return tv;IE=1;var r=Cn(),e=r.Symbol;return tv=e,tv}var nv,BE;function aV(){if(BE)return nv;BE=1;var r=vo(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,a=r?r.toStringTag:void 0;function i(o){var s=t.call(o,a),l=o[a];try{o[a]=void 0;var u=!0}catch{}var c=n.call(o);return u&&(s?o[a]=l:delete o[a]),c}return nv=i,nv}var av,kE;function iV(){if(kE)return av;kE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return av=t,av}var iv,ME;function vi(){if(ME)return iv;ME=1;var r=vo(),e=aV(),t=iV(),n="[object Null]",a="[object Undefined]",i=r?r.toStringTag:void 0;function o(s){return s==null?s===void 0?a:n:i&&i in Object(s)?e(s):t(s)}return iv=o,iv}var ov,LE;function cn(){if(LE)return ov;LE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return ov=r,ov}var sv,OE;function Ss(){if(OE)return sv;OE=1;var r=vi(),e=cn(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var l=r(s);return l==n||l==a||l==t||l==i}return sv=o,sv}var uv,qE;function oV(){if(qE)return uv;qE=1;var r=Cn(),e=r["__core-js_shared__"];return uv=e,uv}var lv,NE;function sV(){if(NE)return lv;NE=1;var r=oV(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return lv=t,lv}var fv,FE;function ZA(){if(FE)return fv;FE=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return fv=t,fv}var cv,zE;function uV(){if(zE)return cv;zE=1;var r=Ss(),e=sV(),t=cn(),n=ZA(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,l=o.toString,u=s.hasOwnProperty,c=RegExp("^"+l.call(u).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?c:i;return g.test(n(h))}return cv=d,cv}var dv,$E;function lV(){if($E)return dv;$E=1;function r(e,t){return e==null?void 0:e[t]}return dv=r,dv}var vv,VE;function hi(){if(VE)return vv;VE=1;var r=uV(),e=lV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return vv=t,vv}var hv,GE;function t0(){if(GE)return hv;GE=1;var r=hi(),e=Cn(),t=r(e,"Map");return hv=t,hv}var gv,WE;function Dl(){if(WE)return gv;WE=1;var r=hi(),e=r(Object,"create");return gv=e,gv}var pv,UE;function fV(){if(UE)return pv;UE=1;var r=Dl();function e(){this.__data__=r?r(null):{},this.size=0}return pv=e,pv}var yv,HE;function cV(){if(HE)return yv;HE=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return yv=r,yv}var mv,KE;function dV(){if(KE)return mv;KE=1;var r=Dl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return mv=a,mv}var bv,jE;function vV(){if(jE)return bv;jE=1;var r=Dl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return bv=n,bv}var wv,YE;function hV(){if(YE)return wv;YE=1;var r=Dl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return wv=t,wv}var xv,ZE;function gV(){if(ZE)return xv;ZE=1;var r=fV(),e=cV(),t=dV(),n=vV(),a=hV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];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,xv=i,xv}var Ev,XE;function pV(){if(XE)return Ev;XE=1;var r=gV(),e=Pl(),t=t0();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Ev=n,Ev}var Cv,QE;function yV(){if(QE)return Cv;QE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Cv=r,Cv}var _v,JE;function Il(){if(JE)return _v;JE=1;var r=yV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return _v=e,_v}var Sv,eC;function mV(){if(eC)return Sv;eC=1;var r=Il();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return Sv=e,Sv}var Tv,rC;function bV(){if(rC)return Tv;rC=1;var r=Il();function e(t){return r(this,t).get(t)}return Tv=e,Tv}var Rv,tC;function wV(){if(tC)return Rv;tC=1;var r=Il();function e(t){return r(this,t).has(t)}return Rv=e,Rv}var Av,nC;function xV(){if(nC)return Av;nC=1;var r=Il();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}return Av=e,Av}var Pv,aC;function n0(){if(aC)return Pv;aC=1;var r=pV(),e=mV(),t=bV(),n=wV(),a=xV();function i(o){var s=-1,l=o==null?0:o.length;for(this.clear();++s<l;){var u=o[s];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,Pv=i,Pv}var Dv,iC;function EV(){if(iC)return Dv;iC=1;var r=Pl(),e=t0(),t=n0(),n=200;function a(i,o){var s=this.__data__;if(s instanceof r){var l=s.__data__;if(!e||l.length<n-1)return l.push([i,o]),this.size=++s.size,this;s=this.__data__=new t(l)}return s.set(i,o),this.size=s.size,this}return Dv=a,Dv}var Iv,oC;function Bl(){if(oC)return Iv;oC=1;var r=Pl(),e=eV(),t=rV(),n=tV(),a=nV(),i=EV();function o(s){var l=this.__data__=new r(s);this.size=l.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Iv=o,Iv}var Bv,sC;function a0(){if(sC)return Bv;sC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e}return Bv=r,Bv}var kv,uC;function XA(){if(uC)return kv;uC=1;var r=hi(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return kv=e,kv}var Mv,lC;function kl(){if(lC)return Mv;lC=1;var r=XA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Mv=e,Mv}var Lv,fC;function Ml(){if(fC)return Lv;fC=1;var r=kl(),e=co(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var l=i[o];(!(n.call(i,o)&&e(l,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Lv=a,Lv}var Ov,cC;function Ts(){if(cC)return Ov;cC=1;var r=Ml(),e=kl();function t(n,a,i,o){var s=!i;i||(i={});for(var l=-1,u=a.length;++l<u;){var c=a[l],d=o?o(i[c],n[c],c,i,n):void 0;d===void 0&&(d=n[c]),s?e(i,c,d):r(i,c,d)}return i}return Ov=t,Ov}var qv,dC;function CV(){if(dC)return qv;dC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return qv=r,qv}var Nv,vC;function qn(){if(vC)return Nv;vC=1;function r(e){return e!=null&&typeof e=="object"}return Nv=r,Nv}var Fv,hC;function _V(){if(hC)return Fv;hC=1;var r=vi(),e=qn(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return Fv=n,Fv}var zv,gC;function Rs(){if(gC)return zv;gC=1;var r=_V(),e=qn(),t=Object.prototype,n=t.hasOwnProperty,a=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return zv=i,zv}var $v,pC;function Zr(){if(pC)return $v;pC=1;var r=Array.isArray;return $v=r,$v}var Go={exports:{}},Vv,yC;function SV(){if(yC)return Vv;yC=1;function r(){return!1}return Vv=r,Vv}Go.exports;var mC;function ho(){return mC||(mC=1,(function(r,e){var t=Cn(),n=SV(),a=e&&!e.nodeType&&e,i=a&&!0&&r&&!r.nodeType&&r,o=i&&i.exports===a,s=o?t.Buffer:void 0,l=s?s.isBuffer:void 0,u=l||n;r.exports=u})(Go,Go.exports)),Go.exports}var Gv,bC;function Ll(){if(bC)return Gv;bC=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return Gv=t,Gv}var Wv,wC;function i0(){if(wC)return Wv;wC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return Wv=e,Wv}var Uv,xC;function TV(){if(xC)return Uv;xC=1;var r=vi(),e=i0(),t=qn(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",h="[object RegExp]",g="[object Set]",p="[object String]",E="[object WeakMap]",m="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",x="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",S="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",D="[object Uint32Array]",I={};I[w]=I[x]=I[C]=I[T]=I[S]=I[_]=I[A]=I[P]=I[D]=!0,I[n]=I[a]=I[m]=I[i]=I[b]=I[o]=I[s]=I[l]=I[u]=I[c]=I[d]=I[h]=I[g]=I[p]=I[E]=!1;function M(k){return t(k)&&e(k.length)&&!!I[r(k)]}return Uv=M,Uv}var Hv,EC;function Ol(){if(EC)return Hv;EC=1;function r(e){return function(t){return e(t)}}return Hv=r,Hv}var Wo={exports:{}};Wo.exports;var CC;function o0(){return CC||(CC=1,(function(r,e){var t=YA(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i&&t.process,s=(function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}})();r.exports=s})(Wo,Wo.exports)),Wo.exports}var Kv,_C;function As(){if(_C)return Kv;_C=1;var r=TV(),e=Ol(),t=o0(),n=t&&t.isTypedArray,a=n?e(n):r;return Kv=a,Kv}var jv,SC;function QA(){if(SC)return jv;SC=1;var r=CV(),e=Rs(),t=Zr(),n=ho(),a=Ll(),i=As(),o=Object.prototype,s=o.hasOwnProperty;function l(u,c){var d=t(u),h=!d&&e(u),g=!d&&!h&&n(u),p=!d&&!h&&!g&&i(u),E=d||h||g||p,m=E?r(u.length,String):[],b=m.length;for(var w in u)(c||s.call(u,w))&&!(E&&(w=="length"||g&&(w=="offset"||w=="parent")||p&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&m.push(w);return m}return jv=l,jv}var Yv,TC;function ql(){if(TC)return Yv;TC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Yv=e,Yv}var Zv,RC;function JA(){if(RC)return Zv;RC=1;function r(e,t){return function(n){return e(t(n))}}return Zv=r,Zv}var Xv,AC;function RV(){if(AC)return Xv;AC=1;var r=JA(),e=r(Object.keys,Object);return Xv=e,Xv}var Qv,PC;function s0(){if(PC)return Qv;PC=1;var r=ql(),e=RV(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!r(i))return e(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return Qv=a,Qv}var Jv,DC;function ta(){if(DC)return Jv;DC=1;var r=Ss(),e=i0();function t(n){return n!=null&&e(n.length)&&!r(n)}return Jv=t,Jv}var eh,IC;function za(){if(IC)return eh;IC=1;var r=QA(),e=s0(),t=ta();function n(a){return t(a)?r(a):e(a)}return eh=n,eh}var rh,BC;function AV(){if(BC)return rh;BC=1;var r=Ts(),e=za();function t(n,a){return n&&r(a,e(a),n)}return rh=t,rh}var th,kC;function PV(){if(kC)return th;kC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return th=r,th}var nh,MC;function DV(){if(MC)return nh;MC=1;var r=cn(),e=ql(),t=PV(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!r(o))return t(o);var s=e(o),l=[];for(var u in o)u=="constructor"&&(s||!a.call(o,u))||l.push(u);return l}return nh=i,nh}var ah,LC;function gi(){if(LC)return ah;LC=1;var r=QA(),e=DV(),t=ta();function n(a){return t(a)?r(a,!0):e(a)}return ah=n,ah}var ih,OC;function IV(){if(OC)return ih;OC=1;var r=Ts(),e=gi();function t(n,a){return n&&r(a,e(a),n)}return ih=t,ih}var Uo={exports:{}};Uo.exports;var qC;function eP(){return qC||(qC=1,(function(r,e){var t=Cn(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,h=s?s(d):new u.constructor(d);return u.copy(h),h}r.exports=l})(Uo,Uo.exports)),Uo.exports}var oh,NC;function rP(){if(NC)return oh;NC=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return oh=r,oh}var sh,FC;function tP(){if(FC)return sh;FC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}return sh=r,sh}var uh,zC;function nP(){if(zC)return uh;zC=1;function r(){return[]}return uh=r,uh}var lh,$C;function u0(){if($C)return lh;$C=1;var r=tP(),e=nP(),t=Object.prototype,n=t.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),r(a(o),function(s){return n.call(o,s)}))}:e;return lh=i,lh}var fh,VC;function BV(){if(VC)return fh;VC=1;var r=Ts(),e=u0();function t(n,a){return r(n,e(n),a)}return fh=t,fh}var ch,GC;function l0(){if(GC)return ch;GC=1;function r(e,t){for(var n=-1,a=t.length,i=e.length;++n<a;)e[i+n]=t[n];return e}return ch=r,ch}var dh,WC;function Nl(){if(WC)return dh;WC=1;var r=JA(),e=r(Object.getPrototypeOf,Object);return dh=e,dh}var vh,UC;function aP(){if(UC)return vh;UC=1;var r=l0(),e=Nl(),t=u0(),n=nP(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return vh=i,vh}var hh,HC;function kV(){if(HC)return hh;HC=1;var r=Ts(),e=aP();function t(n,a){return r(n,e(n),a)}return hh=t,hh}var gh,KC;function iP(){if(KC)return gh;KC=1;var r=l0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return gh=t,gh}var ph,jC;function oP(){if(jC)return ph;jC=1;var r=iP(),e=u0(),t=za();function n(a){return r(a,t,e)}return ph=n,ph}var yh,YC;function MV(){if(YC)return yh;YC=1;var r=iP(),e=aP(),t=gi();function n(a){return r(a,t,e)}return yh=n,yh}var mh,ZC;function LV(){if(ZC)return mh;ZC=1;var r=hi(),e=Cn(),t=r(e,"DataView");return mh=t,mh}var bh,XC;function OV(){if(XC)return bh;XC=1;var r=hi(),e=Cn(),t=r(e,"Promise");return bh=t,bh}var wh,QC;function sP(){if(QC)return wh;QC=1;var r=hi(),e=Cn(),t=r(e,"Set");return wh=t,wh}var xh,JC;function qV(){if(JC)return xh;JC=1;var r=hi(),e=Cn(),t=r(e,"WeakMap");return xh=t,xh}var Eh,e_;function go(){if(e_)return Eh;e_=1;var r=LV(),e=t0(),t=OV(),n=sP(),a=qV(),i=vi(),o=ZA(),s="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",h="[object DataView]",g=o(r),p=o(e),E=o(t),m=o(n),b=o(a),w=i;return(r&&w(new r(new ArrayBuffer(1)))!=h||e&&w(new e)!=s||t&&w(t.resolve())!=u||n&&w(new n)!=c||a&&w(new a)!=d)&&(w=function(x){var C=i(x),T=C==l?x.constructor:void 0,S=T?o(T):"";if(S)switch(S){case g:return h;case p:return s;case E:return u;case m:return c;case b:return d}return C}),Eh=w,Eh}var Ch,r_;function NV(){if(r_)return Ch;r_=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return Ch=t,Ch}var _h,t_;function uP(){if(t_)return _h;t_=1;var r=Cn(),e=r.Uint8Array;return _h=e,_h}var Sh,n_;function f0(){if(n_)return Sh;n_=1;var r=uP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return Sh=e,Sh}var Th,a_;function FV(){if(a_)return Th;a_=1;var r=f0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return Th=e,Th}var Rh,i_;function zV(){if(i_)return Rh;i_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Rh=e,Rh}var Ah,o_;function $V(){if(o_)return Ah;o_=1;var r=vo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Ah=n,Ah}var Ph,s_;function lP(){if(s_)return Ph;s_=1;var r=f0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return Ph=e,Ph}var Dh,u_;function VV(){if(u_)return Dh;u_=1;var r=f0(),e=FV(),t=zV(),n=$V(),a=lP(),i="[object Boolean]",o="[object Date]",s="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",h="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",E="[object Float32Array]",m="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",x="[object Int32Array]",C="[object Uint8Array]",T="[object Uint8ClampedArray]",S="[object Uint16Array]",_="[object Uint32Array]";function A(P,D,I){var M=P.constructor;switch(D){case g:return r(P);case i:case o:return new M(+P);case p:return e(P,I);case E:case m:case b:case w:case x:case C:case T:case S:case _:return a(P,I);case s:return new M;case l:case d:return new M(P);case u:return t(P);case c:return new M;case h:return n(P)}}return Dh=A,Dh}var Ih,l_;function fP(){if(l_)return Ih;l_=1;var r=cn(),e=Object.create,t=(function(){function n(){}return function(a){if(!r(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}})();return Ih=t,Ih}var Bh,f_;function cP(){if(f_)return Bh;f_=1;var r=fP(),e=Nl(),t=ql();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Bh=n,Bh}var kh,c_;function GV(){if(c_)return kh;c_=1;var r=go(),e=qn(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return kh=n,kh}var Mh,d_;function WV(){if(d_)return Mh;d_=1;var r=GV(),e=Ol(),t=o0(),n=t&&t.isMap,a=n?e(n):r;return Mh=a,Mh}var Lh,v_;function UV(){if(v_)return Lh;v_=1;var r=go(),e=qn(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Lh=n,Lh}var Oh,h_;function HV(){if(h_)return Oh;h_=1;var r=UV(),e=Ol(),t=o0(),n=t&&t.isSet,a=n?e(n):r;return Oh=a,Oh}var qh,g_;function dP(){if(g_)return qh;g_=1;var r=Bl(),e=a0(),t=Ml(),n=AV(),a=IV(),i=eP(),o=rP(),s=BV(),l=kV(),u=oP(),c=MV(),d=go(),h=NV(),g=VV(),p=cP(),E=Zr(),m=ho(),b=WV(),w=cn(),x=HV(),C=za(),T=gi(),S=1,_=2,A=4,P="[object Arguments]",D="[object Array]",I="[object Boolean]",M="[object Date]",k="[object Error]",N="[object Function]",z="[object GeneratorFunction]",W="[object Map]",q="[object Number]",$="[object Object]",X="[object RegExp]",Y="[object Set]",K="[object String]",ee="[object Symbol]",le="[object WeakMap]",G="[object ArrayBuffer]",V="[object DataView]",j="[object Float32Array]",re="[object Float64Array]",ce="[object Int8Array]",se="[object Int16Array]",Z="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",ne="[object Uint16Array]",de="[object Uint32Array]",Ce={};Ce[P]=Ce[D]=Ce[G]=Ce[V]=Ce[I]=Ce[M]=Ce[j]=Ce[re]=Ce[ce]=Ce[se]=Ce[Z]=Ce[W]=Ce[q]=Ce[$]=Ce[X]=Ce[Y]=Ce[K]=Ce[ee]=Ce[Q]=Ce[ae]=Ce[ne]=Ce[de]=!0,Ce[k]=Ce[N]=Ce[le]=!1;function ve(U,fe,we,ge,me,Re){var Ie,Be=fe&S,Oe=fe&_,He=fe&A;if(we&&(Ie=me?we(U,ge,me,Re):we(U)),Ie!==void 0)return Ie;if(!w(U))return U;var Ve=E(U);if(Ve){if(Ie=h(U),!Be)return o(U,Ie)}else{var Xe=d(U),er=Xe==N||Xe==z;if(m(U))return i(U,Be);if(Xe==$||Xe==P||er&&!me){if(Ie=Oe||er?{}:p(U),!Be)return Oe?l(U,a(Ie,U)):s(U,n(Ie,U))}else{if(!Ce[Xe])return me?U:{};Ie=g(U,Xe,Be)}}Re||(Re=new r);var $e=Re.get(U);if($e)return $e;Re.set(U,Ie),x(U)?U.forEach(function(L){Ie.add(ve(L,fe,we,L,U,Re))}):b(U)&&U.forEach(function(L,oe){Ie.set(oe,ve(L,fe,we,oe,U,Re))});var Me=He?Oe?c:u:Oe?T:C,pe=Ve?void 0:Me(U);return e(pe||U,function(L,oe){pe&&(oe=L,L=U[oe]),t(Ie,oe,ve(L,fe,we,oe,U,Re))}),Ie}return qh=ve,qh}var Nh,p_;function KV(){if(p_)return Nh;p_=1;var r=dP(),e=4;function t(n){return r(n,e)}return Nh=t,Nh}var Fh,y_;function c0(){if(y_)return Fh;y_=1;function r(e){return function(){return e}}return Fh=r,Fh}var zh,m_;function jV(){if(m_)return zh;m_=1;function r(e){return function(t,n,a){for(var i=-1,o=Object(t),s=a(t),l=s.length;l--;){var u=s[e?l:++i];if(n(o[u],u,o)===!1)break}return t}}return zh=r,zh}var $h,b_;function d0(){if(b_)return $h;b_=1;var r=jV(),e=r();return $h=e,$h}var Vh,w_;function v0(){if(w_)return Vh;w_=1;var r=d0(),e=za();function t(n,a){return n&&r(n,a,e)}return Vh=t,Vh}var Gh,x_;function YV(){if(x_)return Gh;x_=1;var r=ta();function e(t,n){return function(a,i){if(a==null)return a;if(!r(a))return t(a,i);for(var o=a.length,s=n?o:-1,l=Object(a);(n?s--:++s<o)&&i(l[s],s,l)!==!1;);return a}}return Gh=e,Gh}var Wh,E_;function Fl(){if(E_)return Wh;E_=1;var r=v0(),e=YV(),t=e(r);return Wh=t,Wh}var Uh,C_;function pi(){if(C_)return Uh;C_=1;function r(e){return e}return Uh=r,Uh}var Hh,__;function vP(){if(__)return Hh;__=1;var r=pi();function e(t){return typeof t=="function"?t:r}return Hh=e,Hh}var Kh,S_;function hP(){if(S_)return Kh;S_=1;var r=a0(),e=Fl(),t=vP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Kh=a,Kh}var jh,T_;function gP(){return T_||(T_=1,jh=hP()),jh}var Yh,R_;function ZV(){if(R_)return Yh;R_=1;var r=Fl();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Yh=e,Yh}var Zh,A_;function XV(){if(A_)return Zh;A_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Zh=e,Zh}var Xh,P_;function QV(){if(P_)return Xh;P_=1;function r(e){return this.__data__.has(e)}return Xh=r,Xh}var Qh,D_;function pP(){if(D_)return Qh;D_=1;var r=n0(),e=XV(),t=QV();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new r;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,Qh=n,Qh}var Jh,I_;function JV(){if(I_)return Jh;I_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1}return Jh=r,Jh}var eg,B_;function yP(){if(B_)return eg;B_=1;function r(e,t){return e.has(t)}return eg=r,eg}var rg,k_;function mP(){if(k_)return rg;k_=1;var r=pP(),e=JV(),t=yP(),n=1,a=2;function i(o,s,l,u,c,d){var h=l&n,g=o.length,p=s.length;if(g!=p&&!(h&&p>g))return!1;var E=d.get(o),m=d.get(s);if(E&&m)return E==s&&m==o;var b=-1,w=!0,x=l&a?new r:void 0;for(d.set(o,s),d.set(s,o);++b<g;){var C=o[b],T=s[b];if(u)var S=h?u(T,C,b,s,o,d):u(C,T,b,o,s,d);if(S!==void 0){if(S)continue;w=!1;break}if(x){if(!e(s,function(_,A){if(!t(x,A)&&(C===_||c(C,_,l,u,d)))return x.push(A)})){w=!1;break}}else if(!(C===T||c(C,T,l,u,d))){w=!1;break}}return d.delete(o),d.delete(s),w}return rg=i,rg}var tg,M_;function e4(){if(M_)return tg;M_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return tg=r,tg}var ng,L_;function h0(){if(L_)return ng;L_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return ng=r,ng}var ag,O_;function r4(){if(O_)return ag;O_=1;var r=vo(),e=uP(),t=co(),n=mP(),a=e4(),i=h0(),o=1,s=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",h="[object Number]",g="[object RegExp]",p="[object Set]",E="[object String]",m="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",x=r?r.prototype:void 0,C=x?x.valueOf:void 0;function T(S,_,A,P,D,I,M){switch(A){case w:if(S.byteLength!=_.byteLength||S.byteOffset!=_.byteOffset)return!1;S=S.buffer,_=_.buffer;case b:return!(S.byteLength!=_.byteLength||!I(new e(S),new e(_)));case l:case u:case h:return t(+S,+_);case c:return S.name==_.name&&S.message==_.message;case g:case E:return S==_+"";case d:var k=a;case p:var N=P&o;if(k||(k=i),S.size!=_.size&&!N)return!1;var z=M.get(S);if(z)return z==_;P|=s,M.set(S,_);var W=n(k(S),k(_),P,D,I,M);return M.delete(S),W;case m:if(C)return C.call(S)==C.call(_)}return!1}return ag=T,ag}var ig,q_;function t4(){if(q_)return ig;q_=1;var r=oP(),e=1,t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s,l,u,c){var d=s&e,h=r(i),g=h.length,p=r(o),E=p.length;if(g!=E&&!d)return!1;for(var m=g;m--;){var b=h[m];if(!(d?b in o:n.call(o,b)))return!1}var w=c.get(i),x=c.get(o);if(w&&x)return w==o&&x==i;var C=!0;c.set(i,o),c.set(o,i);for(var T=d;++m<g;){b=h[m];var S=i[b],_=o[b];if(l)var A=d?l(_,S,b,o,i,c):l(S,_,b,i,o,c);if(!(A===void 0?S===_||u(S,_,s,l,c):A)){C=!1;break}T||(T=b=="constructor")}if(C&&!T){var P=i.constructor,D=o.constructor;P!=D&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof D=="function"&&D instanceof D)&&(C=!1)}return c.delete(i),c.delete(o),C}return ig=a,ig}var og,N_;function n4(){if(N_)return og;N_=1;var r=Bl(),e=mP(),t=r4(),n=t4(),a=go(),i=Zr(),o=ho(),s=As(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(E,m,b,w,x,C){var T=i(E),S=i(m),_=T?c:a(E),A=S?c:a(m);_=_==u?d:_,A=A==u?d:A;var P=_==d,D=A==d,I=_==A;if(I&&o(E)){if(!o(m))return!1;T=!0,P=!1}if(I&&!P)return C||(C=new r),T||s(E)?e(E,m,b,w,x,C):t(E,m,_,b,w,x,C);if(!(b&l)){var M=P&&g.call(E,"__wrapped__"),k=D&&g.call(m,"__wrapped__");if(M||k){var N=M?E.value():E,z=k?m.value():m;return C||(C=new r),x(N,z,b,w,C)}}return I?(C||(C=new r),n(E,m,b,w,x,C)):!1}return og=p,og}var sg,F_;function bP(){if(F_)return sg;F_=1;var r=n4(),e=qn();function t(n,a,i,o,s){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:r(n,a,i,o,t,s)}return sg=t,sg}var ug,z_;function a4(){if(z_)return ug;z_=1;var r=Bl(),e=bP(),t=1,n=2;function a(i,o,s,l){var u=s.length,c=u,d=!l;if(i==null)return!c;for(i=Object(i);u--;){var h=s[u];if(d&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++u<c;){h=s[u];var g=h[0],p=i[g],E=h[1];if(d&&h[2]){if(p===void 0&&!(g in i))return!1}else{var m=new r;if(l)var b=l(p,E,g,i,o,m);if(!(b===void 0?e(E,p,t|n,l,m):b))return!1}}return!0}return ug=a,ug}var lg,$_;function wP(){if($_)return lg;$_=1;var r=cn();function e(t){return t===t&&!r(t)}return lg=e,lg}var fg,V_;function i4(){if(V_)return fg;V_=1;var r=wP(),e=za();function t(n){for(var a=e(n),i=a.length;i--;){var o=a[i],s=n[o];a[i]=[o,s,r(s)]}return a}return fg=t,fg}var cg,G_;function xP(){if(G_)return cg;G_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return cg=r,cg}var dg,W_;function o4(){if(W_)return dg;W_=1;var r=a4(),e=i4(),t=xP();function n(a){var i=e(a);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(o){return o===a||r(o,a,i)}}return dg=n,dg}var vg,U_;function po(){if(U_)return vg;U_=1;var r=vi(),e=qn(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return vg=n,vg}var hg,H_;function g0(){if(H_)return hg;H_=1;var r=Zr(),e=po(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return hg=a,hg}var gg,K_;function s4(){if(K_)return gg;K_=1;var r=n0(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],l=i.cache;if(l.has(s))return l.get(s);var u=n.apply(this,o);return i.cache=l.set(s,u)||l,u};return i.cache=new(t.Cache||r),i}return t.Cache=r,gg=t,gg}var pg,j_;function u4(){if(j_)return pg;j_=1;var r=s4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return pg=t,pg}var yg,Y_;function l4(){if(Y_)return yg;Y_=1;var r=u4(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,l,u){i.push(l?u.replace(t,"$1"):s||o)}),i});return yg=n,yg}var mg,Z_;function zl(){if(Z_)return mg;Z_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return mg=r,mg}var bg,X_;function f4(){if(X_)return bg;X_=1;var r=vo(),e=zl(),t=Zr(),n=po(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var l=s+"";return l=="0"&&1/s==-1/0?"-0":l}return bg=o,bg}var wg,Q_;function EP(){if(Q_)return wg;Q_=1;var r=f4();function e(t){return t==null?"":r(t)}return wg=e,wg}var xg,J_;function $l(){if(J_)return xg;J_=1;var r=Zr(),e=g0(),t=l4(),n=EP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return xg=a,xg}var Eg,eS;function Ps(){if(eS)return Eg;eS=1;var r=po();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return Eg=e,Eg}var Cg,rS;function Vl(){if(rS)return Cg;rS=1;var r=$l(),e=Ps();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Cg=t,Cg}var _g,tS;function c4(){if(tS)return _g;tS=1;var r=Vl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return _g=e,_g}var Sg,nS;function d4(){if(nS)return Sg;nS=1;function r(e,t){return e!=null&&t in Object(e)}return Sg=r,Sg}var Tg,aS;function CP(){if(aS)return Tg;aS=1;var r=$l(),e=Rs(),t=Zr(),n=Ll(),a=i0(),i=Ps();function o(s,l,u){l=r(l,s);for(var c=-1,d=l.length,h=!1;++c<d;){var g=i(l[c]);if(!(h=s!=null&&u(s,g)))break;s=s[g]}return h||++c!=d?h:(d=s==null?0:s.length,!!d&&a(d)&&n(g,d)&&(t(s)||e(s)))}return Tg=o,Tg}var Rg,iS;function _P(){if(iS)return Rg;iS=1;var r=d4(),e=CP();function t(n,a){return n!=null&&e(n,a,r)}return Rg=t,Rg}var Ag,oS;function v4(){if(oS)return Ag;oS=1;var r=bP(),e=c4(),t=_P(),n=g0(),a=wP(),i=xP(),o=Ps(),s=1,l=2;function u(c,d){return n(c)&&a(d)?i(o(c),d):function(h){var g=e(h,c);return g===void 0&&g===d?t(h,c):r(d,g,s|l)}}return Ag=u,Ag}var Pg,sS;function SP(){if(sS)return Pg;sS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return Pg=r,Pg}var Dg,uS;function h4(){if(uS)return Dg;uS=1;var r=Vl();function e(t){return function(n){return r(n,t)}}return Dg=e,Dg}var Ig,lS;function g4(){if(lS)return Ig;lS=1;var r=SP(),e=h4(),t=g0(),n=Ps();function a(i){return t(i)?r(n(i)):e(i)}return Ig=a,Ig}var Bg,fS;function na(){if(fS)return Bg;fS=1;var r=o4(),e=v4(),t=pi(),n=Zr(),a=g4();function i(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):r(o):a(o)}return Bg=i,Bg}var kg,cS;function TP(){if(cS)return kg;cS=1;var r=tP(),e=ZV(),t=na(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return kg=a,kg}var Mg,dS;function p4(){if(dS)return Mg;dS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Mg=t,Mg}var Lg,vS;function RP(){if(vS)return Lg;vS=1;var r=p4(),e=CP();function t(n,a){return n!=null&&e(n,a,r)}return Lg=t,Lg}var Og,hS;function y4(){if(hS)return Og;hS=1;var r=s0(),e=go(),t=Rs(),n=Zr(),a=ta(),i=ho(),o=ql(),s=As(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function h(g){if(g==null)return!0;if(a(g)&&(n(g)||typeof g=="string"||typeof g.splice=="function"||i(g)||s(g)||t(g)))return!g.length;var p=e(g);if(p==l||p==u)return!g.size;if(o(g))return!r(g).length;for(var E in g)if(d.call(g,E))return!1;return!0}return Og=h,Og}var qg,gS;function AP(){if(gS)return qg;gS=1;function r(e){return e===void 0}return qg=r,qg}var Ng,pS;function PP(){if(pS)return Ng;pS=1;var r=Fl(),e=ta();function t(n,a){var i=-1,o=e(n)?Array(n.length):[];return r(n,function(s,l,u){o[++i]=a(s,l,u)}),o}return Ng=t,Ng}var Fg,yS;function DP(){if(yS)return Fg;yS=1;var r=zl(),e=na(),t=PP(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return Fg=a,Fg}var zg,mS;function m4(){if(mS)return zg;mS=1;function r(e,t,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}return zg=r,zg}var $g,bS;function b4(){if(bS)return $g;bS=1;function r(e,t,n,a,i){return i(e,function(o,s,l){n=a?(a=!1,o):t(n,o,s,l)}),n}return $g=r,$g}var Vg,wS;function IP(){if(wS)return Vg;wS=1;var r=m4(),e=Fl(),t=na(),n=b4(),a=Zr();function i(o,s,l){var u=a(o)?r:n,c=arguments.length<3;return u(o,t(s,4),l,c,e)}return Vg=i,Vg}var Gg,xS;function w4(){if(xS)return Gg;xS=1;var r=vi(),e=Zr(),t=qn(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return Gg=a,Gg}var Wg,ES;function x4(){if(ES)return Wg;ES=1;var r=SP(),e=r("length");return Wg=e,Wg}var Ug,CS;function E4(){if(CS)return Ug;CS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+a+i+"]");function l(u){return s.test(u)}return Ug=l,Ug}var Hg,_S;function C4(){if(_S)return Hg;_S=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="["+r+"]",s="["+a+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+s+"|"+l+")",c="[^"+r+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",p=u+"?",E="["+i+"]?",m="(?:"+g+"(?:"+[c,d,h].join("|")+")"+E+p+")*",b=E+p+m,w="(?:"+[c+s+"?",s,d,h,o].join("|")+")",x=RegExp(l+"(?="+l+")|"+w+b,"g");function C(T){for(var S=x.lastIndex=0;x.test(T);)++S;return S}return Hg=C,Hg}var Kg,SS;function _4(){if(SS)return Kg;SS=1;var r=x4(),e=E4(),t=C4();function n(a){return e(a)?t(a):r(a)}return Kg=n,Kg}var jg,TS;function S4(){if(TS)return jg;TS=1;var r=s0(),e=go(),t=ta(),n=w4(),a=_4(),i="[object Map]",o="[object Set]";function s(l){if(l==null)return 0;if(t(l))return n(l)?a(l):l.length;var u=e(l);return u==i||u==o?l.size:r(l).length}return jg=s,jg}var Yg,RS;function T4(){if(RS)return Yg;RS=1;var r=a0(),e=fP(),t=v0(),n=na(),a=Nl(),i=Zr(),o=ho(),s=Ss(),l=cn(),u=As();function c(d,h,g){var p=i(d),E=p||o(d)||u(d);if(h=n(h,4),g==null){var m=d&&d.constructor;E?g=p?new m:[]:l(d)?g=s(m)?e(a(d)):{}:g={}}return(E?r:t)(d,function(b,w,x){return h(g,b,w,x)}),g}return Yg=c,Yg}var Zg,AS;function R4(){if(AS)return Zg;AS=1;var r=vo(),e=Rs(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Zg=a,Zg}var Xg,PS;function p0(){if(PS)return Xg;PS=1;var r=l0(),e=R4();function t(n,a,i,o,s){var l=-1,u=n.length;for(i||(i=e),s||(s=[]);++l<u;){var c=n[l];a>0&&i(c)?a>1?t(c,a-1,i,o,s):r(s,c):o||(s[s.length]=c)}return s}return Xg=t,Xg}var Qg,DS;function A4(){if(DS)return Qg;DS=1;function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return Qg=r,Qg}var Jg,IS;function BP(){if(IS)return Jg;IS=1;var r=A4(),e=Math.max;function t(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,l=e(o.length-a,0),u=Array(l);++s<l;)u[s]=o[a+s];s=-1;for(var c=Array(a+1);++s<a;)c[s]=o[s];return c[a]=i(u),r(n,this,c)}}return Jg=t,Jg}var ep,BS;function P4(){if(BS)return ep;BS=1;var r=c0(),e=XA(),t=pi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return ep=n,ep}var rp,kS;function D4(){if(kS)return rp;kS=1;var r=800,e=16,t=Date.now;function n(a){var i=0,o=0;return function(){var s=t(),l=e-(s-o);if(o=s,l>0){if(++i>=r)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return rp=n,rp}var tp,MS;function kP(){if(MS)return tp;MS=1;var r=P4(),e=D4(),t=e(r);return tp=t,tp}var np,LS;function Gl(){if(LS)return np;LS=1;var r=pi(),e=BP(),t=kP();function n(a,i){return t(e(a,i,r),a+"")}return np=n,np}var ap,OS;function MP(){if(OS)return ap;OS=1;function r(e,t,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return ap=r,ap}var ip,qS;function I4(){if(qS)return ip;qS=1;function r(e){return e!==e}return ip=r,ip}var op,NS;function B4(){if(NS)return op;NS=1;function r(e,t,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}return op=r,op}var sp,FS;function k4(){if(FS)return sp;FS=1;var r=MP(),e=I4(),t=B4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return sp=n,sp}var up,zS;function M4(){if(zS)return up;zS=1;var r=k4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return up=e,up}var lp,$S;function L4(){if($S)return lp;$S=1;function r(e,t,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(t,e[a]))return!0;return!1}return lp=r,lp}var fp,VS;function O4(){if(VS)return fp;VS=1;function r(){}return fp=r,fp}var cp,GS;function q4(){if(GS)return cp;GS=1;var r=sP(),e=O4(),t=h0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return cp=a,cp}var dp,WS;function N4(){if(WS)return dp;WS=1;var r=pP(),e=M4(),t=L4(),n=yP(),a=q4(),i=h0(),o=200;function s(l,u,c){var d=-1,h=e,g=l.length,p=!0,E=[],m=E;if(c)p=!1,h=t;else if(g>=o){var b=u?null:a(l);if(b)return i(b);p=!1,h=n,m=new r}else m=u?[]:E;e:for(;++d<g;){var w=l[d],x=u?u(w):w;if(w=c||w!==0?w:0,p&&x===x){for(var C=m.length;C--;)if(m[C]===x)continue e;u&&m.push(x),E.push(w)}else h(m,x,c)||(m!==E&&m.push(x),E.push(w))}return E}return dp=s,dp}var vp,US;function LP(){if(US)return vp;US=1;var r=ta(),e=qn();function t(n){return e(n)&&r(n)}return vp=t,vp}var hp,HS;function F4(){if(HS)return hp;HS=1;var r=p0(),e=Gl(),t=N4(),n=LP(),a=e(function(i){return t(r(i,1,n,!0))});return hp=a,hp}var gp,KS;function z4(){if(KS)return gp;KS=1;var r=zl();function e(t,n){return r(n,function(a){return t[a]})}return gp=e,gp}var pp,jS;function OP(){if(jS)return pp;jS=1;var r=z4(),e=za();function t(n){return n==null?[]:r(n,e(n))}return pp=t,pp}var yp,YS;function dn(){if(YS)return yp;YS=1;var r;if(typeof r0=="function")try{r={clone:KV(),constant:c0(),each:gP(),filter:TP(),has:RP(),isArray:Zr(),isEmpty:y4(),isFunction:Ss(),isUndefined:AP(),keys:za(),map:DP(),reduce:IP(),size:S4(),transform:T4(),union:F4(),values:OP()}}catch{}return r||(r=window._),yp=r,yp}var mp,ZS;function y0(){if(ZS)return mp;ZS=1;var r=dn();mp=a;var e="\0",t="\0",n="";function a(c){this._isDirected=r.has(c,"directed")?c.directed:!0,this._isMultigraph=r.has(c,"multigraph")?c.multigraph:!1,this._isCompound=r.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(c){return this._label=c,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultNodeLabelFn=c,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._in[d])})},a.prototype.sinks=function(){var c=this;return r.filter(this.nodes(),function(d){return r.isEmpty(c._out[d])})},a.prototype.setNodes=function(c,d){var h=arguments,g=this;return r.each(c,function(p){h.length>1?g.setNode(p,d):g.setNode(p)}),this},a.prototype.setNode=function(c,d){return r.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=t,this._children[c]={},this._children[t][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},a.prototype.node=function(c){return this._nodes[c]},a.prototype.hasNode=function(c){return r.has(this._nodes,c)},a.prototype.removeNode=function(c){var d=this;if(r.has(this._nodes,c)){var h=function(g){d.removeEdge(d._edgeObjs[g])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],r.each(this.children(c),function(g){d.setParent(g)}),delete this._children[c]),r.each(r.keys(this._in[c]),h),delete this._in[c],delete this._preds[c],r.each(r.keys(this._out[c]),h),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},a.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(d))d=t;else{d+="";for(var h=d;!r.isUndefined(h);h=this.parent(h))if(h===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},a.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},a.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==t)return d}},a.prototype.children=function(c){if(r.isUndefined(c)&&(c=t),this._isCompound){var d=this._children[c];if(d)return r.keys(d)}else{if(c===t)return this.nodes();if(this.hasNode(c))return[]}},a.prototype.predecessors=function(c){var d=this._preds[c];if(d)return r.keys(d)},a.prototype.successors=function(c){var d=this._sucs[c];if(d)return r.keys(d)},a.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return r.union(d,this.successors(c))},a.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},a.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;r.each(this._nodes,function(E,m){c(m)&&d.setNode(m,E)}),r.each(this._edgeObjs,function(E){d.hasNode(E.v)&&d.hasNode(E.w)&&d.setEdge(E,h.edge(E))});var g={};function p(E){var m=h.parent(E);return m===void 0||d.hasNode(m)?(g[E]=m,m):m in g?g[m]:p(m)}return this._isCompound&&r.each(d.nodes(),function(E){d.setParent(E,p(E))}),d},a.prototype.setDefaultEdgeLabel=function(c){return r.isFunction(c)||(c=r.constant(c)),this._defaultEdgeLabelFn=c,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(c,d){var h=this,g=arguments;return r.reduce(c,function(p,E){return g.length>1?h.setEdge(p,E,d):h.setEdge(p,E),E}),this},a.prototype.setEdge=function(){var c,d,h,g,p=!1,E=arguments[0];typeof E=="object"&&E!==null&&"v"in E?(c=E.v,d=E.w,h=E.name,arguments.length===2&&(g=arguments[1],p=!0)):(c=E,d=arguments[1],h=arguments[3],arguments.length>2&&(g=arguments[2],p=!0)),c=""+c,d=""+d,r.isUndefined(h)||(h=""+h);var m=s(this._isDirected,c,d,h);if(r.has(this._edgeLabels,m))return p&&(this._edgeLabels[m]=g),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[m]=p?g:this._defaultEdgeLabelFn(c,d,h);var b=l(this._isDirected,c,d,h);return c=b.v,d=b.w,Object.freeze(b),this._edgeObjs[m]=b,i(this._preds[d],c),i(this._sucs[c],d),this._in[d][m]=b,this._out[c][m]=b,this._edgeCount++,this},a.prototype.edge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return this._edgeLabels[g]},a.prototype.hasEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h);return r.has(this._edgeLabels,g)},a.prototype.removeEdge=function(c,d,h){var g=arguments.length===1?u(this._isDirected,arguments[0]):s(this._isDirected,c,d,h),p=this._edgeObjs[g];return p&&(c=p.v,d=p.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[d],c),o(this._sucs[c],d),delete this._in[d][g],delete this._out[c][g],this._edgeCount--),this},a.prototype.inEdges=function(c,d){var h=this._in[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.v===d}):g}},a.prototype.outEdges=function(c,d){var h=this._out[c];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.w===d}):g}},a.prototype.nodeEdges=function(c,d){var h=this.inEdges(c,d);if(h)return h.concat(this.outEdges(c,d))};function i(c,d){c[d]?c[d]++:c[d]=1}function o(c,d){--c[d]||delete c[d]}function s(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var m=p;p=E,E=m}return p+n+E+n+(r.isUndefined(g)?e:g)}function l(c,d,h,g){var p=""+d,E=""+h;if(!c&&p>E){var m=p;p=E,E=m}var b={v:p,w:E};return g&&(b.name=g),b}function u(c,d){return s(c,d.v,d.w,d.name)}return mp}var bp,XS;function $4(){return XS||(XS=1,bp="2.1.8"),bp}var wp,QS;function V4(){return QS||(QS=1,wp={Graph:y0(),version:$4()}),wp}var xp,JS;function G4(){if(JS)return xp;JS=1;var r=dn(),e=y0();xp={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return r.isUndefined(o.graph())||(s.value=r.clone(o.graph())),s}function n(o){return r.map(o.nodes(),function(s){var l=o.node(s),u=o.parent(s),c={v:s};return r.isUndefined(l)||(c.value=l),r.isUndefined(u)||(c.parent=u),c})}function a(o){return r.map(o.edges(),function(s){var l=o.edge(s),u={v:s.v,w:s.w};return r.isUndefined(s.name)||(u.name=s.name),r.isUndefined(l)||(u.value=l),u})}function i(o){var s=new e(o.options).setGraph(o.value);return r.each(o.nodes,function(l){s.setNode(l.v,l.value),l.parent&&s.setParent(l.v,l.parent)}),r.each(o.edges,function(l){s.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),s}return xp}var Ep,eT;function W4(){if(eT)return Ep;eT=1;var r=dn();Ep=e;function e(t){var n={},a=[],i;function o(s){r.has(n,s)||(n[s]=!0,i.push(s),r.each(t.successors(s),o),r.each(t.predecessors(s),o))}return r.each(t.nodes(),function(s){i=[],o(s),i.length&&a.push(i)}),a}return Ep}var Cp,rT;function qP(){if(rT)return Cp;rT=1;var r=dn();Cp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var a=this._keyIndices;if(t=String(t),!r.has(a,t)){var i=this._arr,o=i.length;return a[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var a=this._keyIndices[t];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(t){var n=this._arr,a=2*t,i=a+1,o=t;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var n=this._arr,a=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<a));)this._swap(t,i),t=i},e.prototype._swap=function(t,n){var a=this._arr,i=this._keyIndices,o=a[t],s=a[n];a[t]=s,a[n]=o,i[s.key]=t,i[o.key]=n},Cp}var _p,tT;function NP(){if(tT)return _p;tT=1;var r=dn(),e=qP();_p=n;var t=r.constant(1);function n(i,o,s,l){return a(i,String(o),s||t,l||function(u){return i.outEdges(u)})}function a(i,o,s,l){var u={},c=new e,d,h,g=function(p){var E=p.v!==d?p.v:p.w,m=u[E],b=s(p),w=h.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+b);w<m.distance&&(m.distance=w,m.predecessor=d,c.decrease(E,w))};for(i.nodes().forEach(function(p){var E=p===o?0:Number.POSITIVE_INFINITY;u[p]={distance:E},c.add(p,E)});c.size()>0&&(d=c.removeMin(),h=u[d],h.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(g);return u}return _p}var Sp,nT;function U4(){if(nT)return Sp;nT=1;var r=NP(),e=dn();Sp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return Sp}var Tp,aT;function FP(){if(aT)return Tp;aT=1;var r=dn();Tp=e;function e(t){var n=0,a=[],i={},o=[];function s(l){var u=i[l]={onStack:!0,lowlink:n,index:n++};if(a.push(l),t.successors(l).forEach(function(h){r.has(i,h)?i[h].onStack&&(u.lowlink=Math.min(u.lowlink,i[h].index)):(s(h),u.lowlink=Math.min(u.lowlink,i[h].lowlink))}),u.lowlink===u.index){var c=[],d;do d=a.pop(),i[d].onStack=!1,c.push(d);while(l!==d);o.push(c)}}return t.nodes().forEach(function(l){r.has(i,l)||s(l)}),o}return Tp}var Rp,iT;function H4(){if(iT)return Rp;iT=1;var r=dn(),e=FP();Rp=t;function t(n){return r.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return Rp}var Ap,oT;function K4(){if(oT)return Ap;oT=1;var r=dn();Ap=t;var e=r.constant(1);function t(a,i,o){return n(a,i||e,o||function(s){return a.outEdges(s)})}function n(a,i,o){var s={},l=a.nodes();return l.forEach(function(u){s[u]={},s[u][u]={distance:0},l.forEach(function(c){u!==c&&(s[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var d=c.v===u?c.w:c.v,h=i(c);s[u][d]={distance:h,predecessor:u}})}),l.forEach(function(u){var c=s[u];l.forEach(function(d){var h=s[d];l.forEach(function(g){var p=h[u],E=c[g],m=h[g],b=p.distance+E.distance;b<m.distance&&(m.distance=b,m.predecessor=E.predecessor)})})}),s}return Ap}var Pp,sT;function zP(){if(sT)return Pp;sT=1;var r=dn();Pp=e,e.CycleException=t;function e(n){var a={},i={},o=[];function s(l){if(r.has(i,l))throw new t;r.has(a,l)||(i[l]=!0,a[l]=!0,r.each(n.predecessors(l),s),delete i[l],o.push(l))}if(r.each(n.sinks(),s),r.size(a)!==n.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Pp}var Dp,uT;function j4(){if(uT)return Dp;uT=1;var r=zP();Dp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Dp}var Ip,lT;function $P(){if(lT)return Ip;lT=1;var r=dn();Ip=e;function e(n,a,i){r.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],l={};return r.each(a,function(u){if(!n.hasNode(u))throw new Error("Graph does not have node: "+u);t(n,u,i==="post",l,o,s)}),s}function t(n,a,i,o,s,l){r.has(o,a)||(o[a]=!0,i||l.push(a),r.each(s(a),function(u){t(n,u,i,o,s,l)}),i&&l.push(a))}return Ip}var Bp,fT;function Y4(){if(fT)return Bp;fT=1;var r=$P();Bp=e;function e(t,n){return r(t,n,"post")}return Bp}var kp,cT;function Z4(){if(cT)return kp;cT=1;var r=$P();kp=e;function e(t,n){return r(t,n,"pre")}return kp}var Mp,dT;function X4(){if(dT)return Mp;dT=1;var r=dn(),e=y0(),t=qP();Mp=n;function n(a,i){var o=new e,s={},l=new t,u;function c(h){var g=h.v===u?h.w:h.v,p=l.priority(g);if(p!==void 0){var E=i(h);E<p&&(s[g]=u,l.decrease(g,E))}}if(a.nodeCount()===0)return o;r.each(a.nodes(),function(h){l.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),l.decrease(a.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),r.has(s,u))o.setEdge(u,s[u]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(u).forEach(c)}return o}return Mp}var Lp,vT;function Q4(){return vT||(vT=1,Lp={components:W4(),dijkstra:NP(),dijkstraAll:U4(),findCycles:H4(),floydWarshall:K4(),isAcyclic:j4(),postorder:Y4(),preorder:Z4(),prim:X4(),tarjan:FP(),topsort:zP()}),Lp}var Op,hT;function J4(){if(hT)return Op;hT=1;var r=V4();return Op={Graph:r.Graph,json:G4(),alg:Q4(),version:r.version},Op}var qp,gT;function En(){if(gT)return qp;gT=1;var r;if(typeof r0=="function")try{r=J4()}catch{}return r||(r=window.graphlib),qp=r,qp}var Np,pT;function eG(){if(pT)return Np;pT=1;var r=dP(),e=1,t=4;function n(a){return r(a,e|t)}return Np=n,Np}var Fp,yT;function Wl(){if(yT)return Fp;yT=1;var r=co(),e=ta(),t=Ll(),n=cn();function a(i,o,s){if(!n(s))return!1;var l=typeof o;return(l=="number"?e(s)&&t(o,s.length):l=="string"&&o in s)?r(s[o],i):!1}return Fp=a,Fp}var zp,mT;function rG(){if(mT)return zp;mT=1;var r=Gl(),e=co(),t=Wl(),n=gi(),a=Object.prototype,i=a.hasOwnProperty,o=r(function(s,l){s=Object(s);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&t(l[0],l[1],d)&&(c=1);++u<c;)for(var h=l[u],g=n(h),p=-1,E=g.length;++p<E;){var m=g[p],b=s[m];(b===void 0||e(b,a[m])&&!i.call(s,m))&&(s[m]=h[m])}return s});return zp=o,zp}var $p,bT;function tG(){if(bT)return $p;bT=1;var r=na(),e=ta(),t=za();function n(a){return function(i,o,s){var l=Object(i);if(!e(i)){var u=r(o,3);i=t(i),o=function(d){return u(l[d],d,l)}}var c=a(i,o,s);return c>-1?l[u?i[c]:c]:void 0}}return $p=n,$p}var Vp,wT;function nG(){if(wT)return Vp;wT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Vp=e,Vp}var Gp,xT;function aG(){if(xT)return Gp;xT=1;var r=nG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Gp=t,Gp}var Wp,ET;function iG(){if(ET)return Wp;ET=1;var r=aG(),e=cn(),t=po(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=r(u);var d=i.test(u);return d||o.test(u)?s(u.slice(2),d?2:8):a.test(u)?n:+u}return Wp=l,Wp}var Up,CT;function VP(){if(CT)return Up;CT=1;var r=iG(),e=1/0,t=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=r(a),a===e||a===-e){var i=a<0?-1:1;return i*t}return a===a?a:0}return Up=n,Up}var Hp,_T;function oG(){if(_T)return Hp;_T=1;var r=VP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return Hp=e,Hp}var Kp,ST;function sG(){if(ST)return Kp;ST=1;var r=MP(),e=na(),t=oG(),n=Math.max;function a(i,o,s){var l=i==null?0:i.length;if(!l)return-1;var u=s==null?0:t(s);return u<0&&(u=n(l+u,0)),r(i,e(o,3),u)}return Kp=a,Kp}var jp,TT;function uG(){if(TT)return jp;TT=1;var r=tG(),e=sG(),t=r(e);return jp=t,jp}var Yp,RT;function GP(){if(RT)return Yp;RT=1;var r=p0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Yp=e,Yp}var Zp,AT;function lG(){if(AT)return Zp;AT=1;var r=d0(),e=vP(),t=gi();function n(a,i){return a==null?a:r(a,e(i),t)}return Zp=n,Zp}var Xp,PT;function fG(){if(PT)return Xp;PT=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return Xp=r,Xp}var Qp,DT;function cG(){if(DT)return Qp;DT=1;var r=kl(),e=v0(),t=na();function n(a,i){var o={};return i=t(i,3),e(a,function(s,l,u){r(o,l,i(s,l,u))}),o}return Qp=n,Qp}var Jp,IT;function m0(){if(IT)return Jp;IT=1;var r=po();function e(t,n,a){for(var i=-1,o=t.length;++i<o;){var s=t[i],l=n(s);if(l!=null&&(u===void 0?l===l&&!r(l):a(l,u)))var u=l,c=s}return c}return Jp=e,Jp}var ey,BT;function dG(){if(BT)return ey;BT=1;function r(e,t){return e>t}return ey=r,ey}var ry,kT;function vG(){if(kT)return ry;kT=1;var r=m0(),e=dG(),t=pi();function n(a){return a&&a.length?r(a,t,e):void 0}return ry=n,ry}var ty,MT;function WP(){if(MT)return ty;MT=1;var r=kl(),e=co();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return ty=t,ty}var ny,LT;function hG(){if(LT)return ny;LT=1;var r=vi(),e=Nl(),t=qn(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,l=o.call(Object);function u(c){if(!t(c)||r(c)!=n)return!1;var d=e(c);if(d===null)return!0;var h=s.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==l}return ny=u,ny}var ay,OT;function UP(){if(OT)return ay;OT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ay=r,ay}var iy,qT;function gG(){if(qT)return iy;qT=1;var r=Ts(),e=gi();function t(n){return r(n,e(n))}return iy=t,iy}var oy,NT;function pG(){if(NT)return oy;NT=1;var r=WP(),e=eP(),t=lP(),n=rP(),a=cP(),i=Rs(),o=Zr(),s=LP(),l=ho(),u=Ss(),c=cn(),d=hG(),h=As(),g=UP(),p=gG();function E(m,b,w,x,C,T,S){var _=g(m,w),A=g(b,w),P=S.get(A);if(P){r(m,w,P);return}var D=T?T(_,A,w+"",m,b,S):void 0,I=D===void 0;if(I){var M=o(A),k=!M&&l(A),N=!M&&!k&&h(A);D=A,M||k||N?o(_)?D=_:s(_)?D=n(_):k?(I=!1,D=e(A,!0)):N?(I=!1,D=t(A,!0)):D=[]:d(A)||i(A)?(D=_,i(_)?D=p(_):(!c(_)||u(_))&&(D=a(A))):I=!1}I&&(S.set(A,D),C(D,A,x,T,S),S.delete(A)),r(m,w,D)}return oy=E,oy}var sy,FT;function yG(){if(FT)return sy;FT=1;var r=Bl(),e=WP(),t=d0(),n=pG(),a=cn(),i=gi(),o=UP();function s(l,u,c,d,h){l!==u&&t(u,function(g,p){if(h||(h=new r),a(g))n(l,u,p,c,s,d,h);else{var E=d?d(o(l,p),g,p+"",l,u,h):void 0;E===void 0&&(E=g),e(l,p,E)}},i)}return sy=s,sy}var uy,zT;function mG(){if(zT)return uy;zT=1;var r=Gl(),e=Wl();function t(n){return r(function(a,i){var o=-1,s=i.length,l=s>1?i[s-1]:void 0,u=s>2?i[2]:void 0;for(l=n.length>3&&typeof l=="function"?(s--,l):void 0,u&&e(i[0],i[1],u)&&(l=s<3?void 0:l,s=1),a=Object(a);++o<s;){var c=i[o];c&&n(a,c,o,l)}return a})}return uy=t,uy}var ly,$T;function bG(){if($T)return ly;$T=1;var r=yG(),e=mG(),t=e(function(n,a,i){r(n,a,i)});return ly=t,ly}var fy,VT;function HP(){if(VT)return fy;VT=1;function r(e,t){return e<t}return fy=r,fy}var cy,GT;function wG(){if(GT)return cy;GT=1;var r=m0(),e=HP(),t=pi();function n(a){return a&&a.length?r(a,t,e):void 0}return cy=n,cy}var dy,WT;function xG(){if(WT)return dy;WT=1;var r=m0(),e=na(),t=HP();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return dy=n,dy}var vy,UT;function EG(){if(UT)return vy;UT=1;var r=Cn(),e=function(){return r.Date.now()};return vy=e,vy}var hy,HT;function CG(){if(HT)return hy;HT=1;var r=Ml(),e=$l(),t=Ll(),n=cn(),a=Ps();function i(o,s,l,u){if(!n(o))return o;s=e(s,o);for(var c=-1,d=s.length,h=d-1,g=o;g!=null&&++c<d;){var p=a(s[c]),E=l;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(c!=h){var m=g[p];E=u?u(m,p,g):void 0,E===void 0&&(E=n(m)?m:t(s[c+1])?[]:{})}r(g,p,E),g=g[p]}return o}return hy=i,hy}var gy,KT;function _G(){if(KT)return gy;KT=1;var r=Vl(),e=CG(),t=$l();function n(a,i,o){for(var s=-1,l=i.length,u={};++s<l;){var c=i[s],d=r(a,c);o(d,c)&&e(u,t(c,a),d)}return u}return gy=n,gy}var py,jT;function SG(){if(jT)return py;jT=1;var r=_G(),e=_P();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return py=t,py}var yy,YT;function TG(){if(YT)return yy;YT=1;var r=GP(),e=BP(),t=kP();function n(a){return t(e(a,void 0,r),a+"")}return yy=n,yy}var my,ZT;function RG(){if(ZT)return my;ZT=1;var r=SG(),e=TG(),t=e(function(n,a){return n==null?{}:r(n,a)});return my=t,my}var by,XT;function AG(){if(XT)return by;XT=1;var r=Math.ceil,e=Math.max;function t(n,a,i,o){for(var s=-1,l=e(r((a-n)/(i||1)),0),u=Array(l);l--;)u[o?l:++s]=n,n+=i;return u}return by=t,by}var wy,QT;function PG(){if(QT)return wy;QT=1;var r=AG(),e=Wl(),t=VP();function n(a){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=t(i),o===void 0?(o=i,i=0):o=t(o),s=s===void 0?i<o?1:-1:t(s),r(i,o,s,a)}}return wy=n,wy}var xy,JT;function DG(){if(JT)return xy;JT=1;var r=PG(),e=r();return xy=e,xy}var Ey,e2;function IG(){if(e2)return Ey;e2=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return Ey=r,Ey}var Cy,r2;function BG(){if(r2)return Cy;r2=1;var r=po();function e(t,n){if(t!==n){var a=t!==void 0,i=t===null,o=t===t,s=r(t),l=n!==void 0,u=n===null,c=n===n,d=r(n);if(!u&&!d&&!s&&t>n||s&&l&&c&&!u&&!d||i&&l&&c||!a&&c||!o)return 1;if(!i&&!s&&!d&&t<n||d&&a&&o&&!i&&!s||u&&a&&o||!l&&o||!c)return-1}return 0}return Cy=e,Cy}var _y,t2;function kG(){if(t2)return _y;t2=1;var r=BG();function e(t,n,a){for(var i=-1,o=t.criteria,s=n.criteria,l=o.length,u=a.length;++i<l;){var c=r(o[i],s[i]);if(c){if(i>=u)return c;var d=a[i];return c*(d=="desc"?-1:1)}}return t.index-n.index}return _y=e,_y}var Sy,n2;function MG(){if(n2)return Sy;n2=1;var r=zl(),e=Vl(),t=na(),n=PP(),a=IG(),i=Ol(),o=kG(),s=pi(),l=Zr();function u(c,d,h){d.length?d=r(d,function(E){return l(E)?function(m){return e(m,E.length===1?E[0]:E)}:E}):d=[s];var g=-1;d=r(d,i(t));var p=n(c,function(E,m,b){var w=r(d,function(x){return x(E)});return{criteria:w,index:++g,value:E}});return a(p,function(E,m){return o(E,m,h)})}return Sy=u,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1;var r=p0(),e=MG(),t=Gl(),n=Wl(),a=t(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,r(o,1),[])});return Ty=a,Ty}var Ry,i2;function OG(){if(i2)return Ry;i2=1;var r=EP(),e=0;function t(n){var a=++e;return r(n)+a}return Ry=t,Ry}var Ay,o2;function qG(){if(o2)return Ay;o2=1;function r(e,t,n){for(var a=-1,i=e.length,o=t.length,s={};++a<i;){var l=a<o?t[a]:void 0;n(s,e[a],l)}return s}return Ay=r,Ay}var Py,s2;function NG(){if(s2)return Py;s2=1;var r=Ml(),e=qG();function t(n,a){return e(n||[],a||[],r)}return Py=t,Py}var Dy,u2;function Or(){if(u2)return Dy;u2=1;var r;if(typeof r0=="function")try{r={cloneDeep:eG(),constant:c0(),defaults:rG(),each:gP(),filter:TP(),find:uG(),flatten:GP(),forEach:hP(),forIn:lG(),has:RP(),isUndefined:AP(),last:fG(),map:DP(),mapValues:cG(),max:vG(),merge:bG(),min:wG(),minBy:xG(),now:EG(),pick:RG(),range:DG(),reduce:IP(),sortBy:LG(),uniqueId:OG(),values:OP(),zipObject:NG()}}catch{}return r||(r=window._),Dy=r,Dy}var Iy,l2;function FG(){if(l2)return Iy;l2=1,Iy=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},r.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},r.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,a){if(n!=="_next"&&n!=="_prev")return a}return Iy}var By,f2;function zG(){if(f2)return By;f2=1;var r=Or(),e=En().Graph,t=FG();By=a;var n=r.constant(1);function a(u,c){if(u.nodeCount()<=1)return[];var d=s(u,c||n),h=i(d.graph,d.buckets,d.zeroIdx);return r.flatten(r.map(h,function(g){return u.outEdges(g.v,g.w)}),!0)}function i(u,c,d){for(var h=[],g=c[c.length-1],p=c[0],E;u.nodeCount();){for(;E=p.dequeue();)o(u,c,d,E);for(;E=g.dequeue();)o(u,c,d,E);if(u.nodeCount()){for(var m=c.length-2;m>0;--m)if(E=c[m].dequeue(),E){h=h.concat(o(u,c,d,E,!0));break}}}return h}function o(u,c,d,h,g){var p=g?[]:void 0;return r.forEach(u.inEdges(h.v),function(E){var m=u.edge(E),b=u.node(E.v);g&&p.push({v:E.v,w:E.w}),b.out-=m,l(c,d,b)}),r.forEach(u.outEdges(h.v),function(E){var m=u.edge(E),b=E.w,w=u.node(b);w.in-=m,l(c,d,w)}),u.removeNode(h.v),p}function s(u,c){var d=new e,h=0,g=0;r.forEach(u.nodes(),function(m){d.setNode(m,{v:m,in:0,out:0})}),r.forEach(u.edges(),function(m){var b=d.edge(m.v,m.w)||0,w=c(m),x=b+w;d.setEdge(m.v,m.w,x),g=Math.max(g,d.node(m.v).out+=w),h=Math.max(h,d.node(m.w).in+=w)});var p=r.range(g+h+3).map(function(){return new t}),E=h+1;return r.forEach(d.nodes(),function(m){l(p,E,d.node(m))}),{graph:d,buckets:p,zeroIdx:E}}function l(u,c,d){d.out?d.in?u[d.out-d.in+c].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}return By}var ky,c2;function $G(){if(c2)return ky;c2=1;var r=Or(),e=zG();ky={run:t,undo:a};function t(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):n(i);r.forEach(o,function(l){var u=i.edge(l);i.removeEdge(l),u.forwardName=l.name,u.reversed=!0,i.setEdge(l.w,l.v,u,r.uniqueId("rev"))});function s(l){return function(u){return l.edge(u).weight}}}function n(i){var o=[],s={},l={};function u(c){r.has(l,c)||(l[c]=!0,s[c]=!0,r.forEach(i.outEdges(c),function(d){r.has(s,d.w)?o.push(d):u(d.w)}),delete s[c])}return r.forEach(i.nodes(),u),o}function a(i){r.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var l=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,l)}})}return ky}var My,d2;function Vt(){if(d2)return My;d2=1;var r=Or(),e=En().Graph;My={addDummyNode:t,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:l,normalizeRanks:u,removeEmptyRanks:c,addBorderNode:d,maxRank:h,partition:g,time:p,notime:E};function t(m,b,w,x){var C;do C=r.uniqueId(x);while(m.hasNode(C));return w.dummy=b,m.setNode(C,w),C}function n(m){var b=new e().setGraph(m.graph());return r.forEach(m.nodes(),function(w){b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){var x=b.edge(w.v,w.w)||{weight:0,minlen:1},C=m.edge(w);b.setEdge(w.v,w.w,{weight:x.weight+C.weight,minlen:Math.max(x.minlen,C.minlen)})}),b}function a(m){var b=new e({multigraph:m.isMultigraph()}).setGraph(m.graph());return r.forEach(m.nodes(),function(w){m.children(w).length||b.setNode(w,m.node(w))}),r.forEach(m.edges(),function(w){b.setEdge(w,m.edge(w))}),b}function i(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.outEdges(w),function(C){x[C.w]=(x[C.w]||0)+m.edge(C).weight}),x});return r.zipObject(m.nodes(),b)}function o(m){var b=r.map(m.nodes(),function(w){var x={};return r.forEach(m.inEdges(w),function(C){x[C.v]=(x[C.v]||0)+m.edge(C).weight}),x});return r.zipObject(m.nodes(),b)}function s(m,b){var w=m.x,x=m.y,C=b.x-w,T=b.y-x,S=m.width/2,_=m.height/2;if(!C&&!T)throw new Error("Not possible to find intersection inside of the rectangle");var A,P;return Math.abs(T)*S>Math.abs(C)*_?(T<0&&(_=-_),A=_*C/T,P=_):(C<0&&(S=-S),A=S,P=S*T/C),{x:w+A,y:x+P}}function l(m){var b=r.map(r.range(h(m)+1),function(){return[]});return r.forEach(m.nodes(),function(w){var x=m.node(w),C=x.rank;r.isUndefined(C)||(b[C][x.order]=w)}),b}function u(m){var b=r.min(r.map(m.nodes(),function(w){return m.node(w).rank}));r.forEach(m.nodes(),function(w){var x=m.node(w);r.has(x,"rank")&&(x.rank-=b)})}function c(m){var b=r.min(r.map(m.nodes(),function(T){return m.node(T).rank})),w=[];r.forEach(m.nodes(),function(T){var S=m.node(T).rank-b;w[S]||(w[S]=[]),w[S].push(T)});var x=0,C=m.graph().nodeRankFactor;r.forEach(w,function(T,S){r.isUndefined(T)&&S%C!==0?--x:x&&r.forEach(T,function(_){m.node(_).rank+=x})})}function d(m,b,w,x){var C={width:0,height:0};return arguments.length>=4&&(C.rank=w,C.order=x),t(m,"border",C,b)}function h(m){return r.max(r.map(m.nodes(),function(b){var w=m.node(b).rank;if(!r.isUndefined(w))return w}))}function g(m,b){var w={lhs:[],rhs:[]};return r.forEach(m,function(x){b(x)?w.lhs.push(x):w.rhs.push(x)}),w}function p(m,b){var w=r.now();try{return b()}finally{console.log(m+" time: "+(r.now()-w)+"ms")}}function E(m,b){return b()}return My}var Ly,v2;function VG(){if(v2)return Ly;v2=1;var r=Or(),e=Vt();Ly={run:t,undo:a};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var s=o.v,l=i.node(s).rank,u=o.w,c=i.node(u).rank,d=o.name,h=i.edge(o),g=h.labelRank;if(c!==l+1){i.removeEdge(o);var p,E,m;for(m=0,++l;l<c;++m,++l)h.points=[],E={width:0,height:0,edgeLabel:h,edgeObj:o,rank:l},p=e.addDummyNode(i,"edge",E,"_d"),l===g&&(E.width=h.width,E.height=h.height,E.dummy="edge-label",E.labelpos=h.labelpos),i.setEdge(s,p,{weight:h.weight},d),m===0&&i.graph().dummyChains.push(p),s=p;i.setEdge(s,u,{weight:h.weight},d)}}function a(i){r.forEach(i.graph().dummyChains,function(o){var s=i.node(o),l=s.edgeLabel,u;for(i.setEdge(s.edgeObj,l);s.dummy;)u=i.successors(o)[0],i.removeNode(o),l.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(l.x=s.x,l.y=s.y,l.width=s.width,l.height=s.height),o=u,s=i.node(o)})}return Ly}var Oy,h2;function ol(){if(h2)return Oy;h2=1;var r=Or();Oy={longestPath:e,slack:t};function e(n){var a={};function i(o){var s=n.node(o);if(r.has(a,o))return s.rank;a[o]=!0;var l=r.min(r.map(n.outEdges(o),function(u){return i(u.w)-n.edge(u).minlen}));return(l===Number.POSITIVE_INFINITY||l===void 0||l===null)&&(l=0),s.rank=l}r.forEach(n.sources(),i)}function t(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Oy}var qy,g2;function KP(){if(g2)return qy;g2=1;var r=Or(),e=En().Graph,t=ol().slack;qy=n;function n(s){var l=new e({directed:!1}),u=s.nodes()[0],c=s.nodeCount();l.setNode(u,{});for(var d,h;a(l,s)<c;)d=i(l,s),h=l.hasNode(d.v)?t(s,d):-t(s,d),o(l,s,h);return l}function a(s,l){function u(c){r.forEach(l.nodeEdges(c),function(d){var h=d.v,g=c===h?d.w:h;!s.hasNode(g)&&!t(l,d)&&(s.setNode(g,{}),s.setEdge(c,g,{}),u(g))})}return r.forEach(s.nodes(),u),s.nodeCount()}function i(s,l){return r.minBy(l.edges(),function(u){if(s.hasNode(u.v)!==s.hasNode(u.w))return t(l,u)})}function o(s,l,u){r.forEach(s.nodes(),function(c){l.node(c).rank+=u})}return qy}var Ny,p2;function GG(){if(p2)return Ny;p2=1;var r=Or(),e=KP(),t=ol().slack,n=ol().longestPath,a=En().alg.preorder,i=En().alg.postorder,o=Vt().simplify;Ny=s,s.initLowLimValues=d,s.initCutValues=l,s.calcCutValue=c,s.leaveEdge=g,s.enterEdge=p,s.exchangeEdges=E;function s(x){x=o(x),n(x);var C=e(x);d(C),l(C,x);for(var T,S;T=g(C);)S=p(C,x,T),E(C,x,T,S)}function l(x,C){var T=i(x,x.nodes());T=T.slice(0,T.length-1),r.forEach(T,function(S){u(x,C,S)})}function u(x,C,T){var S=x.node(T),_=S.parent;x.edge(T,_).cutvalue=c(x,C,T)}function c(x,C,T){var S=x.node(T),_=S.parent,A=!0,P=C.edge(T,_),D=0;return P||(A=!1,P=C.edge(_,T)),D=P.weight,r.forEach(C.nodeEdges(T),function(I){var M=I.v===T,k=M?I.w:I.v;if(k!==_){var N=M===A,z=C.edge(I).weight;if(D+=N?z:-z,b(x,T,k)){var W=x.edge(T,k).cutvalue;D+=N?-W:W}}}),D}function d(x,C){arguments.length<2&&(C=x.nodes()[0]),h(x,{},1,C)}function h(x,C,T,S,_){var A=T,P=x.node(S);return C[S]=!0,r.forEach(x.neighbors(S),function(D){r.has(C,D)||(T=h(x,C,T,D,S))}),P.low=A,P.lim=T++,_?P.parent=_:delete P.parent,T}function g(x){return r.find(x.edges(),function(C){return x.edge(C).cutvalue<0})}function p(x,C,T){var S=T.v,_=T.w;C.hasEdge(S,_)||(S=T.w,_=T.v);var A=x.node(S),P=x.node(_),D=A,I=!1;A.lim>P.lim&&(D=P,I=!0);var M=r.filter(C.edges(),function(k){return I===w(x,x.node(k.v),D)&&I!==w(x,x.node(k.w),D)});return r.minBy(M,function(k){return t(C,k)})}function E(x,C,T,S){var _=T.v,A=T.w;x.removeEdge(_,A),x.setEdge(S.v,S.w,{}),d(x),l(x,C),m(x,C)}function m(x,C){var T=r.find(x.nodes(),function(_){return!C.node(_).parent}),S=a(x,T);S=S.slice(1),r.forEach(S,function(_){var A=x.node(_).parent,P=C.edge(_,A),D=!1;P||(P=C.edge(A,_),D=!0),C.node(_).rank=C.node(A).rank+(D?P.minlen:-P.minlen)})}function b(x,C,T){return x.hasEdge(C,T)}function w(x,C,T){return T.low<=C.lim&&C.lim<=T.lim}return Ny}var Fy,y2;function WG(){if(y2)return Fy;y2=1;var r=ol(),e=r.longestPath,t=KP(),n=GG();Fy=a;function a(l){switch(l.graph().ranker){case"network-simplex":s(l);break;case"tight-tree":o(l);break;case"longest-path":i(l);break;default:s(l)}}var i=e;function o(l){e(l),t(l)}function s(l){n(l)}return Fy}var zy,m2;function UG(){if(m2)return zy;m2=1;var r=Or();zy=e;function e(a){var i=n(a);r.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),l=s.edgeObj,u=t(a,i,l.v,l.w),c=u.path,d=u.lca,h=0,g=c[h],p=!0;o!==l.w;){if(s=a.node(o),p){for(;(g=c[h])!==d&&a.node(g).maxRank<s.rank;)h++;g===d&&(p=!1)}if(!p){for(;h<c.length-1&&a.node(g=c[h+1]).minRank<=s.rank;)h++;g=c[h]}a.setParent(o,g),o=a.successors(o)[0]}})}function t(a,i,o,s){var l=[],u=[],c=Math.min(i[o].low,i[s].low),d=Math.max(i[o].lim,i[s].lim),h,g;h=o;do h=a.parent(h),l.push(h);while(h&&(i[h].low>c||d>i[h].lim));for(g=h,h=s;(h=a.parent(h))!==g;)u.push(h);return{path:l.concat(u.reverse()),lca:g}}function n(a){var i={},o=0;function s(l){var u=o;r.forEach(a.children(l),s),i[l]={low:u,lim:o++}}return r.forEach(a.children(),s),i}return zy}var $y,b2;function HG(){if(b2)return $y;b2=1;var r=Or(),e=Vt();$y={run:t,cleanup:o};function t(s){var l=e.addDummyNode(s,"root",{},"_root"),u=a(s),c=r.max(r.values(u))-1,d=2*c+1;s.graph().nestingRoot=l,r.forEach(s.edges(),function(g){s.edge(g).minlen*=d});var h=i(s)+1;r.forEach(s.children(),function(g){n(s,l,d,h,c,u,g)}),s.graph().nodeRankFactor=d}function n(s,l,u,c,d,h,g){var p=s.children(g);if(!p.length){g!==l&&s.setEdge(l,g,{weight:0,minlen:u});return}var E=e.addBorderNode(s,"_bt"),m=e.addBorderNode(s,"_bb"),b=s.node(g);s.setParent(E,g),b.borderTop=E,s.setParent(m,g),b.borderBottom=m,r.forEach(p,function(w){n(s,l,u,c,d,h,w);var x=s.node(w),C=x.borderTop?x.borderTop:w,T=x.borderBottom?x.borderBottom:w,S=x.borderTop?c:2*c,_=C!==T?1:d-h[g]+1;s.setEdge(E,C,{weight:S,minlen:_,nestingEdge:!0}),s.setEdge(T,m,{weight:S,minlen:_,nestingEdge:!0})}),s.parent(g)||s.setEdge(l,E,{weight:0,minlen:d+h[g]})}function a(s){var l={};function u(c,d){var h=s.children(c);h&&h.length&&r.forEach(h,function(g){u(g,d+1)}),l[c]=d}return r.forEach(s.children(),function(c){u(c,1)}),l}function i(s){return r.reduce(s.edges(),function(l,u){return l+s.edge(u).weight},0)}function o(s){var l=s.graph();s.removeNode(l.nestingRoot),delete l.nestingRoot,r.forEach(s.edges(),function(u){var c=s.edge(u);c.nestingEdge&&s.removeEdge(u)})}return $y}var Vy,w2;function KG(){if(w2)return Vy;w2=1;var r=Or(),e=Vt();Vy=t;function t(a){function i(o){var s=a.children(o),l=a.node(o);if(s.length&&r.forEach(s,i),r.has(l,"minRank")){l.borderLeft=[],l.borderRight=[];for(var u=l.minRank,c=l.maxRank+1;u<c;++u)n(a,"borderLeft","_bl",o,l,u),n(a,"borderRight","_br",o,l,u)}}r.forEach(a.children(),i)}function n(a,i,o,s,l,u){var c={width:0,height:0,rank:u,borderType:i},d=l[i][u-1],h=e.addDummyNode(a,"border",c,o);l[i][u]=h,a.setParent(h,s),d&&a.setEdge(d,h,{weight:1})}return Vy}var Gy,x2;function jG(){if(x2)return Gy;x2=1;var r=Or();Gy={adjust:e,undo:t};function e(u){var c=u.graph().rankdir.toLowerCase();(c==="lr"||c==="rl")&&n(u)}function t(u){var c=u.graph().rankdir.toLowerCase();(c==="bt"||c==="rl")&&i(u),(c==="lr"||c==="rl")&&(s(u),n(u))}function n(u){r.forEach(u.nodes(),function(c){a(u.node(c))}),r.forEach(u.edges(),function(c){a(u.edge(c))})}function a(u){var c=u.width;u.width=u.height,u.height=c}function i(u){r.forEach(u.nodes(),function(c){o(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,o),r.has(d,"y")&&o(d)})}function o(u){u.y=-u.y}function s(u){r.forEach(u.nodes(),function(c){l(u.node(c))}),r.forEach(u.edges(),function(c){var d=u.edge(c);r.forEach(d.points,l),r.has(d,"x")&&l(d)})}function l(u){var c=u.x;u.x=u.y,u.y=c}return Gy}var Wy,E2;function YG(){if(E2)return Wy;E2=1;var r=Or();Wy=e;function e(t){var n={},a=r.filter(t.nodes(),function(u){return!t.children(u).length}),i=r.max(r.map(a,function(u){return t.node(u).rank})),o=r.map(r.range(i+1),function(){return[]});function s(u){if(!r.has(n,u)){n[u]=!0;var c=t.node(u);o[c.rank].push(u),r.forEach(t.successors(u),s)}}var l=r.sortBy(a,function(u){return t.node(u).rank});return r.forEach(l,s),o}return Wy}var Uy,C2;function ZG(){if(C2)return Uy;C2=1;var r=Or();Uy=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=t(n,a[o-1],a[o]);return i}function t(n,a,i){for(var o=r.zipObject(i,r.map(i,function(h,g){return g})),s=r.flatten(r.map(a,function(h){return r.sortBy(r.map(n.outEdges(h),function(g){return{pos:o[g.w],weight:n.edge(g).weight}}),"pos")}),!0),l=1;l<i.length;)l<<=1;var u=2*l-1;l-=1;var c=r.map(new Array(u),function(){return 0}),d=0;return r.forEach(s.forEach(function(h){var g=h.pos+l;c[g]+=h.weight;for(var p=0;g>0;)g%2&&(p+=c[g+1]),g=g-1>>1,c[g]+=h.weight;d+=h.weight*p})),d}return Uy}var Hy,_2;function XG(){if(_2)return Hy;_2=1;var r=Or();Hy=e;function e(t,n){return r.map(n,function(a){var i=t.inEdges(a);if(i.length){var o=r.reduce(i,function(s,l){var u=t.edge(l),c=t.node(l.v);return{sum:s.sum+u.weight*c.order,weight:s.weight+u.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return Hy}var Ky,S2;function QG(){if(S2)return Ky;S2=1;var r=Or();Ky=e;function e(a,i){var o={};r.forEach(a,function(l,u){var c=o[l.v]={indegree:0,in:[],out:[],vs:[l.v],i:u};r.isUndefined(l.barycenter)||(c.barycenter=l.barycenter,c.weight=l.weight)}),r.forEach(i.edges(),function(l){var u=o[l.v],c=o[l.w];!r.isUndefined(u)&&!r.isUndefined(c)&&(c.indegree++,u.out.push(o[l.w]))});var s=r.filter(o,function(l){return!l.indegree});return t(s)}function t(a){var i=[];function o(u){return function(c){c.merged||(r.isUndefined(c.barycenter)||r.isUndefined(u.barycenter)||c.barycenter>=u.barycenter)&&n(u,c)}}function s(u){return function(c){c.in.push(u),--c.indegree===0&&a.push(c)}}for(;a.length;){var l=a.pop();i.push(l),r.forEach(l.in.reverse(),o(l)),r.forEach(l.out,s(l))}return r.map(r.filter(i,function(u){return!u.merged}),function(u){return r.pick(u,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(i.i,a.i),i.merged=!0}return Ky}var jy,T2;function JG(){if(T2)return jy;T2=1;var r=Or(),e=Vt();jy=t;function t(i,o){var s=e.partition(i,function(E){return r.has(E,"barycenter")}),l=s.lhs,u=r.sortBy(s.rhs,function(E){return-E.i}),c=[],d=0,h=0,g=0;l.sort(a(!!o)),g=n(c,u,g),r.forEach(l,function(E){g+=E.vs.length,c.push(E.vs),d+=E.barycenter*E.weight,h+=E.weight,g=n(c,u,g)});var p={vs:r.flatten(c,!0)};return h&&(p.barycenter=d/h,p.weight=h),p}function n(i,o,s){for(var l;o.length&&(l=r.last(o)).i<=s;)o.pop(),i.push(l.vs),s++;return s}function a(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return jy}var Yy,R2;function eW(){if(R2)return Yy;R2=1;var r=Or(),e=XG(),t=QG(),n=JG();Yy=a;function a(s,l,u,c){var d=s.children(l),h=s.node(l),g=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,E={};g&&(d=r.filter(d,function(T){return T!==g&&T!==p}));var m=e(s,d);r.forEach(m,function(T){if(s.children(T.v).length){var S=a(s,T.v,u,c);E[T.v]=S,r.has(S,"barycenter")&&o(T,S)}});var b=t(m,u);i(b,E);var w=n(b,c);if(g&&(w.vs=r.flatten([g,w.vs,p],!0),s.predecessors(g).length)){var x=s.node(s.predecessors(g)[0]),C=s.node(s.predecessors(p)[0]);r.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+x.order+C.order)/(w.weight+2),w.weight+=2}return w}function i(s,l){r.forEach(s,function(u){u.vs=r.flatten(u.vs.map(function(c){return l[c]?l[c].vs:c}),!0)})}function o(s,l){r.isUndefined(s.barycenter)?(s.barycenter=l.barycenter,s.weight=l.weight):(s.barycenter=(s.barycenter*s.weight+l.barycenter*l.weight)/(s.weight+l.weight),s.weight+=l.weight)}return Yy}var Zy,A2;function rW(){if(A2)return Zy;A2=1;var r=Or(),e=En().Graph;Zy=t;function t(a,i,o){var s=n(a),l=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(u){return a.node(u)});return r.forEach(a.nodes(),function(u){var c=a.node(u),d=a.parent(u);(c.rank===i||c.minRank<=i&&i<=c.maxRank)&&(l.setNode(u),l.setParent(u,d||s),r.forEach(a[o](u),function(h){var g=h.v===u?h.w:h.v,p=l.edge(g,u),E=r.isUndefined(p)?0:p.weight;l.setEdge(g,u,{weight:a.edge(h).weight+E})}),r.has(c,"minRank")&&l.setNode(u,{borderLeft:c.borderLeft[i],borderRight:c.borderRight[i]}))}),l}function n(a){for(var i;a.hasNode(i=r.uniqueId("_root")););return i}return Zy}var Xy,P2;function tW(){if(P2)return Xy;P2=1;var r=Or();Xy=e;function e(t,n,a){var i={},o;r.forEach(a,function(s){for(var l=t.parent(s),u,c;l;){if(u=t.parent(l),u?(c=i[u],i[u]=l):(c=o,o=l),c&&c!==l){n.setEdge(c,l);return}l=u}})}return Xy}var Qy,D2;function nW(){if(D2)return Qy;D2=1;var r=Or(),e=YG(),t=ZG(),n=eW(),a=rW(),i=tW(),o=En().Graph,s=Vt();Qy=l;function l(h){var g=s.maxRank(h),p=u(h,r.range(1,g+1),"inEdges"),E=u(h,r.range(g-1,-1,-1),"outEdges"),m=e(h);d(h,m);for(var b=Number.POSITIVE_INFINITY,w,x=0,C=0;C<4;++x,++C){c(x%2?p:E,x%4>=2),m=s.buildLayerMatrix(h);var T=t(h,m);T<b&&(C=0,w=r.cloneDeep(m),b=T)}d(h,w)}function u(h,g,p){return r.map(g,function(E){return a(h,E,p)})}function c(h,g){var p=new o;r.forEach(h,function(E){var m=E.graph().root,b=n(E,m,p,g);r.forEach(b.vs,function(w,x){E.node(w).order=x}),i(E,p,b.vs)})}function d(h,g){r.forEach(g,function(p){r.forEach(p,function(E,m){h.node(E).order=m})})}return Qy}var Jy,I2;function aW(){if(I2)return Jy;I2=1;var r=Or(),e=En().Graph,t=Vt();Jy={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:h,findSmallestWidthAlignment:d,balance:g};function n(b,w){var x={};function C(T,S){var _=0,A=0,P=T.length,D=r.last(S);return r.forEach(S,function(I,M){var k=i(b,I),N=k?b.node(k).order:P;(k||I===D)&&(r.forEach(S.slice(A,M+1),function(z){r.forEach(b.predecessors(z),function(W){var q=b.node(W),$=q.order;($<_||N<$)&&!(q.dummy&&b.node(z).dummy)&&o(x,W,z)})}),A=M+1,_=N)}),S}return r.reduce(w,C),x}function a(b,w){var x={};function C(S,_,A,P,D){var I;r.forEach(r.range(_,A),function(M){I=S[M],b.node(I).dummy&&r.forEach(b.predecessors(I),function(k){var N=b.node(k);N.dummy&&(N.order<P||N.order>D)&&o(x,k,I)})})}function T(S,_){var A=-1,P,D=0;return r.forEach(_,function(I,M){if(b.node(I).dummy==="border"){var k=b.predecessors(I);k.length&&(P=b.node(k[0]).order,C(_,D,M,A,P),D=M,A=P)}C(_,D,_.length,P,S.length)}),_}return r.reduce(w,T),x}function i(b,w){if(b.node(w).dummy)return r.find(b.predecessors(w),function(x){return b.node(x).dummy})}function o(b,w,x){if(w>x){var C=w;w=x,x=C}var T=b[w];T||(b[w]=T={}),T[x]=!0}function s(b,w,x){if(w>x){var C=w;w=x,x=C}return r.has(b[w],x)}function l(b,w,x,C){var T={},S={},_={};return r.forEach(w,function(A){r.forEach(A,function(P,D){T[P]=P,S[P]=P,_[P]=D})}),r.forEach(w,function(A){var P=-1;r.forEach(A,function(D){var I=C(D);if(I.length){I=r.sortBy(I,function(W){return _[W]});for(var M=(I.length-1)/2,k=Math.floor(M),N=Math.ceil(M);k<=N;++k){var z=I[k];S[D]===D&&P<_[z]&&!s(x,D,z)&&(S[z]=D,S[D]=T[D]=T[z],P=_[z])}}})}),{root:T,align:S}}function u(b,w,x,C,T){var S={},_=c(b,w,x,T),A=T?"borderLeft":"borderRight";function P(M,k){for(var N=_.nodes(),z=N.pop(),W={};z;)W[z]?M(z):(W[z]=!0,N.push(z),N=N.concat(k(z))),z=N.pop()}function D(M){S[M]=_.inEdges(M).reduce(function(k,N){return Math.max(k,S[N.v]+_.edge(N))},0)}function I(M){var k=_.outEdges(M).reduce(function(z,W){return Math.min(z,S[W.w]-_.edge(W))},Number.POSITIVE_INFINITY),N=b.node(M);k!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[M]=Math.max(S[M],k))}return P(D,_.predecessors.bind(_)),P(I,_.successors.bind(_)),r.forEach(C,function(M){S[M]=S[x[M]]}),S}function c(b,w,x,C){var T=new e,S=b.graph(),_=E(S.nodesep,S.edgesep,C);return r.forEach(w,function(A){var P;r.forEach(A,function(D){var I=x[D];if(T.setNode(I),P){var M=x[P],k=T.edge(M,I);T.setEdge(M,I,Math.max(_(b,D,P),k||0))}P=D})}),T}function d(b,w){return r.minBy(r.values(w),function(x){var C=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY;return r.forIn(x,function(S,_){var A=m(b,_)/2;C=Math.max(S+A,C),T=Math.min(S-A,T)}),C-T})}function h(b,w){var x=r.values(w),C=r.min(x),T=r.max(x);r.forEach(["u","d"],function(S){r.forEach(["l","r"],function(_){var A=S+_,P=b[A],D;if(P!==w){var I=r.values(P);D=_==="l"?C-r.min(I):T-r.max(I),D&&(b[A]=r.mapValues(P,function(M){return M+D}))}})})}function g(b,w){return r.mapValues(b.ul,function(x,C){if(w)return b[w.toLowerCase()][C];var T=r.sortBy(r.map(b,C));return(T[1]+T[2])/2})}function p(b){var w=t.buildLayerMatrix(b),x=r.merge(n(b,w),a(b,w)),C={},T;r.forEach(["u","d"],function(_){T=_==="u"?w:r.values(w).reverse(),r.forEach(["l","r"],function(A){A==="r"&&(T=r.map(T,function(M){return r.values(M).reverse()}));var P=(_==="u"?b.predecessors:b.successors).bind(b),D=l(b,T,x,P),I=u(b,T,D.root,D.align,A==="r");A==="r"&&(I=r.mapValues(I,function(M){return-M})),C[_+A]=I})});var S=d(b,C);return h(C,S),g(C,b.graph().align)}function E(b,w,x){return function(C,T,S){var _=C.node(T),A=C.node(S),P=0,D;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":D=-_.width/2;break;case"r":D=_.width/2;break}if(D&&(P+=x?D:-D),D=0,P+=(_.dummy?w:b)/2,P+=(A.dummy?w:b)/2,P+=A.width/2,r.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":D=A.width/2;break;case"r":D=-A.width/2;break}return D&&(P+=x?D:-D),D=0,P}}function m(b,w){return b.node(w).width}return Jy}var em,B2;function iW(){if(B2)return em;B2=1;var r=Or(),e=Vt(),t=aW().positionX;em=n;function n(i){i=e.asNonCompoundGraph(i),a(i),r.forEach(t(i),function(o,s){i.node(s).x=o})}function a(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,l=0;r.forEach(o,function(u){var c=r.max(r.map(u,function(d){return i.node(d).height}));r.forEach(u,function(d){i.node(d).y=l+c/2}),l+=c+s})}return em}var rm,k2;function oW(){if(k2)return rm;k2=1;var r=Or(),e=$G(),t=VG(),n=WG(),a=Vt().normalizeRanks,i=UG(),o=Vt().removeEmptyRanks,s=HG(),l=KG(),u=jG(),c=nW(),d=iW(),h=Vt(),g=En().Graph;rm=p;function p(G,V){var j=V&&V.debugTiming?h.time:h.notime;j("layout",function(){var re=j(" buildLayoutGraph",function(){return P(G)});j(" runLayout",function(){E(re,j)}),j(" updateInputGraph",function(){m(G,re)})})}function E(G,V){V(" makeSpaceForEdgeLabels",function(){D(G)}),V(" removeSelfEdges",function(){X(G)}),V(" acyclic",function(){e.run(G)}),V(" nestingGraph.run",function(){s.run(G)}),V(" rank",function(){n(h.asNonCompoundGraph(G))}),V(" injectEdgeLabelProxies",function(){I(G)}),V(" removeEmptyRanks",function(){o(G)}),V(" nestingGraph.cleanup",function(){s.cleanup(G)}),V(" normalizeRanks",function(){a(G)}),V(" assignRankMinMax",function(){M(G)}),V(" removeEdgeLabelProxies",function(){k(G)}),V(" normalize.run",function(){t.run(G)}),V(" parentDummyChains",function(){i(G)}),V(" addBorderSegments",function(){l(G)}),V(" order",function(){c(G)}),V(" insertSelfEdges",function(){Y(G)}),V(" adjustCoordinateSystem",function(){u.adjust(G)}),V(" position",function(){d(G)}),V(" positionSelfEdges",function(){K(G)}),V(" removeBorderNodes",function(){$(G)}),V(" normalize.undo",function(){t.undo(G)}),V(" fixupEdgeLabelCoords",function(){W(G)}),V(" undoCoordinateSystem",function(){u.undo(G)}),V(" translateGraph",function(){N(G)}),V(" assignNodeIntersects",function(){z(G)}),V(" reversePoints",function(){q(G)}),V(" acyclic.undo",function(){e.undo(G)})}function m(G,V){r.forEach(G.nodes(),function(j){var re=G.node(j),ce=V.node(j);re&&(re.x=ce.x,re.y=ce.y,V.children(j).length&&(re.width=ce.width,re.height=ce.height))}),r.forEach(G.edges(),function(j){var re=G.edge(j),ce=V.edge(j);re.points=ce.points,r.has(ce,"x")&&(re.x=ce.x,re.y=ce.y)}),G.graph().width=V.graph().width,G.graph().height=V.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],C=["width","height"],T={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function P(G){var V=new g({multigraph:!0,compound:!0}),j=le(G.graph());return V.setGraph(r.merge({},w,ee(j,b),r.pick(j,x))),r.forEach(G.nodes(),function(re){var ce=le(G.node(re));V.setNode(re,r.defaults(ee(ce,C),T)),V.setParent(re,G.parent(re))}),r.forEach(G.edges(),function(re){var ce=le(G.edge(re));V.setEdge(re,r.merge({},_,ee(ce,S),r.pick(ce,A)))}),V}function D(G){var V=G.graph();V.ranksep/=2,r.forEach(G.edges(),function(j){var re=G.edge(j);re.minlen*=2,re.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?re.width+=re.labeloffset:re.height+=re.labeloffset)})}function I(G){r.forEach(G.edges(),function(V){var j=G.edge(V);if(j.width&&j.height){var re=G.node(V.v),ce=G.node(V.w),se={rank:(ce.rank-re.rank)/2+re.rank,e:V};h.addDummyNode(G,"edge-proxy",se,"_ep")}})}function M(G){var V=0;r.forEach(G.nodes(),function(j){var re=G.node(j);re.borderTop&&(re.minRank=G.node(re.borderTop).rank,re.maxRank=G.node(re.borderBottom).rank,V=r.max(V,re.maxRank))}),G.graph().maxRank=V}function k(G){r.forEach(G.nodes(),function(V){var j=G.node(V);j.dummy==="edge-proxy"&&(G.edge(j.e).labelRank=j.rank,G.removeNode(V))})}function N(G){var V=Number.POSITIVE_INFINITY,j=0,re=Number.POSITIVE_INFINITY,ce=0,se=G.graph(),Z=se.marginx||0,Q=se.marginy||0;function ae(ne){var de=ne.x,Ce=ne.y,ve=ne.width,U=ne.height;V=Math.min(V,de-ve/2),j=Math.max(j,de+ve/2),re=Math.min(re,Ce-U/2),ce=Math.max(ce,Ce+U/2)}r.forEach(G.nodes(),function(ne){ae(G.node(ne))}),r.forEach(G.edges(),function(ne){var de=G.edge(ne);r.has(de,"x")&&ae(de)}),V-=Z,re-=Q,r.forEach(G.nodes(),function(ne){var de=G.node(ne);de.x-=V,de.y-=re}),r.forEach(G.edges(),function(ne){var de=G.edge(ne);r.forEach(de.points,function(Ce){Ce.x-=V,Ce.y-=re}),r.has(de,"x")&&(de.x-=V),r.has(de,"y")&&(de.y-=re)}),se.width=j-V+Z,se.height=ce-re+Q}function z(G){r.forEach(G.edges(),function(V){var j=G.edge(V),re=G.node(V.v),ce=G.node(V.w),se,Z;j.points?(se=j.points[0],Z=j.points[j.points.length-1]):(j.points=[],se=ce,Z=re),j.points.unshift(h.intersectRect(re,se)),j.points.push(h.intersectRect(ce,Z))})}function W(G){r.forEach(G.edges(),function(V){var j=G.edge(V);if(r.has(j,"x"))switch((j.labelpos==="l"||j.labelpos==="r")&&(j.width-=j.labeloffset),j.labelpos){case"l":j.x-=j.width/2+j.labeloffset;break;case"r":j.x+=j.width/2+j.labeloffset;break}})}function q(G){r.forEach(G.edges(),function(V){var j=G.edge(V);j.reversed&&j.points.reverse()})}function $(G){r.forEach(G.nodes(),function(V){if(G.children(V).length){var j=G.node(V),re=G.node(j.borderTop),ce=G.node(j.borderBottom),se=G.node(r.last(j.borderLeft)),Z=G.node(r.last(j.borderRight));j.width=Math.abs(Z.x-se.x),j.height=Math.abs(ce.y-re.y),j.x=se.x+j.width/2,j.y=re.y+j.height/2}}),r.forEach(G.nodes(),function(V){G.node(V).dummy==="border"&&G.removeNode(V)})}function X(G){r.forEach(G.edges(),function(V){if(V.v===V.w){var j=G.node(V.v);j.selfEdges||(j.selfEdges=[]),j.selfEdges.push({e:V,label:G.edge(V)}),G.removeEdge(V)}})}function Y(G){var V=h.buildLayerMatrix(G);r.forEach(V,function(j){var re=0;r.forEach(j,function(ce,se){var Z=G.node(ce);Z.order=se+re,r.forEach(Z.selfEdges,function(Q){h.addDummyNode(G,"selfedge",{width:Q.label.width,height:Q.label.height,rank:Z.rank,order:se+ ++re,e:Q.e,label:Q.label},"_se")}),delete Z.selfEdges})})}function K(G){r.forEach(G.nodes(),function(V){var j=G.node(V);if(j.dummy==="selfedge"){var re=G.node(j.e.v),ce=re.x+re.width/2,se=re.y,Z=j.x-ce,Q=re.height/2;G.setEdge(j.e,j.label),G.removeNode(V),j.label.points=[{x:ce+2*Z/3,y:se-Q},{x:ce+5*Z/6,y:se-Q},{x:ce+Z,y:se},{x:ce+5*Z/6,y:se+Q},{x:ce+2*Z/3,y:se+Q}],j.label.x=j.x,j.label.y=j.y}})}function ee(G,V){return r.mapValues(r.pick(G,V),Number)}function le(G){var V={};return r.forEach(G,function(j,re){V[re.toLowerCase()]=j}),V}return rm}var tm,M2;function sW(){if(M2)return tm;M2=1;var r=Or(),e=Vt(),t=En().Graph;tm={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(a.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+a.node(s).rank)}),r.forEach(a.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),r.forEach(i,function(s,l){var u="layer"+l;o.setNode(u,{rank:"same"}),r.reduce(s,function(c,d){return o.setEdge(c,d,{style:"invis"}),d})}),o}return tm}var nm,L2;function uW(){return L2||(L2=1,nm="0.8.5"),nm}var am,O2;function lW(){return O2||(O2=1,am={graphlib:En(),layout:oW(),debug:sW(),util:{time:Vt().time,notime:Vt().notime},version:uW()}),am}var fW=Gu.exports,q2;function cW(){return q2||(q2=1,(function(r,e){(function(n,a){r.exports=a(lW())})(fW,function(t){return(function(n){var a={};function i(o){if(a[o])return a[o].exports;var s=a[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=a,i.d=function(o,s,l){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:l})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var u in o)i.d(l,u,(function(c){return o[c]}).bind(null,u));return l},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(n,a,i){var o=i(1),s=function(u){u&&u("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),n.exports=s}),(function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var s=function(g){return typeof g=="function"},l=i(2),u=i(3),c=i(4);function d(h){this.options=u({},l,h)}d.prototype.run=function(){var h=this.options,g=this,p=h.cy,E=h.eles,m=function(K,ee){return s(ee)?ee.apply(K,[K]):ee},b=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};b.x2===void 0&&(b.x2=b.x1+b.w),b.w===void 0&&(b.w=b.x2-b.x1),b.y2===void 0&&(b.y2=b.y1+b.h),b.h===void 0&&(b.h=b.y2-b.y1);var w=new c.graphlib.Graph({multigraph:!0,compound:!0}),x={},C=function(K,ee){ee!=null&&(x[K]=ee)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),w.setGraph(x),w.setDefaultEdgeLabel(function(){return{}}),w.setDefaultNodeLabel(function(){return{}});var T=E.nodes();s(h.sort)&&(T=T.sort(h.sort));for(var S=0;S<T.length;S++){var _=T[S],A=_.layoutDimensions(h);w.setNode(_.id(),{width:A.w,height:A.h,name:_.id()})}for(var P=0;P<T.length;P++){var D=T[P];D.isChild()&&w.setParent(D.id(),D.parent().id())}var I=E.edges().stdFilter(function(Y){return!Y.source().isParent()&&!Y.target().isParent()});s(h.sort)&&(I=I.sort(h.sort));for(var M=0;M<I.length;M++){var k=I[M];w.setEdge(k.source().id(),k.target().id(),{minlen:m(k,h.minLen),weight:m(k,h.edgeWeight),name:k.id()},k.id())}c.layout(w);for(var N=w.nodes(),z=0;z<N.length;z++){var W=N[z],q=w.node(W);p.getElementById(W).scratch().dagre=q}var $;h.boundingBox?($={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},T.forEach(function(Y){var K=Y.scratch().dagre;$.x1=Math.min($.x1,K.x),$.x2=Math.max($.x2,K.x),$.y1=Math.min($.y1,K.y),$.y2=Math.max($.y2,K.y)}),$.w=$.x2-$.x1,$.h=$.y2-$.y1):$=b;var X=function(K){if(h.boundingBox){var ee=$.w===0?0:(K.x-$.x1)/$.w,le=$.h===0?0:(K.y-$.y1)/$.h;return{x:b.x1+ee*b.w,y:b.y1+le*b.h}}else return K};return T.layoutPositions(g,h,function(Y){Y=o(Y)==="object"?Y:this;var K=Y.scratch().dagre;return X({x:K.x,y:K.y})}),this},n.exports=d}),(function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,l){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,l){return l},ready:function(){},sort:void 0,stop:function(){}};n.exports=i}),(function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return s.forEach(function(u){Object.keys(u).forEach(function(c){return i[c]=u[c]})}),i}}),(function(n,a){n.exports=t})])})})(Gu)),Gu.exports}var dW=cW();const vW=Rl(dW);var Wu={exports:{}},im,N2;function hW(){if(N2)return im;N2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct,s=typeof self=="object"&&self&&self.Object===Object&&self,l=o||s||Function("return this")();function u(ve,U){return ve==null?void 0:ve[U]}function c(ve){var U=!1;if(ve!=null&&typeof ve.toString!="function")try{U=!!(ve+"")}catch{}return U}var d=Array.prototype,h=Function.prototype,g=Object.prototype,p=l["__core-js_shared__"],E=(function(){var ve=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return ve?"Symbol(src)_1."+ve:""})(),m=h.toString,b=g.hasOwnProperty,w=g.toString,x=RegExp("^"+m.call(b).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,T=ce(l,"Map"),S=ce(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function A(){this.__data__=S?S(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function D(ve){var U=this.__data__;if(S){var fe=U[ve];return fe===e?void 0:fe}return b.call(U,ve)?U[ve]:void 0}function I(ve){var U=this.__data__;return S?U[ve]!==void 0:b.call(U,ve)}function M(ve,U){var fe=this.__data__;return fe[ve]=S&&U===void 0?e:U,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=D,_.prototype.has=I,_.prototype.set=M;function k(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=V(U,ve);if(fe<0)return!1;var we=U.length-1;return fe==we?U.pop():C.call(U,fe,1),!0}function W(ve){var U=this.__data__,fe=V(U,ve);return fe<0?void 0:U[fe][1]}function q(ve){return V(this.__data__,ve)>-1}function $(ve,U){var fe=this.__data__,we=V(fe,ve);return we<0?fe.push([ve,U]):fe[we][1]=U,this}k.prototype.clear=N,k.prototype.delete=z,k.prototype.get=W,k.prototype.has=q,k.prototype.set=$;function X(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var we=ve[U];this.set(we[0],we[1])}}function Y(){this.__data__={hash:new _,map:new(T||k),string:new _}}function K(ve){return re(this,ve).delete(ve)}function ee(ve){return re(this,ve).get(ve)}function le(ve){return re(this,ve).has(ve)}function G(ve,U){return re(this,ve).set(ve,U),this}X.prototype.clear=Y,X.prototype.delete=K,X.prototype.get=ee,X.prototype.has=le,X.prototype.set=G;function V(ve,U){for(var fe=ve.length;fe--;)if(ne(ve[fe][0],U))return fe;return-1}function j(ve){if(!Ce(ve)||Z(ve))return!1;var U=de(ve)||c(ve)?x:i;return U.test(Q(ve))}function re(ve,U){var fe=ve.__data__;return se(U)?fe[typeof U=="string"?"string":"hash"]:fe.map}function ce(ve,U){var fe=u(ve,U);return j(fe)?fe:void 0}function se(ve){var U=typeof ve;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?ve!=="__proto__":ve===null}function Z(ve){return!!E&&E in ve}function Q(ve){if(ve!=null){try{return m.call(ve)}catch{}try{return ve+""}catch{}}return""}function ae(ve,U){if(typeof ve!="function"||U&&typeof U!="function")throw new TypeError(r);var fe=function(){var we=arguments,ge=U?U.apply(this,we):we[0],me=fe.cache;if(me.has(ge))return me.get(ge);var Re=ve.apply(this,we);return fe.cache=me.set(ge,Re),Re};return fe.cache=new(ae.Cache||X),fe}ae.Cache=X;function ne(ve,U){return ve===U||ve!==ve&&U!==U}function de(ve){var U=Ce(ve)?w.call(ve):"";return U==t||U==n}function Ce(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return im=ae,im}var om,F2;function gW(){if(F2)return om;F2=1;var r="Expected a function",e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,l=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct,u=typeof self=="object"&&self&&self.Object===Object&&self,c=l||u||Function("return this")(),d=Object.prototype,h=d.toString,g=Math.max,p=Math.min,E=function(){return c.Date.now()};function m(S,_,A){var P,D,I,M,k,N,z=0,W=!1,q=!1,$=!0;if(typeof S!="function")throw new TypeError(r);_=T(_)||0,w(A)&&(W=!!A.leading,q="maxWait"in A,I=q?g(T(A.maxWait)||0,_):I,$="trailing"in A?!!A.trailing:$);function X(ce){var se=P,Z=D;return P=D=void 0,z=ce,M=S.apply(Z,se),M}function Y(ce){return z=ce,k=setTimeout(le,_),W?X(ce):M}function K(ce){var se=ce-N,Z=ce-z,Q=_-se;return q?p(Q,I-Z):Q}function ee(ce){var se=ce-N,Z=ce-z;return N===void 0||se>=_||se<0||q&&Z>=I}function le(){var ce=E();if(ee(ce))return G(ce);k=setTimeout(le,K(ce))}function G(ce){return k=void 0,$&&P?X(ce):(P=D=void 0,M)}function V(){k!==void 0&&clearTimeout(k),z=0,P=N=D=k=void 0}function j(){return k===void 0?M:G(E())}function re(){var ce=E(),se=ee(ce);if(P=arguments,D=this,N=ce,se){if(k===void 0)return Y(N);if(q)return k=setTimeout(le,_),X(N)}return k===void 0&&(k=setTimeout(le,_)),M}return re.cancel=V,re.flush=j,re}function b(S,_,A){var P=!0,D=!0;if(typeof S!="function")throw new TypeError(r);return w(A)&&(P="leading"in A?!!A.leading:P,D="trailing"in A?!!A.trailing:D),m(S,_,{leading:P,maxWait:_,trailing:D})}function w(S){var _=typeof S;return!!S&&(_=="object"||_=="function")}function x(S){return!!S&&typeof S=="object"}function C(S){return typeof S=="symbol"||x(S)&&h.call(S)==t}function T(S){if(typeof S=="number")return S;if(C(S))return e;if(w(S)){var _=typeof S.valueOf=="function"?S.valueOf():S;S=w(_)?_+"":_}if(typeof S!="string")return S===0?S:+S;S=S.replace(n,"");var A=i.test(S);return A||o.test(S)?s(S.slice(2),A?2:8):a.test(S)?e:+S}return om=b,om}var pW=Wu.exports,z2;function yW(){return z2||(z2=1,(function(r,e){(function(n,a){r.exports=a(hW(),gW())})(pW,function(t,n){return(function(a){var i={};function o(s){if(i[s])return i[s].exports;var l=i[s]={i:s,l:!1,exports:{}};return a[s].call(l.exports,l,l.exports,o),l.l=!0,l.exports}return o.m=a,o.c=i,o.i=function(s){return s},o.d=function(s,l,u){o.o(s,l)||Object.defineProperty(s,l,{configurable:!1,enumerable:!0,get:u})},o.n=function(s){var l=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(l,"a",l),l},o.o=function(s,l){return Object.prototype.hasOwnProperty.call(s,l)},o.p="",o(o.s=12)})([(function(a,i,o){a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var l=arguments.length,u=Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];return u.filter(function(d){return d!=null}).forEach(function(d){Object.keys(d).forEach(function(h){return s[h]=d[h]})}),s}}),(function(a,i,o){var s=o(10),l=o(0);a.exports=function(u){var c=this;return new s(l({cy:c},u))}}),(function(a,i,o){function s(){if(this.saveGestureState(),this.cy.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.addEventListener("touchstart",this.preventDefault,c),window.addEventListener("touchmove",this.preventDefault,c),window.addEventListener("wheel",this.preventDefault,c)}return this}function l(){if(this.cy.zoomingEnabled(this.lastZoomingEnabled).panningEnabled(this.lastPanningEnabled).boxSelectionEnabled(this.lastBoxSelectionEnabled),this.options.disableBrowserGestures){var c=this.windowListenerOptions;window.removeEventListener("touchstart",this.preventDefault,c),window.removeEventListener("touchmove",this.preventDefault,c),window.removeEventListener("wheel",this.preventDefault,c)}return this}function u(){var c=this.cy;return this.lastPanningEnabled=c.panningEnabled(),this.lastZoomingEnabled=c.zoomingEnabled(),this.lastBoxSelectionEnabled=c.boxSelectionEnabled(),this}a.exports={disableGestures:s,resetGestures:l,saveGestureState:u}}),(function(a,i,o){function s(){var l=this,u=this.cy,c=this.options;return this.addListener(u,"drag",function(){return l.grabbingNode=!0}),this.addListener(u,"free",function(){return l.grabbingNode=!1}),this.addListener(u,"tapstart","node",function(d){var h=d.target;l.drawMode&&l.start(h)}),this.addListener(u,"tapdrag",function(d){l.update(d.position)}),this.addListener(u,"tapdragover","node",function(d){c.snap||l.preview(d.target)}),this.addListener(u,"tapdragout","node",function(d){c.snap||l.unpreview(d.target)}),this.addListener(u,"tapend",function(){l.stop()}),this}a.exports={addCytoscapeListeners:s}}),(function(a,i,o){var s={canConnect:function(u,c){return!u.same(c)},edgeParams:function(u,c){return{}},hoverDelay:150,snap:!0,snapThreshold:50,snapFrequency:15,noEdgeEventsInDraw:!0,disableBrowserGestures:!0};a.exports=s}),(function(a,i,o){function s(c){var d=this.cy;return this.drawMode=c??!this.drawMode,this.drawMode?(this.prevUngrabifyState=d.autoungrabify(),d.autoungrabify(!0),this.emit("drawon")):(d.autoungrabify(this.prevUngrabifyState),this.emit("drawoff")),this}function l(){return this.toggleDrawMode(!0)}function u(){return this.toggleDrawMode(!1)}a.exports={toggleDrawMode:s,enableDrawMode:l,disableDrawMode:u}}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(b){return typeof b}:function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},l=o(0),u=function(w){return(typeof w>"u"?"undefined":s(w))===s("")},c=function(w){return(typeof w>"u"?"undefined":s(w))===s([])&&w.length!=null};function d(b,w,x){var C={};return l(C,w,b),l(C.data,w.data,b.data),u(w.classes)?C.classes=w.classes+" "+x:c(w.classes)?C.classes=w.classes.join(" ")+" "+x:C.classes=x,C}function h(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,w=this.cy;this.options;var x=this.presumptiveTargets,C=this.previewEles,T=this.active,S=this.sourceNode,_=this.targetNode,A=b?"eh-preview":"",P=w.collection(),D=this.canConnect(_);if(T&&D){if(!_||_.size()===0){C.remove(),this.emit("cancel",this.mp(),S,x);return}if(!b){C.removeClass("eh-preview").style("events",""),this.emit("complete",this.mp(),S,_,C);return}var I=w.add(d({group:"edges",data:{source:S.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(I),b?(this.previewEles=P,P.style("events","no")):(P.style("events",""),this.emit("complete",this.mp(),S,_,P)),this}}function g(){return this.makeEdges(!0),this}function p(){return this.previewEles.nonempty()&&this.previewEles.inside()}function E(){return this.previewShown()&&this.previewEles.remove(),this}function m(){var b=this,w=this.sourceNode,x=this.ghostNode,C=this.cy,T=this.mx,S=this.my,_=T,A=S,P=void 0,D=void 0;if(w)return(!x||x.length===0||x.removed())&&(D=this.ghostEles=C.collection(),C.batch(function(){x=b.ghostNode=C.add({group:"nodes",classes:"eh-ghost eh-ghost-node",position:{x:0,y:0}}),x.style({"background-color":"blue",width:1e-4,height:1e-4,opacity:0,events:"no"});var I={};P=C.add(l({},I,{group:"edges",data:l({},I.data,{source:w.id(),target:x.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),D.merge(x).merge(P)),x.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:E,previewShown:p,updateEdge:m}}),(function(a,i,o){function s(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events","no"),this}function l(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events",""),this}a.exports={disableEdgeEvents:s,enableEdgeEvents:l}}),(function(a,i,o){function s(){return this.enabled=!0,this.emit("enable"),this}function l(){return this.enabled=!1,this.emit("disable"),this}a.exports={enable:s,disable:l}}),(function(a,i,o){var s=o(13),l=Math.sqrt(2);function u(w){var x=this.previewEles,C=this.ghostEles,T=function(M){return x.anySame(M)},S=function(M){return C.anySame(M)},_=function(M){return T(M)||S(M)},A=this.enabled,P=this.active,D=this.grabbingNode;return A&&!P&&!D&&w!=null&&w.nonempty()&&!_(w)}function c(w){return this.canStartOn(w)&&this.drawMode}function d(w){return this.canStartOn(w)&&!this.drawMode}function h(w){var x=this;if(this.canStartOn(w)){this.active=!0,this.sourceNode=w,this.sourceNode.addClass("eh-source"),this.disableGestures(),this.disableEdgeEvents();var C=function(S){return S.id()};this.canConnect=s(function(T){return x.options.canConnect(x.sourceNode,T)},C),this.edgeParams=s(function(T){return x.options.edgeParams(x.sourceNode,T)},C),this.emit("start",this.hp(),w)}}function g(w){if(this.active){var x=w;return this.mx=x.x,this.my=x.y,this.updateEdge(),this.throttledSnap(),this}}function p(){if(!this.active||!this.options.snap)return!1;var w=this.cy,x=this.targetNode,C=this.options.snapThreshold,T=this.mp(),S=this.previewEles,_=this.ghostNode,A=function(V){return l*Math.max(V.outerWidth(),V.outerHeight())/2},P=function(V,j,re,ce){var se=re-V,Z=ce-j;return se*se+Z*Z},D=function(V,j){return P(V.x,V.y,j.x,j.y)},I=function(V){return D(V.position(),T)},M=function(V){var j=A(V),re=j+C;return re*re},k=function(V){return I(V)<=M(V)},N=function(V){var j=V.position(),re=V.outerWidth()/2,ce=V.outerHeight()/2,se=j.x,Z=j.y,Q=T.x,ae=T.y,ne=se-re,de=se+re,Ce=Z-ce,ve=Z+ce,U=ne<=Q&&Q<=de,fe=Ce<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var we=ae-Ce,ge=ae-ve;return Math.min(we*we,ge*ge)}else if(fe){var me=Q-ne,Re=Q-de;return Math.min(me*me,Re*Re)}else return Q<ne&&ae<Ce?P(Q,ae,ne,Ce):Q>de&&ae<Ce?P(Q,ae,de,Ce):Q<ne&&ae>ve?P(Q,ae,ne,ve):P(Q,ae,de,ve)},z=function(V,j){return N(V)-N(j)},W=z,q=!1,$=function(V){var j=T,re=V.outerWidth(),ce=re/2,se=V.outerHeight(),Z=se/2,Q=V.position(),ae=Q.x-ce,ne=Q.x+ce,de=Q.y-Z,Ce=Q.y+Z;return ae<=j.x&&j.x<=ne&&de<=j.y&&j.y<=Ce},X=function(V){return V.same(S)||V.same(_)},Y=w.nodes(function(G){return!X(G)&&k(G)}).sort(W),K=!1;x.nonempty()&&!k(x)&&this.unpreview(x);for(var ee=0;ee<Y.length;ee++){var le=Y[ee];if(!(le.isParent()&&$(le))&&!(le.isChild()&&!$(le.parent()))&&(le.same(x)||this.preview(le,q))){K=!0;break}}return K}function E(w){var x=this,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,T=this.options,S=this.sourceNode,_=this.ghostNode,A=this.ghostEles,P=this.presumptiveTargets,D=this.previewEles,I=this.active,M=S,k=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!I||k||N||z)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var W=function(){x.targetNode=w,P.merge(w),w.addClass("eh-presumptive-target"),w.addClass("eh-target"),x.emit("hoverover",x.mp(),M,w),w.addClass("eh-preview"),A.addClass("eh-preview-active"),S.addClass("eh-preview-active"),w.addClass("eh-preview-active"),x.makePreview(),x.emit("previewon",x.mp(),M,w,D)};return C&&T.hoverDelay>0?this.previewTimeout=setTimeout(W,T.hoverDelay):W(),!0}function m(w){if(this.active){var x=this.previewTimeout,C=this.sourceNode,T=this.previewEles,S=this.ghostEles,_=this.cy;clearTimeout(x),this.previewTimeout=null;var A=C;return w.removeClass("eh-preview eh-target eh-presumptive-target eh-preview-active"),S.removeClass("eh-preview-active"),C.removeClass("eh-preview-active"),this.targetNode=_.collection(),this.removePreview(A,w),this.emit("hoverout",this.mp(),A,w),this.emit("previewoff",this.mp(),A,w,T),this}}function b(){if(this.active){var w=this.sourceNode,x=this.targetNode,C=this.ghostEles,T=this.presumptiveTargets;return clearTimeout(this.previewTimeout),w.removeClass("eh-source eh-preview-active"),x.removeClass("eh-target eh-preview eh-hover eh-preview-active"),T.removeClass("eh-presumptive-target"),this.makeEdges(),C.remove(),this.clearCollections(),this.resetGestures(),this.enableEdgeEvents(),this.active=!1,this.emit("stop",this.mp(),w),this}}a.exports={start:h,update:g,preview:E,unpreview:m,stop:b,snap:p,canStartOn:u,canStartDrawModeOn:c,canStartNonDrawModeOn:d}}),(function(a,i,o){var s=o(4),l=o(0),u=o(14),c=o(2),d=o(3),h=o(5),g=o(6),p=o(8),E=o(9),m=o(11),b=o(7);function w(T){var S=T.cy;this.cy=S,this.listeners=[],this.enabled=!0,this.drawMode=!1,this.active=!1,this.grabbingNode=!1,this.clearCollections(),this.mx=0,this.my=0,this.options=l({},s,T),this.saveGestureState(),this.addListeners(),this.throttledSnap=u(this.snap.bind(this),1e3/T.snapFrequency),this.preventDefault=function(P){return P.preventDefault()},this.canConnect=function(){return!1};var _=!1;try{var A=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("test",null,A)}catch{}_?this.windowListenerOptions={capture:!0,passive:!1}:this.windowListenerOptions=!0}var x=w.prototype={},C=function(S){return l(x,S)};x.destroy=function(){this.removeListeners()},x.setOptions=function(T){l(this.options,T)},x.mp=function(){return{x:this.mx,y:this.my}},x.hp=function(){return{x:this.hx,y:this.hy}},x.clearCollections=function(){var T=this.cy;this.previewEles=T.collection(),this.ghostEles=T.collection(),this.ghostNode=T.collection(),this.sourceNode=T.collection(),this.targetNode=T.collection(),this.presumptiveTargets=T.collection()},[c,d,h,g,p,E,m,b].forEach(C),a.exports=w}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function l(){var E=this;return this.addCytoscapeListeners(),this.addListener(this.cy,"destroy",function(){return E.destroy()}),this}function u(){for(var E=this.listeners.length-1;E>=0;E--){var m=this.listeners[E];this.removeListener(m.target,m.event,m.selector,m.callback,m.options)}return this}function c(E,m,b,w,x){return(typeof b>"u"?"undefined":s(b))!==s("")&&(w=b,x=w,b=null),x==null&&(x=!1),{target:E,event:m,selector:b,callback:w,options:x}}function d(E){return E instanceof Element}function h(E,m,b,w,x){var C=c(E,m,b,w,x);return this.listeners.push(C),d(C.target)?C.target.addEventListener(C.event,C.callback,C.options):C.selector?C.target.addListener(C.event,C.selector,C.callback,C.options):C.target.addListener(C.event,C.callback,C.options),this}function g(E,m,b,w,x){for(var C=c(E,m,b,w,x),T=this.listeners.length-1;T>=0;T--){var S=this.listeners[T];if(C.target===S.target&&C.event===S.event&&(C.selector==null||C.selector===S.selector)&&(C.callback==null||C.callback===S.callback)){this.listeners.splice(T,1),d(C.target)?C.target.removeEventListener(C.event,C.callback,C.options):C.selector?C.target.removeListener(C.event,C.selector,C.callback,C.options):C.target.removeListener(C.event,C.callback,C.options);break}}return this}function p(E,m){for(var b=this.cy,w=arguments.length,x=Array(w>2?w-2:0),C=2;C<w;C++)x[C-2]=arguments[C];return b.emit({type:"eh"+E,position:m},x),this}a.exports={addListener:h,addListeners:l,removeListener:g,removeListeners:u,emit:p}}),(function(a,i,o){var s=o(1),l=function(c){c&&c("core","edgehandles",s)};typeof cytoscape<"u"&&l(cytoscape),a.exports=l}),(function(a,i){a.exports=t}),(function(a,i){a.exports=n})])})})(Wu)),Wu.exports}var mW=yW();const bW=Rl(mW);var sm,$2;function wW(){if($2)return sm;$2=1;class r{constructor(n,a={}){this._cy=n,this._params=a,this._node_dom={};let i=n.container();if(a.dom_container)this._nodes_dom_container=a.dom_container;else{let s=document.createElement("div");s.style.position="absolute",s.style.zIndex=10,i.querySelector("canvas").parentNode.appendChild(s),this._nodes_dom_container=s}this._resize_observer=new ResizeObserver(s=>{for(let l of s){let u=l.target,c=u.__cy_id;n.getElementById(c).style({width:u.offsetWidth,height:u.offsetHeight,shape:"rectangle"})}}),n.on("add","node",s=>{this._add_node(s.target)}),n.on("remove","node",s=>{this._remove_node(s.target)});for(let s of n.nodes())this._add_node(s);this._nodes_dom_container.style.willChange="transform",this._nodes_dom_container.style.backfaceVisibility="hidden";let o=null;n.on("pan zoom",()=>{o===null&&(o=requestAnimationFrame(()=>{o=null;let s=n.pan(),l=n.zoom(),u="translate3d("+s.x+"px,"+s.y+"px,0) scale("+l+")";this._nodes_dom_container.style.transform=u}))}),this._panZoomRafId=o,n.on("position bounds","node",s=>{let l=s.target,u=l.id();if(!this._node_dom[u])return;let c=this._node_dom[u],d=`translate(-50%, -50%) translate3d(${l.position("x").toFixed(2)}px, ${l.position("y").toFixed(2)}px, 0)`;c.style.transform=d,c.style.display="inline",c.style.position="absolute",c.style["z-index"]=10})}_add_node(n){let a=n.data();a.dom&&(a.skip_node_append!==!0&&this._nodes_dom_container.appendChild(a.dom),a.dom.__cy_id=n.id(),a.dom.style.willChange="transform",a.dom.style.backfaceVisibility="hidden",this._node_dom[n.id()]=a.dom,this._resize_observer.observe(a.dom))}_remove_node(n){let a=n.id(),i=this._node_dom[a];i&&(this._resize_observer.unobserve(i),i.parentNode===this._nodes_dom_container&&this._nodes_dom_container.removeChild(i),delete this._node_dom[a])}node_dom(n){return this._node_dom[n]}update(n,a){let i=this._cy.getElementById(n);if(!i){console.warn(`Node with id ${n} not found`);return}let o=this._node_dom[n];if(!o){console.warn(`DOM element for node ${n} not found`);return}a(o),i.data("dom",o),this._cy.trigger("position",["node",i])}remove(){for(let n in this._node_dom)this._resize_observer.unobserve(this._node_dom[n]);for(;this._nodes_dom_container.firstChild;)this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);this._node_dom={},this._cy.removeListener("add","node"),this._cy.removeListener("remove","node"),this._cy.removeListener("pan zoom"),this._cy.removeListener("position bounds","node"),this._params.dom_container||this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container),this._panZoomRafId!==null&&cancelAnimationFrame(this._panZoomRafId),this._cy=null,this._params=null,this._nodes_dom_container=null,this._resize_observer=null}}function e(t){t&&t("core","domNode",function(n,a){return new r(this,n,a)})}return typeof cytoscape<"u"&&e(cytoscape),sm=e,sm}var xW=wW();const EW=Rl(xW);ln.prototype.hasInitialised||(ln.use(vW),ln.use(bW),ln.use(EW),ln.prototype.hasInitialised=!0);var Ho={exports:{}};/**
|
|
332
|
-
* @license
|
|
333
|
-
* Lodash <https://lodash.com/>
|
|
334
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
335
|
-
* Released under MIT license <https://lodash.com/license>
|
|
336
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
337
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
338
|
-
*/var CW=Ho.exports,V2;function _W(){return V2||(V2=1,(function(r,e){(function(){var t,n="4.17.23",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",u=500,c="__lodash_placeholder__",d=1,h=2,g=4,p=1,E=2,m=1,b=2,w=4,x=8,C=16,T=32,S=64,_=128,A=256,P=512,D=30,I="...",M=800,k=16,N=1,z=2,W=3,q=1/0,$=9007199254740991,X=17976931348623157e292,Y=NaN,K=4294967295,ee=K-1,le=K>>>1,G=[["ary",_],["bind",m],["bindKey",b],["curry",x],["curryRight",C],["flip",P],["partial",T],["partialRight",S],["rearg",A]],V="[object Arguments]",j="[object Array]",re="[object AsyncFunction]",ce="[object Boolean]",se="[object Date]",Z="[object DOMException]",Q="[object Error]",ae="[object Function]",ne="[object GeneratorFunction]",de="[object Map]",Ce="[object Number]",ve="[object Null]",U="[object Object]",fe="[object Promise]",we="[object Proxy]",ge="[object RegExp]",me="[object Set]",Re="[object String]",Ie="[object Symbol]",Be="[object Undefined]",Oe="[object WeakMap]",He="[object WeakSet]",Ve="[object ArrayBuffer]",Xe="[object DataView]",er="[object Float32Array]",$e="[object Float64Array]",Me="[object Int8Array]",pe="[object Int16Array]",L="[object Int32Array]",oe="[object Uint8Array]",ye="[object Uint8ClampedArray]",be="[object Uint16Array]",Ee="[object Uint32Array]",qe=/\b__p \+= '';/g,Ae=/\b(__p \+=) '' \+/g,Ge=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Fe=/&(?:amp|lt|gt|quot|#39);/g,je=/[&<>"']/g,or=RegExp(Fe.source),nr=RegExp(je.source),We=/<%-([\s\S]+?)%>/g,ur=/<%([\s\S]+?)%>/g,ar=/<%=([\s\S]+?)%>/g,Gr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Br=/^\w*$/,lt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kr=/[\\^$.*+?()[\]{}|]/g,Kr=RegExp(kr.source),qr=/^\s+/,Xr=/\s/,_n=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,zr=/\{\n\/\* \[wrapped with (.+)\] \*/,vn=/,? & /,hn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,aa=/[()=,{}\[\]\/\s]/,yi=/\\(\\)?/g,Nn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,at=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,$a=/^\[object .+?Constructor\]$/,Mt=/^0o[0-7]+$/i,Ds=/^(?:0|[1-9]\d*)$/,Hl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,mi=/($^)/,Kl=/['\n\r\u2028\u2029\\]/g,bi="\\ud800-\\udfff",jl="\\u0300-\\u036f",Yl="\\ufe20-\\ufe2f",Zl="\\u20d0-\\u20ff",ia=jl+Yl+Zl,wi="\\u2700-\\u27bf",Va="a-z\\xdf-\\xf6\\xf8-\\xff",Is="\\xac\\xb1\\xd7\\xf7",Bs="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xl="\\u2000-\\u206f",Gt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xi="A-Z\\xc0-\\xd6\\xd8-\\xde",yo="\\ufe0e\\ufe0f",oa=Is+Bs+Xl+Gt,Rt="['’]",Ql="["+bi+"]",Jl="["+oa+"]",Ei="["+ia+"]",x0="\\d+",eD="["+wi+"]",E0="["+Va+"]",C0="[^"+bi+oa+x0+wi+Va+xi+"]",ef="\\ud83c[\\udffb-\\udfff]",rD="(?:"+Ei+"|"+ef+")",_0="[^"+bi+"]",rf="(?:\\ud83c[\\udde6-\\uddff]){2}",tf="[\\ud800-\\udbff][\\udc00-\\udfff]",Ci="["+xi+"]",S0="\\u200d",T0="(?:"+E0+"|"+C0+")",tD="(?:"+Ci+"|"+C0+")",R0="(?:"+Rt+"(?:d|ll|m|re|s|t|ve))?",A0="(?:"+Rt+"(?:D|LL|M|RE|S|T|VE))?",P0=rD+"?",D0="["+yo+"]?",nD="(?:"+S0+"(?:"+[_0,rf,tf].join("|")+")"+D0+P0+")*",aD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",iD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",I0=D0+P0+nD,oD="(?:"+[eD,rf,tf].join("|")+")"+I0,sD="(?:"+[_0+Ei+"?",Ei,rf,tf,Ql].join("|")+")",uD=RegExp(Rt,"g"),lD=RegExp(Ei,"g"),nf=RegExp(ef+"(?="+ef+")|"+sD+I0,"g"),fD=RegExp([Ci+"?"+E0+"+"+R0+"(?="+[Jl,Ci,"$"].join("|")+")",tD+"+"+A0+"(?="+[Jl,Ci+T0,"$"].join("|")+")",Ci+"?"+T0+"+"+R0,Ci+"+"+A0,iD,aD,x0,oD].join("|"),"g"),cD=RegExp("["+S0+bi+ia+yo+"]"),dD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vD=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],hD=-1,Dr={};Dr[er]=Dr[$e]=Dr[Me]=Dr[pe]=Dr[L]=Dr[oe]=Dr[ye]=Dr[be]=Dr[Ee]=!0,Dr[V]=Dr[j]=Dr[Ve]=Dr[ce]=Dr[Xe]=Dr[se]=Dr[Q]=Dr[ae]=Dr[de]=Dr[Ce]=Dr[U]=Dr[ge]=Dr[me]=Dr[Re]=Dr[Oe]=!1;var Tr={};Tr[V]=Tr[j]=Tr[Ve]=Tr[Xe]=Tr[ce]=Tr[se]=Tr[er]=Tr[$e]=Tr[Me]=Tr[pe]=Tr[L]=Tr[de]=Tr[Ce]=Tr[U]=Tr[ge]=Tr[me]=Tr[Re]=Tr[Ie]=Tr[oe]=Tr[ye]=Tr[be]=Tr[Ee]=!0,Tr[Q]=Tr[ae]=Tr[Oe]=!1;var gD={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},pD={"&":"&","<":"<",">":">",'"':""","'":"'"},yD={"&":"&","<":"<",">":">",""":'"',"'":"'"},mD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bD=parseFloat,wD=parseInt,B0=typeof Ct=="object"&&Ct&&Ct.Object===Object&&Ct,xD=typeof self=="object"&&self&&self.Object===Object&&self,ct=B0||xD||Function("return this")(),af=e&&!e.nodeType&&e,Ga=af&&!0&&r&&!r.nodeType&&r,k0=Ga&&Ga.exports===af,of=k0&&B0.process,Qt=(function(){try{var te=Ga&&Ga.require&&Ga.require("util").types;return te||of&&of.binding&&of.binding("util")}catch{}})(),M0=Qt&&Qt.isArrayBuffer,L0=Qt&&Qt.isDate,O0=Qt&&Qt.isMap,q0=Qt&&Qt.isRegExp,N0=Qt&&Qt.isSet,F0=Qt&&Qt.isTypedArray;function Wt(te,xe,he){switch(he.length){case 0:return te.call(xe);case 1:return te.call(xe,he[0]);case 2:return te.call(xe,he[0],he[1]);case 3:return te.call(xe,he[0],he[1],he[2])}return te.apply(xe,he)}function ED(te,xe,he,Ne){for(var rr=-1,mr=te==null?0:te.length;++rr<mr;){var Qr=te[rr];xe(Ne,Qr,he(Qr),te)}return Ne}function Jt(te,xe){for(var he=-1,Ne=te==null?0:te.length;++he<Ne&&xe(te[he],he,te)!==!1;);return te}function CD(te,xe){for(var he=te==null?0:te.length;he--&&xe(te[he],he,te)!==!1;);return te}function z0(te,xe){for(var he=-1,Ne=te==null?0:te.length;++he<Ne;)if(!xe(te[he],he,te))return!1;return!0}function sa(te,xe){for(var he=-1,Ne=te==null?0:te.length,rr=0,mr=[];++he<Ne;){var Qr=te[he];xe(Qr,he,te)&&(mr[rr++]=Qr)}return mr}function ks(te,xe){var he=te==null?0:te.length;return!!he&&_i(te,xe,0)>-1}function sf(te,xe,he){for(var Ne=-1,rr=te==null?0:te.length;++Ne<rr;)if(he(xe,te[Ne]))return!0;return!1}function Mr(te,xe){for(var he=-1,Ne=te==null?0:te.length,rr=Array(Ne);++he<Ne;)rr[he]=xe(te[he],he,te);return rr}function ua(te,xe){for(var he=-1,Ne=xe.length,rr=te.length;++he<Ne;)te[rr+he]=xe[he];return te}function uf(te,xe,he,Ne){var rr=-1,mr=te==null?0:te.length;for(Ne&&mr&&(he=te[++rr]);++rr<mr;)he=xe(he,te[rr],rr,te);return he}function _D(te,xe,he,Ne){var rr=te==null?0:te.length;for(Ne&&rr&&(he=te[--rr]);rr--;)he=xe(he,te[rr],rr,te);return he}function lf(te,xe){for(var he=-1,Ne=te==null?0:te.length;++he<Ne;)if(xe(te[he],he,te))return!0;return!1}var SD=ff("length");function TD(te){return te.split("")}function RD(te){return te.match(hn)||[]}function $0(te,xe,he){var Ne;return he(te,function(rr,mr,Qr){if(xe(rr,mr,Qr))return Ne=mr,!1}),Ne}function Ms(te,xe,he,Ne){for(var rr=te.length,mr=he+(Ne?1:-1);Ne?mr--:++mr<rr;)if(xe(te[mr],mr,te))return mr;return-1}function _i(te,xe,he){return xe===xe?FD(te,xe,he):Ms(te,V0,he)}function AD(te,xe,he,Ne){for(var rr=he-1,mr=te.length;++rr<mr;)if(Ne(te[rr],xe))return rr;return-1}function V0(te){return te!==te}function G0(te,xe){var he=te==null?0:te.length;return he?df(te,xe)/he:Y}function ff(te){return function(xe){return xe==null?t:xe[te]}}function cf(te){return function(xe){return te==null?t:te[xe]}}function W0(te,xe,he,Ne,rr){return rr(te,function(mr,Qr,_r){he=Ne?(Ne=!1,mr):xe(he,mr,Qr,_r)}),he}function PD(te,xe){var he=te.length;for(te.sort(xe);he--;)te[he]=te[he].value;return te}function df(te,xe){for(var he,Ne=-1,rr=te.length;++Ne<rr;){var mr=xe(te[Ne]);mr!==t&&(he=he===t?mr:he+mr)}return he}function vf(te,xe){for(var he=-1,Ne=Array(te);++he<te;)Ne[he]=xe(he);return Ne}function DD(te,xe){return Mr(xe,function(he){return[he,te[he]]})}function U0(te){return te&&te.slice(0,Y0(te)+1).replace(qr,"")}function Ut(te){return function(xe){return te(xe)}}function hf(te,xe){return Mr(xe,function(he){return te[he]})}function mo(te,xe){return te.has(xe)}function H0(te,xe){for(var he=-1,Ne=te.length;++he<Ne&&_i(xe,te[he],0)>-1;);return he}function K0(te,xe){for(var he=te.length;he--&&_i(xe,te[he],0)>-1;);return he}function ID(te,xe){for(var he=te.length,Ne=0;he--;)te[he]===xe&&++Ne;return Ne}var BD=cf(gD),kD=cf(pD);function MD(te){return"\\"+mD[te]}function LD(te,xe){return te==null?t:te[xe]}function Si(te){return cD.test(te)}function OD(te){return dD.test(te)}function qD(te){for(var xe,he=[];!(xe=te.next()).done;)he.push(xe.value);return he}function gf(te){var xe=-1,he=Array(te.size);return te.forEach(function(Ne,rr){he[++xe]=[rr,Ne]}),he}function j0(te,xe){return function(he){return te(xe(he))}}function la(te,xe){for(var he=-1,Ne=te.length,rr=0,mr=[];++he<Ne;){var Qr=te[he];(Qr===xe||Qr===c)&&(te[he]=c,mr[rr++]=he)}return mr}function Ls(te){var xe=-1,he=Array(te.size);return te.forEach(function(Ne){he[++xe]=Ne}),he}function ND(te){var xe=-1,he=Array(te.size);return te.forEach(function(Ne){he[++xe]=[Ne,Ne]}),he}function FD(te,xe,he){for(var Ne=he-1,rr=te.length;++Ne<rr;)if(te[Ne]===xe)return Ne;return-1}function zD(te,xe,he){for(var Ne=he+1;Ne--;)if(te[Ne]===xe)return Ne;return Ne}function Ti(te){return Si(te)?VD(te):SD(te)}function gn(te){return Si(te)?GD(te):TD(te)}function Y0(te){for(var xe=te.length;xe--&&Xr.test(te.charAt(xe)););return xe}var $D=cf(yD);function VD(te){for(var xe=nf.lastIndex=0;nf.test(te);)++xe;return xe}function GD(te){return te.match(nf)||[]}function WD(te){return te.match(fD)||[]}var UD=(function te(xe){xe=xe==null?ct:Ri.defaults(ct.Object(),xe,Ri.pick(ct,vD));var he=xe.Array,Ne=xe.Date,rr=xe.Error,mr=xe.Function,Qr=xe.Math,_r=xe.Object,pf=xe.RegExp,HD=xe.String,en=xe.TypeError,Os=he.prototype,KD=mr.prototype,Ai=_r.prototype,qs=xe["__core-js_shared__"],Ns=KD.toString,br=Ai.hasOwnProperty,jD=0,Z0=(function(){var f=/[^.]+$/.exec(qs&&qs.keys&&qs.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""})(),Fs=Ai.toString,YD=Ns.call(_r),ZD=ct._,XD=pf("^"+Ns.call(br).replace(kr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zs=k0?xe.Buffer:t,fa=xe.Symbol,$s=xe.Uint8Array,X0=zs?zs.allocUnsafe:t,Vs=j0(_r.getPrototypeOf,_r),Q0=_r.create,J0=Ai.propertyIsEnumerable,Gs=Os.splice,eb=fa?fa.isConcatSpreadable:t,bo=fa?fa.iterator:t,Wa=fa?fa.toStringTag:t,Ws=(function(){try{var f=Ya(_r,"defineProperty");return f({},"",{}),f}catch{}})(),QD=xe.clearTimeout!==ct.clearTimeout&&xe.clearTimeout,JD=Ne&&Ne.now!==ct.Date.now&&Ne.now,eI=xe.setTimeout!==ct.setTimeout&&xe.setTimeout,Us=Qr.ceil,Hs=Qr.floor,yf=_r.getOwnPropertySymbols,rI=zs?zs.isBuffer:t,rb=xe.isFinite,tI=Os.join,nI=j0(_r.keys,_r),Jr=Qr.max,wt=Qr.min,aI=Ne.now,iI=xe.parseInt,tb=Qr.random,oI=Os.reverse,mf=Ya(xe,"DataView"),wo=Ya(xe,"Map"),bf=Ya(xe,"Promise"),Pi=Ya(xe,"Set"),xo=Ya(xe,"WeakMap"),Eo=Ya(_r,"create"),Ks=xo&&new xo,Di={},sI=Za(mf),uI=Za(wo),lI=Za(bf),fI=Za(Pi),cI=Za(xo),js=fa?fa.prototype:t,Co=js?js.valueOf:t,nb=js?js.toString:t;function O(f){if($r(f)&&!tr(f)&&!(f instanceof dr)){if(f instanceof rn)return f;if(br.call(f,"__wrapped__"))return a1(f)}return new rn(f)}var Ii=(function(){function f(){}return function(v){if(!Nr(v))return{};if(Q0)return Q0(v);f.prototype=v;var y=new f;return f.prototype=t,y}})();function Ys(){}function rn(f,v){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!v,this.__index__=0,this.__values__=t}O.templateSettings={escape:We,evaluate:ur,interpolate:ar,variable:"",imports:{_:O}},O.prototype=Ys.prototype,O.prototype.constructor=O,rn.prototype=Ii(Ys.prototype),rn.prototype.constructor=rn;function dr(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=K,this.__views__=[]}function dI(){var f=new dr(this.__wrapped__);return f.__actions__=Lt(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=Lt(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=Lt(this.__views__),f}function vI(){if(this.__filtered__){var f=new dr(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function hI(){var f=this.__wrapped__.value(),v=this.__dir__,y=tr(f),R=v<0,B=y?f.length:0,F=TB(0,B,this.__views__),H=F.start,J=F.end,ie=J-H,_e=R?J:H-1,Se=this.__iteratees__,Pe=Se.length,Le=0,Ue=wt(ie,this.__takeCount__);if(!y||!R&&B==ie&&Ue==ie)return Rb(f,this.__actions__);var Qe=[];e:for(;ie--&&Le<Ue;){_e+=v;for(var sr=-1,Je=f[_e];++sr<Pe;){var cr=Se[sr],vr=cr.iteratee,jt=cr.type,Dt=vr(Je);if(jt==z)Je=Dt;else if(!Dt){if(jt==N)continue e;break e}}Qe[Le++]=Je}return Qe}dr.prototype=Ii(Ys.prototype),dr.prototype.constructor=dr;function Ua(f){var v=-1,y=f==null?0:f.length;for(this.clear();++v<y;){var R=f[v];this.set(R[0],R[1])}}function gI(){this.__data__=Eo?Eo(null):{},this.size=0}function pI(f){var v=this.has(f)&&delete this.__data__[f];return this.size-=v?1:0,v}function yI(f){var v=this.__data__;if(Eo){var y=v[f];return y===l?t:y}return br.call(v,f)?v[f]:t}function mI(f){var v=this.__data__;return Eo?v[f]!==t:br.call(v,f)}function bI(f,v){var y=this.__data__;return this.size+=this.has(f)?0:1,y[f]=Eo&&v===t?l:v,this}Ua.prototype.clear=gI,Ua.prototype.delete=pI,Ua.prototype.get=yI,Ua.prototype.has=mI,Ua.prototype.set=bI;function Fn(f){var v=-1,y=f==null?0:f.length;for(this.clear();++v<y;){var R=f[v];this.set(R[0],R[1])}}function wI(){this.__data__=[],this.size=0}function xI(f){var v=this.__data__,y=Zs(v,f);if(y<0)return!1;var R=v.length-1;return y==R?v.pop():Gs.call(v,y,1),--this.size,!0}function EI(f){var v=this.__data__,y=Zs(v,f);return y<0?t:v[y][1]}function CI(f){return Zs(this.__data__,f)>-1}function _I(f,v){var y=this.__data__,R=Zs(y,f);return R<0?(++this.size,y.push([f,v])):y[R][1]=v,this}Fn.prototype.clear=wI,Fn.prototype.delete=xI,Fn.prototype.get=EI,Fn.prototype.has=CI,Fn.prototype.set=_I;function zn(f){var v=-1,y=f==null?0:f.length;for(this.clear();++v<y;){var R=f[v];this.set(R[0],R[1])}}function SI(){this.size=0,this.__data__={hash:new Ua,map:new(wo||Fn),string:new Ua}}function TI(f){var v=uu(this,f).delete(f);return this.size-=v?1:0,v}function RI(f){return uu(this,f).get(f)}function AI(f){return uu(this,f).has(f)}function PI(f,v){var y=uu(this,f),R=y.size;return y.set(f,v),this.size+=y.size==R?0:1,this}zn.prototype.clear=SI,zn.prototype.delete=TI,zn.prototype.get=RI,zn.prototype.has=AI,zn.prototype.set=PI;function Ha(f){var v=-1,y=f==null?0:f.length;for(this.__data__=new zn;++v<y;)this.add(f[v])}function DI(f){return this.__data__.set(f,l),this}function II(f){return this.__data__.has(f)}Ha.prototype.add=Ha.prototype.push=DI,Ha.prototype.has=II;function pn(f){var v=this.__data__=new Fn(f);this.size=v.size}function BI(){this.__data__=new Fn,this.size=0}function kI(f){var v=this.__data__,y=v.delete(f);return this.size=v.size,y}function MI(f){return this.__data__.get(f)}function LI(f){return this.__data__.has(f)}function OI(f,v){var y=this.__data__;if(y instanceof Fn){var R=y.__data__;if(!wo||R.length<a-1)return R.push([f,v]),this.size=++y.size,this;y=this.__data__=new zn(R)}return y.set(f,v),this.size=y.size,this}pn.prototype.clear=BI,pn.prototype.delete=kI,pn.prototype.get=MI,pn.prototype.has=LI,pn.prototype.set=OI;function ab(f,v){var y=tr(f),R=!y&&Xa(f),B=!y&&!R&&ga(f),F=!y&&!R&&!B&&Li(f),H=y||R||B||F,J=H?vf(f.length,HD):[],ie=J.length;for(var _e in f)(v||br.call(f,_e))&&!(H&&(_e=="length"||B&&(_e=="offset"||_e=="parent")||F&&(_e=="buffer"||_e=="byteLength"||_e=="byteOffset")||Wn(_e,ie)))&&J.push(_e);return J}function ib(f){var v=f.length;return v?f[Df(0,v-1)]:t}function qI(f,v){return lu(Lt(f),Ka(v,0,f.length))}function NI(f){return lu(Lt(f))}function wf(f,v,y){(y!==t&&!yn(f[v],y)||y===t&&!(v in f))&&$n(f,v,y)}function _o(f,v,y){var R=f[v];(!(br.call(f,v)&&yn(R,y))||y===t&&!(v in f))&&$n(f,v,y)}function Zs(f,v){for(var y=f.length;y--;)if(yn(f[y][0],v))return y;return-1}function FI(f,v,y,R){return ca(f,function(B,F,H){v(R,B,y(B),H)}),R}function ob(f,v){return f&&Tn(v,it(v),f)}function zI(f,v){return f&&Tn(v,qt(v),f)}function $n(f,v,y){v=="__proto__"&&Ws?Ws(f,v,{configurable:!0,enumerable:!0,value:y,writable:!0}):f[v]=y}function xf(f,v){for(var y=-1,R=v.length,B=he(R),F=f==null;++y<R;)B[y]=F?t:rc(f,v[y]);return B}function Ka(f,v,y){return f===f&&(y!==t&&(f=f<=y?f:y),v!==t&&(f=f>=v?f:v)),f}function tn(f,v,y,R,B,F){var H,J=v&d,ie=v&h,_e=v&g;if(y&&(H=B?y(f,R,B,F):y(f)),H!==t)return H;if(!Nr(f))return f;var Se=tr(f);if(Se){if(H=AB(f),!J)return Lt(f,H)}else{var Pe=xt(f),Le=Pe==ae||Pe==ne;if(ga(f))return Db(f,J);if(Pe==U||Pe==V||Le&&!B){if(H=ie||Le?{}:Yb(f),!J)return ie?yB(f,zI(H,f)):pB(f,ob(H,f))}else{if(!Tr[Pe])return B?f:{};H=PB(f,Pe,J)}}F||(F=new pn);var Ue=F.get(f);if(Ue)return Ue;F.set(f,H),_1(f)?f.forEach(function(Je){H.add(tn(Je,v,y,Je,f,F))}):E1(f)&&f.forEach(function(Je,cr){H.set(cr,tn(Je,v,y,cr,f,F))});var Qe=_e?ie?$f:zf:ie?qt:it,sr=Se?t:Qe(f);return Jt(sr||f,function(Je,cr){sr&&(cr=Je,Je=f[cr]),_o(H,cr,tn(Je,v,y,cr,f,F))}),H}function $I(f){var v=it(f);return function(y){return sb(y,f,v)}}function sb(f,v,y){var R=y.length;if(f==null)return!R;for(f=_r(f);R--;){var B=y[R],F=v[B],H=f[B];if(H===t&&!(B in f)||!F(H))return!1}return!0}function ub(f,v,y){if(typeof f!="function")throw new en(o);return Io(function(){f.apply(t,y)},v)}function So(f,v,y,R){var B=-1,F=ks,H=!0,J=f.length,ie=[],_e=v.length;if(!J)return ie;y&&(v=Mr(v,Ut(y))),R?(F=sf,H=!1):v.length>=a&&(F=mo,H=!1,v=new Ha(v));e:for(;++B<J;){var Se=f[B],Pe=y==null?Se:y(Se);if(Se=R||Se!==0?Se:0,H&&Pe===Pe){for(var Le=_e;Le--;)if(v[Le]===Pe)continue e;ie.push(Se)}else F(v,Pe,R)||ie.push(Se)}return ie}var ca=Lb(Sn),lb=Lb(Cf,!0);function VI(f,v){var y=!0;return ca(f,function(R,B,F){return y=!!v(R,B,F),y}),y}function Xs(f,v,y){for(var R=-1,B=f.length;++R<B;){var F=f[R],H=v(F);if(H!=null&&(J===t?H===H&&!Kt(H):y(H,J)))var J=H,ie=F}return ie}function GI(f,v,y,R){var B=f.length;for(y=ir(y),y<0&&(y=-y>B?0:B+y),R=R===t||R>B?B:ir(R),R<0&&(R+=B),R=y>R?0:T1(R);y<R;)f[y++]=v;return f}function fb(f,v){var y=[];return ca(f,function(R,B,F){v(R,B,F)&&y.push(R)}),y}function dt(f,v,y,R,B){var F=-1,H=f.length;for(y||(y=IB),B||(B=[]);++F<H;){var J=f[F];v>0&&y(J)?v>1?dt(J,v-1,y,R,B):ua(B,J):R||(B[B.length]=J)}return B}var Ef=Ob(),cb=Ob(!0);function Sn(f,v){return f&&Ef(f,v,it)}function Cf(f,v){return f&&cb(f,v,it)}function Qs(f,v){return sa(v,function(y){return Un(f[y])})}function ja(f,v){v=va(v,f);for(var y=0,R=v.length;f!=null&&y<R;)f=f[Rn(v[y++])];return y&&y==R?f:t}function db(f,v,y){var R=v(f);return tr(f)?R:ua(R,y(f))}function At(f){return f==null?f===t?Be:ve:Wa&&Wa in _r(f)?SB(f):NB(f)}function _f(f,v){return f>v}function WI(f,v){return f!=null&&br.call(f,v)}function UI(f,v){return f!=null&&v in _r(f)}function HI(f,v,y){return f>=wt(v,y)&&f<Jr(v,y)}function Sf(f,v,y){for(var R=y?sf:ks,B=f[0].length,F=f.length,H=F,J=he(F),ie=1/0,_e=[];H--;){var Se=f[H];H&&v&&(Se=Mr(Se,Ut(v))),ie=wt(Se.length,ie),J[H]=!y&&(v||B>=120&&Se.length>=120)?new Ha(H&&Se):t}Se=f[0];var Pe=-1,Le=J[0];e:for(;++Pe<B&&_e.length<ie;){var Ue=Se[Pe],Qe=v?v(Ue):Ue;if(Ue=y||Ue!==0?Ue:0,!(Le?mo(Le,Qe):R(_e,Qe,y))){for(H=F;--H;){var sr=J[H];if(!(sr?mo(sr,Qe):R(f[H],Qe,y)))continue e}Le&&Le.push(Qe),_e.push(Ue)}}return _e}function KI(f,v,y,R){return Sn(f,function(B,F,H){v(R,y(B),F,H)}),R}function To(f,v,y){v=va(v,f),f=Jb(f,v);var R=f==null?f:f[Rn(an(v))];return R==null?t:Wt(R,f,y)}function vb(f){return $r(f)&&At(f)==V}function jI(f){return $r(f)&&At(f)==Ve}function YI(f){return $r(f)&&At(f)==se}function Ro(f,v,y,R,B){return f===v?!0:f==null||v==null||!$r(f)&&!$r(v)?f!==f&&v!==v:ZI(f,v,y,R,Ro,B)}function ZI(f,v,y,R,B,F){var H=tr(f),J=tr(v),ie=H?j:xt(f),_e=J?j:xt(v);ie=ie==V?U:ie,_e=_e==V?U:_e;var Se=ie==U,Pe=_e==U,Le=ie==_e;if(Le&&ga(f)){if(!ga(v))return!1;H=!0,Se=!1}if(Le&&!Se)return F||(F=new pn),H||Li(f)?Hb(f,v,y,R,B,F):CB(f,v,ie,y,R,B,F);if(!(y&p)){var Ue=Se&&br.call(f,"__wrapped__"),Qe=Pe&&br.call(v,"__wrapped__");if(Ue||Qe){var sr=Ue?f.value():f,Je=Qe?v.value():v;return F||(F=new pn),B(sr,Je,y,R,F)}}return Le?(F||(F=new pn),_B(f,v,y,R,B,F)):!1}function XI(f){return $r(f)&&xt(f)==de}function Tf(f,v,y,R){var B=y.length,F=B,H=!R;if(f==null)return!F;for(f=_r(f);B--;){var J=y[B];if(H&&J[2]?J[1]!==f[J[0]]:!(J[0]in f))return!1}for(;++B<F;){J=y[B];var ie=J[0],_e=f[ie],Se=J[1];if(H&&J[2]){if(_e===t&&!(ie in f))return!1}else{var Pe=new pn;if(R)var Le=R(_e,Se,ie,f,v,Pe);if(!(Le===t?Ro(Se,_e,p|E,R,Pe):Le))return!1}}return!0}function hb(f){if(!Nr(f)||kB(f))return!1;var v=Un(f)?XD:$a;return v.test(Za(f))}function QI(f){return $r(f)&&At(f)==ge}function JI(f){return $r(f)&&xt(f)==me}function eB(f){return $r(f)&&gu(f.length)&&!!Dr[At(f)]}function gb(f){return typeof f=="function"?f:f==null?Nt:typeof f=="object"?tr(f)?mb(f[0],f[1]):yb(f):q1(f)}function Rf(f){if(!Do(f))return nI(f);var v=[];for(var y in _r(f))br.call(f,y)&&y!="constructor"&&v.push(y);return v}function rB(f){if(!Nr(f))return qB(f);var v=Do(f),y=[];for(var R in f)R=="constructor"&&(v||!br.call(f,R))||y.push(R);return y}function Af(f,v){return f<v}function pb(f,v){var y=-1,R=Ot(f)?he(f.length):[];return ca(f,function(B,F,H){R[++y]=v(B,F,H)}),R}function yb(f){var v=Gf(f);return v.length==1&&v[0][2]?Xb(v[0][0],v[0][1]):function(y){return y===f||Tf(y,f,v)}}function mb(f,v){return Uf(f)&&Zb(v)?Xb(Rn(f),v):function(y){var R=rc(y,f);return R===t&&R===v?tc(y,f):Ro(v,R,p|E)}}function Js(f,v,y,R,B){f!==v&&Ef(v,function(F,H){if(B||(B=new pn),Nr(F))tB(f,v,H,y,Js,R,B);else{var J=R?R(Kf(f,H),F,H+"",f,v,B):t;J===t&&(J=F),wf(f,H,J)}},qt)}function tB(f,v,y,R,B,F,H){var J=Kf(f,y),ie=Kf(v,y),_e=H.get(ie);if(_e){wf(f,y,_e);return}var Se=F?F(J,ie,y+"",f,v,H):t,Pe=Se===t;if(Pe){var Le=tr(ie),Ue=!Le&&ga(ie),Qe=!Le&&!Ue&&Li(ie);Se=ie,Le||Ue||Qe?tr(J)?Se=J:Wr(J)?Se=Lt(J):Ue?(Pe=!1,Se=Db(ie,!0)):Qe?(Pe=!1,Se=Ib(ie,!0)):Se=[]:Bo(ie)||Xa(ie)?(Se=J,Xa(J)?Se=R1(J):(!Nr(J)||Un(J))&&(Se=Yb(ie))):Pe=!1}Pe&&(H.set(ie,Se),B(Se,ie,R,F,H),H.delete(ie)),wf(f,y,Se)}function bb(f,v){var y=f.length;if(y)return v+=v<0?y:0,Wn(v,y)?f[v]:t}function wb(f,v,y){v.length?v=Mr(v,function(F){return tr(F)?function(H){return ja(H,F.length===1?F[0]:F)}:F}):v=[Nt];var R=-1;v=Mr(v,Ut(Ze()));var B=pb(f,function(F,H,J){var ie=Mr(v,function(_e){return _e(F)});return{criteria:ie,index:++R,value:F}});return PD(B,function(F,H){return gB(F,H,y)})}function nB(f,v){return xb(f,v,function(y,R){return tc(f,R)})}function xb(f,v,y){for(var R=-1,B=v.length,F={};++R<B;){var H=v[R],J=ja(f,H);y(J,H)&&Ao(F,va(H,f),J)}return F}function aB(f){return function(v){return ja(v,f)}}function Pf(f,v,y,R){var B=R?AD:_i,F=-1,H=v.length,J=f;for(f===v&&(v=Lt(v)),y&&(J=Mr(f,Ut(y)));++F<H;)for(var ie=0,_e=v[F],Se=y?y(_e):_e;(ie=B(J,Se,ie,R))>-1;)J!==f&&Gs.call(J,ie,1),Gs.call(f,ie,1);return f}function Eb(f,v){for(var y=f?v.length:0,R=y-1;y--;){var B=v[y];if(y==R||B!==F){var F=B;Wn(B)?Gs.call(f,B,1):kf(f,B)}}return f}function Df(f,v){return f+Hs(tb()*(v-f+1))}function iB(f,v,y,R){for(var B=-1,F=Jr(Us((v-f)/(y||1)),0),H=he(F);F--;)H[R?F:++B]=f,f+=y;return H}function If(f,v){var y="";if(!f||v<1||v>$)return y;do v%2&&(y+=f),v=Hs(v/2),v&&(f+=f);while(v);return y}function lr(f,v){return jf(Qb(f,v,Nt),f+"")}function oB(f){return ib(Oi(f))}function sB(f,v){var y=Oi(f);return lu(y,Ka(v,0,y.length))}function Ao(f,v,y,R){if(!Nr(f))return f;v=va(v,f);for(var B=-1,F=v.length,H=F-1,J=f;J!=null&&++B<F;){var ie=Rn(v[B]),_e=y;if(ie==="__proto__"||ie==="constructor"||ie==="prototype")return f;if(B!=H){var Se=J[ie];_e=R?R(Se,ie,J):t,_e===t&&(_e=Nr(Se)?Se:Wn(v[B+1])?[]:{})}_o(J,ie,_e),J=J[ie]}return f}var Cb=Ks?function(f,v){return Ks.set(f,v),f}:Nt,uB=Ws?function(f,v){return Ws(f,"toString",{configurable:!0,enumerable:!1,value:ac(v),writable:!0})}:Nt;function lB(f){return lu(Oi(f))}function nn(f,v,y){var R=-1,B=f.length;v<0&&(v=-v>B?0:B+v),y=y>B?B:y,y<0&&(y+=B),B=v>y?0:y-v>>>0,v>>>=0;for(var F=he(B);++R<B;)F[R]=f[R+v];return F}function fB(f,v){var y;return ca(f,function(R,B,F){return y=v(R,B,F),!y}),!!y}function eu(f,v,y){var R=0,B=f==null?R:f.length;if(typeof v=="number"&&v===v&&B<=le){for(;R<B;){var F=R+B>>>1,H=f[F];H!==null&&!Kt(H)&&(y?H<=v:H<v)?R=F+1:B=F}return B}return Bf(f,v,Nt,y)}function Bf(f,v,y,R){var B=0,F=f==null?0:f.length;if(F===0)return 0;v=y(v);for(var H=v!==v,J=v===null,ie=Kt(v),_e=v===t;B<F;){var Se=Hs((B+F)/2),Pe=y(f[Se]),Le=Pe!==t,Ue=Pe===null,Qe=Pe===Pe,sr=Kt(Pe);if(H)var Je=R||Qe;else _e?Je=Qe&&(R||Le):J?Je=Qe&&Le&&(R||!Ue):ie?Je=Qe&&Le&&!Ue&&(R||!sr):Ue||sr?Je=!1:Je=R?Pe<=v:Pe<v;Je?B=Se+1:F=Se}return wt(F,ee)}function _b(f,v){for(var y=-1,R=f.length,B=0,F=[];++y<R;){var H=f[y],J=v?v(H):H;if(!y||!yn(J,ie)){var ie=J;F[B++]=H===0?0:H}}return F}function Sb(f){return typeof f=="number"?f:Kt(f)?Y:+f}function Ht(f){if(typeof f=="string")return f;if(tr(f))return Mr(f,Ht)+"";if(Kt(f))return nb?nb.call(f):"";var v=f+"";return v=="0"&&1/f==-q?"-0":v}function da(f,v,y){var R=-1,B=ks,F=f.length,H=!0,J=[],ie=J;if(y)H=!1,B=sf;else if(F>=a){var _e=v?null:xB(f);if(_e)return Ls(_e);H=!1,B=mo,ie=new Ha}else ie=v?[]:J;e:for(;++R<F;){var Se=f[R],Pe=v?v(Se):Se;if(Se=y||Se!==0?Se:0,H&&Pe===Pe){for(var Le=ie.length;Le--;)if(ie[Le]===Pe)continue e;v&&ie.push(Pe),J.push(Se)}else B(ie,Pe,y)||(ie!==J&&ie.push(Pe),J.push(Se))}return J}function kf(f,v){v=va(v,f);var y=-1,R=v.length;if(!R)return!0;for(var B=f==null||typeof f!="object"&&typeof f!="function";++y<R;){var F=v[y];if(typeof F=="string"){if(F==="__proto__"&&!br.call(f,"__proto__"))return!1;if(F==="constructor"&&y+1<R&&typeof v[y+1]=="string"&&v[y+1]==="prototype"){if(B&&y===0)continue;return!1}}}var H=Jb(f,v);return H==null||delete H[Rn(an(v))]}function Tb(f,v,y,R){return Ao(f,v,y(ja(f,v)),R)}function ru(f,v,y,R){for(var B=f.length,F=R?B:-1;(R?F--:++F<B)&&v(f[F],F,f););return y?nn(f,R?0:F,R?F+1:B):nn(f,R?F+1:0,R?B:F)}function Rb(f,v){var y=f;return y instanceof dr&&(y=y.value()),uf(v,function(R,B){return B.func.apply(B.thisArg,ua([R],B.args))},y)}function Mf(f,v,y){var R=f.length;if(R<2)return R?da(f[0]):[];for(var B=-1,F=he(R);++B<R;)for(var H=f[B],J=-1;++J<R;)J!=B&&(F[B]=So(F[B]||H,f[J],v,y));return da(dt(F,1),v,y)}function Ab(f,v,y){for(var R=-1,B=f.length,F=v.length,H={};++R<B;){var J=R<F?v[R]:t;y(H,f[R],J)}return H}function Lf(f){return Wr(f)?f:[]}function Of(f){return typeof f=="function"?f:Nt}function va(f,v){return tr(f)?f:Uf(f,v)?[f]:n1(wr(f))}var cB=lr;function ha(f,v,y){var R=f.length;return y=y===t?R:y,!v&&y>=R?f:nn(f,v,y)}var Pb=QD||function(f){return ct.clearTimeout(f)};function Db(f,v){if(v)return f.slice();var y=f.length,R=X0?X0(y):new f.constructor(y);return f.copy(R),R}function qf(f){var v=new f.constructor(f.byteLength);return new $s(v).set(new $s(f)),v}function dB(f,v){var y=v?qf(f.buffer):f.buffer;return new f.constructor(y,f.byteOffset,f.byteLength)}function vB(f){var v=new f.constructor(f.source,ft.exec(f));return v.lastIndex=f.lastIndex,v}function hB(f){return Co?_r(Co.call(f)):{}}function Ib(f,v){var y=v?qf(f.buffer):f.buffer;return new f.constructor(y,f.byteOffset,f.length)}function Bb(f,v){if(f!==v){var y=f!==t,R=f===null,B=f===f,F=Kt(f),H=v!==t,J=v===null,ie=v===v,_e=Kt(v);if(!J&&!_e&&!F&&f>v||F&&H&&ie&&!J&&!_e||R&&H&&ie||!y&&ie||!B)return 1;if(!R&&!F&&!_e&&f<v||_e&&y&&B&&!R&&!F||J&&y&&B||!H&&B||!ie)return-1}return 0}function gB(f,v,y){for(var R=-1,B=f.criteria,F=v.criteria,H=B.length,J=y.length;++R<H;){var ie=Bb(B[R],F[R]);if(ie){if(R>=J)return ie;var _e=y[R];return ie*(_e=="desc"?-1:1)}}return f.index-v.index}function kb(f,v,y,R){for(var B=-1,F=f.length,H=y.length,J=-1,ie=v.length,_e=Jr(F-H,0),Se=he(ie+_e),Pe=!R;++J<ie;)Se[J]=v[J];for(;++B<H;)(Pe||B<F)&&(Se[y[B]]=f[B]);for(;_e--;)Se[J++]=f[B++];return Se}function Mb(f,v,y,R){for(var B=-1,F=f.length,H=-1,J=y.length,ie=-1,_e=v.length,Se=Jr(F-J,0),Pe=he(Se+_e),Le=!R;++B<Se;)Pe[B]=f[B];for(var Ue=B;++ie<_e;)Pe[Ue+ie]=v[ie];for(;++H<J;)(Le||B<F)&&(Pe[Ue+y[H]]=f[B++]);return Pe}function Lt(f,v){var y=-1,R=f.length;for(v||(v=he(R));++y<R;)v[y]=f[y];return v}function Tn(f,v,y,R){var B=!y;y||(y={});for(var F=-1,H=v.length;++F<H;){var J=v[F],ie=R?R(y[J],f[J],J,y,f):t;ie===t&&(ie=f[J]),B?$n(y,J,ie):_o(y,J,ie)}return y}function pB(f,v){return Tn(f,Wf(f),v)}function yB(f,v){return Tn(f,Kb(f),v)}function tu(f,v){return function(y,R){var B=tr(y)?ED:FI,F=v?v():{};return B(y,f,Ze(R,2),F)}}function Bi(f){return lr(function(v,y){var R=-1,B=y.length,F=B>1?y[B-1]:t,H=B>2?y[2]:t;for(F=f.length>3&&typeof F=="function"?(B--,F):t,H&&Pt(y[0],y[1],H)&&(F=B<3?t:F,B=1),v=_r(v);++R<B;){var J=y[R];J&&f(v,J,R,F)}return v})}function Lb(f,v){return function(y,R){if(y==null)return y;if(!Ot(y))return f(y,R);for(var B=y.length,F=v?B:-1,H=_r(y);(v?F--:++F<B)&&R(H[F],F,H)!==!1;);return y}}function Ob(f){return function(v,y,R){for(var B=-1,F=_r(v),H=R(v),J=H.length;J--;){var ie=H[f?J:++B];if(y(F[ie],ie,F)===!1)break}return v}}function mB(f,v,y){var R=v&m,B=Po(f);function F(){var H=this&&this!==ct&&this instanceof F?B:f;return H.apply(R?y:this,arguments)}return F}function qb(f){return function(v){v=wr(v);var y=Si(v)?gn(v):t,R=y?y[0]:v.charAt(0),B=y?ha(y,1).join(""):v.slice(1);return R[f]()+B}}function ki(f){return function(v){return uf(L1(M1(v).replace(uD,"")),f,"")}}function Po(f){return function(){var v=arguments;switch(v.length){case 0:return new f;case 1:return new f(v[0]);case 2:return new f(v[0],v[1]);case 3:return new f(v[0],v[1],v[2]);case 4:return new f(v[0],v[1],v[2],v[3]);case 5:return new f(v[0],v[1],v[2],v[3],v[4]);case 6:return new f(v[0],v[1],v[2],v[3],v[4],v[5]);case 7:return new f(v[0],v[1],v[2],v[3],v[4],v[5],v[6])}var y=Ii(f.prototype),R=f.apply(y,v);return Nr(R)?R:y}}function bB(f,v,y){var R=Po(f);function B(){for(var F=arguments.length,H=he(F),J=F,ie=Mi(B);J--;)H[J]=arguments[J];var _e=F<3&&H[0]!==ie&&H[F-1]!==ie?[]:la(H,ie);if(F-=_e.length,F<y)return Vb(f,v,nu,B.placeholder,t,H,_e,t,t,y-F);var Se=this&&this!==ct&&this instanceof B?R:f;return Wt(Se,this,H)}return B}function Nb(f){return function(v,y,R){var B=_r(v);if(!Ot(v)){var F=Ze(y,3);v=it(v),y=function(J){return F(B[J],J,B)}}var H=f(v,y,R);return H>-1?B[F?v[H]:H]:t}}function Fb(f){return Gn(function(v){var y=v.length,R=y,B=rn.prototype.thru;for(f&&v.reverse();R--;){var F=v[R];if(typeof F!="function")throw new en(o);if(B&&!H&&su(F)=="wrapper")var H=new rn([],!0)}for(R=H?R:y;++R<y;){F=v[R];var J=su(F),ie=J=="wrapper"?Vf(F):t;ie&&Hf(ie[0])&&ie[1]==(_|x|T|A)&&!ie[4].length&&ie[9]==1?H=H[su(ie[0])].apply(H,ie[3]):H=F.length==1&&Hf(F)?H[J]():H.thru(F)}return function(){var _e=arguments,Se=_e[0];if(H&&_e.length==1&&tr(Se))return H.plant(Se).value();for(var Pe=0,Le=y?v[Pe].apply(this,_e):Se;++Pe<y;)Le=v[Pe].call(this,Le);return Le}})}function nu(f,v,y,R,B,F,H,J,ie,_e){var Se=v&_,Pe=v&m,Le=v&b,Ue=v&(x|C),Qe=v&P,sr=Le?t:Po(f);function Je(){for(var cr=arguments.length,vr=he(cr),jt=cr;jt--;)vr[jt]=arguments[jt];if(Ue)var Dt=Mi(Je),Yt=ID(vr,Dt);if(R&&(vr=kb(vr,R,B,Ue)),F&&(vr=Mb(vr,F,H,Ue)),cr-=Yt,Ue&&cr<_e){var Ur=la(vr,Dt);return Vb(f,v,nu,Je.placeholder,y,vr,Ur,J,ie,_e-cr)}var mn=Pe?y:this,Kn=Le?mn[f]:f;return cr=vr.length,J?vr=FB(vr,J):Qe&&cr>1&&vr.reverse(),Se&&ie<cr&&(vr.length=ie),this&&this!==ct&&this instanceof Je&&(Kn=sr||Po(Kn)),Kn.apply(mn,vr)}return Je}function zb(f,v){return function(y,R){return KI(y,f,v(R),{})}}function au(f,v){return function(y,R){var B;if(y===t&&R===t)return v;if(y!==t&&(B=y),R!==t){if(B===t)return R;typeof y=="string"||typeof R=="string"?(y=Ht(y),R=Ht(R)):(y=Sb(y),R=Sb(R)),B=f(y,R)}return B}}function Nf(f){return Gn(function(v){return v=Mr(v,Ut(Ze())),lr(function(y){var R=this;return f(v,function(B){return Wt(B,R,y)})})})}function iu(f,v){v=v===t?" ":Ht(v);var y=v.length;if(y<2)return y?If(v,f):v;var R=If(v,Us(f/Ti(v)));return Si(v)?ha(gn(R),0,f).join(""):R.slice(0,f)}function wB(f,v,y,R){var B=v&m,F=Po(f);function H(){for(var J=-1,ie=arguments.length,_e=-1,Se=R.length,Pe=he(Se+ie),Le=this&&this!==ct&&this instanceof H?F:f;++_e<Se;)Pe[_e]=R[_e];for(;ie--;)Pe[_e++]=arguments[++J];return Wt(Le,B?y:this,Pe)}return H}function $b(f){return function(v,y,R){return R&&typeof R!="number"&&Pt(v,y,R)&&(y=R=t),v=Hn(v),y===t?(y=v,v=0):y=Hn(y),R=R===t?v<y?1:-1:Hn(R),iB(v,y,R,f)}}function ou(f){return function(v,y){return typeof v=="string"&&typeof y=="string"||(v=on(v),y=on(y)),f(v,y)}}function Vb(f,v,y,R,B,F,H,J,ie,_e){var Se=v&x,Pe=Se?H:t,Le=Se?t:H,Ue=Se?F:t,Qe=Se?t:F;v|=Se?T:S,v&=~(Se?S:T),v&w||(v&=-4);var sr=[f,v,B,Ue,Pe,Qe,Le,J,ie,_e],Je=y.apply(t,sr);return Hf(f)&&e1(Je,sr),Je.placeholder=R,r1(Je,f,v)}function Ff(f){var v=Qr[f];return function(y,R){if(y=on(y),R=R==null?0:wt(ir(R),292),R&&rb(y)){var B=(wr(y)+"e").split("e"),F=v(B[0]+"e"+(+B[1]+R));return B=(wr(F)+"e").split("e"),+(B[0]+"e"+(+B[1]-R))}return v(y)}}var xB=Pi&&1/Ls(new Pi([,-0]))[1]==q?function(f){return new Pi(f)}:sc;function Gb(f){return function(v){var y=xt(v);return y==de?gf(v):y==me?ND(v):DD(v,f(v))}}function Vn(f,v,y,R,B,F,H,J){var ie=v&b;if(!ie&&typeof f!="function")throw new en(o);var _e=R?R.length:0;if(_e||(v&=-97,R=B=t),H=H===t?H:Jr(ir(H),0),J=J===t?J:ir(J),_e-=B?B.length:0,v&S){var Se=R,Pe=B;R=B=t}var Le=ie?t:Vf(f),Ue=[f,v,y,R,B,Se,Pe,F,H,J];if(Le&&OB(Ue,Le),f=Ue[0],v=Ue[1],y=Ue[2],R=Ue[3],B=Ue[4],J=Ue[9]=Ue[9]===t?ie?0:f.length:Jr(Ue[9]-_e,0),!J&&v&(x|C)&&(v&=-25),!v||v==m)var Qe=mB(f,v,y);else v==x||v==C?Qe=bB(f,v,J):(v==T||v==(m|T))&&!B.length?Qe=wB(f,v,y,R):Qe=nu.apply(t,Ue);var sr=Le?Cb:e1;return r1(sr(Qe,Ue),f,v)}function Wb(f,v,y,R){return f===t||yn(f,Ai[y])&&!br.call(R,y)?v:f}function Ub(f,v,y,R,B,F){return Nr(f)&&Nr(v)&&(F.set(v,f),Js(f,v,t,Ub,F),F.delete(v)),f}function EB(f){return Bo(f)?t:f}function Hb(f,v,y,R,B,F){var H=y&p,J=f.length,ie=v.length;if(J!=ie&&!(H&&ie>J))return!1;var _e=F.get(f),Se=F.get(v);if(_e&&Se)return _e==v&&Se==f;var Pe=-1,Le=!0,Ue=y&E?new Ha:t;for(F.set(f,v),F.set(v,f);++Pe<J;){var Qe=f[Pe],sr=v[Pe];if(R)var Je=H?R(sr,Qe,Pe,v,f,F):R(Qe,sr,Pe,f,v,F);if(Je!==t){if(Je)continue;Le=!1;break}if(Ue){if(!lf(v,function(cr,vr){if(!mo(Ue,vr)&&(Qe===cr||B(Qe,cr,y,R,F)))return Ue.push(vr)})){Le=!1;break}}else if(!(Qe===sr||B(Qe,sr,y,R,F))){Le=!1;break}}return F.delete(f),F.delete(v),Le}function CB(f,v,y,R,B,F,H){switch(y){case Xe:if(f.byteLength!=v.byteLength||f.byteOffset!=v.byteOffset)return!1;f=f.buffer,v=v.buffer;case Ve:return!(f.byteLength!=v.byteLength||!F(new $s(f),new $s(v)));case ce:case se:case Ce:return yn(+f,+v);case Q:return f.name==v.name&&f.message==v.message;case ge:case Re:return f==v+"";case de:var J=gf;case me:var ie=R&p;if(J||(J=Ls),f.size!=v.size&&!ie)return!1;var _e=H.get(f);if(_e)return _e==v;R|=E,H.set(f,v);var Se=Hb(J(f),J(v),R,B,F,H);return H.delete(f),Se;case Ie:if(Co)return Co.call(f)==Co.call(v)}return!1}function _B(f,v,y,R,B,F){var H=y&p,J=zf(f),ie=J.length,_e=zf(v),Se=_e.length;if(ie!=Se&&!H)return!1;for(var Pe=ie;Pe--;){var Le=J[Pe];if(!(H?Le in v:br.call(v,Le)))return!1}var Ue=F.get(f),Qe=F.get(v);if(Ue&&Qe)return Ue==v&&Qe==f;var sr=!0;F.set(f,v),F.set(v,f);for(var Je=H;++Pe<ie;){Le=J[Pe];var cr=f[Le],vr=v[Le];if(R)var jt=H?R(vr,cr,Le,v,f,F):R(cr,vr,Le,f,v,F);if(!(jt===t?cr===vr||B(cr,vr,y,R,F):jt)){sr=!1;break}Je||(Je=Le=="constructor")}if(sr&&!Je){var Dt=f.constructor,Yt=v.constructor;Dt!=Yt&&"constructor"in f&&"constructor"in v&&!(typeof Dt=="function"&&Dt instanceof Dt&&typeof Yt=="function"&&Yt instanceof Yt)&&(sr=!1)}return F.delete(f),F.delete(v),sr}function Gn(f){return jf(Qb(f,t,s1),f+"")}function zf(f){return db(f,it,Wf)}function $f(f){return db(f,qt,Kb)}var Vf=Ks?function(f){return Ks.get(f)}:sc;function su(f){for(var v=f.name+"",y=Di[v],R=br.call(Di,v)?y.length:0;R--;){var B=y[R],F=B.func;if(F==null||F==f)return B.name}return v}function Mi(f){var v=br.call(O,"placeholder")?O:f;return v.placeholder}function Ze(){var f=O.iteratee||ic;return f=f===ic?gb:f,arguments.length?f(arguments[0],arguments[1]):f}function uu(f,v){var y=f.__data__;return BB(v)?y[typeof v=="string"?"string":"hash"]:y.map}function Gf(f){for(var v=it(f),y=v.length;y--;){var R=v[y],B=f[R];v[y]=[R,B,Zb(B)]}return v}function Ya(f,v){var y=LD(f,v);return hb(y)?y:t}function SB(f){var v=br.call(f,Wa),y=f[Wa];try{f[Wa]=t;var R=!0}catch{}var B=Fs.call(f);return R&&(v?f[Wa]=y:delete f[Wa]),B}var Wf=yf?function(f){return f==null?[]:(f=_r(f),sa(yf(f),function(v){return J0.call(f,v)}))}:uc,Kb=yf?function(f){for(var v=[];f;)ua(v,Wf(f)),f=Vs(f);return v}:uc,xt=At;(mf&&xt(new mf(new ArrayBuffer(1)))!=Xe||wo&&xt(new wo)!=de||bf&&xt(bf.resolve())!=fe||Pi&&xt(new Pi)!=me||xo&&xt(new xo)!=Oe)&&(xt=function(f){var v=At(f),y=v==U?f.constructor:t,R=y?Za(y):"";if(R)switch(R){case sI:return Xe;case uI:return de;case lI:return fe;case fI:return me;case cI:return Oe}return v});function TB(f,v,y){for(var R=-1,B=y.length;++R<B;){var F=y[R],H=F.size;switch(F.type){case"drop":f+=H;break;case"dropRight":v-=H;break;case"take":v=wt(v,f+H);break;case"takeRight":f=Jr(f,v-H);break}}return{start:f,end:v}}function RB(f){var v=f.match(zr);return v?v[1].split(vn):[]}function jb(f,v,y){v=va(v,f);for(var R=-1,B=v.length,F=!1;++R<B;){var H=Rn(v[R]);if(!(F=f!=null&&y(f,H)))break;f=f[H]}return F||++R!=B?F:(B=f==null?0:f.length,!!B&&gu(B)&&Wn(H,B)&&(tr(f)||Xa(f)))}function AB(f){var v=f.length,y=new f.constructor(v);return v&&typeof f[0]=="string"&&br.call(f,"index")&&(y.index=f.index,y.input=f.input),y}function Yb(f){return typeof f.constructor=="function"&&!Do(f)?Ii(Vs(f)):{}}function PB(f,v,y){var R=f.constructor;switch(v){case Ve:return qf(f);case ce:case se:return new R(+f);case Xe:return dB(f,y);case er:case $e:case Me:case pe:case L:case oe:case ye:case be:case Ee:return Ib(f,y);case de:return new R;case Ce:case Re:return new R(f);case ge:return vB(f);case me:return new R;case Ie:return hB(f)}}function DB(f,v){var y=v.length;if(!y)return f;var R=y-1;return v[R]=(y>1?"& ":"")+v[R],v=v.join(y>2?", ":" "),f.replace(_n,`{
|
|
339
|
-
/* [wrapped with `+v+`] */
|
|
340
|
-
`)}function IB(f){return tr(f)||Xa(f)||!!(eb&&f&&f[eb])}function Wn(f,v){var y=typeof f;return v=v??$,!!v&&(y=="number"||y!="symbol"&&Ds.test(f))&&f>-1&&f%1==0&&f<v}function Pt(f,v,y){if(!Nr(y))return!1;var R=typeof v;return(R=="number"?Ot(y)&&Wn(v,y.length):R=="string"&&v in y)?yn(y[v],f):!1}function Uf(f,v){if(tr(f))return!1;var y=typeof f;return y=="number"||y=="symbol"||y=="boolean"||f==null||Kt(f)?!0:Br.test(f)||!Gr.test(f)||v!=null&&f in _r(v)}function BB(f){var v=typeof f;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?f!=="__proto__":f===null}function Hf(f){var v=su(f),y=O[v];if(typeof y!="function"||!(v in dr.prototype))return!1;if(f===y)return!0;var R=Vf(y);return!!R&&f===R[0]}function kB(f){return!!Z0&&Z0 in f}var MB=qs?Un:lc;function Do(f){var v=f&&f.constructor,y=typeof v=="function"&&v.prototype||Ai;return f===y}function Zb(f){return f===f&&!Nr(f)}function Xb(f,v){return function(y){return y==null?!1:y[f]===v&&(v!==t||f in _r(y))}}function LB(f){var v=vu(f,function(R){return y.size===u&&y.clear(),R}),y=v.cache;return v}function OB(f,v){var y=f[1],R=v[1],B=y|R,F=B<(m|b|_),H=R==_&&y==x||R==_&&y==A&&f[7].length<=v[8]||R==(_|A)&&v[7].length<=v[8]&&y==x;if(!(F||H))return f;R&m&&(f[2]=v[2],B|=y&m?0:w);var J=v[3];if(J){var ie=f[3];f[3]=ie?kb(ie,J,v[4]):J,f[4]=ie?la(f[3],c):v[4]}return J=v[5],J&&(ie=f[5],f[5]=ie?Mb(ie,J,v[6]):J,f[6]=ie?la(f[5],c):v[6]),J=v[7],J&&(f[7]=J),R&_&&(f[8]=f[8]==null?v[8]:wt(f[8],v[8])),f[9]==null&&(f[9]=v[9]),f[0]=v[0],f[1]=B,f}function qB(f){var v=[];if(f!=null)for(var y in _r(f))v.push(y);return v}function NB(f){return Fs.call(f)}function Qb(f,v,y){return v=Jr(v===t?f.length-1:v,0),function(){for(var R=arguments,B=-1,F=Jr(R.length-v,0),H=he(F);++B<F;)H[B]=R[v+B];B=-1;for(var J=he(v+1);++B<v;)J[B]=R[B];return J[v]=y(H),Wt(f,this,J)}}function Jb(f,v){return v.length<2?f:ja(f,nn(v,0,-1))}function FB(f,v){for(var y=f.length,R=wt(v.length,y),B=Lt(f);R--;){var F=v[R];f[R]=Wn(F,y)?B[F]:t}return f}function Kf(f,v){if(!(v==="constructor"&&typeof f[v]=="function")&&v!="__proto__")return f[v]}var e1=t1(Cb),Io=eI||function(f,v){return ct.setTimeout(f,v)},jf=t1(uB);function r1(f,v,y){var R=v+"";return jf(f,DB(R,zB(RB(R),y)))}function t1(f){var v=0,y=0;return function(){var R=aI(),B=k-(R-y);if(y=R,B>0){if(++v>=M)return arguments[0]}else v=0;return f.apply(t,arguments)}}function lu(f,v){var y=-1,R=f.length,B=R-1;for(v=v===t?R:v;++y<v;){var F=Df(y,B),H=f[F];f[F]=f[y],f[y]=H}return f.length=v,f}var n1=LB(function(f){var v=[];return f.charCodeAt(0)===46&&v.push(""),f.replace(lt,function(y,R,B,F){v.push(B?F.replace(yi,"$1"):R||y)}),v});function Rn(f){if(typeof f=="string"||Kt(f))return f;var v=f+"";return v=="0"&&1/f==-q?"-0":v}function Za(f){if(f!=null){try{return Ns.call(f)}catch{}try{return f+""}catch{}}return""}function zB(f,v){return Jt(G,function(y){var R="_."+y[0];v&y[1]&&!ks(f,R)&&f.push(R)}),f.sort()}function a1(f){if(f instanceof dr)return f.clone();var v=new rn(f.__wrapped__,f.__chain__);return v.__actions__=Lt(f.__actions__),v.__index__=f.__index__,v.__values__=f.__values__,v}function $B(f,v,y){(y?Pt(f,v,y):v===t)?v=1:v=Jr(ir(v),0);var R=f==null?0:f.length;if(!R||v<1)return[];for(var B=0,F=0,H=he(Us(R/v));B<R;)H[F++]=nn(f,B,B+=v);return H}function VB(f){for(var v=-1,y=f==null?0:f.length,R=0,B=[];++v<y;){var F=f[v];F&&(B[R++]=F)}return B}function GB(){var f=arguments.length;if(!f)return[];for(var v=he(f-1),y=arguments[0],R=f;R--;)v[R-1]=arguments[R];return ua(tr(y)?Lt(y):[y],dt(v,1))}var WB=lr(function(f,v){return Wr(f)?So(f,dt(v,1,Wr,!0)):[]}),UB=lr(function(f,v){var y=an(v);return Wr(y)&&(y=t),Wr(f)?So(f,dt(v,1,Wr,!0),Ze(y,2)):[]}),HB=lr(function(f,v){var y=an(v);return Wr(y)&&(y=t),Wr(f)?So(f,dt(v,1,Wr,!0),t,y):[]});function KB(f,v,y){var R=f==null?0:f.length;return R?(v=y||v===t?1:ir(v),nn(f,v<0?0:v,R)):[]}function jB(f,v,y){var R=f==null?0:f.length;return R?(v=y||v===t?1:ir(v),v=R-v,nn(f,0,v<0?0:v)):[]}function YB(f,v){return f&&f.length?ru(f,Ze(v,3),!0,!0):[]}function ZB(f,v){return f&&f.length?ru(f,Ze(v,3),!0):[]}function XB(f,v,y,R){var B=f==null?0:f.length;return B?(y&&typeof y!="number"&&Pt(f,v,y)&&(y=0,R=B),GI(f,v,y,R)):[]}function i1(f,v,y){var R=f==null?0:f.length;if(!R)return-1;var B=y==null?0:ir(y);return B<0&&(B=Jr(R+B,0)),Ms(f,Ze(v,3),B)}function o1(f,v,y){var R=f==null?0:f.length;if(!R)return-1;var B=R-1;return y!==t&&(B=ir(y),B=y<0?Jr(R+B,0):wt(B,R-1)),Ms(f,Ze(v,3),B,!0)}function s1(f){var v=f==null?0:f.length;return v?dt(f,1):[]}function QB(f){var v=f==null?0:f.length;return v?dt(f,q):[]}function JB(f,v){var y=f==null?0:f.length;return y?(v=v===t?1:ir(v),dt(f,v)):[]}function ek(f){for(var v=-1,y=f==null?0:f.length,R={};++v<y;){var B=f[v];R[B[0]]=B[1]}return R}function u1(f){return f&&f.length?f[0]:t}function rk(f,v,y){var R=f==null?0:f.length;if(!R)return-1;var B=y==null?0:ir(y);return B<0&&(B=Jr(R+B,0)),_i(f,v,B)}function tk(f){var v=f==null?0:f.length;return v?nn(f,0,-1):[]}var nk=lr(function(f){var v=Mr(f,Lf);return v.length&&v[0]===f[0]?Sf(v):[]}),ak=lr(function(f){var v=an(f),y=Mr(f,Lf);return v===an(y)?v=t:y.pop(),y.length&&y[0]===f[0]?Sf(y,Ze(v,2)):[]}),ik=lr(function(f){var v=an(f),y=Mr(f,Lf);return v=typeof v=="function"?v:t,v&&y.pop(),y.length&&y[0]===f[0]?Sf(y,t,v):[]});function ok(f,v){return f==null?"":tI.call(f,v)}function an(f){var v=f==null?0:f.length;return v?f[v-1]:t}function sk(f,v,y){var R=f==null?0:f.length;if(!R)return-1;var B=R;return y!==t&&(B=ir(y),B=B<0?Jr(R+B,0):wt(B,R-1)),v===v?zD(f,v,B):Ms(f,V0,B,!0)}function uk(f,v){return f&&f.length?bb(f,ir(v)):t}var lk=lr(l1);function l1(f,v){return f&&f.length&&v&&v.length?Pf(f,v):f}function fk(f,v,y){return f&&f.length&&v&&v.length?Pf(f,v,Ze(y,2)):f}function ck(f,v,y){return f&&f.length&&v&&v.length?Pf(f,v,t,y):f}var dk=Gn(function(f,v){var y=f==null?0:f.length,R=xf(f,v);return Eb(f,Mr(v,function(B){return Wn(B,y)?+B:B}).sort(Bb)),R});function vk(f,v){var y=[];if(!(f&&f.length))return y;var R=-1,B=[],F=f.length;for(v=Ze(v,3);++R<F;){var H=f[R];v(H,R,f)&&(y.push(H),B.push(R))}return Eb(f,B),y}function Yf(f){return f==null?f:oI.call(f)}function hk(f,v,y){var R=f==null?0:f.length;return R?(y&&typeof y!="number"&&Pt(f,v,y)?(v=0,y=R):(v=v==null?0:ir(v),y=y===t?R:ir(y)),nn(f,v,y)):[]}function gk(f,v){return eu(f,v)}function pk(f,v,y){return Bf(f,v,Ze(y,2))}function yk(f,v){var y=f==null?0:f.length;if(y){var R=eu(f,v);if(R<y&&yn(f[R],v))return R}return-1}function mk(f,v){return eu(f,v,!0)}function bk(f,v,y){return Bf(f,v,Ze(y,2),!0)}function wk(f,v){var y=f==null?0:f.length;if(y){var R=eu(f,v,!0)-1;if(yn(f[R],v))return R}return-1}function xk(f){return f&&f.length?_b(f):[]}function Ek(f,v){return f&&f.length?_b(f,Ze(v,2)):[]}function Ck(f){var v=f==null?0:f.length;return v?nn(f,1,v):[]}function _k(f,v,y){return f&&f.length?(v=y||v===t?1:ir(v),nn(f,0,v<0?0:v)):[]}function Sk(f,v,y){var R=f==null?0:f.length;return R?(v=y||v===t?1:ir(v),v=R-v,nn(f,v<0?0:v,R)):[]}function Tk(f,v){return f&&f.length?ru(f,Ze(v,3),!1,!0):[]}function Rk(f,v){return f&&f.length?ru(f,Ze(v,3)):[]}var Ak=lr(function(f){return da(dt(f,1,Wr,!0))}),Pk=lr(function(f){var v=an(f);return Wr(v)&&(v=t),da(dt(f,1,Wr,!0),Ze(v,2))}),Dk=lr(function(f){var v=an(f);return v=typeof v=="function"?v:t,da(dt(f,1,Wr,!0),t,v)});function Ik(f){return f&&f.length?da(f):[]}function Bk(f,v){return f&&f.length?da(f,Ze(v,2)):[]}function kk(f,v){return v=typeof v=="function"?v:t,f&&f.length?da(f,t,v):[]}function Zf(f){if(!(f&&f.length))return[];var v=0;return f=sa(f,function(y){if(Wr(y))return v=Jr(y.length,v),!0}),vf(v,function(y){return Mr(f,ff(y))})}function f1(f,v){if(!(f&&f.length))return[];var y=Zf(f);return v==null?y:Mr(y,function(R){return Wt(v,t,R)})}var Mk=lr(function(f,v){return Wr(f)?So(f,v):[]}),Lk=lr(function(f){return Mf(sa(f,Wr))}),Ok=lr(function(f){var v=an(f);return Wr(v)&&(v=t),Mf(sa(f,Wr),Ze(v,2))}),qk=lr(function(f){var v=an(f);return v=typeof v=="function"?v:t,Mf(sa(f,Wr),t,v)}),Nk=lr(Zf);function Fk(f,v){return Ab(f||[],v||[],_o)}function zk(f,v){return Ab(f||[],v||[],Ao)}var $k=lr(function(f){var v=f.length,y=v>1?f[v-1]:t;return y=typeof y=="function"?(f.pop(),y):t,f1(f,y)});function c1(f){var v=O(f);return v.__chain__=!0,v}function Vk(f,v){return v(f),f}function fu(f,v){return v(f)}var Gk=Gn(function(f){var v=f.length,y=v?f[0]:0,R=this.__wrapped__,B=function(F){return xf(F,f)};return v>1||this.__actions__.length||!(R instanceof dr)||!Wn(y)?this.thru(B):(R=R.slice(y,+y+(v?1:0)),R.__actions__.push({func:fu,args:[B],thisArg:t}),new rn(R,this.__chain__).thru(function(F){return v&&!F.length&&F.push(t),F}))});function Wk(){return c1(this)}function Uk(){return new rn(this.value(),this.__chain__)}function Hk(){this.__values__===t&&(this.__values__=S1(this.value()));var f=this.__index__>=this.__values__.length,v=f?t:this.__values__[this.__index__++];return{done:f,value:v}}function Kk(){return this}function jk(f){for(var v,y=this;y instanceof Ys;){var R=a1(y);R.__index__=0,R.__values__=t,v?B.__wrapped__=R:v=R;var B=R;y=y.__wrapped__}return B.__wrapped__=f,v}function Yk(){var f=this.__wrapped__;if(f instanceof dr){var v=f;return this.__actions__.length&&(v=new dr(this)),v=v.reverse(),v.__actions__.push({func:fu,args:[Yf],thisArg:t}),new rn(v,this.__chain__)}return this.thru(Yf)}function Zk(){return Rb(this.__wrapped__,this.__actions__)}var Xk=tu(function(f,v,y){br.call(f,y)?++f[y]:$n(f,y,1)});function Qk(f,v,y){var R=tr(f)?z0:VI;return y&&Pt(f,v,y)&&(v=t),R(f,Ze(v,3))}function Jk(f,v){var y=tr(f)?sa:fb;return y(f,Ze(v,3))}var eM=Nb(i1),rM=Nb(o1);function tM(f,v){return dt(cu(f,v),1)}function nM(f,v){return dt(cu(f,v),q)}function aM(f,v,y){return y=y===t?1:ir(y),dt(cu(f,v),y)}function d1(f,v){var y=tr(f)?Jt:ca;return y(f,Ze(v,3))}function v1(f,v){var y=tr(f)?CD:lb;return y(f,Ze(v,3))}var iM=tu(function(f,v,y){br.call(f,y)?f[y].push(v):$n(f,y,[v])});function oM(f,v,y,R){f=Ot(f)?f:Oi(f),y=y&&!R?ir(y):0;var B=f.length;return y<0&&(y=Jr(B+y,0)),pu(f)?y<=B&&f.indexOf(v,y)>-1:!!B&&_i(f,v,y)>-1}var sM=lr(function(f,v,y){var R=-1,B=typeof v=="function",F=Ot(f)?he(f.length):[];return ca(f,function(H){F[++R]=B?Wt(v,H,y):To(H,v,y)}),F}),uM=tu(function(f,v,y){$n(f,y,v)});function cu(f,v){var y=tr(f)?Mr:pb;return y(f,Ze(v,3))}function lM(f,v,y,R){return f==null?[]:(tr(v)||(v=v==null?[]:[v]),y=R?t:y,tr(y)||(y=y==null?[]:[y]),wb(f,v,y))}var fM=tu(function(f,v,y){f[y?0:1].push(v)},function(){return[[],[]]});function cM(f,v,y){var R=tr(f)?uf:W0,B=arguments.length<3;return R(f,Ze(v,4),y,B,ca)}function dM(f,v,y){var R=tr(f)?_D:W0,B=arguments.length<3;return R(f,Ze(v,4),y,B,lb)}function vM(f,v){var y=tr(f)?sa:fb;return y(f,hu(Ze(v,3)))}function hM(f){var v=tr(f)?ib:oB;return v(f)}function gM(f,v,y){(y?Pt(f,v,y):v===t)?v=1:v=ir(v);var R=tr(f)?qI:sB;return R(f,v)}function pM(f){var v=tr(f)?NI:lB;return v(f)}function yM(f){if(f==null)return 0;if(Ot(f))return pu(f)?Ti(f):f.length;var v=xt(f);return v==de||v==me?f.size:Rf(f).length}function mM(f,v,y){var R=tr(f)?lf:fB;return y&&Pt(f,v,y)&&(v=t),R(f,Ze(v,3))}var bM=lr(function(f,v){if(f==null)return[];var y=v.length;return y>1&&Pt(f,v[0],v[1])?v=[]:y>2&&Pt(v[0],v[1],v[2])&&(v=[v[0]]),wb(f,dt(v,1),[])}),du=JD||function(){return ct.Date.now()};function wM(f,v){if(typeof v!="function")throw new en(o);return f=ir(f),function(){if(--f<1)return v.apply(this,arguments)}}function h1(f,v,y){return v=y?t:v,v=f&&v==null?f.length:v,Vn(f,_,t,t,t,t,v)}function g1(f,v){var y;if(typeof v!="function")throw new en(o);return f=ir(f),function(){return--f>0&&(y=v.apply(this,arguments)),f<=1&&(v=t),y}}var Xf=lr(function(f,v,y){var R=m;if(y.length){var B=la(y,Mi(Xf));R|=T}return Vn(f,R,v,y,B)}),p1=lr(function(f,v,y){var R=m|b;if(y.length){var B=la(y,Mi(p1));R|=T}return Vn(v,R,f,y,B)});function y1(f,v,y){v=y?t:v;var R=Vn(f,x,t,t,t,t,t,v);return R.placeholder=y1.placeholder,R}function m1(f,v,y){v=y?t:v;var R=Vn(f,C,t,t,t,t,t,v);return R.placeholder=m1.placeholder,R}function b1(f,v,y){var R,B,F,H,J,ie,_e=0,Se=!1,Pe=!1,Le=!0;if(typeof f!="function")throw new en(o);v=on(v)||0,Nr(y)&&(Se=!!y.leading,Pe="maxWait"in y,F=Pe?Jr(on(y.maxWait)||0,v):F,Le="trailing"in y?!!y.trailing:Le);function Ue(Ur){var mn=R,Kn=B;return R=B=t,_e=Ur,H=f.apply(Kn,mn),H}function Qe(Ur){return _e=Ur,J=Io(cr,v),Se?Ue(Ur):H}function sr(Ur){var mn=Ur-ie,Kn=Ur-_e,N1=v-mn;return Pe?wt(N1,F-Kn):N1}function Je(Ur){var mn=Ur-ie,Kn=Ur-_e;return ie===t||mn>=v||mn<0||Pe&&Kn>=F}function cr(){var Ur=du();if(Je(Ur))return vr(Ur);J=Io(cr,sr(Ur))}function vr(Ur){return J=t,Le&&R?Ue(Ur):(R=B=t,H)}function jt(){J!==t&&Pb(J),_e=0,R=ie=B=J=t}function Dt(){return J===t?H:vr(du())}function Yt(){var Ur=du(),mn=Je(Ur);if(R=arguments,B=this,ie=Ur,mn){if(J===t)return Qe(ie);if(Pe)return Pb(J),J=Io(cr,v),Ue(ie)}return J===t&&(J=Io(cr,v)),H}return Yt.cancel=jt,Yt.flush=Dt,Yt}var xM=lr(function(f,v){return ub(f,1,v)}),EM=lr(function(f,v,y){return ub(f,on(v)||0,y)});function CM(f){return Vn(f,P)}function vu(f,v){if(typeof f!="function"||v!=null&&typeof v!="function")throw new en(o);var y=function(){var R=arguments,B=v?v.apply(this,R):R[0],F=y.cache;if(F.has(B))return F.get(B);var H=f.apply(this,R);return y.cache=F.set(B,H)||F,H};return y.cache=new(vu.Cache||zn),y}vu.Cache=zn;function hu(f){if(typeof f!="function")throw new en(o);return function(){var v=arguments;switch(v.length){case 0:return!f.call(this);case 1:return!f.call(this,v[0]);case 2:return!f.call(this,v[0],v[1]);case 3:return!f.call(this,v[0],v[1],v[2])}return!f.apply(this,v)}}function _M(f){return g1(2,f)}var SM=cB(function(f,v){v=v.length==1&&tr(v[0])?Mr(v[0],Ut(Ze())):Mr(dt(v,1),Ut(Ze()));var y=v.length;return lr(function(R){for(var B=-1,F=wt(R.length,y);++B<F;)R[B]=v[B].call(this,R[B]);return Wt(f,this,R)})}),Qf=lr(function(f,v){var y=la(v,Mi(Qf));return Vn(f,T,t,v,y)}),w1=lr(function(f,v){var y=la(v,Mi(w1));return Vn(f,S,t,v,y)}),TM=Gn(function(f,v){return Vn(f,A,t,t,t,v)});function RM(f,v){if(typeof f!="function")throw new en(o);return v=v===t?v:ir(v),lr(f,v)}function AM(f,v){if(typeof f!="function")throw new en(o);return v=v==null?0:Jr(ir(v),0),lr(function(y){var R=y[v],B=ha(y,0,v);return R&&ua(B,R),Wt(f,this,B)})}function PM(f,v,y){var R=!0,B=!0;if(typeof f!="function")throw new en(o);return Nr(y)&&(R="leading"in y?!!y.leading:R,B="trailing"in y?!!y.trailing:B),b1(f,v,{leading:R,maxWait:v,trailing:B})}function DM(f){return h1(f,1)}function IM(f,v){return Qf(Of(v),f)}function BM(){if(!arguments.length)return[];var f=arguments[0];return tr(f)?f:[f]}function kM(f){return tn(f,g)}function MM(f,v){return v=typeof v=="function"?v:t,tn(f,g,v)}function LM(f){return tn(f,d|g)}function OM(f,v){return v=typeof v=="function"?v:t,tn(f,d|g,v)}function qM(f,v){return v==null||sb(f,v,it(v))}function yn(f,v){return f===v||f!==f&&v!==v}var NM=ou(_f),FM=ou(function(f,v){return f>=v}),Xa=vb((function(){return arguments})())?vb:function(f){return $r(f)&&br.call(f,"callee")&&!J0.call(f,"callee")},tr=he.isArray,zM=M0?Ut(M0):jI;function Ot(f){return f!=null&&gu(f.length)&&!Un(f)}function Wr(f){return $r(f)&&Ot(f)}function $M(f){return f===!0||f===!1||$r(f)&&At(f)==ce}var ga=rI||lc,VM=L0?Ut(L0):YI;function GM(f){return $r(f)&&f.nodeType===1&&!Bo(f)}function WM(f){if(f==null)return!0;if(Ot(f)&&(tr(f)||typeof f=="string"||typeof f.splice=="function"||ga(f)||Li(f)||Xa(f)))return!f.length;var v=xt(f);if(v==de||v==me)return!f.size;if(Do(f))return!Rf(f).length;for(var y in f)if(br.call(f,y))return!1;return!0}function UM(f,v){return Ro(f,v)}function HM(f,v,y){y=typeof y=="function"?y:t;var R=y?y(f,v):t;return R===t?Ro(f,v,t,y):!!R}function Jf(f){if(!$r(f))return!1;var v=At(f);return v==Q||v==Z||typeof f.message=="string"&&typeof f.name=="string"&&!Bo(f)}function KM(f){return typeof f=="number"&&rb(f)}function Un(f){if(!Nr(f))return!1;var v=At(f);return v==ae||v==ne||v==re||v==we}function x1(f){return typeof f=="number"&&f==ir(f)}function gu(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=$}function Nr(f){var v=typeof f;return f!=null&&(v=="object"||v=="function")}function $r(f){return f!=null&&typeof f=="object"}var E1=O0?Ut(O0):XI;function jM(f,v){return f===v||Tf(f,v,Gf(v))}function YM(f,v,y){return y=typeof y=="function"?y:t,Tf(f,v,Gf(v),y)}function ZM(f){return C1(f)&&f!=+f}function XM(f){if(MB(f))throw new rr(i);return hb(f)}function QM(f){return f===null}function JM(f){return f==null}function C1(f){return typeof f=="number"||$r(f)&&At(f)==Ce}function Bo(f){if(!$r(f)||At(f)!=U)return!1;var v=Vs(f);if(v===null)return!0;var y=br.call(v,"constructor")&&v.constructor;return typeof y=="function"&&y instanceof y&&Ns.call(y)==YD}var ec=q0?Ut(q0):QI;function eL(f){return x1(f)&&f>=-$&&f<=$}var _1=N0?Ut(N0):JI;function pu(f){return typeof f=="string"||!tr(f)&&$r(f)&&At(f)==Re}function Kt(f){return typeof f=="symbol"||$r(f)&&At(f)==Ie}var Li=F0?Ut(F0):eB;function rL(f){return f===t}function tL(f){return $r(f)&&xt(f)==Oe}function nL(f){return $r(f)&&At(f)==He}var aL=ou(Af),iL=ou(function(f,v){return f<=v});function S1(f){if(!f)return[];if(Ot(f))return pu(f)?gn(f):Lt(f);if(bo&&f[bo])return qD(f[bo]());var v=xt(f),y=v==de?gf:v==me?Ls:Oi;return y(f)}function Hn(f){if(!f)return f===0?f:0;if(f=on(f),f===q||f===-q){var v=f<0?-1:1;return v*X}return f===f?f:0}function ir(f){var v=Hn(f),y=v%1;return v===v?y?v-y:v:0}function T1(f){return f?Ka(ir(f),0,K):0}function on(f){if(typeof f=="number")return f;if(Kt(f))return Y;if(Nr(f)){var v=typeof f.valueOf=="function"?f.valueOf():f;f=Nr(v)?v+"":v}if(typeof f!="string")return f===0?f:+f;f=U0(f);var y=bt.test(f);return y||Mt.test(f)?wD(f.slice(2),y?2:8):at.test(f)?Y:+f}function R1(f){return Tn(f,qt(f))}function oL(f){return f?Ka(ir(f),-$,$):f===0?f:0}function wr(f){return f==null?"":Ht(f)}var sL=Bi(function(f,v){if(Do(v)||Ot(v)){Tn(v,it(v),f);return}for(var y in v)br.call(v,y)&&_o(f,y,v[y])}),A1=Bi(function(f,v){Tn(v,qt(v),f)}),yu=Bi(function(f,v,y,R){Tn(v,qt(v),f,R)}),uL=Bi(function(f,v,y,R){Tn(v,it(v),f,R)}),lL=Gn(xf);function fL(f,v){var y=Ii(f);return v==null?y:ob(y,v)}var cL=lr(function(f,v){f=_r(f);var y=-1,R=v.length,B=R>2?v[2]:t;for(B&&Pt(v[0],v[1],B)&&(R=1);++y<R;)for(var F=v[y],H=qt(F),J=-1,ie=H.length;++J<ie;){var _e=H[J],Se=f[_e];(Se===t||yn(Se,Ai[_e])&&!br.call(f,_e))&&(f[_e]=F[_e])}return f}),dL=lr(function(f){return f.push(t,Ub),Wt(P1,t,f)});function vL(f,v){return $0(f,Ze(v,3),Sn)}function hL(f,v){return $0(f,Ze(v,3),Cf)}function gL(f,v){return f==null?f:Ef(f,Ze(v,3),qt)}function pL(f,v){return f==null?f:cb(f,Ze(v,3),qt)}function yL(f,v){return f&&Sn(f,Ze(v,3))}function mL(f,v){return f&&Cf(f,Ze(v,3))}function bL(f){return f==null?[]:Qs(f,it(f))}function wL(f){return f==null?[]:Qs(f,qt(f))}function rc(f,v,y){var R=f==null?t:ja(f,v);return R===t?y:R}function xL(f,v){return f!=null&&jb(f,v,WI)}function tc(f,v){return f!=null&&jb(f,v,UI)}var EL=zb(function(f,v,y){v!=null&&typeof v.toString!="function"&&(v=Fs.call(v)),f[v]=y},ac(Nt)),CL=zb(function(f,v,y){v!=null&&typeof v.toString!="function"&&(v=Fs.call(v)),br.call(f,v)?f[v].push(y):f[v]=[y]},Ze),_L=lr(To);function it(f){return Ot(f)?ab(f):Rf(f)}function qt(f){return Ot(f)?ab(f,!0):rB(f)}function SL(f,v){var y={};return v=Ze(v,3),Sn(f,function(R,B,F){$n(y,v(R,B,F),R)}),y}function TL(f,v){var y={};return v=Ze(v,3),Sn(f,function(R,B,F){$n(y,B,v(R,B,F))}),y}var RL=Bi(function(f,v,y){Js(f,v,y)}),P1=Bi(function(f,v,y,R){Js(f,v,y,R)}),AL=Gn(function(f,v){var y={};if(f==null)return y;var R=!1;v=Mr(v,function(F){return F=va(F,f),R||(R=F.length>1),F}),Tn(f,$f(f),y),R&&(y=tn(y,d|h|g,EB));for(var B=v.length;B--;)kf(y,v[B]);return y});function PL(f,v){return D1(f,hu(Ze(v)))}var DL=Gn(function(f,v){return f==null?{}:nB(f,v)});function D1(f,v){if(f==null)return{};var y=Mr($f(f),function(R){return[R]});return v=Ze(v),xb(f,y,function(R,B){return v(R,B[0])})}function IL(f,v,y){v=va(v,f);var R=-1,B=v.length;for(B||(B=1,f=t);++R<B;){var F=f==null?t:f[Rn(v[R])];F===t&&(R=B,F=y),f=Un(F)?F.call(f):F}return f}function BL(f,v,y){return f==null?f:Ao(f,v,y)}function kL(f,v,y,R){return R=typeof R=="function"?R:t,f==null?f:Ao(f,v,y,R)}var I1=Gb(it),B1=Gb(qt);function ML(f,v,y){var R=tr(f),B=R||ga(f)||Li(f);if(v=Ze(v,4),y==null){var F=f&&f.constructor;B?y=R?new F:[]:Nr(f)?y=Un(F)?Ii(Vs(f)):{}:y={}}return(B?Jt:Sn)(f,function(H,J,ie){return v(y,H,J,ie)}),y}function LL(f,v){return f==null?!0:kf(f,v)}function OL(f,v,y){return f==null?f:Tb(f,v,Of(y))}function qL(f,v,y,R){return R=typeof R=="function"?R:t,f==null?f:Tb(f,v,Of(y),R)}function Oi(f){return f==null?[]:hf(f,it(f))}function NL(f){return f==null?[]:hf(f,qt(f))}function FL(f,v,y){return y===t&&(y=v,v=t),y!==t&&(y=on(y),y=y===y?y:0),v!==t&&(v=on(v),v=v===v?v:0),Ka(on(f),v,y)}function zL(f,v,y){return v=Hn(v),y===t?(y=v,v=0):y=Hn(y),f=on(f),HI(f,v,y)}function $L(f,v,y){if(y&&typeof y!="boolean"&&Pt(f,v,y)&&(v=y=t),y===t&&(typeof v=="boolean"?(y=v,v=t):typeof f=="boolean"&&(y=f,f=t)),f===t&&v===t?(f=0,v=1):(f=Hn(f),v===t?(v=f,f=0):v=Hn(v)),f>v){var R=f;f=v,v=R}if(y||f%1||v%1){var B=tb();return wt(f+B*(v-f+bD("1e-"+((B+"").length-1))),v)}return Df(f,v)}var VL=ki(function(f,v,y){return v=v.toLowerCase(),f+(y?k1(v):v)});function k1(f){return nc(wr(f).toLowerCase())}function M1(f){return f=wr(f),f&&f.replace(Hl,BD).replace(lD,"")}function GL(f,v,y){f=wr(f),v=Ht(v);var R=f.length;y=y===t?R:Ka(ir(y),0,R);var B=y;return y-=v.length,y>=0&&f.slice(y,B)==v}function WL(f){return f=wr(f),f&&nr.test(f)?f.replace(je,kD):f}function UL(f){return f=wr(f),f&&Kr.test(f)?f.replace(kr,"\\$&"):f}var HL=ki(function(f,v,y){return f+(y?"-":"")+v.toLowerCase()}),KL=ki(function(f,v,y){return f+(y?" ":"")+v.toLowerCase()}),jL=qb("toLowerCase");function YL(f,v,y){f=wr(f),v=ir(v);var R=v?Ti(f):0;if(!v||R>=v)return f;var B=(v-R)/2;return iu(Hs(B),y)+f+iu(Us(B),y)}function ZL(f,v,y){f=wr(f),v=ir(v);var R=v?Ti(f):0;return v&&R<v?f+iu(v-R,y):f}function XL(f,v,y){f=wr(f),v=ir(v);var R=v?Ti(f):0;return v&&R<v?iu(v-R,y)+f:f}function QL(f,v,y){return y||v==null?v=0:v&&(v=+v),iI(wr(f).replace(qr,""),v||0)}function JL(f,v,y){return(y?Pt(f,v,y):v===t)?v=1:v=ir(v),If(wr(f),v)}function eO(){var f=arguments,v=wr(f[0]);return f.length<3?v:v.replace(f[1],f[2])}var rO=ki(function(f,v,y){return f+(y?"_":"")+v.toLowerCase()});function tO(f,v,y){return y&&typeof y!="number"&&Pt(f,v,y)&&(v=y=t),y=y===t?K:y>>>0,y?(f=wr(f),f&&(typeof v=="string"||v!=null&&!ec(v))&&(v=Ht(v),!v&&Si(f))?ha(gn(f),0,y):f.split(v,y)):[]}var nO=ki(function(f,v,y){return f+(y?" ":"")+nc(v)});function aO(f,v,y){return f=wr(f),y=y==null?0:Ka(ir(y),0,f.length),v=Ht(v),f.slice(y,y+v.length)==v}function iO(f,v,y){var R=O.templateSettings;y&&Pt(f,v,y)&&(v=t),f=wr(f),v=yu({},v,R,Wb);var B=yu({},v.imports,R.imports,Wb),F=it(B),H=hf(B,F),J,ie,_e=0,Se=v.interpolate||mi,Pe="__p += '",Le=pf((v.escape||mi).source+"|"+Se.source+"|"+(Se===ar?Nn:mi).source+"|"+(v.evaluate||mi).source+"|$","g"),Ue="//# sourceURL="+(br.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++hD+"]")+`
|
|
341
|
-
`;f.replace(Le,function(Je,cr,vr,jt,Dt,Yt){return vr||(vr=jt),Pe+=f.slice(_e,Yt).replace(Kl,MD),cr&&(J=!0,Pe+=`' +
|
|
342
|
-
__e(`+cr+`) +
|
|
343
|
-
'`),Dt&&(ie=!0,Pe+=`';
|
|
344
|
-
`+Dt+`;
|
|
345
|
-
__p += '`),vr&&(Pe+=`' +
|
|
346
|
-
((__t = (`+vr+`)) == null ? '' : __t) +
|
|
347
|
-
'`),_e=Yt+Je.length,Je}),Pe+=`';
|
|
348
|
-
`;var Qe=br.call(v,"variable")&&v.variable;if(!Qe)Pe=`with (obj) {
|
|
349
|
-
`+Pe+`
|
|
350
|
-
}
|
|
351
|
-
`;else if(aa.test(Qe))throw new rr(s);Pe=(ie?Pe.replace(qe,""):Pe).replace(Ae,"$1").replace(Ge,"$1;"),Pe="function("+(Qe||"obj")+`) {
|
|
352
|
-
`+(Qe?"":`obj || (obj = {});
|
|
353
|
-
`)+"var __t, __p = ''"+(J?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join;
|
|
354
|
-
function print() { __p += __j.call(arguments, '') }
|
|
355
|
-
`:`;
|
|
356
|
-
`)+Pe+`return __p
|
|
357
|
-
}`;var sr=O1(function(){return mr(F,Ue+"return "+Pe).apply(t,H)});if(sr.source=Pe,Jf(sr))throw sr;return sr}function oO(f){return wr(f).toLowerCase()}function sO(f){return wr(f).toUpperCase()}function uO(f,v,y){if(f=wr(f),f&&(y||v===t))return U0(f);if(!f||!(v=Ht(v)))return f;var R=gn(f),B=gn(v),F=H0(R,B),H=K0(R,B)+1;return ha(R,F,H).join("")}function lO(f,v,y){if(f=wr(f),f&&(y||v===t))return f.slice(0,Y0(f)+1);if(!f||!(v=Ht(v)))return f;var R=gn(f),B=K0(R,gn(v))+1;return ha(R,0,B).join("")}function fO(f,v,y){if(f=wr(f),f&&(y||v===t))return f.replace(qr,"");if(!f||!(v=Ht(v)))return f;var R=gn(f),B=H0(R,gn(v));return ha(R,B).join("")}function cO(f,v){var y=D,R=I;if(Nr(v)){var B="separator"in v?v.separator:B;y="length"in v?ir(v.length):y,R="omission"in v?Ht(v.omission):R}f=wr(f);var F=f.length;if(Si(f)){var H=gn(f);F=H.length}if(y>=F)return f;var J=y-Ti(R);if(J<1)return R;var ie=H?ha(H,0,J).join(""):f.slice(0,J);if(B===t)return ie+R;if(H&&(J+=ie.length-J),ec(B)){if(f.slice(J).search(B)){var _e,Se=ie;for(B.global||(B=pf(B.source,wr(ft.exec(B))+"g")),B.lastIndex=0;_e=B.exec(Se);)var Pe=_e.index;ie=ie.slice(0,Pe===t?J:Pe)}}else if(f.indexOf(Ht(B),J)!=J){var Le=ie.lastIndexOf(B);Le>-1&&(ie=ie.slice(0,Le))}return ie+R}function dO(f){return f=wr(f),f&&or.test(f)?f.replace(Fe,$D):f}var vO=ki(function(f,v,y){return f+(y?" ":"")+v.toUpperCase()}),nc=qb("toUpperCase");function L1(f,v,y){return f=wr(f),v=y?t:v,v===t?OD(f)?WD(f):RD(f):f.match(v)||[]}var O1=lr(function(f,v){try{return Wt(f,t,v)}catch(y){return Jf(y)?y:new rr(y)}}),hO=Gn(function(f,v){return Jt(v,function(y){y=Rn(y),$n(f,y,Xf(f[y],f))}),f});function gO(f){var v=f==null?0:f.length,y=Ze();return f=v?Mr(f,function(R){if(typeof R[1]!="function")throw new en(o);return[y(R[0]),R[1]]}):[],lr(function(R){for(var B=-1;++B<v;){var F=f[B];if(Wt(F[0],this,R))return Wt(F[1],this,R)}})}function pO(f){return $I(tn(f,d))}function ac(f){return function(){return f}}function yO(f,v){return f==null||f!==f?v:f}var mO=Fb(),bO=Fb(!0);function Nt(f){return f}function ic(f){return gb(typeof f=="function"?f:tn(f,d))}function wO(f){return yb(tn(f,d))}function xO(f,v){return mb(f,tn(v,d))}var EO=lr(function(f,v){return function(y){return To(y,f,v)}}),CO=lr(function(f,v){return function(y){return To(f,y,v)}});function oc(f,v,y){var R=it(v),B=Qs(v,R);y==null&&!(Nr(v)&&(B.length||!R.length))&&(y=v,v=f,f=this,B=Qs(v,it(v)));var F=!(Nr(y)&&"chain"in y)||!!y.chain,H=Un(f);return Jt(B,function(J){var ie=v[J];f[J]=ie,H&&(f.prototype[J]=function(){var _e=this.__chain__;if(F||_e){var Se=f(this.__wrapped__),Pe=Se.__actions__=Lt(this.__actions__);return Pe.push({func:ie,args:arguments,thisArg:f}),Se.__chain__=_e,Se}return ie.apply(f,ua([this.value()],arguments))})}),f}function _O(){return ct._===this&&(ct._=ZD),this}function sc(){}function SO(f){return f=ir(f),lr(function(v){return bb(v,f)})}var TO=Nf(Mr),RO=Nf(z0),AO=Nf(lf);function q1(f){return Uf(f)?ff(Rn(f)):aB(f)}function PO(f){return function(v){return f==null?t:ja(f,v)}}var DO=$b(),IO=$b(!0);function uc(){return[]}function lc(){return!1}function BO(){return{}}function kO(){return""}function MO(){return!0}function LO(f,v){if(f=ir(f),f<1||f>$)return[];var y=K,R=wt(f,K);v=Ze(v),f-=K;for(var B=vf(R,v);++y<f;)v(y);return B}function OO(f){return tr(f)?Mr(f,Rn):Kt(f)?[f]:Lt(n1(wr(f)))}function qO(f){var v=++jD;return wr(f)+v}var NO=au(function(f,v){return f+v},0),FO=Ff("ceil"),zO=au(function(f,v){return f/v},1),$O=Ff("floor");function VO(f){return f&&f.length?Xs(f,Nt,_f):t}function GO(f,v){return f&&f.length?Xs(f,Ze(v,2),_f):t}function WO(f){return G0(f,Nt)}function UO(f,v){return G0(f,Ze(v,2))}function HO(f){return f&&f.length?Xs(f,Nt,Af):t}function KO(f,v){return f&&f.length?Xs(f,Ze(v,2),Af):t}var jO=au(function(f,v){return f*v},1),YO=Ff("round"),ZO=au(function(f,v){return f-v},0);function XO(f){return f&&f.length?df(f,Nt):0}function QO(f,v){return f&&f.length?df(f,Ze(v,2)):0}return O.after=wM,O.ary=h1,O.assign=sL,O.assignIn=A1,O.assignInWith=yu,O.assignWith=uL,O.at=lL,O.before=g1,O.bind=Xf,O.bindAll=hO,O.bindKey=p1,O.castArray=BM,O.chain=c1,O.chunk=$B,O.compact=VB,O.concat=GB,O.cond=gO,O.conforms=pO,O.constant=ac,O.countBy=Xk,O.create=fL,O.curry=y1,O.curryRight=m1,O.debounce=b1,O.defaults=cL,O.defaultsDeep=dL,O.defer=xM,O.delay=EM,O.difference=WB,O.differenceBy=UB,O.differenceWith=HB,O.drop=KB,O.dropRight=jB,O.dropRightWhile=YB,O.dropWhile=ZB,O.fill=XB,O.filter=Jk,O.flatMap=tM,O.flatMapDeep=nM,O.flatMapDepth=aM,O.flatten=s1,O.flattenDeep=QB,O.flattenDepth=JB,O.flip=CM,O.flow=mO,O.flowRight=bO,O.fromPairs=ek,O.functions=bL,O.functionsIn=wL,O.groupBy=iM,O.initial=tk,O.intersection=nk,O.intersectionBy=ak,O.intersectionWith=ik,O.invert=EL,O.invertBy=CL,O.invokeMap=sM,O.iteratee=ic,O.keyBy=uM,O.keys=it,O.keysIn=qt,O.map=cu,O.mapKeys=SL,O.mapValues=TL,O.matches=wO,O.matchesProperty=xO,O.memoize=vu,O.merge=RL,O.mergeWith=P1,O.method=EO,O.methodOf=CO,O.mixin=oc,O.negate=hu,O.nthArg=SO,O.omit=AL,O.omitBy=PL,O.once=_M,O.orderBy=lM,O.over=TO,O.overArgs=SM,O.overEvery=RO,O.overSome=AO,O.partial=Qf,O.partialRight=w1,O.partition=fM,O.pick=DL,O.pickBy=D1,O.property=q1,O.propertyOf=PO,O.pull=lk,O.pullAll=l1,O.pullAllBy=fk,O.pullAllWith=ck,O.pullAt=dk,O.range=DO,O.rangeRight=IO,O.rearg=TM,O.reject=vM,O.remove=vk,O.rest=RM,O.reverse=Yf,O.sampleSize=gM,O.set=BL,O.setWith=kL,O.shuffle=pM,O.slice=hk,O.sortBy=bM,O.sortedUniq=xk,O.sortedUniqBy=Ek,O.split=tO,O.spread=AM,O.tail=Ck,O.take=_k,O.takeRight=Sk,O.takeRightWhile=Tk,O.takeWhile=Rk,O.tap=Vk,O.throttle=PM,O.thru=fu,O.toArray=S1,O.toPairs=I1,O.toPairsIn=B1,O.toPath=OO,O.toPlainObject=R1,O.transform=ML,O.unary=DM,O.union=Ak,O.unionBy=Pk,O.unionWith=Dk,O.uniq=Ik,O.uniqBy=Bk,O.uniqWith=kk,O.unset=LL,O.unzip=Zf,O.unzipWith=f1,O.update=OL,O.updateWith=qL,O.values=Oi,O.valuesIn=NL,O.without=Mk,O.words=L1,O.wrap=IM,O.xor=Lk,O.xorBy=Ok,O.xorWith=qk,O.zip=Nk,O.zipObject=Fk,O.zipObjectDeep=zk,O.zipWith=$k,O.entries=I1,O.entriesIn=B1,O.extend=A1,O.extendWith=yu,oc(O,O),O.add=NO,O.attempt=O1,O.camelCase=VL,O.capitalize=k1,O.ceil=FO,O.clamp=FL,O.clone=kM,O.cloneDeep=LM,O.cloneDeepWith=OM,O.cloneWith=MM,O.conformsTo=qM,O.deburr=M1,O.defaultTo=yO,O.divide=zO,O.endsWith=GL,O.eq=yn,O.escape=WL,O.escapeRegExp=UL,O.every=Qk,O.find=eM,O.findIndex=i1,O.findKey=vL,O.findLast=rM,O.findLastIndex=o1,O.findLastKey=hL,O.floor=$O,O.forEach=d1,O.forEachRight=v1,O.forIn=gL,O.forInRight=pL,O.forOwn=yL,O.forOwnRight=mL,O.get=rc,O.gt=NM,O.gte=FM,O.has=xL,O.hasIn=tc,O.head=u1,O.identity=Nt,O.includes=oM,O.indexOf=rk,O.inRange=zL,O.invoke=_L,O.isArguments=Xa,O.isArray=tr,O.isArrayBuffer=zM,O.isArrayLike=Ot,O.isArrayLikeObject=Wr,O.isBoolean=$M,O.isBuffer=ga,O.isDate=VM,O.isElement=GM,O.isEmpty=WM,O.isEqual=UM,O.isEqualWith=HM,O.isError=Jf,O.isFinite=KM,O.isFunction=Un,O.isInteger=x1,O.isLength=gu,O.isMap=E1,O.isMatch=jM,O.isMatchWith=YM,O.isNaN=ZM,O.isNative=XM,O.isNil=JM,O.isNull=QM,O.isNumber=C1,O.isObject=Nr,O.isObjectLike=$r,O.isPlainObject=Bo,O.isRegExp=ec,O.isSafeInteger=eL,O.isSet=_1,O.isString=pu,O.isSymbol=Kt,O.isTypedArray=Li,O.isUndefined=rL,O.isWeakMap=tL,O.isWeakSet=nL,O.join=ok,O.kebabCase=HL,O.last=an,O.lastIndexOf=sk,O.lowerCase=KL,O.lowerFirst=jL,O.lt=aL,O.lte=iL,O.max=VO,O.maxBy=GO,O.mean=WO,O.meanBy=UO,O.min=HO,O.minBy=KO,O.stubArray=uc,O.stubFalse=lc,O.stubObject=BO,O.stubString=kO,O.stubTrue=MO,O.multiply=jO,O.nth=uk,O.noConflict=_O,O.noop=sc,O.now=du,O.pad=YL,O.padEnd=ZL,O.padStart=XL,O.parseInt=QL,O.random=$L,O.reduce=cM,O.reduceRight=dM,O.repeat=JL,O.replace=eO,O.result=IL,O.round=YO,O.runInContext=te,O.sample=hM,O.size=yM,O.snakeCase=rO,O.some=mM,O.sortedIndex=gk,O.sortedIndexBy=pk,O.sortedIndexOf=yk,O.sortedLastIndex=mk,O.sortedLastIndexBy=bk,O.sortedLastIndexOf=wk,O.startCase=nO,O.startsWith=aO,O.subtract=ZO,O.sum=XO,O.sumBy=QO,O.template=iO,O.times=LO,O.toFinite=Hn,O.toInteger=ir,O.toLength=T1,O.toLower=oO,O.toNumber=on,O.toSafeInteger=oL,O.toString=wr,O.toUpper=sO,O.trim=uO,O.trimEnd=lO,O.trimStart=fO,O.truncate=cO,O.unescape=dO,O.uniqueId=qO,O.upperCase=vO,O.upperFirst=nc,O.each=d1,O.eachRight=v1,O.first=u1,oc(O,(function(){var f={};return Sn(O,function(v,y){br.call(O.prototype,y)||(f[y]=v)}),f})(),{chain:!1}),O.VERSION=n,Jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){O[f].placeholder=O}),Jt(["drop","take"],function(f,v){dr.prototype[f]=function(y){y=y===t?1:Jr(ir(y),0);var R=this.__filtered__&&!v?new dr(this):this.clone();return R.__filtered__?R.__takeCount__=wt(y,R.__takeCount__):R.__views__.push({size:wt(y,K),type:f+(R.__dir__<0?"Right":"")}),R},dr.prototype[f+"Right"]=function(y){return this.reverse()[f](y).reverse()}}),Jt(["filter","map","takeWhile"],function(f,v){var y=v+1,R=y==N||y==W;dr.prototype[f]=function(B){var F=this.clone();return F.__iteratees__.push({iteratee:Ze(B,3),type:y}),F.__filtered__=F.__filtered__||R,F}}),Jt(["head","last"],function(f,v){var y="take"+(v?"Right":"");dr.prototype[f]=function(){return this[y](1).value()[0]}}),Jt(["initial","tail"],function(f,v){var y="drop"+(v?"":"Right");dr.prototype[f]=function(){return this.__filtered__?new dr(this):this[y](1)}}),dr.prototype.compact=function(){return this.filter(Nt)},dr.prototype.find=function(f){return this.filter(f).head()},dr.prototype.findLast=function(f){return this.reverse().find(f)},dr.prototype.invokeMap=lr(function(f,v){return typeof f=="function"?new dr(this):this.map(function(y){return To(y,f,v)})}),dr.prototype.reject=function(f){return this.filter(hu(Ze(f)))},dr.prototype.slice=function(f,v){f=ir(f);var y=this;return y.__filtered__&&(f>0||v<0)?new dr(y):(f<0?y=y.takeRight(-f):f&&(y=y.drop(f)),v!==t&&(v=ir(v),y=v<0?y.dropRight(-v):y.take(v-f)),y)},dr.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},dr.prototype.toArray=function(){return this.take(K)},Sn(dr.prototype,function(f,v){var y=/^(?:filter|find|map|reject)|While$/.test(v),R=/^(?:head|last)$/.test(v),B=O[R?"take"+(v=="last"?"Right":""):v],F=R||/^find/.test(v);B&&(O.prototype[v]=function(){var H=this.__wrapped__,J=R?[1]:arguments,ie=H instanceof dr,_e=J[0],Se=ie||tr(H),Pe=function(cr){var vr=B.apply(O,ua([cr],J));return R&&Le?vr[0]:vr};Se&&y&&typeof _e=="function"&&_e.length!=1&&(ie=Se=!1);var Le=this.__chain__,Ue=!!this.__actions__.length,Qe=F&&!Le,sr=ie&&!Ue;if(!F&&Se){H=sr?H:new dr(this);var Je=f.apply(H,J);return Je.__actions__.push({func:fu,args:[Pe],thisArg:t}),new rn(Je,Le)}return Qe&&sr?f.apply(this,J):(Je=this.thru(Pe),Qe?R?Je.value()[0]:Je.value():Je)})}),Jt(["pop","push","shift","sort","splice","unshift"],function(f){var v=Os[f],y=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",R=/^(?:pop|shift)$/.test(f);O.prototype[f]=function(){var B=arguments;if(R&&!this.__chain__){var F=this.value();return v.apply(tr(F)?F:[],B)}return this[y](function(H){return v.apply(tr(H)?H:[],B)})}}),Sn(dr.prototype,function(f,v){var y=O[v];if(y){var R=y.name+"";br.call(Di,R)||(Di[R]=[]),Di[R].push({name:v,func:y})}}),Di[nu(t,b).name]=[{name:"wrapper",func:t}],dr.prototype.clone=dI,dr.prototype.reverse=vI,dr.prototype.value=hI,O.prototype.at=Gk,O.prototype.chain=Wk,O.prototype.commit=Uk,O.prototype.next=Hk,O.prototype.plant=jk,O.prototype.reverse=Yk,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=Zk,O.prototype.first=O.prototype.head,bo&&(O.prototype[bo]=Kk),O}),Ri=UD();Ga?((Ga.exports=Ri)._=Ri,af._=Ri):ct._=Ri}).call(CW)})(Ho,Ho.exports)),Ho.exports}var hr=_W();const G2=Rl(hr);function SW({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,l]=Te.useState(!1),u=Te.useRef(null),c=Te.useRef(null),d=Te.useRef(null),h=Te.useRef(!0),g=Te.useCallback(()=>{var m;d.current!==null&&d.current.stop(),c.current&&(d.current=c.current.layout(t),(m=d.current)==null||m.run())},[t]),p=G2.debounce(g,n);Te.useEffect(()=>{var x;if(!u.current)return;const m=ln({container:u.current,...r}),b=(x=u.current.parentElement)==null?void 0:x.querySelector(".cytoscape-react-nodes-and-edges");if(b&&m.domNode({dom_container:b}),c.current=e||m,u.current&&(u.current.cy=c.current),o==null||o(c.current),i(m),u.current&&c.current){const C=u.current.parentElement;let T=0,S=0;C&&(T=C.clientHeight,S=C.clientWidth,T===0&&(T=window.innerHeight-C.getBoundingClientRect().top-100),S===0&&(S=window.innerWidth)),T>0&&S>0&&(u.current.style.width=`${S}px`,u.current.style.height=`${T}px`),c.current.resize(),r.zoom&&r.pan&&c.current.viewport({zoom:r.zoom,pan:r.pan})}l(!0);const w=new ResizeObserver(G2.debounce(()=>{if(u.current&&c.current){const C=u.current.parentElement;let T=0,S=0;C&&(T=C.clientHeight,S=C.clientWidth,T===0&&(T=window.innerHeight-C.getBoundingClientRect().top-100),S===0&&(S=window.innerWidth),T>0&&S>0&&(u.current.style.width=`${S}px`,u.current.style.height=`${T}px`));const _=c.current.zoom()!==void 0?{zoom:c.current.zoom(),pan:c.current.pan()}:null;c.current.resize(),_&&c.current.viewport(_)}},50));return u.current&&w.observe(u.current),()=>{w.disconnect();try{m.destroy()}catch{}c.current=null,l(!1)}},[]),Te.useEffect(()=>{h.current?(h.current=!1,g()):p()},[s,t,p,g]);const E=Te.useMemo(()=>{var m;return c.current!==null?((m=Te.Children.map(a,b=>{var w;return b?Te.cloneElement(b,{key:(w=b==null?void 0:b.props)==null?void 0:w.id,cytoInstance:c.current,layout:p}):null}))==null?void 0:m.filter(Boolean))||[]:[]},[a,s,p]);return ue.jsxs("div",{style:{width:"100%",height:"100%",position:"relative",background:"transparent"},children:[ue.jsx("div",{ref:u,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative",background:"transparent"}}),ue.jsx("div",{className:"cytoscape-react-nodes-and-edges",style:{pointerEvents:"none",position:"absolute",top:0,left:0,transformOrigin:"0 0",zIndex:10},children:E})]})}function TW({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s}){const l=Te.useRef(null);function u(h){if(s){const g=s(h);h.isParent()&&(h.style("shape","roundrectangle"),h.style(g))}}Te.useEffect(()=>{try{if(l.current){const h={id:e,dom:l.current};t&&(h.parent=t),n&&(h.label=n);const g=r.add({data:h,classes:o});u(g)}}catch{}return()=>{r.getElementById(e).remove()}},[l,t,n]),Te.useEffect(()=>{i();const h=r.getElementById(e);h&&h.isParent()&&u(h)},[e,a]),Te.useEffect(()=>{if(!s)return;const h=r.getElementById(e);h&&h.isParent()&&u(h)},[s]);function c(h){return Te.cloneElement(h,{cytoInstance:r,layout:i})}const d=Te.Children.map(a,c);return ue.jsx("div",{ref:l,className:"cytoscape-react-node",children:d})}const RW={name:"dagre",rankDir:"LR",fit:!1,padding:20,spacingFactor:1.3,animate:!1,nodeDimensionsIncludeLabels:!0,ranker:"network-simplex",rankSep:10,nodeSep:5,edgeSep:10,avoidOverlap:!0,edgeWeight:function(r){return 1},minLen:function(r){return 1},useSimpleEdgeFunction:!0,edgeRouting:!0,controlPoints:!0},jP={padding:20,motionBlur:!1,compound:!0,pixelRatio:"auto",zoomingEnabled:!0,userZoomingEnabled:!0,dragpan:!0,avoidOverlap:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,selectionType:"additive",minZoom:.01,maxZoom:1.5,autoungrabify:!0,styleEnabled:!0,hideEdgesOnViewport:!1,hideLabelsOnViewport:!0,headless:!1,touchTapThreshold:8,desktopTapThreshold:4,touchHoldDuration:500,desktopHoldDuration:1e3,autolock:!1,autounselectify:!1,wheelPanEnabled:!0,wheelPanThreshold:1,wheelPanDebounce:10,wheelAction:"pan"},YP={...jP,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},AW={...YP,hideEdgesOnViewport:!0,hideLabelsOnViewport:!0},PW=({nodes:r,edges:e})=>{const{themeColor:t,edgeColor:n,direction:a,cyRef:i,callbacks:o,config:s,selectedNodeIds:l,setSelectedNodeIds:u,setSelectedEdgeId:c,setIsPerformanceMode:d,isZoomMode:h,setIsZoomMode:g,isMultiSelectMode:p,setIsMultiSelectMode:E,isDragMode:m,setIsDragMode:b,isEdgeHandlesEnabled:w,isArrayNodeMode:x}=Mn(),C=Te.useRef(null),T=Te.useRef(null),S=Te.useRef(x),_=r.length>200;Te.useEffect(()=>{d(_)},[_,d]);const{edgeSep:A,rankSep:P}=Te.useMemo(()=>yq(r.length),[r.length]),{bgColor:D}=cs(t),{background:I,borderSecondary:M}=ds(),k=s.backgroundColor||I,N=Te.useCallback(U=>{if(U!=null&&U.includes("gray"))return"whitesmoke";if(!U)return ht(t);switch(U){case"dark":return ht(k);case"light":return ht(M);default:return ht(U)}},[t,k,M]),z=s.colorMode==="dark",W=Te.useMemo(()=>z?N(D):"dark",[z,D,N]),q=n?N(n):W,$=Te.useMemo(()=>pq(N),[N]),X=s.initialViewport||{pan:{x:0,y:0},zoom:.01},Y=Te.useMemo(()=>({..._?AW:r.length>100?YP:jP,style:$,zoom:X.zoom,pan:X.pan,minZoom:s.minZoom??.01,maxZoom:s.maxZoom??1.5}),[$,X,r.length,s.minZoom,s.maxZoom]),K=Te.useRef(!1),ee=Te.useRef();Te.useEffect(()=>()=>{clearTimeout(ee.current)},[]);const le=Te.useMemo(()=>({...RW,...a&&{rankDir:a},edgeSep:A,rankSep:P,get animate(){return K.current&&!_},animationDuration:300,animationEasing:"ease-in-out-cubic",stop:()=>{i.current&&(K.current||setTimeout(()=>{var U;(U=i.current)==null||U.fit(void 0,50)},100),clearTimeout(ee.current),ee.current=setTimeout(()=>{K.current=!0},500))}}),[a,A,P,i,_]),G=Te.useCallback(U=>{const fe=N(U||t);return{"corner-radius":50,"background-color":fe,color:fe,"border-color":fe}},[t,N]),V=Te.useCallback((U,fe,we,ge)=>{let me={};return ge!=null&&ge.isInverted&&(ge==null?void 0:ge.source)===fe&&(me["target-arrow-shape"]="none",me["source-arrow-shape"]="triangle"),ge!=null&&ge.isEdgeAnimated?(me["line-style"]="dashed",me["line-dash-pattern"]=[32,18],me["line-dash-offset"]=0):ge!=null&&ge.isEdgeDashed?(me["line-style"]="dashed",me["line-dash-pattern"]=[],me["line-dash-offset"]=0):(me["line-style"]="solid",me["line-dash-pattern"]=[],me["line-dash-offset"]=0),a==="TB"&&(me["taxi-direction"]="downward"),a==="BT"&&(me["taxi-direction"]="upward"),a==="LR"&&(me["taxi-direction"]="rightward"),a==="RL"&&(me["taxi-direction"]="leftward"),me["line-color"]=q,me.color=q,me["target-arrow-color"]=q,me["source-arrow-color"]=q,me},[q,a]),j=Te.useRef(r);j.current=r;const re=Te.useRef(G);re.current=G;const ce=Te.useRef(V);ce.current=V,Te.useEffect(()=>{if(!i.current)return;const U=i.current,fe=()=>{U.nodes().forEach(we=>{var ge,me;if(we.isParent()){const Re=j.current.find(Ie=>{var Be;return((Be=Ie.data)==null?void 0:Be.id)===we.id()});we.style(re.current((me=(ge=Re==null?void 0:Re.data)==null?void 0:ge.viewProps)==null?void 0:me.bgColor))}})};return U.on("add",fe),()=>{U.off("add",fe)}},[]),Te.useEffect(()=>{if(!i.current)return;const U=i.current;U.nodes().forEach(fe=>{var we,ge;if(fe.isParent()){const me=r.find(Re=>{var Ie;return((Ie=Re.data)==null?void 0:Ie.id)===fe.id()});fe.style(G((ge=(we=me==null?void 0:me.data)==null?void 0:we.viewProps)==null?void 0:ge.bgColor))}}),e.forEach(({data:fe})=>{const we=U.getElementById(fe.id);we!=null&&we.length&&(we.data({isEdgeAnimated:fe.isEdgeAnimated,isEdgeDashed:fe.isEdgeDashed}),we.style(V(we,fe.source,fe.target,fe)))})},[r,e,q,G,V]);const se=Te.useRef(s);se.current=s;const Z=Te.useRef(h);Z.current=h;const Q=Te.useRef(w);Q.current=w,S.current=x,Te.useEffect(()=>{if(!i.current||!i.current.container)return;const U=i.current,fe=C.current;if(!fe)return;let we=null,ge=null,me=0,Re=0,Ie=0,Be=0,Oe=0;const He=Ve=>{Ve.preventDefault(),Ve.stopPropagation(),Z.current||Ve.metaKey||Ve.ctrlKey?(Ie+=Ve.deltaY,Be=Ve.clientX,Oe=Ve.clientY,ge===null&&(ge=requestAnimationFrame(()=>{ge=null;const er=se.current,$e=U.zoom(),Me=Ie;Ie=0;let pe=$e-Me*.05/100;pe=Math.max(er.minZoom??.01,Math.min(er.maxZoom??1.5,pe));const L=fe.getBoundingClientRect();U.zoom({level:pe,renderedPosition:{x:Be-L.left,y:Oe-L.top}})}))):(me+=Ve.deltaX,Re+=Ve.deltaY,we===null&&(we=requestAnimationFrame(()=>{we=null;const er=U.pan(),$e=U.zoom(),Me=.35,pe=me,L=Re;me=0,Re=0,U.pan({x:er.x+-pe*Me/$e,y:er.y+-L*Me/$e})})))};return fe.addEventListener("wheel",He,{passive:!1}),()=>{fe.removeEventListener("wheel",He),we!==null&&cancelAnimationFrame(we),ge!==null&&cancelAnimationFrame(ge)}},[i.current]),Te.useEffect(()=>{i.current&&i.current.userPanningEnabled(m)},[m]),Te.useEffect(()=>{if(!i.current)return;const U=i.current;U.boxSelectionEnabled(!!p),U.selectionType(p?"additive":"single"),U.userPanningEnabled(!p&&m)},[p,m]),Te.useEffect(()=>{T.current&&(w?T.current.enableDrawMode():T.current.disableDrawMode())},[w]);const ae=Te.useRef(l);ae.current=l,Te.useEffect(()=>{if(s.disableKeyboardShortcuts)return;const U=fe=>{var ge,me;const we=fe.target;if(!(we.tagName==="INPUT"||we.tagName==="TEXTAREA"||we.isContentEditable)&&((fe.key==="z"||fe.key==="Z")&&g(!Z.current),(fe.key==="m"||fe.key==="M")&&E(!p),(fe.key==="d"||fe.key==="D")&&b(!m),(fe.key==="Delete"||fe.key==="Backspace")&&ae.current.length>0)){fe.preventDefault();const Re=ae.current.filter(Be=>Be!=="root");if(Re.length===0)return;const Ie=i.current;for(const Be of Re){const Oe=(ge=Ie==null?void 0:Ie.getElementById(Be))==null?void 0:ge.data();(me=o.onNodeDelete)==null||me.call(o,Be,Oe||{})}u([])}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[p,m,g,E,b,s.disableKeyboardShortcuts,o,u,i]),Te.useEffect(()=>()=>{if(i.current)try{i.current.removeAllListeners()}catch{}},[]);const ne=Te.useMemo(()=>_?300:r.length>50?150:r.length>20?100:50,[r.length,_]),de=Te.useMemo(()=>{var fe;const U=new Set;for(const we of r)(fe=we.data)!=null&&fe.parent&&U.add(we.data.parent);return U},[r]),Ce=Te.useMemo(()=>{var fe;const U=new Map;for(const we of e)(fe=we.data)!=null&&fe.source&&!U.has(we.data.source)&&U.set(we.data.source,we.data);return U},[e]),ve=s.backgroundPattern||"dot";return ue.jsx(lq,{pattern:ve,backgroundColor:s.backgroundColor,children:ue.jsx(De.Box,{ref:C,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:ue.jsxs(SW,{cyParams:Y,layoutParams:le,layoutDebounce:ne,onCyInit:U=>{var we;i.current=U,(we=o.onCyInit)==null||we.call(o,U);let fe=null;if(U.on("zoom pan",()=>{fe===null&&(fe=requestAnimationFrame(()=>{var ge;fe=null,(ge=o.onViewportChange)==null||ge.call(o,{zoom:U.zoom(),pan:U.pan()})}))}),U.on("select","edge",ge=>{var Re;const me=ge.target;c(me.id()),(Re=o.onEdgeSelect)==null||Re.call(o,me.id(),me.data())}),U.on("unselect","edge",()=>{var ge;c(null),(ge=o.onEdgeDeselect)==null||ge.call(o)}),U.on("remove","edge",ge=>{var Re;const me=ge.target;(Re=o.onEdgeRemove)==null||Re.call(o,me.id(),me.data())}),U.on("tap",":parent",ge=>{var Re;const me=ge.target;u([me.id()]),(Re=o.onNodeSelect)==null||Re.call(o,me.id(),me.data())}),s.edgeHandles!==!1){const ge={canConnect:(Be,Oe)=>!Be.same(Oe),edgeParams:(Be,Oe)=>({data:{source:Be.id(),target:Oe.id(),label:""}}),loopAllowed:()=>!1,hoverDelay:500,snap:!1,snapThreshold:10,snapFrequency:5,noEdgeEventsInDraw:!0,disableBrowserGestures:!0,handlePosition:"left",handleNodes:"node",handleSize:20,handleColor:t||"#0ea5e9",handleOutlineColor:"#B92020FF",handleOutlineWidth:2,handleLineType:"ghost",handleLineWidth:2,preview:!0,ghostEdgeParams:()=>({}),edgeType:()=>"flat",nodeParams:()=>({})},me=U.edgehandles(ge);T.current=me,Q.current&&me.enableDrawMode();let Re=null,Ie=null;U.on("ehstart",(Be,Oe)=>{Ie=Oe;const He=Be.originalEvent||window.event;if(He!=null&&He.clientX&&(He!=null&&He.clientY))Re={x:He.clientX,y:He.clientY};else{const Ve=Oe.renderedPosition();Re={x:Ve.x,y:Ve.y}}}),U.on("ehcancel",Be=>{if(!Re||!Ie)return;const Oe=Be.originalEvent||window.event,He=Oe==null?void 0:Oe.clientX,Ve=Oe==null?void 0:Oe.clientY;if(He&&Ve&&o.onNodeCreate){const Xe=Math.abs(He-Re.x),er=Math.abs(Ve-Re.y);if(Math.max(Xe,er)>30){const $e=U.renderer().projectIntoViewport(He,Ve);o.onNodeCreate({type:"text",sourceNodeId:Ie.id(),position:{x:$e[0],y:$e[1]},isArrayMode:S.current})}}Re=null,Ie=null}),U.on("ehcomplete",(Be,Oe,He)=>{var Ve;(Ve=o.onEdgeCreate)==null||Ve.call(o,Oe.id(),He.id())}),U.on("ehstop",()=>{Re=null,Ie=null})}},children:[(r||[]).map(U=>{var Ie,Be,Oe,He,Ve,Xe,er,$e,Me;const fe=s.customViews||gq,we=de.has((Ie=U.data)==null?void 0:Ie.id)&&!((Be=U.data)!=null&&Be.parent),ge=we?((Oe=U.data)==null?void 0:Oe.label)||((He=U.data)==null?void 0:He.headerTitle)||"Container":void 0,me=we?fe.parentContainer:fe[U==null?void 0:U.data.type]||fe.text,Re=Ce.get((Ve=U.data)==null?void 0:Ve.id);return ue.jsx(TW,{id:(Xe=U.data)==null?void 0:Xe.id,parent:(er=U.data)==null?void 0:er.parent,label:ge,styleCallback:()=>{var pe,L;return G((L=(pe=U.data)==null?void 0:pe.viewProps)==null?void 0:L.bgColor)},children:Te.createElement(me,{...U,isInverted:Re==null?void 0:Re.isInverted,isParent:we,key:`${($e=U.data)==null?void 0:$e.id}-${t}`})},(Me=U.data)==null?void 0:Me.id)}),(e||[]).map(({data:U})=>ue.jsx(mq,{id:U==null?void 0:U.id,source:U==null?void 0:U.source,target:U==null?void 0:U.target,label:U==null?void 0:U.label,isPerformanceMode:_,styleCallback:(fe,we,ge)=>V(fe,we,ge,U)},U==null?void 0:U.id))]})})})},DW=Te.memo(PW);var Ko=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(Ko||{});const IW=[{value:"BT",label:"Bottom to Up",icon:Hr.PiArrowUpLight,flowType:Ko.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:Hr.PiArrowDownLight,flowType:Ko.TOP_DOWN},{value:"LR",label:"Left to Right",icon:Hr.PiArrowArcRightLight,flowType:Ko.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:Hr.PiArrowArcLeftLight,flowType:Ko.RIGHT_LEFT}];function Yn({label:r,children:e}){return ue.jsxs(De.Tooltip.Root,{positioning:{placement:"top"},children:[ue.jsx(De.Tooltip.Trigger,{asChild:!0,children:e}),ue.jsx(De.Tooltip.Positioner,{children:ue.jsx(De.Tooltip.Content,{fontSize:"xs",children:r})})]})}function ma({icon:r,...e}){return ue.jsx(De.IconButton,{...e,children:r})}const ZP=()=>{const{cyRef:r,themeColor:e,direction:t,selectedNodeIds:n,setSelectedNodeIds:a,selectedEdgeId:i,setSelectedEdgeId:o,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:m,isPinned:b,setIsPinned:w,callbacks:x,config:C}=Mn(),T=C.colorMode==="dark",{background:S,border:_,colorInactive:A,colorText:P,colorActive:D,darkBackgroundSecondary:I}=ds(),[M,k]=Te.useState(!0),[N,z]=Te.useState(!1),[W,q]=Te.useState(!0),[$,X]=Te.useState(!1),[Y,K]=Te.useState(!1);Te.useEffect(()=>{const ne=()=>q(window.innerWidth>=768);return ne(),window.addEventListener("resize",ne),()=>window.removeEventListener("resize",ne)},[]),Te.useEffect(()=>{if(!W){k(!0);return}if(!b){k(!1);return}const ne=Ce=>{k(window.innerHeight-Ce.clientY<=250)},de=()=>k(!1);return window.addEventListener("mousemove",ne),window.addEventListener("mouseleave",de),()=>{window.removeEventListener("mousemove",ne),window.removeEventListener("mouseleave",de)}},[W,b]);const ee=Te.useCallback(ne=>{const de=r.current;if(!de)return;const Ce=C.minZoom??.01,ve=C.maxZoom??1.5,U=.02,fe=de.zoomingEnabled(),we=de.userZoomingEnabled();de.zoomingEnabled(!0),de.userZoomingEnabled(!0);let ge=de.zoom();switch(ne){case"increase":ge=Math.min(ve,ge+U),de.zoom(ge),de.center();break;case"decrease":ge=Math.max(Ce,ge-U),de.zoom(ge),de.center();break;case"reset":de.fit(void 0,50);break}de.zoomingEnabled(fe),de.userZoomingEnabled(we)},[r,C.minZoom,C.maxZoom]),le=M||N,G=C.renderSelectedNodeToolbar,V=n.length>0&&!!G,j=Te.useMemo(()=>{if(!V)return[];const ne=r.current;return ne?n.map(de=>{const Ce=ne.getElementById(de);return Ce!=null&&Ce.length?{...Ce.data(),isParent:Ce.isParent()}:{id:de}}):[]},[V,n,r]),re=Te.useCallback(()=>{var ne;a([]),(ne=x.onNodeDeselect)==null||ne.call(x)},[a,x]),ce=C.renderSelectedEdgeToolbar,se=!!i&&!!ce,Z=Te.useMemo(()=>{if(!se||!i)return null;const ne=r.current;if(!ne)return{id:i};const de=ne.getElementById(i);return de!=null&&de.length?de.data():{id:i}},[se,i,r]),Q=Te.useCallback(()=>{var de;o(null);const ne=r.current;ne&&ne.edges().unselect(),(de=x.onEdgeDeselect)==null||de.call(x)},[o,r,x]),ae=C.renderBottomBar;return ae?ue.jsxs(ue.Fragment,{children:[V&&ue.jsx(De.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:G({selectedNodeIds:n,selectedNodeData:j,onDeselect:re})}),se&&Z&&ue.jsx(De.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:ce({edgeId:i,edgeData:Z,onDeselect:Q})}),ue.jsx(De.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",children:ae({zoomIn:()=>ee("increase"),zoomOut:()=>ee("decrease"),resetZoom:()=>ee("reset"),direction:t,isZoomMode:s,setIsZoomMode:l,isMultiSelectMode:u,setIsMultiSelectMode:c,isDragMode:d,setIsDragMode:h,isEdgeHandlesEnabled:g,setIsEdgeHandlesEnabled:p,isArrayNodeMode:E,setIsArrayNodeMode:m,selectedNodeIds:n,selectedNodeData:j,selectedEdgeId:i,selectedEdgeData:Z,onNodeDeselect:re,onEdgeDeselect:Q,callbacks:x})})]}):ue.jsxs(ue.Fragment,{children:[V&&ue.jsx(De.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:G({selectedNodeIds:n,selectedNodeData:j,onDeselect:re})}),se&&Z&&ue.jsx(De.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:ce({edgeId:i,edgeData:Z,onDeselect:Q})}),!b&&ue.jsx(De.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:ue.jsx(Yn,{label:"Show Bottom Bar",children:ue.jsx(De.Flex,{align:"center",bg:S,borderColor:_,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{z(!0),k(!0)},onMouseLeave:()=>z(!1),_hover:{bg:I},children:ue.jsx(De.Icon,{ml:-1,as:Hr.PiLineVerticalBold,boxSize:5,color:_})})})}),ue.jsx(De.Box,{position:"absolute",bottom:0,left:0,right:0,zIndex:100,w:"100%",transition:"opacity 0.3s ease-in, transform 0.3s ease",transform:le?"translateY(0)":"translateY(100%)",pointerEvents:le?"auto":"none",opacity:le?1:0,onMouseEnter:()=>{b||k(!0)},onMouseLeave:()=>{b||(k(!1),z(!1))},children:ue.jsxs(De.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[ue.jsx(De.Box,{bg:S,alignContent:"center",h:50,borderColor:_,borderWidth:1,borderRadius:"15px",children:ue.jsxs(De.HStack,{px:2,gap:1,children:[ue.jsx(Yn,{label:b?"Unpin":"Pin",children:ue.jsx(ma,{"aria-label":"Pin",icon:ue.jsx(De.Icon,{as:b?Hr.PiPushPinFill:Hr.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:b?e:A,onClick:()=>{const ne=!b;w(ne),k(ne)}})}),ue.jsx(De.Icon,{mx:-1,as:Hr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(Yn,{label:"Zoom Out",children:ue.jsx(ma,{"aria-label":"Zoom out",icon:ue.jsx(De.Icon,{as:iq.HiMinus,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("decrease")})}),ue.jsx(Yn,{label:"Zoom In",children:ue.jsx(ma,{"aria-label":"Zoom in",icon:ue.jsx(De.Icon,{as:fc.VscAdd,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("increase")})}),ue.jsx(Yn,{label:"Reset Zoom",children:ue.jsx(ma,{"aria-label":"Reset zoom",icon:ue.jsx(De.Icon,{as:oq.GrPowerReset,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("reset")})}),!Y&&ue.jsxs(ue.Fragment,{children:[ue.jsx(De.Icon,{mx:-1,as:Hr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(Yn,{label:s?"Zoom Mode (z)":"Pan Mode (z)",children:ue.jsx(ma,{"aria-label":"Toggle zoom mode",icon:ue.jsx(De.Icon,{as:s?fc.VscZoomIn:fc.VscMove,boxSize:5}),size:"sm",variant:"ghost",color:s?e:A,onClick:()=>l(!s)})}),ue.jsx(De.Icon,{mx:-1,as:Hr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(Yn,{label:d?"Drag Mode On (d)":"Drag Mode Off (d)",children:ue.jsx(ma,{"aria-label":"Toggle drag mode",icon:ue.jsx(De.Icon,{as:Hr.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:d?e:A,onClick:()=>h(!d)})})]}),ue.jsx(De.Icon,{mx:-1,as:Hr.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(Yn,{label:Y?"Expand toolbar":"Collapse toolbar",children:ue.jsx(ma,{"aria-label":"Toggle toolbar collapse",icon:ue.jsx(De.Icon,{as:Y?Hr.PiCaretRight:Hr.PiCaretLeft,boxSize:5}),size:"sm",variant:"ghost",color:A,onClick:()=>K(!Y)})})]})}),ue.jsxs(De.Box,{position:"relative",ml:"auto",children:[ue.jsx(De.Box,{bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",h:50,px:3,cursor:"pointer",onClick:()=>X(!$),children:ue.jsxs(De.Flex,{align:"center",h:"100%",children:[ue.jsx(Yn,{label:"Flow Direction",children:ue.jsx(ma,{"aria-label":"Direction",icon:ue.jsx(De.Icon,{as:Hr.PiCaretUp,boxSize:4}),size:"sm",variant:"ghost",color:A})}),ue.jsx(De.Text,{fontSize:"xs",color:T?"whiteAlpha.600":"blackAlpha.500",ml:1,children:t})]})}),$&&ue.jsxs(De.Box,{position:"absolute",bottom:"60px",right:0,bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",p:2,zIndex:200,minW:"180px",shadow:"lg",onMouseLeave:()=>X(!1),children:[IW.map(ne=>ue.jsxs(De.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var de;(de=x.onDirectionChange)==null||de.call(x,ne.value),X(!1)},children:[ue.jsx(De.Icon,{as:ne.icon,boxSize:5,color:P}),ue.jsx(De.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:ne.label}),t===ne.value&&ue.jsx(De.Icon,{as:z1.IoCheckmark,boxSize:4,color:D})]},ne.value)),ue.jsxs(De.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var ne;(ne=x.onDirectionChange)==null||ne.call(x,"LR"),X(!1)},children:[ue.jsx(De.Icon,{as:sq.TbAlignCenter,boxSize:5,color:P}),ue.jsx(De.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:"Center"}),t==="C"&&ue.jsx(De.Icon,{as:z1.IoCheckmark,boxSize:4,color:D})]})]})]})]})})]})};ZP.displayName="BottomBar";const BW=Te.memo(ZP),kW=".cytoscape-react-nodes-and-edges{position:absolute!important;top:0!important;left:0!important;z-index:10!important;pointer-events:none!important;overflow:visible!important;transform-origin:0 0!important}.cytoscape-react-node{z-index:0!important;overflow:visible!important;pointer-events:auto!important;position:absolute!important;transform-origin:0 0!important}.cytoscape-react-node input,.cytoscape-react-node textarea{pointer-events:auto!important;user-select:text!important;cursor:text!important}.cytoscape-react-edge{overflow:visible!important;pointer-events:none!important}.cytoscape-react-cy-container{width:100%!important;height:100%!important;overflow:visible!important;position:relative!important;background:transparent!important}.cytoscape-react-cy-container canvas{display:inline!important;vertical-align:baseline!important;overflow:visible!important}.cytoscape-react-cy-container>div{overflow:visible!important}";let W2=!1;function MW(){if(W2||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=kW,document.head.appendChild(r),W2=!0}function LW({title:r="untitled",nodes:e,edges:t,config:n={},callbacks:a={},className:i,style:o,showBottomBar:s=!0}){MW();const l=e||[],u=t||[];return ue.jsx(uq,{config:n,callbacks:a,children:ue.jsxs(De.Box,{className:i,style:o,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:[ue.jsx(DW,{nodes:l,edges:u}),s&&ue.jsx(BW,{})]})})}const Ul={label:"Untitled",description:"",isTask:!1,isLocked:!1},b0={id:null,type:"text",data:{...Ul,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",borderColor:"transparent",borderRadius:25,borderWidth:0,boxShadow:"none",textOverflow:"ellipsis",fontWeight:"bold",textColor:"gray.800",textAlign:"center"}}},U2={id:null,type:"objectView",data:{...Ul,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},OW={id:null,type:"arrayView",data:{...Ul,viewProps:{width:"max-content !important",maxWidth:700,height:"100%",textAlign:"center",borderRadius:25,fontSize:"5xl",borderWidth:2,textOverflow:"ellipsis",wordBreak:"keep-all",fontWeight:"bold",textColor:"gray.900",placeholder:"Start Typing"}}},H2={id:null,type:"workflowStep",data:{...Ul,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Iu;const qW=new Uint8Array(16);function NW(){if(!Iu&&(Iu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Iu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Iu(qW)}const vt=[];for(let r=0;r<256;++r)vt.push((r+256).toString(16).slice(1));function FW(r,e=0){return vt[r[e+0]]+vt[r[e+1]]+vt[r[e+2]]+vt[r[e+3]]+"-"+vt[r[e+4]]+vt[r[e+5]]+"-"+vt[r[e+6]]+vt[r[e+7]]+"-"+vt[r[e+8]]+vt[r[e+9]]+"-"+vt[r[e+10]]+vt[r[e+11]]+vt[r[e+12]]+vt[r[e+13]]+vt[r[e+14]]+vt[r[e+15]]}const zW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),K2={randomUUID:zW};function $W(r,e,t){if(K2.randomUUID&&!r)return K2.randomUUID();r=r||{};const n=r.random||(r.rng||NW)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,FW(n)}const Xt=r=>typeof r=="object",XP=r=>Array.isArray(r),VW=["order","position","selected","locked","grabbed","grabbable","scratch"],Ba=r=>Object.entries(r).reduce((e,[t,n])=>(!Xt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),w0=(r,e)=>typeof r=="string"&&r.startsWith("$")?um(r,e):Xt(r)&&!XP(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...um(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=um(a,e):t[n]=a,t),{}):r,ka=r=>Object.entries(r).reduce((e,[t,n])=>(Xt(n)&&t&&n&&!t.startsWith("$")&&(VW.includes(t)&&(t=t+"#"),e[t]=n),e),{}),ai=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Xt(i)||XP(i))&&(i=JSON.stringify(i,null,2)),{data:{parent:n,...r.data,id:e,text:t||"",label:t,code:i||null,type:r.type,description:a}}),Ca=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:$W(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),Ma=(r,e=[])=>{const t={},n={};let a=[];if(r)for(const[i,o]of Object.entries(r))i.startsWith("$")&&i!=="$"?t[i.slice(1)]=o:i!=="$"?n[i]=o:i==="$"&&(a=o);return{newConfig:t,updatedObject:n,arrayObject:a}},Yi=(r,e)=>{let t=U2;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:l,stepType:u}=e;r=n||r,u?t={...H2}:r==="object"?t=U2:r==="text"?t=b0:r==="array"?t=OW:r==="workflowStep"&&(t={...H2});const c=t.data.viewProps;return t.data.viewProps={...c,borderRadius:i||(u?15:50),bgColor:o,borderColor:a,textColor:s,fontSize:l},t.data.config=e,{config:t}},fs=(r,e)=>(r=e.find(n=>n.data.id===r)?`${r}.#`:r,r),um=(r,{ids:e,jsnObjct:t})=>{if(typeof r=="string"&&(r!=null&&r.startsWith("$"))){const n=r.replace("$","").replace("*","");r==null||r.endsWith("*");const a=e.find(s=>s.split(".").slice(-1)[0]===n||n===s);if(!a)return r;const i=GW(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},GW=(r,e)=>{let t=r.split(".").splice(1);return t=t[t.length-1]==="#"||t[t.length-1].includes("{")?t.slice(0,-2):t,(i=>t.reduce((o,s)=>{s=s.replace("[","").replace("]","");const{arrayObject:l}=Ma(o);return o=l.length?l:o,o[s]},i))(e)};function eo(r,e="root",t=[]){try{const{arrayObject:n}=Ma(r);n.length&&(r=n);const a=Ba(r),i=ka(r);return Xt(r)?(hr.isArray(r)||hr.isArray(r)&&e==="root"||!hr.isArray(r)&&Object.keys(a).length||e==="root")&&t.push(e):t.push(e),Object.keys(i).length&&!hr.isArray(r)?Xo({chldPth:null,itrblObjct:i,nodes:t,path:e}):hr.isArray(r)&&r.forEach((o,s)=>{const l=Ba(o),u=ka(o),{newConfig:c,arrayObject:d}=Ma(o);let h=`${e}.${s}`;Xt(o)?Object.keys(l).length?(eo(l,h,t),Object.keys(u).length&&!hr.isArray(o)&&Xo({chldPth:h,itrblObjct:u,nodes:t,path:e})):Object.keys(u).length&&!hr.isArray(o)?Xo({chldPth:h,itrblObjct:u,nodes:t,path:e}):hr.isArray(o)&&QP({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const Xo=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Ba(i),l=ka(i),{newConfig:u,arrayObject:c}=Ma(i);c.length&&(i=c),n.split(".").slice(0,2).join(".");let d=r?`${r}.${a}`:`${n}.${a}`;if(Xt(i)&&!hr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Yi("array",u),t.push(d)),Object.keys(s).length){const g=hr.isArray(i)?`${i.length||""}`:`{${Object.keys(i).length||""}}`;let p=d;h&&(p=`${d}.${g}`),eo(i,p,t)}else Object.keys(l).length&&!hr.isArray(i)?Xo({chldPth:d,itrblObjct:l,path:d,nodes:t}):eo(i,d,t)}else hr.isArray(i)&&eo(i,d,t)}),QP=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=ka(a),l=Ba(a);Xt(a)?!hr.isArray(a)&&Object.keys(l).length?eo(a,o,t):Object.keys(s).length&&!hr.isArray(a)?Xo({chldPth:o,itrblObjct:s,path:n,nodes:t}):hr.isArray(a)&&QP({chldPth:o,item:a,nodes:t,path:n}):t.push(o)}),sl=[];let Qo;function ro(r,e="root",t=[],n=[],a="untitled",i={hideDefaultObject:!1,sprtObjctKy:!1,isCntr:!1},o={}){if(!r||typeof r!="object")return console.error("Invalid object passed",r),{nodes:t,edges:n};const s=r;if(!Qo){const{nodes:c}=eo(r);Qo={ids:c,jsnObjct:r}}let{hideDefaultObject:l,sprtObjctKy:u}=i;try{e=fs(e,t);const{newConfig:c,arrayObject:d}=Ma(r),h=Object.keys(o).length>0?o:c;d.length&&(r=d);const g=Ba(r),p=ka(r),{label:E,collapsed:m,parent:b}=h;if(!Xt(r))t.push(ai(b0,e,{label:E||e,parent:b},r,s));else if(hr.isArray(r)||hr.isArray(r)&&e==="root"){const{config:w}=Yi("array",h),x=hr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,C=e==="root"?a:`${a} ${x}`;t.push(ai(w,e,{label:E||C,parent:b},r,hr.isArray(s)?{[a]:s}:s))}else if(!hr.isArray(r)&&Object.keys(g).length||e==="root"){const{config:w}=Yi(null,h),x=hr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,C=e.split("."),T=C[C.length-1];let S=isNaN(Number(T))?null:Number(T)+1;const _=isNaN(Number(T))?T:C[C.length-2]+" "+S,A=e==="root"?a:_;let P=!1;Number.isNaN(Number(a))||(P=!0);const D=r;if(E){const{config:I}=Yi("object",h);t.push(ai(I,e,{label:E||`${E} ${x}`,parent:b},g,D))}else w.data.headerTitle=A,t.push(ai(w,e,{label:E,parent:b},g,D))}return m||(Object.keys(p).length&&!hr.isArray(r)?Jo({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:p,nodes:t,path:e,newConfig:h}):hr.isArray(r)&&r.forEach((w,x)=>{w=w0(w,Qo);const C=w,T=Ba(w),S=ka(w),{newConfig:_,arrayObject:A}=Ma(w);A.length&&(w=A);const{config:P}=Yi(typeof w=="string"?"text":"array",_),{hideConfig:D,sourceLabel:I,label:M,isEdgeAnimated:k,parent:N}=_;l=l||D;const z=e==="root"&&i.isCntr,W=e.split(".").slice(0,2).join("."),q=sl.includes(W),$=i.isCntr&&q||x%2===0&&z;let X=`${e}.${x}`;X=fs(X,t),$&&sl.push(X),Xt(w)?Object.keys(T).length&&!hr.isArray(w)?(n.push(Ca(e,X,null,I,$,k)),ro(w,X,t,n,M||x,i,_)):Object.keys(S).length&&!hr.isArray(w)?Jo({flowConfig:i,chldPth:X,isInverted:$,edges:n,itrblObjct:S,nodes:t,path:e,newConfig:_,forceIsInverted:!0}):hr.isArray(w)?JP({flowConfig:i,chldPth:X,edges:n,isInverted:$,item:w,nodes:t,path:e}):Xt(w)&&Jo({flowConfig:i,chldPth:X,isInverted:$,edges:n,itrblObjct:[w],nodes:t,path:e,newConfig:_}):(n.push(Ca(e,X,null,I,$,k)),t.push(ai(P,X,{label:M||String(w),parent:N},w,C)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const Jo=({chldPth:r,flowConfig:e,edges:t,itrblObjct:n,nodes:a,isInverted:i,path:o,newConfig:s,forceIsInverted:l=!1})=>{let{hideDefaultObject:u,sprtObjctKy:c}=e;return Object.entries(n).forEach(([d,h],g)=>{h=w0(h,Qo);const p=h,E=Ba(h),m=ka(h),{newConfig:b,arrayObject:w}=Ma(h);w.length&&(h=w);const{hideConfig:x,sourceLabel:C,label:T,content:S,target:_,targetLabel:A,collapsed:P,isEdgeAnimated:D,parent:I}=b;u=u||x;const M=o==="root"&&e.isCntr,k=o.split(".").slice(0,2).join("."),N=sl.includes(k);l||(i=e.isCntr&&N||g%2===0&&M);let z=r?`${r}.${d}`:`${o}.${d}`;if(z=fs(z,a),i&&sl.push(z),_&&t.push(Ca(z,_,null,A,i,D)),Xt(h)&&!hr.isArray(h)){t.push(Ca(o,z,null,C,i,D));const W=c||Object.keys(E).length===0;if(W){const q=S?"object":"array",{config:$}=Yi(q,b);$.data.headerTitle=S?T:null,a.push(ai($,z,{label:T||d,parent:I},h,p))}if(Object.keys(E).length&&!u){const q=hr.isArray(h)?` ${h.length||""}`:`{${Object.keys(h).length||""}}`;let $=z;W&&($=`${z}.${q}`,$=fs($,a),t.push(Ca(z,$,null,C,i,D))),ro(h,$,a,t,T||d,e,b)}else Object.keys(m).length&&!hr.isArray(h)?Jo({chldPth:z,flowConfig:e,itrblObjct:m,path:z,edges:t,nodes:a,newConfig:b,isInverted:i}):ro(h,z,a,t,d,e,b)}else hr.isArray(h)&&(t.push(Ca(o,z,null,C,i,D)),ro(h,z,a,t,d,e,b))})},JP=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o})=>a.forEach((s,l)=>{let u=`${e}.${l}`;u=fs(u,i);const c=s;s=w0(s,Qo);const d=ka(s),h=Ba(s),{newConfig:g}=Ma(s),{collapsed:p,label:E,parent:m,sourceLabel:b,isEdgeAnimated:w,content:x}=g;Xt(s)?!hr.isArray(s)&&Object.keys(h).length?(t.push(Ca(o,u,null,b,n,w)),ro(s,u,i,t,l,r,g)):Object.keys(d).length&&!hr.isArray(s)&&!p?Jo({chldPth:u,flowConfig:r,itrblObjct:d,path:o,edges:t,nodes:i,isInverted:n,newConfig:g}):hr.isArray(s)&&JP({flowConfig:r,chldPth:u,edges:t,isInverted:n,item:s,nodes:i,path:o}):(t.push(Ca(o,u,null,b,n,w)),i.push(ai(b0,u,{label:E||String(s),parent:m},s,c)))});exports.DynamicIcon=Pm;exports.FlowDiagram=LW;exports.contentObjTheme=In;exports.createFlowDiagram=ro;exports.getChakraColorHex=ht;exports.getColorVariant=Y2;exports.getDarkerHexColor=Uu;exports.useCustomColors=ds;exports.useStopPropagation=Z2;exports.useThemeContentColors=cs;
|
|
357
|
+
`),s=tV(n,a,o);s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var u=0;u<this.batchManager.getMaxAtlasesPerBatch();u++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(u)));return s}},{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,o=a.createVertexArray();return a.bindVertexArray(o),cV(a,"vec2",i.aPosition,t),this.transformBuffer=dV(a,n,i.aTransform),this.indexBuffer=Ln(a,n,"vec4",i.aIndex),this.vertTypeBuffer=Ln(a,n,"int",i.aVertType),this.atlasIdBuffer=Ln(a,n,"int",i.aAtlasId),this.texBuffer=Ln(a,n,"vec4",i.aTex),this.pointAPointBBuffer=Ln(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=Ln(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=Ln(a,n,"vec2",i.aLineWidth),this.colorBuffer=Ln(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=Ln(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=Ln(a,n,"vec4",i.aBorderColor),a.bindVertexArray(null),o}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return _a(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:os.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):!0:!1}},{key:"drawTexture",value:function(t,n,a){var i=this.atlasManager,o=this.batchManager,s=i.getRenderTypeOpts(a);if(this._isVisible(t,s)&&!(t.isEdge()&&!this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var u=s.getTexPickingMode(t);if(u===dl.IGNORE)return;if(u==dl.USE_BB){this.drawPickingRectangle(t,n,a);return}}var l=i.getAtlasInfo(t,a),f=Gt(l),d;try{for(f.s();!(d=f.n()).done;){var h=d.value,g=h.atlas,p=h.tex1,x=h.tex2;o.canAddToCurrentBatch(g)||this.endBatch();for(var b=o.getAtlasIndexForBatch(g),w=0,y=[[p,!0],[x,!1]];w<y.length;w++){var E=Xr(y[w],2),C=E[0],S=E[1];if(C.w!=0){var R=this.instanceCount;this.vertTypeBuffer.getView(R)[0]=ov;var _=this.indexBuffer.getView(R);ji(n,_);var A=this.atlasIdBuffer.getView(R);A[0]=b;var P=this.texBuffer.getView(R);P[0]=C.x,P[1]=C.y,P[2]=C.w,P[3]=C.h;var I=this.transformBuffer.getMatrixView(R);this.setTransformMatrix(t,I,s,h,S),this.instanceCount++,S||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(D){f.e(D)}finally{f.f()}}}},{key:"setTransformMatrix",value:function(t,n,a,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=0;if(a.shapeProps&&a.shapeProps.padding&&(s=t.pstyle(a.shapeProps.padding).pfValue),i){var u=i.bb,l=i.tex1,f=i.tex2,d=l.w/(l.w+f.w);o||(d=1-d);var h=this._getAdjustedBB(u,s,o,d);this._applyTransformMatrix(n,h,a,t)}else{var g=a.getBoundingBox(t),p=this._getAdjustedBB(g,s,!0,1);this._applyTransformMatrix(n,p,a,t)}}},{key:"_applyTransformMatrix",value:function(t,n,a,i){var o,s;GE(t);var u=a.getRotation?a.getRotation(i):0;if(u!==0){var l=a.getRotationPoint(i),f=l.x,d=l.y;Yu(t,t,[f,d]),WE(t,t,u);var h=a.getRotationOffset(i);o=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else o=n.x1,s=n.y1;Yu(t,t,[o,s]),qm(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,a,i){var o=t.x1,s=t.y1,u=t.w,l=t.h,f=t.yOffset;n&&(o-=n,s-=n,u+=2*n,l+=2*n);var d=0,h=u*i;return a&&i<1?u=h:!a&&i<1&&(d=u-h,o+=d,u=h),{x1:o,y1:s,w:u,h:l,xOffset:d,yOffset:f}}},{key:"drawPickingRectangle",value:function(t,n,a){var i=this.atlasManager.getRenderTypeOpts(a),o=this.instanceCount;this.vertTypeBuffer.getView(o)[0]=Yi;var s=this.indexBuffer.getView(o);ji(n,s);var u=this.colorBuffer.getView(o);ri([0,0,0],1,u);var l=this.transformBuffer.getMatrixView(o);this.setTransformMatrix(t,l,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 o=i.shapeProps,s=this._getVertTypeForShape(t,o.shape);if(s===void 0||i.isSimple&&!i.isSimple(t)){this.drawTexture(t,n,a);return}var u=this.instanceCount;if(this.vertTypeBuffer.getView(u)[0]=s,s===Nu||s===Uo){var l=i.getBoundingBox(t),f=this._getCornerRadius(t,o.radius,l),d=this.cornerRadiusBuffer.getView(u);d[0]=f,d[1]=f,d[2]=f,d[3]=f,s===Uo&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(u);ji(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,x=this.colorBuffer.getView(u);ri(g,p,x);var b=this.lineWidthBuffer.getView(u);if(b[0]=0,b[1]=0,o.border){var w=t.pstyle("border-width").value;if(w>0){var y=t.pstyle("border-color").value,E=t.pstyle("border-opacity").value,C=this.borderColorBuffer.getView(u);ri(y,E,C);var S=t.pstyle("border-position").value;if(S==="inside")b[0]=0,b[1]=-w;else if(S==="outside")b[0]=w,b[1]=0;else{var R=w/2;b[0]=R,b[1]=-R}}}var _=this.transformBuffer.getMatrixView(u);this.setTransformMatrix(t,_,i),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){var a=t.pstyle(n).value;switch(a){case"rectangle":return Yi;case"ellipse":return Ho;case"roundrectangle":case"round-rectangle":return Nu;case"bottom-round-rectangle":return Uo;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return Ma(i,o);var s=t.pstyle(n).pfValue,u=i/2,l=o/2;return Math.min(s,l,u)}},{key:"drawEdgeArrow",value:function(t,n,a){if(t.visible()){var i=t._private.rscratch,o,s,u;if(a==="source"?(o=i.arrowStartX,s=i.arrowStartY,u=i.srcArrowAngle):(o=i.arrowEndX,s=i.arrowEndY,u=i.tgtArrowAngle),!(isNaN(o)||o==null||isNaN(s)||s==null||isNaN(u)||u==null)){var l=t.pstyle(a+"-arrow-shape").value;if(l!=="none"){var f=t.pstyle(a+"-arrow-color").value,d=t.pstyle("opacity").value,h=t.pstyle("line-opacity").value,g=d*h,p=t.pstyle("width").pfValue,x=t.pstyle("arrow-scale").value,b=this.r.getArrowWidth(p,x),w=this.instanceCount,y=this.transformBuffer.getMatrixView(w);GE(y),Yu(y,y,[o,s]),qm(y,y,[b,b]),WE(y,y,u),this.vertTypeBuffer.getView(w)[0]=sv;var E=this.indexBuffer.getView(w);ji(n,E);var C=this.colorBuffer.getView(w);ri(f,g,C),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,o=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,u=t.pstyle("line-color").value,l=i*o;if(a.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),a.length==4){var f=this.instanceCount;this.vertTypeBuffer.getView(f)[0]=UE;var d=this.indexBuffer.getView(f);ji(n,d);var h=this.colorBuffer.getView(f);ri(u,l,h);var g=this.lineWidthBuffer.getView(f);g[0]=s;var p=this.pointAPointBBuffer.getView(f);p[0]=a[0],p[1]=a[1],p[2]=a[2],p[3]=a[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var x=0;x<a.length-2;x+=2){var b=this.instanceCount;this.vertTypeBuffer.getView(b)[0]=HE;var w=this.indexBuffer.getView(b);ji(n,w);var y=this.colorBuffer.getView(b);ri(u,l,y);var E=this.lineWidthBuffer.getView(b);E[0]=s;var C=a[x-2],S=a[x-1],R=a[x],_=a[x+1],A=a[x+2],P=a[x+3],I=a[x+4],D=a[x+5];x==0&&(C=2*R-A+.001,S=2*_-P+.001),x==a.length-4&&(I=2*A-R+.001,D=2*P-_+.001);var L=this.pointAPointBBuffer.getView(b);L[0]=C,L[1]=S,L[2]=R,L[3]=_;var M=this.pointCPointDBuffer.getView(b);M[0]=A,M[1]=P,M[2]=I,M[3]=D,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||n.allpts==null||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var a=n.allpts;if(a.length==4)return a;var i=this._getNumSegments(t);return this._getCurveSegmentPoints(a,i)}}},{key:"_getNumSegments",value:function(t){var n=15;return Math.min(Math.max(n,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(t.length==4)return t;for(var a=Array((n+1)*2),i=0;i<=n;i++)if(i==0)a[0]=t[0],a[1]=t[1];else if(i==n)a[i*2]=t[t.length-2],a[i*2+1]=t[t.length-1];else{var o=i/n;this._setCurvePoint(t,o,a,i*2)}return a}},{key:"_setCurvePoint",value:function(t,n,a,i){if(t.length<=2)a[i]=t[0],a[i+1]=t[1];else{for(var o=Array(t.length-2),s=0;s<o.length;s+=2){var u=(1-n)*t[s]+n*t[s+2],l=(1-n)*t[s+1]+n*t[s+3];o[s]=u,o[s+1]=l}return this._setCurvePoint(o,n,a,i)}}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,a=this.vertexCount,i=this.instanceCount;if(i!==0){var o=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(o),t.bindVertexArray(n);var s=Gt(this.buffers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.bufferSubData(i)}}catch(p){s.e(p)}finally{s.f()}for(var f=this.batchManager.getAtlases(),d=0;d<f.length;d++)f[d].bufferIfNeeded(t);for(var h=0;h<f.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,f[h].texture),t.uniform1i(o.uTextures[h],h);t.uniform1f(o.uZoom,aV(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=ri(this.bgColor,1);t.uniform4fv(o.uBGColor,g),t.drawArraysInstanced(t.TRIANGLES,0,a,i),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:i,atlasCount:f.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(o,s){return o+s.atlasCount},0),a=this.batchDebugInfo,i=a.reduce(function(o,s){return o+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:a.length,batchInfo:a,totalInstances:i}}}])})(),fP={};fP.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=TV(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=vV(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new SV(t,n,r);var a=function(d){return function(h){return t.getTextAngle(h,d)}},i=function(d){return function(h){var g=h.pstyle(d);return g&&g.value}},o=function(d){return function(h){return h.pstyle("".concat(d,"-opacity")).value>0}},s=function(d){var h=d.pstyle("text-events").strValue==="yes";return h?dl.USE_BB:dl.IGNORE},u=function(d){var h=d.position(),g=h.x,p=h.y,x=d.outerWidth(),b=d.outerHeight();return{w:x,h:b,x1:g-x/2,y1:p-b/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:u,isSimple:oV,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:u,isVisible:o("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:u,isVisible:o("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:s,getKey:uv(e.getLabelKey,null),getBoundingBox:lv(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:s,getKey:uv(e.getSourceLabelKey,"source"),getBoundingBox:lv(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:s,getKey:uv(e.getTargetLabelKey,"target"),getBoundingBox:lv(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var l=Ss(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(f,d){var h=!1;d&&d.length>0&&(h|=t.drawing.invalidate(d)),h&&l()}),RV(t)};function TV(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return NR(t)}function cP(r,e){var t=r._private.rscratch;return $t(t,"labelWrapCachedLines",e)||[]}var uv=function(e,t){return function(n){var a=e(n),i=cP(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},lv=function(e,t){return function(n,a){var i=e(n);if(typeof a=="string"){var o=a.indexOf("_");if(o>0){var s=Number(a.substring(o+1)),u=cP(n,t),l=i.h/u.length,f=l*s,d=i.y1+f;return{x1:i.x1,w:i.w,y1:d,h:l,yOffset:f}}}return i}};function RV(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>nP?(AV(r),e.call(r,i)):(PV(r),vP(r,i,os.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,o,s,u){return OV(r,i,o)};{var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0}}{var a=r.notify;r.notify=function(i,o){a.call(r,i,o),i==="viewport"||i==="bounds"?r.pickingFrameBuffer.needsDraw=!0:i==="background"&&r.drawing.invalidate(o,{type:"node-body"})}}}function AV(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function PV(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])}function IV(r){var e=r.canvasWidth,t=r.canvasHeight,n=g0(r),a=n.pan,i=n.zoom,o=iv();Yu(o,o,[a.x,a.y]),qm(o,o,[i,i]);var s=iv();gV(s,e,t);var u=iv();return hV(u,s,o),u}function dP(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=g0(r),i=a.pan,o=a.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(i.x,i.y),e.scale(o,o)}function DV(r,e){r.drawSelectionRectangle(e,function(t){return dP(r,t)})}function BV(r){var e=r.data.contexts[r.NODE];e.save(),dP(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()}function MV(r){var e=function(a,i,o){for(var s=a.atlasManager.getAtlasCollection(i),u=r.data.contexts[r.NODE],l=s.atlases,f=0;f<l.length;f++){var d=l[f],h=d.canvas;if(h){var g=h.width,p=h.height,x=g*f,b=h.height*o,w=.4;u.save(),u.scale(w,w),u.drawImage(h,x,b),u.strokeStyle="black",u.rect(x,b,g,p),u.stroke(),u.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}function LV(r,e,t,n,a){var i,o,s,u,l=g0(r),f=l.pan,d=l.zoom;{var h=iV(r,f,d,e,t),g=Xr(h,2),p=g[0],x=g[1],b=6;i=p-b/2,o=x-b/2,s=b,u=b}if(s===0||u===0)return[];var w=r.data.contexts[r.WEBGL];w.bindFramebuffer(w.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(w.viewport(0,0,w.canvas.width,w.canvas.height),vP(r,null,os.PICKING),r.pickingFrameBuffer.needsDraw=!1);var y=s*u,E=new Uint8Array(y*4);w.readPixels(i,o,s,u,w.RGBA,w.UNSIGNED_BYTE,E),w.bindFramebuffer(w.FRAMEBUFFER,null);for(var C=new Set,S=0;S<y;S++){var R=E.slice(S*4,S*4+4),_=uV(R)-1;_>=0&&C.add(_)}return C}function OV(r,e,t){var n=LV(r,e,t),a=r.getCachedZSortedEles(),i,o,s=Gt(n),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,f=a[l];if(!i&&f.isNode()&&(i=f),!o&&f.isEdge()&&(o=f),i&&o)break}}catch(d){s.e(d)}finally{s.f()}return[i,o].filter(Boolean)}function fv(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 vP(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]&&DV(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var o=r.data.contexts[r.WEBGL];t.screen?(o.clearColor(0,0,0,0),o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)):o.disable(o.BLEND),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),o.viewport(0,0,o.canvas.width,o.canvas.height);var s=IV(r),u=r.getCachedZSortedEles();if(i=u.length,a.startFrame(s,t),t.screen){for(var l=0;l<u.nondrag.length;l++)fv(r,l,u.nondrag[l]);for(var f=0;f<u.drag.length;f++)fv(r,f,u.drag[f])}else if(t.picking)for(var d=0;d<u.length;d++)fv(r,d,u[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(BV(r),MV(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=!1,p=Math.ceil(h-n),x=a.getDebugInfo(),b=["".concat(i," elements"),"".concat(x.totalInstances," instances"),"".concat(x.batchCount," batches"),"".concat(x.totalAtlases," atlases"),"".concat(x.wrappedCount," wrapped textures"),"".concat(x.simpleCount," simple shapes")].join(", ");if(g)console.log("WebGL (".concat(t.name,") - time ").concat(p,"ms, ").concat(b));else{console.log("WebGL (".concat(t.name,") - frame time ").concat(p,"ms")),console.log("Totals:"),console.log(" ".concat(b)),console.log("Texture Atlases Used:");var w=x.atlasInfo,y=Gt(w),E;try{for(y.s();!(E=y.n()).done;){var C=E.value;console.log(" ".concat(C.type,": ").concat(C.keyCount," keys, ").concat(C.atlasCount," atlases"))}}catch(S){y.e(S)}finally{y.f()}console.log("")}}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,a.gc())}var $a={};$a.drawPolygonPath=function(r,e,t,n,a,i){var o=n/2,s=a/2;r.beginPath&&r.beginPath(),r.moveTo(e+o*i[0],t+s*i[1]);for(var u=1;u<i.length/2;u++)r.lineTo(e+o*i[u*2],t+s*i[u*2+1]);r.closePath()};$a.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return jA(r,s)}),r.closePath()};$a.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,u=i==="auto"?Ma(n,a):Math.min(i,s,o);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+o,t-s,e+o,t,u),r.arcTo(e+o,t+s,e,t+s,u),r.arcTo(e-o,t+s,e-o,t,u),r.arcTo(e-o,t-s,e,t-s,u),r.lineTo(e,t-s),r.closePath()};$a.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,u=i==="auto"?Ma(n,a):i;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+o,t-s),r.lineTo(e+o,t),r.arcTo(e+o,t+s,e,t+s,u),r.arcTo(e-o,t+s,e-o,t,u),r.lineTo(e-o,t-s),r.lineTo(e,t-s),r.closePath()};$a.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,u=a/2,l=o==="auto"?r0():o;r.beginPath&&r.beginPath(),r.moveTo(e-s+l,t-u),r.lineTo(e+s-l,t-u),r.lineTo(e+s,t-u+l),r.lineTo(e+s,t+u-l),r.lineTo(e+s-l,t+u),r.lineTo(e-s+l,t+u),r.lineTo(e-s,t+u-l),r.lineTo(e-s,t-u+l),r.closePath()};$a.drawBarrelPath=function(r,e,t,n,a){var i=n/2,o=a/2,s=e-i,u=e+i,l=t-o,f=t+o,d=Cm(n,a),h=d.widthOffset,g=d.heightOffset,p=d.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,l+g),r.lineTo(s,f-g),r.quadraticCurveTo(s+p,f,s+h,f),r.lineTo(u-h,f),r.quadraticCurveTo(u-p,f,u,f-g),r.lineTo(u,l+g),r.quadraticCurveTo(u-p,l,u-h,l),r.lineTo(s+h,l),r.quadraticCurveTo(s+p,l,s,l+g),r.closePath()};var KE=Math.sin(0),jE=Math.cos(0),Nm={},Fm={},hP=Math.PI/40;for(var Xi=0*Math.PI;Xi<2*Math.PI;Xi+=hP)Nm[Xi]=Math.sin(Xi),Fm[Xi]=Math.cos(Xi);$a.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,o,s=n/2,u=a/2,l=0*Math.PI;l<2*Math.PI;l+=hP)i=e-s*Nm[l]*KE+s*Fm[l]*jE,o=t+u*Fm[l]*KE+u*Nm[l]*jE,l===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var Ds={};Ds.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};Ds.bufferCanvasImage=function(r){var e=this.cy,t=e.mutableElements(),n=t.boundingBox(),a=this.findContainerClientCoords(),i=r.full?Math.ceil(n.w):a[2],o=r.full?Math.ceil(n.h):a[3],s=qe(r.maxWidth)||qe(r.maxHeight),u=this.getPixelRatio(),l=1;if(r.scale!==void 0)i*=r.scale,o*=r.scale,l=r.scale;else if(s){var f=1/0,d=1/0;qe(r.maxWidth)&&(f=l*r.maxWidth/i),qe(r.maxHeight)&&(d=l*r.maxHeight/o),l=Math.min(f,d),i*=l,o*=l}s||(i*=u,o*=u,l*=u);var h=document.createElement("canvas");h.width=i,h.height=o,h.style.width=i+"px",h.style.height=o+"px";var g=h.getContext("2d");if(i>0&&o>0){g.clearRect(0,0,i,o),g.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(r.full)g.translate(-n.x1*l,-n.y1*l),g.scale(l,l),this.drawElements(g,p),g.scale(1/l,1/l),g.translate(n.x1*l,n.y1*l);else{var x=e.pan(),b={x:x.x*l,y:x.y*l};l*=e.zoom(),g.translate(b.x,b.y),g.scale(l,l),this.drawElements(g,p),g.scale(1/l,1/l),g.translate(-b.x,-b.y)}r.bg&&(g.globalCompositeOperation="destination-over",g.fillStyle=r.bg,g.rect(0,0,i,o),g.fill())}return h};function kV(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})}function YE(r){var e=r.indexOf(",");return r.substr(e+1)}function gP(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new po(function(a,i){try{e.toBlob(function(o){o!=null?a(o):i(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(o){i(o)}});case"blob":return kV(YE(n()),t);case"base64":return YE(n());case"base64uri":default:return n()}}Ds.png=function(r){return gP(r,this.bufferCanvasImage(r),"image/png")};Ds.jpg=function(r){return gP(r,this.bufferCanvasImage(r),"image/jpeg")};var pP={};pP.nodeShapeImpl=function(r,e,t,n,a,i,o,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,a,i);case"polygon":return this.drawPolygonPath(e,t,n,a,i,o);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,a,i,o,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,a,i,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,a,i,o,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,a,i,s);case"barrel":return this.drawBarrelPath(e,t,n,a,i)}};var qV=yP,cr=yP.prototype;cr.CANVAS_LAYERS=3;cr.SELECT_BOX=0;cr.DRAG=1;cr.NODE=2;cr.WEBGL=3;cr.CANVAS_TYPES=["2d","2d","2d","webgl2"];cr.BUFFER_COUNT=3;cr.TEXTURE_BUFFER=0;cr.MOTIONBLUR_BUFFER_NODE=1;cr.MOTIONBLUR_BUFFER_DRAG=2;function yP(r){var e=this,t=e.cy.window(),n=t.document;r.webgl&&(cr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(cr.CANVAS_LAYERS),contexts:new Array(cr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(cr.CANVAS_LAYERS),bufferCanvases:new Array(cr.BUFFER_COUNT),bufferContexts:new Array(cr.CANVAS_LAYERS)};var a="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var o=e.data.canvasContainer.style;e.data.canvasContainer.style[a]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[a]=i;var u={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};DN()&&(u["-ms-touch-action"]="none",u["touch-action"]="none");for(var l=0;l<cr.CANVAS_LAYERS;l++){var f=e.data.canvases[l]=n.createElement("canvas"),d=cr.CANVAS_TYPES[l];e.data.contexts[l]=f.getContext(d),e.data.contexts[l]||kr("Could not create canvas of type "+d),Object.keys(u).forEach(function(oe){f.style[oe]=u[oe]}),f.style.position="absolute",f.setAttribute("data-id","layer"+l),f.style.zIndex=String(cr.CANVAS_LAYERS-l),e.data.canvasContainer.appendChild(f),e.data.canvasNeedsRedraw[l]=!1}e.data.topCanvas=e.data.canvases[0],e.data.canvases[cr.NODE].setAttribute("data-id","layer"+cr.NODE+"-node"),e.data.canvases[cr.SELECT_BOX].setAttribute("data-id","layer"+cr.SELECT_BOX+"-selectbox"),e.data.canvases[cr.DRAG].setAttribute("data-id","layer"+cr.DRAG+"-drag"),e.data.canvases[cr.WEBGL]&&e.data.canvases[cr.WEBGL].setAttribute("data-id","layer"+cr.WEBGL+"-webgl");for(var l=0;l<cr.BUFFER_COUNT;l++)e.data.bufferCanvases[l]=n.createElement("canvas"),e.data.bufferContexts[l]=e.data.bufferCanvases[l].getContext("2d"),e.data.bufferCanvases[l].style.position="absolute",e.data.bufferCanvases[l].setAttribute("data-id","buffer"+l),e.data.bufferCanvases[l].style.zIndex=String(-l-1),e.data.bufferCanvases[l].style.visibility="hidden";e.pathsEnabled=!0;var h=Lt(),g=function(Z){return{x:(Z.x1+Z.x2)/2,y:(Z.y1+Z.y2)/2}},p=function(Z){return{x:-Z.w/2,y:-Z.h/2}},x=function(Z){var Q=Z[0]._private,ie=Q.oldBackgroundTimestamp===Q.backgroundTimestamp;return!ie},b=function(Z){return Z[0]._private.nodeKey},w=function(Z){return Z[0]._private.labelStyleKey},y=function(Z){return Z[0]._private.sourceLabelStyleKey},E=function(Z){return Z[0]._private.targetLabelStyleKey},C=function(Z,Q,ie,de,we){return e.drawElement(Z,Q,ie,!1,!1,we)},S=function(Z,Q,ie,de,we){return e.drawElementText(Z,Q,ie,de,"main",we)},R=function(Z,Q,ie,de,we){return e.drawElementText(Z,Q,ie,de,"source",we)},_=function(Z,Q,ie,de,we){return e.drawElementText(Z,Q,ie,de,"target",we)},A=function(Z){return Z.boundingBox(),Z[0]._private.bodyBounds},P=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.main||h},I=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.source||h},D=function(Z){return Z.boundingBox(),Z[0]._private.labelBounds.target||h},L=function(Z,Q){return Q},M=function(Z){return g(A(Z))},q=function(Z,Q,ie){var de=Z?Z+"-":"";return{x:Q.x+ie.pstyle(de+"text-margin-x").pfValue,y:Q.y+ie.pstyle(de+"text-margin-y").pfValue}},N=function(Z,Q,ie){var de=Z[0]._private.rscratch;return{x:de[Q],y:de[ie]}},W=function(Z){return q("",N(Z,"labelX","labelY"),Z)},V=function(Z){return q("source",N(Z,"sourceLabelX","sourceLabelY"),Z)},$=function(Z){return q("target",N(Z,"targetLabelX","targetLabelY"),Z)},X=function(Z){return p(A(Z))},ee=function(Z){return p(I(Z))},K=function(Z){return p(D(Z))},j=function(Z){var Q=P(Z),ie=p(P(Z));if(Z.isNode()){switch(Z.pstyle("text-halign").value){case"left":ie.x=-Q.w-(Q.leftPad||0);break;case"right":ie.x=-(Q.rightPad||0);break}switch(Z.pstyle("text-valign").value){case"top":ie.y=-Q.h-(Q.topPad||0);break;case"bottom":ie.y=-(Q.botPad||0);break}}return ie},fe=e.data.eleTxrCache=new Zo(e,{getKey:b,doesEleInvalidateKey:x,drawElement:C,getBoundingBox:A,getRotationPoint:M,getRotationOffset:X,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),G=e.data.lblTxrCache=new Zo(e,{getKey:w,drawElement:S,getBoundingBox:P,getRotationPoint:W,getRotationOffset:j,isVisible:L}),z=e.data.slbTxrCache=new Zo(e,{getKey:y,drawElement:R,getBoundingBox:I,getRotationPoint:V,getRotationOffset:ee,isVisible:L}),Y=e.data.tlbTxrCache=new Zo(e,{getKey:E,drawElement:_,getBoundingBox:D,getRotationPoint:$,getRotationOffset:K,isVisible:L}),te=e.data.lyrTxrCache=new aP(e);e.onUpdateEleCalcs(function(Z,Q){fe.invalidateElements(Q),G.invalidateElements(Q),z.invalidateElements(Q),Y.invalidateElements(Q),te.invalidateElements(Q);for(var ie=0;ie<Q.length;ie++){var de=Q[ie]._private;de.oldBackgroundTimestamp=de.backgroundTimestamp}});var ue=function(Z){for(var Q=0;Q<Z.length;Q++)te.enqueueElementRefinement(Z[Q].ele)};fe.onDequeue(ue),G.onDequeue(ue),z.onDequeue(ue),Y.onDequeue(ue),r.webgl&&e.initWebgl(r,{getStyleKey:b,getLabelKey:w,getSourceLabelKey:y,getTargetLabelKey:E,drawElement:C,drawLabel:S,drawSourceLabel:R,drawTargetLabel:_,getElementBox:A,getLabelBox:P,getSourceLabelBox:I,getTargetLabelBox:D,getElementRotationPoint:M,getElementRotationOffset:X,getLabelRotationPoint:W,getSourceLabelRotationPoint:V,getTargetLabelRotationPoint:$,getLabelRotationOffset:j,getSourceLabelRotationOffset:ee,getTargetLabelRotationOffset:K})}cr.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[cr.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[cr.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[cr.SELECT_BOX]=e;break;case"gc":t.data.gc=!0;break}};var NV=typeof Path2D<"u";cr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};cr.usePaths=function(){return NV&&this.pathsEnabled};cr.setImgSmoothing=function(r,e){r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)};cr.getImgSmoothing=function(r){return r.imageSmoothingEnabled!=null?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled};cr.makeOffscreenCanvas=function(r,e){var t;if((typeof OffscreenCanvas>"u"?"undefined":at(OffscreenCanvas))!=="undefined")t=new OffscreenCanvas(r,e);else{var n=this.cy.window(),a=n.document;t=a.createElement("canvas"),t.width=r,t.height=e}return t};[iP,Vn,ia,h0,bi,za,Ot,fP,$a,Ds,pP].forEach(function(r){Ze(cr,r)});var FV=[{name:"null",impl:UA},{name:"base",impl:rP},{name:"canvas",impl:qV}],zV=[{type:"layout",extensions:c3},{type:"renderer",extensions:FV}],mP={},bP={};function wP(r,e,t){var n=t,a=function(A){Cr("Can not register `"+e+"` for `"+r+"` since `"+A+"` already exists in the prototype and can not be overridden")};if(r==="core"){if(ys.prototype[e])return a(e);ys.prototype[e]=t}else if(r==="collection"){if(bt.prototype[e])return a(e);bt.prototype[e]=t}else if(r==="layout"){for(var i=function(A){this.options=A,t.call(this,A),yr(this._private)||(this._private={}),this._private.cy=A.cy,this._private.listeners=[],this.createEmitter()},o=i.prototype=Object.create(t.prototype),s=[],u=0;u<s.length;u++){var l=s[u];o[l]=o[l]||function(){return this}}o.start&&!o.run?o.run=function(){return this.start(),this}:!o.start&&o.run&&(o.start=function(){return this.run(),this});var f=t.prototype.stop;o.stop=function(){var _=this.options;if(_&&_.animate){var A=this.animations;if(A)for(var P=0;P<A.length;P++)A[P].stop()}return f?f.call(this):this.emit("layoutstop"),this},o.destroy||(o.destroy=function(){return this}),o.cy=function(){return this._private.cy};var d=function(A){return A._private.cy},h={addEventFields:function(A,P){P.layout=A,P.cy=d(A),P.target=A},bubble:function(){return!0},parent:function(A){return d(A)}};Ze(o,{createEmitter:function(){return this._private.emitter=new Pl(h,this),this},emitter:function(){return this._private.emitter},on:function(A,P){return this.emitter().on(A,P),this},one:function(A,P){return this.emitter().one(A,P),this},once:function(A,P){return this.emitter().one(A,P),this},removeListener:function(A,P){return this.emitter().removeListener(A,P),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(A,P){return this.emitter().emit(A,P),this}}),Er.eventAliasesOn(o),n=i}else if(r==="renderer"&&e!=="null"&&e!=="base"){var g=xP("renderer","base"),p=g.prototype,x=t,b=t.prototype,w=function(){g.apply(this,arguments),x.apply(this,arguments)},y=w.prototype;for(var E in p){var C=p[E],S=b[E]!=null;if(S)return a(E);y[E]=C}for(var R in b)y[R]=b[R];p.clientFunctions.forEach(function(_){y[_]=y[_]||function(){kr("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=w}else if(r==="__proto__"||r==="constructor"||r==="prototype")return kr(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return FR({map:mP,keys:[r,e],value:n})}function xP(r,e){return zR({map:mP,keys:[r,e]})}function $V(r,e,t,n,a){return FR({map:bP,keys:[r,e,t,n],value:a})}function VV(r,e,t,n){return zR({map:bP,keys:[r,e,t,n]})}var zm=function(){if(arguments.length===2)return xP.apply(null,arguments);if(arguments.length===3)return wP.apply(null,arguments);if(arguments.length===4)return VV.apply(null,arguments);if(arguments.length===5)return $V.apply(null,arguments);kr("Invalid extension access syntax")};ys.prototype.extension=zm;zV.forEach(function(r){r.extensions.forEach(function(e){wP(r.type,e.name,e.impl)})});var vl=function(){if(!(this instanceof vl))return new vl;this.length=0},gi=vl.prototype;gi.instanceString=function(){return"stylesheet"};gi.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};gi.css=function(r,e){var t=this.length-1;if(Ye(r))this[t].properties.push({name:r,value:e});else if(yr(r))for(var n=r,a=Object.keys(n),i=0;i<a.length;i++){var o=a[i],s=n[o];if(s!=null){var u=lt.properties[o]||lt.properties[bl(o)];if(u!=null){var l=u.name,f=s;this[t].properties.push({name:l,value:f})}}}return this};gi.style=gi.css;gi.generateStyle=function(r){var e=new lt(r);return this.appendToStyle(e)};gi.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],n=t.selector,a=t.properties;r.selector(n);for(var i=0;i<a.length;i++){var o=a[i];r.css(o.name,o.value)}}return r};var GV="3.33.1",vn=function(e){if(e===void 0&&(e={}),yr(e))return new ys(e);if(Ye(e))return zm.apply(zm,arguments)};vn.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(vn),r.apply(null,e),this};vn.warnings=function(r){return KR(r)};vn.version=GV;vn.stylesheet=vn.Stylesheet=vl;var Xu={exports:{}};function p0(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var cv,XE;function WV(){if(XE)return cv;XE=1;function r(){this.__data__=[],this.size=0}return cv=r,cv}var dv,ZE;function xo(){if(ZE)return dv;ZE=1;function r(e,t){return e===t||e!==e&&t!==t}return dv=r,dv}var vv,QE;function ql(){if(QE)return vv;QE=1;var r=xo();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return vv=e,vv}var hv,JE;function UV(){if(JE)return hv;JE=1;var r=ql(),e=Array.prototype,t=e.splice;function n(a){var i=this.__data__,o=r(i,a);if(o<0)return!1;var s=i.length-1;return o==s?i.pop():t.call(i,o,1),--this.size,!0}return hv=n,hv}var gv,eC;function HV(){if(eC)return gv;eC=1;var r=ql();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return gv=e,gv}var pv,rC;function KV(){if(rC)return pv;rC=1;var r=ql();function e(t){return r(this.__data__,t)>-1}return pv=e,pv}var yv,tC;function jV(){if(tC)return yv;tC=1;var r=ql();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}return yv=e,yv}var mv,nC;function Nl(){if(nC)return mv;nC=1;var r=WV(),e=UV(),t=HV(),n=KV(),a=jV();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,mv=i,mv}var bv,aC;function YV(){if(aC)return bv;aC=1;var r=Nl();function e(){this.__data__=new r,this.size=0}return bv=e,bv}var wv,iC;function XV(){if(iC)return wv;iC=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return wv=r,wv}var xv,oC;function ZV(){if(oC)return xv;oC=1;function r(e){return this.__data__.get(e)}return xv=r,xv}var Ev,sC;function QV(){if(sC)return Ev;sC=1;function r(e){return this.__data__.has(e)}return Ev=r,Ev}var Cv,uC;function Bs(){if(uC)return Cv;uC=1;var r=yi(),e=rn(),t="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(s){if(!e(s))return!1;var u=r(s);return u==n||u==a||u==t||u==i}return Cv=o,Cv}var _v,lC;function JV(){if(lC)return _v;lC=1;var r=An(),e=r["__core-js_shared__"];return _v=e,_v}var Sv,fC;function e4(){if(fC)return Sv;fC=1;var r=JV(),e=(function(){var n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function t(n){return!!e&&e in n}return Sv=t,Sv}var Tv,cC;function EP(){if(cC)return Tv;cC=1;var r=Function.prototype,e=r.toString;function t(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Tv=t,Tv}var Rv,dC;function r4(){if(dC)return Rv;dC=1;var r=Bs(),e=e4(),t=rn(),n=EP(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,u=o.toString,l=s.hasOwnProperty,f=RegExp("^"+u.call(l).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(h){if(!t(h)||e(h))return!1;var g=r(h)?f:i;return g.test(n(h))}return Rv=d,Rv}var Av,vC;function t4(){if(vC)return Av;vC=1;function r(e,t){return e==null?void 0:e[t]}return Av=r,Av}var Pv,hC;function wi(){if(hC)return Pv;hC=1;var r=r4(),e=t4();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return Pv=t,Pv}var Iv,gC;function y0(){if(gC)return Iv;gC=1;var r=wi(),e=An(),t=r(e,"Map");return Iv=t,Iv}var Dv,pC;function Fl(){if(pC)return Dv;pC=1;var r=wi(),e=r(Object,"create");return Dv=e,Dv}var Bv,yC;function n4(){if(yC)return Bv;yC=1;var r=Fl();function e(){this.__data__=r?r(null):{},this.size=0}return Bv=e,Bv}var Mv,mC;function a4(){if(mC)return Mv;mC=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return Mv=r,Mv}var Lv,bC;function i4(){if(bC)return Lv;bC=1;var r=Fl(),e="__lodash_hash_undefined__",t=Object.prototype,n=t.hasOwnProperty;function a(i){var o=this.__data__;if(r){var s=o[i];return s===e?void 0:s}return n.call(o,i)?o[i]:void 0}return Lv=a,Lv}var Ov,wC;function o4(){if(wC)return Ov;wC=1;var r=Fl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return Ov=n,Ov}var kv,xC;function s4(){if(xC)return kv;xC=1;var r=Fl(),e="__lodash_hash_undefined__";function t(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=r&&a===void 0?e:a,this}return kv=t,kv}var qv,EC;function u4(){if(EC)return qv;EC=1;var r=n4(),e=a4(),t=i4(),n=o4(),a=s4();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,qv=i,qv}var Nv,CC;function l4(){if(CC)return Nv;CC=1;var r=u4(),e=Nl(),t=y0();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return Nv=n,Nv}var Fv,_C;function f4(){if(_C)return Fv;_C=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return Fv=r,Fv}var zv,SC;function zl(){if(SC)return zv;SC=1;var r=f4();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return zv=e,zv}var $v,TC;function c4(){if(TC)return $v;TC=1;var r=zl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return $v=e,$v}var Vv,RC;function d4(){if(RC)return Vv;RC=1;var r=zl();function e(t){return r(this,t).get(t)}return Vv=e,Vv}var Gv,AC;function v4(){if(AC)return Gv;AC=1;var r=zl();function e(t){return r(this,t).has(t)}return Gv=e,Gv}var Wv,PC;function h4(){if(PC)return Wv;PC=1;var r=zl();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}return Wv=e,Wv}var Uv,IC;function m0(){if(IC)return Uv;IC=1;var r=l4(),e=c4(),t=d4(),n=v4(),a=h4();function i(o){var s=-1,u=o==null?0:o.length;for(this.clear();++s<u;){var l=o[s];this.set(l[0],l[1])}}return i.prototype.clear=r,i.prototype.delete=e,i.prototype.get=t,i.prototype.has=n,i.prototype.set=a,Uv=i,Uv}var Hv,DC;function g4(){if(DC)return Hv;DC=1;var r=Nl(),e=y0(),t=m0(),n=200;function a(i,o){var s=this.__data__;if(s instanceof r){var u=s.__data__;if(!e||u.length<n-1)return u.push([i,o]),this.size=++s.size,this;s=this.__data__=new t(u)}return s.set(i,o),this.size=s.size,this}return Hv=a,Hv}var Kv,BC;function $l(){if(BC)return Kv;BC=1;var r=Nl(),e=YV(),t=XV(),n=ZV(),a=QV(),i=g4();function o(s){var u=this.__data__=new r(s);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,Kv=o,Kv}var jv,MC;function b0(){if(MC)return jv;MC=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a&&t(e[n],n,e)!==!1;);return e}return jv=r,jv}var Yv,LC;function CP(){if(LC)return Yv;LC=1;var r=wi(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Yv=e,Yv}var Xv,OC;function Vl(){if(OC)return Xv;OC=1;var r=CP();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Xv=e,Xv}var Zv,kC;function Gl(){if(kC)return Zv;kC=1;var r=Vl(),e=xo(),t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s){var u=i[o];(!(n.call(i,o)&&e(u,s))||s===void 0&&!(o in i))&&r(i,o,s)}return Zv=a,Zv}var Qv,qC;function Ms(){if(qC)return Qv;qC=1;var r=Gl(),e=Vl();function t(n,a,i,o){var s=!i;i||(i={});for(var u=-1,l=a.length;++u<l;){var f=a[u],d=o?o(i[f],n[f],f,i,n):void 0;d===void 0&&(d=n[f]),s?e(i,f,d):r(i,f,d)}return i}return Qv=t,Qv}var Jv,NC;function p4(){if(NC)return Jv;NC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return Jv=r,Jv}var eh,FC;function y4(){if(FC)return eh;FC=1;var r=yi(),e=zn(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return eh=n,eh}var rh,zC;function Ls(){if(zC)return rh;zC=1;var r=y4(),e=zn(),t=Object.prototype,n=t.hasOwnProperty,a=t.propertyIsEnumerable,i=r((function(){return arguments})())?r:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return rh=i,rh}var th,$C;function Zr(){if($C)return th;$C=1;var r=Array.isArray;return th=r,th}var Qo={exports:{}},nh,VC;function m4(){if(VC)return nh;VC=1;function r(){return!1}return nh=r,nh}Qo.exports;var GC;function Eo(){return GC||(GC=1,(function(r,e){var t=An(),n=m4(),a=e&&!e.nodeType&&e,i=a&&!0&&r&&!r.nodeType&&r,o=i&&i.exports===a,s=o?t.Buffer:void 0,u=s?s.isBuffer:void 0,l=u||n;r.exports=l})(Qo,Qo.exports)),Qo.exports}var ah,WC;function Wl(){if(WC)return ah;WC=1;var r=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function t(n,a){var i=typeof n;return a=a??r,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return ah=t,ah}var ih,UC;function w0(){if(UC)return ih;UC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return ih=e,ih}var oh,HC;function b4(){if(HC)return oh;HC=1;var r=yi(),e=w0(),t=zn(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",s="[object Error]",u="[object Function]",l="[object Map]",f="[object Number]",d="[object Object]",h="[object RegExp]",g="[object Set]",p="[object String]",x="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",y="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",S="[object Int16Array]",R="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",D={};D[y]=D[E]=D[C]=D[S]=D[R]=D[_]=D[A]=D[P]=D[I]=!0,D[n]=D[a]=D[b]=D[i]=D[w]=D[o]=D[s]=D[u]=D[l]=D[f]=D[d]=D[h]=D[g]=D[p]=D[x]=!1;function L(M){return t(M)&&e(M.length)&&!!D[r(M)]}return oh=L,oh}var sh,KC;function Ul(){if(KC)return sh;KC=1;function r(e){return function(t){return e(t)}}return sh=r,sh}var Jo={exports:{}};Jo.exports;var jC;function x0(){return jC||(jC=1,(function(r,e){var t=AR(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i&&t.process,s=(function(){try{var u=a&&a.require&&a.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();r.exports=s})(Jo,Jo.exports)),Jo.exports}var uh,YC;function Os(){if(YC)return uh;YC=1;var r=b4(),e=Ul(),t=x0(),n=t&&t.isTypedArray,a=n?e(n):r;return uh=a,uh}var lh,XC;function _P(){if(XC)return lh;XC=1;var r=p4(),e=Ls(),t=Zr(),n=Eo(),a=Wl(),i=Os(),o=Object.prototype,s=o.hasOwnProperty;function u(l,f){var d=t(l),h=!d&&e(l),g=!d&&!h&&n(l),p=!d&&!h&&!g&&i(l),x=d||h||g||p,b=x?r(l.length,String):[],w=b.length;for(var y in l)(f||s.call(l,y))&&!(x&&(y=="length"||g&&(y=="offset"||y=="parent")||p&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||a(y,w)))&&b.push(y);return b}return lh=u,lh}var fh,ZC;function Hl(){if(ZC)return fh;ZC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return fh=e,fh}var ch,QC;function SP(){if(QC)return ch;QC=1;function r(e,t){return function(n){return e(t(n))}}return ch=r,ch}var dh,JC;function w4(){if(JC)return dh;JC=1;var r=SP(),e=r(Object.keys,Object);return dh=e,dh}var vh,e_;function E0(){if(e_)return vh;e_=1;var r=Hl(),e=w4(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!r(i))return e(i);var o=[];for(var s in Object(i))n.call(i,s)&&s!="constructor"&&o.push(s);return o}return vh=a,vh}var hh,r_;function oa(){if(r_)return hh;r_=1;var r=Bs(),e=w0();function t(n){return n!=null&&e(n.length)&&!r(n)}return hh=t,hh}var gh,t_;function Va(){if(t_)return gh;t_=1;var r=_P(),e=E0(),t=oa();function n(a){return t(a)?r(a):e(a)}return gh=n,gh}var ph,n_;function x4(){if(n_)return ph;n_=1;var r=Ms(),e=Va();function t(n,a){return n&&r(a,e(a),n)}return ph=t,ph}var yh,a_;function E4(){if(a_)return yh;a_=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return yh=r,yh}var mh,i_;function C4(){if(i_)return mh;i_=1;var r=rn(),e=Hl(),t=E4(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!r(o))return t(o);var s=e(o),u=[];for(var l in o)l=="constructor"&&(s||!a.call(o,l))||u.push(l);return u}return mh=i,mh}var bh,o_;function xi(){if(o_)return bh;o_=1;var r=_P(),e=C4(),t=oa();function n(a){return t(a)?r(a,!0):e(a)}return bh=n,bh}var wh,s_;function _4(){if(s_)return wh;s_=1;var r=Ms(),e=xi();function t(n,a){return n&&r(a,e(a),n)}return wh=t,wh}var es={exports:{}};es.exports;var u_;function TP(){return u_||(u_=1,(function(r,e){var t=An(),n=e&&!e.nodeType&&e,a=n&&!0&&r&&!r.nodeType&&r,i=a&&a.exports===n,o=i?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function u(l,f){if(f)return l.slice();var d=l.length,h=s?s(d):new l.constructor(d);return l.copy(h),h}r.exports=u})(es,es.exports)),es.exports}var xh,l_;function RP(){if(l_)return xh;l_=1;function r(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}return xh=r,xh}var Eh,f_;function AP(){if(f_)return Eh;f_=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}return Eh=r,Eh}var Ch,c_;function PP(){if(c_)return Ch;c_=1;function r(){return[]}return Ch=r,Ch}var _h,d_;function C0(){if(d_)return _h;d_=1;var r=AP(),e=PP(),t=Object.prototype,n=t.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),r(a(o),function(s){return n.call(o,s)}))}:e;return _h=i,_h}var Sh,v_;function S4(){if(v_)return Sh;v_=1;var r=Ms(),e=C0();function t(n,a){return r(n,e(n),a)}return Sh=t,Sh}var Th,h_;function _0(){if(h_)return Th;h_=1;function r(e,t){for(var n=-1,a=t.length,i=e.length;++n<a;)e[i+n]=t[n];return e}return Th=r,Th}var Rh,g_;function Kl(){if(g_)return Rh;g_=1;var r=SP(),e=r(Object.getPrototypeOf,Object);return Rh=e,Rh}var Ah,p_;function IP(){if(p_)return Ah;p_=1;var r=_0(),e=Kl(),t=C0(),n=PP(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return Ah=i,Ah}var Ph,y_;function T4(){if(y_)return Ph;y_=1;var r=Ms(),e=IP();function t(n,a){return r(n,e(n),a)}return Ph=t,Ph}var Ih,m_;function DP(){if(m_)return Ih;m_=1;var r=_0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return Ih=t,Ih}var Dh,b_;function BP(){if(b_)return Dh;b_=1;var r=DP(),e=C0(),t=Va();function n(a){return r(a,t,e)}return Dh=n,Dh}var Bh,w_;function R4(){if(w_)return Bh;w_=1;var r=DP(),e=IP(),t=xi();function n(a){return r(a,t,e)}return Bh=n,Bh}var Mh,x_;function A4(){if(x_)return Mh;x_=1;var r=wi(),e=An(),t=r(e,"DataView");return Mh=t,Mh}var Lh,E_;function P4(){if(E_)return Lh;E_=1;var r=wi(),e=An(),t=r(e,"Promise");return Lh=t,Lh}var Oh,C_;function MP(){if(C_)return Oh;C_=1;var r=wi(),e=An(),t=r(e,"Set");return Oh=t,Oh}var kh,__;function I4(){if(__)return kh;__=1;var r=wi(),e=An(),t=r(e,"WeakMap");return kh=t,kh}var qh,S_;function Co(){if(S_)return qh;S_=1;var r=A4(),e=y0(),t=P4(),n=MP(),a=I4(),i=yi(),o=EP(),s="[object Map]",u="[object Object]",l="[object Promise]",f="[object Set]",d="[object WeakMap]",h="[object DataView]",g=o(r),p=o(e),x=o(t),b=o(n),w=o(a),y=i;return(r&&y(new r(new ArrayBuffer(1)))!=h||e&&y(new e)!=s||t&&y(t.resolve())!=l||n&&y(new n)!=f||a&&y(new a)!=d)&&(y=function(E){var C=i(E),S=C==u?E.constructor:void 0,R=S?o(S):"";if(R)switch(R){case g:return h;case p:return s;case x:return l;case b:return f;case w:return d}return C}),qh=y,qh}var Nh,T_;function D4(){if(T_)return Nh;T_=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n){var a=n.length,i=new n.constructor(a);return a&&typeof n[0]=="string"&&e.call(n,"index")&&(i.index=n.index,i.input=n.input),i}return Nh=t,Nh}var Fh,R_;function LP(){if(R_)return Fh;R_=1;var r=An(),e=r.Uint8Array;return Fh=e,Fh}var zh,A_;function S0(){if(A_)return zh;A_=1;var r=LP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return zh=e,zh}var $h,P_;function B4(){if(P_)return $h;P_=1;var r=S0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}return $h=e,$h}var Vh,I_;function M4(){if(I_)return Vh;I_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return Vh=e,Vh}var Gh,D_;function L4(){if(D_)return Gh;D_=1;var r=vo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Gh=n,Gh}var Wh,B_;function OP(){if(B_)return Wh;B_=1;var r=S0();function e(t,n){var a=n?r(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}return Wh=e,Wh}var Uh,M_;function O4(){if(M_)return Uh;M_=1;var r=S0(),e=B4(),t=M4(),n=L4(),a=OP(),i="[object Boolean]",o="[object Date]",s="[object Map]",u="[object Number]",l="[object RegExp]",f="[object Set]",d="[object String]",h="[object Symbol]",g="[object ArrayBuffer]",p="[object DataView]",x="[object Float32Array]",b="[object Float64Array]",w="[object Int8Array]",y="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",S="[object Uint8ClampedArray]",R="[object Uint16Array]",_="[object Uint32Array]";function A(P,I,D){var L=P.constructor;switch(I){case g:return r(P);case i:case o:return new L(+P);case p:return e(P,D);case x:case b:case w:case y:case E:case C:case S:case R:case _:return a(P,D);case s:return new L;case u:case d:return new L(P);case l:return t(P);case f:return new L;case h:return n(P)}}return Uh=A,Uh}var Hh,L_;function kP(){if(L_)return Hh;L_=1;var r=rn(),e=Object.create,t=(function(){function n(){}return function(a){if(!r(a))return{};if(e)return e(a);n.prototype=a;var i=new n;return n.prototype=void 0,i}})();return Hh=t,Hh}var Kh,O_;function qP(){if(O_)return Kh;O_=1;var r=kP(),e=Kl(),t=Hl();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Kh=n,Kh}var jh,k_;function k4(){if(k_)return jh;k_=1;var r=Co(),e=zn(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return jh=n,jh}var Yh,q_;function q4(){if(q_)return Yh;q_=1;var r=k4(),e=Ul(),t=x0(),n=t&&t.isMap,a=n?e(n):r;return Yh=a,Yh}var Xh,N_;function N4(){if(N_)return Xh;N_=1;var r=Co(),e=zn(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Xh=n,Xh}var Zh,F_;function F4(){if(F_)return Zh;F_=1;var r=N4(),e=Ul(),t=x0(),n=t&&t.isSet,a=n?e(n):r;return Zh=a,Zh}var Qh,z_;function NP(){if(z_)return Qh;z_=1;var r=$l(),e=b0(),t=Gl(),n=x4(),a=_4(),i=TP(),o=RP(),s=S4(),u=T4(),l=BP(),f=R4(),d=Co(),h=D4(),g=O4(),p=qP(),x=Zr(),b=Eo(),w=q4(),y=rn(),E=F4(),C=Va(),S=xi(),R=1,_=2,A=4,P="[object Arguments]",I="[object Array]",D="[object Boolean]",L="[object Date]",M="[object Error]",q="[object Function]",N="[object GeneratorFunction]",W="[object Map]",V="[object Number]",$="[object Object]",X="[object RegExp]",ee="[object Set]",K="[object String]",j="[object Symbol]",fe="[object WeakMap]",G="[object ArrayBuffer]",z="[object DataView]",Y="[object Float32Array]",te="[object Float64Array]",ue="[object Int8Array]",oe="[object Int16Array]",Z="[object Int32Array]",Q="[object Uint8Array]",ie="[object Uint8ClampedArray]",de="[object Uint16Array]",we="[object Uint32Array]",Ae={};Ae[P]=Ae[I]=Ae[G]=Ae[z]=Ae[D]=Ae[L]=Ae[Y]=Ae[te]=Ae[ue]=Ae[oe]=Ae[Z]=Ae[W]=Ae[V]=Ae[$]=Ae[X]=Ae[ee]=Ae[K]=Ae[j]=Ae[Q]=Ae[ie]=Ae[de]=Ae[we]=!0,Ae[M]=Ae[q]=Ae[fe]=!1;function ve(le,Me,Se,Ee,re,ce){var _e,me=Me&R,Te=Me&_,De=Me&A;if(Se&&(_e=re?Se(le,Ee,re,ce):Se(le)),_e!==void 0)return _e;if(!y(le))return le;var Ne=x(le);if(Ne){if(_e=h(le),!me)return o(le,_e)}else{var ze=d(le),$e=ze==q||ze==N;if(b(le))return i(le,me);if(ze==$||ze==P||$e&&!re){if(_e=Te||$e?{}:p(le),!me)return Te?u(le,a(_e,le)):s(le,n(_e,le))}else{if(!Ae[ze])return re?le:{};_e=g(le,ze,me)}}ce||(ce=new r);var ke=ce.get(le);if(ke)return ke;ce.set(le,_e),E(le)?le.forEach(function(O){_e.add(ve(O,Me,Se,O,le,ce))}):w(le)&&le.forEach(function(O,ne){_e.set(ne,ve(O,Me,Se,ne,le,ce))});var Oe=De?Te?f:l:Te?S:C,ye=Ne?void 0:Oe(le);return e(ye||le,function(O,ne){ye&&(ne=O,O=le[ne]),t(_e,ne,ve(O,Me,Se,ne,le,ce))}),_e}return Qh=ve,Qh}var Jh,$_;function z4(){if($_)return Jh;$_=1;var r=NP(),e=4;function t(n){return r(n,e)}return Jh=t,Jh}var eg,V_;function T0(){if(V_)return eg;V_=1;function r(e){return function(){return e}}return eg=r,eg}var rg,G_;function $4(){if(G_)return rg;G_=1;function r(e){return function(t,n,a){for(var i=-1,o=Object(t),s=a(t),u=s.length;u--;){var l=s[e?u:++i];if(n(o[l],l,o)===!1)break}return t}}return rg=r,rg}var tg,W_;function R0(){if(W_)return tg;W_=1;var r=$4(),e=r();return tg=e,tg}var ng,U_;function A0(){if(U_)return ng;U_=1;var r=R0(),e=Va();function t(n,a){return n&&r(n,a,e)}return ng=t,ng}var ag,H_;function V4(){if(H_)return ag;H_=1;var r=oa();function e(t,n){return function(a,i){if(a==null)return a;if(!r(a))return t(a,i);for(var o=a.length,s=n?o:-1,u=Object(a);(n?s--:++s<o)&&i(u[s],s,u)!==!1;);return a}}return ag=e,ag}var ig,K_;function jl(){if(K_)return ig;K_=1;var r=A0(),e=V4(),t=e(r);return ig=t,ig}var og,j_;function Ei(){if(j_)return og;j_=1;function r(e){return e}return og=r,og}var sg,Y_;function FP(){if(Y_)return sg;Y_=1;var r=Ei();function e(t){return typeof t=="function"?t:r}return sg=e,sg}var ug,X_;function zP(){if(X_)return ug;X_=1;var r=b0(),e=jl(),t=FP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return ug=a,ug}var lg,Z_;function $P(){return Z_||(Z_=1,lg=zP()),lg}var fg,Q_;function G4(){if(Q_)return fg;Q_=1;var r=jl();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return fg=e,fg}var cg,J_;function W4(){if(J_)return cg;J_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return cg=e,cg}var dg,eS;function U4(){if(eS)return dg;eS=1;function r(e){return this.__data__.has(e)}return dg=r,dg}var vg,rS;function VP(){if(rS)return vg;rS=1;var r=m0(),e=W4(),t=U4();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new r;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=t,vg=n,vg}var hg,tS;function H4(){if(tS)return hg;tS=1;function r(e,t){for(var n=-1,a=e==null?0:e.length;++n<a;)if(t(e[n],n,e))return!0;return!1}return hg=r,hg}var gg,nS;function GP(){if(nS)return gg;nS=1;function r(e,t){return e.has(t)}return gg=r,gg}var pg,aS;function WP(){if(aS)return pg;aS=1;var r=VP(),e=H4(),t=GP(),n=1,a=2;function i(o,s,u,l,f,d){var h=u&n,g=o.length,p=s.length;if(g!=p&&!(h&&p>g))return!1;var x=d.get(o),b=d.get(s);if(x&&b)return x==s&&b==o;var w=-1,y=!0,E=u&a?new r:void 0;for(d.set(o,s),d.set(s,o);++w<g;){var C=o[w],S=s[w];if(l)var R=h?l(S,C,w,s,o,d):l(C,S,w,o,s,d);if(R!==void 0){if(R)continue;y=!1;break}if(E){if(!e(s,function(_,A){if(!t(E,A)&&(C===_||f(C,_,u,l,d)))return E.push(A)})){y=!1;break}}else if(!(C===S||f(C,S,u,l,d))){y=!1;break}}return d.delete(o),d.delete(s),y}return pg=i,pg}var yg,iS;function K4(){if(iS)return yg;iS=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return yg=r,yg}var mg,oS;function P0(){if(oS)return mg;oS=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return mg=r,mg}var bg,sS;function j4(){if(sS)return bg;sS=1;var r=vo(),e=LP(),t=xo(),n=WP(),a=K4(),i=P0(),o=1,s=2,u="[object Boolean]",l="[object Date]",f="[object Error]",d="[object Map]",h="[object Number]",g="[object RegExp]",p="[object Set]",x="[object String]",b="[object Symbol]",w="[object ArrayBuffer]",y="[object DataView]",E=r?r.prototype:void 0,C=E?E.valueOf:void 0;function S(R,_,A,P,I,D,L){switch(A){case y:if(R.byteLength!=_.byteLength||R.byteOffset!=_.byteOffset)return!1;R=R.buffer,_=_.buffer;case w:return!(R.byteLength!=_.byteLength||!D(new e(R),new e(_)));case u:case l:case h:return t(+R,+_);case f:return R.name==_.name&&R.message==_.message;case g:case x:return R==_+"";case d:var M=a;case p:var q=P&o;if(M||(M=i),R.size!=_.size&&!q)return!1;var N=L.get(R);if(N)return N==_;P|=s,L.set(R,_);var W=n(M(R),M(_),P,I,D,L);return L.delete(R),W;case b:if(C)return C.call(R)==C.call(_)}return!1}return bg=S,bg}var wg,uS;function Y4(){if(uS)return wg;uS=1;var r=BP(),e=1,t=Object.prototype,n=t.hasOwnProperty;function a(i,o,s,u,l,f){var d=s&e,h=r(i),g=h.length,p=r(o),x=p.length;if(g!=x&&!d)return!1;for(var b=g;b--;){var w=h[b];if(!(d?w in o:n.call(o,w)))return!1}var y=f.get(i),E=f.get(o);if(y&&E)return y==o&&E==i;var C=!0;f.set(i,o),f.set(o,i);for(var S=d;++b<g;){w=h[b];var R=i[w],_=o[w];if(u)var A=d?u(_,R,w,o,i,f):u(R,_,w,i,o,f);if(!(A===void 0?R===_||l(R,_,s,u,f):A)){C=!1;break}S||(S=w=="constructor")}if(C&&!S){var P=i.constructor,I=o.constructor;P!=I&&"constructor"in i&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&(C=!1)}return f.delete(i),f.delete(o),C}return wg=a,wg}var xg,lS;function X4(){if(lS)return xg;lS=1;var r=$l(),e=WP(),t=j4(),n=Y4(),a=Co(),i=Zr(),o=Eo(),s=Os(),u=1,l="[object Arguments]",f="[object Array]",d="[object Object]",h=Object.prototype,g=h.hasOwnProperty;function p(x,b,w,y,E,C){var S=i(x),R=i(b),_=S?f:a(x),A=R?f:a(b);_=_==l?d:_,A=A==l?d:A;var P=_==d,I=A==d,D=_==A;if(D&&o(x)){if(!o(b))return!1;S=!0,P=!1}if(D&&!P)return C||(C=new r),S||s(x)?e(x,b,w,y,E,C):t(x,b,_,w,y,E,C);if(!(w&u)){var L=P&&g.call(x,"__wrapped__"),M=I&&g.call(b,"__wrapped__");if(L||M){var q=L?x.value():x,N=M?b.value():b;return C||(C=new r),E(q,N,w,y,C)}}return D?(C||(C=new r),n(x,b,w,y,E,C)):!1}return xg=p,xg}var Eg,fS;function UP(){if(fS)return Eg;fS=1;var r=X4(),e=zn();function t(n,a,i,o,s){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:r(n,a,i,o,t,s)}return Eg=t,Eg}var Cg,cS;function Z4(){if(cS)return Cg;cS=1;var r=$l(),e=UP(),t=1,n=2;function a(i,o,s,u){var l=s.length,f=l,d=!u;if(i==null)return!f;for(i=Object(i);l--;){var h=s[l];if(d&&h[2]?h[1]!==i[h[0]]:!(h[0]in i))return!1}for(;++l<f;){h=s[l];var g=h[0],p=i[g],x=h[1];if(d&&h[2]){if(p===void 0&&!(g in i))return!1}else{var b=new r;if(u)var w=u(p,x,g,i,o,b);if(!(w===void 0?e(x,p,t|n,u,b):w))return!1}}return!0}return Cg=a,Cg}var _g,dS;function HP(){if(dS)return _g;dS=1;var r=rn();function e(t){return t===t&&!r(t)}return _g=e,_g}var Sg,vS;function Q4(){if(vS)return Sg;vS=1;var r=HP(),e=Va();function t(n){for(var a=e(n),i=a.length;i--;){var o=a[i],s=n[o];a[i]=[o,s,r(s)]}return a}return Sg=t,Sg}var Tg,hS;function KP(){if(hS)return Tg;hS=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return Tg=r,Tg}var Rg,gS;function J4(){if(gS)return Rg;gS=1;var r=Z4(),e=Q4(),t=KP();function n(a){var i=e(a);return i.length==1&&i[0][2]?t(i[0][0],i[0][1]):function(o){return o===a||r(o,a,i)}}return Rg=n,Rg}var Ag,pS;function I0(){if(pS)return Ag;pS=1;var r=Zr(),e=ho(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(r(i))return!1;var s=typeof i;return s=="number"||s=="symbol"||s=="boolean"||i==null||e(i)?!0:n.test(i)||!t.test(i)||o!=null&&i in Object(o)}return Ag=a,Ag}var Pg,yS;function eG(){if(yS)return Pg;yS=1;var r=m0(),e="Expected a function";function t(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,s=a?a.apply(this,o):o[0],u=i.cache;if(u.has(s))return u.get(s);var l=n.apply(this,o);return i.cache=u.set(s,l)||u,l};return i.cache=new(t.Cache||r),i}return t.Cache=r,Pg=t,Pg}var Ig,mS;function rG(){if(mS)return Ig;mS=1;var r=eG(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return Ig=t,Ig}var Dg,bS;function tG(){if(bS)return Dg;bS=1;var r=rG(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,s,u,l){i.push(u?l.replace(t,"$1"):s||o)}),i});return Dg=n,Dg}var Bg,wS;function Yl(){if(wS)return Bg;wS=1;function r(e,t){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=t(e[n],n,e);return i}return Bg=r,Bg}var Mg,xS;function nG(){if(xS)return Mg;xS=1;var r=vo(),e=Yl(),t=Zr(),n=ho(),a=r?r.prototype:void 0,i=a?a.toString:void 0;function o(s){if(typeof s=="string")return s;if(t(s))return e(s,o)+"";if(n(s))return i?i.call(s):"";var u=s+"";return u=="0"&&1/s==-1/0?"-0":u}return Mg=o,Mg}var Lg,ES;function jP(){if(ES)return Lg;ES=1;var r=nG();function e(t){return t==null?"":r(t)}return Lg=e,Lg}var Og,CS;function Xl(){if(CS)return Og;CS=1;var r=Zr(),e=I0(),t=tG(),n=jP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return Og=a,Og}var kg,_S;function ks(){if(_S)return kg;_S=1;var r=ho();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return kg=e,kg}var qg,SS;function Zl(){if(SS)return qg;SS=1;var r=Xl(),e=ks();function t(n,a){a=r(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return qg=t,qg}var Ng,TS;function aG(){if(TS)return Ng;TS=1;var r=Zl();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return Ng=e,Ng}var Fg,RS;function iG(){if(RS)return Fg;RS=1;function r(e,t){return e!=null&&t in Object(e)}return Fg=r,Fg}var zg,AS;function YP(){if(AS)return zg;AS=1;var r=Xl(),e=Ls(),t=Zr(),n=Wl(),a=w0(),i=ks();function o(s,u,l){u=r(u,s);for(var f=-1,d=u.length,h=!1;++f<d;){var g=i(u[f]);if(!(h=s!=null&&l(s,g)))break;s=s[g]}return h||++f!=d?h:(d=s==null?0:s.length,!!d&&a(d)&&n(g,d)&&(t(s)||e(s)))}return zg=o,zg}var $g,PS;function XP(){if(PS)return $g;PS=1;var r=iG(),e=YP();function t(n,a){return n!=null&&e(n,a,r)}return $g=t,$g}var Vg,IS;function oG(){if(IS)return Vg;IS=1;var r=UP(),e=aG(),t=XP(),n=I0(),a=HP(),i=KP(),o=ks(),s=1,u=2;function l(f,d){return n(f)&&a(d)?i(o(f),d):function(h){var g=e(h,f);return g===void 0&&g===d?t(h,f):r(d,g,s|u)}}return Vg=l,Vg}var Gg,DS;function ZP(){if(DS)return Gg;DS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return Gg=r,Gg}var Wg,BS;function sG(){if(BS)return Wg;BS=1;var r=Zl();function e(t){return function(n){return r(n,t)}}return Wg=e,Wg}var Ug,MS;function uG(){if(MS)return Ug;MS=1;var r=ZP(),e=sG(),t=I0(),n=ks();function a(i){return t(i)?r(n(i)):e(i)}return Ug=a,Ug}var Hg,LS;function sa(){if(LS)return Hg;LS=1;var r=J4(),e=oG(),t=Ei(),n=Zr(),a=uG();function i(o){return typeof o=="function"?o:o==null?t:typeof o=="object"?n(o)?e(o[0],o[1]):r(o):a(o)}return Hg=i,Hg}var Kg,OS;function QP(){if(OS)return Kg;OS=1;var r=AP(),e=G4(),t=sa(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return Kg=a,Kg}var jg,kS;function lG(){if(kS)return jg;kS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return jg=t,jg}var Yg,qS;function JP(){if(qS)return Yg;qS=1;var r=lG(),e=YP();function t(n,a){return n!=null&&e(n,a,r)}return Yg=t,Yg}var Xg,NS;function fG(){if(NS)return Xg;NS=1;var r=E0(),e=Co(),t=Ls(),n=Zr(),a=oa(),i=Eo(),o=Hl(),s=Os(),u="[object Map]",l="[object Set]",f=Object.prototype,d=f.hasOwnProperty;function h(g){if(g==null)return!0;if(a(g)&&(n(g)||typeof g=="string"||typeof g.splice=="function"||i(g)||s(g)||t(g)))return!g.length;var p=e(g);if(p==u||p==l)return!g.size;if(o(g))return!r(g).length;for(var x in g)if(d.call(g,x))return!1;return!0}return Xg=h,Xg}var Zg,FS;function eI(){if(FS)return Zg;FS=1;function r(e){return e===void 0}return Zg=r,Zg}var Qg,zS;function rI(){if(zS)return Qg;zS=1;var r=jl(),e=oa();function t(n,a){var i=-1,o=e(n)?Array(n.length):[];return r(n,function(s,u,l){o[++i]=a(s,u,l)}),o}return Qg=t,Qg}var Jg,$S;function tI(){if($S)return Jg;$S=1;var r=Yl(),e=sa(),t=rI(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return Jg=a,Jg}var ep,VS;function cG(){if(VS)return ep;VS=1;function r(e,t,n,a){var i=-1,o=e==null?0:e.length;for(a&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}return ep=r,ep}var rp,GS;function dG(){if(GS)return rp;GS=1;function r(e,t,n,a,i){return i(e,function(o,s,u){n=a?(a=!1,o):t(n,o,s,u)}),n}return rp=r,rp}var tp,WS;function nI(){if(WS)return tp;WS=1;var r=cG(),e=jl(),t=sa(),n=dG(),a=Zr();function i(o,s,u){var l=a(o)?r:n,f=arguments.length<3;return l(o,t(s,4),u,f,e)}return tp=i,tp}var np,US;function vG(){if(US)return np;US=1;var r=yi(),e=Zr(),t=zn(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return np=a,np}var ap,HS;function hG(){if(HS)return ap;HS=1;var r=ZP(),e=r("length");return ap=e,ap}var ip,KS;function gG(){if(KS)return ip;KS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="\\u200d",s=RegExp("["+o+r+a+i+"]");function u(l){return s.test(l)}return ip=u,ip}var op,jS;function pG(){if(jS)return op;jS=1;var r="\\ud800-\\udfff",e="\\u0300-\\u036f",t="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+t+n,i="\\ufe0e\\ufe0f",o="["+r+"]",s="["+a+"]",u="\\ud83c[\\udffb-\\udfff]",l="(?:"+s+"|"+u+")",f="[^"+r+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",p=l+"?",x="["+i+"]?",b="(?:"+g+"(?:"+[f,d,h].join("|")+")"+x+p+")*",w=x+p+b,y="(?:"+[f+s+"?",s,d,h,o].join("|")+")",E=RegExp(u+"(?="+u+")|"+y+w,"g");function C(S){for(var R=E.lastIndex=0;E.test(S);)++R;return R}return op=C,op}var sp,YS;function yG(){if(YS)return sp;YS=1;var r=hG(),e=gG(),t=pG();function n(a){return e(a)?t(a):r(a)}return sp=n,sp}var up,XS;function mG(){if(XS)return up;XS=1;var r=E0(),e=Co(),t=oa(),n=vG(),a=yG(),i="[object Map]",o="[object Set]";function s(u){if(u==null)return 0;if(t(u))return n(u)?a(u):u.length;var l=e(u);return l==i||l==o?u.size:r(u).length}return up=s,up}var lp,ZS;function bG(){if(ZS)return lp;ZS=1;var r=b0(),e=kP(),t=A0(),n=sa(),a=Kl(),i=Zr(),o=Eo(),s=Bs(),u=rn(),l=Os();function f(d,h,g){var p=i(d),x=p||o(d)||l(d);if(h=n(h,4),g==null){var b=d&&d.constructor;x?g=p?new b:[]:u(d)?g=s(b)?e(a(d)):{}:g={}}return(x?r:t)(d,function(w,y,E){return h(g,w,y,E)}),g}return lp=f,lp}var fp,QS;function wG(){if(QS)return fp;QS=1;var r=vo(),e=Ls(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return fp=a,fp}var cp,JS;function D0(){if(JS)return cp;JS=1;var r=_0(),e=wG();function t(n,a,i,o,s){var u=-1,l=n.length;for(i||(i=e),s||(s=[]);++u<l;){var f=n[u];a>0&&i(f)?a>1?t(f,a-1,i,o,s):r(s,f):o||(s[s.length]=f)}return s}return cp=t,cp}var dp,eT;function xG(){if(eT)return dp;eT=1;function r(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}return dp=r,dp}var vp,rT;function aI(){if(rT)return vp;rT=1;var r=xG(),e=Math.max;function t(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,s=-1,u=e(o.length-a,0),l=Array(u);++s<u;)l[s]=o[a+s];s=-1;for(var f=Array(a+1);++s<a;)f[s]=o[s];return f[a]=i(l),r(n,this,f)}}return vp=t,vp}var hp,tT;function EG(){if(tT)return hp;tT=1;var r=T0(),e=CP(),t=Ei(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return hp=n,hp}var gp,nT;function CG(){if(nT)return gp;nT=1;var r=800,e=16,t=Date.now;function n(a){var i=0,o=0;return function(){var s=t(),u=e-(s-o);if(o=s,u>0){if(++i>=r)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return gp=n,gp}var pp,aT;function iI(){if(aT)return pp;aT=1;var r=EG(),e=CG(),t=e(r);return pp=t,pp}var yp,iT;function Ql(){if(iT)return yp;iT=1;var r=Ei(),e=aI(),t=iI();function n(a,i){return t(e(a,i,r),a+"")}return yp=n,yp}var mp,oT;function oI(){if(oT)return mp;oT=1;function r(e,t,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(t(e[o],o,e))return o;return-1}return mp=r,mp}var bp,sT;function _G(){if(sT)return bp;sT=1;function r(e){return e!==e}return bp=r,bp}var wp,uT;function SG(){if(uT)return wp;uT=1;function r(e,t,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===t)return a;return-1}return wp=r,wp}var xp,lT;function TG(){if(lT)return xp;lT=1;var r=oI(),e=_G(),t=SG();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return xp=n,xp}var Ep,fT;function RG(){if(fT)return Ep;fT=1;var r=TG();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return Ep=e,Ep}var Cp,cT;function AG(){if(cT)return Cp;cT=1;function r(e,t,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(t,e[a]))return!0;return!1}return Cp=r,Cp}var _p,dT;function PG(){if(dT)return _p;dT=1;function r(){}return _p=r,_p}var Sp,vT;function IG(){if(vT)return Sp;vT=1;var r=MP(),e=PG(),t=P0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return Sp=a,Sp}var Tp,hT;function DG(){if(hT)return Tp;hT=1;var r=VP(),e=RG(),t=AG(),n=GP(),a=IG(),i=P0(),o=200;function s(u,l,f){var d=-1,h=e,g=u.length,p=!0,x=[],b=x;if(f)p=!1,h=t;else if(g>=o){var w=l?null:a(u);if(w)return i(w);p=!1,h=n,b=new r}else b=l?[]:x;e:for(;++d<g;){var y=u[d],E=l?l(y):y;if(y=f||y!==0?y:0,p&&E===E){for(var C=b.length;C--;)if(b[C]===E)continue e;l&&b.push(E),x.push(y)}else h(b,E,f)||(b!==x&&b.push(E),x.push(y))}return x}return Tp=s,Tp}var Rp,gT;function sI(){if(gT)return Rp;gT=1;var r=oa(),e=zn();function t(n){return e(n)&&r(n)}return Rp=t,Rp}var Ap,pT;function BG(){if(pT)return Ap;pT=1;var r=D0(),e=Ql(),t=DG(),n=sI(),a=e(function(i){return t(r(i,1,n,!0))});return Ap=a,Ap}var Pp,yT;function MG(){if(yT)return Pp;yT=1;var r=Yl();function e(t,n){return r(n,function(a){return t[a]})}return Pp=e,Pp}var Ip,mT;function uI(){if(mT)return Ip;mT=1;var r=MG(),e=Va();function t(n){return n==null?[]:r(n,e(n))}return Ip=t,Ip}var Dp,bT;function gn(){if(bT)return Dp;bT=1;var r;if(typeof p0=="function")try{r={clone:z4(),constant:T0(),each:$P(),filter:QP(),has:JP(),isArray:Zr(),isEmpty:fG(),isFunction:Bs(),isUndefined:eI(),keys:Va(),map:tI(),reduce:nI(),size:mG(),transform:bG(),union:BG(),values:uI()}}catch{}return r||(r=window._),Dp=r,Dp}var Bp,wT;function B0(){if(wT)return Bp;wT=1;var r=gn();Bp=a;var e="\0",t="\0",n="";function a(f){this._isDirected=r.has(f,"directed")?f.directed:!0,this._isMultigraph=r.has(f,"multigraph")?f.multigraph:!1,this._isCompound=r.has(f,"compound")?f.compound:!1,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[t]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(f){return this._label=f,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(f){return r.isFunction(f)||(f=r.constant(f)),this._defaultNodeLabelFn=f,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return r.keys(this._nodes)},a.prototype.sources=function(){var f=this;return r.filter(this.nodes(),function(d){return r.isEmpty(f._in[d])})},a.prototype.sinks=function(){var f=this;return r.filter(this.nodes(),function(d){return r.isEmpty(f._out[d])})},a.prototype.setNodes=function(f,d){var h=arguments,g=this;return r.each(f,function(p){h.length>1?g.setNode(p,d):g.setNode(p)}),this},a.prototype.setNode=function(f,d){return r.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=d),this):(this._nodes[f]=arguments.length>1?d:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]=t,this._children[f]={},this._children[t][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},a.prototype.node=function(f){return this._nodes[f]},a.prototype.hasNode=function(f){return r.has(this._nodes,f)},a.prototype.removeNode=function(f){var d=this;if(r.has(this._nodes,f)){var h=function(g){d.removeEdge(d._edgeObjs[g])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],r.each(this.children(f),function(g){d.setParent(g)}),delete this._children[f]),r.each(r.keys(this._in[f]),h),delete this._in[f],delete this._preds[f],r.each(r.keys(this._out[f]),h),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},a.prototype.setParent=function(f,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(d))d=t;else{d+="";for(var h=d;!r.isUndefined(h);h=this.parent(h))if(h===f)throw new Error("Setting "+d+" as parent of "+f+" would create a cycle");this.setNode(d)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=d,this._children[d][f]=!0,this},a.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},a.prototype.parent=function(f){if(this._isCompound){var d=this._parent[f];if(d!==t)return d}},a.prototype.children=function(f){if(r.isUndefined(f)&&(f=t),this._isCompound){var d=this._children[f];if(d)return r.keys(d)}else{if(f===t)return this.nodes();if(this.hasNode(f))return[]}},a.prototype.predecessors=function(f){var d=this._preds[f];if(d)return r.keys(d)},a.prototype.successors=function(f){var d=this._sucs[f];if(d)return r.keys(d)},a.prototype.neighbors=function(f){var d=this.predecessors(f);if(d)return r.union(d,this.successors(f))},a.prototype.isLeaf=function(f){var d;return this.isDirected()?d=this.successors(f):d=this.neighbors(f),d.length===0},a.prototype.filterNodes=function(f){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var h=this;r.each(this._nodes,function(x,b){f(b)&&d.setNode(b,x)}),r.each(this._edgeObjs,function(x){d.hasNode(x.v)&&d.hasNode(x.w)&&d.setEdge(x,h.edge(x))});var g={};function p(x){var b=h.parent(x);return b===void 0||d.hasNode(b)?(g[x]=b,b):b in g?g[b]:p(b)}return this._isCompound&&r.each(d.nodes(),function(x){d.setParent(x,p(x))}),d},a.prototype.setDefaultEdgeLabel=function(f){return r.isFunction(f)||(f=r.constant(f)),this._defaultEdgeLabelFn=f,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return r.values(this._edgeObjs)},a.prototype.setPath=function(f,d){var h=this,g=arguments;return r.reduce(f,function(p,x){return g.length>1?h.setEdge(p,x,d):h.setEdge(p,x),x}),this},a.prototype.setEdge=function(){var f,d,h,g,p=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(f=x.v,d=x.w,h=x.name,arguments.length===2&&(g=arguments[1],p=!0)):(f=x,d=arguments[1],h=arguments[3],arguments.length>2&&(g=arguments[2],p=!0)),f=""+f,d=""+d,r.isUndefined(h)||(h=""+h);var b=s(this._isDirected,f,d,h);if(r.has(this._edgeLabels,b))return p&&(this._edgeLabels[b]=g),this;if(!r.isUndefined(h)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(d),this._edgeLabels[b]=p?g:this._defaultEdgeLabelFn(f,d,h);var w=u(this._isDirected,f,d,h);return f=w.v,d=w.w,Object.freeze(w),this._edgeObjs[b]=w,i(this._preds[d],f),i(this._sucs[f],d),this._in[d][b]=w,this._out[f][b]=w,this._edgeCount++,this},a.prototype.edge=function(f,d,h){var g=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,f,d,h);return this._edgeLabels[g]},a.prototype.hasEdge=function(f,d,h){var g=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,f,d,h);return r.has(this._edgeLabels,g)},a.prototype.removeEdge=function(f,d,h){var g=arguments.length===1?l(this._isDirected,arguments[0]):s(this._isDirected,f,d,h),p=this._edgeObjs[g];return p&&(f=p.v,d=p.w,delete this._edgeLabels[g],delete this._edgeObjs[g],o(this._preds[d],f),o(this._sucs[f],d),delete this._in[d][g],delete this._out[f][g],this._edgeCount--),this},a.prototype.inEdges=function(f,d){var h=this._in[f];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.v===d}):g}},a.prototype.outEdges=function(f,d){var h=this._out[f];if(h){var g=r.values(h);return d?r.filter(g,function(p){return p.w===d}):g}},a.prototype.nodeEdges=function(f,d){var h=this.inEdges(f,d);if(h)return h.concat(this.outEdges(f,d))};function i(f,d){f[d]?f[d]++:f[d]=1}function o(f,d){--f[d]||delete f[d]}function s(f,d,h,g){var p=""+d,x=""+h;if(!f&&p>x){var b=p;p=x,x=b}return p+n+x+n+(r.isUndefined(g)?e:g)}function u(f,d,h,g){var p=""+d,x=""+h;if(!f&&p>x){var b=p;p=x,x=b}var w={v:p,w:x};return g&&(w.name=g),w}function l(f,d){return s(f,d.v,d.w,d.name)}return Bp}var Mp,xT;function LG(){return xT||(xT=1,Mp="2.1.8"),Mp}var Lp,ET;function OG(){return ET||(ET=1,Lp={Graph:B0(),version:LG()}),Lp}var Op,CT;function kG(){if(CT)return Op;CT=1;var r=gn(),e=B0();Op={write:t,read:i};function t(o){var s={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:n(o),edges:a(o)};return r.isUndefined(o.graph())||(s.value=r.clone(o.graph())),s}function n(o){return r.map(o.nodes(),function(s){var u=o.node(s),l=o.parent(s),f={v:s};return r.isUndefined(u)||(f.value=u),r.isUndefined(l)||(f.parent=l),f})}function a(o){return r.map(o.edges(),function(s){var u=o.edge(s),l={v:s.v,w:s.w};return r.isUndefined(s.name)||(l.name=s.name),r.isUndefined(u)||(l.value=u),l})}function i(o){var s=new e(o.options).setGraph(o.value);return r.each(o.nodes,function(u){s.setNode(u.v,u.value),u.parent&&s.setParent(u.v,u.parent)}),r.each(o.edges,function(u){s.setEdge({v:u.v,w:u.w,name:u.name},u.value)}),s}return Op}var kp,_T;function qG(){if(_T)return kp;_T=1;var r=gn();kp=e;function e(t){var n={},a=[],i;function o(s){r.has(n,s)||(n[s]=!0,i.push(s),r.each(t.successors(s),o),r.each(t.predecessors(s),o))}return r.each(t.nodes(),function(s){i=[],o(s),i.length&&a.push(i)}),a}return kp}var qp,ST;function lI(){if(ST)return qp;ST=1;var r=gn();qp=e;function e(){this._arr=[],this._keyIndices={}}return e.prototype.size=function(){return this._arr.length},e.prototype.keys=function(){return this._arr.map(function(t){return t.key})},e.prototype.has=function(t){return r.has(this._keyIndices,t)},e.prototype.priority=function(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority},e.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},e.prototype.add=function(t,n){var a=this._keyIndices;if(t=String(t),!r.has(a,t)){var i=this._arr,o=i.length;return a[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1},e.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},e.prototype.decrease=function(t,n){var a=this._keyIndices[t];if(n>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[a].priority+" New: "+n);this._arr[a].priority=n,this._decrease(a)},e.prototype._heapify=function(t){var n=this._arr,a=2*t,i=a+1,o=t;a<n.length&&(o=n[a].priority<n[o].priority?a:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))},e.prototype._decrease=function(t){for(var n=this._arr,a=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<a));)this._swap(t,i),t=i},e.prototype._swap=function(t,n){var a=this._arr,i=this._keyIndices,o=a[t],s=a[n];a[t]=s,a[n]=o,i[s.key]=t,i[o.key]=n},qp}var Np,TT;function fI(){if(TT)return Np;TT=1;var r=gn(),e=lI();Np=n;var t=r.constant(1);function n(i,o,s,u){return a(i,String(o),s||t,u||function(l){return i.outEdges(l)})}function a(i,o,s,u){var l={},f=new e,d,h,g=function(p){var x=p.v!==d?p.v:p.w,b=l[x],w=s(p),y=h.distance+w;if(w<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+w);y<b.distance&&(b.distance=y,b.predecessor=d,f.decrease(x,y))};for(i.nodes().forEach(function(p){var x=p===o?0:Number.POSITIVE_INFINITY;l[p]={distance:x},f.add(p,x)});f.size()>0&&(d=f.removeMin(),h=l[d],h.distance!==Number.POSITIVE_INFINITY);)u(d).forEach(g);return l}return Np}var Fp,RT;function NG(){if(RT)return Fp;RT=1;var r=fI(),e=gn();Fp=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return Fp}var zp,AT;function cI(){if(AT)return zp;AT=1;var r=gn();zp=e;function e(t){var n=0,a=[],i={},o=[];function s(u){var l=i[u]={onStack:!0,lowlink:n,index:n++};if(a.push(u),t.successors(u).forEach(function(h){r.has(i,h)?i[h].onStack&&(l.lowlink=Math.min(l.lowlink,i[h].index)):(s(h),l.lowlink=Math.min(l.lowlink,i[h].lowlink))}),l.lowlink===l.index){var f=[],d;do d=a.pop(),i[d].onStack=!1,f.push(d);while(u!==d);o.push(f)}}return t.nodes().forEach(function(u){r.has(i,u)||s(u)}),o}return zp}var $p,PT;function FG(){if(PT)return $p;PT=1;var r=gn(),e=cI();$p=t;function t(n){return r.filter(e(n),function(a){return a.length>1||a.length===1&&n.hasEdge(a[0],a[0])})}return $p}var Vp,IT;function zG(){if(IT)return Vp;IT=1;var r=gn();Vp=t;var e=r.constant(1);function t(a,i,o){return n(a,i||e,o||function(s){return a.outEdges(s)})}function n(a,i,o){var s={},u=a.nodes();return u.forEach(function(l){s[l]={},s[l][l]={distance:0},u.forEach(function(f){l!==f&&(s[l][f]={distance:Number.POSITIVE_INFINITY})}),o(l).forEach(function(f){var d=f.v===l?f.w:f.v,h=i(f);s[l][d]={distance:h,predecessor:l}})}),u.forEach(function(l){var f=s[l];u.forEach(function(d){var h=s[d];u.forEach(function(g){var p=h[l],x=f[g],b=h[g],w=p.distance+x.distance;w<b.distance&&(b.distance=w,b.predecessor=x.predecessor)})})}),s}return Vp}var Gp,DT;function dI(){if(DT)return Gp;DT=1;var r=gn();Gp=e,e.CycleException=t;function e(n){var a={},i={},o=[];function s(u){if(r.has(i,u))throw new t;r.has(a,u)||(i[u]=!0,a[u]=!0,r.each(n.predecessors(u),s),delete i[u],o.push(u))}if(r.each(n.sinks(),s),r.size(a)!==n.nodeCount())throw new t;return o}function t(){}return t.prototype=new Error,Gp}var Wp,BT;function $G(){if(BT)return Wp;BT=1;var r=dI();Wp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Wp}var Up,MT;function vI(){if(MT)return Up;MT=1;var r=gn();Up=e;function e(n,a,i){r.isArray(a)||(a=[a]);var o=(n.isDirected()?n.successors:n.neighbors).bind(n),s=[],u={};return r.each(a,function(l){if(!n.hasNode(l))throw new Error("Graph does not have node: "+l);t(n,l,i==="post",u,o,s)}),s}function t(n,a,i,o,s,u){r.has(o,a)||(o[a]=!0,i||u.push(a),r.each(s(a),function(l){t(n,l,i,o,s,u)}),i&&u.push(a))}return Up}var Hp,LT;function VG(){if(LT)return Hp;LT=1;var r=vI();Hp=e;function e(t,n){return r(t,n,"post")}return Hp}var Kp,OT;function GG(){if(OT)return Kp;OT=1;var r=vI();Kp=e;function e(t,n){return r(t,n,"pre")}return Kp}var jp,kT;function WG(){if(kT)return jp;kT=1;var r=gn(),e=B0(),t=lI();jp=n;function n(a,i){var o=new e,s={},u=new t,l;function f(h){var g=h.v===l?h.w:h.v,p=u.priority(g);if(p!==void 0){var x=i(h);x<p&&(s[g]=l,u.decrease(g,x))}}if(a.nodeCount()===0)return o;r.each(a.nodes(),function(h){u.add(h,Number.POSITIVE_INFINITY),o.setNode(h)}),u.decrease(a.nodes()[0],0);for(var d=!1;u.size()>0;){if(l=u.removeMin(),r.has(s,l))o.setEdge(l,s[l]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(l).forEach(f)}return o}return jp}var Yp,qT;function UG(){return qT||(qT=1,Yp={components:qG(),dijkstra:fI(),dijkstraAll:NG(),findCycles:FG(),floydWarshall:zG(),isAcyclic:$G(),postorder:VG(),preorder:GG(),prim:WG(),tarjan:cI(),topsort:dI()}),Yp}var Xp,NT;function HG(){if(NT)return Xp;NT=1;var r=OG();return Xp={Graph:r.Graph,json:kG(),alg:UG(),version:r.version},Xp}var Zp,FT;function Tn(){if(FT)return Zp;FT=1;var r;if(typeof p0=="function")try{r=HG()}catch{}return r||(r=window.graphlib),Zp=r,Zp}var Qp,zT;function KG(){if(zT)return Qp;zT=1;var r=NP(),e=1,t=4;function n(a){return r(a,e|t)}return Qp=n,Qp}var Jp,$T;function Jl(){if($T)return Jp;$T=1;var r=xo(),e=oa(),t=Wl(),n=rn();function a(i,o,s){if(!n(s))return!1;var u=typeof o;return(u=="number"?e(s)&&t(o,s.length):u=="string"&&o in s)?r(s[o],i):!1}return Jp=a,Jp}var ey,VT;function jG(){if(VT)return ey;VT=1;var r=Ql(),e=xo(),t=Jl(),n=xi(),a=Object.prototype,i=a.hasOwnProperty,o=r(function(s,u){s=Object(s);var l=-1,f=u.length,d=f>2?u[2]:void 0;for(d&&t(u[0],u[1],d)&&(f=1);++l<f;)for(var h=u[l],g=n(h),p=-1,x=g.length;++p<x;){var b=g[p],w=s[b];(w===void 0||e(w,a[b])&&!i.call(s,b))&&(s[b]=h[b])}return s});return ey=o,ey}var ry,GT;function YG(){if(GT)return ry;GT=1;var r=sa(),e=oa(),t=Va();function n(a){return function(i,o,s){var u=Object(i);if(!e(i)){var l=r(o,3);i=t(i),o=function(d){return l(u[d],d,u)}}var f=a(i,o,s);return f>-1?u[l?i[f]:f]:void 0}}return ry=n,ry}var ty,WT;function hI(){if(WT)return ty;WT=1;var r=IR(),e=1/0,t=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=r(a),a===e||a===-e){var i=a<0?-1:1;return i*t}return a===a?a:0}return ty=n,ty}var ny,UT;function XG(){if(UT)return ny;UT=1;var r=hI();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return ny=e,ny}var ay,HT;function ZG(){if(HT)return ay;HT=1;var r=oI(),e=sa(),t=XG(),n=Math.max;function a(i,o,s){var u=i==null?0:i.length;if(!u)return-1;var l=s==null?0:t(s);return l<0&&(l=n(u+l,0)),r(i,e(o,3),l)}return ay=a,ay}var iy,KT;function QG(){if(KT)return iy;KT=1;var r=YG(),e=ZG(),t=r(e);return iy=t,iy}var oy,jT;function gI(){if(jT)return oy;jT=1;var r=D0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return oy=e,oy}var sy,YT;function JG(){if(YT)return sy;YT=1;var r=R0(),e=FP(),t=xi();function n(a,i){return a==null?a:r(a,e(i),t)}return sy=n,sy}var uy,XT;function eW(){if(XT)return uy;XT=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return uy=r,uy}var ly,ZT;function rW(){if(ZT)return ly;ZT=1;var r=Vl(),e=A0(),t=sa();function n(a,i){var o={};return i=t(i,3),e(a,function(s,u,l){r(o,u,i(s,u,l))}),o}return ly=n,ly}var fy,QT;function M0(){if(QT)return fy;QT=1;var r=ho();function e(t,n,a){for(var i=-1,o=t.length;++i<o;){var s=t[i],u=n(s);if(u!=null&&(l===void 0?u===u&&!r(u):a(u,l)))var l=u,f=s}return f}return fy=e,fy}var cy,JT;function tW(){if(JT)return cy;JT=1;function r(e,t){return e>t}return cy=r,cy}var dy,e2;function nW(){if(e2)return dy;e2=1;var r=M0(),e=tW(),t=Ei();function n(a){return a&&a.length?r(a,t,e):void 0}return dy=n,dy}var vy,r2;function pI(){if(r2)return vy;r2=1;var r=Vl(),e=xo();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return vy=t,vy}var hy,t2;function aW(){if(t2)return hy;t2=1;var r=yi(),e=Kl(),t=zn(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,s=i.hasOwnProperty,u=o.call(Object);function l(f){if(!t(f)||r(f)!=n)return!1;var d=e(f);if(d===null)return!0;var h=s.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&o.call(h)==u}return hy=l,hy}var gy,n2;function yI(){if(n2)return gy;n2=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return gy=r,gy}var py,a2;function iW(){if(a2)return py;a2=1;var r=Ms(),e=xi();function t(n){return r(n,e(n))}return py=t,py}var yy,i2;function oW(){if(i2)return yy;i2=1;var r=pI(),e=TP(),t=OP(),n=RP(),a=qP(),i=Ls(),o=Zr(),s=sI(),u=Eo(),l=Bs(),f=rn(),d=aW(),h=Os(),g=yI(),p=iW();function x(b,w,y,E,C,S,R){var _=g(b,y),A=g(w,y),P=R.get(A);if(P){r(b,y,P);return}var I=S?S(_,A,y+"",b,w,R):void 0,D=I===void 0;if(D){var L=o(A),M=!L&&u(A),q=!L&&!M&&h(A);I=A,L||M||q?o(_)?I=_:s(_)?I=n(_):M?(D=!1,I=e(A,!0)):q?(D=!1,I=t(A,!0)):I=[]:d(A)||i(A)?(I=_,i(_)?I=p(_):(!f(_)||l(_))&&(I=a(A))):D=!1}D&&(R.set(A,I),C(I,A,E,S,R),R.delete(A)),r(b,y,I)}return yy=x,yy}var my,o2;function sW(){if(o2)return my;o2=1;var r=$l(),e=pI(),t=R0(),n=oW(),a=rn(),i=xi(),o=yI();function s(u,l,f,d,h){u!==l&&t(l,function(g,p){if(h||(h=new r),a(g))n(u,l,p,f,s,d,h);else{var x=d?d(o(u,p),g,p+"",u,l,h):void 0;x===void 0&&(x=g),e(u,p,x)}},i)}return my=s,my}var by,s2;function uW(){if(s2)return by;s2=1;var r=Ql(),e=Jl();function t(n){return r(function(a,i){var o=-1,s=i.length,u=s>1?i[s-1]:void 0,l=s>2?i[2]:void 0;for(u=n.length>3&&typeof u=="function"?(s--,u):void 0,l&&e(i[0],i[1],l)&&(u=s<3?void 0:u,s=1),a=Object(a);++o<s;){var f=i[o];f&&n(a,f,o,u)}return a})}return by=t,by}var wy,u2;function lW(){if(u2)return wy;u2=1;var r=sW(),e=uW(),t=e(function(n,a,i){r(n,a,i)});return wy=t,wy}var xy,l2;function mI(){if(l2)return xy;l2=1;function r(e,t){return e<t}return xy=r,xy}var Ey,f2;function fW(){if(f2)return Ey;f2=1;var r=M0(),e=mI(),t=Ei();function n(a){return a&&a.length?r(a,t,e):void 0}return Ey=n,Ey}var Cy,c2;function cW(){if(c2)return Cy;c2=1;var r=M0(),e=sa(),t=mI();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return Cy=n,Cy}var _y,d2;function dW(){if(d2)return _y;d2=1;var r=Gl(),e=Xl(),t=Wl(),n=rn(),a=ks();function i(o,s,u,l){if(!n(o))return o;s=e(s,o);for(var f=-1,d=s.length,h=d-1,g=o;g!=null&&++f<d;){var p=a(s[f]),x=u;if(p==="__proto__"||p==="constructor"||p==="prototype")return o;if(f!=h){var b=g[p];x=l?l(b,p,g):void 0,x===void 0&&(x=n(b)?b:t(s[f+1])?[]:{})}r(g,p,x),g=g[p]}return o}return _y=i,_y}var Sy,v2;function vW(){if(v2)return Sy;v2=1;var r=Zl(),e=dW(),t=Xl();function n(a,i,o){for(var s=-1,u=i.length,l={};++s<u;){var f=i[s],d=r(a,f);o(d,f)&&e(l,t(f,a),d)}return l}return Sy=n,Sy}var Ty,h2;function hW(){if(h2)return Ty;h2=1;var r=vW(),e=XP();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return Ty=t,Ty}var Ry,g2;function gW(){if(g2)return Ry;g2=1;var r=gI(),e=aI(),t=iI();function n(a){return t(e(a,void 0,r),a+"")}return Ry=n,Ry}var Ay,p2;function pW(){if(p2)return Ay;p2=1;var r=hW(),e=gW(),t=e(function(n,a){return n==null?{}:r(n,a)});return Ay=t,Ay}var Py,y2;function yW(){if(y2)return Py;y2=1;var r=Math.ceil,e=Math.max;function t(n,a,i,o){for(var s=-1,u=e(r((a-n)/(i||1)),0),l=Array(u);u--;)l[o?u:++s]=n,n+=i;return l}return Py=t,Py}var Iy,m2;function mW(){if(m2)return Iy;m2=1;var r=yW(),e=Jl(),t=hI();function n(a){return function(i,o,s){return s&&typeof s!="number"&&e(i,o,s)&&(o=s=void 0),i=t(i),o===void 0?(o=i,i=0):o=t(o),s=s===void 0?i<o?1:-1:t(s),r(i,o,s,a)}}return Iy=n,Iy}var Dy,b2;function bW(){if(b2)return Dy;b2=1;var r=mW(),e=r();return Dy=e,Dy}var By,w2;function wW(){if(w2)return By;w2=1;function r(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}return By=r,By}var My,x2;function xW(){if(x2)return My;x2=1;var r=ho();function e(t,n){if(t!==n){var a=t!==void 0,i=t===null,o=t===t,s=r(t),u=n!==void 0,l=n===null,f=n===n,d=r(n);if(!l&&!d&&!s&&t>n||s&&u&&f&&!l&&!d||i&&u&&f||!a&&f||!o)return 1;if(!i&&!s&&!d&&t<n||d&&a&&o&&!i&&!s||l&&a&&o||!u&&o||!f)return-1}return 0}return My=e,My}var Ly,E2;function EW(){if(E2)return Ly;E2=1;var r=xW();function e(t,n,a){for(var i=-1,o=t.criteria,s=n.criteria,u=o.length,l=a.length;++i<u;){var f=r(o[i],s[i]);if(f){if(i>=l)return f;var d=a[i];return f*(d=="desc"?-1:1)}}return t.index-n.index}return Ly=e,Ly}var Oy,C2;function CW(){if(C2)return Oy;C2=1;var r=Yl(),e=Zl(),t=sa(),n=rI(),a=wW(),i=Ul(),o=EW(),s=Ei(),u=Zr();function l(f,d,h){d.length?d=r(d,function(x){return u(x)?function(b){return e(b,x.length===1?x[0]:x)}:x}):d=[s];var g=-1;d=r(d,i(t));var p=n(f,function(x,b,w){var y=r(d,function(E){return E(x)});return{criteria:y,index:++g,value:x}});return a(p,function(x,b){return o(x,b,h)})}return Oy=l,Oy}var ky,_2;function _W(){if(_2)return ky;_2=1;var r=D0(),e=CW(),t=Ql(),n=Jl(),a=t(function(i,o){if(i==null)return[];var s=o.length;return s>1&&n(i,o[0],o[1])?o=[]:s>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,r(o,1),[])});return ky=a,ky}var qy,S2;function SW(){if(S2)return qy;S2=1;var r=jP(),e=0;function t(n){var a=++e;return r(n)+a}return qy=t,qy}var Ny,T2;function TW(){if(T2)return Ny;T2=1;function r(e,t,n){for(var a=-1,i=e.length,o=t.length,s={};++a<i;){var u=a<o?t[a]:void 0;n(s,e[a],u)}return s}return Ny=r,Ny}var Fy,R2;function RW(){if(R2)return Fy;R2=1;var r=Gl(),e=TW();function t(n,a){return e(n||[],a||[],r)}return Fy=t,Fy}var zy,A2;function qr(){if(A2)return zy;A2=1;var r;if(typeof p0=="function")try{r={cloneDeep:KG(),constant:T0(),defaults:jG(),each:$P(),filter:QP(),find:QG(),flatten:gI(),forEach:zP(),forIn:JG(),has:JP(),isUndefined:eI(),last:eW(),map:tI(),mapValues:rW(),max:nW(),merge:lW(),min:fW(),minBy:cW(),now:PR(),pick:pW(),range:bW(),reduce:nI(),sortBy:_W(),uniqueId:SW(),values:uI(),zipObject:RW()}}catch{}return r||(r=window._),zy=r,zy}var $y,P2;function AW(){if(P2)return $y;P2=1,$y=r;function r(){var n={};n._next=n._prev=n,this._sentinel=n}r.prototype.dequeue=function(){var n=this._sentinel,a=n._prev;if(a!==n)return e(a),a},r.prototype.enqueue=function(n){var a=this._sentinel;n._prev&&n._next&&e(n),n._next=a._next,a._next._prev=n,a._next=n,n._prev=a},r.prototype.toString=function(){for(var n=[],a=this._sentinel,i=a._prev;i!==a;)n.push(JSON.stringify(i,t)),i=i._prev;return"["+n.join(", ")+"]"};function e(n){n._prev._next=n._next,n._next._prev=n._prev,delete n._next,delete n._prev}function t(n,a){if(n!=="_next"&&n!=="_prev")return a}return $y}var Vy,I2;function PW(){if(I2)return Vy;I2=1;var r=qr(),e=Tn().Graph,t=AW();Vy=a;var n=r.constant(1);function a(l,f){if(l.nodeCount()<=1)return[];var d=s(l,f||n),h=i(d.graph,d.buckets,d.zeroIdx);return r.flatten(r.map(h,function(g){return l.outEdges(g.v,g.w)}),!0)}function i(l,f,d){for(var h=[],g=f[f.length-1],p=f[0],x;l.nodeCount();){for(;x=p.dequeue();)o(l,f,d,x);for(;x=g.dequeue();)o(l,f,d,x);if(l.nodeCount()){for(var b=f.length-2;b>0;--b)if(x=f[b].dequeue(),x){h=h.concat(o(l,f,d,x,!0));break}}}return h}function o(l,f,d,h,g){var p=g?[]:void 0;return r.forEach(l.inEdges(h.v),function(x){var b=l.edge(x),w=l.node(x.v);g&&p.push({v:x.v,w:x.w}),w.out-=b,u(f,d,w)}),r.forEach(l.outEdges(h.v),function(x){var b=l.edge(x),w=x.w,y=l.node(w);y.in-=b,u(f,d,y)}),l.removeNode(h.v),p}function s(l,f){var d=new e,h=0,g=0;r.forEach(l.nodes(),function(b){d.setNode(b,{v:b,in:0,out:0})}),r.forEach(l.edges(),function(b){var w=d.edge(b.v,b.w)||0,y=f(b),E=w+y;d.setEdge(b.v,b.w,E),g=Math.max(g,d.node(b.v).out+=y),h=Math.max(h,d.node(b.w).in+=y)});var p=r.range(g+h+3).map(function(){return new t}),x=h+1;return r.forEach(d.nodes(),function(b){u(p,x,d.node(b))}),{graph:d,buckets:p,zeroIdx:x}}function u(l,f,d){d.out?d.in?l[d.out-d.in+f].enqueue(d):l[l.length-1].enqueue(d):l[0].enqueue(d)}return Vy}var Gy,D2;function IW(){if(D2)return Gy;D2=1;var r=qr(),e=PW();Gy={run:t,undo:a};function t(i){var o=i.graph().acyclicer==="greedy"?e(i,s(i)):n(i);r.forEach(o,function(u){var l=i.edge(u);i.removeEdge(u),l.forwardName=u.name,l.reversed=!0,i.setEdge(u.w,u.v,l,r.uniqueId("rev"))});function s(u){return function(l){return u.edge(l).weight}}}function n(i){var o=[],s={},u={};function l(f){r.has(u,f)||(u[f]=!0,s[f]=!0,r.forEach(i.outEdges(f),function(d){r.has(s,d.w)?o.push(d):l(d.w)}),delete s[f])}return r.forEach(i.nodes(),l),o}function a(i){r.forEach(i.edges(),function(o){var s=i.edge(o);if(s.reversed){i.removeEdge(o);var u=s.forwardName;delete s.reversed,delete s.forwardName,i.setEdge(o.w,o.v,s,u)}})}return Gy}var Wy,B2;function Wt(){if(B2)return Wy;B2=1;var r=qr(),e=Tn().Graph;Wy={addDummyNode:t,simplify:n,asNonCompoundGraph:a,successorWeights:i,predecessorWeights:o,intersectRect:s,buildLayerMatrix:u,normalizeRanks:l,removeEmptyRanks:f,addBorderNode:d,maxRank:h,partition:g,time:p,notime:x};function t(b,w,y,E){var C;do C=r.uniqueId(E);while(b.hasNode(C));return y.dummy=w,b.setNode(C,y),C}function n(b){var w=new e().setGraph(b.graph());return r.forEach(b.nodes(),function(y){w.setNode(y,b.node(y))}),r.forEach(b.edges(),function(y){var E=w.edge(y.v,y.w)||{weight:0,minlen:1},C=b.edge(y);w.setEdge(y.v,y.w,{weight:E.weight+C.weight,minlen:Math.max(E.minlen,C.minlen)})}),w}function a(b){var w=new e({multigraph:b.isMultigraph()}).setGraph(b.graph());return r.forEach(b.nodes(),function(y){b.children(y).length||w.setNode(y,b.node(y))}),r.forEach(b.edges(),function(y){w.setEdge(y,b.edge(y))}),w}function i(b){var w=r.map(b.nodes(),function(y){var E={};return r.forEach(b.outEdges(y),function(C){E[C.w]=(E[C.w]||0)+b.edge(C).weight}),E});return r.zipObject(b.nodes(),w)}function o(b){var w=r.map(b.nodes(),function(y){var E={};return r.forEach(b.inEdges(y),function(C){E[C.v]=(E[C.v]||0)+b.edge(C).weight}),E});return r.zipObject(b.nodes(),w)}function s(b,w){var y=b.x,E=b.y,C=w.x-y,S=w.y-E,R=b.width/2,_=b.height/2;if(!C&&!S)throw new Error("Not possible to find intersection inside of the rectangle");var A,P;return Math.abs(S)*R>Math.abs(C)*_?(S<0&&(_=-_),A=_*C/S,P=_):(C<0&&(R=-R),A=R,P=R*S/C),{x:y+A,y:E+P}}function u(b){var w=r.map(r.range(h(b)+1),function(){return[]});return r.forEach(b.nodes(),function(y){var E=b.node(y),C=E.rank;r.isUndefined(C)||(w[C][E.order]=y)}),w}function l(b){var w=r.min(r.map(b.nodes(),function(y){return b.node(y).rank}));r.forEach(b.nodes(),function(y){var E=b.node(y);r.has(E,"rank")&&(E.rank-=w)})}function f(b){var w=r.min(r.map(b.nodes(),function(S){return b.node(S).rank})),y=[];r.forEach(b.nodes(),function(S){var R=b.node(S).rank-w;y[R]||(y[R]=[]),y[R].push(S)});var E=0,C=b.graph().nodeRankFactor;r.forEach(y,function(S,R){r.isUndefined(S)&&R%C!==0?--E:E&&r.forEach(S,function(_){b.node(_).rank+=E})})}function d(b,w,y,E){var C={width:0,height:0};return arguments.length>=4&&(C.rank=y,C.order=E),t(b,"border",C,w)}function h(b){return r.max(r.map(b.nodes(),function(w){var y=b.node(w).rank;if(!r.isUndefined(y))return y}))}function g(b,w){var y={lhs:[],rhs:[]};return r.forEach(b,function(E){w(E)?y.lhs.push(E):y.rhs.push(E)}),y}function p(b,w){var y=r.now();try{return w()}finally{console.log(b+" time: "+(r.now()-y)+"ms")}}function x(b,w){return w()}return Wy}var Uy,M2;function DW(){if(M2)return Uy;M2=1;var r=qr(),e=Wt();Uy={run:t,undo:a};function t(i){i.graph().dummyChains=[],r.forEach(i.edges(),function(o){n(i,o)})}function n(i,o){var s=o.v,u=i.node(s).rank,l=o.w,f=i.node(l).rank,d=o.name,h=i.edge(o),g=h.labelRank;if(f!==u+1){i.removeEdge(o);var p,x,b;for(b=0,++u;u<f;++b,++u)h.points=[],x={width:0,height:0,edgeLabel:h,edgeObj:o,rank:u},p=e.addDummyNode(i,"edge",x,"_d"),u===g&&(x.width=h.width,x.height=h.height,x.dummy="edge-label",x.labelpos=h.labelpos),i.setEdge(s,p,{weight:h.weight},d),b===0&&i.graph().dummyChains.push(p),s=p;i.setEdge(s,l,{weight:h.weight},d)}}function a(i){r.forEach(i.graph().dummyChains,function(o){var s=i.node(o),u=s.edgeLabel,l;for(i.setEdge(s.edgeObj,u);s.dummy;)l=i.successors(o)[0],i.removeNode(o),u.points.push({x:s.x,y:s.y}),s.dummy==="edge-label"&&(u.x=s.x,u.y=s.y,u.width=s.width,u.height=s.height),o=l,s=i.node(o)})}return Uy}var Hy,L2;function hl(){if(L2)return Hy;L2=1;var r=qr();Hy={longestPath:e,slack:t};function e(n){var a={};function i(o){var s=n.node(o);if(r.has(a,o))return s.rank;a[o]=!0;var u=r.min(r.map(n.outEdges(o),function(l){return i(l.w)-n.edge(l).minlen}));return(u===Number.POSITIVE_INFINITY||u===void 0||u===null)&&(u=0),s.rank=u}r.forEach(n.sources(),i)}function t(n,a){return n.node(a.w).rank-n.node(a.v).rank-n.edge(a).minlen}return Hy}var Ky,O2;function bI(){if(O2)return Ky;O2=1;var r=qr(),e=Tn().Graph,t=hl().slack;Ky=n;function n(s){var u=new e({directed:!1}),l=s.nodes()[0],f=s.nodeCount();u.setNode(l,{});for(var d,h;a(u,s)<f;)d=i(u,s),h=u.hasNode(d.v)?t(s,d):-t(s,d),o(u,s,h);return u}function a(s,u){function l(f){r.forEach(u.nodeEdges(f),function(d){var h=d.v,g=f===h?d.w:h;!s.hasNode(g)&&!t(u,d)&&(s.setNode(g,{}),s.setEdge(f,g,{}),l(g))})}return r.forEach(s.nodes(),l),s.nodeCount()}function i(s,u){return r.minBy(u.edges(),function(l){if(s.hasNode(l.v)!==s.hasNode(l.w))return t(u,l)})}function o(s,u,l){r.forEach(s.nodes(),function(f){u.node(f).rank+=l})}return Ky}var jy,k2;function BW(){if(k2)return jy;k2=1;var r=qr(),e=bI(),t=hl().slack,n=hl().longestPath,a=Tn().alg.preorder,i=Tn().alg.postorder,o=Wt().simplify;jy=s,s.initLowLimValues=d,s.initCutValues=u,s.calcCutValue=f,s.leaveEdge=g,s.enterEdge=p,s.exchangeEdges=x;function s(E){E=o(E),n(E);var C=e(E);d(C),u(C,E);for(var S,R;S=g(C);)R=p(C,E,S),x(C,E,S,R)}function u(E,C){var S=i(E,E.nodes());S=S.slice(0,S.length-1),r.forEach(S,function(R){l(E,C,R)})}function l(E,C,S){var R=E.node(S),_=R.parent;E.edge(S,_).cutvalue=f(E,C,S)}function f(E,C,S){var R=E.node(S),_=R.parent,A=!0,P=C.edge(S,_),I=0;return P||(A=!1,P=C.edge(_,S)),I=P.weight,r.forEach(C.nodeEdges(S),function(D){var L=D.v===S,M=L?D.w:D.v;if(M!==_){var q=L===A,N=C.edge(D).weight;if(I+=q?N:-N,w(E,S,M)){var W=E.edge(S,M).cutvalue;I+=q?-W:W}}}),I}function d(E,C){arguments.length<2&&(C=E.nodes()[0]),h(E,{},1,C)}function h(E,C,S,R,_){var A=S,P=E.node(R);return C[R]=!0,r.forEach(E.neighbors(R),function(I){r.has(C,I)||(S=h(E,C,S,I,R))}),P.low=A,P.lim=S++,_?P.parent=_:delete P.parent,S}function g(E){return r.find(E.edges(),function(C){return E.edge(C).cutvalue<0})}function p(E,C,S){var R=S.v,_=S.w;C.hasEdge(R,_)||(R=S.w,_=S.v);var A=E.node(R),P=E.node(_),I=A,D=!1;A.lim>P.lim&&(I=P,D=!0);var L=r.filter(C.edges(),function(M){return D===y(E,E.node(M.v),I)&&D!==y(E,E.node(M.w),I)});return r.minBy(L,function(M){return t(C,M)})}function x(E,C,S,R){var _=S.v,A=S.w;E.removeEdge(_,A),E.setEdge(R.v,R.w,{}),d(E),u(E,C),b(E,C)}function b(E,C){var S=r.find(E.nodes(),function(_){return!C.node(_).parent}),R=a(E,S);R=R.slice(1),r.forEach(R,function(_){var A=E.node(_).parent,P=C.edge(_,A),I=!1;P||(P=C.edge(A,_),I=!0),C.node(_).rank=C.node(A).rank+(I?P.minlen:-P.minlen)})}function w(E,C,S){return E.hasEdge(C,S)}function y(E,C,S){return S.low<=C.lim&&C.lim<=S.lim}return jy}var Yy,q2;function MW(){if(q2)return Yy;q2=1;var r=hl(),e=r.longestPath,t=bI(),n=BW();Yy=a;function a(u){switch(u.graph().ranker){case"network-simplex":s(u);break;case"tight-tree":o(u);break;case"longest-path":i(u);break;default:s(u)}}var i=e;function o(u){e(u),t(u)}function s(u){n(u)}return Yy}var Xy,N2;function LW(){if(N2)return Xy;N2=1;var r=qr();Xy=e;function e(a){var i=n(a);r.forEach(a.graph().dummyChains,function(o){for(var s=a.node(o),u=s.edgeObj,l=t(a,i,u.v,u.w),f=l.path,d=l.lca,h=0,g=f[h],p=!0;o!==u.w;){if(s=a.node(o),p){for(;(g=f[h])!==d&&a.node(g).maxRank<s.rank;)h++;g===d&&(p=!1)}if(!p){for(;h<f.length-1&&a.node(g=f[h+1]).minRank<=s.rank;)h++;g=f[h]}a.setParent(o,g),o=a.successors(o)[0]}})}function t(a,i,o,s){var u=[],l=[],f=Math.min(i[o].low,i[s].low),d=Math.max(i[o].lim,i[s].lim),h,g;h=o;do h=a.parent(h),u.push(h);while(h&&(i[h].low>f||d>i[h].lim));for(g=h,h=s;(h=a.parent(h))!==g;)l.push(h);return{path:u.concat(l.reverse()),lca:g}}function n(a){var i={},o=0;function s(u){var l=o;r.forEach(a.children(u),s),i[u]={low:l,lim:o++}}return r.forEach(a.children(),s),i}return Xy}var Zy,F2;function OW(){if(F2)return Zy;F2=1;var r=qr(),e=Wt();Zy={run:t,cleanup:o};function t(s){var u=e.addDummyNode(s,"root",{},"_root"),l=a(s),f=r.max(r.values(l))-1,d=2*f+1;s.graph().nestingRoot=u,r.forEach(s.edges(),function(g){s.edge(g).minlen*=d});var h=i(s)+1;r.forEach(s.children(),function(g){n(s,u,d,h,f,l,g)}),s.graph().nodeRankFactor=d}function n(s,u,l,f,d,h,g){var p=s.children(g);if(!p.length){g!==u&&s.setEdge(u,g,{weight:0,minlen:l});return}var x=e.addBorderNode(s,"_bt"),b=e.addBorderNode(s,"_bb"),w=s.node(g);s.setParent(x,g),w.borderTop=x,s.setParent(b,g),w.borderBottom=b,r.forEach(p,function(y){n(s,u,l,f,d,h,y);var E=s.node(y),C=E.borderTop?E.borderTop:y,S=E.borderBottom?E.borderBottom:y,R=E.borderTop?f:2*f,_=C!==S?1:d-h[g]+1;s.setEdge(x,C,{weight:R,minlen:_,nestingEdge:!0}),s.setEdge(S,b,{weight:R,minlen:_,nestingEdge:!0})}),s.parent(g)||s.setEdge(u,x,{weight:0,minlen:d+h[g]})}function a(s){var u={};function l(f,d){var h=s.children(f);h&&h.length&&r.forEach(h,function(g){l(g,d+1)}),u[f]=d}return r.forEach(s.children(),function(f){l(f,1)}),u}function i(s){return r.reduce(s.edges(),function(u,l){return u+s.edge(l).weight},0)}function o(s){var u=s.graph();s.removeNode(u.nestingRoot),delete u.nestingRoot,r.forEach(s.edges(),function(l){var f=s.edge(l);f.nestingEdge&&s.removeEdge(l)})}return Zy}var Qy,z2;function kW(){if(z2)return Qy;z2=1;var r=qr(),e=Wt();Qy=t;function t(a){function i(o){var s=a.children(o),u=a.node(o);if(s.length&&r.forEach(s,i),r.has(u,"minRank")){u.borderLeft=[],u.borderRight=[];for(var l=u.minRank,f=u.maxRank+1;l<f;++l)n(a,"borderLeft","_bl",o,u,l),n(a,"borderRight","_br",o,u,l)}}r.forEach(a.children(),i)}function n(a,i,o,s,u,l){var f={width:0,height:0,rank:l,borderType:i},d=u[i][l-1],h=e.addDummyNode(a,"border",f,o);u[i][l]=h,a.setParent(h,s),d&&a.setEdge(d,h,{weight:1})}return Qy}var Jy,$2;function qW(){if($2)return Jy;$2=1;var r=qr();Jy={adjust:e,undo:t};function e(l){var f=l.graph().rankdir.toLowerCase();(f==="lr"||f==="rl")&&n(l)}function t(l){var f=l.graph().rankdir.toLowerCase();(f==="bt"||f==="rl")&&i(l),(f==="lr"||f==="rl")&&(s(l),n(l))}function n(l){r.forEach(l.nodes(),function(f){a(l.node(f))}),r.forEach(l.edges(),function(f){a(l.edge(f))})}function a(l){var f=l.width;l.width=l.height,l.height=f}function i(l){r.forEach(l.nodes(),function(f){o(l.node(f))}),r.forEach(l.edges(),function(f){var d=l.edge(f);r.forEach(d.points,o),r.has(d,"y")&&o(d)})}function o(l){l.y=-l.y}function s(l){r.forEach(l.nodes(),function(f){u(l.node(f))}),r.forEach(l.edges(),function(f){var d=l.edge(f);r.forEach(d.points,u),r.has(d,"x")&&u(d)})}function u(l){var f=l.x;l.x=l.y,l.y=f}return Jy}var em,V2;function NW(){if(V2)return em;V2=1;var r=qr();em=e;function e(t){var n={},a=r.filter(t.nodes(),function(l){return!t.children(l).length}),i=r.max(r.map(a,function(l){return t.node(l).rank})),o=r.map(r.range(i+1),function(){return[]});function s(l){if(!r.has(n,l)){n[l]=!0;var f=t.node(l);o[f.rank].push(l),r.forEach(t.successors(l),s)}}var u=r.sortBy(a,function(l){return t.node(l).rank});return r.forEach(u,s),o}return em}var rm,G2;function FW(){if(G2)return rm;G2=1;var r=qr();rm=e;function e(n,a){for(var i=0,o=1;o<a.length;++o)i+=t(n,a[o-1],a[o]);return i}function t(n,a,i){for(var o=r.zipObject(i,r.map(i,function(h,g){return g})),s=r.flatten(r.map(a,function(h){return r.sortBy(r.map(n.outEdges(h),function(g){return{pos:o[g.w],weight:n.edge(g).weight}}),"pos")}),!0),u=1;u<i.length;)u<<=1;var l=2*u-1;u-=1;var f=r.map(new Array(l),function(){return 0}),d=0;return r.forEach(s.forEach(function(h){var g=h.pos+u;f[g]+=h.weight;for(var p=0;g>0;)g%2&&(p+=f[g+1]),g=g-1>>1,f[g]+=h.weight;d+=h.weight*p})),d}return rm}var tm,W2;function zW(){if(W2)return tm;W2=1;var r=qr();tm=e;function e(t,n){return r.map(n,function(a){var i=t.inEdges(a);if(i.length){var o=r.reduce(i,function(s,u){var l=t.edge(u),f=t.node(u.v);return{sum:s.sum+l.weight*f.order,weight:s.weight+l.weight}},{sum:0,weight:0});return{v:a,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:a}})}return tm}var nm,U2;function $W(){if(U2)return nm;U2=1;var r=qr();nm=e;function e(a,i){var o={};r.forEach(a,function(u,l){var f=o[u.v]={indegree:0,in:[],out:[],vs:[u.v],i:l};r.isUndefined(u.barycenter)||(f.barycenter=u.barycenter,f.weight=u.weight)}),r.forEach(i.edges(),function(u){var l=o[u.v],f=o[u.w];!r.isUndefined(l)&&!r.isUndefined(f)&&(f.indegree++,l.out.push(o[u.w]))});var s=r.filter(o,function(u){return!u.indegree});return t(s)}function t(a){var i=[];function o(l){return function(f){f.merged||(r.isUndefined(f.barycenter)||r.isUndefined(l.barycenter)||f.barycenter>=l.barycenter)&&n(l,f)}}function s(l){return function(f){f.in.push(l),--f.indegree===0&&a.push(f)}}for(;a.length;){var u=a.pop();i.push(u),r.forEach(u.in.reverse(),o(u)),r.forEach(u.out,s(u))}return r.map(r.filter(i,function(l){return!l.merged}),function(l){return r.pick(l,["vs","i","barycenter","weight"])})}function n(a,i){var o=0,s=0;a.weight&&(o+=a.barycenter*a.weight,s+=a.weight),i.weight&&(o+=i.barycenter*i.weight,s+=i.weight),a.vs=i.vs.concat(a.vs),a.barycenter=o/s,a.weight=s,a.i=Math.min(i.i,a.i),i.merged=!0}return nm}var am,H2;function VW(){if(H2)return am;H2=1;var r=qr(),e=Wt();am=t;function t(i,o){var s=e.partition(i,function(x){return r.has(x,"barycenter")}),u=s.lhs,l=r.sortBy(s.rhs,function(x){return-x.i}),f=[],d=0,h=0,g=0;u.sort(a(!!o)),g=n(f,l,g),r.forEach(u,function(x){g+=x.vs.length,f.push(x.vs),d+=x.barycenter*x.weight,h+=x.weight,g=n(f,l,g)});var p={vs:r.flatten(f,!0)};return h&&(p.barycenter=d/h,p.weight=h),p}function n(i,o,s){for(var u;o.length&&(u=r.last(o)).i<=s;)o.pop(),i.push(u.vs),s++;return s}function a(i){return function(o,s){return o.barycenter<s.barycenter?-1:o.barycenter>s.barycenter?1:i?s.i-o.i:o.i-s.i}}return am}var im,K2;function GW(){if(K2)return im;K2=1;var r=qr(),e=zW(),t=$W(),n=VW();im=a;function a(s,u,l,f){var d=s.children(u),h=s.node(u),g=h?h.borderLeft:void 0,p=h?h.borderRight:void 0,x={};g&&(d=r.filter(d,function(S){return S!==g&&S!==p}));var b=e(s,d);r.forEach(b,function(S){if(s.children(S.v).length){var R=a(s,S.v,l,f);x[S.v]=R,r.has(R,"barycenter")&&o(S,R)}});var w=t(b,l);i(w,x);var y=n(w,f);if(g&&(y.vs=r.flatten([g,y.vs,p],!0),s.predecessors(g).length)){var E=s.node(s.predecessors(g)[0]),C=s.node(s.predecessors(p)[0]);r.has(y,"barycenter")||(y.barycenter=0,y.weight=0),y.barycenter=(y.barycenter*y.weight+E.order+C.order)/(y.weight+2),y.weight+=2}return y}function i(s,u){r.forEach(s,function(l){l.vs=r.flatten(l.vs.map(function(f){return u[f]?u[f].vs:f}),!0)})}function o(s,u){r.isUndefined(s.barycenter)?(s.barycenter=u.barycenter,s.weight=u.weight):(s.barycenter=(s.barycenter*s.weight+u.barycenter*u.weight)/(s.weight+u.weight),s.weight+=u.weight)}return im}var om,j2;function WW(){if(j2)return om;j2=1;var r=qr(),e=Tn().Graph;om=t;function t(a,i,o){var s=n(a),u=new e({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(function(l){return a.node(l)});return r.forEach(a.nodes(),function(l){var f=a.node(l),d=a.parent(l);(f.rank===i||f.minRank<=i&&i<=f.maxRank)&&(u.setNode(l),u.setParent(l,d||s),r.forEach(a[o](l),function(h){var g=h.v===l?h.w:h.v,p=u.edge(g,l),x=r.isUndefined(p)?0:p.weight;u.setEdge(g,l,{weight:a.edge(h).weight+x})}),r.has(f,"minRank")&&u.setNode(l,{borderLeft:f.borderLeft[i],borderRight:f.borderRight[i]}))}),u}function n(a){for(var i;a.hasNode(i=r.uniqueId("_root")););return i}return om}var sm,Y2;function UW(){if(Y2)return sm;Y2=1;var r=qr();sm=e;function e(t,n,a){var i={},o;r.forEach(a,function(s){for(var u=t.parent(s),l,f;u;){if(l=t.parent(u),l?(f=i[l],i[l]=u):(f=o,o=u),f&&f!==u){n.setEdge(f,u);return}u=l}})}return sm}var um,X2;function HW(){if(X2)return um;X2=1;var r=qr(),e=NW(),t=FW(),n=GW(),a=WW(),i=UW(),o=Tn().Graph,s=Wt();um=u;function u(h){var g=s.maxRank(h),p=l(h,r.range(1,g+1),"inEdges"),x=l(h,r.range(g-1,-1,-1),"outEdges"),b=e(h);d(h,b);for(var w=Number.POSITIVE_INFINITY,y,E=0,C=0;C<4;++E,++C){f(E%2?p:x,E%4>=2),b=s.buildLayerMatrix(h);var S=t(h,b);S<w&&(C=0,y=r.cloneDeep(b),w=S)}d(h,y)}function l(h,g,p){return r.map(g,function(x){return a(h,x,p)})}function f(h,g){var p=new o;r.forEach(h,function(x){var b=x.graph().root,w=n(x,b,p,g);r.forEach(w.vs,function(y,E){x.node(y).order=E}),i(x,p,w.vs)})}function d(h,g){r.forEach(g,function(p){r.forEach(p,function(x,b){h.node(x).order=b})})}return um}var lm,Z2;function KW(){if(Z2)return lm;Z2=1;var r=qr(),e=Tn().Graph,t=Wt();lm={positionX:p,findType1Conflicts:n,findType2Conflicts:a,addConflict:o,hasConflict:s,verticalAlignment:u,horizontalCompaction:l,alignCoordinates:h,findSmallestWidthAlignment:d,balance:g};function n(w,y){var E={};function C(S,R){var _=0,A=0,P=S.length,I=r.last(R);return r.forEach(R,function(D,L){var M=i(w,D),q=M?w.node(M).order:P;(M||D===I)&&(r.forEach(R.slice(A,L+1),function(N){r.forEach(w.predecessors(N),function(W){var V=w.node(W),$=V.order;($<_||q<$)&&!(V.dummy&&w.node(N).dummy)&&o(E,W,N)})}),A=L+1,_=q)}),R}return r.reduce(y,C),E}function a(w,y){var E={};function C(R,_,A,P,I){var D;r.forEach(r.range(_,A),function(L){D=R[L],w.node(D).dummy&&r.forEach(w.predecessors(D),function(M){var q=w.node(M);q.dummy&&(q.order<P||q.order>I)&&o(E,M,D)})})}function S(R,_){var A=-1,P,I=0;return r.forEach(_,function(D,L){if(w.node(D).dummy==="border"){var M=w.predecessors(D);M.length&&(P=w.node(M[0]).order,C(_,I,L,A,P),I=L,A=P)}C(_,I,_.length,P,R.length)}),_}return r.reduce(y,S),E}function i(w,y){if(w.node(y).dummy)return r.find(w.predecessors(y),function(E){return w.node(E).dummy})}function o(w,y,E){if(y>E){var C=y;y=E,E=C}var S=w[y];S||(w[y]=S={}),S[E]=!0}function s(w,y,E){if(y>E){var C=y;y=E,E=C}return r.has(w[y],E)}function u(w,y,E,C){var S={},R={},_={};return r.forEach(y,function(A){r.forEach(A,function(P,I){S[P]=P,R[P]=P,_[P]=I})}),r.forEach(y,function(A){var P=-1;r.forEach(A,function(I){var D=C(I);if(D.length){D=r.sortBy(D,function(W){return _[W]});for(var L=(D.length-1)/2,M=Math.floor(L),q=Math.ceil(L);M<=q;++M){var N=D[M];R[I]===I&&P<_[N]&&!s(E,I,N)&&(R[N]=I,R[I]=S[I]=S[N],P=_[N])}}})}),{root:S,align:R}}function l(w,y,E,C,S){var R={},_=f(w,y,E,S),A=S?"borderLeft":"borderRight";function P(L,M){for(var q=_.nodes(),N=q.pop(),W={};N;)W[N]?L(N):(W[N]=!0,q.push(N),q=q.concat(M(N))),N=q.pop()}function I(L){R[L]=_.inEdges(L).reduce(function(M,q){return Math.max(M,R[q.v]+_.edge(q))},0)}function D(L){var M=_.outEdges(L).reduce(function(N,W){return Math.min(N,R[W.w]-_.edge(W))},Number.POSITIVE_INFINITY),q=w.node(L);M!==Number.POSITIVE_INFINITY&&q.borderType!==A&&(R[L]=Math.max(R[L],M))}return P(I,_.predecessors.bind(_)),P(D,_.successors.bind(_)),r.forEach(C,function(L){R[L]=R[E[L]]}),R}function f(w,y,E,C){var S=new e,R=w.graph(),_=x(R.nodesep,R.edgesep,C);return r.forEach(y,function(A){var P;r.forEach(A,function(I){var D=E[I];if(S.setNode(D),P){var L=E[P],M=S.edge(L,D);S.setEdge(L,D,Math.max(_(w,I,P),M||0))}P=I})}),S}function d(w,y){return r.minBy(r.values(y),function(E){var C=Number.NEGATIVE_INFINITY,S=Number.POSITIVE_INFINITY;return r.forIn(E,function(R,_){var A=b(w,_)/2;C=Math.max(R+A,C),S=Math.min(R-A,S)}),C-S})}function h(w,y){var E=r.values(y),C=r.min(E),S=r.max(E);r.forEach(["u","d"],function(R){r.forEach(["l","r"],function(_){var A=R+_,P=w[A],I;if(P!==y){var D=r.values(P);I=_==="l"?C-r.min(D):S-r.max(D),I&&(w[A]=r.mapValues(P,function(L){return L+I}))}})})}function g(w,y){return r.mapValues(w.ul,function(E,C){if(y)return w[y.toLowerCase()][C];var S=r.sortBy(r.map(w,C));return(S[1]+S[2])/2})}function p(w){var y=t.buildLayerMatrix(w),E=r.merge(n(w,y),a(w,y)),C={},S;r.forEach(["u","d"],function(_){S=_==="u"?y:r.values(y).reverse(),r.forEach(["l","r"],function(A){A==="r"&&(S=r.map(S,function(L){return r.values(L).reverse()}));var P=(_==="u"?w.predecessors:w.successors).bind(w),I=u(w,S,E,P),D=l(w,S,I.root,I.align,A==="r");A==="r"&&(D=r.mapValues(D,function(L){return-L})),C[_+A]=D})});var R=d(w,C);return h(C,R),g(C,w.graph().align)}function x(w,y,E){return function(C,S,R){var _=C.node(S),A=C.node(R),P=0,I;if(P+=_.width/2,r.has(_,"labelpos"))switch(_.labelpos.toLowerCase()){case"l":I=-_.width/2;break;case"r":I=_.width/2;break}if(I&&(P+=E?I:-I),I=0,P+=(_.dummy?y:w)/2,P+=(A.dummy?y:w)/2,P+=A.width/2,r.has(A,"labelpos"))switch(A.labelpos.toLowerCase()){case"l":I=A.width/2;break;case"r":I=-A.width/2;break}return I&&(P+=E?I:-I),I=0,P}}function b(w,y){return w.node(y).width}return lm}var fm,Q2;function jW(){if(Q2)return fm;Q2=1;var r=qr(),e=Wt(),t=KW().positionX;fm=n;function n(i){i=e.asNonCompoundGraph(i),a(i),r.forEach(t(i),function(o,s){i.node(s).x=o})}function a(i){var o=e.buildLayerMatrix(i),s=i.graph().ranksep,u=0;r.forEach(o,function(l){var f=r.max(r.map(l,function(d){return i.node(d).height}));r.forEach(l,function(d){i.node(d).y=u+f/2}),u+=f+s})}return fm}var cm,J2;function YW(){if(J2)return cm;J2=1;var r=qr(),e=IW(),t=DW(),n=MW(),a=Wt().normalizeRanks,i=LW(),o=Wt().removeEmptyRanks,s=OW(),u=kW(),l=qW(),f=HW(),d=jW(),h=Wt(),g=Tn().Graph;cm=p;function p(G,z){var Y=z&&z.debugTiming?h.time:h.notime;Y("layout",function(){var te=Y(" buildLayoutGraph",function(){return P(G)});Y(" runLayout",function(){x(te,Y)}),Y(" updateInputGraph",function(){b(G,te)})})}function x(G,z){z(" makeSpaceForEdgeLabels",function(){I(G)}),z(" removeSelfEdges",function(){X(G)}),z(" acyclic",function(){e.run(G)}),z(" nestingGraph.run",function(){s.run(G)}),z(" rank",function(){n(h.asNonCompoundGraph(G))}),z(" injectEdgeLabelProxies",function(){D(G)}),z(" removeEmptyRanks",function(){o(G)}),z(" nestingGraph.cleanup",function(){s.cleanup(G)}),z(" normalizeRanks",function(){a(G)}),z(" assignRankMinMax",function(){L(G)}),z(" removeEdgeLabelProxies",function(){M(G)}),z(" normalize.run",function(){t.run(G)}),z(" parentDummyChains",function(){i(G)}),z(" addBorderSegments",function(){u(G)}),z(" order",function(){f(G)}),z(" insertSelfEdges",function(){ee(G)}),z(" adjustCoordinateSystem",function(){l.adjust(G)}),z(" position",function(){d(G)}),z(" positionSelfEdges",function(){K(G)}),z(" removeBorderNodes",function(){$(G)}),z(" normalize.undo",function(){t.undo(G)}),z(" fixupEdgeLabelCoords",function(){W(G)}),z(" undoCoordinateSystem",function(){l.undo(G)}),z(" translateGraph",function(){q(G)}),z(" assignNodeIntersects",function(){N(G)}),z(" reversePoints",function(){V(G)}),z(" acyclic.undo",function(){e.undo(G)})}function b(G,z){r.forEach(G.nodes(),function(Y){var te=G.node(Y),ue=z.node(Y);te&&(te.x=ue.x,te.y=ue.y,z.children(Y).length&&(te.width=ue.width,te.height=ue.height))}),r.forEach(G.edges(),function(Y){var te=G.edge(Y),ue=z.edge(Y);te.points=ue.points,r.has(ue,"x")&&(te.x=ue.x,te.y=ue.y)}),G.graph().width=z.graph().width,G.graph().height=z.graph().height}var w=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],S={width:0,height:0},R=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},A=["labelpos"];function P(G){var z=new g({multigraph:!0,compound:!0}),Y=fe(G.graph());return z.setGraph(r.merge({},y,j(Y,w),r.pick(Y,E))),r.forEach(G.nodes(),function(te){var ue=fe(G.node(te));z.setNode(te,r.defaults(j(ue,C),S)),z.setParent(te,G.parent(te))}),r.forEach(G.edges(),function(te){var ue=fe(G.edge(te));z.setEdge(te,r.merge({},_,j(ue,R),r.pick(ue,A)))}),z}function I(G){var z=G.graph();z.ranksep/=2,r.forEach(G.edges(),function(Y){var te=G.edge(Y);te.minlen*=2,te.labelpos.toLowerCase()!=="c"&&(z.rankdir==="TB"||z.rankdir==="BT"?te.width+=te.labeloffset:te.height+=te.labeloffset)})}function D(G){r.forEach(G.edges(),function(z){var Y=G.edge(z);if(Y.width&&Y.height){var te=G.node(z.v),ue=G.node(z.w),oe={rank:(ue.rank-te.rank)/2+te.rank,e:z};h.addDummyNode(G,"edge-proxy",oe,"_ep")}})}function L(G){var z=0;r.forEach(G.nodes(),function(Y){var te=G.node(Y);te.borderTop&&(te.minRank=G.node(te.borderTop).rank,te.maxRank=G.node(te.borderBottom).rank,z=r.max(z,te.maxRank))}),G.graph().maxRank=z}function M(G){r.forEach(G.nodes(),function(z){var Y=G.node(z);Y.dummy==="edge-proxy"&&(G.edge(Y.e).labelRank=Y.rank,G.removeNode(z))})}function q(G){var z=Number.POSITIVE_INFINITY,Y=0,te=Number.POSITIVE_INFINITY,ue=0,oe=G.graph(),Z=oe.marginx||0,Q=oe.marginy||0;function ie(de){var we=de.x,Ae=de.y,ve=de.width,le=de.height;z=Math.min(z,we-ve/2),Y=Math.max(Y,we+ve/2),te=Math.min(te,Ae-le/2),ue=Math.max(ue,Ae+le/2)}r.forEach(G.nodes(),function(de){ie(G.node(de))}),r.forEach(G.edges(),function(de){var we=G.edge(de);r.has(we,"x")&&ie(we)}),z-=Z,te-=Q,r.forEach(G.nodes(),function(de){var we=G.node(de);we.x-=z,we.y-=te}),r.forEach(G.edges(),function(de){var we=G.edge(de);r.forEach(we.points,function(Ae){Ae.x-=z,Ae.y-=te}),r.has(we,"x")&&(we.x-=z),r.has(we,"y")&&(we.y-=te)}),oe.width=Y-z+Z,oe.height=ue-te+Q}function N(G){r.forEach(G.edges(),function(z){var Y=G.edge(z),te=G.node(z.v),ue=G.node(z.w),oe,Z;Y.points?(oe=Y.points[0],Z=Y.points[Y.points.length-1]):(Y.points=[],oe=ue,Z=te),Y.points.unshift(h.intersectRect(te,oe)),Y.points.push(h.intersectRect(ue,Z))})}function W(G){r.forEach(G.edges(),function(z){var Y=G.edge(z);if(r.has(Y,"x"))switch((Y.labelpos==="l"||Y.labelpos==="r")&&(Y.width-=Y.labeloffset),Y.labelpos){case"l":Y.x-=Y.width/2+Y.labeloffset;break;case"r":Y.x+=Y.width/2+Y.labeloffset;break}})}function V(G){r.forEach(G.edges(),function(z){var Y=G.edge(z);Y.reversed&&Y.points.reverse()})}function $(G){r.forEach(G.nodes(),function(z){if(G.children(z).length){var Y=G.node(z),te=G.node(Y.borderTop),ue=G.node(Y.borderBottom),oe=G.node(r.last(Y.borderLeft)),Z=G.node(r.last(Y.borderRight));Y.width=Math.abs(Z.x-oe.x),Y.height=Math.abs(ue.y-te.y),Y.x=oe.x+Y.width/2,Y.y=te.y+Y.height/2}}),r.forEach(G.nodes(),function(z){G.node(z).dummy==="border"&&G.removeNode(z)})}function X(G){r.forEach(G.edges(),function(z){if(z.v===z.w){var Y=G.node(z.v);Y.selfEdges||(Y.selfEdges=[]),Y.selfEdges.push({e:z,label:G.edge(z)}),G.removeEdge(z)}})}function ee(G){var z=h.buildLayerMatrix(G);r.forEach(z,function(Y){var te=0;r.forEach(Y,function(ue,oe){var Z=G.node(ue);Z.order=oe+te,r.forEach(Z.selfEdges,function(Q){h.addDummyNode(G,"selfedge",{width:Q.label.width,height:Q.label.height,rank:Z.rank,order:oe+ ++te,e:Q.e,label:Q.label},"_se")}),delete Z.selfEdges})})}function K(G){r.forEach(G.nodes(),function(z){var Y=G.node(z);if(Y.dummy==="selfedge"){var te=G.node(Y.e.v),ue=te.x+te.width/2,oe=te.y,Z=Y.x-ue,Q=te.height/2;G.setEdge(Y.e,Y.label),G.removeNode(z),Y.label.points=[{x:ue+2*Z/3,y:oe-Q},{x:ue+5*Z/6,y:oe-Q},{x:ue+Z,y:oe},{x:ue+5*Z/6,y:oe+Q},{x:ue+2*Z/3,y:oe+Q}],Y.label.x=Y.x,Y.label.y=Y.y}})}function j(G,z){return r.mapValues(r.pick(G,z),Number)}function fe(G){var z={};return r.forEach(G,function(Y,te){z[te.toLowerCase()]=Y}),z}return cm}var dm,eR;function XW(){if(eR)return dm;eR=1;var r=qr(),e=Wt(),t=Tn().Graph;dm={debugOrdering:n};function n(a){var i=e.buildLayerMatrix(a),o=new t({compound:!0,multigraph:!0}).setGraph({});return r.forEach(a.nodes(),function(s){o.setNode(s,{label:s}),o.setParent(s,"layer"+a.node(s).rank)}),r.forEach(a.edges(),function(s){o.setEdge(s.v,s.w,{},s.name)}),r.forEach(i,function(s,u){var l="layer"+u;o.setNode(l,{rank:"same"}),r.reduce(s,function(f,d){return o.setEdge(f,d,{style:"invis"}),d})}),o}return dm}var vm,rR;function ZW(){return rR||(rR=1,vm="0.8.5"),vm}var hm,tR;function QW(){return tR||(tR=1,hm={graphlib:Tn(),layout:YW(),debug:XW(),util:{time:Wt().time,notime:Wt().notime},version:ZW()}),hm}var JW=Xu.exports,nR;function eU(){return nR||(nR=1,(function(r,e){(function(n,a){r.exports=a(QW())})(JW,function(t){return(function(n){var a={};function i(o){if(a[o])return a[o].exports;var s=a[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=n,i.c=a,i.d=function(o,s,u){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:u})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(s&1&&(o=i(o)),s&8||s&4&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(i.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),s&2&&typeof o!="string")for(var l in o)i.d(u,l,(function(f){return o[f]}).bind(null,l));return u},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=0)})([(function(n,a,i){var o=i(1),s=function(l){l&&l("layout","dagre",o)};typeof cytoscape<"u"&&s(cytoscape),n.exports=s}),(function(n,a,i){function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(p){return typeof p}:o=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},o(h)}var s=function(g){return typeof g=="function"},u=i(2),l=i(3),f=i(4);function d(h){this.options=l({},u,h)}d.prototype.run=function(){var h=this.options,g=this,p=h.cy,x=h.eles,b=function(K,j){return s(j)?j.apply(K,[K]):j},w=h.boundingBox||{x1:0,y1:0,w:p.width(),h:p.height()};w.x2===void 0&&(w.x2=w.x1+w.w),w.w===void 0&&(w.w=w.x2-w.x1),w.y2===void 0&&(w.y2=w.y1+w.h),w.h===void 0&&(w.h=w.y2-w.y1);var y=new f.graphlib.Graph({multigraph:!0,compound:!0}),E={},C=function(K,j){j!=null&&(E[K]=j)};C("nodesep",h.nodeSep),C("edgesep",h.edgeSep),C("ranksep",h.rankSep),C("rankdir",h.rankDir),C("align",h.align),C("ranker",h.ranker),C("acyclicer",h.acyclicer),y.setGraph(E),y.setDefaultEdgeLabel(function(){return{}}),y.setDefaultNodeLabel(function(){return{}});var S=x.nodes();s(h.sort)&&(S=S.sort(h.sort));for(var R=0;R<S.length;R++){var _=S[R],A=_.layoutDimensions(h);y.setNode(_.id(),{width:A.w,height:A.h,name:_.id()})}for(var P=0;P<S.length;P++){var I=S[P];I.isChild()&&y.setParent(I.id(),I.parent().id())}var D=x.edges().stdFilter(function(ee){return!ee.source().isParent()&&!ee.target().isParent()});s(h.sort)&&(D=D.sort(h.sort));for(var L=0;L<D.length;L++){var M=D[L];y.setEdge(M.source().id(),M.target().id(),{minlen:b(M,h.minLen),weight:b(M,h.edgeWeight),name:M.id()},M.id())}f.layout(y);for(var q=y.nodes(),N=0;N<q.length;N++){var W=q[N],V=y.node(W);p.getElementById(W).scratch().dagre=V}var $;h.boundingBox?($={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},S.forEach(function(ee){var K=ee.scratch().dagre;$.x1=Math.min($.x1,K.x),$.x2=Math.max($.x2,K.x),$.y1=Math.min($.y1,K.y),$.y2=Math.max($.y2,K.y)}),$.w=$.x2-$.x1,$.h=$.y2-$.y1):$=w;var X=function(K){if(h.boundingBox){var j=$.w===0?0:(K.x-$.x1)/$.w,fe=$.h===0?0:(K.y-$.y1)/$.h;return{x:w.x1+j*w.w,y:w.y1+fe*w.h}}else return K};return S.layoutPositions(g,h,function(ee){ee=o(ee)==="object"?ee:this;var K=ee.scratch().dagre;return X({x:K.x,y:K.y})}),this},n.exports=d}),(function(n,a){var i={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(s){return 1},edgeWeight:function(s){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(s,u){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(s,u){return u},ready:function(){},sort:void 0,stop:function(){}};n.exports=i}),(function(n,a){n.exports=Object.assign!=null?Object.assign.bind(Object):function(i){for(var o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return s.forEach(function(l){Object.keys(l).forEach(function(f){return i[f]=l[f]})}),i}}),(function(n,a){n.exports=t})])})})(Xu)),Xu.exports}var rU=eU();const tU=gl(rU);var Zu={exports:{}},gm,aR;function nU(){if(aR)return gm;aR=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof St=="object"&&St&&St.Object===Object&&St,s=typeof self=="object"&&self&&self.Object===Object&&self,u=o||s||Function("return this")();function l(ve,le){return ve==null?void 0:ve[le]}function f(ve){var le=!1;if(ve!=null&&typeof ve.toString!="function")try{le=!!(ve+"")}catch{}return le}var d=Array.prototype,h=Function.prototype,g=Object.prototype,p=u["__core-js_shared__"],x=(function(){var ve=/[^.]+$/.exec(p&&p.keys&&p.keys.IE_PROTO||"");return ve?"Symbol(src)_1."+ve:""})(),b=h.toString,w=g.hasOwnProperty,y=g.toString,E=RegExp("^"+b.call(w).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=d.splice,S=ue(u,"Map"),R=ue(Object,"create");function _(ve){var le=-1,Me=ve?ve.length:0;for(this.clear();++le<Me;){var Se=ve[le];this.set(Se[0],Se[1])}}function A(){this.__data__=R?R(null):{}}function P(ve){return this.has(ve)&&delete this.__data__[ve]}function I(ve){var le=this.__data__;if(R){var Me=le[ve];return Me===e?void 0:Me}return w.call(le,ve)?le[ve]:void 0}function D(ve){var le=this.__data__;return R?le[ve]!==void 0:w.call(le,ve)}function L(ve,le){var Me=this.__data__;return Me[ve]=R&&le===void 0?e:le,this}_.prototype.clear=A,_.prototype.delete=P,_.prototype.get=I,_.prototype.has=D,_.prototype.set=L;function M(ve){var le=-1,Me=ve?ve.length:0;for(this.clear();++le<Me;){var Se=ve[le];this.set(Se[0],Se[1])}}function q(){this.__data__=[]}function N(ve){var le=this.__data__,Me=z(le,ve);if(Me<0)return!1;var Se=le.length-1;return Me==Se?le.pop():C.call(le,Me,1),!0}function W(ve){var le=this.__data__,Me=z(le,ve);return Me<0?void 0:le[Me][1]}function V(ve){return z(this.__data__,ve)>-1}function $(ve,le){var Me=this.__data__,Se=z(Me,ve);return Se<0?Me.push([ve,le]):Me[Se][1]=le,this}M.prototype.clear=q,M.prototype.delete=N,M.prototype.get=W,M.prototype.has=V,M.prototype.set=$;function X(ve){var le=-1,Me=ve?ve.length:0;for(this.clear();++le<Me;){var Se=ve[le];this.set(Se[0],Se[1])}}function ee(){this.__data__={hash:new _,map:new(S||M),string:new _}}function K(ve){return te(this,ve).delete(ve)}function j(ve){return te(this,ve).get(ve)}function fe(ve){return te(this,ve).has(ve)}function G(ve,le){return te(this,ve).set(ve,le),this}X.prototype.clear=ee,X.prototype.delete=K,X.prototype.get=j,X.prototype.has=fe,X.prototype.set=G;function z(ve,le){for(var Me=ve.length;Me--;)if(de(ve[Me][0],le))return Me;return-1}function Y(ve){if(!Ae(ve)||Z(ve))return!1;var le=we(ve)||f(ve)?E:i;return le.test(Q(ve))}function te(ve,le){var Me=ve.__data__;return oe(le)?Me[typeof le=="string"?"string":"hash"]:Me.map}function ue(ve,le){var Me=l(ve,le);return Y(Me)?Me:void 0}function oe(ve){var le=typeof ve;return le=="string"||le=="number"||le=="symbol"||le=="boolean"?ve!=="__proto__":ve===null}function Z(ve){return!!x&&x in ve}function Q(ve){if(ve!=null){try{return b.call(ve)}catch{}try{return ve+""}catch{}}return""}function ie(ve,le){if(typeof ve!="function"||le&&typeof le!="function")throw new TypeError(r);var Me=function(){var Se=arguments,Ee=le?le.apply(this,Se):Se[0],re=Me.cache;if(re.has(Ee))return re.get(Ee);var ce=ve.apply(this,Se);return Me.cache=re.set(Ee,ce),ce};return Me.cache=new(ie.Cache||X),Me}ie.Cache=X;function de(ve,le){return ve===le||ve!==ve&&le!==le}function we(ve){var le=Ae(ve)?y.call(ve):"";return le==t||le==n}function Ae(ve){var le=typeof ve;return!!ve&&(le=="object"||le=="function")}return gm=ie,gm}var pm,iR;function aU(){if(iR)return pm;iR=1;var r="Expected a function",e=NaN,t="[object Symbol]",n=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,u=typeof St=="object"&&St&&St.Object===Object&&St,l=typeof self=="object"&&self&&self.Object===Object&&self,f=u||l||Function("return this")(),d=Object.prototype,h=d.toString,g=Math.max,p=Math.min,x=function(){return f.Date.now()};function b(R,_,A){var P,I,D,L,M,q,N=0,W=!1,V=!1,$=!0;if(typeof R!="function")throw new TypeError(r);_=S(_)||0,y(A)&&(W=!!A.leading,V="maxWait"in A,D=V?g(S(A.maxWait)||0,_):D,$="trailing"in A?!!A.trailing:$);function X(ue){var oe=P,Z=I;return P=I=void 0,N=ue,L=R.apply(Z,oe),L}function ee(ue){return N=ue,M=setTimeout(fe,_),W?X(ue):L}function K(ue){var oe=ue-q,Z=ue-N,Q=_-oe;return V?p(Q,D-Z):Q}function j(ue){var oe=ue-q,Z=ue-N;return q===void 0||oe>=_||oe<0||V&&Z>=D}function fe(){var ue=x();if(j(ue))return G(ue);M=setTimeout(fe,K(ue))}function G(ue){return M=void 0,$&&P?X(ue):(P=I=void 0,L)}function z(){M!==void 0&&clearTimeout(M),N=0,P=q=I=M=void 0}function Y(){return M===void 0?L:G(x())}function te(){var ue=x(),oe=j(ue);if(P=arguments,I=this,q=ue,oe){if(M===void 0)return ee(q);if(V)return M=setTimeout(fe,_),X(q)}return M===void 0&&(M=setTimeout(fe,_)),L}return te.cancel=z,te.flush=Y,te}function w(R,_,A){var P=!0,I=!0;if(typeof R!="function")throw new TypeError(r);return y(A)&&(P="leading"in A?!!A.leading:P,I="trailing"in A?!!A.trailing:I),b(R,_,{leading:P,maxWait:_,trailing:I})}function y(R){var _=typeof R;return!!R&&(_=="object"||_=="function")}function E(R){return!!R&&typeof R=="object"}function C(R){return typeof R=="symbol"||E(R)&&h.call(R)==t}function S(R){if(typeof R=="number")return R;if(C(R))return e;if(y(R)){var _=typeof R.valueOf=="function"?R.valueOf():R;R=y(_)?_+"":_}if(typeof R!="string")return R===0?R:+R;R=R.replace(n,"");var A=i.test(R);return A||o.test(R)?s(R.slice(2),A?2:8):a.test(R)?e:+R}return pm=w,pm}var iU=Zu.exports,oR;function oU(){return oR||(oR=1,(function(r,e){(function(n,a){r.exports=a(nU(),aU())})(iU,function(t,n){return(function(a){var i={};function o(s){if(i[s])return i[s].exports;var u=i[s]={i:s,l:!1,exports:{}};return a[s].call(u.exports,u,u.exports,o),u.l=!0,u.exports}return o.m=a,o.c=i,o.i=function(s){return s},o.d=function(s,u,l){o.o(s,u)||Object.defineProperty(s,u,{configurable:!1,enumerable:!0,get:l})},o.n=function(s){var u=s&&s.__esModule?function(){return s.default}:function(){return s};return o.d(u,"a",u),u},o.o=function(s,u){return Object.prototype.hasOwnProperty.call(s,u)},o.p="",o(o.s=12)})([(function(a,i,o){a.exports=Object.assign!=null?Object.assign.bind(Object):function(s){for(var u=arguments.length,l=Array(u>1?u-1:0),f=1;f<u;f++)l[f-1]=arguments[f];return l.filter(function(d){return d!=null}).forEach(function(d){Object.keys(d).forEach(function(h){return s[h]=d[h]})}),s}}),(function(a,i,o){var s=o(10),u=o(0);a.exports=function(l){var f=this;return new s(u({cy:f},l))}}),(function(a,i,o){function s(){if(this.saveGestureState(),this.cy.zoomingEnabled(!1).panningEnabled(!1).boxSelectionEnabled(!1),this.options.disableBrowserGestures){var f=this.windowListenerOptions;window.addEventListener("touchstart",this.preventDefault,f),window.addEventListener("touchmove",this.preventDefault,f),window.addEventListener("wheel",this.preventDefault,f)}return this}function u(){if(this.cy.zoomingEnabled(this.lastZoomingEnabled).panningEnabled(this.lastPanningEnabled).boxSelectionEnabled(this.lastBoxSelectionEnabled),this.options.disableBrowserGestures){var f=this.windowListenerOptions;window.removeEventListener("touchstart",this.preventDefault,f),window.removeEventListener("touchmove",this.preventDefault,f),window.removeEventListener("wheel",this.preventDefault,f)}return this}function l(){var f=this.cy;return this.lastPanningEnabled=f.panningEnabled(),this.lastZoomingEnabled=f.zoomingEnabled(),this.lastBoxSelectionEnabled=f.boxSelectionEnabled(),this}a.exports={disableGestures:s,resetGestures:u,saveGestureState:l}}),(function(a,i,o){function s(){var u=this,l=this.cy,f=this.options;return this.addListener(l,"drag",function(){return u.grabbingNode=!0}),this.addListener(l,"free",function(){return u.grabbingNode=!1}),this.addListener(l,"tapstart","node",function(d){var h=d.target;u.drawMode&&u.start(h)}),this.addListener(l,"tapdrag",function(d){u.update(d.position)}),this.addListener(l,"tapdragover","node",function(d){f.snap||u.preview(d.target)}),this.addListener(l,"tapdragout","node",function(d){f.snap||u.unpreview(d.target)}),this.addListener(l,"tapend",function(){u.stop()}),this}a.exports={addCytoscapeListeners:s}}),(function(a,i,o){var s={canConnect:function(l,f){return!l.same(f)},edgeParams:function(l,f){return{}},hoverDelay:150,snap:!0,snapThreshold:50,snapFrequency:15,noEdgeEventsInDraw:!0,disableBrowserGestures:!0};a.exports=s}),(function(a,i,o){function s(f){var d=this.cy;return this.drawMode=f??!this.drawMode,this.drawMode?(this.prevUngrabifyState=d.autoungrabify(),d.autoungrabify(!0),this.emit("drawon")):(d.autoungrabify(this.prevUngrabifyState),this.emit("drawoff")),this}function u(){return this.toggleDrawMode(!0)}function l(){return this.toggleDrawMode(!1)}a.exports={toggleDrawMode:s,enableDrawMode:u,disableDrawMode:l}}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},u=o(0),l=function(y){return(typeof y>"u"?"undefined":s(y))===s("")},f=function(y){return(typeof y>"u"?"undefined":s(y))===s([])&&y.length!=null};function d(w,y,E){var C={};return u(C,y,w),u(C.data,y.data,w.data),l(y.classes)?C.classes=y.classes+" "+E:f(y.classes)?C.classes=y.classes.join(" ")+" "+E:C.classes=E,C}function h(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=this.cy;this.options;var E=this.presumptiveTargets,C=this.previewEles,S=this.active,R=this.sourceNode,_=this.targetNode,A=w?"eh-preview":"",P=y.collection(),I=this.canConnect(_);if(S&&I){if(!_||_.size()===0){C.remove(),this.emit("cancel",this.mp(),R,E);return}if(!w){C.removeClass("eh-preview").style("events",""),this.emit("complete",this.mp(),R,_,C);return}var D=y.add(d({group:"edges",data:{source:R.id(),target:_.id()}},this.edgeParams(_),A));return P=P.merge(D),w?(this.previewEles=P,P.style("events","no")):(P.style("events",""),this.emit("complete",this.mp(),R,_,P)),this}}function g(){return this.makeEdges(!0),this}function p(){return this.previewEles.nonempty()&&this.previewEles.inside()}function x(){return this.previewShown()&&this.previewEles.remove(),this}function b(){var w=this,y=this.sourceNode,E=this.ghostNode,C=this.cy,S=this.mx,R=this.my,_=S,A=R,P=void 0,I=void 0;if(y)return(!E||E.length===0||E.removed())&&(I=this.ghostEles=C.collection(),C.batch(function(){E=w.ghostNode=C.add({group:"nodes",classes:"eh-ghost eh-ghost-node",position:{x:0,y:0}}),E.style({"background-color":"blue",width:1e-4,height:1e-4,opacity:0,events:"no"});var D={};P=C.add(u({},D,{group:"edges",data:u({},D.data,{source:y.id(),target:E.id()}),classes:"eh-ghost eh-ghost-edge"})),P.style({events:"no"})}),I.merge(E).merge(P)),E.position({x:_,y:A}),this}a.exports={makeEdges:h,makePreview:g,removePreview:x,previewShown:p,updateEdge:b}}),(function(a,i,o){function s(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events","no"),this}function u(){return this.options.noEdgeEventsInDraw&&this.cy.edges().style("events",""),this}a.exports={disableEdgeEvents:s,enableEdgeEvents:u}}),(function(a,i,o){function s(){return this.enabled=!0,this.emit("enable"),this}function u(){return this.enabled=!1,this.emit("disable"),this}a.exports={enable:s,disable:u}}),(function(a,i,o){var s=o(13),u=Math.sqrt(2);function l(y){var E=this.previewEles,C=this.ghostEles,S=function(L){return E.anySame(L)},R=function(L){return C.anySame(L)},_=function(L){return S(L)||R(L)},A=this.enabled,P=this.active,I=this.grabbingNode;return A&&!P&&!I&&y!=null&&y.nonempty()&&!_(y)}function f(y){return this.canStartOn(y)&&this.drawMode}function d(y){return this.canStartOn(y)&&!this.drawMode}function h(y){var E=this;if(this.canStartOn(y)){this.active=!0,this.sourceNode=y,this.sourceNode.addClass("eh-source"),this.disableGestures(),this.disableEdgeEvents();var C=function(R){return R.id()};this.canConnect=s(function(S){return E.options.canConnect(E.sourceNode,S)},C),this.edgeParams=s(function(S){return E.options.edgeParams(E.sourceNode,S)},C),this.emit("start",this.hp(),y)}}function g(y){if(this.active){var E=y;return this.mx=E.x,this.my=E.y,this.updateEdge(),this.throttledSnap(),this}}function p(){if(!this.active||!this.options.snap)return!1;var y=this.cy,E=this.targetNode,C=this.options.snapThreshold,S=this.mp(),R=this.previewEles,_=this.ghostNode,A=function(z){return u*Math.max(z.outerWidth(),z.outerHeight())/2},P=function(z,Y,te,ue){var oe=te-z,Z=ue-Y;return oe*oe+Z*Z},I=function(z,Y){return P(z.x,z.y,Y.x,Y.y)},D=function(z){return I(z.position(),S)},L=function(z){var Y=A(z),te=Y+C;return te*te},M=function(z){return D(z)<=L(z)},q=function(z){var Y=z.position(),te=z.outerWidth()/2,ue=z.outerHeight()/2,oe=Y.x,Z=Y.y,Q=S.x,ie=S.y,de=oe-te,we=oe+te,Ae=Z-ue,ve=Z+ue,le=de<=Q&&Q<=we,Me=Ae<=ie&&ie<=ve;if(le&&Me)return 0;if(le){var Se=ie-Ae,Ee=ie-ve;return Math.min(Se*Se,Ee*Ee)}else if(Me){var re=Q-de,ce=Q-we;return Math.min(re*re,ce*ce)}else return Q<de&&ie<Ae?P(Q,ie,de,Ae):Q>we&&ie<Ae?P(Q,ie,we,Ae):Q<de&&ie>ve?P(Q,ie,de,ve):P(Q,ie,we,ve)},N=function(z,Y){return q(z)-q(Y)},W=N,V=!1,$=function(z){var Y=S,te=z.outerWidth(),ue=te/2,oe=z.outerHeight(),Z=oe/2,Q=z.position(),ie=Q.x-ue,de=Q.x+ue,we=Q.y-Z,Ae=Q.y+Z;return ie<=Y.x&&Y.x<=de&&we<=Y.y&&Y.y<=Ae},X=function(z){return z.same(R)||z.same(_)},ee=y.nodes(function(G){return!X(G)&&M(G)}).sort(W),K=!1;E.nonempty()&&!M(E)&&this.unpreview(E);for(var j=0;j<ee.length;j++){var fe=ee[j];if(!(fe.isParent()&&$(fe))&&!(fe.isChild()&&!$(fe.parent()))&&(fe.same(E)||this.preview(fe,V))){K=!0;break}}return K}function x(y){var E=this,C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,S=this.options,R=this.sourceNode,_=this.ghostNode,A=this.ghostEles,P=this.presumptiveTargets,I=this.previewEles,D=this.active,L=R,M=y.same(_),q=!this.canConnect(y),N=y.same(this.targetNode);if(!D||M||q||N)return!1;this.targetNode.nonempty()&&this.unpreview(this.targetNode),clearTimeout(this.previewTimeout);var W=function(){E.targetNode=y,P.merge(y),y.addClass("eh-presumptive-target"),y.addClass("eh-target"),E.emit("hoverover",E.mp(),L,y),y.addClass("eh-preview"),A.addClass("eh-preview-active"),R.addClass("eh-preview-active"),y.addClass("eh-preview-active"),E.makePreview(),E.emit("previewon",E.mp(),L,y,I)};return C&&S.hoverDelay>0?this.previewTimeout=setTimeout(W,S.hoverDelay):W(),!0}function b(y){if(this.active){var E=this.previewTimeout,C=this.sourceNode,S=this.previewEles,R=this.ghostEles,_=this.cy;clearTimeout(E),this.previewTimeout=null;var A=C;return y.removeClass("eh-preview eh-target eh-presumptive-target eh-preview-active"),R.removeClass("eh-preview-active"),C.removeClass("eh-preview-active"),this.targetNode=_.collection(),this.removePreview(A,y),this.emit("hoverout",this.mp(),A,y),this.emit("previewoff",this.mp(),A,y,S),this}}function w(){if(this.active){var y=this.sourceNode,E=this.targetNode,C=this.ghostEles,S=this.presumptiveTargets;return clearTimeout(this.previewTimeout),y.removeClass("eh-source eh-preview-active"),E.removeClass("eh-target eh-preview eh-hover eh-preview-active"),S.removeClass("eh-presumptive-target"),this.makeEdges(),C.remove(),this.clearCollections(),this.resetGestures(),this.enableEdgeEvents(),this.active=!1,this.emit("stop",this.mp(),y),this}}a.exports={start:h,update:g,preview:x,unpreview:b,stop:w,snap:p,canStartOn:l,canStartDrawModeOn:f,canStartNonDrawModeOn:d}}),(function(a,i,o){var s=o(4),u=o(0),l=o(14),f=o(2),d=o(3),h=o(5),g=o(6),p=o(8),x=o(9),b=o(11),w=o(7);function y(S){var R=S.cy;this.cy=R,this.listeners=[],this.enabled=!0,this.drawMode=!1,this.active=!1,this.grabbingNode=!1,this.clearCollections(),this.mx=0,this.my=0,this.options=u({},s,S),this.saveGestureState(),this.addListeners(),this.throttledSnap=l(this.snap.bind(this),1e3/S.snapFrequency),this.preventDefault=function(P){return P.preventDefault()},this.canConnect=function(){return!1};var _=!1;try{var A=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("test",null,A)}catch{}_?this.windowListenerOptions={capture:!0,passive:!1}:this.windowListenerOptions=!0}var E=y.prototype={},C=function(R){return u(E,R)};E.destroy=function(){this.removeListeners()},E.setOptions=function(S){u(this.options,S)},E.mp=function(){return{x:this.mx,y:this.my}},E.hp=function(){return{x:this.hx,y:this.hy}},E.clearCollections=function(){var S=this.cy;this.previewEles=S.collection(),this.ghostEles=S.collection(),this.ghostNode=S.collection(),this.sourceNode=S.collection(),this.targetNode=S.collection(),this.presumptiveTargets=S.collection()},[f,d,h,g,p,x,b,w].forEach(C),a.exports=y}),(function(a,i,o){var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x};function u(){var x=this;return this.addCytoscapeListeners(),this.addListener(this.cy,"destroy",function(){return x.destroy()}),this}function l(){for(var x=this.listeners.length-1;x>=0;x--){var b=this.listeners[x];this.removeListener(b.target,b.event,b.selector,b.callback,b.options)}return this}function f(x,b,w,y,E){return(typeof w>"u"?"undefined":s(w))!==s("")&&(y=w,E=y,w=null),E==null&&(E=!1),{target:x,event:b,selector:w,callback:y,options:E}}function d(x){return x instanceof Element}function h(x,b,w,y,E){var C=f(x,b,w,y,E);return this.listeners.push(C),d(C.target)?C.target.addEventListener(C.event,C.callback,C.options):C.selector?C.target.addListener(C.event,C.selector,C.callback,C.options):C.target.addListener(C.event,C.callback,C.options),this}function g(x,b,w,y,E){for(var C=f(x,b,w,y,E),S=this.listeners.length-1;S>=0;S--){var R=this.listeners[S];if(C.target===R.target&&C.event===R.event&&(C.selector==null||C.selector===R.selector)&&(C.callback==null||C.callback===R.callback)){this.listeners.splice(S,1),d(C.target)?C.target.removeEventListener(C.event,C.callback,C.options):C.selector?C.target.removeListener(C.event,C.selector,C.callback,C.options):C.target.removeListener(C.event,C.callback,C.options);break}}return this}function p(x,b){for(var w=this.cy,y=arguments.length,E=Array(y>2?y-2:0),C=2;C<y;C++)E[C-2]=arguments[C];return w.emit({type:"eh"+x,position:b},E),this}a.exports={addListener:h,addListeners:u,removeListener:g,removeListeners:l,emit:p}}),(function(a,i,o){var s=o(1),u=function(f){f&&f("core","edgehandles",s)};typeof cytoscape<"u"&&u(cytoscape),a.exports=u}),(function(a,i){a.exports=t}),(function(a,i){a.exports=n})])})})(Zu)),Zu.exports}var sU=oU();const uU=gl(sU);var ym,sR;function lU(){if(sR)return ym;sR=1;class r{constructor(n,a={}){this._cy=n,this._params=a,this._node_dom={};let i=n.container();if(a.dom_container)this._nodes_dom_container=a.dom_container;else{let o=document.createElement("div");o.style.position="absolute",o.style.zIndex=10,i.querySelector("canvas").parentNode.appendChild(o),this._nodes_dom_container=o}this._resize_observer=new ResizeObserver(o=>{for(let s of o){let u=s.target,l=u.__cy_id;n.getElementById(l).style({width:u.offsetWidth,height:u.offsetHeight,shape:"rectangle"})}}),n.on("add","node",o=>{this._add_node(o.target)}),n.on("remove","node",o=>{this._remove_node(o.target)});for(let o of n.nodes())this._add_node(o);n.on("pan zoom",o=>{let s=n.pan(),u=n.zoom(),l="translate("+s.x+"px,"+s.y+"px) scale("+u+")";this._nodes_dom_container.style.msTransform=l,this._nodes_dom_container.style.transform=l}),n.on("position bounds","node",o=>{let s=o.target,u=s.id();if(!this._node_dom[u])return;let l=this._node_dom[u],f=`translate(-50%, -50%) translate(${s.position("x").toFixed(2)}px, ${s.position("y").toFixed(2)}px)`;l.style.webkitTransform=f,l.style.msTransform=f,l.style.transform=f,l.style.display="inline",l.style.position="absolute",l.style["z-index"]=10})}_add_node(n){let a=n.data();a.dom&&(a.skip_node_append!==!0&&this._nodes_dom_container.appendChild(a.dom),a.dom.__cy_id=n.id(),this._node_dom[n.id()]=a.dom,this._resize_observer.observe(a.dom))}_remove_node(n){let a=n.id(),i=this._node_dom[a];i&&(this._resize_observer.unobserve(i),i.parentNode===this._nodes_dom_container&&this._nodes_dom_container.removeChild(i),delete this._node_dom[a])}node_dom(n){return this._node_dom[n]}update(n,a){let i=this._cy.getElementById(n);if(!i){console.warn(`Node with id ${n} not found`);return}let o=this._node_dom[n];if(!o){console.warn(`DOM element for node ${n} not found`);return}a(o),i.data("dom",o),this._cy.trigger("position",["node",i])}remove(){for(let n in this._node_dom)this._resize_observer.unobserve(this._node_dom[n]);for(;this._nodes_dom_container.firstChild;)this._nodes_dom_container.removeChild(this._nodes_dom_container.firstChild);this._node_dom={},this._cy.removeListener("add","node"),this._cy.removeListener("remove","node"),this._cy.removeListener("pan zoom"),this._cy.removeListener("position bounds","node"),this._params.dom_container||this._nodes_dom_container.parentNode.removeChild(this._nodes_dom_container),this._cy=null,this._params=null,this._nodes_dom_container=null,this._resize_observer=null}}function e(t){t&&t("core","domNode",function(n,a){return new r(this,n,a)})}return typeof cytoscape<"u"&&e(cytoscape),ym=e,ym}var fU=lU();const cU=gl(fU);vn.prototype.hasInitialised||(vn.use(tU),vn.use(uU),vn.use(cU),vn.prototype.hasInitialised=!0);function dU({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,u]=xe.useState(!1),l=xe.useRef(null),f=xe.useRef(null),d=xe.useRef(null),h=xe.useRef(!0),g=xe.useRef(t);g.current=t;const p=xe.useCallback(()=>{var w;d.current!==null&&d.current.stop(),f.current&&(d.current=f.current.layout(g.current),(w=d.current)==null||w.run())},[]),x=xe.useMemo(()=>xw(p,n),[p,n]);xe.useEffect(()=>()=>{x.cancel()},[x]),xe.useEffect(()=>{var C;if(!l.current)return;const w=vn({container:l.current,...r}),y=(C=l.current.parentElement)==null?void 0:C.querySelector(".cytoscape-react-nodes-and-edges");if(y&&w.domNode({dom_container:y}),f.current=e||w,l.current&&(l.current.cy=f.current),o==null||o(f.current),i(w),l.current&&f.current){const S=l.current.parentElement;let R=0,_=0;S&&(R=S.clientHeight,_=S.clientWidth,R===0&&(R=window.innerHeight-S.getBoundingClientRect().top-100),_===0&&(_=window.innerWidth)),R>0&&_>0&&(l.current.style.width=`${_}px`,l.current.style.height=`${R}px`),f.current.resize(),r.zoom&&r.pan&&f.current.viewport({zoom:r.zoom,pan:r.pan})}u(!0);const E=new ResizeObserver(xw(()=>{if(l.current&&f.current){const S=l.current.parentElement;let R=0,_=0;S&&(R=S.clientHeight,_=S.clientWidth,R===0&&(R=window.innerHeight-S.getBoundingClientRect().top-100),_===0&&(_=window.innerWidth),R>0&&_>0&&(l.current.style.width=`${_}px`,l.current.style.height=`${R}px`));const A=f.current.zoom()!==void 0?{zoom:f.current.zoom(),pan:f.current.pan()}:null;f.current.resize(),A&&f.current.viewport(A)}},50));return l.current&&E.observe(l.current),()=>{E.disconnect();try{w.destroy()}catch{}f.current=null,u(!1)}},[]),xe.useEffect(()=>{h.current?(h.current=!1,p()):x()},[s,t,x,p]);const b=xe.useMemo(()=>{var w;return f.current!==null?((w=xe.Children.map(a,y=>{var E;return y?xe.cloneElement(y,{key:(E=y==null?void 0:y.props)==null?void 0:E.id,cytoInstance:f.current,layout:x}):null}))==null?void 0:w.filter(Boolean))||[]:[]},[a,s,x]);return H.jsxs("div",{style:{width:"100%",height:"100%",position:"relative",background:"transparent"},children:[H.jsx("div",{ref:l,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative",background:"transparent"}}),H.jsx("div",{className:"cytoscape-react-nodes-and-edges",style:{pointerEvents:"none",position:"absolute",top:0,left:0,transformOrigin:"0 0",zIndex:10},children:b})]})}function vU({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s,parentViewProps:u}){const l=xe.useRef(null),f=xe.useRef("");function d(p){s&&p.isParent()&&(p.style("shape","roundrectangle"),p.style(s(u)))}xe.useEffect(()=>{try{if(l.current){const p={id:e,dom:l.current};t&&(p.parent=t),n&&(p.label=n);const x=r.add({data:p,classes:o});d(x),i()}}catch{}return()=>{r.getElementById(e).remove(),i()}},[l,t,n]),xe.useEffect(()=>{const p=l.current;if(!p||typeof ResizeObserver>"u")return;const x=new ResizeObserver(()=>{const b=`${p.offsetWidth}x${p.offsetHeight}`;b!==f.current&&(f.current=b,i())});return x.observe(p),()=>x.disconnect()},[i]),xe.useEffect(()=>{if(!s)return;const p=r.getElementById(e);p.length&&d(p)},[s,u]);function h(p){return xe.cloneElement(p,{cytoInstance:r,layout:i})}const g=xe.Children.map(a,h);return H.jsx("div",{ref:l,className:"cytoscape-react-node",children:g})}const wI=.4,hU=r=>[{selector:"node",style:{"outline-opacity":0,"background-opacity":0,"background-color":"transparent","border-color":"transparent",color:"transparent","border-opacity":0,"text-valign":"center","text-halign":"center","border-width":0,"outline-width":0,width:60,height:60}},{selector:"node:selected",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:"node:active",style:{"overlay-opacity":0,"overlay-color":"transparent"}},{selector:":parent",style:{shape:"round-rectangle","background-opacity":wI,"corner-radius":50,"line-color":r("light"),"background-color":r(),"border-color":r(),"border-width":6,"border-style":"solid","border-opacity":1,padding:"120px","text-valign":"top","font-size":"70px","font-weight":"bold","text-margin-y":90,"text-background-opacity":0,"text-background-padding":"45px","z-index":1e3,"compound-sizing-wrt-labels":"include",label:"data(label)"}},{selector:"edge",style:{width:6,label:"data(label)","z-index":-100,"control-point-step-size":10,"taxi-direction":"horizontal","curve-style":"round-taxi","edge-distances":"intersection","line-color":r("light"),color:r("light"),"text-rotation":"autorotate","target-arrow-color":r("light"),"source-arrow-color":r("light"),"target-arrow-shape":"triangle","arrow-scale":"3","text-background-color":r("dark"),"text-background-opacity":1,"text-background-padding":"15px","taxi-radius":500,"source-arrow-fill":"filled","target-arrow-fill":"filled","text-max-width":"200px","font-size":"45px","text-wrap":"wrap","text-margin-x":50,"transition-duration":"0.5s","source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","source-distance-from-node":80,"target-distance-from-node":80}},{selector:"edge:loop",style:{"curve-style":"bezier","control-point-step-size":350,"loop-direction":"-90deg","loop-sweep":"-60deg","source-distance-from-node":0,"target-distance-from-node":0}}],xI={padding:20,motionBlur:!1,compound:!0,pixelRatio:"auto",zoomingEnabled:!0,userZoomingEnabled:!0,dragpan:!0,avoidOverlap:!0,panningEnabled:!0,userPanningEnabled:!0,boxSelectionEnabled:!1,selectionType:"additive",minZoom:.01,maxZoom:1.5,autoungrabify:!0,styleEnabled:!0,hideEdgesOnViewport:!1,hideLabelsOnViewport:!0,headless:!1,touchTapThreshold:8,desktopTapThreshold:4,touchHoldDuration:500,desktopHoldDuration:1e3,autolock:!1,autounselectify:!1,wheelPanEnabled:!0,wheelPanThreshold:1,wheelPanDebounce:10,wheelAction:"pan"},EI={...xI,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},gU={...EI,hideEdgesOnViewport:!0,hideLabelsOnViewport:!0},pU={name:"dagre",rankDir:"LR",fit:!1,padding:20,spacingFactor:1.3,animate:!1,nodeDimensionsIncludeLabels:!0,ranker:"network-simplex",rankSep:10,nodeSep:5,edgeSep:10,avoidOverlap:!0,edgeWeight:function(r){return 1},minLen:function(r){return 1},useSimpleEdgeFunction:!0,edgeRouting:!0,controlPoints:!0},L0=({name:r,...e})=>{const[t,n]=xe.useState(null),[a,i]=xe.useState(!0),[o,s]=xe.useState(!1);return xe.useEffect(()=>{if(!r||r.length<2){n(null),i(!1);return}i(!0),s(!1),(async()=>{try{let l;if(r.startsWith("Md"))l="md";else if(r.startsWith("Fa"))l="fa6";else if(r.startsWith("Io5"))l="io5";else if(r.startsWith("Io"))l="io";else if(r.startsWith("Ti"))l="ti";else if(r.startsWith("Go"))l="go";else if(r.startsWith("Fi"))l="fi";else if(r.startsWith("Di"))l="di";else if(r.startsWith("Ai"))l="ai";else if(r.startsWith("Bs"))l="bs";else if(r.startsWith("Ri"))l="ri";else if(r.startsWith("Fc"))l="fc";else if(r.startsWith("Gi"))l="gi";else if(r.startsWith("Hi2"))l="hi2";else if(r.startsWith("Hi"))l="hi";else if(r.startsWith("Si"))l="si";else if(r.startsWith("Sl"))l="sl";else if(r.startsWith("Im"))l="im";else if(r.startsWith("Bi"))l="bi";else if(r.startsWith("Pi"))l="pi";else if(r.startsWith("Vsc"))l="vsc";else if(r.startsWith("Tb"))l="tb";else if(r.startsWith("Tfi"))l="tfi";else if(r.startsWith("Cg"))l="cg";else if(r.startsWith("Lia"))l="lia";else if(r.startsWith("Lu"))l="lu";else throw new Error(`Unknown library prefix for icon: ${r}`);let f;switch(l){case"md":f=await import("react-icons/md");break;case"fa6":f=await import("react-icons/fa6");break;case"io5":f=await import("react-icons/io5");break;case"io":f=await import("react-icons/io");break;case"ti":f=await import("react-icons/ti");break;case"go":f=await import("react-icons/go");break;case"fi":f=await import("react-icons/fi");break;case"di":f=await import("react-icons/di");break;case"ai":f=await import("react-icons/ai");break;case"bs":f=await import("react-icons/bs");break;case"ri":f=await import("react-icons/ri");break;case"fc":f=await import("react-icons/fc");break;case"gi":f=await import("react-icons/gi");break;case"hi2":f=await import("react-icons/hi2");break;case"hi":f=await import("react-icons/hi");break;case"si":f=await import("react-icons/si");break;case"sl":f=await import("react-icons/sl");break;case"im":f=await import("react-icons/im");break;case"bi":f=await import("react-icons/bi");break;case"pi":f=await import("react-icons/pi");break;case"vsc":f=await import("react-icons/vsc");break;case"tb":f=await import("react-icons/tb");break;case"tfi":f=await import("react-icons/tfi");break;case"cg":f=await import("react-icons/cg");break;case"lia":f=await import("react-icons/lia");break;case"lu":f=await import("react-icons/lu");break;default:throw new Error(`Unsupported library: ${l}`)}const d=f[r];if(!d)throw new Error(`Icon ${r} not found in library ${l}`);n(()=>d)}catch(l){console.warn(`Failed to load icon ${r}:`,l.message),s(!0),n(null)}finally{i(!1)}})()},[r]),a||!t?null:H.jsx(t,{...e})},uR=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:u}=Rn();return H.jsxs(Re.Tooltip.Root,{positioning:{placement:i.placement||"top"},children:[H.jsx(Re.Tooltip.Trigger,{asChild:!0,children:H.jsx(Re.Flex,{children:H.jsx(Re.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})}),H.jsx(Re.Tooltip.Positioner,{children:H.jsx(Re.Tooltip.Content,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||u,borderRadius:15,fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:e})})]})},yU=({data:r,children:e,isInverted:t,isParent:n})=>{var W,V;const{selectedNodeIds:a,setSelectedNodeIds:i,setSelectedEdgeId:o,isMultiSelectMode:s,isPerformanceMode:u,cyRef:l,callbacks:f,config:d,themeColor:h,direction:g}=en(),{background:p,border:x,colorText:b}=Rn(),w=xe.useRef(null),y=xe.useRef(null),[E,C]=xe.useState(!1),[S,R]=xe.useState(!1),_=r==null?void 0:r.id,A=a.includes(_),P=d.nodeOverlayActions,I=d.renderNodeOverlay,D=(()=>{var $;try{const X=($=l.current)==null?void 0:$.zoom();return X!==void 0&&X<.08}catch{return!1}})(),L=xe.useCallback(()=>{var $,X,ee,K;if(!S)if(o(null),($=l.current)==null||$.edges(":selected").unselect(),s){const j=a.includes(_),fe=j?a.filter(G=>G!==_):[...a,_];i(fe),j?(X=f.onNodeDeselect)==null||X.call(f):(ee=f.onNodeSelect)==null||ee.call(f,_,r)}else i([_]),(K=f.onNodeSelect)==null||K.call(f,_,r)},[_,r,a,s,S,i,o,l,f]),M=xe.useCallback(()=>{var $;S||($=f.onNodeDoubleClick)==null||$.call(f,_,r)},[_,r,S,f]),q=xe.useCallback(()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>C(!0),100)},[]),N=xe.useCallback(()=>{y.current&&clearTimeout(y.current),C(!1)},[]);return n?H.jsxs(Re.Box,{ref:w,onClick:L,onDoubleClick:M,onMouseEnter:q,onMouseLeave:N,cursor:"pointer",position:"relative",children:[!u&&(I||P&&P.length>0)&&E&&!D&&H.jsxs(H.Fragment,{children:[H.jsx(Re.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>C(!0),onMouseLeave:N}),I?H.jsx(Re.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>C(!0),onMouseLeave:N,willChange:"transform",children:I({nodeId:_,nodeData:r,isRoot:_==="root",isParent:!0,isHovered:E,setIsHovered:C})}):H.jsx(Re.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:p,p:3,borderColor:x,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>C(!0),onMouseLeave:N,willChange:"transform",children:H.jsx(Re.HStack,{px:2,gap:2,children:P.map(($,X)=>H.jsxs(Re.Box,{display:"contents",children:[X>0&&H.jsx(Re.Box,{borderColor:x,height:5,borderRightWidth:1}),H.jsx(uR,{icon:$.icon,label:$.label,color:b,bgColor:p,borderColor:x,textColor:b,boxSize:5,onClick:ee=>{var K;ee.stopPropagation(),(K=f.onNodeHoverAction)==null||K.call(f,$.id,_,r)}})]},$.id))})})]}),e({id:_,data:r,isActive:A,isLowZoom:D,isEditing:S,onEditStart:()=>R(!0),onEditEnd:()=>R(!1)}),((W=r==null?void 0:r.config)==null?void 0:W.collapsed)!==void 0&&(()=>{var ee;const $=g==="TB"||g==="BT",X=t||g==="RL";return H.jsx(Re.IconButton,{position:"absolute",...$?{[g==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:X?void 0:"-75px",left:X?"-75px":void 0,top:"50%",transform:"translateY(-50%)"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:K=>{var j;K.stopPropagation(),(j=f.onNodeCollapse)==null||j.call(f,_,!r.config.collapsed)},bgColor:zr(((ee=r==null?void 0:r.viewProps)==null?void 0:ee.bgColor)||h),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?H.jsx(rr.PiPlusBold,{size:30,color:"gray.800"}):H.jsx(rr.PiMinusBold,{size:30,color:"gray.800"})})})()]}):H.jsxs(Re.Box,{ref:w,onClick:L,onDoubleClick:M,onMouseEnter:q,onMouseLeave:N,cursor:"pointer",transition:"transform 0.1s ease",position:"relative",children:[!u&&(I||P&&P.length>0)&&E&&!D&&H.jsxs(H.Fragment,{children:[H.jsx(Re.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>C(!0),onMouseLeave:N}),I?H.jsx(Re.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",onMouseEnter:()=>C(!0),onMouseLeave:N,willChange:"transform",children:I({nodeId:_,nodeData:r,isRoot:_==="root",isParent:!!n,isHovered:E,setIsHovered:C})}):H.jsx(Re.Box,{position:"absolute",zIndex:1e3,top:"-100px",left:"50%",bg:p,p:3,borderColor:x,borderWidth:1,borderRadius:15,pointerEvents:"auto",transform:"translateX(-50%) scale3d(3, 3, 1)",boxShadow:"lg",onMouseEnter:()=>C(!0),onMouseLeave:N,willChange:"transform",children:H.jsx(Re.HStack,{px:2,gap:2,children:P.map(($,X)=>H.jsxs(Re.Box,{display:"contents",children:[X>0&&H.jsx(Re.Box,{borderColor:x,height:5,borderRightWidth:1}),H.jsx(uR,{icon:$.icon,label:$.label,color:b,bgColor:p,borderColor:x,textColor:b,boxSize:5,onClick:ee=>{var K;ee.stopPropagation(),(K=f.onNodeHoverAction)==null||K.call(f,$.id,_,r)}})]},$.id))})})]}),H.jsxs(Re.Box,{position:"relative",display:"flex",h:"100%",w:"100%",children:[((V=r==null?void 0:r.config)==null?void 0:V.collapsed)!==void 0&&!n&&(()=>{var ee;const $=g==="TB"||g==="BT",X=t||g==="RL";return H.jsx(Re.IconButton,{position:"absolute",...$?{[g==="BT"?"top":"bottom"]:"-75px",left:"50%",transform:"translateX(-50%)"}:{right:X?void 0:"-75px",left:X?"-75px":void 0,alignSelf:"center"},"aria-label":r.config.collapsed?"Expand":"Collapse",onClick:K=>{var j;K.stopPropagation(),(j=f.onNodeCollapse)==null||j.call(f,_,!r.config.collapsed)},bgColor:zr(((ee=r==null?void 0:r.viewProps)==null?void 0:ee.bgColor)||h),size:"md",color:"gray.100",rounded:"full",mr:2,px:2,py:4,children:r.config.collapsed?H.jsx(rr.PiPlusBold,{size:30,color:"gray.800"}):H.jsx(rr.PiMinusBold,{size:30,color:"gray.800"})})})(),e({id:_,data:r,isActive:A,isLowZoom:D,isEditing:S,onEditStart:()=>R(!0),onEditEnd:()=>R(!1)})]})]})},ef=xe.memo(yU);function CI(r=!0){const e=xe.useRef(null);return xe.useEffect(()=>{if(!r||!e.current)return;const t=i=>{i.stopPropagation()},n=e.current,a=["mousedown","mouseup","click","dblclick","pointerdown","pointerup","wheel"];return a.forEach(i=>n.addEventListener(i,t)),()=>{a.forEach(i=>n.removeEventListener(i,t))}},[r]),e}const _I=({nodeId:r,label:e,color:t,fontWeight:n="bold",fontSize:a="5xl",isEditing:i,onEditStart:o,onEditEnd:s})=>{const{callbacks:u,config:l,readOnly:f}=en(),d=l.editable&&!f,[h,g]=xe.useState(e),p=xe.useRef(null),x=xe.useRef(!1),b=CI(i);xe.useEffect(()=>{i&&(x.current=!1,p.current&&(p.current.focus(),p.current.select()))},[i]);const w=()=>{var E;if(x.current)return;x.current=!0;const y=h.trim();y&&y!==e&&((E=u.onNodeLabelChange)==null||E.call(u,r,y)),s()};return!d||!i?H.jsx(Re.Text,{color:t,fontWeight:n,fontSize:a,onDoubleClick:d?y=>{y.stopPropagation(),g(e),o()}:void 0,cursor:d?"text":void 0,children:e}):H.jsx("div",{ref:b,children:H.jsx(Re.Input,{ref:p,value:h,onChange:y=>g(y.target.value),onBlur:w,onKeyDown:y=>{y.key==="Enter"&&w(),y.key==="Escape"&&s()},color:t,fontWeight:n,fontSize:a,bg:"transparent",borderWidth:0,p:0,h:"auto",lineHeight:"normal"})})},mU=({id:r,data:e,isActive:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var d,h,g;const{themeColor:o}=en(),{bgColor:s,borderColor:u,textColor:l}=bs(((d=e==null?void 0:e.viewProps)==null?void 0:d.bgColor)||o),f=zr(((h=e==null?void 0:e.viewProps)==null?void 0:h.textColor)||l);return H.jsx(Re.Box,{borderRadius:(g=e==null?void 0:e.viewProps)==null?void 0:g.borderRadius,bgColor:s,borderColor:t?"white":u,_hover:{borderColor:"white"},borderWidth:2,py:14,px:20,whiteSpace:"normal",children:H.jsx(Re.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:H.jsx(_I,{nodeId:r,label:(e==null?void 0:e.label)||(e==null?void 0:e.text)||"",color:f,isEditing:n,onEditStart:a,onEditEnd:i})})})},bU=({id:r,isActive:e,data:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var p,x,b,w;const{themeColor:o}=en(),s=((p=t==null?void 0:t.viewProps)==null?void 0:p.bgColor)||o,{borderColor:u,highlightColor:l,textColor:f}=bs(s),d=zr(((x=t==null?void 0:t.viewProps)==null?void 0:x.textColor)||f),h=zr(((b=t==null?void 0:t.viewProps)==null?void 0:b.borderColor)||u),g=s!=null&&s.startsWith("#")?s:zr(l);return H.jsx(Re.Flex,{align:"center",borderRadius:(w=t==null?void 0:t.viewProps)==null?void 0:w.borderRadius,bgColor:g,style:{backgroundColor:g},textTransform:"capitalize",borderColor:e?"white":h,_hover:{borderColor:"white"},borderWidth:2,px:50,whiteSpace:"nowrap",children:H.jsx(Re.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:H.jsx(_I,{nodeId:r,label:(t==null?void 0:t.label)||(t==null?void 0:t.text)||"",color:d,isEditing:n,onEditStart:a,onEditEnd:i})})})},SI=(r,e)=>{var u,l,f;const t=((u=r==null?void 0:r.viewProps)==null?void 0:u.bgColor)||e,[n]=t.split("."),a=bs(t),i=t!=null&&t.startsWith("#")?zr(t):zr(a.bgColor),o=zr(((l=r==null?void 0:r.viewProps)==null?void 0:l.textColor)||a.textColor),s=zr(((f=r==null?void 0:r.viewProps)==null?void 0:f.borderColor)||a.borderColor);return{...a,bg:t,wordBeforeDot:n,hexbgColor:i,hextextColor:o,hexborderColor:s}},wU=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,TI=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,xU=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},RI=r=>H.jsx(ef,{...r,children:e=>H.jsx(mU,{...e})}),AI=r=>H.jsx(ef,{...r,children:e=>H.jsx(bU,{...e})}),PI=r=>{const{themeColor:e}=en(),[t,n]=xe.useState(!1);return H.jsx(ef,{...r,children:({data:a,isActive:i,isLowZoom:o})=>{var h,g,p,x,b,w,y,E;const s=SI(a,e),u=Object.entries(a.description||{}).length>0,l=xU(a.description),f=(g=(h=r.data)==null?void 0:h.config)==null?void 0:g.icon,d=(x=(p=r.data)==null?void 0:p.config)==null?void 0:x.content;return H.jsx(Re.Flex,{justifyContent:"space-between",...a==null?void 0:a.viewProps,direction:"column",p:0,borderRadius:(b=a==null?void 0:a.viewProps)==null?void 0:b.borderRadius,overflow:"hidden",alignItems:"center",style:{backgroundColor:s.hexbgColor,transition:"border-color 0.2s ease-in-out"},width:"100%",borderColor:i?"white":s.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:H.jsxs(Re.Flex,{width:"100%",direction:"column",borderRadius:(w=a==null?void 0:a.viewProps)==null?void 0:w.borderRadius,borderColor:s.hexborderColor,borderWidth:0,overflow:"hidden",children:[a.headerTitle&&H.jsxs(Re.Flex,{justify:"flex-start",direction:"row",p:Object.entries(a.description||{}).length?8:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:d?"left":"center",textOverflow:"ellipsis",alignItems:"center",fontWeight:"bold",color:s.propertyColor,bgColor:s.highlightColor,borderBottomColor:!u&&!d?"transparent":s.hexborderColor,children:[!!f&&H.jsx(Re.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:H.jsx(L0,{name:f,size:80,color:s.hextextColor},s.hextextColor)}),H.jsx(Re.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(y=a==null?void 0:a.viewProps)==null?void 0:y.textColor,children:TI(a.headerTitle)}),!!d&&H.jsx(Re.Box,{ml:10,onClick:()=>n(!t),children:t?H.jsx(rr.PiGear,{size:30,style:{cursor:"pointer"}}):H.jsx(rr.PiNotepad,{size:30,style:{cursor:"pointer"}})})]}),d&&!t?H.jsx(Re.Flex,{w:"100%",overflow:"auto",justifyContent:"start",background:s.highlightColor,p:10,fontSize:"5xl",lineHeight:"normal",cursor:"text",children:H.jsx(Re.Text,{whiteSpace:"pre-wrap",overflow:"hidden",textOverflow:"ellipsis",color:(E=a==null?void 0:a.viewProps)==null?void 0:E.textColor,children:d})}):H.jsx(Re.Box,{children:Object.entries(a.description||{}).map(([C,S],R)=>{var P,I;const _=kn(s.wordBeforeDot)[typeof S],A=kn(s.wordBeforeDot).property;return H.jsxs(Re.Box,{children:[H.jsxs(Re.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[H.jsx(Re.Flex,{justifyContent:"start",align:"center",background:s.highlightColor,width:`${l}px`,minWidth:`${l}px`,borderRightColor:s.hexborderColor,borderRightWidth:1,children:H.jsx(Re.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",color:((P=a==null?void 0:a.viewProps)==null?void 0:P.textColor)||A,children:C})}),H.jsx(Re.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:s.hexbgColor,w:600,maxH:200,children:H.jsx(Re.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",color:((I=a==null?void 0:a.viewProps)==null?void 0:I.textColor)||_,fontWeight:400,children:wU(S)})})]}),R!==Object.entries(a.description||{}).length-1&&H.jsx(Re.Box,{borderTopWidth:1,my:0,borderColor:s.hexborderColor})]},R)})})]})})}})},II=r=>{const{themeColor:e}=en();return H.jsx(ef,{...r,children:({data:t,isActive:n})=>{var o,s,u,l;const a=SI(t,e),i=(s=(o=r.data)==null?void 0:o.config)==null?void 0:s.icon;return H.jsx(Re.Flex,{justifyContent:"space-between",...t==null?void 0:t.viewProps,direction:"column",p:0,borderRadius:((u=t==null?void 0:t.viewProps)==null?void 0:u.borderRadius)||15,overflow:"hidden",bgColor:a.bgColor,position:"absolute",top:0,left:0,right:0,bottom:0,alignItems:"center",style:{backgroundColor:a.hexbgColor,transition:"border-color 0.2s ease-in-out"},borderColor:n?"white":a.hexborderColor,_hover:{borderColor:"white"},borderWidth:3,children:t.headerTitle&&H.jsxs(Re.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",color:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:[!!i&&H.jsx(Re.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:H.jsx(L0,{name:i,size:80,color:a.hextextColor},a.hextextColor)}),H.jsx(Re.Text,{fontSize:"5xl",lineClamp:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(l=t==null?void 0:t.viewProps)==null?void 0:l.textColor,children:TI(t.headerTitle)})]})})}})};RI.displayName="text";AI.displayName="arrayView";PI.displayName="NodeJsonObjectView";II.displayName="ParentContainerView";const EU={objectView:PI,arrayView:AI,text:RI,parentContainer:II},CU=({children:r,pattern:e="dot",backgroundColor:t})=>{const{colorMode:n}=en(),a=n==="dark",i=a?"--chakra-colors-gray-700":"--chakra-colors-gray-500",o=a?"--chakra-colors-gray-700":"--chakra-colors-gray-800";return e==="none"?H.jsx(Re.Box,{width:"100%",height:"100%",padding:0,bg:t,children:r}):H.jsxs(Re.Box,{position:"relative",width:"100%",height:"100%",padding:0,bg:t,children:[H.jsx(Re.Box,{position:"absolute",top:0,left:0,right:0,bottom:0,width:"100%",height:"100%",zIndex:0,pointerEvents:"none",style:{backgroundImage:e==="dot"?`radial-gradient(var(${i}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${o}) 0, var(${o}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${o}) 1px, transparent 1px), linear-gradient(90deg, var(${o}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),H.jsx(Re.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})},_U=({nodes:r,edges:e})=>{const{themeColor:t,edgeColor:n,direction:a,parentNodeStyle:i,cyRef:o,callbacks:s,config:u,selectedNodeIds:l,setSelectedNodeIds:f,setSelectedEdgeId:d,setIsPerformanceMode:h,isZoomMode:g,setIsZoomMode:p,isMultiSelectMode:x,setIsMultiSelectMode:b,isDragMode:w,setIsDragMode:y,isEdgeHandlesEnabled:E,isArrayNodeMode:C}=en(),S=xe.useRef(null),R=xe.useRef(null),_=xe.useRef(C),A=r.length>200;xe.useEffect(()=>{h(A)},[A,h]);const{edgeSep:P,rankSep:I}=xe.useMemo(()=>aN(r.length),[r.length]),{bgColor:D}=bs(t),{canvas:L,borderSecondary:M}=Rn(),q=u.backgroundColor||L,N=xe.useCallback(re=>{if(re!=null&&re.includes("gray"))return"whitesmoke";if(!re)return zr(t);switch(re){case"dark":return zr(q);case"light":return zr(M);default:return zr(re)}},[t,q,M]),W=u.colorMode==="dark",V=xe.useMemo(()=>N(W?D:"light"),[W,D,N]),$=n?N(n):V,X=xe.useMemo(()=>hU(N),[N]),ee=u.initialViewport||{pan:{x:0,y:0},zoom:.01},K=xe.useMemo(()=>({...A?gU:r.length>100?EI:xI,style:X,zoom:ee.zoom,pan:ee.pan,minZoom:u.minZoom??.01,maxZoom:u.maxZoom??1.5}),[X,ee,r.length,u.minZoom,u.maxZoom]),j=xe.useRef(!1),fe=xe.useRef();xe.useEffect(()=>()=>{clearTimeout(fe.current)},[]);const G=a==="C"?"LR":a,z=xe.useMemo(()=>({...pU,...G&&{rankDir:G},edgeSep:P,rankSep:I,get animate(){return j.current&&!A},animationDuration:300,animationEasing:"ease-in-out-cubic",stop:()=>{o.current&&(j.current||setTimeout(()=>{var re;(re=o.current)==null||re.fit(void 0,50)},100),clearTimeout(fe.current),fe.current=setTimeout(()=>{j.current=!0},500))}}),[G,P,I,o,A]),Y=xe.useCallback(re=>{const ce={...i,...re};return{...ce,bgColor:ce.bgColor||t,bgOpacity:ce.bgOpacity??wI}},[i,t]),te=xe.useCallback(re=>{const ce=Y(re),_e=zr(ce.bgColor),me={shape:"round-rectangle","background-color":_e,"background-opacity":ce.bgOpacity,"border-color":ce.borderColor?zr(ce.borderColor):_e,color:ce.textColor?zr(ce.textColor):_e,"corner-radius":ce.borderRadius??50};return ce.borderWidth!==void 0&&(me["border-width"]=ce.borderWidth),ce.borderStyle&&(me["border-style"]=ce.borderStyle),ce.fontSize!==void 0&&(me["font-size"]=`${ce.fontSize}px`),ce.padding!==void 0&&(me.padding=`${ce.padding}px`),ce.labelPosition&&(me["text-valign"]=ce.labelPosition,me["text-margin-y"]=ce.labelPosition==="top"?90:ce.labelPosition==="bottom"?-90:0),me},[Y]),ue=xe.useMemo(()=>{var ce;const re=new Map;for(const _e of r)(ce=_e.data)!=null&&ce.id&&re.set(_e.data.id,_e);return re},[r]),oe=xe.useMemo(()=>{var _e,me;const re=new Map;for(const Te of e){const De=(_e=Te.data)==null?void 0:_e.source,Ne=(me=Te.data)==null?void 0:me.target;if(!De||!Ne||De===Ne)continue;const ze=De<Ne?`${De}|${Ne}`:`${Ne}|${De}`,$e=re.get(ze);$e?$e.push({id:Te.data.id,source:De}):re.set(ze,[{id:Te.data.id,source:De}])}const ce=new Map;for(const[Te,De]of re){if(De.length<2)continue;const Ne=Te.split("|")[0],ze=Math.min(20,70/De.length);De.forEach(({id:$e,source:ke},Oe)=>{const ye=50+(Oe-(De.length-1)/2)*ze;ce.set($e,`${ke===Ne?ye:100-ye}%`)})}return ce},[e]),Z=xe.useCallback((re,ce,_e,me)=>{var ke,Oe,ye,O,ne,he;let Te={};me!=null&&me.isInverted&&(me==null?void 0:me.source)===ce&&(Te["target-arrow-shape"]="none",Te["source-arrow-shape"]="triangle"),me!=null&&me.isEdgeAnimated?(Te["line-style"]="dashed",Te["line-dash-pattern"]=[32,18],Te["line-dash-offset"]=0):me!=null&&me.isEdgeDashed?(Te["line-style"]="dashed",Te["line-dash-pattern"]=[],Te["line-dash-offset"]=0):(Te["line-style"]="solid",Te["line-dash-pattern"]=[],Te["line-dash-offset"]=0),G==="TB"&&(Te["taxi-direction"]="downward"),G==="BT"&&(Te["taxi-direction"]="upward"),G==="LR"&&(Te["taxi-direction"]="rightward"),G==="RL"&&(Te["taxi-direction"]="leftward"),Te["taxi-turn"]=oe.get(me==null?void 0:me.id)??"50%";const De=me!=null&&me.color?zr(me.color):$;Te["line-color"]=De,Te.color=De,Te["target-arrow-color"]=De,Te["source-arrow-color"]=De;const Ne=N("dark");Te["text-background-color"]=Ne;const ze=(Oe=(ke=ue.get(me==null?void 0:me.source))==null?void 0:ke.data)==null?void 0:Oe.parent,$e=(O=(ye=ue.get(me==null?void 0:me.target))==null?void 0:ye.data)==null?void 0:O.parent;if(ze&&ze===$e){const ge=Y((he=(ne=ue.get(ze))==null?void 0:ne.data)==null?void 0:he.viewProps),be=Zq(Ne,zr(ge.bgColor),ge.bgOpacity);be&&(Te["text-background-color"]=be)}return Te},[$,G,oe,ue,Y,N]),Q=xe.useRef(ue);Q.current=ue;const ie=xe.useRef(te);ie.current=te,xe.useEffect(()=>{if(!o.current)return;const re=o.current,ce=Te=>{var Ne;const De=Q.current.get(Te.id());Te.style(ie.current((Ne=De==null?void 0:De.data)==null?void 0:Ne.viewProps))},_e=Te=>{const De=Te.target;if(!De.isNode())return;De.isParent()&&ce(De);const Ne=De.parent();Ne.length&&ce(Ne)},me=Te=>{const De=Te.target;De.isNode()&&De.isParent()&&De.style("shape")==="rectangle"&&ce(De)};return re.on("add",_e),re.on("style","node",me),()=>{re.off("add",_e),re.off("style","node",me)}},[]),xe.useEffect(()=>{if(!o.current)return;const re=o.current;re.startBatch(),re.nodes(":parent").forEach(ce=>{var me;const _e=ue.get(ce.id());ce.style(te((me=_e==null?void 0:_e.data)==null?void 0:me.viewProps))}),e.forEach(({data:ce})=>{const _e=re.getElementById(ce.id);_e!=null&&_e.length&&(_e.data({isEdgeAnimated:ce.isEdgeAnimated,isEdgeDashed:ce.isEdgeDashed}),_e.style(Z(_e,ce.source,ce.target,ce)))}),re.endBatch()},[ue,e,$,te,Z]);const de=xe.useRef(u);de.current=u;const we=xe.useRef(g);we.current=g;const Ae=xe.useRef(E);Ae.current=E,_.current=C,xe.useEffect(()=>{if(!o.current||!o.current.container)return;const re=o.current,ce=S.current;if(!ce)return;let _e=null,me=null,Te=0,De=0,Ne=0,ze=0,$e=0;const ke=Oe=>{Oe.preventDefault(),Oe.stopPropagation(),we.current||Oe.metaKey||Oe.ctrlKey?(Ne+=Oe.deltaY,ze=Oe.clientX,$e=Oe.clientY,me===null&&(me=requestAnimationFrame(()=>{me=null;const O=de.current,ne=re.zoom(),he=Ne;Ne=0;let ge=ne-he*.05/100;ge=Math.max(O.minZoom??.01,Math.min(O.maxZoom??1.5,ge));const be=ce.getBoundingClientRect();re.zoom({level:ge,renderedPosition:{x:ze-be.left,y:$e-be.top}})}))):(Te+=Oe.deltaX,De+=Oe.deltaY,_e===null&&(_e=requestAnimationFrame(()=>{_e=null;const O=re.pan(),ne=re.zoom(),he=.35,ge=Te,be=De;Te=0,De=0,re.pan({x:O.x+-ge*he/ne,y:O.y+-be*he/ne})})))};return ce.addEventListener("wheel",ke,{passive:!1}),()=>{ce.removeEventListener("wheel",ke),_e!==null&&cancelAnimationFrame(_e),me!==null&&cancelAnimationFrame(me)}},[o.current]),xe.useEffect(()=>{o.current&&o.current.userPanningEnabled(w)},[w]),xe.useEffect(()=>{if(!o.current)return;const re=o.current;re.boxSelectionEnabled(!!x),re.selectionType(x?"additive":"single"),re.userPanningEnabled(!x&&w)},[x,w]),xe.useEffect(()=>{R.current&&(E?R.current.enableDrawMode():R.current.disableDrawMode())},[E]);const ve=xe.useRef(l);ve.current=l,xe.useEffect(()=>{if(u.disableKeyboardShortcuts)return;const re=ce=>{var me,Te;const _e=ce.target;if(!(_e.tagName==="INPUT"||_e.tagName==="TEXTAREA"||_e.isContentEditable)&&((ce.key==="z"||ce.key==="Z")&&p(!we.current),(ce.key==="m"||ce.key==="M")&&b(!x),(ce.key==="d"||ce.key==="D")&&y(!w),(ce.key==="Delete"||ce.key==="Backspace")&&ve.current.length>0)){ce.preventDefault();const De=ve.current.filter(ze=>ze!=="root");if(De.length===0)return;const Ne=o.current;for(const ze of De){const $e=(me=Ne==null?void 0:Ne.getElementById(ze))==null?void 0:me.data();(Te=s.onNodeDelete)==null||Te.call(s,ze,$e||{})}f([])}};return window.addEventListener("keydown",re),()=>window.removeEventListener("keydown",re)},[x,w,p,b,y,u.disableKeyboardShortcuts,s,f,o]),xe.useEffect(()=>()=>{if(o.current)try{o.current.removeAllListeners()}catch{}},[]);const le=xe.useMemo(()=>A?300:r.length>50?150:r.length>20?100:50,[r.length,A]),Me=xe.useMemo(()=>{var ce;const re=new Set;for(const _e of r)(ce=_e.data)!=null&&ce.parent&&re.add(_e.data.parent);return re},[r]),Se=xe.useMemo(()=>{var ce;const re=new Map;for(const _e of e)(ce=_e.data)!=null&&ce.source&&!re.has(_e.data.source)&&re.set(_e.data.source,_e.data);return re},[e]),Ee=u.backgroundPattern||"dot";return H.jsx(CU,{pattern:Ee,backgroundColor:q,children:H.jsx(Re.Box,{ref:S,className:E?"flow-draw-mode":void 0,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:H.jsxs(dU,{cyParams:K,layoutParams:z,layoutDebounce:le,onCyInit:re=>{var _e;o.current=re,(_e=s.onCyInit)==null||_e.call(s,re);let ce=null;if(re.on("zoom pan",()=>{ce===null&&(ce=requestAnimationFrame(()=>{var me;ce=null,(me=s.onViewportChange)==null||me.call(s,{zoom:re.zoom(),pan:re.pan()})}))}),re.on("select","edge",me=>{var De;const Te=me.target;ve.current.length&&f([]),d(Te.id()),(De=s.onEdgeSelect)==null||De.call(s,Te.id(),Te.data())}),re.on("unselect","edge",()=>{var me;d(null),(me=s.onEdgeDeselect)==null||me.call(s)}),re.on("remove","edge",me=>{var De;const Te=me.target;(De=s.onEdgeRemove)==null||De.call(s,Te.id(),Te.data())}),re.on("boxselect","node",me=>{var Ne;const Te=me.target.id(),De=ve.current;De.includes(Te)||(f([...De,Te]),(Ne=s.onNodeSelect)==null||Ne.call(s,Te,me.target.data()))}),re.on("tap",me=>{var Te;me.target===re&&ve.current.length&&(f([]),(Te=s.onNodeDeselect)==null||Te.call(s))}),re.on("tap",":parent",me=>{var De;const Te=me.target;f([Te.id()]),(De=s.onNodeSelect)==null||De.call(s,Te.id(),Te.data())}),u.edgeHandles!==!1){const me={canConnect:(ze,$e)=>!ze.same($e),edgeParams:(ze,$e)=>({data:{source:ze.id(),target:$e.id(),label:""}}),loopAllowed:()=>!1,hoverDelay:500,snap:!1,snapThreshold:10,snapFrequency:5,noEdgeEventsInDraw:!0,disableBrowserGestures:!0,handlePosition:"left",handleNodes:"node",handleSize:20,handleColor:t||"#0ea5e9",handleOutlineColor:"#B92020FF",handleOutlineWidth:2,handleLineType:"ghost",handleLineWidth:2,preview:!0,ghostEdgeParams:()=>({}),edgeType:()=>"flat",nodeParams:()=>({})},Te=re.edgehandles(me);R.current=Te,Ae.current&&Te.enableDrawMode();let De=null,Ne=null;re.on("ehstart",(ze,$e)=>{Ne=$e;const ke=ze.originalEvent||window.event;if(ke!=null&&ke.clientX&&(ke!=null&&ke.clientY))De={x:ke.clientX,y:ke.clientY};else{const Oe=$e.renderedPosition();De={x:Oe.x,y:Oe.y}}}),re.on("ehcancel",ze=>{if(!De||!Ne)return;const $e=ze.originalEvent||window.event,ke=$e==null?void 0:$e.clientX,Oe=$e==null?void 0:$e.clientY;if(ke&&Oe&&s.onNodeCreate){const ye=Math.abs(ke-De.x),O=Math.abs(Oe-De.y);if(Math.max(ye,O)>30){const ne=re.renderer().projectIntoViewport(ke,Oe);s.onNodeCreate({type:"text",sourceNodeId:Ne.id(),position:{x:ne[0],y:ne[1]},isArrayMode:_.current})}}De=null,Ne=null}),re.on("ehcomplete",(ze,$e,ke)=>{var Oe;(Oe=s.onEdgeCreate)==null||Oe.call(s,$e.id(),ke.id())}),re.on("ehstop",()=>{De=null,Ne=null})}},children:[(r||[]).map(re=>{var Ne,ze,$e,ke,Oe,ye,O,ne,he,ge;const ce=u.customViews||EU,_e=Me.has((Ne=re.data)==null?void 0:Ne.id)&&!((ze=re.data)!=null&&ze.parent),me=_e?(($e=re.data)==null?void 0:$e.label)||((ke=re.data)==null?void 0:ke.headerTitle)||"Container":void 0,Te=_e?ce.parentContainer:ce[re==null?void 0:re.data.type]||ce.text,De=Se.get((Oe=re.data)==null?void 0:Oe.id);return H.jsx(vU,{id:(ye=re.data)==null?void 0:ye.id,parent:(O=re.data)==null?void 0:O.parent,label:me,styleCallback:te,parentViewProps:(ne=re.data)==null?void 0:ne.viewProps,children:xe.createElement(Te,{...re,isInverted:De==null?void 0:De.isInverted,isParent:_e,key:`${(he=re.data)==null?void 0:he.id}-${t}`})},(ge=re.data)==null?void 0:ge.id)}),(e||[]).map(({data:re})=>H.jsx(sN,{id:re==null?void 0:re.id,source:re==null?void 0:re.source,target:re==null?void 0:re.target,label:re==null?void 0:re.label,isPerformanceMode:A,animated:!!(re!=null&&re.isEdgeAnimated),inverted:!!(re!=null&&re.isInverted),edgeData:re,styleCallback:Z},re==null?void 0:re.id))]})})})},SU=xe.memo(_U),TU=".cytoscape-react-nodes-and-edges{position:absolute!important;top:0!important;left:0!important;z-index:10!important;pointer-events:none!important;overflow:visible!important;transform-origin:0 0!important}.cytoscape-react-node{z-index:0!important;overflow:visible!important;pointer-events:auto!important;position:absolute!important;transform-origin:0 0!important}.cytoscape-react-node input,.cytoscape-react-node textarea{pointer-events:auto!important;user-select:text!important;cursor:text!important}.cytoscape-react-edge{overflow:visible!important;pointer-events:none!important}.cytoscape-react-cy-container{width:100%!important;height:100%!important;overflow:visible!important;position:relative!important;background:transparent!important}.cytoscape-react-cy-container canvas{display:inline!important;vertical-align:baseline!important;overflow:visible!important}.cytoscape-react-cy-container>div{overflow:visible!important}.flow-draw-mode .cytoscape-react-node{pointer-events:none!important}.flow-draw-mode .cytoscape-react-node input,.flow-draw-mode .cytoscape-react-node textarea{pointer-events:none!important}.flow-draw-mode .cytoscape-react-cy-container{cursor:crosshair}";let lR=!1;function RU(){if(lR||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=TU,document.head.appendChild(r),lR=!0}function AU({title:r="untitled",json:e,nodes:t,edges:n,config:a={},callbacks:i={},className:o,style:s,showBottomBar:u=!0}){RU();const l=a.direction==="C",f=xe.useMemo(()=>e?bR(e,{title:r,isCenter:l}):null,[e,r,l]),d=(f==null?void 0:f.nodes)??t??[],h=(f==null?void 0:f.edges)??n??[],g=xe.useMemo(()=>e&&f?wR(e,f.edges,i,i.onJsonChange):i,[e,f,i]);return H.jsx(Xq,{config:a,callbacks:g,nodes:d,edges:h,children:H.jsxs(Re.Box,{className:o,style:s,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:[H.jsx(SU,{nodes:d,edges:h}),u&&H.jsx(nN,{})]})})}exports.DynamicIcon=L0;exports.FlowDiagram=AU;exports.addChild=gR;exports.addTargetEdge=yR;exports.addressToPath=fi;exports.applyCollapsed=jq;exports.bindSqueedCallbacks=wR;exports.compileSqueed=bR;exports.contentObjTheme=kn;exports.createFlowDiagram=li;exports.getChakraColorHex=zr;exports.getColorVariant=CR;exports.getDarkerHexColor=Ju;exports.getNode=mm;exports.removeEdge=mR;exports.removeNode=pR;exports.resolveEdgeOwner=ml;exports.setCollapsed=vR;exports.setEdgeProp=us;exports.setEdgeStyle=hR;exports.setNodeProp=no;exports.updateNode=pi;exports.useCustomColors=Rn;exports.useStopPropagation=CI;exports.useThemeContentColors=bs;
|
|
358
358
|
//# sourceMappingURL=index.cjs.map
|