@squeed/flow-sdk 0.1.8 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +43 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6000 -6007
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
package/dist/index.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
"use strict";var ZO=Object.create;var O1=Object.defineProperty;var XO=Object.getOwnPropertyDescriptor;var QO=Object.getOwnPropertyNames;var JO=Object.getPrototypeOf,eq=Object.prototype.hasOwnProperty;var rq=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of QO(e))!eq.call(r,a)&&a!==t&&O1(r,a,{get:()=>e[a],enumerable:!(n=XO(e,a))||n.enumerable});return r};var Rr=(r,e,t)=>(t=r!=null?ZO(JO(r)):{},rq(e||!r||!r.__esModule?O1(t,"default",{value:r,enumerable:!0}):t,r));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ue=require("react/jsx-runtime"),ye=require("@chakra-ui/react"),Re=require("react"),Ir=require("react-icons/pi"),tq=require("react-icons/hi2"),nq=require("react-icons/gr"),gu=require("react-icons/vsc"),aq=require("react-icons/tb"),q1=require("react-icons/io5"),U2=Re.createContext(null);function Ia(){const r=Re.useContext(U2);if(!r)throw new Error("useFlowDiagramContext must be used within FlowDiagram");return r}function iq({config:r,callbacks:e,children:t}){const n=Re.useRef(null),[a,i]=Re.useState([]),[o,s]=Re.useState(null),[l,u]=Re.useState(!0),[c,d]=Re.useState(!1),[h,g]=Re.useState(!0),[p,E]=Re.useState(r.edgeHandles===!0),[m,b]=Re.useState(!1),[w,x]=Re.useState(!0),[C,T]=Re.useState(!1),S=Re.useRef(e);S.current=e;const _=Re.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",k=r.readOnly??!1,M=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=Re.useRef(r);q.current=r;const $=Re.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=Re.useMemo(()=>({themeColor:A,edgeColor:P,colorMode:D,direction:I,selectedNodeIds:a,setSelectedNodeIds:i,selectedEdgeId:o,setSelectedEdgeId:s,isZoomMode:M,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:k}),[A,P,D,I,a,o,M,N,W,z,m,w,C,k,_,$]);return ue.jsx(U2.Provider,{value:X,children:t})}const oq=({children:r,pattern:e="dot",backgroundColor:t})=>{const n=ye.useColorModeValue("--chakra-colors-gray-500","--chakra-colors-gray-700"),a=ye.useColorModeValue("--chakra-colors-gray-800","--chakra-colors-gray-700");return e==="none"?ue.jsx(ye.Box,{width:"100%",height:"100%",padding:0,bg:t,children:r}):ue.jsxs(ye.Box,{position:"relative",width:"100%",height:"100%",padding:0,bg:t,children:[ue.jsx(ye.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(${n}) 8%, transparent 8%)`:e==="steel"?`repeating-linear-gradient(45deg, var(${a}) 0, var(${a}) 1px, transparent 1px, transparent 20px)`:`linear-gradient(var(${a}) 1px, transparent 1px), linear-gradient(90deg, var(${a}) 1px, transparent 1px)`,backgroundSize:"20px 20px",opacity:.3}}),ue.jsx(ye.Box,{position:"relative",width:"100%",height:"100%",zIndex:1,padding:0,children:r})]})};function Gu(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 Dn=r=>r!=null&&r.startsWith("#")?{background:r,highlight:Gu(r,.1),border:Gu(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"},H2=r=>{let e=r;if(e!=null&&e.startsWith("#"))return{secondary:Gu(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}},N1={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=N1[n])!=null&&i[Number(a)])?N1[n][Number(a)]:`var(--chakra-colors-${t})`};function us(r){const[e]=(r==null?void 0:r.split("."))||[],{secondary:t}=H2(r),n=Dn(e).background,a=Dn(e).highlight,i=Dn(e).border,o=Dn(e).property,s=Dn(e).property;let l=Dn(e).background,u=Dn(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 ls(r=null){const e=r==null?void 0:r.includes("gray"),t=ye.useColorModeValue("gray.100","gray.900"),n=ye.useColorModeValue("gray.200","blackAlpha.400"),a=ye.useColorModeValue("gray.200","blackAlpha.600"),i=ye.useColorModeValue("gray.500","gray.800"),o=ye.useColorModeValue("gray.700","gray.700"),s=ye.useColorModeValue("gray.900","gray.900"),l=ye.useColorModeValue("gray.400","gray.500"),u=ye.useColorModeValue("gray.400","gray.700"),c=ye.useColorModeValue("gray.900","gray.200"),d=ye.useColorModeValue(e?"gray.900":"gray.200",e?"gray.200":"gray.900"),h=ye.useColorModeValue("gray.900","gray.200"),g=ye.useColorModeValue(r&&"#000000",r||"#ffffff"),p=ye.useColorModeValue(r||"#ffffff",r?"#000000":"#ffffff"),E=o,m=ye.useColorModeValue("gray.300","gray.800"),b=ye.useColorModeValue("white","blackAlpha.400"),w=ye.useColorModeValue("green.100","green.700");return{background:t,backgroundSecondary:n,darkBackgroundSecondary:a,border:i,darkColor:s,backgroundWhiteColor:b,borderSecondary:o,colorActive:l,colorInactive:u,iconColor:h,moreIconColor:E,colorText:c,themedColorText:d,logoColor:g,logoColorSecondary:p,darkColorActive:m,greenColor:w}}const F1=({icon:r,label:e,onClick:t,color:n,boxSize:a=6,...i})=>{const{background:o,border:s,colorText:l}=ls();return ue.jsx(ye.Tooltip,{bgColor:i.bgColor||o,borderColor:i.borderColor||s,borderWidth:1,color:i.textColor||l,label:e,borderRadius:15,placement:i.placement||"top",fontWeight:300,fontSize:"sm",p:2,px:4,shadow:"none",children:ue.jsx(ye.Flex,{children:ue.jsx(ye.Icon,{as:r,boxSize:a,color:n,cursor:t?"pointer":void 0,onClick:t})})})},sq=({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}=Ia(),{background:g,border:p,colorText:E}=ls(),m=Re.useRef(null),b=Re.useRef(null),[w,x]=Re.useState(!1),[C,T]=Re.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=Re.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]),k=Re.useCallback(()=>{var q;C||(q=u.onNodeDoubleClick)==null||q.call(u,S,r)},[S,r,C,u]),M=Re.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>x(!0),100)},[]),N=Re.useCallback(()=>{b.current&&clearTimeout(b.current),x(!1)},[]);return n?ue.jsxs(ye.Box,{ref:m,onClick:I,onDoubleClick:k,onMouseEnter:M,onMouseLeave:N,cursor:"pointer",position:"relative",children:[!s&&(P||A&&A.length>0)&&w&&!D&&ue.jsxs(ue.Fragment,{children:[ue.jsx(ye.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(ye.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(ye.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(ye.HStack,{px:2,spacing:2,children:A.map((q,$)=>ue.jsxs(ye.Box,{display:"contents",children:[$>0&&ue.jsx(ye.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(F1,{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(ye.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",icon:r.config.collapsed?ue.jsx(Ir.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Ir.PiMinusBold,{size:30,color:"gray.800"}),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})})()]}):ue.jsxs(ye.Box,{ref:m,onClick:I,onDoubleClick:k,onMouseEnter:M,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(ye.Box,{position:"absolute",top:-150,left:"0",right:"0",height:"150px",pointerEvents:"auto",onMouseEnter:()=>x(!0),onMouseLeave:N}),P?ue.jsx(ye.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(ye.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(ye.HStack,{px:2,spacing:2,children:A.map((q,$)=>ue.jsxs(ye.Box,{display:"contents",children:[$>0&&ue.jsx(ye.Box,{borderColor:p,height:5,borderRightWidth:1}),ue.jsx(F1,{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(ye.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(ye.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",icon:r.config.collapsed?ue.jsx(Ir.PiPlusBold,{size:30,color:"gray.800"}):ue.jsx(Ir.PiMinusBold,{size:30,color:"gray.800"}),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})})(),e({id:S,data:r,isActive:_,isLowZoom:D,isEditing:C,onEditStart:()=>T(!0),onEditEnd:()=>T(!1)})]})]})},ol=Re.memo(sq);function K2(r=!0){const e=Re.useRef(null);return Re.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 j2=({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}=Ia(),d=u.editable&&!c,[h,g]=Re.useState(e),p=Re.useRef(null),E=Re.useRef(!1),m=K2(i);Re.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(ye.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(ye.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,variant:"unstyled",p:0,h:"auto",lineHeight:"normal"})})},uq=({id:r,data:e,isActive:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var d,h,g;const{themeColor:o}=Ia(),{bgColor:s,borderColor:l,textColor:u}=us(((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(ye.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(ye.Flex,{justifyContent:"start",w:900,fontSize:"5xl",lineHeight:"normal",children:ue.jsx(j2,{nodeId:r,label:(e==null?void 0:e.label)||(e==null?void 0:e.text)||"",color:c,isEditing:n,onEditStart:a,onEditEnd:i})})})},lq=({id:r,isActive:e,data:t,isEditing:n,onEditStart:a,onEditEnd:i})=>{var p,E,m,b;const{themeColor:o}=Ia(),s=((p=t==null?void 0:t.viewProps)==null?void 0:p.bgColor)||o,{borderColor:l,highlightColor:u,textColor:c}=us(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(ye.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(ye.Flex,{justifyContent:"start",py:14,fontSize:"5xl",lineHeight:"normal",w:900,children:ue.jsx(j2,{nodeId:r,label:(t==null?void 0:t.label)||(t==null?void 0:t.text)||"",color:d,isEditing:n,onEditStart:a,onEditEnd:i})})})},Tm=({name:r,...e})=>{const[t,n]=Re.useState(null),[a,i]=Re.useState(!0),[o,s]=Re.useState(!1);return Re.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})},Y2=(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=us(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}},fq=(r,e=350)=>`${String(r).substring(0,e)}${String(r).length>e?"...":""}`,Z2=r=>r!=null&&r.includes("root")?r.replace("root","untitled"):r,cq=r=>{const e=Math.max(...Object.keys(r||{}).map(n=>n.length),0);return Math.max(e*28+30,200)},X2=r=>ue.jsx(ol,{...r,children:e=>ue.jsx(uq,{...e})}),Q2=r=>ue.jsx(ol,{...r,children:e=>ue.jsx(lq,{...e})}),J2=r=>{const{themeColor:e}=Ia(),[t,n]=Re.useState(!1);return ue.jsx(ol,{...r,children:({data:a,isActive:i,isLowZoom:o})=>{var h,g,p,E,m,b,w,x;const s=Y2(a,e),l=Object.entries(a.description||{}).length>0,u=cq(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(ye.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(ye.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(ye.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",textColor:s.propertyColor,bgColor:s.highlightColor,borderBottomColor:!l&&!d?"transparent":s.hexborderColor,children:[!!c&&ue.jsx(ye.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Tm,{name:c,size:80,color:s.hextextColor},s.hextextColor)}),ue.jsx(ye.Text,{fontSize:"5xl",noOfLines:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(w=a==null?void 0:a.viewProps)==null?void 0:w.textColor,children:Z2(a.headerTitle)}),!!d&&ue.jsx(ye.Box,{ml:10,onClick:()=>n(!t),children:t?ue.jsx(Ir.PiGear,{size:30,style:{cursor:"pointer"}}):ue.jsx(Ir.PiNotepad,{size:30,style:{cursor:"pointer"}})})]}),d&&!t?ue.jsx(ye.Flex,{w:"100%",overflow:"auto",justifyContent:"start",background:s.highlightColor,p:10,fontSize:"5xl",lineHeight:"normal",cursor:"text",children:ue.jsx(ye.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(ye.Box,{children:Object.entries(a.description||{}).map(([C,T],S)=>{var P,D;const _=Dn(s.wordBeforeDot)[typeof T],A=Dn(s.wordBeforeDot).property;return ue.jsxs(ye.Box,{children:[ue.jsxs(ye.Flex,{flexWrap:"nowrap",overflow:"hidden",children:[ue.jsx(ye.Flex,{justifyContent:"start",align:"center",background:s.highlightColor,width:`${u}px`,minWidth:`${u}px`,borderRightColor:s.hexborderColor,borderRightWidth:1,children:ue.jsx(ye.Text,{py:5,px:10,w:"100%",whiteSpace:"nowrap",fontWeight:"bold",fontSize:"4xl",textColor:((P=a==null?void 0:a.viewProps)==null?void 0:P.textColor)||A,children:C})}),ue.jsx(ye.Flex,{flex:1,justifyContent:"start",overflow:"hidden",p:4,background:s.hexbgColor,w:600,maxH:200,children:ue.jsx(ye.Text,{overflow:"hidden",py:3,px:4,whiteSpace:"normal",textOverflow:"ellipsis",fontSize:"4xl",textColor:((D=a==null?void 0:a.viewProps)==null?void 0:D.textColor)||_,fontWeight:400,children:fq(T)})})]}),S!==Object.entries(a.description||{}).length-1&&ue.jsx(ye.Divider,{borderWidth:1,orientation:"horizontal",my:0,borderColor:s.hexborderColor})]},S)})})]})})}})},eR=r=>{const{themeColor:e}=Ia();return ue.jsx(ol,{...r,children:({data:t,isActive:n})=>{var o,s,l,u;const a=Y2(t,e),i=(s=(o=r.data)==null?void 0:o.config)==null?void 0:s.icon;return ue.jsx(ye.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(ye.Flex,{justify:"flex-start",direction:"row",p:20,borderBottomWidth:1,minWidth:"max-content !important",width:"100%",textTransform:"capitalize",align:"center",alignItems:"center",fontWeight:"bold",textColor:a.propertyColor,bgColor:a.highlightColor,borderBottomColor:a.hexborderColor,children:[!!i&&ue.jsx(ye.Box,{mr:8,justifyContent:"flex-start",height:"100%",w:50,alignItems:"center",rounded:"full",children:ue.jsx(Tm,{name:i,size:80,color:a.hextextColor},a.hextextColor)}),ue.jsx(ye.Text,{fontSize:"5xl",noOfLines:2,textOverflow:"ellipsis",whiteSpace:"nowrap",color:(u=t==null?void 0:t.viewProps)==null?void 0:u.textColor,children:Z2(t.headerTitle)})]})})}})};X2.displayName="text";Q2.displayName="arrayView";J2.displayName="NodeJsonObjectView";eR.displayName="ParentContainerView";const dq={objectView:J2,arrayView:Q2,text:X2,parentContainer:eR},vq=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":120,"target-distance-from-node":120}}],uc=(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]}},hq=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 gq({cytoInstance:r,id:e,source:t,type:n,target:a,label:i,children:o,layout:s,styleCallback:l,isPerformanceMode:u}){const c=Re.useRef(null),d=Re.useRef(null),[h,g]=Re.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=Re.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 _=uc(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(Re.useEffect(()=>{if(x(t,a)===0){const _=r.getElementById(e);if(_.length===0){const A=uc(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=uc(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]),Re.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)}},[]),Re.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]),Re.useEffect(()=>{s()},[e,o]),Re.useEffect(()=>{if(!h){const S=r.getElementById(e);m(S)}},[l,h]),h>0)return null;function C(S){return Re.cloneElement(S,{cytoInstance:r,layout:s})}const T=Re.Children.map(o,C);return ue.jsx("div",{ref:c,className:"cytoscape-react-edge",children:T})}function om(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 pq(r){if(Array.isArray(r))return r}function yq(r){if(Array.isArray(r))return om(r)}function Ba(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function mq(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,tR(n.key),n)}}function Ma(r,e,t){return e&&mq(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function zt(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Rm(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
|
-
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 l=t.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||t.return==null||t.return()}finally{if(s)throw i}}}}function
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yr(r,e){return pq(r)||wq(r,e)||Rm(r,e)||xq()}function Wu(r){return yq(r)||bq(r)||Rm(r)||Eq()}function Cq(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 tR(r){var e=Cq(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 Rm(r,e){if(r){if(typeof r=="string")return om(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)?om(r,e):void 0}}var et=typeof window>"u"?null:window,z1=et?et.navigator:null;et&&et.document;var _q=tt(""),nR=tt({}),Sq=tt(function(){}),Tq=typeof HTMLElement>"u"?"undefined":tt(HTMLElement),fs=function(e){return e&&e.instanceString&&zr(e.instanceString)?e.instanceString():null},Ke=function(e){return e!=null&&tt(e)==_q},zr=function(e){return e!=null&&tt(e)===Sq},Sr=function(e){return!Yt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},pr=function(e){return e!=null&&tt(e)===nR&&!Sr(e)&&e.constructor===Object},Rq=function(e){return e!=null&&tt(e)===nR},Me=function(e){return e!=null&&tt(e)===tt(1)&&!isNaN(e)},Aq=function(e){return Me(e)&&Math.floor(e)===e},Uu=function(e){if(Tq!=="undefined")return e!=null&&e instanceof HTMLElement},Yt=function(e){return cs(e)||aR(e)},cs=function(e){return fs(e)==="collection"&&e._private.single},aR=function(e){return fs(e)==="collection"&&!e._private.single},Am=function(e){return fs(e)==="core"},iR=function(e){return fs(e)==="stylesheet"},Pq=function(e){return fs(e)==="event"},Ea=function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},Dq=function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},Iq=function(e){return pr(e)&&Me(e.x1)&&Me(e.x2)&&Me(e.y1)&&Me(e.y2)},Bq=function(e){return Rq(e)&&zr(e.then)},Mq=function(){return z1&&z1.userAgent.match(/msie|trident|edge/i)},Ji=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},Pm=Ji(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),sl=Ji(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),oR=Ji(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),$1=function(e){return Ea(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},pa=function(e,t){return e.slice(-1*t.length)===t},rt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",kq="rgb[a]?\\(("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)\\s*,\\s*("+rt+"[%]?)(?:\\s*,\\s*("+rt+"))?\\)",Lq="rgb[a]?\\((?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)\\s*,\\s*(?:"+rt+"[%]?)(?:\\s*,\\s*(?:"+rt+"))?\\)",Oq="hsl[a]?\\(("+rt+")\\s*,\\s*("+rt+"[%])\\s*,\\s*("+rt+"[%])(?:\\s*,\\s*("+rt+"))?\\)",qq="hsl[a]?\\((?:"+rt+")\\s*,\\s*(?:"+rt+"[%])\\s*,\\s*(?:"+rt+"[%])(?:\\s*,\\s*(?:"+rt+"))?\\)",Nq="\\#[0-9a-fA-F]{3}",Fq="\\#[0-9a-fA-F]{6}",sR=function(e,t){return e<t?-1:e>t?1:0},zq=function(e,t){return-1*sR(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},$q=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]}},Vq=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("^"+Oq+"$").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},Gq=function(e){var t,n=new RegExp("^"+kq+"$").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},Wq=function(e){return Uq[e.toLowerCase()]},uR=function(e){return(Sr(e)?e:null)||Wq(e)||$q(e)||Gq(e)||Vq(e)},Uq={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]},lR=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}},fR=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},pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ds(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var lc,V1;function vs(){if(V1)return lc;V1=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return lc=r,lc}var fc,G1;function Hq(){if(G1)return fc;G1=1;var r=typeof pu=="object"&&pu&&pu.Object===Object&&pu;return fc=r,fc}var cc,W1;function ul(){if(W1)return cc;W1=1;var r=Hq(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return cc=t,cc}var dc,U1;function Kq(){if(U1)return dc;U1=1;var r=ul(),e=function(){return r.Date.now()};return dc=e,dc}var vc,H1;function jq(){if(H1)return vc;H1=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return vc=e,vc}var hc,K1;function Yq(){if(K1)return hc;K1=1;var r=jq(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return hc=t,hc}var gc,j1;function Dm(){if(j1)return gc;j1=1;var r=ul(),e=r.Symbol;return gc=e,gc}var pc,Y1;function Zq(){if(Y1)return pc;Y1=1;var r=Dm(),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 pc=i,pc}var yc,Z1;function Xq(){if(Z1)return yc;Z1=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return yc=t,yc}var mc,X1;function cR(){if(X1)return mc;X1=1;var r=Dm(),e=Zq(),t=Xq(),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 mc=o,mc}var bc,Q1;function Qq(){if(Q1)return bc;Q1=1;function r(e){return e!=null&&typeof e=="object"}return bc=r,bc}var wc,J1;function hs(){if(J1)return wc;J1=1;var r=cR(),e=Qq(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return wc=n,wc}var xc,ew;function Jq(){if(ew)return xc;ew=1;var r=Yq(),e=vs(),t=hs(),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 xc=l,xc}var Ec,rw;function eN(){if(rw)return Ec;rw=1;var r=vs(),e=Kq(),t=Jq(),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(M){var N=c,z=d;return c=d=void 0,m=M,g=s.apply(z,N),g}function T(M){return m=M,p=setTimeout(A,l),b?C(M):g}function S(M){var N=M-E,z=M-m,W=l-N;return w?i(W,h-z):W}function _(M){var N=M-E,z=M-m;return E===void 0||N>=l||N<0||w&&z>=h}function A(){var M=e();if(_(M))return P(M);p=setTimeout(A,S(M))}function P(M){return p=void 0,x&&c?C(M):(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 k(){var M=e(),N=_(M);if(c=arguments,d=this,E=M,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 k.cancel=D,k.flush=I,k}return Ec=o,Ec}var rN=eN(),gs=ds(rN),Cc=et?et.performance:null,dR=Cc&&Cc.now?function(){return Cc.now()}:function(){return Date.now()},tN=(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(dR())},1e3/60)}})(),Hu=function(e){return tN(e)},Yn=dR,Ja=9261,vR=65599,Vi=5381,hR=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ja,n=t,a;a=e.next(),!a.done;)n=n*vR+a.value|0;return n},Xo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ja;return t*vR+e|0},Qo=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vi;return(t<<5)+t+e|0},nN=function(e,t){return e*2097152+t},va=function(e){return e[0]*2097152+e[1]},yu=function(e,t){return[Xo(e[0],t[0]),Qo(e[1],t[1])]},tw=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 hR(o,t)},ni=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 hR(o,t)},gR=function(){return aN(arguments)},aN=function(e){for(var t,n=0;n<e.length;n++){var a=e[n];n===0?t=ni(a):t=ni(a,t)}return t};function iN(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 oN=function(e,t,n,a,i,o){return{x:(e-n)*i+n,y:(t-a)*o+a}};function sN(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=iN(r.x,r.y,n,a,t),l=oN(s.x,s.y,n,a,i,o);return{x:l.x,y:l.y}}var nw=!0,uN=console.warn!=null,lN=console.trace!=null,Im=Number.MAX_SAFE_INTEGER||9007199254740991,pR=function(){return!0},Ku=function(){return!1},aw=function(){return 0},Bm=function(){},Or=function(e){throw new Error(e)},yR=function(e){if(e!==void 0)nw=!!e;else return nw},Er=function(e){yR()&&(uN?console.warn(e):(console.log(e),lN&&console.trace()))},fN=function(e){return Ye({},e)},In=function(e){return e==null?e:Sr(e)?e.slice():pr(e)?fN(e):e},cN=function(e){return e.slice()},mR=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},dN={},bR=function(){return dN},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}},Ca=function(e,t,n){for(var a=e.length-1;a>=0;a--)e[a]===t&&e.splice(a,1)},Mm=function(e){e.splice(0,e.length)},vN=function(e,t){for(var n=0;n<t.length;n++){var a=t[n];e.push(a)}},Nt=function(e,t,n){return n&&(t=oR(n,t)),e[t]},Kn=function(e,t,n,a){n&&(t=oR(n,t)),e[t]=a},hN=(function(){function r(){Ba(this,r),this._obj={}}return Ma(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]}}])})(),jn=typeof Map<"u"?Map:hN,gN="undefined",pN=(function(){function r(e){if(Ba(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 Ma(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)}}])})(),to=(typeof Set>"u"?"undefined":tt(Set))!==gN?Set:pN,ll=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!Am(e)){Or("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"){Or("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 to,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))},iw=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,a,i){var o;pr(n)&&!Yt(n)&&(o=n,n=o.roots||o.root,a=o.visit,i=o.directed),i=arguments.length===2&&!zr(a)?a:i,a=zr(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 M=e.bfs?u.shift():u.pop(),N=M.id();if(e.dfs){if(g[N])return 0;g[N]=!0,c.push(M)}var z=h[N],W=d[N],q=W!=null?W.source():null,$=W!=null?W.target():null,X=W==null?void 0:M.same(q)?$[0]:q[0],Y;if(Y=a(M,W,X,p++,z),Y===!0)return E=M,1;if(Y===!1)return 1;for(var K=M.connectedEdges().filter(function(j){return(!i||j.source().same(M))&&w.has(j)}),ee=0;ee<K.length;ee++){var le=K[ee],G=le.connectedNodes().filter(function(j){return!j.same(M)&&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)}}},Jo={breadthFirstSearch:iw({bfs:!0}),depthFirstSearch:iw({dfs:!0})};Jo.bfs=Jo.breadthFirstSearch;Jo.dfs=Jo.depthFirstSearch;var Du={exports:{}},yN=Du.exports,ow;function mN(){return ow||(ow=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,k;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),k=[],A=0,I=d(w,b.length);0<=I?A<I:A>I;0<=I?++A:--A)k.push(o(b,x));return k},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(yN)})(Du)),Du.exports}var _c,sw;function bN(){return sw||(sw=1,_c=mN()),_c}var wN=bN(),ps=ds(wN),xN=yt({root:null,weight:function(e){return 1},directed:!1}),EN={dijkstra:function(e){if(!pr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=xN(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 ps(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],k=I.id(),M=T(S,I),N=_+M.dist;N<m(I)&&(b(I,N),d[k]={node:S,edge:M.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($)}}}},CN={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}},_N=yt({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),SN={aStar:function(e){var t=this.cy(),n=_N(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 ps(function(Y,K){return h[Y.id()]-h[K.id()]}),E=new to,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 k=x._private.edges,M=0;M<k.length;M++){var N=k[M];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:_}}},TN=yt({weight:function(e){return 1},directed:!1}),RN={floydWarshall:function(e){for(var t=this.cy(),n=TN(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 k=P*c+A;!i&&p[k]>I&&(p[k]=I,w[k]=A,x[k]=T)}}}for(var M=0;M<c;M++)for(var N=0;N<c;N++)for(var z=N*c+M,W=0;W<c;W++){var q=N*c+W,$=M*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 de=t.collection(),se=V,Z;for(de.merge(re);V!==j;)se=V,V=w[V*c+j],Z=x[se*c+V],de.merge(Z),de.merge(g(V));return de}};return K}},AN=yt({weight:function(e){return 1},directed:!1,root:null}),PN={bellmanFord:function(e){var t=this,n=AN(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 jn,E=!1,m=[];o=u.collection(o)[0],d.unmergeBy(function(U){return U.isLoop()});for(var b=d.length,w=function(fe){var xe=p.get(fe.id());return xe||(xe={},p.set(fe.id(),xe)),xe},x=function(fe){return(Ke(fe)?u.$(fe):fe)[0]},C=function(fe){return w(x(fe)).dist},T=function(fe){for(var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:o,ge=x(fe),be=[],Ae=ge;;){if(Ae==null)return t.spawn();var Ie=w(Ae),Be=Ie.edge,Oe=Ie.pred;if(be.unshift(Ae[0]),Ae.same(xe)&&be.length>0)break;Be!=null&&be.unshift(Be),Ae=Oe}return l.spawn(be)},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,xe,ge,be,Ae,Ie){var Be=be.dist+Ie;Be<Ae.dist&&!ge.same(be.edge)&&(Ae.dist=Be,Ae.pred=fe,Ae.edge=ge,P=!0)},I=1;I<g;I++){P=!1;for(var k=0;k<b;k++){var M=d[k],N=M.source(),z=M.target(),W=s(M),q=w(N),$=w(z);D(N,z,M,q,$,W),i||D(z,N,M,$,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 de=re.length,se=0;se<de;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 te=Q[0].id(),ce=0,_e=2;_e<Q.length;_e+=2)Q[_e].id()<te&&(te=Q[_e].id(),ce=_e);Q=Q.slice(ce).concat(Q.slice(0,ce)),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}}},DN=Math.sqrt(2),IN=function(e,t,n){n.length===0&&Or("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},Sc=function(e,t,n,a){for(;n>a;){var i=Math.floor(Math.random()*t.length);t=IN(i,e,t),n--}return t},BN={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/DN);if(i<2){Or("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=Sc(E,u.slice(),i,l),T=C.slice();b(E,m);var S=Sc(E,C,l,2),_=Sc(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],k=0;k<p.length;k++){var M=p[k],N=n[k];M===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}},Tc,MN=function(e){return{x:e.x,y:e.y}},fl=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},wR=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},Gi=function(e){return{x:e[0],y:e[1]}},kN=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},LN=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},ON=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},qN=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},NN=function(e){return Math.PI*e/180},mu=function(e,t){return Math.atan2(t,e)-Math.PI/2},km=Math.log2||function(r){return Math.log(r)/Math.log(2)},Lm=function(e){return e>0?1:e<0?-1:0},ai=function(e,t){return Math.sqrt(Xa(e,t))},Xa=function(e,t){var n=t.x-e.x,a=t.y-e.y;return n*n+a*a},FN=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},Ki=function(e,t,n,a){return{x:ot(e.x,t.x,n.x,a),y:ot(e.y,t.y,n.y,a)}},zN=function(e,t,n,a){var i={x:t.x-e.x,y:t.y-e.y},o=ai(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}},es=function(e,t,n){return Math.max(e,Math.min(n,t))},It=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}}},$N=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},VN=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},GN=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},xR=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},Iu=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},Bu=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},uw=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},Om=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)},ya=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},lw=function(e,t){return ya(e,t.x,t.y)},ER=function(e,t){return ya(e,t.x1,t.y1)&&ya(e,t.x2,t.y2)},WN=(Tc=Math.hypot)!==null&&Tc!==void 0?Tc:function(r,e){return Math.sqrt(r*r+e*e)};function UN(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=WN(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],k=A[(D+1)%A.length];P+=I.x*k.y-k.x*I.y}return P/2},l=function(A,P,D,I){var k=n(P,A),M=n(I,D),N=i(k,M);if(Math.abs(N)<1e-9)return t(A,a(k,.5));var z=i(n(D,A),M)/N;return t(A,a(k,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 HN(r,e,t,n,a,i){var o=rF(r,e,t,n,a),s=UN(o,i),l=It();return s.forEach(function(u){return xR(l,u.x,u.y)}),l}var CR=function(e,t,n,a,i,o,s){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?_a(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=ma(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=ma(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=ma(e,t,n,a,_,A,P,D,!1),p.length>0)return p}if(g){var I=n-c-s,k=a-d+u-s,M=I,N=a+d-u+s;if(p=ma(e,t,n,a,I,k,M,N,!1),p.length>0)return p}var z;{var W=n-c+u,q=a-d+u;if(z=qo(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=qo(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=qo(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=qo(e,t,n,a,ee,le,u+s),z.length>0&&z[0]<=ee&&z[1]>=le)return[z[0],z[1]]}return[]},KN=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},jN=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)},YN=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]},ZN=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)},XN=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=[];ZN(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},QN=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},Ft=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},Zn=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=Yu(c,-u);E=ju(m)}else E=c;return Ft(e,t,E)},JN=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 Ft(e,t,u)},ju=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=ma(n,a,i,o,s,l,u,c,!0);t[d*2]=h[0],t[d*2+1]=h[1]}return t},Yu=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},eF=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]},ti=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},qo=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]},Rc=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},ma=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?Rc(e,n,s)===s?[s,l]:Rc(e,n,i)===i?[i,o]:Rc(i,s,n)===n?[n,a]:[]:[]},rF=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},rs=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=Yu(d,-l);g=ju(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=ma(e,t,a,i,m,b,w,x),c.length!==0&&u.push(c[0],c[1]);return u},tF=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=qo(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=ma(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},bu=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]]},Dt=function(e,t){var n=sm(e,t);return n=_R(n),n},_R=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},sm=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},_a=function(e,t){return Math.min(e/4,t/4,8)},SR=function(e,t){return Math.min(e/10,t/10,8)},qm=function(){return 8},nF=function(e,t,n){return[e-2*t+n,2*(t-e),e]},um=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function Ac(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=zt(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(Wu(t(r)),Wu(t(e))),o=zt(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 aF=yt({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),iF={pageRank:function(e){for(var t=aF(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 k=1/d+m,M=0;M<d;M++)if(E[M]===0)for(var N=0;N<d;N++){var z=N*d+M;p[z]=k}else for(var W=0;W<d;W++){var q=W*d+M;p[q]=p[q]/E[M]+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]}FN(X),Y=$,$=X,X=Y;for(var re=0,de=0;de<d;de++){var se=Y[de]-$[de];re+=se*se}if(re<a)break}var Z={rank:function(ae){return ae=s.collection(ae)[0],$[u.indexOf(ae)]}};return Z}},fw=yt({root:null,weight:function(e){return 1},directed:!1,alpha:0}),ji={degreeCentralityNormalized:function(e){e=fw(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=fw(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)}}}};ji.dc=ji.degreeCentrality;ji.dcn=ji.degreeCentralityNormalised=ji.degreeCentralityNormalized;var cw=yt({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),Yi={closenessCentralityNormalized:function(e){for(var t=cw(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=cw(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}};Yi.cc=Yi.closenessCentrality;Yi.ccn=Yi.closenessCentralityNormalised=Yi.closenessCentralityNormalized;var oF=yt({weight:null,directed:!1}),lm={betweennessCentrality:function(e){for(var t=oF(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 ps(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 k=0;k<l[I].length;k++){var M=l[I][k],N=o.getElementById(I),z=void 0;N.edgesTo(M).length>0?z=N.edgesTo(M)[0]:z=M.edgesTo(N)[0];var W=a(z);M=M.id(),_[M]>_[I]+W&&(_[M]=_[I]+W,A.nodes.indexOf(M)<0?A.push(M):A.updateItem(M),S[M]=0,T[M]=[]),_[M]==_[I]+W&&(S[M]=S[M]+S[I],T[M].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}};lm.bc=lm.betweennessCentrality;var sF=yt({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),uF=function(e){return sF(e)},lF=function(e,t){for(var n=0,a=0;a<t.length;a++)n+=t[a](e);return n},fF=function(e,t,n){for(var a=0;a<t;a++)e[a*t+a]=n},TR=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}},cF=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},dF=function(e,t,n){for(var a=e.slice(0),i=1;i<n;i++)e=cF(e,a,t);return e},vF=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 TR(a,t),a},hF=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},gF=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},pF=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},yF=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&pF(e[t],e[n])&&e.splice(n,1);return e},dw=function(e){for(var t=this.nodes(),n=this.edges(),a=this.cy(),i=uF(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=lF(p,i.attributes);c[E*l+m]+=b,c[m*l+E]+=b}fF(c,l,i.multFactor),TR(c,l);for(var w=!0,x=0;w&&x<i.maxIterations;)w=!1,d=dF(c,l,i.expandFactor),c=vF(d,l,i.inflateFactor),hF(c,d,u,4)||(w=!0),x++;var C=gF(c,l,t,a);return C=yF(C),C},mF={markovClustering:dw,mcl:dw},bF=function(e){return e},RR=function(e,t){return Math.abs(t-e)},vw=function(e,t,n){return e+RR(t,n)},hw=function(e,t,n){return e+Math.pow(n-t,2)},wF=function(e){return Math.sqrt(e)},xF=function(e,t,n){return Math.max(e,RR(t,n))},Do=function(e,t,n,a,i){for(var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:bF,s=a,l,u,c=0;c<e;c++)l=t(c),u=n(c),s=i(s,l,u);return o(s)},eo={euclidean:function(e,t,n){return e>=2?Do(e,t,n,0,hw,wF):Do(e,t,n,0,vw)},squaredEuclidean:function(e,t,n){return Do(e,t,n,0,hw)},manhattan:function(e,t,n){return Do(e,t,n,0,vw)},max:function(e,t,n){return Do(e,t,n,-1/0,xF)}};eo["squared-euclidean"]=eo.squaredEuclidean;eo.squaredeuclidean=eo.squaredEuclidean;function cl(r,e,t,n,a,i){var o;return zr(r)?o=r:o=eo[r]||eo.euclidean,e===0&&zr(r)?o(a,i):o(e,t,n,a,i)}var EF=yt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Nm=function(e){return EF(e)},Zu=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 cl(e,a.length,s,l,u,c)},Pc=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},AR=function(e,t,n,a,i){for(var o=1/0,s=0,l=0;l<t.length;l++){var u=Zu(n,e,t[l],a,i);u<o&&(o=u,s=l)}return s},PR=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},CF=function(e,t,n){return Math.abs(t-e)<=n},_F=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},SF=function(e,t,n){for(var a=0;a<n;a++)if(e===t[a])return!0;return!1},gw=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)];SF(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},pw=function(e,t,n){for(var a=0,i=0;i<t.length;i++)a+=Zu("manhattan",t[i],e,n,"kMedoids");return a},TF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=Nm(e),o=new Array(i.k),s={},l;i.testMode?typeof i.testCentroids=="number"?(i.testCentroids,l=Pc(n,i.k,i.attributes)):tt(i.testCentroids)==="object"?l=i.testCentroids:l=Pc(n,i.k,i.attributes):l=Pc(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()]=AR(a,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var g=PR(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,CF(m[w],E[w],i.sensitivityThreshold)||(u=!0)}l[h]=m,o[h]=t.collection(g)}}c++}return o},RF=function(e){var t=this.cy(),n=this.nodes(),a=null,i=Nm(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=gw(n,i.k)):s=gw(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()]=AR(a,s,i.distance,i.attributes,"kMedoids");d=!1;for(var p=0;p<s.length;p++){var E=PR(p,n,l);if(E.length!==0){c[p]=pw(s[p],E,i.attributes);for(var m=0;m<E.length;m++)u=pw(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},AF=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}},PF=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=Zu(i.distance,a[h],n[d],i.attributes,"cmeans"),u=Zu(i.distance,a[h],n[g],i.attributes,"cmeans"),s+=Math.pow(l/u,c);e[h][d]=1/s}},DF=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},yw=function(e){var t=this.cy(),n=this.nodes(),a=Nm(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,AF(o,n,s,u,a),PF(s,l,o,n,a),_F(s,l,a.sensitivityThreshold)||(w=!0),x++;return i=DF(n,s,a,t),{clusters:i,degreeOfMembership:s}},IF={kMeans:TF,kMedoids:RF,fuzzyCMeans:yw,fcm:yw},BF=yt({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),MF={single:"min",complete:"max"},kF=function(e){var t=BF(e),n=MF[t.linkage];return n!=null&&(t.linkage=n),t},mw=function(e,t,n,a,i){for(var o=0,s=1/0,l,u=i.attributes,c=function(P,D){return cl(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},Wi=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&Wi(e.left,t),e.right&&Wi(e.right,t)))},fm=function(e,t){if(!e)return"";if(e.left&&e.right){var n=fm(e.left,t),a=fm(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()},cm=function(e,t,n){if(!e)return[];var a=[],i=[],o=[];return t===0?(e.left&&Wi(e.left,a),e.right&&Wi(e.right,i),o=a.concat(i),[n.collection(o)]):t===1?e.value?[n.collection(e.value)]:(e.left&&Wi(e.left,a),e.right&&Wi(e.right,i),[n.collection(a),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(a=cm(e.left,t-1,n)),e.right&&(i=cm(e.right,t-1,n)),a.concat(i))},bw=function(e){for(var t=this.cy(),n=this.nodes(),a=kF(e),i=a.attributes,o=function(x,C){return cl(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=mw(s,c,l,u,a);m;)m=mw(s,c,l,u,a);var b;return a.mode==="dendrogram"?(b=cm(s[0],a.dendrogramDepth,t),a.addDendrogram&&fm(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},LF={hierarchicalClustering:bw,hca:bw},OF=yt({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),qF=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||Or("Damping must range on [0.5, 1). Got: ".concat(t));var a=["median","mean","min","max"];return a.some(function(i){return i===n})||Me(n)||Or("Preference must be one of [".concat(a.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(n)),OF(e)},NF=function(e,t,n,a){var i=function(s,l){return a[l](s)};return-cl(e,a.length,function(o){return i(t,o)},function(o){return i(n,o)},t,n)},FF=function(e,t){var n=null;return t==="median"?n=qN(e):t==="mean"?n=ON(e):t==="min"?n=kN(e):t==="max"?n=LN(e):n=t,n},zF=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},ww=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},$F=function(e,t,n){for(var a=ww(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=ww(e,t,n),a},xw=function(e){for(var t=this.cy(),n=this.nodes(),a=qF(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]=NF(a.distance,n[p],n[E],a.attributes));c=FF(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,k=-1/0,M=-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?(k=I,I=N,M=z):N>k&&(k=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+M]=(1-a.damping)*(u[D*s+M]-k)+a.damping*x[M]}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=zF(s,d,h),de=$F(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()],te=de[ae];te!=null&&se[te].push(n[Q])}for(var ce=new Array(re.length),_e=0;_e<re.length;_e++)ce[_e]=t.collection(se[re[_e]]);return ce},VF={affinityPropagation:xw,ap:xw},GF=yt({root:void 0,directed:!1}),WF={hierholzer:function(e){if(!pr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=GF(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}},wu=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}},UF={hopcroftTarjanBiconnected:wu,htbc:wu,htb:wu,hopcroftTarjanBiconnectedComponents:wu},xu=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}},HF={tarjanStronglyConnected:xu,tsc:xu,tscc:xu,tarjanStronglyConnectedComponents:xu},DR={};[Jo,EN,CN,SN,RN,PN,BN,iF,ji,Yi,lm,mF,IF,LF,VF,WF,UF,HF].forEach(function(r){Ye(DR,r)});/*!
|
|
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.Separator,{borderWidth:1,orientation:"horizontal",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
|
+
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 l=t.next();return o=l.done,l},e:function(l){s=!0,i=l},f:function(){try{o||t.return==null||t.return()}finally{if(s)throw i}}}}function aR(r,e,t){return(e=iR(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Eq(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Cq(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,a,i,o,s=[],l=!0,u=!1;try{if(i=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=i.call(t)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,a=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw a}}return s}}function _q(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sq(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
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)});/*!
|
|
5
5
|
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|
6
6
|
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|
7
7
|
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
8
|
-
*/var IR=0,BR=1,MR=2,wn=function(e){if(!(this instanceof wn))return new wn(e);this.id="Thenable/1.0.7",this.state=IR,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))};wn.prototype={fulfill:function(e){return Ew(this,BR,"fulfillValue",e)},reject:function(e){return Ew(this,MR,"rejectReason",e)},then:function(e,t){var n=this,a=new wn;return n.onFulfilled.push(_w(e,a,"fulfill")),n.onRejected.push(_w(t,a,"reject")),kR(n),a.proxy}};var Ew=function(e,t,n,a){return e.state===IR&&(e.state=t,e[n]=a,kR(e)),e},kR=function(e){e.state===BR?Cw(e,"onFulfilled",e.fulfillValue):e.state===MR&&Cw(e,"onRejected",e.rejectReason)},Cw=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)}},_w=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}LR(t,i)}}},LR=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")):LR(e,i))},function(i){a||(a=!0,e.reject(i))})}catch(i){a||e.reject(i)}return}e.fulfill(t)};wn.all=function(r){return new wn(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)})};wn.resolve=function(r){return new wn(function(e,t){e(r)})};wn.reject=function(r){return new wn(function(e,t){t(r)})};var no=typeof Promise<"u"?Promise:wn,dm=function(e,t,n){var a=Am(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&&zr(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},ii=dm.prototype;Ye(ii,{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),Yt(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 no(function(a,i){n.push(function(){a()})})}});ii.complete=ii.completed;ii.run=ii.play;ii.running=ii.playing;var KF={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 dm(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=wR(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 dm(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}}},Dc,Sw;function dl(){if(Sw)return Dc;Sw=1;var r=Array.isArray;return Dc=r,Dc}var Ic,Tw;function jF(){if(Tw)return Ic;Tw=1;var r=dl(),e=hs(),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 Ic=a,Ic}var Bc,Rw;function YF(){if(Rw)return Bc;Rw=1;var r=cR(),e=vs(),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 Bc=o,Bc}var Mc,Aw;function ZF(){if(Aw)return Mc;Aw=1;var r=ul(),e=r["__core-js_shared__"];return Mc=e,Mc}var kc,Pw;function XF(){if(Pw)return kc;Pw=1;var r=ZF(),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 kc=t,kc}var Lc,Dw;function QF(){if(Dw)return Lc;Dw=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 Lc=t,Lc}var Oc,Iw;function JF(){if(Iw)return Oc;Iw=1;var r=YF(),e=XF(),t=vs(),n=QF(),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 Oc=d,Oc}var qc,Bw;function ez(){if(Bw)return qc;Bw=1;function r(e,t){return e==null?void 0:e[t]}return qc=r,qc}var Nc,Mw;function Fm(){if(Mw)return Nc;Mw=1;var r=JF(),e=ez();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return Nc=t,Nc}var Fc,kw;function vl(){if(kw)return Fc;kw=1;var r=Fm(),e=r(Object,"create");return Fc=e,Fc}var zc,Lw;function rz(){if(Lw)return zc;Lw=1;var r=vl();function e(){this.__data__=r?r(null):{},this.size=0}return zc=e,zc}var $c,Ow;function tz(){if(Ow)return $c;Ow=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return $c=r,$c}var Vc,qw;function nz(){if(qw)return Vc;qw=1;var r=vl(),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 Vc=a,Vc}var Gc,Nw;function az(){if(Nw)return Gc;Nw=1;var r=vl(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return Gc=n,Gc}var Wc,Fw;function iz(){if(Fw)return Wc;Fw=1;var r=vl(),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 Wc=t,Wc}var Uc,zw;function oz(){if(zw)return Uc;zw=1;var r=rz(),e=tz(),t=nz(),n=az(),a=iz();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,Uc=i,Uc}var Hc,$w;function sz(){if($w)return Hc;$w=1;function r(){this.__data__=[],this.size=0}return Hc=r,Hc}var Kc,Vw;function OR(){if(Vw)return Kc;Vw=1;function r(e,t){return e===t||e!==e&&t!==t}return Kc=r,Kc}var jc,Gw;function hl(){if(Gw)return jc;Gw=1;var r=OR();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return jc=e,jc}var Yc,Ww;function uz(){if(Ww)return Yc;Ww=1;var r=hl(),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 Yc=n,Yc}var Zc,Uw;function lz(){if(Uw)return Zc;Uw=1;var r=hl();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Zc=e,Zc}var Xc,Hw;function fz(){if(Hw)return Xc;Hw=1;var r=hl();function e(t){return r(this.__data__,t)>-1}return Xc=e,Xc}var Qc,Kw;function cz(){if(Kw)return Qc;Kw=1;var r=hl();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 Qc=e,Qc}var Jc,jw;function dz(){if(jw)return Jc;jw=1;var r=sz(),e=uz(),t=lz(),n=fz(),a=cz();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 ed,Yw;function vz(){if(Yw)return ed;Yw=1;var r=Fm(),e=ul(),t=r(e,"Map");return ed=t,ed}var rd,Zw;function hz(){if(Zw)return rd;Zw=1;var r=oz(),e=dz(),t=vz();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return rd=n,rd}var td,Xw;function gz(){if(Xw)return td;Xw=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return td=r,td}var nd,Qw;function gl(){if(Qw)return nd;Qw=1;var r=gz();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return nd=e,nd}var ad,Jw;function pz(){if(Jw)return ad;Jw=1;var r=gl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return ad=e,ad}var id,ex;function yz(){if(ex)return id;ex=1;var r=gl();function e(t){return r(this,t).get(t)}return id=e,id}var od,rx;function mz(){if(rx)return od;rx=1;var r=gl();function e(t){return r(this,t).has(t)}return od=e,od}var sd,tx;function bz(){if(tx)return sd;tx=1;var r=gl();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 sd=e,sd}var ud,nx;function wz(){if(nx)return ud;nx=1;var r=hz(),e=pz(),t=yz(),n=mz(),a=bz();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,ud=i,ud}var ld,ax;function xz(){if(ax)return ld;ax=1;var r=wz(),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,ld=t,ld}var fd,ix;function Ez(){if(ix)return fd;ix=1;var r=xz(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return fd=t,fd}var cd,ox;function qR(){if(ox)return cd;ox=1;var r=Ez(),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 cd=n,cd}var dd,sx;function NR(){if(sx)return dd;sx=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 dd=r,dd}var vd,ux;function Cz(){if(ux)return vd;ux=1;var r=Dm(),e=NR(),t=dl(),n=hs(),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 vd=o,vd}var hd,lx;function FR(){if(lx)return hd;lx=1;var r=Cz();function e(t){return t==null?"":r(t)}return hd=e,hd}var gd,fx;function zR(){if(fx)return gd;fx=1;var r=dl(),e=jF(),t=qR(),n=FR();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return gd=a,gd}var pd,cx;function zm(){if(cx)return pd;cx=1;var r=hs();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return pd=e,pd}var yd,dx;function _z(){if(dx)return yd;dx=1;var r=zR(),e=zm();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 yd=t,yd}var md,vx;function Sz(){if(vx)return md;vx=1;var r=_z();function e(t,n,a){var i=t==null?void 0:r(t,n);return i===void 0?a:i}return md=e,md}var Tz=Sz(),Rz=ds(Tz),bd,hx;function Az(){if(hx)return bd;hx=1;var r=Fm(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return bd=e,bd}var wd,gx;function Pz(){if(gx)return wd;gx=1;var r=Az();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return wd=e,wd}var xd,px;function Dz(){if(px)return xd;px=1;var r=Pz(),e=OR(),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 xd=a,xd}var Ed,yx;function Iz(){if(yx)return Ed;yx=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 Ed=t,Ed}var Cd,mx;function Bz(){if(mx)return Cd;mx=1;var r=Dz(),e=zR(),t=Iz(),n=vs(),a=zm();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 Cd=i,Cd}var _d,bx;function Mz(){if(bx)return _d;bx=1;var r=Bz();function e(t,n,a){return t==null?t:r(t,n,a)}return _d=e,_d}var kz=Mz(),Lz=ds(kz),Sd,wx;function Oz(){if(wx)return Sd;wx=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 Sd=r,Sd}var Td,xx;function qz(){if(xx)return Td;xx=1;var r=NR(),e=Oz(),t=dl(),n=hs(),a=qR(),i=zm(),o=FR();function s(l){return t(l)?r(l,i):n(l)?[l]:e(a(o(l)))}return Td=s,Td}var Nz=qz(),Fz=ds(Nz),zz={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&&Fz(a);if(o.allowGetting&&i===void 0){var g;return c&&(o.beforeGet(c),h&&c._private[o.field][a]===void 0?g=Rz(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=rR({},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?Lz(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&&zr(a)){var I=a;s.on(o.bindingEvent,I)}else if(o.allowGetting&&a===void 0){var k;return c&&(o.beforeGet(c),k=c._private[o.field]),k}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(!Ea(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}}},$z={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 no(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={};[KF,zz,$z].forEach(function(r){Ye(xr,r)});var Vz={animate:xr.animate(),animation:xr.animation(),animated:xr.animated(),clearQueue:xr.clearQueue(),delay:xr.delay(),delayAnimation:xr.delayAnimation(),stop:xr.stop()},Mu={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 to(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}};Mu.className=Mu.classNames=Mu.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},vm=[{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 zq(r.selector,e.selector)}),Gz=(function(){for(var r={},e,t=0;t<vm.length;t++)e=vm[t],r[e.selector]=e.matches;return r})(),Wz=function(e,t){return Gz[e](t)},Uz="("+vm.map(function(r){return r.selector}).join("|")+")",ki=function(e){return e.replace(new RegExp("\\\\("+gr.metaChar+")","g"),function(t,n){return n})},ha=function(e,t,n){e[e.length-1]=n},hm=[{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:Uz,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:ki(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:ki(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:ki(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:ki(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:ki(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:ki(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}),ha(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}),ha(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]}),ha(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}),ha(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}),ha(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}),ha(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}),ha(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}),ha(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)}}];hm.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var Hz=function(e){for(var t,n,a,i=0;i<hm.length;i++){var o=hm[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}},Kz=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},jz=function(e){var t=this,n=t.inputText=e,a=t[0]=Cr();for(t.length=1,n=Kz(n);;){var i=Hz(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},Yz=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},Zz={parse:jz,toString:Yz},$R=function(e,t,n){var a,i=Ke(e),o=Me(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},Xz=function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return e===void 0}},Qz=function(e){return e!==void 0},$m=function(e,t){return e.data(t)},Jz=function(e,t){return e[t]()},Gr=[],Br=function(e,t){return e.checks.every(function(n){return Gr[n.type](n,t)})};Gr[ze.GROUP]=function(r,e){var t=r.value;return t==="*"||t===e.group()};Gr[ze.STATE]=function(r,e){var t=r.value;return Wz(t,e)};Gr[ze.ID]=function(r,e){var t=r.value;return e.id()===t};Gr[ze.CLASS]=function(r,e){var t=r.value;return e.hasClass(t)};Gr[ze.META_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return $R(Jz(e,t),n,a)};Gr[ze.DATA_COMPARE]=function(r,e){var t=r.field,n=r.operator,a=r.value;return $R($m(e,t),n,a)};Gr[ze.DATA_BOOL]=function(r,e){var t=r.field,n=r.operator;return Xz($m(e,t),n)};Gr[ze.DATA_EXIST]=function(r,e){var t=r.field;return r.operator,Qz($m(e,t))};Gr[ze.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)};Gr[ze.NODE_NEIGHBOR]=function(r,e){return Br(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&Br(r.neighbor,t)})};Gr[ze.DIRECTED_EDGE]=function(r,e){return Br(r.source,e.source())&&Br(r.target,e.target())};Gr[ze.NODE_SOURCE]=function(r,e){return Br(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&Br(r.target,t)})};Gr[ze.NODE_TARGET]=function(r,e){return Br(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&Br(r.source,t)})};Gr[ze.CHILD]=function(r,e){return Br(r.child,e)&&Br(r.parent,e.parent())};Gr[ze.PARENT]=function(r,e){return Br(r.parent,e)&&e.children().some(function(t){return Br(r.child,t)})};Gr[ze.DESCENDANT]=function(r,e){return Br(r.descendant,e)&&e.ancestors().some(function(t){return Br(r.ancestor,t)})};Gr[ze.ANCESTOR]=function(r,e){return Br(r.ancestor,e)&&e.descendants().some(function(t){return Br(r.descendant,t)})};Gr[ze.COMPOUND_SPLIT]=function(r,e){return Br(r.subject,e)&&Br(r.left,e)&&Br(r.right,e)};Gr[ze.TRUE]=function(){return!0};Gr[ze.COLLECTION]=function(r,e){var t=r.value;return t.has(e)};Gr[ze.FILTER]=function(r,e){var t=r.value;return t(e)};var e5=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(Br(s,i))return!0}return!1};return t.text()==null&&(n=function(){return!0}),e.filter(n)},r5=function(e){for(var t=this,n=0;n<t.length;n++){var a=t[n];if(Br(a,e))return!0}return!1},t5={matches:r5,filter:e5},Sa=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||Ke(e)&&e.match(/^\s*$/)||(Yt(e)?this.addQuery({checks:[{type:ze.COLLECTION,value:e.collection()}]}):zr(e)?this.addQuery({checks:[{type:ze.FILTER,value:e}]}):Ke(e)?this.parse(e)||(this.invalid=!0):Or("A selector must be created from a string; found "))},Ta=Sa.prototype;[Zz,t5].forEach(function(r){return Ye(Ta,r)});Ta.text=function(){return this.inputText};Ta.size=function(){return this.length};Ta.eq=function(r){return this[r]};Ta.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()};Ta.addQuery=function(r){this[this.length++]=r};Ta.selector=Ta.toString;var wa={allAre:function(e){var t=new Sa(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new Sa(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())})}};wa.allAreNeighbours=wa.allAreNeighbors;wa.has=wa.contains;wa.equal=wa.equals=wa.same;var ln=function(e,t){return function(a,i,o,s){var l=a,u=this,c;if(l==null?c="":Yt(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=ni(c),E=g[p];return E||(g[p]=e.call(u,a,i,o,s))}else return e.call(u,a,i,o,s)}},ro={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:ln(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 Vm(r,e,t,n){for(var a=[],i=new to,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 VR(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)}}ro.forEachDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Vm(this,r,e,VR)};function GR(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}ro.forEachUp=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Vm(this,r,e,GR)};function n5(r,e,t){GR(r,e,t),VR(r,e,t)}ro.forEachUpAndDown=function(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Vm(this,r,e,n5)};ro.ancestors=ro.parents;var ts,WR;ts=WR={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}};ts.attr=ts.data;ts.removeAttr=ts.removeData;var a5=WR,pl={};function Rd(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(pl,{degree:Rd(function(r,e){return e.source().same(e.target())?2:1}),indegree:Rd(function(r,e){return e.target().same(r)?1:0}),outdegree:Rd(function(r,e){return e.source().same(r)?1:0})});function Li(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(pl,{minDegree:Li("degree",function(r,e){return r<e}),maxDegree:Li("degree",function(r,e){return r>e}),minIndegree:Li("indegree",function(r,e){return r<e}),maxIndegree:Li("indegree",function(r,e){return r>e}),minOutdegree:Li("outdegree",function(r,e){return r<e}),maxOutdegree:Li("outdegree",function(r,e){return r>e})});Ye(pl,{totalDegree:function(e){for(var t=0,n=this.nodes(),a=0;a<n.length;a++)t+=n[a].degree(e);return t}});var bn,UR,HR=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()}}},Ex={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){HR(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};bn=UR={position:xr.data(Ex),silentPosition:xr.data(Ye({},Ex,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){HR(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(pr(e))t?this.silentPosition(e):this.position(e);else if(zr(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:Me(e.x)?e.x:0,y:Me(e.y)?e.y:0},n=t):Ke(e)&&Me(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)&&Me(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(wR(s,i,o))}else{var d=n.position();return s=fl(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}};bn.modelPosition=bn.point=bn.position;bn.modelPositions=bn.points=bn.positions;bn.renderedPoint=bn.renderedPosition;bn.relativePoint=bn.relativePosition;var i5=UR,Zi,ka;Zi=ka={};ka.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}};ka.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)};ka.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 k=0,M=0,N=D+I;return P>0&&N>0&&(k=D/N*P,M=I/N*P),{biasDiff:k,biasComplementDiff:M}}function p(P,D,I,k){if(I.units==="%")switch(k){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 sn=function(e){return e===1/0||e===-1/0?0:e},mn=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)},ga=function(e,t){return t==null?e:mn(e,t.x1,t.y1,t.x2,t.y2)},Io=function(e,t,n){return Nt(e,t,n)},Eu=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,Iu(d,1),mn(e,d.x1,d.y1,d.x2,d.y2)}}},Ad=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=Io(o,"labelWidth",n),d=Io(o,"labelHeight",n),h=Io(o,"labelX",n),g=Io(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,k,M,N;if(m)I=h-P,k=h+P,M=g-D,N=g+D;else{switch(l.value){case"left":I=h-A,k=h;break;case"center":I=h-P,k=h+P;break;case"right":I=h,k=h+A;break}switch(u.value){case"top":M=g-_,N=g;break;case"center":M=g-D,N=g+D;break;case"bottom":M=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,k+=W,M+=q,N+=$;var X=n||"main",Y=i.labelBounds,K=Y[X]=Y[X]||{};K.x1=I,K.y1=M,K.x2=k,K.y2=N,K.w=k-I,K.h=N-M,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?Io(i.rstyle,"labelAngle",n):b.pfValue,V=Math.cos(G),j=Math.sin(G),re=(I+k)/2,de=(M+N)/2;if(!m){switch(l.value){case"left":re=k;break;case"right":re=I;break}switch(u.value){case"top":de=N;break;case"bottom":de=M;break}}var se=function(U,fe){return U=U-re,fe=fe-de,{x:U*V-fe*j+re,y:U*j+fe*V+de}},Z=se(I,M),Q=se(I,N),ae=se(k,M),te=se(k,N);I=Math.min(Z.x,Q.x,ae.x,te.x),k=Math.max(Z.x,Q.x,ae.x,te.x),M=Math.min(Z.y,Q.y,ae.y,te.y),N=Math.max(Z.y,Q.y,ae.y,te.y)}var ce=X+"Rot",_e=Y[ce]=Y[ce]||{};_e.x1=I,_e.y1=M,_e.x2=k,_e.y2=N,_e.w=k-I,_e.h=N-M,mn(e,I,M,k,N),mn(i.labelBounds.all,I,M,k,N)}return e}},Cx=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;KR(e,t,n,o,"outside",o/2)}},KR=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);ga(e,E)}else o!=null&&o>0&&Bu(e,[o,o,o,o])}},o5=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;KR(e,t,n,a,i)}},s5=function(e,t){var n=e._private.cy,a=n.styleEnabled(),i=n.headless(),o=It(),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 k=e.outerWidth(),M=k/2,N=e.outerHeight(),z=N/2;c=p-M,d=p+M,h=E-z,g=E+z,mn(o,c,h,d,g),a&&Cx(o,e),a&&t.includeOutlines&&!i&&Cx(o,e),a&&o5(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,mn(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}mn(o,c-D,h-D,d+D,g+D)}}else if(W==="bezier"||W==="unbundled-bezier"||pa(W,"segments")||pa(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,mn(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 de=h;h=g,g=de}c-=D,d+=D,h-=D,g+=D,mn(o,c,h,d,g)}if(a&&t.includeEdges&&u&&(Eu(o,e,"mid-source"),Eu(o,e,"mid-target"),Eu(o,e,"source"),Eu(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;mn(o,o.x1+Z,o.y1+Q,o.x2+Z,o.y2+Q)}}var ae=s.bodyBounds=s.bodyBounds||{};uw(ae,o),Bu(ae,b),Iu(ae,1),a&&(c=o.x1,d=o.x2,h=o.y1,g=o.y2,mn(o,c-A,h-A,d+A,g+A));var te=s.overlayBounds=s.overlayBounds||{};uw(te,o),Bu(te,b),Iu(te,1);var ce=s.labelBounds=s.labelBounds||{};ce.all!=null?VN(ce.all):ce.all=It(),a&&t.includeLabels&&(t.includeMainLabels&&Ad(o,e,null),u&&(t.includeSourceLabels&&Ad(o,e,"source"),t.includeTargetLabels&&Ad(o,e,"target")))}return o.x1=sn(o.x1),o.y1=sn(o.y1),o.x2=sn(o.x2),o.y2=sn(o.y2),o.w=sn(o.x2-o.x1),o.h=sn(o.y2-o.y1),o.w>0&&o.h>0&&x&&(Bu(o,b),Iu(o,1)),o},jR=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},YR=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var n=e.source().position(),a=e.target().position();return tw([t(n.x),t(n.y),t(a.x),t(a.y)])}else{var i=e.position();return tw([t(i.x),t(i.y)])}},_x=function(e,t){var n=e._private,a,i=e.isEdge(),o=t==null?Sx:jR(t),s=o===Sx;if(n.bbCache==null?(a=s5(e,ns),n.bbCache=a,n.bbCachePosKey=YR(e)):a=n.bbCache,!s){var l=e.isNode();a=It(),(t.includeNodes&&l||t.includeEdges&&!l)&&(t.includeOverlays?ga(a,n.overlayBounds):ga(a,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ga(a,n.labelBounds.all):(t.includeMainLabels&&ga(a,n.labelBounds.mainRot),t.includeSourceLabels&&ga(a,n.labelBounds.sourceRot),t.includeTargetLabels&&ga(a,n.labelBounds.targetRot))),a.w=a.x2-a.x1,a.h=a.y2-a.y1}return a},ns={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},Sx=jR(ns),Tx=yt(ns);ka.boundingBox=function(r){var e,t=r===void 0||r.useCache===void 0||r.useCache===!0,n=Ji(function(c){var d=c._private;return d.bbCache==null||d.styleDirty||d.bbCachePosKey!==YR(c)},function(c){return c.id()});if(t&&this.length===1&&!n(this[0]))r===void 0?r=ns:r=Tx(r),e=_x(this[0],r);else{e=It(),r=r||ns;var a=Tx(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(),ga(e,_x(u,a))}}return e.x1=sn(e.x1),e.y1=sn(e.y1),e.x2=sn(e.x2),e.y2=sn(e.y2),e.w=sn(e.x2-e.x1),e.h=sn(e.y2-e.y1),e};ka.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};ka.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=$N(this.boundingBox({useCache:!1}));return e.silentPositions(s),n&&(a.dirtyCompoundBoundsCache(),a.dirtyBoundingBoxCache(),a.updateCompoundBounds(!0)),t.endBatch(),l};Zi.boundingbox=Zi.bb=Zi.boundingBox;Zi.renderedBoundingbox=Zi.renderedBoundingBox;var u5=ka,No,ys;No=ys={};var ZR=function(e){e.uppercaseName=$1(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=$1(e.outerName),No[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},No["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},No["rendered"+e.uppercaseName]=function(){var n=this[0];if(n){var a=n[e.name]();return a*this.cy().zoom()}},No["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n){var a=n[e.outerName]();return a*this.cy().zoom()}}};ZR({name:"width"});ZR({name:"height"});ys.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};ys.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()};ys.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var l5=ys,f5=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},c5=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return fl(t(e),n.zoom(),n.pan())}},d5=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 fl(o,i,a)})}},v5=function(e){return e.renderer().getControlPoints(e)},h5=function(e){return e.renderer().getSegmentPoints(e)},g5=function(e){return e.renderer().getSourceEndpoint(e)},p5=function(e){return e.renderer().getTargetEndpoint(e)},y5=function(e){return e.renderer().getEdgeMidpoint(e)},Rx={controlPoints:{get:v5,mult:!0},segmentPoints:{get:h5,mult:!0},sourceEndpoint:{get:g5},targetEndpoint:{get:p5},midpoint:{get:y5}},m5=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)},b5=Object.keys(Rx).reduce(function(r,e){var t=Rx[e],n=m5(e);return r[e]=function(){return f5(this,t.get)},t.mult?r[n]=function(){return d5(this,t.get)}:r[n]=function(){return c5(this,t.get)},r},{}),w5=Ye({},i5,u5,l5,b5);/*!
|
|
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);/*!
|
|
9
9
|
Event object based on jQuery events, MIT license
|
|
10
10
|
|
|
11
11
|
https://jquery.org/license/
|
|
12
12
|
https://tldrlegal.com/license/mit-license
|
|
13
13
|
https://github.com/jquery/jquery/blob/master/src/event.js
|
|
14
|
-
*/var XR=function(e,t){this.recycle(e,t)};function Bo(){return!1}function Cu(){return!0}XR.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Bo,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Cu:Bo):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=Cu;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Cu;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Cu,this.stopPropagation()},isDefaultPrevented:Bo,isPropagationStopped:Bo,isImmediatePropagationStopped:Bo};var QR=/^([^.]+)(\.(?:[^.]+))?$/,x5=".*",JR={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},Ax=Object.keys(JR),E5={};function yl(){for(var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E5,e=arguments.length>1?arguments[1]:void 0,t=0;t<Ax.length;t++){var n=Ax[t];this[n]=r[n]||JR[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ra=yl.prototype,eA=function(e,t,n,a,i,o,s){zr(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(!Ea(c)){var d=c.match(QR);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}}}},Px=function(e,t){return e.addEventFields(e.context,t),new XR(t.type,t)},C5=function(e,t,n){if(Pq(n)){t(e,n);return}else if(pr(n)){t(e,Px(e,n));return}for(var a=Sr(n)?n:n.split(/\s+/),i=0;i<a.length;i++){var o=a[i];if(!Ea(o)){var s=o.match(QR);if(s){var l=s[1],u=s[2]?s[2]:null,c=Px(e,{type:l,namespace:u,target:e.context});t(e,c)}}}};Ra.on=Ra.addListener=function(r,e,t,n,a){return eA(this,function(i,o,s,l,u,c,d){zr(c)&&i.listeners.push({event:o,callback:c,type:s,namespace:l,qualifier:u,conf:d})},r,e,t,n,a),this};Ra.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})};Ra.removeListener=Ra.off=function(r,e,t,n){var a=this;this.emitting!==0&&(this.listeners=cN(this.listeners));for(var i=this.listeners,o=function(u){var c=i[u];eA(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};Ra.removeAllListeners=function(){return this.removeListener("*")};Ra.emit=Ra.trigger=function(r,e,t){var n=this.listeners,a=n.length;return this.emitting++,Sr(e)||(e=[e]),C5(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===x5)&&i.eventMatches(i.context,c,o)){var d=[o];e!=null&&vN(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 _5={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&&cs(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()}},_u=function(e){return Ke(e)?new Sa(e):e},rA={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new yl(_5,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var a=_u(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=_u(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=_u(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=_u(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(rA);var tA={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)||Yt(e))return new Sa(e).filter(this);if(zr(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=tA;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 S5={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}},nA=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"?Im: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()},Xu={forEach:function(e,t){if(zr(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(!zr(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(nA)},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:Im-1}else{var i=t.source,o=t.target,s=i.zDepth(),l=o.zDepth();return Math.max(s,l,0)}}}};Xu.each=Xu.forEach;var T5=function(){var e="undefined",t=(typeof Symbol>"u"?"undefined":tt(Symbol))!=e&&tt(Symbol.iterator)!=e;t&&(Xu[Symbol.iterator]=function(){var n=this,a={value:void 0,done:!1},i=0,o=this.length;return rR({next:function(){return i<o?a.value=n[i++]:(a.value=void 0,a.done=!0),a}},Symbol.iterator,function(){return this})})};T5();var R5=yt({nodeDimensionsIncludeLabels:!1}),ku={layoutDimensions:function(e){e=R5(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=Ji(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=It(),_=0;_<a.length;_++){var A=a[_],P=l(A,_);xR(S,P.x,P.y)}return S},h=d(),g=Ji(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}),no.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}))}};ku.createLayout=ku.makeLayout=ku.layout;function aA(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 ml(r,e){return r=ni(r),function(n){return aA(r,e,n)}}function bl(r,e){r=ni(r);var t=function(a){return e.call(a)};return function(){var a=this[0];if(a)return aA(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 Pd(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 Gm(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||Pd(i,n);var l=s.source,u=s.target;return t(l)&&(!o||Pd(l,t))&&(l===u||t(u)&&(!o||Pd(u,t)))}}}var ao=ml("eleTakesUpSpace",function(r){return r.pstyle("display").value==="element"&&r.width()!==0&&(r.isNode()?r.height()!==0:!0)});gt.takesUpSpace=bl("takesUpSpace",Gm({ok:ao}));var A5=ml("eleInteractive",function(r){return r.pstyle("events").value==="yes"&&r.pstyle("visibility").value==="visible"&&ao(r)}),P5=ml("parentInteractive",function(r){return r.pstyle("visibility").value==="visible"&&ao(r)});gt.interactive=bl("interactive",Gm({ok:A5,parentOk:P5,edgeOkViaNode:ao}));gt.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var D5=ml("eleVisible",function(r){return r.pstyle("visibility").value==="visible"&&r.pstyle("opacity").pfValue!==0&&ao(r)}),I5=ao;gt.visible=bl("visible",Gm({ok:D5,edgeOkViaNode:I5}));gt.hidden=function(){var r=this[0];if(r)return!r.visible()};gt.isBundledBezier=bl("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 xa={};function Dx(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&&zr(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 io(r){xa[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]}},xa[r.on]=Dx({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),xa[r.off]=Dx({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}io({field:"locked",overrideField:function(e){return e.cy().autolock()?!0:void 0},on:"lock",off:"unlock"});io({field:"grabbable",overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:"grabify",off:"ungrabify"});io({field:"selected",ableField:"selectable",overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:"select",off:"unselect"});io({field:"selectable",overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:"selectify",off:"unselectify"});xa.deselect=xa.unselect;xa.grabbed=function(){var r=this[0];if(r)return r._private.grabbed};io({field:"active",on:"activate",off:"unactivate"});io({field:"pannable",on:"panify",off:"unpanify"});xa.inactive=function(){var r=this[0];if(r)return!r._private.active};var Ct={},Ix=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)}},Bx=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)}},Mx=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)}};Ct.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null};Ye(Ct,{roots:Ix({noIncomingEdges:!0}),leaves:Ix({noOutgoingEdges:!0}),outgoers:ln(Bx({outgoing:!0}),"outgoers"),successors:Mx({outgoing:!0}),incomers:ln(Bx({incoming:!0}),"incomers"),predecessors:Mx({})});Ye(Ct,{neighborhood:ln(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)}});Ct.neighbourhood=Ct.neighborhood;Ct.closedNeighbourhood=Ct.closedNeighborhood;Ct.openNeighbourhood=Ct.openNeighborhood;Ye(Ct,{source:ln(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:ln(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:kx({attr:"source"}),targets:kx({attr:"target"})});function kx(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(Ct,{edgesWith:ln(Lx(),"edgesWith"),edgesTo:ln(Lx({thisIsSrc:!0}),"edgesTo")});function Lx(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(Ct,{connectedEdges:ln(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:ln(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:ln(Ox(),"parallelEdges"),codirectedEdges:ln(Ox({codirected:!0}),"codirectedEdges")});function Ox(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(Ct,{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]}});Ct.componentsOf=Ct.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){Or("A collection must have a reference to the core");return}var i=new jn,o=!1;if(!t)t=[];else if(t.length>0&&pr(t[0])&&!cs(t[0])){o=!0;for(var s=[],l=new to,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=mR();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var g=new ll(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 jn,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=ll.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 aR(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:In(n.data),position:In(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 ll(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=mR();else if(Me(E.id))E.id=""+E.id;else if(Ea(E.id)||!Ke(E.id)){Or("Can not create element with invalid string ID `"+E.id+"`"),h();continue}else if(n.hasElementWithId(E.id)){Or("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[_];Me(A)&&(A=E[_]=""+E[_]),A==null||A===""?(Or("Can not create edge `"+m+"` with unspecified "+_),T=!0):n.hasElementWithId(A)||(Or("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 jn,p.map.set(m,{ele:g,index:0}),p.removed=!1,e&&n.addToPool(g)}for(var I=0;I<i.length;I++){var k=i[I],M=k._private.data;Me(M.parent)&&(M.parent=""+M.parent);var N=M.parent,z=N!=null;if(z||k._private.parent){var W=k._private.parent?n.collection().merge(k._private.parent):n.getElementById(N);if(W.empty())M.parent=void 0;else if(W[0].removed())Er("Node added with missing parent, reference to parent removed"),M.parent=void 0,k._private.parent=null;else{for(var q=!1,$=W;!$.empty();){if(k.same($)){q=!0,M.parent=void 0;break}$=$.parent()}q||(W[0]._private.children.push(k),k._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;Ca(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();Ca(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 k=0;k<p.length;k++){var M=p[k];(!e||!M.removed())&&M.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};[DR,Vz,Mu,wa,ro,a5,pl,w5,rA,tA,S5,Xu,ku,gt,xa,Ct].forEach(function(r){Ye(Pr,r)});var B5={add:function(e){var t,n=this;if(Yt(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 ll(n,x).collection()}return t},remove:function(e){if(!Yt(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 M5(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,k){return((g(I,k)*D+p(I,k))*D+E(I))*D}function b(D,I,k){return 3*g(I,k)*D*D+2*p(I,k)*D+E(I)}function w(D,I){for(var k=0;k<a;++k){var M=b(I,r,t);if(M===0)return I;var N=m(I,r,t)-D;I-=N/M}return I}function x(){for(var D=0;D<l;++D)h[D]=m(D*u,r,t)}function C(D,I,k){var M,N,z=0;do N=I+(k-I)/2,M=m(N,r,t)-D,M>0?k=N:I=N;while(Math.abs(M)>o&&++z<s);return N}function T(D){for(var I=0,k=1,M=l-1;k!==M&&h[k]<=D;++k)I+=u;--k;var N=(D-h[k])/(h[k+1]-h[k]),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 k5=(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=M5(e,t,n,a);return function(o,s,l){return o+(s-o)*i(l)}},Lu={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 Lu.linear;var a=k5(e,t,n);return function(i,o,s){return i+(o-i)*a(s)}},"cubic-bezier":Ar};function qx(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 Nx(r,e){return r.pfValue!=null||r.value!=null?r.pfValue!=null&&(e==null||e.type.units!=="%")?r.pfValue:r.value:r}function Oi(r,e,t,n,a){var i=a!=null?a.type:null;t<0?t=0:t>1&&(t=1);var o=Nx(r,a),s=Nx(e,a);if(Me(o)&&Me(s))return qx(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=qx(i,c,d,t,n);l.push(h)}else l.push(d)}return l}}function L5(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=Lu.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=Lu[g].apply(null,p)):o.easingImpl=Lu[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={};Mo(b.x,w.x)&&(x.x=Oi(b.x,w.x,m,E)),Mo(b.y,w.y)&&(x.y=Oi(b.y,w.y,m,E)),r.position(x)}var C=o.startPan,T=o.pan,S=i.pan,_=T!=null&&n;_&&(Mo(C.x,T.x)&&(S.x=Oi(C.x,T.x,m,E)),Mo(C.y,T.y)&&(S.y=Oi(C.y,T.y,m,E)),r.emit("pan"));var A=o.startZoom,P=o.zoom,D=P!=null&&n;D&&(Mo(A,P)&&(i.zoom=es(i.minZoom,Oi(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 k=0;k<I.length;k++){var M=I[k],N=M.name,z=M,W=o.startStyle[N],q=c.properties[W.name],$=Oi(W,z,m,E,q);c.overrideBypass(r,N,$)}r.emit("style")}}return o.progress=m,m}function Mo(r,e){return r==null||e==null?!1:Me(r)&&Me(e)?!0:!!(r&&e)}function O5(r,e,t,n){var a=e._private;a.started=!0,a.startTime=t-a.progress*a.duration}function Fx(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||O5(c,x,r),L5(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 q5={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&&Hu(function(i){Fx(i,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(i,o){Fx(o,e)},n.beforeRenderPriorities.animations):t()}},N5={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&&cs(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}},Su=function(e){return Ke(e)?new Sa(e):e},iA={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new yl(N5,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Su(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Su(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Su(t),n),this},once:function(e,t,n){return this.emitter().one(e,Su(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(iA);var gm={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)}};gm.jpeg=gm.jpg;var Ou={layout:function(e){var t=this;if(e==null){Or("Layout options must be specified to make a layout");return}if(e.name==null){Or("A `name` must be specified to make a layout");return}var n=e.name,a=t.extension("layout",n);if(a==null){Or("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}};Ou.createLayout=Ou.makeLayout=Ou.layout;var F5={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)}})}},z5=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]}),pm={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){Or("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=z5(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)}};pm.invalidateDimensions=pm.resize;var qu={collection:function(e,t){return Ke(e)?this.$(e):Yt(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}};qu.elements=qu.filter=qu.$;var ut={},Uo="t",$5="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]===Uo,d=e[l]===Uo,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]===Uo;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+=Uo:t+=$5}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]===Uo;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,te,ce){return t.getPropertiesHash(ae,te,ce)},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]=[Ja,Vi]}for(var d=function(ae,te){return e.styleKeys[te][0]=Xo(ae,e.styleKeys[te][0])},h=function(ae,te){return e.styleKeys[te][1]=Qo(ae,e.styleKeys[te][1])},g=function(ae,te){d(ae,te),h(ae,te)},p=function(ae,te){for(var ce=0;ce<ae.length;ce++){var _e=ae.charCodeAt(ce);d(_e,te),h(_e,te)}},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,k=x.units;if(T.number&&I&&!T.multiple){var M=P?_:A;g(m(M),S),!P&&k!=null&&p(k,S)}else p(x.strValue,S)}}for(var N=[Ja,Vi],z=0;z<a.length;z++){var W=a[z],q=e.styleKeys[W];N[0]=Xo(q[0],N[0]),N[1]=Qo(q[1],N[1])}e.styleKey=nN(N[0],N[1]);var $=e.styleKeys;e.labelDimsKey=va($.labelDimensions);var X=i(r,["label"],$.labelDimensions);if(e.labelKey=va(X),e.labelStyleKey=va(yu($.commonLabel,X)),!s){var Y=i(r,["source-label"],$.labelDimensions);e.sourceLabelKey=va(Y),e.sourceLabelStyleKey=va(yu($.commonLabel,Y));var K=i(r,["target-label"],$.labelDimensions);e.targetLabelKey=va(K),e.targetLabelStyleKey=va(yu($.commonLabel,K))}if(s){var ee=e.styleKeys,le=ee.nodeBody,G=ee.nodeBorder,V=ee.nodeOutline,j=ee.backgroundImage,re=ee.compound,de=ee.pie,se=ee.stripe,Z=[le,G,V,j,re,de,se].filter(function(Q){return Q!=null}).reduce(yu,[Ja,Vi]);e.nodeKey=va(Z),e.hasPie=de!=null&&de[0]!==Ja&&de[1]!==Vi,e.hasStripe=se!=null&&se[0]!==Ja&&se[1]!==Vi}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(Me(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],k=n.valueMin[3]==null?1:n.valueMin[3],M=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(k+(M-k)*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=In(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&&(Me(p.pfValue)&&Me(E.pfValue)?(m=E.pfValue-p.pfValue,b=p.pfValue+w*m):Me(p.value)&&Me(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 no(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 ms={};ms.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[sl(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,In(A))||w,n&&(S.next=C.pstyle(A.name))}w&&this.updateStyleHints(C),n&&this.updateTransitions(C,T,o)}return w};ms.overrideBypass=function(r,e,t){e=Pm(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)}};ms.removeAllBypasses=function(r,e){return this.removeBypasses(r,this.propertyNames,e)};ms.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 Wm={};Wm.getEmSizeInPixels=function(){var r=this.containerCss("font-size");return r!=null?parseFloat(r):1};Wm.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 Bn={};Bn.getRenderedStyle=function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)};Bn.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[sl(i.name)]=o)}return n}};Bn.getIndexedStyle=function(r,e,t,n){var a=r.pstyle(e)[t][n];return a??r.cy().style().getDefaultProperty(e)[t][0]};Bn.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&&Me(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}};Bn.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};Bn.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[Pm(s)],c=this.parse(u.name,l);c&&t.push(c)}return t};Bn.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]=Xo(s,n[0]),n[1]=Qo(s,n[1]);else for(o=i.strValue,u=0;u<o.length;u++)s=o.charCodeAt(u),n[0]=Xo(s,n[0]),n[1]=Qo(s,n[1]);return n};Bn.getPropertiesHash=Bn.getNonDefaultPropertiesHash;var wl={};wl.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};wl.fromJson=function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e};wl.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 Um={};Um.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 Sa(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};Um.fromString=function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e};var jr={};(function(){var r=rt,e=Lq,t=qq,n=Nq,a=Fq,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 te=Ea(Q),ce=Ea(ae);return te&&!ce||!te&&ce}},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,te){return Q===ae?!1:te.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}],k=[{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}],M=[];jr.pieBackgroundN=16,M.push({name:"pie-size",type:u.sizeMaybePercent}),M.push({name:"pie-hole",type:u.sizeMaybePercent}),M.push({name:"pie-start-angle",type:u.angle});for(var N=1;N<=jr.pieBackgroundN;N++)M.push({name:"pie-"+N+"-background-color",type:u.color}),M.push({name:"pie-"+N+"-background-size",type:u.percent}),M.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,te=Z.type,ce=Z.triggersBounds;q.push({name:ae,type:te,triggersBounds:ce})})},{});var X=jr.properties=[].concat(E,x,m,b,w,I,p,g,c,d,h,T,S,_,A,M,z,P,D,q,k),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:M,stripe:z,compound:P,edgeLine:D,edgeArrow:q,core:k},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],de=X[re.pointsTo],se={name:re.name,alias:!0,pointsTo:de};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 xl={};xl.parse=function(r,e,t,n){var a=this;if(zr(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=gR(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=In(c),c&&(c.value=In(c.value))),c};xl.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};xl.parseImpl=function(r,e,t,n){var a=this;r=Pm(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(zr(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 k,M="px";if(u.units&&(k=u.units),u.implicitUnits&&(M=u.implicitUnits),!u.unitless)if(l){var N="px|em"+(u.allowPercent?"|\\%":"");k&&(N=k);var z=e.match("^("+rt+")("+N+")?$");z&&(e=z[1],k=z[2]||M)}else(!k||u.implicitUnits)&&(k=M);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&&!Aq(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+(k||""),units:k,bypass:t};return u.unitless||k!=="px"&&k!=="em"?W.pfValue=e:W.pfValue=k==="px"||!k?e:this.getEmSizeInPixels()*e,(k==="ms"||k==="s")&&(W.pfValue=k==="ms"?e:1e3*e),(k==="deg"||k==="rad")&&(W.pfValue=k==="rad"?e:NN(e)),k==="%"&&(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=uR(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(!Am(e)){Or("A style must have a core reference");return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},_t=st.prototype;_t.instanceString=function(){return"style"};_t.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};_t.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this};_t.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)};_t.selector=function(r){var e=r==="core"?null:new Sa(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this};_t.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[sl(a.name)]),i!==void 0&&this.cssRule(a.name,i)}else e.length===2&&this.cssRule(e[0],e[1]);return this};_t.style=_t.css;_t.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};_t.append=function(r){return iR(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,ms,Wm,Bn,wl,Um,jr,xl].forEach(function(r){Ye(_t,r)});st.types=_t.types;st.properties=_t.properties;st.propertyGroups=_t.propertyGroups;st.propertyGroupNames=_t.propertyGroupNames;st.propertyGroupKeys=_t.propertyGroupKeys;var V5={style:function(e){if(e){var t=this.setStyle(e);t.update()}return this._private.style},setStyle:function(e){var t=this._private;return iR(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()}},G5="single",oi={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=G5),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,Me(o)&&(t.x=o),Me(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")&&Me(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,Me(l)&&(a.x+=l),Me(u)&&(a.y+=u),this.emit("pan viewport"));break;case 2:i=e,o=t,(i==="x"||i==="y")&&Me(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(Me(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(Iq(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 Yt(e)||(e=this.mutableElements());if(!(Yt(e)&&e.empty())){n=n||e.boundingBox();var o=this.width(),s=this.height(),l;if(t=Me(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 Me(e)&&Me(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Me(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:Me(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),Me(e)?o=e:pr(e)&&(o=e.level,e.position!=null?i=fl(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||!Me(o)||o===a||i!=null&&(!Me(i.x)||!Me(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(Me(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;Me(u.x)&&(t.pan.x=u.x,s=!1),Me(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 Yt(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}};oi.centre=oi.center;oi.autolockNodes=oi.autolock;oi.autoungrabifyNodes=oi.autoungrabify;var as={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})};as.attr=as.data;as.removeAttr=as.removeData;var is=function(e){var t=this;e=Ye({},e);var n=e.container;n&&!Uu(n)&&Uu(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:Me(s.zoom)?s.zoom:1,pan:{x:pr(s.pan)&&Me(s.pan.x)?s.pan.x:0,y:pr(s.pan)&&Me(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(Bq);if(m)return no.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,zr(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)})},Qu=is.prototype;Ye(Qu,{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!Uu(e)&&Uu(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 In(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 k=0;k<_.length;k++){var M=_[k],N=M.ele,z=M.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=In(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=In(n.pan),b.boxSelectionEnabled=n.boxSelectionEnabled,b.renderer=In(w.renderer),b.hideEdgesOnViewport=w.hideEdgesOnViewport,b.textureOnViewport=w.textureOnViewport,b.wheelSensitivity=w.wheelSensitivity,b.motionBlur=w.motionBlur,b.multiClickDebounceTime=w.multiClickDebounceTime,b}}});Qu.$id=Qu.getElementById;[B5,q5,iA,gm,Ou,F5,pm,qu,V5,oi,as].forEach(function(r){Ye(Qu,r)});var W5={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}},U5={maximal:!1,acyclic:!1},qi=function(e){return e.scratch("breadthfirst")},zx=function(e,t){return e.scratch("breadthfirst",t)};function oA(r){this.options=Ye({},W5,U5,r)}oA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(xe){return xe.isChildless()}),a=t,i=r.directed,o=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,l=It(s?r.boundingBox:structuredClone(e.extent())),u;if(Yt(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],be=ge.maxDegree(!1),Ae=ge.filter(function(Ie){return Ie.degree(!1)===be});u=u.add(Ae)},m=0;m<p.length;m++)E()}var b=[],w={},x=function(ge,be){b[be]==null&&(b[be]=[]);var Ae=b[be].length;b[be].push(ge),zx(ge,{index:Ae,depth:be})},C=function(ge,be){var Ae=qi(ge),Ie=Ae.depth,Be=Ae.index;b[Ie][Be]=null,ge.isChildless()&&x(ge,be)};a.bfs({roots:u,directed:r.directed,visit:function(ge,be,Ae,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 be=b[ge],Ae=0;Ae<be.length;Ae++){var Ie=be[Ae];if(Ie==null){be.splice(Ae,1),Ae--;continue}zx(Ie,{depth:ge,index:Ae})}},P=function(ge,be){for(var Ae=qi(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=qi(Ve);Be=Math.max(Be,Xe.depth)}if(Ae.depth<=Be){if(!r.acyclic&&be[Oe])return null;var er=Be+1;return C(ge,er),be[Oe]=er,!0}return!1};if(i&&o){var D=[],I={},k=function(ge){return D.push(ge)},M=function(){return D.shift()};for(n.forEach(function(xe){return D.push(xe)});D.length>0;){var N=M(),z=P(N,I);if(z)N.outgoers().filter(function(xe){return xe.isNode()&&t.has(xe)}).forEach(k);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 be=qi(ge).depth,Ae=ge.neighborhood(),Ie=0,Be=0,Oe=0;Oe<Ae.length;Oe++){var He=Ae[Oe];if(!(He.isEdge()||He.isParent()||!n.has(He))){var Ve=qi(He);if(Ve!=null){var Xe=Ve.index,er=Ve.depth;if(!(Xe==null||er==null)){var $e=b[er].length;er<be&&(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,be){var Ae=le(ge),Ie=le(be),Be=Ae-Ie;return Be===0?sR(ge.id(),be.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=[],de=0;de<T.length;de++)re.push(T[de]);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},te=n.reduce(function(xe,ge){return(function(be){return{w:xe.w===-1?be.w:(xe.w+be.w)/2,h:xe.h===-1?be.h:(xe.h+be.h)/2}})(ge.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ce=Math.max(V===1?0:s?(l.h-r.padding*2-te.h)/(V-1):(l.h-r.padding*2-te.h)/(V+1),W),_e=b.reduce(function(xe,ge){return Math.max(xe,ge.length)},0),ve=function(ge){var be=qi(ge),Ae=be.depth,Ie=be.index;if(r.circle){var Be=Math.min(l.w/2/V,l.h/2/V);Be=Math.max(Be,W);var Oe=Be*Ae+Be-(V>0&&b[0].length<=3?Be/2:0),He=2*Math.PI/b[Ae].length*Ie;return Ae===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[Ae].length,Xe=Math.max(Ve===1?0:s?(l.w-r.padding*2-te.w)/((r.grid?_e:Ve)-1):(l.w-r.padding*2-te.w)/((r.grid?_e:Ve)+1),W),er={x:ae.x+(Ie+1-(Ve+1)/2)*Xe,y:ae.y+(Ae+1-(V+1)/2)*ce};return er}},U={downward:0,leftward:90,upward:180,rightward:-90};Object.keys(U).indexOf(r.direction)===-1&&Or("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(U).join(", ")));var fe=function(ge){return sN(ve(ge),l,U[r.direction])};return t.nodes().layoutPositions(this,r,fe),this};var H5={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 sA(r){this.options=Ye({},H5,r)}sA.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=It(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(Me(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 K5={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 uA(r){this.options=Ye({},K5,r)}uA.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=It(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(ce,_e){return _e.value-ce.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 k=b[I],M=e.sweep===void 0?2*Math.PI-2*Math.PI/k.length:e.sweep,N=k.dTheta=M/Math.max(1,k.length-1);if(k.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)}k.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],de=re.dTheta,se=re.r,Z=0;Z<re.length;Z++){var Q=re[Z],ae=e.startAngle+(t?1:-1)*de*Z,te={x:s.x+se*Math.cos(ae),y:s.y+se*Math.sin(ae)};V[Q.node.id()]=te}return a.nodes().layoutPositions(this,e,function(ce){var _e=ce.id();return V[_e]}),this};var Dd,j5={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 El(r){this.options=Ye({},j5,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)}El.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?Dd=!0:Dd=!1;var n=Y5(e,t,r);Dd&&X5(n),r.randomize&&Q5(n);var a=Yn(),i=function(){J5(n,e,r),r.fit===!0&&e.fit(r.padding)},o=function(h){return!(t.stopped||h>=r.numIter||(e$(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=fA(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)Vx(n,r),s();else{var g=Yn();g-a>=r.animationThreshold&&i(),Hu(c)}};c()}else{for(;u;)u=o(l),l++;Vx(n,r),s()}return this};El.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};El.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Y5=function(e,t,n){for(var a=n.eles.edges(),i=n.eles.nodes(),o=It(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=zr(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],k={};k.id=I.data("id"),k.sourceId=I.data("source"),k.targetId=I.data("target");var M=zr(n.idealEdgeLength)?n.idealEdgeLength(I):n.idealEdgeLength,N=zr(n.edgeElasticity)?n.edgeElasticity(I):n.edgeElasticity,z=s.idToIndex[k.sourceId],W=s.idToIndex[k.targetId],q=s.indexToGraph[z],$=s.indexToGraph[W];if(q!=$){for(var X=Z5(k.sourceId,k.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++;M*=K*n.nestingFactor}k.idealLength=M,k.elasticity=N,s.layoutEdges.push(k)}return s},Z5=function(e,t,n){var a=lA(e,t,0,n);return 2>a.count?0:a.graph},lA=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=lA(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}},X5,Q5=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)}},fA=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}}},J5=function(e,t,n){var a=n.layout,i=n.eles.nodes(),o=fA(e,n,i);i.positions(o),e.ready!==!0&&(e.ready=!0,a.one("layoutready",n.ready),a.emit({type:"layoutready",layout:this}))},e$=function(e,t,n){r$(e,t),a$(e),i$(e,t),o$(e),s$(e)},r$=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]]];t$(s,u,e,t)}},$x=function(e){return-1+2*e*Math.random()},t$=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=$x(u),l=$x(u));var c=n$(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=Ju(e,s,l),m=Ju(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)}},n$=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},Ju=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)},a$=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=Ju(o,u,c),h=Ju(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)}}},i$=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}}}}},o$=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}}},s$=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=u$(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,cA(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)}},u$=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},cA=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 cA(a,t)}},Vx=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)}}},l$={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 dA(r){this.options=Ye({},l$,r)}dA.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=It(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={},k=function(G,V){return!!I["c-"+G+"-"+V]},M=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;k(K.row,K.col);)K.col++;else if(K.row===void 0)for(K.row=0;k(K.row,K.col);)K.row++;q[X.id()]=K,M(K.row,K.col)}}var ee=function(G,V){var j,re;if(G.locked()||G.isParent())return!1;var de=q[G.id()];if(de)j=de.col*w+w/2+i.x1,re=de.row*x+x/2+i.y1;else{for(;k(N,z);)W();j=z*w+w/2+i.x1,re=N*x+x/2+i.y1,M(N,z),W()}return{x:j,y:re}};a.layoutPositions(this,e,ee)}return this};var f$={ready:function(){},stop:function(){}};function Hm(r){this.options=Ye({},f$,r)}Hm.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};Hm.prototype.stop=function(){return this};var c$={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 vA(r){this.options=Ye({},c$,r)}vA.prototype.run=function(){var r=this.options,e=r.eles,t=e.nodes(),n=zr(r.positions);function a(i){if(r.positions==null)return MN(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 d$={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function hA(r){this.options=Ye({},d$,r)}hA.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=It(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 v$=[{name:"breadthfirst",impl:oA},{name:"circle",impl:sA},{name:"concentric",impl:uA},{name:"cose",impl:El},{name:"grid",impl:dA},{name:"null",impl:Hm},{name:"preset",impl:vA},{name:"random",impl:hA}];function gA(r){this.options=r,this.notifications=0}var Gx=function(){},Wx=function(){throw new Error("A headless instance can not render images")};gA.prototype={recalculateRenderedStyle:Gx,notify:function(){this.notifications++},init:Gx,isHeadless:function(){return!0},png:Wx,jpg:Wx};var Km={};Km.arrowShapeWidth=.3;Km.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=Ft(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:Ku,roughCollide:Ku,draw:Bm,spacing:aw,gap:aw}),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=Ft(u,c,m)||Ft(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 Ft(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=Ft(u,c,m)||Ft(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 ui={};ui.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]};ui.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]};ui.invalidateContainerClientCoordsCache=function(){this.containerBB=null};ui.findNearestElement=function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]};ui.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,k=_.position(),M=_.pstyle("corner-radius").value==="auto"?"auto":_.pstyle("corner-radius").pfValue,N=_._private.rscratch;if(k.x-D<=r&&r<=k.x+D&&k.y-I<=e&&e<=k.y+I){var z=i.nodeShapes[a.getNodeShape(_)];if(z.checkPoint(r,e,0,A,P,k.x,k.y,M,N))return m(_,0),!0}}function w(_){var A=_._private,P=A.rscratch,D=_.pstyle("width").pfValue,I=_.pstyle("arrow-scale").value,k=D/2+c,M=k*k,N=k*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(KN(r,e,W[q],W[q+1],W[q+2],W[q+3],N)&&M>(z=QN(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(jN(r,e,W[q],W[q+1],W[q+2],W[q+3],W[q+4],W[q+5],N)&&M>(z=XN(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 Nt(_,A,P)}function C(_,A){var P=_._private,D=h,I;A?I=A+"-":I="",_.boundingBox();var k=P.labelBounds[A||"main"],M=_.pstyle(I+"label").value,N=_.pstyle("text-events").strValue==="yes";if(!(!N||!M)){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=k.x1-D-$,K=k.x2+D-$,ee=k.y1-D-X,le=k.y2+D-X;if(q){var G=Math.cos(q),V=Math.sin(q),j=function(te,ce){return te=te-z,ce=ce-W,{x:te*G-ce*V+z,y:te*V+ce*G+W}},re=j(Y,ee),de=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,de.x+$,de.y+X];if(Ft(r,e,Q))return m(_),!0}else if(ya(k,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};ui.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=It({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(te,ce,_e){return Nt(te,ce,_e)}function m(te,ce){var _e=te._private,ve=o,U="";te.boundingBox();var fe=_e.labelBounds.main;if(!fe)return null;var xe=E(_e.rscratch,"labelX",ce),ge=E(_e.rscratch,"labelY",ce),be=E(_e.rscratch,"labelAngle",ce),Ae=te.pstyle(U+"text-margin-x").pfValue,Ie=te.pstyle(U+"text-margin-y").pfValue,Be=fe.x1-ve-Ae,Oe=fe.x2+ve-Ae,He=fe.y1-ve-Ie,Ve=fe.y2+ve-Ie;if(be){var Xe=Math.cos(be),er=Math.sin(be),$e=function(pe,L){return pe=pe-xe,L=L-ge,{x:pe*Xe-L*er+xe,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(te,ce,_e,ve){function U(fe,xe,ge){return(ge.y-fe.y)*(xe.x-fe.x)>(xe.y-fe.y)*(ge.x-fe.x)}return U(te,_e,ve)!==U(ce,_e,ve)&&U(te,ce,_e)!==U(te,ce,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&&Ac(I,g)&&(s.push(C),D=!0)}!D&&ER(h,P)&&s.push(C)}else if(S==="overlap"&&Om(h,P)){var k=C.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1}),M=[{x:k.x1,y:k.y1},{x:k.x2,y:k.y1},{x:k.x2,y:k.y2},{x:k.x1,y:k.y2}];if(Ac(M,g))s.push(C);else{var N=m(C);N&&Ac(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&&!ya(h,q.startX,q.startY)||q.endX!=null&&q.endY!=null&&!ya(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(!lw(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&&(ya(h,q.startX,q.startY)||ya(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(lw(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],de=V[j+1],se=0;se<p.length;se++){var Z=Yr(p[se],2),Q=Z[0],ae=Z[1];if(b(re,de,Q,ae)){s.push(z),ee=!0;break}}if(ee)break}}}}}return s};var el={};el.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=mu(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,k=I+2;S=ot(p[D],p[I],p[k],0),_=ot(p[D+1],p[I+1],p[k+1],0),A=ot(p[D],p[I],p[k],1e-4),P=ot(p[D+1],p[I+1],p[k+1],1e-4)}else{var I=p.length/2-1,D=I-2,k=I+2;S=ot(p[D],p[I],p[k],.4999),_=ot(p[D+1],p[I+1],p[k+1],.4999),A=ot(p[D],p[I],p[k],.5),P=ot(p[D+1],p[I+1],p[k+1],.5)}l=A-S,u=P-_}if(e.midtgtArrowAngle=mu(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,M=x+2;l=-(p[M]-p[x]),u=-(p[M+1]-p[x+1])}}}if(e.midsrcArrowAngle=mu(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=mu(l,u)};el.getArrowWidth=el.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 ym,mm,Pn={},on={},Ux,Hx,ei,Nu,Hn,Ya,Qa,Rn,Ni,Tu,pA,yA,bm,wm,Kx,jx=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)},h$=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},g$=function(e,t,n,a,i){if(e!==Kx?jx(t,e,Pn):h$(on,Pn),jx(t,n,on),Ux=Pn.nx*on.ny-Pn.ny*on.nx,Hx=Pn.nx*on.nx-Pn.ny*-on.ny,Hn=Math.asin(Math.max(-1,Math.min(1,Ux))),Math.abs(Hn)<1e-6){ym=t.x,mm=t.y,Qa=Ni=0;return}ei=1,Nu=!1,Hx<0?Hn<0?Hn=Math.PI+Hn:(Hn=Math.PI-Hn,ei=-1,Nu=!0):Hn>0&&(ei=-1,Nu=!0),t.radius!==void 0?Ni=t.radius:Ni=a,Ya=Hn/2,Tu=Math.min(Pn.len/2,on.len/2),i?(Rn=Math.abs(Math.cos(Ya)*Ni/Math.sin(Ya)),Rn>Tu?(Rn=Tu,Qa=Math.abs(Rn*Math.sin(Ya)/Math.cos(Ya))):Qa=Ni):(Rn=Math.min(Tu,Ni),Qa=Math.abs(Rn*Math.sin(Ya)/Math.cos(Ya))),bm=t.x+on.nx*Rn,wm=t.y+on.ny*Rn,ym=bm-on.ny*Qa*ei,mm=wm+on.nx*Qa*ei,pA=t.x+Pn.nx*Rn,yA=t.y+Pn.ny*Rn,Kx=t};function mA(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 jm(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}:(g$(r,e,t,n,a),{cx:ym,cy:mm,radius:Qa,startX:pA,startY:yA,stopX:bm,stopY:wm,startAngle:Pn.ang+Math.PI/2*ei,endAngle:on.ang-Math.PI/2*ei,counterClockwise:Nu})}var os=.01,p$=Math.sqrt(2*os),St={};St.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}};St.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)}};St.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")}};St.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)]};St.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*os)),S=Math.max(C,Math.log(u*os));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]};St.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"};St.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=Lm(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)}};St.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,k=function(L,oe){return L>0?Math.max(L-oe,0):Math.min(L+oe,0)},M=k(D,A),N=k(I,P),z=!1;w===u?b=Math.abs(M)>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:M,$=W?I:D,X=Lm($),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 de=Math.abs($)<=h/2,se=Math.abs(D)<=g/2;if(de){var Z=(c.x1+c.x2)/2,Q=c.y1,ae=c.y2;t.segpts=[Z,Q,Z,ae]}else if(se){var te=(c.y1+c.y2)/2,ce=c.x1,_e=c.x2;t.segpts=[ce,te,_e,te]}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,xe=c.x1,ge=c.x2;t.segpts=[xe,fe,ge,fe]}else if(U){var be=(c.x1+c.x2)/2,Ae=c.y1,Ie=c.y2;t.segpts=[be,Ae,be,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,ke=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(ke)}};St.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=!Me(t.startX)||!Me(t.startY),m=!Me(t.arrowStartX)||!Me(t.arrowStartY),b=!Me(t.endX)||!Me(t.endY),w=!Me(t.arrowEndX)||!Me(t.arrowEndY),x=3,C=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth,T=x*C,S=ai({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),_=S<T,A=ai({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},k=Math.sqrt(I.x*I.x+I.y*I.y),M={x:I.x/k,y:I.y/k},N=Math.max(i,o),z={x:t.ctrlpts[0]+M.x*2*N,y:t.ctrlpts[1]+M.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]+M.x*(T-S),t.ctrlpts[1]=t.ctrlpts[1]+M.y*(T-S)):(t.ctrlpts[0]=W[0]+M.x*T,t.ctrlpts[1]=W[1]+M.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)}};St.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(jm({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}}}}};St.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||Me(e.startX)&&Me(e.startY)&&Me(e.endX)&&Me(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."))};St.findEdgeControlPoints=function(r){var e=this;if(!(!r||r.length===0)){for(var t=this,n=t.cy,a=n.hasCompoundNodes(),i=new jn,o=function(P,D){return[].concat(Wu(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"||pa(h,"segments")||h==="straight"||h==="straight-triangle"||pa(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,k=o(D,I),M=i.get(k),N;if(!M.hasUnbundled){var z=M.eles[0].parallelEdges().filter(function(ke){return ke.isBundledBezier()});Mm(M.eles),z.forEach(function(ke){return M.eles.push(ke)}),M.eles.sort(function(ke,pe){return ke.poolIndex()-pe.poolIndex()})}var W=M.eles[0],q=W.source(),$=W.target();if(q.poolIndex()>$.poolIndex()){var X=q;q=$,$=X}var Y=M.srcPos=q.position(),K=M.tgtPos=$.position(),ee=M.srcW=q.outerWidth(),le=M.srcH=q.outerHeight(),G=M.tgtW=$.outerWidth(),V=M.tgtH=$.outerHeight(),j=M.srcShape=t.nodeShapes[e.getNodeShape(q)],re=M.tgtShape=t.nodeShapes[e.getNodeShape($)],de=M.srcCornerRadius=q.pstyle("corner-radius").value==="auto"?"auto":q.pstyle("corner-radius").pfValue,se=M.tgtCornerRadius=$.pstyle("corner-radius").value==="auto"?"auto":$.pstyle("corner-radius").pfValue,Z=M.tgtRs=$._private.rscratch,Q=M.srcRs=q._private.rscratch;M.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var ae=0;ae<M.eles.length;ae++){var te=M.eles[ae],ce=te[0]._private.rscratch,_e=te.pstyle("curve-style").value,ve=_e==="unbundled-bezier"||pa(_e,"segments")||pa(_e,"taxi"),U=!q.same(te.source());if(!M.calculatedIntersection&&q!==$&&(M.hasBezier||M.hasUnbundled)){M.calculatedIntersection=!0;var fe=j.intersectLine(Y.x,Y.y,ee,le,K.x,K.y,0,de,Q),xe=M.srcIntn=fe,ge=re.intersectLine(K.x,K.y,G,V,Y.x,Y.y,0,se,Z),be=M.tgtIntn=ge,Ae=M.intersectionPts={x1:fe[0],x2:ge[0],y1:fe[1],y2:ge[1]},Ie=M.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);Me(He)&&He>=p$||(He=Math.sqrt(Math.max(Oe*Oe,os)+Math.max(Be*Be,os)));var Ve=M.vector={x:Oe,y:Be},Xe=M.vectorNorm={x:Ve.x/He,y:Ve.y/He},er={x:-Xe.y,y:Xe.x};M.nodesOverlap=!Me(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,de,Q),M.vectorNormInverse=er,N={nodesOverlap:M.nodesOverlap,dirCounts:M.dirCounts,calculatedIntersection:!0,hasBezier:M.hasBezier,hasUnbundled:M.hasUnbundled,eles:M.eles,srcPos:K,srcRs:Z,tgtPos:Y,tgtRs:Q,srcW:G,srcH:V,tgtW:ee,tgtH:le,srcIntn:be,tgtIntn:xe,srcShape:re,tgtShape:j,posPts:{x1:Ie.x2,y1:Ie.y2,x2:Ie.x1,y2:Ie.y1},intersectionPts:{x1:Ae.x2,y1:Ae.y2,x2:Ae.x1,y2:Ae.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:M;ce.nodesOverlap=$e.nodesOverlap,ce.srcIntn=$e.srcIntn,ce.tgtIntn=$e.tgtIntn,ce.isRound=_e.startsWith("round"),a&&(q.isParent()||q.isChild()||$.isParent()||$.isChild())&&(q.parents().anySame($)||$.parents().anySame(q)||q.same($)&&q.isParent())?e.findCompoundLoopPoints(te,$e,ae,ve):q===$?e.findLoopPoints(te,$e,ae,ve):_e.endsWith("segments")?e.findSegmentsPoints(te,$e):_e.endsWith("taxi")?e.findTaxiPoints(te,$e):_e==="straight"||!ve&&M.eles.length%2===1&&ae===Math.floor(M.eles.length/2)?e.findStraightEdgePoints(te):e.findBezierPoints(te,$e,ae,ve,U),e.findEndpoints(te),e.tryToCorrectInvalidPoints(te,$e),e.checkForInvalidEdgeWarning(te),e.storeAllpts(te),e.storeEdgeProjections(te),e.calculateArrowAngles(te),e.recalculateEdgeLabelProjections(te),e.calculateLabelAngles(te)}},_=0;_<s.length;_++)S();this.findHaystackPoints(l)}};function bA(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}}St.getSegmentPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if(t==="segments")return bA(e.segpts)};St.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 bA(e.ctrlpts)};St.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var bs={};bs.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)}};bs.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=pa(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,k=r.pstyle("source-endpoint"),M=I?"outside-to-node":k.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=k,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=(k==null||(a=k.pfValue)===null||a===void 0?void 0:a.length)===2?k.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 de=l._private.rscratch,se=de.labelWidth,Z=de.labelHeight,Q=de.labelX,ae=de.labelY,te=se/2,ce=Z/2,_e=l.pstyle("text-valign").value;_e==="top"?ae-=ce:_e==="bottom"&&(ae+=ce);var ve=l.pstyle("text-halign").value;ve==="left"?Q-=te:ve==="right"&&(Q+=te);var U=rs(Y[0],Y[1],[Q-te,ae-ce,Q+te,ae-ce,Q+te,ae+ce,Q-te,ae+ce],c.x,c.y);if(U.length>0){var fe=u,xe=Xa(fe,Gi(o)),ge=Xa(fe,Gi(U)),be=xe;if(ge<xe&&(o=U,be=ge),U.length>2){var Ae=Xa(fe,{x:U[2],y:U[3]});Ae<be&&(o=[U[2],U[3]])}}}var Ie=bu(o,$,i.arrowShapes[d].spacing(r)+g),Be=bu(o,$,i.arrowShapes[d].gap(r)+g);if(w.endX=Be[0],w.endY=Be[1],w.arrowEndX=Ie[0],w.arrowEndY=Ie[1],M==="inside-to-node")o=[u.x,u.y];else if(k.units)o=this.manualEndptToPx(s,k);else if(M==="outside-to-line")o=w.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=[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),M==="outside-to-node-or-label"||M==="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,ke=Ve/2,pe=s.pstyle("text-valign").value;pe==="top"?er-=ke:pe==="bottom"&&(er+=ke);var L=s.pstyle("text-halign").value;L==="left"?Xe-=$e:L==="right"&&(Xe+=$e);var oe=rs(K[0],K[1],[Xe-$e,er-ke,Xe+$e,er-ke,Xe+$e,er+ke,Xe-$e,er+ke],u.x,u.y);if(oe.length>0){var me=c,we=Xa(me,Gi(o)),Ce=Xa(me,Gi(oe)),qe=we;if(Ce<we&&(o=[oe[0],oe[1]],qe=Ce),oe.length>2){var Pe=Xa(me,{x:oe[2],y:oe[3]});Pe<qe&&(o=[oe[2],oe[3]])}}}var Ge=bu(o,X,i.arrowShapes[h].spacing(r)+p),Fe=bu(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&&(!Me(w.startX)||!Me(w.startY)||!Me(w.endX)||!Me(w.endY)?w.badLine=!0:w.badLine=!1)};bs.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}}};bs.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 Ym={};function y$(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)})}}Ym.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)y$(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};Ym.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Mn={};Mn.recalculateNodeLabelProjection=function(r){var e=r.pstyle("label").strValue;if(!Ea(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 wA=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n=n*-1),n},xA=function(e,t){var n=t.x-e.x,a=t.y-e.y;return wA(n,a)},m$=function(e,t,n,a){var i=es(0,a-.001,1),o=es(0,a+.001,1),s=Ki(e,t,n,i),l=Ki(e,t,n,o);return xA(s,l)};Mn.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){Kn(t.rscratch,d,h,g),Kn(t.rstyle,d,h,g)};o("labelX",null,e.x),o("labelY",null,e.y);var s=wA(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 k=ai(A,P),M=_.segments[_.segments.length-1],N={p0:A,p1:P,t0:D,t1:I,startDist:M?M.startDist+M.length:0,length:k};_.segments.push(N),_.length+=k}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,k=g?P.t0+I*D:P.t1-I*D;k=es(0,k,1),e=Ki(A.p0,A.p1,A.p2,k),h=m$(A.p0,A.p1,A.p2,k);break}case"straight":case"segments":case"haystack":{for(var M=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=ai(W,q),z=M,M+=N,!(M>=p));X+=2);var Y=p-z,K=Y/N;K=es(0,K,1),e=zN(W,q,K),h=xA(W,q);break}}o("labelX",d,e.x),o("labelY",d,e.y),o("labelAutoAngle",d,h)}};u("source"),u("target"),this.applyLabelDimensions(r)}};Mn.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))};Mn.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),a=ni(n,r._private.labelDimsKey);if(Nt(t.rscratch,"prefixedLabelDimsKey",e)!==a){Kn(t.rscratch,"prefixedLabelDimsKey",e,a);var i=this.calculateLabelDimensions(r,n),o=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,l=Nt(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;Kn(t.rstyle,"labelWidth",e,h),Kn(t.rscratch,"labelWidth",e,h),Kn(t.rstyle,"labelHeight",e,g),Kn(t.rscratch,"labelHeight",e,g),Kn(t.rscratch,"labelLineHeight",e,d)}};Mn.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?(Kn(t.rscratch,le,e,G),G):Nt(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=[],E=/[\s\u200b]+|$/g,m=0;m<c.length;m++){var b=c[m],w=this.calculateLabelDimensions(r,b),x=w.width;if(g){var C=b.split("").join(u);b=C}if(x>d){var T=b.matchAll(E),S="",_=0,A
|
|
16
|
-
`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var W=r.pstyle("text-max-width").pfValue,q="",$="…",X=!1;if(this.calculateLabelDimensions(r,a).width<W)return a;for(var Y=0;Y<a.length;Y++){var K=this.calculateLabelDimensions(r,q+a[Y]+$).width;if(K>W)break;q+=a[Y],Y===a.length-1&&(X=!0)}return X||(q+=$),q}return a};
|
|
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}};Mn.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};Mn.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 EA={},Yx=28,Zx=!1;EA.getNodeShape=function(r){var e=this,t=r.pstyle("shape").value;if(t==="cutrectangle"&&(r.width()<Yx||r.height()<Yx))return Zx||(Er("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),Zx=!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 Cl={};Cl.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)};Cl.onUpdateEleCalcs=function(r){var e=this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[];e.push(r)};Cl.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 _l={};_l.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)}}};_l.invalidateCachedZSortedEles=function(){this.cachedZSortedEles=null};_l.getCachedZSortedEles=function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(nA),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e};var CA={};[ui,el,St,bs,Ym,Mn,EA,Cl,_l].forEach(function(r){Ye(CA,r)});var _A={};_A.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 oo={};oo.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)};oo.binder=function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||Dq(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}};oo.nodeIsDraggable=function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()};oo.nodeIsGrabbable=function(r){return this.nodeIsDraggable(r)&&r.interactive()};oo.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,me,we){L==null&&(L=r.cy);for(var Ce=0;Ce<oe.length;Ce++){var qe=oe[Ce];L.emit({originalEvent:me,type:qe,position:we})}},i=function(L){return L.shiftKey||L.metaKey||L.ctrlKey},o=function(L,oe){var me=!0;if(r.cy.hasCompoundNodes()&&L&&L.pannable())for(var we=0;oe&&we<oe.length;we++){var L=oe[we];if(L.isNode()&&L.isParent()&&!L.pannable()){me=!1;break}}else me=!0;return me},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 me=oe.addToList,we=me.has(L);!we&&L.grabbable()&&!L.locked()&&(me.merge(L),s(L))},p=function(L,oe){if(L.cy().hasCompoundNodes()&&!(oe.inDragLayer==null&&oe.addToList==null)){var me=L.descendants();oe.inDragLayer&&(me.forEach(u),me.connectedEdges().forEach(u)),oe.addToList&&g(me,oe)}},E=function(L,oe){oe=oe||{};var me=L.cy().hasCompoundNodes();oe.inDragLayer&&(L.forEach(u),L.neighborhood().stdFilter(function(we){return!me||we.isEdge()}).forEach(u)),oe.addToList&&L.forEach(function(we){g(we,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 me=L.ancestors().orphans();if(!me.same(L)){var we=me.descendants().spawnSelf().merge(me).unmerge(L).unmerge(L.descendants()),Ce=we.connectedEdges();oe.inDragLayer&&(Ce.forEach(u),we.forEach(u)),oe.addToList&&we.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],me=oe.removedNodes;if(me)for(var we=0;we<me.length;we++){var Ce=me[we];if(Ce===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=gs(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(),me=oe[0],we=oe[1],Ce=oe[2],qe=oe[3],Pe=L.touches?L.touches:[L],Ge=!1,Fe=0;Fe<Pe.length;Fe++){var je=Pe[Fe];if(me<=je.clientX&&je.clientX<=me+Ce&&we<=je.clientY&&je.clientY<=we+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,me=[L.clientX,L.clientY],we=r.projectIntoViewport(me[0],me[1]),Ce=r.selection,qe=r.findNearestElements(we[0],we[1],!0,!1),Pe=qe[0],Ge=r.dragData.possibleDragElements;r.hoverData.mdownPos=we,r.hoverData.mdownGPos=me;var Fe=function(ar){return{originalEvent:L,type:ar,position:{x:we[0],y:we[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:we[0],y:we[1]}};Pe?(Pe.activate(),Pe.emit(or),r.hoverData.down=Pe):oe.emit(or),r.hoverData.downTime=new Date().getTime(),r.hoverData.cxtDragged=!1}else if(L.which==1){Pe&&Pe.activate();{if(Pe!=null&&r.nodeIsGrabbable(Pe)){var nr=function(ar){ar.emit(Fe("grab"))};if(d(Pe),!Pe.selected())Ge=r.dragData.possibleDragElements=oe.collection(),m(Pe,{addToList:Ge}),Pe.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}),Pe.emit(Fe("grabon")),We.forEach(nr)}r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Pe,r.hoverData.downs=qe,r.hoverData.downTime=new Date().getTime()}a(Pe,["mousedown","tapstart","vmousedown"],L,{x:we[0],y:we[1]}),Pe==null?(Ce[4]=1,r.data.bgActivePosistion={x:we[0],y:we[1]},r.redrawHint("select",!0),r.redraw()):Pe.pannable()&&(Ce[4]=1),je()}Ce[0]=Ce[2]=we[0],Ce[1]=Ce[3]=we[1]}},!1);var I=n(r.container);r.registerBinding([e,I],"mousemove",function(L){var oe=r.hoverData.capture;if(!(!oe&&!D(L))){var me=!1,we=r.cy,Ce=we.zoom(),qe=[L.clientX,L.clientY],Pe=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(Pe[0],Pe[1],!0,!1));var nr=r.hoverData.last,We=r.hoverData.down,ur=[Pe[0]-je[2],Pe[1]-je[3]],ar=r.dragData.possibleDragElements,Wr;if(Fe){var Mr=qe[0]-Fe[0],lt=Mr*Mr,kr=qe[1]-Fe[1],Kr=kr*kr,Nr=lt+Kr;r.hoverData.isOverThresholdDrag=Wr=Nr>=r.desktopTapThreshold2}var Xr=i(L);Wr&&(r.hoverData.tapholdCancelled=!0);var Cn=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])};me=!0,a(or,["mousemove","vmousemove","tapdrag"],L,{x:Pe[0],y:Pe[1]});var $r=function(Mt){return{originalEvent:L,type:Mt,position:{x:Pe[0],y:Pe[1]}}},dn=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||we.emit($r("boxstart")),je[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(r.hoverData.which===3){if(Wr){var vn=$r("cxtdrag");We?We.emit(vn):we.emit(vn),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||or!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit($r("cxtdragout")),r.hoverData.cxtOver=or,or&&or.emit($r("cxtdragover")))}}else if(r.hoverData.dragging){if(me=!0,we.panningEnabled()&&we.userPanningEnabled()){var ra;if(r.hoverData.justStartedPan){var hi=r.hoverData.mdownPos;ra={x:(Pe[0]-hi[0])*Ce,y:(Pe[1]-hi[1])*Ce},r.hoverData.justStartedPan=!1}else ra={x:ur[0]*Ce,y:ur[1]*Ce};we.panBy(ra),we.emit($r("dragpan")),r.hoverData.dragged=!0}Pe=r.projectIntoViewport(L.clientX,L.clientY)}else if(je[4]==1&&(We==null||We.pannable())){if(Wr){if(!r.hoverData.dragging&&we.boxSelectionEnabled()&&(Xr||!we.panningEnabled()||!we.userPanningEnabled()))dn();else if(!r.hoverData.selecting&&we.panningEnabled()&&we.userPanningEnabled()){var On=o(We,r.hoverData.downs);On&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,je[4]=0,r.data.bgActivePosistion=Gi(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:Pe[0],y:Pe[1]}),or&&a(or,["mouseover","tapdragover"],L,{x:Pe[0],y:Pe[1]}),r.hoverData.last=or),We)if(Wr){if(we.boxSelectionEnabled()&&Xr)We&&We.grabbed()&&(b(ar),We.emit($r("freeon")),ar.emit($r("free")),r.dragData.didDrag&&(We.emit($r("dragfreeon")),ar.emit($r("dragfree")))),dn();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(Me(ur[0])&&Me(ur[1])&&(at.x+=ur[0],at.y+=ur[1],ft)){var bt=r.hoverData.dragDelta;bt&&Me(bt[0])&&Me(bt[1])&&(at.x+=bt[0],at.y+=bt[1])}r.hoverData.draggingEles=!0,ar.silentShift(at).emit($r("position")).emit($r("drag")),r.redrawHint("drag",!0),r.redraw()}}else Cn();me=!0}if(je[2]=Pe[0],je[3]=Pe[1],me)return L.stopPropagation&&L.stopPropagation(),L.preventDefault&&L.preventDefault(),!1}},!1);var k,M,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 me=r.cy,we=r.projectIntoViewport(L.clientX,L.clientY),Ce=r.selection,qe=r.findNearestElement(we[0],we[1],!0,!1),Pe=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(Mr){return{originalEvent:L,type:Mr,position:{x:we[0],y:we[1]}}};if(r.hoverData.which===3){var or=je("cxttapend");if(Ge?Ge.emit(or):me.emit(or),!r.hoverData.cxtDragged){var nr=je("cxttap");Ge?Ge.emit(nr):me.emit(nr)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(r.hoverData.which===1){if(a(qe,["mouseup","tapend","vmouseup"],L,{x:we[0],y:we[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(a(Ge,["click","tap","vclick"],L,{x:we[0],y:we[1]}),M=!1,L.timeStamp-N<=me.multiClickDebounceTime()?(k&&clearTimeout(k),M=!0,N=null,a(Ge,["dblclick","dbltap","vdblclick"],L,{x:we[0],y:we[1]})):(k=setTimeout(function(){M||a(Ge,["oneclick","onetap","voneclick"],L,{x:we[0],y:we[1]})},me.multiClickDebounceTime()),N=L.timeStamp)),Ge==null&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!i(L)&&(me.$(t).unselect(["tapunselect"]),Pe.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Pe=me.collection()),qe==Ge&&!r.dragData.didDrag&&!r.hoverData.selecting&&qe!=null&&qe._private.selectable&&(r.hoverData.dragging||(me.selectionType()==="additive"||Fe?qe.selected()?qe.unselect(["tapunselect"]):qe.select(["tapselect"]):Fe||(me.$(t).unmerge(qe).unselect(["tapunselect"]),qe.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var We=me.collection(r.getAllInBox(Ce[0],Ce[1],Ce[2],Ce[3]));r.redrawHint("select",!0),We.length>0&&r.redrawHint("eles",!0),me.emit(je("boxend"));var ur=function(Mr){return Mr.selectable()&&!Mr.selected()};me.selectionType()==="additive"||Fe||me.$(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()),!Ce[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var ar=Ge&&Ge.grabbed();b(Pe),ar&&(Ge.emit(je("freeon")),Pe.emit(je("free")),r.dragData.didDrag&&(Ge.emit(je("dragfreeon")),Pe.emit(je("dragfree"))))}}Ce[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 me=0;me<L.length;me++)if(L[me]%oe!==0)return!1;return!0},Y=function(L){for(var oe=Math.abs(L[0]),me=1;me<L.length;me++)if(Math.abs(L[me])!==oe)return!1;return!0},K=function(L){var oe=!1,me=L.deltaY;if(me==null&&(L.wheelDeltaY!=null?me=L.wheelDeltaY/4:L.wheelDelta!=null&&(me=L.wheelDelta/4)),me!==0){if(q==null)if(z.length>=W){var we=z;if(q=X(we,5),!q){var Ce=Math.abs(we[0]);q=Y(we)&&Ce>5}if(q)for(var qe=0;qe<we.length;qe++)$=Math.min(Math.abs(we[qe]),$)}else z.push(me),oe=!0;else q&&($=Math.min(Math.abs(me),$));if(!r.scrollingPage){var Pe=r.cy,Ge=Pe.zoom(),Fe=Pe.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(Pe.panningEnabled()&&Pe.userPanningEnabled()&&Pe.zoomingEnabled()&&Pe.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(me)>5&&(me=Lm(me)*5),nr=me/-250,q&&(nr/=$,nr*=3),nr=nr*r.wheelSensitivity;var We=L.deltaMode===1;We&&(nr*=33);var ur=Pe.zoom()*Math.pow(10,nr);L.type==="gesturechange"&&(ur=r.gestureStartZoom*L.scale),Pe.zoom({level:ur,renderedPosition:{x:or[0],y:or[1]}}),Pe.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,de,se,Z,Q,ae,te,ce,_e=function(L,oe,me,we){return Math.sqrt((me-L)*(me-L)+(we-oe)*(we-oe))},ve=function(L,oe,me,we){return(me-L)*(me-L)+(we-oe)*(we-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,me=r.touchData.now,we=r.touchData.earlier;if(L.touches[0]){var Ce=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);me[0]=Ce[0],me[1]=Ce[1]}if(L.touches[1]){var Ce=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);me[2]=Ce[0],me[3]=Ce[1]}if(L.touches[2]){var Ce=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);me[4]=Ce[0],me[5]=Ce[1]}var qe=function(Xr){return{originalEvent:L,type:Xr,position:{x:me[0],y:me[1]}}};if(L.touches[1]){r.touchData.singleTouchMoved=!0,b(r.dragData.touchDragEles);var Pe=r.findContainerClientCoords();Z=Pe[0],Q=Pe[1],ae=Pe[2],te=Pe[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,ce=0<=ee&&ee<=ae&&0<=G&&G<=ae&&0<=le&&le<=te&&0<=V&&V<=te;var Ge=oe.pan(),Fe=oe.zoom();j=_e(ee,le,G,V),re=ve(ee,le,G,V),de=[(ee+G)/2,(le+V)/2],se=[(de[0]-Ge.x)/Fe,(de[1]-Ge.y)/Fe];var je=200,or=je*je;if(re<or&&!L.touches[2]){var nr=r.findNearestElement(me[0],me[1],!0,!0),We=r.findNearestElement(me[2],me[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(me[0],me[1],!0,!0),ar=ur[0];if(ar!=null&&(ar.activate(),r.touchData.start=ar,r.touchData.starts=ur,r.nodeIsGrabbable(ar))){var Wr=r.dragData.touchDragEles=oe.collection(),Mr=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),ar.selected()?(Mr=oe.$(function(Nr){return Nr.selected()&&r.nodeIsGrabbable(Nr)}),E(Mr,{addToList:Wr})):m(ar,{addToList:Wr}),d(ar),ar.emit(qe("grabon")),Mr?Mr.forEach(function(Nr){Nr.emit(qe("grab"))}):ar.emit(qe("grab"))}a(ar,["touchstart","tapstart","vmousedown"],L,{x:me[0],y:me[1]}),ar==null&&(r.data.bgActivePosistion={x:Ce[0],y:Ce[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:me[0],y:me[1]})},r.tapholdDuration)}}if(L.touches.length>=1){for(var lt=r.touchData.startPosition=[null,null,null,null,null,null],kr=0;kr<me.length;kr++)lt[kr]=we[kr]=me[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 me=r.selection,we=r.cy,Ce=r.touchData.now,qe=r.touchData.earlier,Pe=we.zoom();if(L.touches[0]){var Ge=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ce[0]=Ge[0],Ce[1]=Ge[1]}if(L.touches[1]){var Ge=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Ce[2]=Ge[0],Ce[3]=Ge[1]}if(L.touches[2]){var Ge=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Ce[4]=Ge[0],Ce[5]=Ge[1]}var Fe=function(bi){return{originalEvent:L,type:bi,position:{x:Ce[0],y:Ce[1]}}},je=r.touchData.startGPosition,or;if(oe&&L.touches[0]&&je){for(var nr=[],We=0;We<Ce.length;We++)nr[We]=Ce[We]-qe[We];var ur=L.touches[0].clientX-je[0],ar=ur*ur,Wr=L.touches[0].clientY-je[1],Mr=Wr*Wr,lt=ar+Mr;or=lt>=r.touchTapThreshold2}if(oe&&r.touchData.cxt){L.preventDefault();var kr=L.touches[0].clientX-Z,Kr=L.touches[0].clientY-Q,Nr=L.touches[1].clientX-Z,Xr=L.touches[1].clientY-Q,Cn=ve(kr,Kr,Nr,Xr),$r=Cn/re,dn=150,vn=dn*dn,ra=1.5,hi=ra*ra;if($r>=hi||Cn>=vn){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var On=Fe("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(On),r.touchData.start=null):we.emit(On)}}if(oe&&r.touchData.cxt){var On=Fe("cxtdrag");r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(On):we.emit(On),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var ft=r.findNearestElement(Ce[0],Ce[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]&&we.boxSelectionEnabled())L.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||we.emit(Fe("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,me[4]=1,!me||me.length===0||me[0]===void 0?(me[0]=(Ce[0]+Ce[2]+Ce[4])/3,me[1]=(Ce[1]+Ce[3]+Ce[5])/3,me[2]=(Ce[0]+Ce[2]+Ce[4])/3+1,me[3]=(Ce[1]+Ce[3]+Ce[5])/3+1):(me[2]=(Ce[0]+Ce[2]+Ce[4])/3,me[3]=(Ce[1]+Ce[3]+Ce[5])/3),r.redrawHint("select",!0),r.redraw();else if(oe&&L.touches[1]&&!r.touchData.didSelect&&we.zoomingEnabled()&&we.panningEnabled()&&we.userZoomingEnabled()&&we.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 Na=at[bt]._private;Na.grabbed=!1,Na.rscratch.inDragLayer=!1}}var Mt=r.touchData.start,kr=L.touches[0].clientX-Z,Kr=L.touches[0].clientY-Q,Nr=L.touches[1].clientX-Z,Xr=L.touches[1].clientY-Q,Rs=_e(kr,Kr,Nr,Xr),Wl=Rs/j;if(ce){var gi=kr-ee,Ul=Kr-le,pi=Nr-G,Hl=Xr-V,Kl=(gi+pi)/2,jl=(Ul+Hl)/2,ta=we.zoom(),yi=ta*Wl,Fa=we.pan(),As=se[0]*ta+Fa.x,Ps=se[1]*ta+Fa.y,Yl={x:-yi/ta*(As-Fa.x-Kl)+As,y:-yi/ta*(Ps-Fa.y-jl)+Ps};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")))}we.viewport({zoom:yi,pan:Yl,cancelOnFailedZoom:!0}),we.emit(Fe("pinchzoom")),j=Rs,ee=kr,le=Kr,G=Nr,V=Xr,r.pinching=!0}if(L.touches[0]){var Ge=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ce[0]=Ge[0],Ce[1]=Ge[1]}if(L.touches[1]){var Ge=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Ce[2]=Ge[0],Ce[3]=Ge[1]}if(L.touches[2]){var Ge=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Ce[4]=Ge[0],Ce[5]=Ge[1]}}else if(L.touches[0]&&!r.touchData.didSelect){var Vt=r.touchData.start,mi=r.touchData.last,ft;if(!r.hoverData.draggingEles&&!r.swipePanning&&(ft=r.findNearestElement(Ce[0],Ce[1],!0,!0)),oe&&Vt!=null&&L.preventDefault(),oe&&Vt!=null&&r.nodeIsDraggable(Vt))if(or){var at=r.dragData.touchDragEles,ho=!r.dragData.didDrag;ho&&E(at,{inDragLayer:!0}),r.dragData.didDrag=!0;var na={x:0,y:0};if(Me(nr[0])&&Me(nr[1])&&(na.x+=nr[0],na.y+=nr[1],ho)){r.redrawHint("eles",!0);var Tt=r.touchData.dragDelta;Tt&&Me(Tt[0])&&Me(Tt[1])&&(na.x+=Tt[0],na.y+=Tt[1])}r.hoverData.draggingEles=!0,at.silentShift(na).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 Tt=r.touchData.dragDelta=r.touchData.dragDelta||[];Tt.length===0?(Tt.push(nr[0]),Tt.push(nr[1])):(Tt[0]+=nr[0],Tt[1]+=nr[1])}if(a(Vt||ft,["touchmove","tapdrag","vmousemove"],L,{x:Ce[0],y:Ce[1]}),(!Vt||!Vt.grabbed())&&ft!=mi&&(mi&&mi.emit(Fe("tapdragout")),ft&&ft.emit(Fe("tapdragover"))),r.touchData.last=ft,oe)for(var bt=0;bt<Ce.length;bt++)Ce[bt]&&r.touchData.startPosition[bt]&&or&&(r.touchData.singleTouchMoved=!0);if(oe&&(Vt==null||Vt.pannable())&&we.panningEnabled()&&we.userPanningEnabled()){var Zl=o(Vt,r.touchData.starts);Zl&&(L.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=Gi(r.touchData.startPosition)),r.swipePanning?(we.panBy({x:nr[0]*Pe,y:nr[1]*Pe}),we.emit(Fe("dragpan"))):or&&(r.swipePanning=!0,we.panBy({x:ur*Pe,y:Wr*Pe}),we.emit(Fe("dragpan")),Vt&&(Vt.unactivate(),r.redrawHint("select",!0),r.touchData.start=null)));var Ge=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Ce[0]=Ge[0],Ce[1]=Ge[1]}}for(var We=0;We<Ce.length;We++)qe[We]=Ce[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 xe;r.registerBinding(e,"touchcancel",xe=function(L){var oe=r.touchData.start;r.touchData.capture=!1,oe&&oe.unactivate()});var ge,be,Ae,Ie;if(r.registerBinding(e,"touchend",ge=function(L){var oe=r.touchData.start,me=r.touchData.capture;if(me)L.touches.length===0&&(r.touchData.capture=!1),L.preventDefault();else return;var we=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var Ce=r.cy,qe=Ce.zoom(),Pe=r.touchData.now,Ge=r.touchData.earlier;if(L.touches[0]){var Fe=r.projectIntoViewport(L.touches[0].clientX,L.touches[0].clientY);Pe[0]=Fe[0],Pe[1]=Fe[1]}if(L.touches[1]){var Fe=r.projectIntoViewport(L.touches[1].clientX,L.touches[1].clientY);Pe[2]=Fe[0],Pe[3]=Fe[1]}if(L.touches[2]){var Fe=r.projectIntoViewport(L.touches[2].clientX,L.touches[2].clientY);Pe[4]=Fe[0],Pe[5]=Fe[1]}var je=function(vn){return{originalEvent:L,type:vn,position:{x:Pe[0],y:Pe[1]}}};oe&&oe.unactivate();var or;if(r.touchData.cxt){if(or=je("cxttapend"),oe?oe.emit(or):Ce.emit(or),!r.touchData.cxtDragged){var nr=je("cxttap");oe?oe.emit(nr):Ce.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]&&Ce.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var We=Ce.collection(r.getAllInBox(we[0],we[1],we[2],we[3]));we[0]=void 0,we[1]=void 0,we[2]=void 0,we[3]=void 0,we[4]=0,r.redrawHint("select",!0),Ce.emit(je("boxend"));var ur=function(vn){return vn.selectable()&&!vn.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 Wr=oe._private.grabbed;b(ar),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Wr&&(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:Pe[0],y:Pe[1]}),oe.unactivate(),r.touchData.start=null}else{var Mr=r.findNearestElement(Pe[0],Pe[1],!0,!0);a(Mr,["touchend","tapend","vmouseup","tapdragout"],L,{x:Pe[0],y:Pe[1]})}var lt=r.touchData.startPosition[0]-Pe[0],kr=lt*lt,Kr=r.touchData.startPosition[1]-Pe[1],Nr=Kr*Kr,Xr=kr+Nr,Cn=Xr*qe*qe;r.touchData.singleTouchMoved||(oe||Ce.$(":selected").unselect(["tapunselect"]),a(oe,["tap","vclick"],L,{x:Pe[0],y:Pe[1]}),be=!1,L.timeStamp-Ie<=Ce.multiClickDebounceTime()?(Ae&&clearTimeout(Ae),be=!0,Ie=null,a(oe,["dbltap","vdblclick"],L,{x:Pe[0],y:Pe[1]})):(Ae=setTimeout(function(){be||a(oe,["onetap","voneclick"],L,{x:Pe[0],y:Pe[1]})},Ce.multiClickDebounceTime()),Ie=L.timeStamp)),oe!=null&&!r.dragData.didDrag&&oe._private.selectable&&Cn<r.touchTapThreshold2&&!r.pinching&&(Ce.selectionType()==="single"?(Ce.$(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 $r=0;$r<Pe.length;$r++)Ge[$r]=Pe[$r];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 me=Be[oe];if(me.event.pointerId===L.pointerId){Be.splice(oe,1);return}}},er=function(L){var oe=Be.filter(function(me){return me.event.pointerId===L.pointerId})[0];oe.event=L,oe.touch=Oe(L)},$e=function(L){L.touches=Be.map(function(oe){return oe.touch})},ke=function(L){return L.pointerType==="mouse"||L.pointerType===4};r.registerBinding(r.container,"pointerdown",function(pe){ke(pe)||(pe.preventDefault(),Ve(pe),$e(pe),U(pe))}),r.registerBinding(r.container,"pointerup",function(pe){ke(pe)||(Xe(pe),$e(pe),ge(pe))}),r.registerBinding(r.container,"pointercancel",function(pe){ke(pe)||(Xe(pe),$e(pe),xe(pe))}),r.registerBinding(r.container,"pointermove",function(pe){ke(pe)||(pe.preventDefault(),er(pe),$e(pe),fe(pe))})}};var Xn={};Xn.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 rs(s,l,this.points,n,a,i/2,o/2,u)},checkPoint:function(n,a,i,o,s,l,u,c){return Zn(n,a,this.points,l,u,o,s,[0,-1],i)},hasMiterBounds:r!=="rectangle",miterBounds:function(n,a,i,o,s,l){return HN(this.points,n,a,i,o,s)}}};Xn.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 eF(i,o,e,t,n/2+s,a/2+s)},checkPoint:function(e,t,n,a,i,o,s,l){return ti(e,t,a,i,o,s,n)}}};Xn.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"?SR(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]=jm(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 tF(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 JN(n,a,this.points,l,u,o,s,this.getOrCreateCorners(l,u,o,s,c,d,"corners"))}}};Xn.generateRoundRectangle=function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:Dt(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 CR(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"?_a(a,i):l,l=Math.min(u,c,l);var d=l*2;return!!(Zn(e,t,this.points,o,s,a,i-d,[0,-1],n)||Zn(e,t,this.points,o,s,a-d,i,[0,-1],n)||ti(e,t,d,d,o-u+l,s-c+l,n)||ti(e,t,d,d,o+u-l,s-c+l,n)||ti(e,t,d,d,o+u-l,s+c-l,n)||ti(e,t,d,d,o-u+l,s+c-l,n))}}};Xn.generateCutRectangle=function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:qm(),points:Dt(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 rs(i,o,c,e,t)},checkPoint:function(e,t,n,a,i,o,s,l){var u=l==="auto"?this.cornerLength:l;if(Zn(e,t,this.points,o,s,a,i-2*u,[0,-1],n)||Zn(e,t,this.points,o,s,a-2*u,i,[0,-1],n))return!0;var c=this.generateCutTrianglePts(a,i,o,s);return Ft(e,t,c.topLeft)||Ft(e,t,c.topRight)||Ft(e,t,c.bottomRight)||Ft(e,t,c.bottomLeft)}}};Xn.generateBarrel=function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:Dt(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=Ki({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},u),w=Ki({x:m[0],y:m[1]},{x:m[2],y:m[3]},{x:m[4],y:m[5]},c),x=Ki({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 rs(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=um(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=um(a,i),c=u.heightOffset,d=u.widthOffset;if(Zn(e,t,this.points,o,s,a,i-2*c,[0,-1],n)||Zn(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],k=D[2],M=D[0],N=D[5],z=D[1],W=Math.min(I,M),q=Math.max(I,M),$=Math.min(N,z),X=Math.max(N,z);if(W<=A&&A<=q&&$<=P&&P<=X){var Y=nF(I,k,M),K=YN(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}}};Xn.generateBottomRoundrectangle=function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:Dt(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=ma(i,o,e,t,u,c,h,d,!1);return g.length>0?g:CR(i,o,e,t,n,a,s,l)},checkPoint:function(e,t,n,a,i,o,s,l){l=l==="auto"?_a(a,i):l;var u=2*l;if(Zn(e,t,this.points,o,s,a,i-u,[0,-1],n)||Zn(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!!(Ft(e,t,h)||ti(e,t,u,u,o+a/2-l,s+i/2-l,n)||ti(e,t,u,u,o-a/2+l,s+i/2-l,n))}}};Xn.registerNodeShapes=function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",Dt(3,0)),this.generateRoundPolygon("round-triangle",Dt(3,0)),this.generatePolygon("rectangle",Dt(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",Dt(5,0)),this.generateRoundPolygon("round-pentagon",Dt(5,0)),this.generatePolygon("hexagon",Dt(6,0)),this.generateRoundPolygon("round-hexagon",Dt(6,0)),this.generatePolygon("heptagon",Dt(7,0)),this.generateRoundPolygon("round-heptagon",Dt(7,0)),this.generatePolygon("octagon",Dt(8,0)),this.generateRoundPolygon("round-octagon",Dt(8,0));var n=new Array(20);{var a=sm(5,0),i=sm(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=_R(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 ws={};ws.timeToRender=function(){return this.redrawTotalTime/this.redrawCount};ws.redraw=function(r){r=r||bR();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};ws.beforeRender=function(r,e){if(!this.destroyed){e==null&&Or("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 Xx=function(e,t,n){for(var a=e.beforeRenderCallbacks,i=0;i<a.length;i++)a[i].fn(t,n)};ws.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){Xx(r,!0,a);var i=Yn();r.render(r.renderOptions);var o=r.lastDrawTime=Yn();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 Xx(r,!1,a);r.skipFrame=!1,Hu(t)}};Hu(t)}};var b$=function(e){this.init(e)},SA=b$,so=SA.prototype;so.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"];so.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=Me(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()};so.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()}};so.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{}};so.isHeadless=function(){return!1};[Km,CA,_A,oo,Xn,ws].forEach(function(r){Ye(so,r)});var Id=1e3/60,TA={setupDequeueing:function(e){return function(){var n=this,a=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var i=gs(function(){a.redrawHint("eles",!0),a.redrawHint("drag",!0),a.redraw()},e.deqRedrawThreshold),o=function(u,c){var d=Yn(),h=a.averageRedrawTime,g=a.lastRedrawTime,p=[],E=a.cy.extent(),m=a.getPixelRatio();for(u||a.flushRenderedStyleQueue();;){var b=Yn(),w=b-d,x=b-c;if(g<Id){var C=Id-(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*Id)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||Bm;a.beforeRender(o,s(n))}}}},w$=(function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ku;Ba(this,r),this.idsByKey=new jn,this.keyForId=new jn,this.cachesByLvl=new jn,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t}return Ma(r,[{key:"getIdsFor",value:function(t){t==null&&Or("Can not get id list for null key");var n=this.idsByKey,a=this.idsByKey.get(t);return a||(a=new to,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 jn,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}}])})(),Qx=25,Ru=50,Fu=-4,xm=3,RA=7.99,x$=8,E$=1024,C$=1024,_$=1024,S$=.2,T$=.8,R$=10,A$=.15,P$=.1,D$=.9,I$=.9,B$=100,M$=1,Ui={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},k$=yt({getKey:null,doesEleInvalidateKey:Ku,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:pR,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Fo=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var a=k$(t);Ye(n,a),n.lookup=new w$(a.getKey,a.doesEleInvalidateKey),n.setupDequeueing()},nt=Fo.prototype;nt.reasons=Ui;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 ps(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(km(s*t))),n<Fu)n=Fu;else if(s>=RA||n>xm)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<=Qx?p=Qx:c<=Ru?p=Ru:p=Math.ceil(c/Ru)*Ru,c>_$||d>C$)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===Ui.dequeue,C=a&&a===Ui.highQuality,T=a&&a===Ui.downscale,S,_=n+1;_<=xm;_++){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,Ui.downscale);D()}else return i.queueElement(r,S.level-1),S;else{var k;if(!x&&!C&&!T)for(var M=n-1;M>=Fu;M--){var N=l.get(r,M);if(N){k=N;break}}if(w(k))return i.queueElement(r,n),k;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+x$),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=Fu;i<=xm;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>=S$*r.width&&this.retireTexture(r)};nt.checkTextureFullness=function(r){var e=this,t=e.getTextureQueue(r.height);r.usedWidth/r.width>T$&&r.fullnessChecks>=R$?Ca(t,r):r.fullnessChecks++};nt.retireTexture=function(r){var e=this,t=r.height,n=e.getTextureQueue(t),a=this.lookup;Ca(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)}Mm(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(E$,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,Mm(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ca(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<M$&&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,Ui.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=Im,t.updateItem(i),t.pop(),n[a]=null):i.eles.unmerge(r))};nt.onDequeue=function(r){this.onDequeues.push(r)};nt.offDequeue=function(r){Ca(this.onDequeues,r)};nt.setupDequeueing=TA.setupDequeueing({deqRedrawThreshold:B$,deqCost:A$,deqAvgCost:P$,deqNoDrawCost:D$,deqFastCost:I$,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(Om(l,a))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var L$=1,Ho=-4,rl=2,O$=3.99,q$=50,N$=50,F$=.15,z$=.1,$$=.9,V$=.9,G$=1,Jx=250,W$=4e3*4e3,eE=32767,U$=!0,AA=function(e){var t=this,n=t.renderer=e,a=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Yn()-2*Jx,t.skipping=!1,t.eleTxrDeqs=a.collection(),t.scheduleElementRefinement=gs(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},N$),n.beforeRender(function(o,s){s-t.lastInvalidationTime<=Jx?t.skipping=!0:t.skipping=!1},n.beforeRenderPriorities.lyrTxrSkip);var i=function(s,l){return l.reqs-s.reqs};t.layersQueue=new ps(i),t.setupDequeueing()},mt=AA.prototype,rE=0,H$=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:rE=++rE%H$,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(km(o*e)),t<Ho)t=Ho;else if(o>=O$||t>rl)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;Ho<=W&&W<=rl&&!D(W);W+=z);};I(1),I(-1);for(var k=c.length-1;k>=0;k--){var M=c[k];M.invalid&&Ca(c,M)}};if(!h)p();else return c;var E=function(){if(!d){d=It();for(var D=0;D<r.length;D++)GN(d,r[D].boundingBox())}return d},m=function(D){D=D||{};var I=D.after;E();var k=Math.ceil(d.w*u),M=Math.ceil(d.h*u);if(k>eE||M>eE)return null;var N=k*M;if(N>W$)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/L$,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||!ER(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,U$),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=cs(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=Ho;u<=rl;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=Ho;t<=rl;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=Yn(),!(r.length===0||!e.haveLayers())&&e.updateElementsInLayers(r,function(n,a,i){e.invalidateLayer(n)}))};mt.invalidateLayer=function(r){if(this.lastInvalidationTime=Yn(),!r.invalid){var e=r.level,t=r.eles,n=this.layersByLevel[e];Ca(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<G$&&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=gs(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100);mt.setupDequeueing=TA.setupDequeueing({deqRedrawThreshold:q$,deqCost:F$,deqAvgCost:z$,deqNoDrawCost:$$,deqFastCost:V$,deq:function(e,t){return e.dequeue(t)},onDeqd:Bm,shouldRedraw:pR,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var PA={},tE;function K$(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function j$(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 nE(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 Y$(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 Z$(r,e,t,n){r.arc(e,t,n,0,Math.PI*2,!1)}PA.arrowShapeImpl=function(r){return(tE||(tE={polygon:K$,"triangle-backcurve":j$,"triangle-tee":nE,"circle-triangle":Y$,"triangle-cross":nE,circle:Z$}))[r]};var kn={};kn.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)};kn.drawElementOverlay=function(r,e){var t=this;e.isNode()?t.drawNodeOverlay(r,e):t.drawEdgeOverlay(r,e)};kn.drawElementUnderlay=function(r,e){var t=this;e.isNode()?t.drawNodeUnderlay(r,e):t.drawEdgeUnderlay(r,e)};kn.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 X$=function(){return 0},Q$=function(e,t){return e.getTextAngle(t,null)},J$=function(e,t){return e.getTextAngle(t,"source")},e3=function(e,t){return e.getTextAngle(t,"target")},r3=function(e,t){return t.effectiveOpacity()},Bd=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};kn.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||Om(h,n))){var p=e.isEdge(),E=e.element()._private.rscratch.badLine;o.drawElementUnderlay(r,e),o.drawCachedElementPortion(r,e,l,t,a,g,X$,r3),(!p||!E)&&o.drawCachedElementPortion(r,e,u,t,a,g,Q$,Bd),p&&!E&&(o.drawCachedElementPortion(r,e,c,t,a,g,J$,Bd),o.drawCachedElementPortion(r,e,d,t,a,g,e3,Bd)),o.drawElementOverlay(r,e)}};kn.drawElements=function(r,e){for(var t=this,n=0;n<e.length;n++){var a=e[n];t.drawElement(r,a)}};kn.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)}};kn.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)}};kn.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 Qn={};Qn.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,k=e.pstyle("ghost-opacity").value,M=b*k;r.translate(D,I),x(M),_(M),r.translate(-D,-I)}else C();S(),x(),_(),T(),A(),t&&r.translate(l.x1,l.y1)}};var DA=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")}}}};Qn.drawEdgeOverlay=DA("overlay");Qn.drawEdgeUnderlay=DA("underlay");Qn.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=zt(a.roundCorners),m;try{for(E.s();!(m=E.n()).done;){var b=m.value;mA(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([])};Qn.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()}};Qn.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)};Qn.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)}}};Qn.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=ni(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 Zm={};Zm.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)}};Zm.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 k=Math.min(m/D,b/I);D*=k,I*=k}else if(d==="cover"){var k=Math.max(m/D,b/I);D*=k,I*=k}var M=s-m/2,N=c(t,"background-position-x","units",n),z=c(t,"background-position-x","pfValue",n);N==="%"?M+=(m-D)*z:M+=z;var W=c(t,"background-offset-x","units",n),q=c(t,"background-offset-x","pfValue",n);W==="%"?M+=(m-D)*q:M+=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&&(M-=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,M,$,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(M,$),r.fill(),r.translate(-M,-$)}r.globalAlpha=le,V&&i.setImgSmoothing(r,G)}};var li={};li.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),a=Math.ceil(km(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)};li.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)};li.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};li.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 t3(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 aE(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()}li.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=Nt(a,"labelAngle",e);t=r.isEdge()?s:0}else o.strValue==="none"?t=0:t=o.pfValue;return t};li.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=Nt(o,"labelX",t),u=Nt(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=Nt(o,"labelWidth",t),E=Nt(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",k=D==="circle",M=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(),aE(r,ee,le,G,V,M)):k?(r.beginPath(),t3(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?aE(r,ee+j,le+j,G-2*j,V-2*j,M):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 de=Nt(o,"labelWrapCachedLines",t),se=Nt(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-=(de.length-1)*se;break;case"center":case"bottom":u-=(de.length-1)*se;break}for(var ae=0;ae<de.length;ae++)re>0&&r.strokeText(de[ae],l,u),r.fillText(de[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 La={};La.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(!(!Me(d.x)||!Me(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,k=e.pstyle("border-width").pfValue,M=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 de=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:M;o.eleFillStyle(r,e,ke)},se=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:K;o.colorStrokeStyle(r,N[0],N[1],N[2],ke)},Z=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;o.colorStrokeStyle(r,le[0],le[1],le[2],ke)},Q=function(ke,pe,L,oe){var me=o.nodePathCache=o.nodePathCache||[],we=gR(L==="polygon"?L+","+oe.join(","):L,""+pe,""+ke,""+re),Ce=me[we],qe,Pe=!1;return Ce!=null?(qe=Ce,Pe=!0,c.pathCache=qe):(qe=new Path2D,me[we]=c.pathCache=qe),{path:qe,cacheHit:Pe}},ae=e.pstyle("shape").strValue,te=e.pstyle("shape-polygon-points").pfValue;if(g){r.translate(d.x,d.y);var ce=Q(s,l,ae,te);p=ce.path,E=ce.cacheHit}var _e=function(){if(!E){var ke=d;g&&(ke={x:0,y:0}),o.nodeShapes[o.getNodeShape(e)].draw(p||r,ke.x,ke.y,s,l,re,c)}g?r.fill(p):r.fill()},ve=function(){for(var ke=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,me=0;me<T.length;me++){var we=e.cy().style().getIndexedStyle(e,"background-image-containment","value",me);if(pe&&we==="over"||!pe&&we==="inside"){oe++;continue}C[me]&&T[me].complete&&!T[me].error&&(oe++,o.drawInscribedImage(r,T[me],e,me,ke))}u.backgrounding=oe!==S,L!==u.backgrounding&&e.updateStyle(!1)},U=function(){var ke=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),ke&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c)))},fe=function(){var ke=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(),ke&&(g||o.nodeShapes[o.getNodeShape(e)].draw(r,d.x,d.y,s,l,re,c)))},xe=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:h,pe=(I>0?I:-I)*ke,L=I>0?0:255;I!==0&&(o.colorFillStyle(r,L,L,L,pe),g?r.fill(p):r.fill())},ge=function(){if(k>0){if(r.lineWidth=k,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 ke=new Path2D;ke.rect(-s/2-k,-l/2-k,s+2*k,l+2*k),ke.addPath(p),r.clip(ke,"evenodd")}g?r.stroke(p):r.stroke(),r.restore()}else g?r.stroke(p):r.stroke();if(z==="double"){r.lineWidth=k/3;var pe=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(p):r.stroke(),r.globalCompositeOperation=pe}r.setLineDash&&r.setLineDash([])}},be=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 ke=d;g&&(ke={x:0,y:0});var pe=o.getNodeShape(e),L=k;$==="inside"&&(L=0),$==="outside"&&(L*=2);var oe=(s+L+(ee+j))/s,me=(l+L+(ee+j))/l,we=s*oe,Ce=l*me,qe=o.nodeShapes[pe].points,Pe;if(g){var Ge=Q(we,Ce,pe,qe);Pe=Ge.path}if(pe==="ellipse")o.drawEllipsePath(Pe||r,ke.x,ke.y,we,Ce);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,we=s*oe,["round-hexagon","round-tag"].includes(pe)||(me=(l+Fe)/l,Ce=l*me)),re=re==="auto"?SR(we,Ce):re;for(var nr=we/2,We=Ce/2,ur=re+(L+ee+j)/2,ar=new Array(qe.length/2),Wr=new Array(qe.length/2),Mr=0;Mr<qe.length/2;Mr++)ar[Mr]={x:ke.x+je+nr*qe[Mr*2],y:ke.y+or+We*qe[Mr*2+1]};var lt,kr,Kr,Nr,Xr=ar.length;for(kr=ar[Xr-1],lt=0;lt<Xr;lt++)Kr=ar[lt%Xr],Nr=ar[(lt+1)%Xr],Wr[lt]=jm(kr,Kr,Nr,ur),kr=Kr,Kr=Nr;o.drawRoundPolygonPath(Pe||r,ke.x+je,ke.y+or,s*oe,l*me,qe,Wr)}else if(["roundrectangle","round-rectangle"].includes(pe))re=re==="auto"?_a(we,Ce):re,o.drawRoundRectanglePath(Pe||r,ke.x,ke.y,we,Ce,re+(L+ee+j)/2);else if(["cutrectangle","cut-rectangle"].includes(pe))re=re==="auto"?qm():re,o.drawCutRectanglePath(Pe||r,ke.x,ke.y,we,Ce,null,re+(L+ee+j)/4);else if(["bottomroundrectangle","bottom-round-rectangle"].includes(pe))re=re==="auto"?_a(we,Ce):re,o.drawBottomRoundRectanglePath(Pe||r,ke.x,ke.y,we,Ce,re+(L+ee+j)/2);else if(pe==="barrel")o.drawBarrelPath(Pe||r,ke.x,ke.y,we,Ce);else if(pe.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(pe)){var Cn=(L+ee+j)/s;qe=ju(Yu(qe,Cn)),o.drawPolygonPath(Pe||r,ke.x,ke.y,s,l,qe)}else{var $r=(L+ee+j)/s;qe=ju(Yu(qe,-$r)),o.drawPolygonPath(Pe||r,ke.x,ke.y,s,l,qe)}if(g?r.stroke(Pe):r.stroke(),G==="double"){r.lineWidth=L/3;var dn=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",g?r.stroke(Pe):r.stroke(),r.globalCompositeOperation=dn}r.setLineDash&&r.setLineDash([])}},Ae=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(),be(),de(Xe*M),_e(),ve(er,!0),se(Xe*K),ge(),U(I!==0||k!==0),fe(I!==0||k!==0),ve(er,!1),xe(er),r.translate(-He,-Ve)}g&&r.translate(-d.x,-d.y),Ie(),g&&r.translate(d.x,d.y),Z(),be(),de(),_e(),ve(h,!0),se(),ge(),U(I!==0||k!==0),fe(I!==0||k!==0),ve(h,!1),xe(),g&&r.translate(-d.x,-d.y),Be(),Ae(),t&&r.translate(b.x1,b.y1)}};var IA=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()}}}};La.drawNodeOverlay=IA("overlay");La.drawNodeUnderlay=IA("underlay");La.hasPie=function(r){return r=r[0],r._private.hasPie};La.hasStripe=function(r){return r=r[0],r._private.hasStripe};La.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)}};La.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 Bt={},n3=100;Bt.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};Bt.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};Bt.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=ai(u,d),g=ai(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};Bt.gradientFillStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"background",e,t,n);if(!a)return null;r.fillStyle=a};Bt.colorFillStyle=function(r,e,t,n,a){r.fillStyle="rgba("+e+","+t+","+n+","+a+")"};Bt.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)}};Bt.gradientStrokeStyle=function(r,e,t,n){var a=this.createGradientStyleFor(r,"line",e,t,n);if(!a)return null;r.strokeStyle=a};Bt.colorStrokeStyle=function(r,e,t,n,a){r.strokeStyle="rgba("+e+","+t+","+n+","+a+")"};Bt.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)}};Bt.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}};Bt.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})};Bt.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])};Bt.render=function(r){var e=this;r=r||bR();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,te){var ce=se.globalCompositeOperation;se.globalCompositeOperation="destination-out",e.colorFillStyle(se,255,255,255,e.motionBlurTransparency),se.fillRect(Z,Q,ae,te),se.globalCompositeOperation=ce}function k(se,Z){var Q,ae,te,ce;!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,te=e.canvasWidth*g,ce=e.canvasHeight*g):(Q=S,ae=C,te=e.canvasWidth,ce=e.canvasHeight),se.setTransform(1,0,0,1,0,0),Z==="motionBlur"?I(se,0,0,te,ce):!n&&(Z===void 0||Z)&&se.clearRect(0,0,te,ce),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 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: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();k(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;k(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]);k(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,k),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],de=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 te=g;Z.drawImage(Q,0,0,e.canvasWidth*te,e.canvasHeight*te,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||K[e.NODE])&&(de(G,V,K[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||K[e.DRAG])&&(de(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()},n3)),n||t.emit("render")};var ko;Bt.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",!ko){var b=c.measureText(m);ko=b.actualBoundingBoxAscent}c.fillText(m,0,ko);var w=60;c.strokeRect(0,ko+10,250,20),c.fillRect(0,ko+10,250*Math.min(E/w,1),20)}s||(l[t.SELECT_BOX]=!1)}};function iE(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 a3(r,e,t){var n=iE(r,r.VERTEX_SHADER,e),a=iE(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 i3(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 Xm(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 o3(r){var e=r.pixelRatio,t=r.cy.zoom();return t*e}function s3(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 u3(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 l3(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 Za(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 Fi(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 f3(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function c3(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 BA(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 MA(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function d3(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 v3(r,e,t,n){var a=BA(r,e),i=Yr(a,2),o=i[0],s=i[1],l=MA(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 An(r,e,t,n){var a=BA(r,t),i=Yr(a,3),o=i[0],s=i[1],l=i[2],u=MA(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]=d3(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 h3(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 g3(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 oE=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 Md(){var r=new oE(9);return oE!=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 sE(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 p3(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 zu(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 uE(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 Em(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 y3(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 m3=(function(){function r(e,t,n,a){Ba(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 Ma(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,k=(i.freePointer.row+1)*l,M=S;C&&C.context.drawImage(x,I,0,M,_,0,k,M,_),p[1]={x:0,y:k,w:M,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=c3(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}}])})(),b3=(function(){function r(e,t,n,a){Ba(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 Ma(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 m3(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=zt(this.atlases),l;try{var u=function(){var d=l.value,h=d.getKeys(),g=w3(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=zt(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 w3(r,e){return r.intersection?r.intersection(e):new Set(Wu(r).filter(function(t){return e.has(t)}))}var x3=(function(){function r(e,t){Ba(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 Ma(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 b3(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=zt(t),p;try{for(g.s();!(p=g.n()).done;){var E=p.value;if(l(E)){var m=zt(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(k){return S.markKeyForGC(k)}),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&&!l3(A,I)&&(d=!0,n.typeAndIdToKey.delete(D),I.forEach(function(k){return S.markKeyForGC(k)}))}}};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=zt(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=zt(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}}])})(),E3=(function(){function r(e){Ba(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]}return Ma(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}}])})(),C3=`
|
|
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=[],E=/[\s\u200b]+|$/g,m=0;m<c.length;m++){var b=c[m],w=this.calculateLabelDimensions(r,b),x=w.width;if(g){var C=b.split("").join(u);b=C}if(x>d){var T=b.matchAll(E),S="",_=0,A=$t(T),P;try{for(A.s();!(P=A.n()).done;){var D=P.value,I=D[0],M=b.substring(_,D.index);_=D.index+I.length;var k=S.length===0?M:S+M+I,N=this.calculateLabelDimensions(r,k),z=N.width;z<=d?S+=M+I:(S&&p.push(S),S=M+I)}}catch(ee){A.e(ee)}finally{A.f()}S.match(/^[\s\u200b]+$/)||p.push(S)}else p.push(b)}o("labelWrapCachedLines",p),a=o("labelWrapCachedText",p.join(`
|
|
16
|
+
`)),o("labelWrapKey",l)}else if(s==="ellipsis"){var W=r.pstyle("text-max-width").pfValue,q="",$="…",X=!1;if(this.calculateLabelDimensions(r,a).width<W)return a;for(var Y=0;Y<a.length;Y++){var K=this.calculateLabelDimensions(r,q+a[Y]+$).width;if(K>W)break;q+=a[Y],Y===a.length-1&&(X=!0)}return X||(q+=$),q}return a};Ln.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};Ln.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,l=r.pstyle("font-family").strValue,u=r.pstyle("font-weight").strValue,c=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=a.createElement("canvas"),d=this.labelCalcCanvasContext=c.getContext("2d");var h=c.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}d.font="".concat(o," ").concat(u," ").concat(s,"px ").concat(l);for(var g=0,p=0,E=e.split(`
|
|
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=`
|
|
18
18
|
float circleSD(vec2 p, float r) {
|
|
19
19
|
return distance(vec2(0), p) - r; // signed distance
|
|
20
20
|
}
|
|
21
|
-
`,
|
|
21
|
+
`,R3=`
|
|
22
22
|
float rectangleSD(vec2 p, vec2 b) {
|
|
23
23
|
vec2 d = abs(p)-b;
|
|
24
24
|
return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);
|
|
25
25
|
}
|
|
26
|
-
`,
|
|
26
|
+
`,A3=`
|
|
27
27
|
float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {
|
|
28
28
|
cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;
|
|
29
29
|
cr.x = (p.y > 0.0) ? cr.x : cr.y;
|
|
30
30
|
vec2 q = abs(p) - b + cr.x;
|
|
31
31
|
return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,P3=`
|
|
34
34
|
float ellipseSD(vec2 p, vec2 ab) {
|
|
35
35
|
p = abs( p ); // symmetry
|
|
36
36
|
|
|
@@ -50,7 +50,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
50
50
|
// return signed distance
|
|
51
51
|
return (dot(p/ab,p/ab)>1.0) ? d : -d;
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,Zo={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},al={IGNORE:1,USE_BB:2},qd=0,dE=1,vE=2,Nd=3,Gi=4,Du=5,No=6,Fo=7,D3=(function(){function r(e,t,n){La(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=u3,this.atlasManager=new _3(e,n),this.batchManager=new S3(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram(Zo.SCREEN),this.pickingProgram=this._createShaderProgram(Zo.PICKING),this.vao=this._createVAO()}return Oa(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
54
|
precision highp float;
|
|
55
55
|
|
|
56
56
|
uniform mat3 uPanZoomMatrix;
|
|
@@ -97,7 +97,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
97
97
|
int vid = gl_VertexID;
|
|
98
98
|
vec2 position = aPosition; // TODO make this a vec3, simplifies some code below
|
|
99
99
|
|
|
100
|
-
if(aVertType == `.concat(
|
|
100
|
+
if(aVertType == `.concat(qd,`) {
|
|
101
101
|
float texX = aTex.x; // texture coordinates
|
|
102
102
|
float texY = aTex.y;
|
|
103
103
|
float texW = aTex.z;
|
|
@@ -115,8 +115,8 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
115
115
|
|
|
116
116
|
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
117
117
|
}
|
|
118
|
-
else if(aVertType == `).concat(
|
|
119
|
-
|| aVertType == `).concat(
|
|
118
|
+
else if(aVertType == `).concat(Gi," || aVertType == ").concat(Fo,`
|
|
119
|
+
|| aVertType == `).concat(Du," || aVertType == ").concat(No,`) { // simple shapes
|
|
120
120
|
|
|
121
121
|
// the bounding box is needed by the fragment shader
|
|
122
122
|
vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat
|
|
@@ -131,7 +131,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
131
131
|
|
|
132
132
|
gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);
|
|
133
133
|
}
|
|
134
|
-
else if(aVertType == `).concat(
|
|
134
|
+
else if(aVertType == `).concat(dE,`) {
|
|
135
135
|
vec2 source = aPointAPointB.xy;
|
|
136
136
|
vec2 target = aPointAPointB.zw;
|
|
137
137
|
|
|
@@ -146,7 +146,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
146
146
|
gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);
|
|
147
147
|
vColor = aColor;
|
|
148
148
|
}
|
|
149
|
-
else if(aVertType == `).concat(
|
|
149
|
+
else if(aVertType == `).concat(vE,`) {
|
|
150
150
|
vec2 pointA = aPointAPointB.xy;
|
|
151
151
|
vec2 pointB = aPointAPointB.zw;
|
|
152
152
|
vec2 pointC = aPointCPointD.xy;
|
|
@@ -195,7 +195,7 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
195
195
|
|
|
196
196
|
vColor = aColor;
|
|
197
197
|
}
|
|
198
|
-
else if(aVertType == `).concat(
|
|
198
|
+
else if(aVertType == `).concat(Nd,` && vid < 3) {
|
|
199
199
|
// massage the first triangle into an edge arrow
|
|
200
200
|
if(vid == 0)
|
|
201
201
|
position = vec2(-0.15, -0.3);
|
|
@@ -240,10 +240,10 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
240
240
|
|
|
241
241
|
out vec4 outColor;
|
|
242
242
|
|
|
243
|
-
`).concat(C3,`
|
|
244
|
-
`).concat(_3,`
|
|
245
|
-
`).concat(S3,`
|
|
246
243
|
`).concat(T3,`
|
|
244
|
+
`).concat(R3,`
|
|
245
|
+
`).concat(A3,`
|
|
246
|
+
`).concat(P3,`
|
|
247
247
|
|
|
248
248
|
vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha
|
|
249
249
|
return vec4(
|
|
@@ -259,21 +259,21 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
void main(void) {
|
|
262
|
-
if(vVertType == `).concat(
|
|
262
|
+
if(vVertType == `).concat(qd,`) {
|
|
263
263
|
// look up the texel from the texture unit
|
|
264
264
|
`).concat(i.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join(`
|
|
265
265
|
else `),`
|
|
266
266
|
}
|
|
267
|
-
else if(vVertType == `).concat(
|
|
267
|
+
else if(vVertType == `).concat(Nd,`) {
|
|
268
268
|
// mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';
|
|
269
269
|
outColor = blend(vColor, uBGColor);
|
|
270
270
|
outColor.a = 1.0; // make opaque, masks out line under arrow
|
|
271
271
|
}
|
|
272
|
-
else if(vVertType == `).concat(
|
|
272
|
+
else if(vVertType == `).concat(Gi,` && vBorderWidth == vec2(0.0)) { // simple rectangle with no border
|
|
273
273
|
outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done
|
|
274
274
|
}
|
|
275
|
-
else if(vVertType == `).concat(
|
|
276
|
-
|| vVertType == `).concat(
|
|
275
|
+
else if(vVertType == `).concat(Gi," || vVertType == ").concat(Fo,`
|
|
276
|
+
|| vVertType == `).concat(Du," || vVertType == ").concat(No,`) { // use SDF
|
|
277
277
|
|
|
278
278
|
float outerBorder = vBorderWidth[0];
|
|
279
279
|
float innerBorder = vBorderWidth[1];
|
|
@@ -284,11 +284,11 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
284
284
|
vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center
|
|
285
285
|
|
|
286
286
|
float d; // signed distance
|
|
287
|
-
if(vVertType == `).concat(
|
|
287
|
+
if(vVertType == `).concat(Gi,`) {
|
|
288
288
|
d = rectangleSD(p, b);
|
|
289
|
-
} else if(vVertType == `).concat(
|
|
289
|
+
} else if(vVertType == `).concat(Fo,` && w == h) {
|
|
290
290
|
d = circleSD(p, b.x); // faster than ellipse
|
|
291
|
-
} else if(vVertType == `).concat(
|
|
291
|
+
} else if(vVertType == `).concat(Fo,`) {
|
|
292
292
|
d = ellipseSD(p, b);
|
|
293
293
|
} else {
|
|
294
294
|
d = roundRectangleSD(p, b, vCornerRadius.wzyx);
|
|
@@ -328,31 +328,31 @@ https://github.com/jquery/jquery/blob/master/src/event.js
|
|
|
328
328
|
`).concat(t.picking?`if(outColor.a == 0.0) discard;
|
|
329
329
|
else outColor = vIndex;`:"",`
|
|
330
330
|
}
|
|
331
|
-
`),s=a3(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),v3(a,"vec2",i.aPosition,t),this.transformBuffer=h3(a,n,i.aTransform),this.indexBuffer=An(a,n,"vec4",i.aIndex),this.vertTypeBuffer=An(a,n,"int",i.aVertType),this.atlasIdBuffer=An(a,n,"int",i.aAtlasId),this.texBuffer=An(a,n,"vec4",i.aTex),this.pointAPointBBuffer=An(a,n,"vec4",i.aPointAPointB),this.pointCPointDBuffer=An(a,n,"vec4",i.aPointCPointD),this.lineWidthBuffer=An(a,n,"vec2",i.aLineWidth),this.colorBuffer=An(a,n,"vec4",i.aColor),this.cornerRadiusBuffer=An(a,n,"vec4",i.aCornerRadius),this.borderColorBuffer=An(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 pa(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]:Ko.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===tl.IGNORE)return;if(l==tl.USE_BB){this.drawPickingRectangle(t,n,a);return}}var u=i.getAtlasInfo(t,a),c=zt(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]=kd;var _=this.indexBuffer.getView(S);Fi(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;sE(t);var l=a.getRotation?a.getRotation(i):0;if(l!==0){var u=a.getRotationPoint(i),c=u.x,d=u.y;zu(t,t,[c,d]),uE(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;zu(t,t,[o,s]),Em(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]=zi;var s=this.indexBuffer.getView(o);Fi(n,s);var l=this.colorBuffer.getView(o);Za([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===Au||s===Lo){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===Lo&&(d[0]=0,d[2]=0)}var h=this.indexBuffer.getView(l);Fi(n,h);var g=t.pstyle(o.color).value,p=t.pstyle(o.opacity).value,E=this.colorBuffer.getView(l);Za(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);Za(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 zi;case"ellipse":return Oo;case"roundrectangle":case"round-rectangle":return Au;case"bottom-round-rectangle":return Lo;default:return}}},{key:"_getCornerRadius",value:function(t,n,a){var i=a.w,o=a.h;if(t.pstyle(n).value==="auto")return _a(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);sE(w),zu(w,w,[o,s]),Em(w,w,[m,m]),uE(w,w,l),this.vertTypeBuffer.getView(b)[0]=Ld;var x=this.indexBuffer.getView(b);Fi(n,x);var C=this.colorBuffer.getView(b);Za(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]=lE;var d=this.indexBuffer.getView(c);Fi(n,d);var h=this.colorBuffer.getView(c);Za(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]=fE;var b=this.indexBuffer.getView(m);Fi(n,b);var w=this.colorBuffer.getView(m);Za(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 k=this.pointAPointBBuffer.getView(m);k[0]=C,k[1]=T,k[2]=S,k[3]=_;var M=this.pointCPointDBuffer.getView(m);M[0]=A,M[1]=P,M[2]=D,M[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=zt(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,o3(this.r)),t.uniformMatrix3fv(o.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(o.uAtlasSize,this.batchManager.getAtlasSize());var g=Za(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}}}])})(),kA={};kA.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=A3(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=g3(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new R3(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?tl.USE_BB:tl.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:u3,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:Od(e.getLabelKey,null),getBoundingBox:qd(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:Od(e.getSourceLabelKey,"source"),getBoundingBox:qd(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:Od(e.getTargetLabelKey,"target"),getBoundingBox:qd(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:a("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:i("target-label")});var u=gs(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()}),P3(t)};function A3(r){var e=r.cy.container(),t=e&&e.style&&e.style.backgroundColor||"white";return uR(t)}function LA(r,e){var t=r._private.rscratch;return Nt(t,"labelWrapCachedLines",e)||[]}var Od=function(e,t){return function(n){var a=e(n),i=LA(n,t);return i.length>1?i.map(function(o,s){return"".concat(a,"_").concat(s)}):a}},qd=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=LA(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 P3(r){{var e=r.render;r.render=function(i){i=i||{};var o=r.cy;r.webgl&&(o.zoom()>RA?(D3(r),e.call(r,i)):(I3(r),qA(r,i,Ko.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 q3(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 D3(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}function I3(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 B3(r){var e=r.canvasWidth,t=r.canvasHeight,n=Xm(r),a=n.pan,i=n.zoom,o=Md();zu(o,o,[a.x,a.y]),Em(o,o,[i,i]);var s=Md();y3(s,e,t);var l=Md();return p3(l,s,o),l}function OA(r,e){var t=r.canvasWidth,n=r.canvasHeight,a=Xm(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 M3(r,e){r.drawSelectionRectangle(e,function(t){return OA(r,t)})}function k3(r){var e=r.data.contexts[r.NODE];e.save(),OA(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 L3(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 O3(r,e,t,n,a){var i,o,s,l,u=Xm(r),c=u.pan,d=u.zoom;{var h=s3(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),qA(r,null,Ko.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),_=f3(S)-1;_>=0&&C.add(_)}return C}function q3(r,e,t){var n=O3(r,e,t),a=r.getCachedZSortedEles(),i,o,s=zt(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 Nd(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 qA(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]&&M3(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=B3(r),l=r.getCachedZSortedEles();if(i=l.length,a.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)Nd(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)Nd(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)Nd(r,d,l[d]);a.endFrame(),t.screen&&r.webglDebugShowAtlases&&(k3(r),L3(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=zt(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 Oa={};Oa.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()};Oa.drawRoundPolygonPath=function(r,e,t,n,a,i,o){o.forEach(function(s){return mA(r,s)}),r.closePath()};Oa.drawRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?_a(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()};Oa.drawBottomRoundRectanglePath=function(r,e,t,n,a,i){var o=n/2,s=a/2,l=i==="auto"?_a(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()};Oa.drawCutRectanglePath=function(r,e,t,n,a,i,o){var s=n/2,l=a/2,u=o==="auto"?qm():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()};Oa.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=um(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 cE=Math.sin(0),dE=Math.cos(0),Cm={},_m={},NA=Math.PI/40;for(var $i=0*Math.PI;$i<2*Math.PI;$i+=NA)Cm[$i]=Math.sin($i),_m[$i]=Math.cos($i);Oa.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+=NA)i=e-s*Cm[u]*cE+s*_m[u]*dE,o=t+l*_m[u]*cE+l*Cm[u]*dE,u===0?r.moveTo(i,o):r.lineTo(i,o);r.closePath()};var xs={};xs.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]};xs.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=Me(r.maxWidth)||Me(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;Me(r.maxWidth)&&(c=u*r.maxWidth/i),Me(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 N3(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 vE(r){var e=r.indexOf(",");return r.substr(e+1)}function FA(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new no(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 N3(vE(n()),t);case"base64":return vE(n());case"base64uri":default:return n()}}xs.png=function(r){return FA(r,this.bufferCanvasImage(r),"image/png")};xs.jpg=function(r){return FA(r,this.bufferCanvasImage(r),"image/jpeg")};var zA={};zA.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 F3=$A,fr=$A.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 $A(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"};Mq()&&(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]||Or("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=It(),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,te,ce){return e.drawElement(Z,Q,ae,!1,!1,ce)},T=function(Z,Q,ae,te,ce){return e.drawElementText(Z,Q,ae,te,"main",ce)},S=function(Z,Q,ae,te,ce){return e.drawElementText(Z,Q,ae,te,"source",ce)},_=function(Z,Q,ae,te,ce){return e.drawElementText(Z,Q,ae,te,"target",ce)},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},k=function(Z,Q){return Q},M=function(Z){return g(A(Z))},N=function(Z,Q,ae){var te=Z?Z+"-":"";return{x:Q.x+ae.pstyle(te+"text-margin-x").pfValue,y:Q.y+ae.pstyle(te+"text-margin-y").pfValue}},z=function(Z,Q,ae){var te=Z[0]._private.rscratch;return{x:te[Q],y:te[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 Fo(e,{getKey:m,doesEleInvalidateKey:E,drawElement:C,getBoundingBox:A,getRotationPoint:M,getRotationOffset:X,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),G=e.data.lblTxrCache=new Fo(e,{getKey:b,drawElement:T,getBoundingBox:P,getRotationPoint:W,getRotationOffset:ee,isVisible:k}),V=e.data.slbTxrCache=new Fo(e,{getKey:w,drawElement:S,getBoundingBox:D,getRotationPoint:q,getRotationOffset:Y,isVisible:k}),j=e.data.tlbTxrCache=new Fo(e,{getKey:x,drawElement:_,getBoundingBox:I,getRotationPoint:$,getRotationOffset:K,isVisible:k}),re=e.data.lyrTxrCache=new AA(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 te=Q[ae]._private;te.oldBackgroundTimestamp=te.backgroundTimestamp}});var de=function(Z){for(var Q=0;Q<Z.length;Q++)re.enqueueElementRefinement(Z[Q].ele)};le.onDequeue(de),G.onDequeue(de),V.onDequeue(de),j.onDequeue(de),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:M,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 z3=typeof Path2D<"u";fr.path2dEnabled=function(r){if(r===void 0)return this.pathsEnabled;this.pathsEnabled=!!r};fr.usePaths=function(){return z3&&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};[PA,kn,Qn,Zm,li,La,Bt,kA,Oa,xs,zA].forEach(function(r){Ye(fr,r)});var $3=[{name:"null",impl:gA},{name:"base",impl:SA},{name:"canvas",impl:F3}],V3=[{type:"layout",extensions:v$},{type:"renderer",extensions:$3}],VA={},GA={};function WA(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(is.prototype[e])return a(e);is.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 yl(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=UA("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(){Or("Renderer does not implement `renderer."+_+"()` on its prototype")}}),n=b}else if(r==="__proto__"||r==="constructor"||r==="prototype")return Or(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return lR({map:VA,keys:[r,e],value:n})}function UA(r,e){return fR({map:VA,keys:[r,e]})}function G3(r,e,t,n,a){return lR({map:GA,keys:[r,e,t,n],value:a})}function W3(r,e,t,n){return fR({map:GA,keys:[r,e,t,n]})}var Sm=function(){if(arguments.length===2)return UA.apply(null,arguments);if(arguments.length===3)return WA.apply(null,arguments);if(arguments.length===4)return W3.apply(null,arguments);if(arguments.length===5)return G3.apply(null,arguments);Or("Invalid extension access syntax")};is.prototype.extension=Sm;V3.forEach(function(r){r.extensions.forEach(function(e){WA(r.type,e.name,e.impl)})});var nl=function(){if(!(this instanceof nl))return new nl;this.length=0},si=nl.prototype;si.instanceString=function(){return"stylesheet"};si.selector=function(r){var e=this.length++;return this[e]={selector:r,properties:[]},this};si.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[sl(o)];if(l!=null){var u=l.name,c=s;this[t].properties.push({name:u,value:c})}}}return this};si.style=si.css;si.generateStyle=function(r){var e=new st(r);return this.appendToStyle(e)};si.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 U3="3.33.1",un=function(e){if(e===void 0&&(e={}),pr(e))return new is(e);if(Ke(e))return Sm.apply(Sm,arguments)};un.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(un),r.apply(null,e),this};un.warnings=function(r){return yR(r)};un.version=U3;un.stylesheet=un.Stylesheet=nl;var Et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sl(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var $u={exports:{}};function Qm(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 Fd,hE;function H3(){if(hE)return Fd;hE=1;function r(){this.__data__=[],this.size=0}return Fd=r,Fd}var zd,gE;function uo(){if(gE)return zd;gE=1;function r(e,t){return e===t||e!==e&&t!==t}return zd=r,zd}var $d,pE;function Tl(){if(pE)return $d;pE=1;var r=uo();function e(t,n){for(var a=t.length;a--;)if(r(t[a][0],n))return a;return-1}return $d=e,$d}var Vd,yE;function K3(){if(yE)return Vd;yE=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 Vd=n,Vd}var Gd,mE;function j3(){if(mE)return Gd;mE=1;var r=Tl();function e(t){var n=this.__data__,a=r(n,t);return a<0?void 0:n[a][1]}return Gd=e,Gd}var Wd,bE;function Y3(){if(bE)return Wd;bE=1;var r=Tl();function e(t){return r(this.__data__,t)>-1}return Wd=e,Wd}var Ud,wE;function Z3(){if(wE)return Ud;wE=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 Ud=e,Ud}var Hd,xE;function Rl(){if(xE)return Hd;xE=1;var r=H3(),e=K3(),t=j3(),n=Y3(),a=Z3();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,Hd=i,Hd}var Kd,EE;function X3(){if(EE)return Kd;EE=1;var r=Rl();function e(){this.__data__=new r,this.size=0}return Kd=e,Kd}var jd,CE;function Q3(){if(CE)return jd;CE=1;function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}return jd=r,jd}var Yd,_E;function J3(){if(_E)return Yd;_E=1;function r(e){return this.__data__.get(e)}return Yd=r,Yd}var Zd,SE;function eV(){if(SE)return Zd;SE=1;function r(e){return this.__data__.has(e)}return Zd=r,Zd}var Xd,TE;function HA(){if(TE)return Xd;TE=1;var r=typeof Et=="object"&&Et&&Et.Object===Object&&Et;return Xd=r,Xd}var Qd,RE;function En(){if(RE)return Qd;RE=1;var r=HA(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Qd=t,Qd}var Jd,AE;function lo(){if(AE)return Jd;AE=1;var r=En(),e=r.Symbol;return Jd=e,Jd}var ev,PE;function rV(){if(PE)return ev;PE=1;var r=lo(),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 ev=i,ev}var rv,DE;function tV(){if(DE)return rv;DE=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return rv=t,rv}var tv,IE;function fi(){if(IE)return tv;IE=1;var r=lo(),e=rV(),t=tV(),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 tv=o,tv}var nv,BE;function fn(){if(BE)return nv;BE=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return nv=r,nv}var av,ME;function Es(){if(ME)return av;ME=1;var r=fi(),e=fn(),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 av=o,av}var iv,kE;function nV(){if(kE)return iv;kE=1;var r=En(),e=r["__core-js_shared__"];return iv=e,iv}var ov,LE;function aV(){if(LE)return ov;LE=1;var r=nV(),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 ov=t,ov}var sv,OE;function KA(){if(OE)return sv;OE=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 sv=t,sv}var uv,qE;function iV(){if(qE)return uv;qE=1;var r=Es(),e=aV(),t=fn(),n=KA(),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 uv=d,uv}var lv,NE;function oV(){if(NE)return lv;NE=1;function r(e,t){return e==null?void 0:e[t]}return lv=r,lv}var fv,FE;function ci(){if(FE)return fv;FE=1;var r=iV(),e=oV();function t(n,a){var i=e(n,a);return r(i)?i:void 0}return fv=t,fv}var cv,zE;function Jm(){if(zE)return cv;zE=1;var r=ci(),e=En(),t=r(e,"Map");return cv=t,cv}var dv,$E;function Al(){if($E)return dv;$E=1;var r=ci(),e=r(Object,"create");return dv=e,dv}var vv,VE;function sV(){if(VE)return vv;VE=1;var r=Al();function e(){this.__data__=r?r(null):{},this.size=0}return vv=e,vv}var hv,GE;function uV(){if(GE)return hv;GE=1;function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}return hv=r,hv}var gv,WE;function lV(){if(WE)return gv;WE=1;var r=Al(),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 gv=a,gv}var pv,UE;function fV(){if(UE)return pv;UE=1;var r=Al(),e=Object.prototype,t=e.hasOwnProperty;function n(a){var i=this.__data__;return r?i[a]!==void 0:t.call(i,a)}return pv=n,pv}var yv,HE;function cV(){if(HE)return yv;HE=1;var r=Al(),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 yv=t,yv}var mv,KE;function dV(){if(KE)return mv;KE=1;var r=sV(),e=uV(),t=lV(),n=fV(),a=cV();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,mv=i,mv}var bv,jE;function vV(){if(jE)return bv;jE=1;var r=dV(),e=Rl(),t=Jm();function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}return bv=n,bv}var wv,YE;function hV(){if(YE)return wv;YE=1;function r(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}return wv=r,wv}var xv,ZE;function Pl(){if(ZE)return xv;ZE=1;var r=hV();function e(t,n){var a=t.__data__;return r(n)?a[typeof n=="string"?"string":"hash"]:a.map}return xv=e,xv}var Ev,XE;function gV(){if(XE)return Ev;XE=1;var r=Pl();function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}return Ev=e,Ev}var Cv,QE;function pV(){if(QE)return Cv;QE=1;var r=Pl();function e(t){return r(this,t).get(t)}return Cv=e,Cv}var _v,JE;function yV(){if(JE)return _v;JE=1;var r=Pl();function e(t){return r(this,t).has(t)}return _v=e,_v}var Sv,eC;function mV(){if(eC)return Sv;eC=1;var r=Pl();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 Sv=e,Sv}var Tv,rC;function e0(){if(rC)return Tv;rC=1;var r=vV(),e=gV(),t=pV(),n=yV(),a=mV();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,Tv=i,Tv}var Rv,tC;function bV(){if(tC)return Rv;tC=1;var r=Rl(),e=Jm(),t=e0(),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 Rv=a,Rv}var Av,nC;function Dl(){if(nC)return Av;nC=1;var r=Rl(),e=X3(),t=Q3(),n=J3(),a=eV(),i=bV();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,Av=o,Av}var Pv,aC;function r0(){if(aC)return Pv;aC=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 Pv=r,Pv}var Dv,iC;function jA(){if(iC)return Dv;iC=1;var r=ci(),e=(function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}})();return Dv=e,Dv}var Iv,oC;function Il(){if(oC)return Iv;oC=1;var r=jA();function e(t,n,a){n=="__proto__"&&r?r(t,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[n]=a}return Iv=e,Iv}var Bv,sC;function Bl(){if(sC)return Bv;sC=1;var r=Il(),e=uo(),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 Bv=a,Bv}var Mv,uC;function Cs(){if(uC)return Mv;uC=1;var r=Bl(),e=Il();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 Mv=t,Mv}var kv,lC;function wV(){if(lC)return kv;lC=1;function r(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}return kv=r,kv}var Lv,fC;function Ln(){if(fC)return Lv;fC=1;function r(e){return e!=null&&typeof e=="object"}return Lv=r,Lv}var Ov,cC;function xV(){if(cC)return Ov;cC=1;var r=fi(),e=Ln(),t="[object Arguments]";function n(a){return e(a)&&r(a)==t}return Ov=n,Ov}var qv,dC;function _s(){if(dC)return qv;dC=1;var r=xV(),e=Ln(),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 qv=i,qv}var Nv,vC;function Zr(){if(vC)return Nv;vC=1;var r=Array.isArray;return Nv=r,Nv}var zo={exports:{}},Fv,hC;function EV(){if(hC)return Fv;hC=1;function r(){return!1}return Fv=r,Fv}zo.exports;var gC;function fo(){return gC||(gC=1,(function(r,e){var t=En(),n=EV(),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})(zo,zo.exports)),zo.exports}var zv,pC;function Ml(){if(pC)return zv;pC=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 zv=t,zv}var $v,yC;function t0(){if(yC)return $v;yC=1;var r=9007199254740991;function e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=r}return $v=e,$v}var Vv,mC;function CV(){if(mC)return Vv;mC=1;var r=fi(),e=t0(),t=Ln(),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 k(M){return t(M)&&e(M.length)&&!!I[r(M)]}return Vv=k,Vv}var Gv,bC;function kl(){if(bC)return Gv;bC=1;function r(e){return function(t){return e(t)}}return Gv=r,Gv}var $o={exports:{}};$o.exports;var wC;function n0(){return wC||(wC=1,(function(r,e){var t=HA(),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})($o,$o.exports)),$o.exports}var Wv,xC;function Ss(){if(xC)return Wv;xC=1;var r=CV(),e=kl(),t=n0(),n=t&&t.isTypedArray,a=n?e(n):r;return Wv=a,Wv}var Uv,EC;function YA(){if(EC)return Uv;EC=1;var r=wV(),e=_s(),t=Zr(),n=fo(),a=Ml(),i=Ss(),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 Uv=l,Uv}var Hv,CC;function Ll(){if(CC)return Hv;CC=1;var r=Object.prototype;function e(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||r;return t===a}return Hv=e,Hv}var Kv,_C;function ZA(){if(_C)return Kv;_C=1;function r(e,t){return function(n){return e(t(n))}}return Kv=r,Kv}var jv,SC;function _V(){if(SC)return jv;SC=1;var r=ZA(),e=r(Object.keys,Object);return jv=e,jv}var Yv,TC;function a0(){if(TC)return Yv;TC=1;var r=Ll(),e=_V(),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 Yv=a,Yv}var Zv,RC;function Jn(){if(RC)return Zv;RC=1;var r=Es(),e=t0();function t(n){return n!=null&&e(n.length)&&!r(n)}return Zv=t,Zv}var Xv,AC;function qa(){if(AC)return Xv;AC=1;var r=YA(),e=a0(),t=Jn();function n(a){return t(a)?r(a):e(a)}return Xv=n,Xv}var Qv,PC;function SV(){if(PC)return Qv;PC=1;var r=Cs(),e=qa();function t(n,a){return n&&r(a,e(a),n)}return Qv=t,Qv}var Jv,DC;function TV(){if(DC)return Jv;DC=1;function r(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}return Jv=r,Jv}var eh,IC;function RV(){if(IC)return eh;IC=1;var r=fn(),e=Ll(),t=TV(),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 eh=i,eh}var rh,BC;function di(){if(BC)return rh;BC=1;var r=YA(),e=RV(),t=Jn();function n(a){return t(a)?r(a,!0):e(a)}return rh=n,rh}var th,MC;function AV(){if(MC)return th;MC=1;var r=Cs(),e=di();function t(n,a){return n&&r(a,e(a),n)}return th=t,th}var Vo={exports:{}};Vo.exports;var kC;function XA(){return kC||(kC=1,(function(r,e){var t=En(),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})(Vo,Vo.exports)),Vo.exports}var nh,LC;function QA(){if(LC)return nh;LC=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 nh=r,nh}var ah,OC;function JA(){if(OC)return ah;OC=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 ah=r,ah}var ih,qC;function eP(){if(qC)return ih;qC=1;function r(){return[]}return ih=r,ih}var oh,NC;function i0(){if(NC)return oh;NC=1;var r=JA(),e=eP(),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 oh=i,oh}var sh,FC;function PV(){if(FC)return sh;FC=1;var r=Cs(),e=i0();function t(n,a){return r(n,e(n),a)}return sh=t,sh}var uh,zC;function o0(){if(zC)return uh;zC=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 uh=r,uh}var lh,$C;function Ol(){if($C)return lh;$C=1;var r=ZA(),e=r(Object.getPrototypeOf,Object);return lh=e,lh}var fh,VC;function rP(){if(VC)return fh;VC=1;var r=o0(),e=Ol(),t=i0(),n=eP(),a=Object.getOwnPropertySymbols,i=a?function(o){for(var s=[];o;)r(s,t(o)),o=e(o);return s}:n;return fh=i,fh}var ch,GC;function DV(){if(GC)return ch;GC=1;var r=Cs(),e=rP();function t(n,a){return r(n,e(n),a)}return ch=t,ch}var dh,WC;function tP(){if(WC)return dh;WC=1;var r=o0(),e=Zr();function t(n,a,i){var o=a(n);return e(n)?o:r(o,i(n))}return dh=t,dh}var vh,UC;function nP(){if(UC)return vh;UC=1;var r=tP(),e=i0(),t=qa();function n(a){return r(a,t,e)}return vh=n,vh}var hh,HC;function IV(){if(HC)return hh;HC=1;var r=tP(),e=rP(),t=di();function n(a){return r(a,t,e)}return hh=n,hh}var gh,KC;function BV(){if(KC)return gh;KC=1;var r=ci(),e=En(),t=r(e,"DataView");return gh=t,gh}var ph,jC;function MV(){if(jC)return ph;jC=1;var r=ci(),e=En(),t=r(e,"Promise");return ph=t,ph}var yh,YC;function aP(){if(YC)return yh;YC=1;var r=ci(),e=En(),t=r(e,"Set");return yh=t,yh}var mh,ZC;function kV(){if(ZC)return mh;ZC=1;var r=ci(),e=En(),t=r(e,"WeakMap");return mh=t,mh}var bh,XC;function co(){if(XC)return bh;XC=1;var r=BV(),e=Jm(),t=MV(),n=aP(),a=kV(),i=fi(),o=KA(),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}),bh=w,bh}var wh,QC;function LV(){if(QC)return wh;QC=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 wh=t,wh}var xh,JC;function iP(){if(JC)return xh;JC=1;var r=En(),e=r.Uint8Array;return xh=e,xh}var Eh,e_;function s0(){if(e_)return Eh;e_=1;var r=iP();function e(t){var n=new t.constructor(t.byteLength);return new r(n).set(new r(t)),n}return Eh=e,Eh}var Ch,r_;function OV(){if(r_)return Ch;r_=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 Ch=e,Ch}var _h,t_;function qV(){if(t_)return _h;t_=1;var r=/\w*$/;function e(t){var n=new t.constructor(t.source,r.exec(t));return n.lastIndex=t.lastIndex,n}return _h=e,_h}var Sh,n_;function NV(){if(n_)return Sh;n_=1;var r=lo(),e=r?r.prototype:void 0,t=e?e.valueOf:void 0;function n(a){return t?Object(t.call(a)):{}}return Sh=n,Sh}var Th,a_;function oP(){if(a_)return Th;a_=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 Th=e,Th}var Rh,i_;function FV(){if(i_)return Rh;i_=1;var r=s0(),e=OV(),t=qV(),n=NV(),a=oP(),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 k=P.constructor;switch(D){case g:return r(P);case i:case o:return new k(+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 k;case l:case d:return new k(P);case u:return t(P);case c:return new k;case h:return n(P)}}return Rh=A,Rh}var Ah,o_;function sP(){if(o_)return Ah;o_=1;var r=fn(),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 Ah=t,Ah}var Ph,s_;function uP(){if(s_)return Ph;s_=1;var r=sP(),e=Ol(),t=Ll();function n(a){return typeof a.constructor=="function"&&!t(a)?r(e(a)):{}}return Ph=n,Ph}var Dh,u_;function zV(){if(u_)return Dh;u_=1;var r=co(),e=Ln(),t="[object Map]";function n(a){return e(a)&&r(a)==t}return Dh=n,Dh}var Ih,l_;function $V(){if(l_)return Ih;l_=1;var r=zV(),e=kl(),t=n0(),n=t&&t.isMap,a=n?e(n):r;return Ih=a,Ih}var Bh,f_;function VV(){if(f_)return Bh;f_=1;var r=co(),e=Ln(),t="[object Set]";function n(a){return e(a)&&r(a)==t}return Bh=n,Bh}var Mh,c_;function GV(){if(c_)return Mh;c_=1;var r=VV(),e=kl(),t=n0(),n=t&&t.isSet,a=n?e(n):r;return Mh=a,Mh}var kh,d_;function lP(){if(d_)return kh;d_=1;var r=Dl(),e=r0(),t=Bl(),n=SV(),a=AV(),i=XA(),o=QA(),s=PV(),l=DV(),u=nP(),c=IV(),d=co(),h=LV(),g=FV(),p=uP(),E=Zr(),m=fo(),b=$V(),w=fn(),x=GV(),C=qa(),T=di(),S=1,_=2,A=4,P="[object Arguments]",D="[object Array]",I="[object Boolean]",k="[object Date]",M="[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]",de="[object Int8Array]",se="[object Int16Array]",Z="[object Int32Array]",Q="[object Uint8Array]",ae="[object Uint8ClampedArray]",te="[object Uint16Array]",ce="[object Uint32Array]",_e={};_e[P]=_e[D]=_e[G]=_e[V]=_e[I]=_e[k]=_e[j]=_e[re]=_e[de]=_e[se]=_e[Z]=_e[W]=_e[q]=_e[$]=_e[X]=_e[Y]=_e[K]=_e[ee]=_e[Q]=_e[ae]=_e[te]=_e[ce]=!0,_e[M]=_e[N]=_e[le]=!1;function ve(U,fe,xe,ge,be,Ae){var Ie,Be=fe&S,Oe=fe&_,He=fe&A;if(xe&&(Ie=be?xe(U,ge,be,Ae):xe(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&&!be){if(Ie=Oe||er?{}:p(U),!Be)return Oe?l(U,a(Ie,U)):s(U,n(Ie,U))}else{if(!_e[Xe])return be?U:{};Ie=g(U,Xe,Be)}}Ae||(Ae=new r);var $e=Ae.get(U);if($e)return $e;Ae.set(U,Ie),x(U)?U.forEach(function(L){Ie.add(ve(L,fe,xe,L,U,Ae))}):b(U)&&U.forEach(function(L,oe){Ie.set(oe,ve(L,fe,xe,oe,U,Ae))});var ke=He?Oe?c:u:Oe?T:C,pe=Ve?void 0:ke(U);return e(pe||U,function(L,oe){pe&&(oe=L,L=U[oe]),t(Ie,oe,ve(L,fe,xe,oe,U,Ae))}),Ie}return kh=ve,kh}var Lh,v_;function WV(){if(v_)return Lh;v_=1;var r=lP(),e=4;function t(n){return r(n,e)}return Lh=t,Lh}var Oh,h_;function u0(){if(h_)return Oh;h_=1;function r(e){return function(){return e}}return Oh=r,Oh}var qh,g_;function UV(){if(g_)return qh;g_=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 qh=r,qh}var Nh,p_;function l0(){if(p_)return Nh;p_=1;var r=UV(),e=r();return Nh=e,Nh}var Fh,y_;function f0(){if(y_)return Fh;y_=1;var r=l0(),e=qa();function t(n,a){return n&&r(n,a,e)}return Fh=t,Fh}var zh,m_;function HV(){if(m_)return zh;m_=1;var r=Jn();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 zh=e,zh}var $h,b_;function ql(){if(b_)return $h;b_=1;var r=f0(),e=HV(),t=e(r);return $h=t,$h}var Vh,w_;function vi(){if(w_)return Vh;w_=1;function r(e){return e}return Vh=r,Vh}var Gh,x_;function fP(){if(x_)return Gh;x_=1;var r=vi();function e(t){return typeof t=="function"?t:r}return Gh=e,Gh}var Wh,E_;function cP(){if(E_)return Wh;E_=1;var r=r0(),e=ql(),t=fP(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o))}return Wh=a,Wh}var Uh,C_;function dP(){return C_||(C_=1,Uh=cP()),Uh}var Hh,__;function KV(){if(__)return Hh;__=1;var r=ql();function e(t,n){var a=[];return r(t,function(i,o,s){n(i,o,s)&&a.push(i)}),a}return Hh=e,Hh}var Kh,S_;function jV(){if(S_)return Kh;S_=1;var r="__lodash_hash_undefined__";function e(t){return this.__data__.set(t,r),this}return Kh=e,Kh}var jh,T_;function YV(){if(T_)return jh;T_=1;function r(e){return this.__data__.has(e)}return jh=r,jh}var Yh,R_;function vP(){if(R_)return Yh;R_=1;var r=e0(),e=jV(),t=YV();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,Yh=n,Yh}var Zh,A_;function ZV(){if(A_)return Zh;A_=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 Zh=r,Zh}var Xh,P_;function hP(){if(P_)return Xh;P_=1;function r(e,t){return e.has(t)}return Xh=r,Xh}var Qh,D_;function gP(){if(D_)return Qh;D_=1;var r=vP(),e=ZV(),t=hP(),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 Qh=i,Qh}var Jh,I_;function XV(){if(I_)return Jh;I_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a,i){n[++t]=[i,a]}),n}return Jh=r,Jh}var eg,B_;function c0(){if(B_)return eg;B_=1;function r(e){var t=-1,n=Array(e.size);return e.forEach(function(a){n[++t]=a}),n}return eg=r,eg}var rg,M_;function QV(){if(M_)return rg;M_=1;var r=lo(),e=iP(),t=uo(),n=gP(),a=XV(),i=c0(),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,k){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 M=a;case p:var N=P&o;if(M||(M=i),S.size!=_.size&&!N)return!1;var z=k.get(S);if(z)return z==_;P|=s,k.set(S,_);var W=n(M(S),M(_),P,D,I,k);return k.delete(S),W;case m:if(C)return C.call(S)==C.call(_)}return!1}return rg=T,rg}var tg,k_;function JV(){if(k_)return tg;k_=1;var r=nP(),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 tg=a,tg}var ng,L_;function e4(){if(L_)return ng;L_=1;var r=Dl(),e=gP(),t=QV(),n=JV(),a=co(),i=Zr(),o=fo(),s=Ss(),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 k=P&&g.call(E,"__wrapped__"),M=D&&g.call(m,"__wrapped__");if(k||M){var N=k?E.value():E,z=M?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 ng=p,ng}var ag,O_;function pP(){if(O_)return ag;O_=1;var r=e4(),e=Ln();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 ag=t,ag}var ig,q_;function r4(){if(q_)return ig;q_=1;var r=Dl(),e=pP(),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 ig=a,ig}var og,N_;function yP(){if(N_)return og;N_=1;var r=fn();function e(t){return t===t&&!r(t)}return og=e,og}var sg,F_;function t4(){if(F_)return sg;F_=1;var r=yP(),e=qa();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 ug,z_;function mP(){if(z_)return ug;z_=1;function r(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}return ug=r,ug}var lg,$_;function n4(){if($_)return lg;$_=1;var r=r4(),e=t4(),t=mP();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 lg=n,lg}var fg,V_;function vo(){if(V_)return fg;V_=1;var r=fi(),e=Ln(),t="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&r(a)==t}return fg=n,fg}var cg,G_;function d0(){if(G_)return cg;G_=1;var r=Zr(),e=vo(),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 cg=a,cg}var dg,W_;function a4(){if(W_)return dg;W_=1;var r=e0(),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,dg=t,dg}var vg,U_;function i4(){if(U_)return vg;U_=1;var r=a4(),e=500;function t(n){var a=r(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return vg=t,vg}var hg,H_;function o4(){if(H_)return hg;H_=1;var r=i4(),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 hg=n,hg}var gg,K_;function Nl(){if(K_)return gg;K_=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 gg=r,gg}var pg,j_;function s4(){if(j_)return pg;j_=1;var r=lo(),e=Nl(),t=Zr(),n=vo(),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 pg=o,pg}var yg,Y_;function bP(){if(Y_)return yg;Y_=1;var r=s4();function e(t){return t==null?"":r(t)}return yg=e,yg}var mg,Z_;function Fl(){if(Z_)return mg;Z_=1;var r=Zr(),e=d0(),t=o4(),n=bP();function a(i,o){return r(i)?i:e(i,o)?[i]:t(n(i))}return mg=a,mg}var bg,X_;function Ts(){if(X_)return bg;X_=1;var r=vo();function e(t){if(typeof t=="string"||r(t))return t;var n=t+"";return n=="0"&&1/t==-1/0?"-0":n}return bg=e,bg}var wg,Q_;function zl(){if(Q_)return wg;Q_=1;var r=Fl(),e=Ts();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 wg=t,wg}var xg,J_;function u4(){if(J_)return xg;J_=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 xg=e,xg}var Eg,eS;function l4(){if(eS)return Eg;eS=1;function r(e,t){return e!=null&&t in Object(e)}return Eg=r,Eg}var Cg,rS;function wP(){if(rS)return Cg;rS=1;var r=Fl(),e=_s(),t=Zr(),n=Ml(),a=t0(),i=Ts();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 Cg=o,Cg}var _g,tS;function xP(){if(tS)return _g;tS=1;var r=l4(),e=wP();function t(n,a){return n!=null&&e(n,a,r)}return _g=t,_g}var Sg,nS;function f4(){if(nS)return Sg;nS=1;var r=pP(),e=u4(),t=xP(),n=d0(),a=yP(),i=mP(),o=Ts(),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 Sg=u,Sg}var Tg,aS;function EP(){if(aS)return Tg;aS=1;function r(e){return function(t){return t==null?void 0:t[e]}}return Tg=r,Tg}var Rg,iS;function c4(){if(iS)return Rg;iS=1;var r=zl();function e(t){return function(n){return r(n,t)}}return Rg=e,Rg}var Ag,oS;function d4(){if(oS)return Ag;oS=1;var r=EP(),e=c4(),t=d0(),n=Ts();function a(i){return t(i)?r(n(i)):e(i)}return Ag=a,Ag}var Pg,sS;function ea(){if(sS)return Pg;sS=1;var r=n4(),e=f4(),t=vi(),n=Zr(),a=d4();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 Pg=i,Pg}var Dg,uS;function CP(){if(uS)return Dg;uS=1;var r=JA(),e=KV(),t=ea(),n=Zr();function a(i,o){var s=n(i)?r:e;return s(i,t(o,3))}return Dg=a,Dg}var Ig,lS;function v4(){if(lS)return Ig;lS=1;var r=Object.prototype,e=r.hasOwnProperty;function t(n,a){return n!=null&&e.call(n,a)}return Ig=t,Ig}var Bg,fS;function _P(){if(fS)return Bg;fS=1;var r=v4(),e=wP();function t(n,a){return n!=null&&e(n,a,r)}return Bg=t,Bg}var Mg,cS;function h4(){if(cS)return Mg;cS=1;var r=a0(),e=co(),t=_s(),n=Zr(),a=Jn(),i=fo(),o=Ll(),s=Ss(),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 Mg=h,Mg}var kg,dS;function SP(){if(dS)return kg;dS=1;function r(e){return e===void 0}return kg=r,kg}var Lg,vS;function TP(){if(vS)return Lg;vS=1;var r=ql(),e=Jn();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 Lg=t,Lg}var Og,hS;function RP(){if(hS)return Og;hS=1;var r=Nl(),e=ea(),t=TP(),n=Zr();function a(i,o){var s=n(i)?r:t;return s(i,e(o,3))}return Og=a,Og}var qg,gS;function g4(){if(gS)return qg;gS=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 qg=r,qg}var Ng,pS;function p4(){if(pS)return Ng;pS=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 Ng=r,Ng}var Fg,yS;function AP(){if(yS)return Fg;yS=1;var r=g4(),e=ql(),t=ea(),n=p4(),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 Fg=i,Fg}var zg,mS;function y4(){if(mS)return zg;mS=1;var r=fi(),e=Zr(),t=Ln(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&t(i)&&r(i)==n}return zg=a,zg}var $g,bS;function m4(){if(bS)return $g;bS=1;var r=EP(),e=r("length");return $g=e,$g}var Vg,wS;function b4(){if(wS)return Vg;wS=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 Vg=l,Vg}var Gg,xS;function w4(){if(xS)return Gg;xS=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 Gg=C,Gg}var Wg,ES;function x4(){if(ES)return Wg;ES=1;var r=m4(),e=b4(),t=w4();function n(a){return e(a)?t(a):r(a)}return Wg=n,Wg}var Ug,CS;function E4(){if(CS)return Ug;CS=1;var r=a0(),e=co(),t=Jn(),n=y4(),a=x4(),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 Ug=s,Ug}var Hg,_S;function C4(){if(_S)return Hg;_S=1;var r=r0(),e=sP(),t=f0(),n=ea(),a=Ol(),i=Zr(),o=fo(),s=Es(),l=fn(),u=Ss();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 Hg=c,Hg}var Kg,SS;function _4(){if(SS)return Kg;SS=1;var r=lo(),e=_s(),t=Zr(),n=r?r.isConcatSpreadable:void 0;function a(i){return t(i)||e(i)||!!(n&&i&&i[n])}return Kg=a,Kg}var jg,TS;function v0(){if(TS)return jg;TS=1;var r=o0(),e=_4();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 jg=t,jg}var Yg,RS;function S4(){if(RS)return Yg;RS=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 Yg=r,Yg}var Zg,AS;function PP(){if(AS)return Zg;AS=1;var r=S4(),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 Zg=t,Zg}var Xg,PS;function T4(){if(PS)return Xg;PS=1;var r=u0(),e=jA(),t=vi(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:r(i),writable:!0})}:t;return Xg=n,Xg}var Qg,DS;function R4(){if(DS)return Qg;DS=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 Qg=n,Qg}var Jg,IS;function DP(){if(IS)return Jg;IS=1;var r=T4(),e=R4(),t=e(r);return Jg=t,Jg}var ep,BS;function $l(){if(BS)return ep;BS=1;var r=vi(),e=PP(),t=DP();function n(a,i){return t(e(a,i,r),a+"")}return ep=n,ep}var rp,MS;function IP(){if(MS)return rp;MS=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 rp=r,rp}var tp,kS;function A4(){if(kS)return tp;kS=1;function r(e){return e!==e}return tp=r,tp}var np,LS;function P4(){if(LS)return np;LS=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 np=r,np}var ap,OS;function D4(){if(OS)return ap;OS=1;var r=IP(),e=A4(),t=P4();function n(a,i,o){return i===i?t(a,i,o):r(a,e,o)}return ap=n,ap}var ip,qS;function I4(){if(qS)return ip;qS=1;var r=D4();function e(t,n){var a=t==null?0:t.length;return!!a&&r(t,n,0)>-1}return ip=e,ip}var op,NS;function B4(){if(NS)return op;NS=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 op=r,op}var sp,FS;function M4(){if(FS)return sp;FS=1;function r(){}return sp=r,sp}var up,zS;function k4(){if(zS)return up;zS=1;var r=aP(),e=M4(),t=c0(),n=1/0,a=r&&1/t(new r([,-0]))[1]==n?function(i){return new r(i)}:e;return up=a,up}var lp,$S;function L4(){if($S)return lp;$S=1;var r=vP(),e=I4(),t=B4(),n=hP(),a=k4(),i=c0(),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 lp=s,lp}var fp,VS;function BP(){if(VS)return fp;VS=1;var r=Jn(),e=Ln();function t(n){return e(n)&&r(n)}return fp=t,fp}var cp,GS;function O4(){if(GS)return cp;GS=1;var r=v0(),e=$l(),t=L4(),n=BP(),a=e(function(i){return t(r(i,1,n,!0))});return cp=a,cp}var dp,WS;function q4(){if(WS)return dp;WS=1;var r=Nl();function e(t,n){return r(n,function(a){return t[a]})}return dp=e,dp}var vp,US;function MP(){if(US)return vp;US=1;var r=q4(),e=qa();function t(n){return n==null?[]:r(n,e(n))}return vp=t,vp}var hp,HS;function cn(){if(HS)return hp;HS=1;var r;if(typeof Qm=="function")try{r={clone:WV(),constant:u0(),each:dP(),filter:CP(),has:_P(),isArray:Zr(),isEmpty:h4(),isFunction:Es(),isUndefined:SP(),keys:qa(),map:RP(),reduce:AP(),size:E4(),transform:C4(),union:O4(),values:MP()}}catch{}return r||(r=window._),hp=r,hp}var gp,KS;function h0(){if(KS)return gp;KS=1;var r=cn();gp=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 gp}var pp,jS;function N4(){return jS||(jS=1,pp="2.1.8"),pp}var yp,YS;function F4(){return YS||(YS=1,yp={Graph:h0(),version:N4()}),yp}var mp,ZS;function z4(){if(ZS)return mp;ZS=1;var r=cn(),e=h0();mp={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 mp}var bp,XS;function $4(){if(XS)return bp;XS=1;var r=cn();bp=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 bp}var wp,QS;function kP(){if(QS)return wp;QS=1;var r=cn();wp=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},wp}var xp,JS;function LP(){if(JS)return xp;JS=1;var r=cn(),e=kP();xp=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 xp}var Ep,eT;function V4(){if(eT)return Ep;eT=1;var r=LP(),e=cn();Ep=t;function t(n,a,i){return e.transform(n.nodes(),function(o,s){o[s]=r(n,s,a,i)},{})}return Ep}var Cp,rT;function OP(){if(rT)return Cp;rT=1;var r=cn();Cp=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 Cp}var _p,tT;function G4(){if(tT)return _p;tT=1;var r=cn(),e=OP();_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 Sp,nT;function W4(){if(nT)return Sp;nT=1;var r=cn();Sp=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 Sp}var Tp,aT;function qP(){if(aT)return Tp;aT=1;var r=cn();Tp=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,Tp}var Rp,iT;function U4(){if(iT)return Rp;iT=1;var r=qP();Rp=e;function e(t){try{r(t)}catch(n){if(n instanceof r.CycleException)return!1;throw n}return!0}return Rp}var Ap,oT;function NP(){if(oT)return Ap;oT=1;var r=cn();Ap=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 Ap}var Pp,sT;function H4(){if(sT)return Pp;sT=1;var r=NP();Pp=e;function e(t,n){return r(t,n,"post")}return Pp}var Dp,uT;function K4(){if(uT)return Dp;uT=1;var r=NP();Dp=e;function e(t,n){return r(t,n,"pre")}return Dp}var Ip,lT;function j4(){if(lT)return Ip;lT=1;var r=cn(),e=h0(),t=kP();Ip=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 Ip}var Bp,fT;function Y4(){return fT||(fT=1,Bp={components:$4(),dijkstra:LP(),dijkstraAll:V4(),findCycles:G4(),floydWarshall:W4(),isAcyclic:U4(),postorder:H4(),preorder:K4(),prim:j4(),tarjan:OP(),topsort:qP()}),Bp}var Mp,cT;function Z4(){if(cT)return Mp;cT=1;var r=F4();return Mp={Graph:r.Graph,json:z4(),alg:Y4(),version:r.version},Mp}var kp,dT;function xn(){if(dT)return kp;dT=1;var r;if(typeof Qm=="function")try{r=Z4()}catch{}return r||(r=window.graphlib),kp=r,kp}var Lp,vT;function X4(){if(vT)return Lp;vT=1;var r=lP(),e=1,t=4;function n(a){return r(a,e|t)}return Lp=n,Lp}var Op,hT;function Vl(){if(hT)return Op;hT=1;var r=uo(),e=Jn(),t=Ml(),n=fn();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 Op=a,Op}var qp,gT;function Q4(){if(gT)return qp;gT=1;var r=$l(),e=uo(),t=Vl(),n=di(),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 qp=o,qp}var Np,pT;function J4(){if(pT)return Np;pT=1;var r=ea(),e=Jn(),t=qa();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 Np=n,Np}var Fp,yT;function eG(){if(yT)return Fp;yT=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Fp=e,Fp}var zp,mT;function rG(){if(mT)return zp;mT=1;var r=eG(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return zp=t,zp}var $p,bT;function tG(){if(bT)return $p;bT=1;var r=rG(),e=fn(),t=vo(),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 $p=l,$p}var Vp,wT;function FP(){if(wT)return Vp;wT=1;var r=tG(),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 Vp=n,Vp}var Gp,xT;function nG(){if(xT)return Gp;xT=1;var r=FP();function e(t){var n=r(t),a=n%1;return n===n?a?n-a:n:0}return Gp=e,Gp}var Wp,ET;function aG(){if(ET)return Wp;ET=1;var r=IP(),e=ea(),t=nG(),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 Wp=a,Wp}var Up,CT;function iG(){if(CT)return Up;CT=1;var r=J4(),e=aG(),t=r(e);return Up=t,Up}var Hp,_T;function zP(){if(_T)return Hp;_T=1;var r=v0();function e(t){var n=t==null?0:t.length;return n?r(t,1):[]}return Hp=e,Hp}var Kp,ST;function oG(){if(ST)return Kp;ST=1;var r=l0(),e=fP(),t=di();function n(a,i){return a==null?a:r(a,e(i),t)}return Kp=n,Kp}var jp,TT;function sG(){if(TT)return jp;TT=1;function r(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}return jp=r,jp}var Yp,RT;function uG(){if(RT)return Yp;RT=1;var r=Il(),e=f0(),t=ea();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 Yp=n,Yp}var Zp,AT;function g0(){if(AT)return Zp;AT=1;var r=vo();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 Zp=e,Zp}var Xp,PT;function lG(){if(PT)return Xp;PT=1;function r(e,t){return e>t}return Xp=r,Xp}var Qp,DT;function fG(){if(DT)return Qp;DT=1;var r=g0(),e=lG(),t=vi();function n(a){return a&&a.length?r(a,t,e):void 0}return Qp=n,Qp}var Jp,IT;function $P(){if(IT)return Jp;IT=1;var r=Il(),e=uo();function t(n,a,i){(i!==void 0&&!e(n[a],i)||i===void 0&&!(a in n))&&r(n,a,i)}return Jp=t,Jp}var ey,BT;function cG(){if(BT)return ey;BT=1;var r=fi(),e=Ol(),t=Ln(),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 ey=u,ey}var ry,MT;function VP(){if(MT)return ry;MT=1;function r(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}return ry=r,ry}var ty,kT;function dG(){if(kT)return ty;kT=1;var r=Cs(),e=di();function t(n){return r(n,e(n))}return ty=t,ty}var ny,LT;function vG(){if(LT)return ny;LT=1;var r=$P(),e=XA(),t=oP(),n=QA(),a=uP(),i=_s(),o=Zr(),s=BP(),l=fo(),u=Es(),c=fn(),d=cG(),h=Ss(),g=VP(),p=dG();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 k=o(A),M=!k&&l(A),N=!k&&!M&&h(A);D=A,k||M||N?o(_)?D=_:s(_)?D=n(_):M?(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 ny=E,ny}var ay,OT;function hG(){if(OT)return ay;OT=1;var r=Dl(),e=$P(),t=l0(),n=vG(),a=fn(),i=di(),o=VP();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 ay=s,ay}var iy,qT;function gG(){if(qT)return iy;qT=1;var r=$l(),e=Vl();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 iy=t,iy}var oy,NT;function pG(){if(NT)return oy;NT=1;var r=hG(),e=gG(),t=e(function(n,a,i){r(n,a,i)});return oy=t,oy}var sy,FT;function GP(){if(FT)return sy;FT=1;function r(e,t){return e<t}return sy=r,sy}var uy,zT;function yG(){if(zT)return uy;zT=1;var r=g0(),e=GP(),t=vi();function n(a){return a&&a.length?r(a,t,e):void 0}return uy=n,uy}var ly,$T;function mG(){if($T)return ly;$T=1;var r=g0(),e=ea(),t=GP();function n(a,i){return a&&a.length?r(a,e(i,2),t):void 0}return ly=n,ly}var fy,VT;function bG(){if(VT)return fy;VT=1;var r=En(),e=function(){return r.Date.now()};return fy=e,fy}var cy,GT;function wG(){if(GT)return cy;GT=1;var r=Bl(),e=Fl(),t=Ml(),n=fn(),a=Ts();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 cy=i,cy}var dy,WT;function xG(){if(WT)return dy;WT=1;var r=zl(),e=wG(),t=Fl();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 dy=n,dy}var vy,UT;function EG(){if(UT)return vy;UT=1;var r=xG(),e=xP();function t(n,a){return r(n,a,function(i,o){return e(n,o)})}return vy=t,vy}var hy,HT;function CG(){if(HT)return hy;HT=1;var r=zP(),e=PP(),t=DP();function n(a){return t(e(a,void 0,r),a+"")}return hy=n,hy}var gy,KT;function _G(){if(KT)return gy;KT=1;var r=EG(),e=CG(),t=e(function(n,a){return n==null?{}:r(n,a)});return gy=t,gy}var py,jT;function SG(){if(jT)return py;jT=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 py=t,py}var yy,YT;function TG(){if(YT)return yy;YT=1;var r=SG(),e=Vl(),t=FP();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 yy=n,yy}var my,ZT;function RG(){if(ZT)return my;ZT=1;var r=TG(),e=r();return my=e,my}var by,XT;function AG(){if(XT)return by;XT=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 wy,QT;function PG(){if(QT)return wy;QT=1;var r=vo();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 wy=e,wy}var xy,JT;function DG(){if(JT)return xy;JT=1;var r=PG();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 xy=e,xy}var Ey,e2;function IG(){if(e2)return Ey;e2=1;var r=Nl(),e=zl(),t=ea(),n=TP(),a=AG(),i=kl(),o=DG(),s=vi(),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 Ey=u,Ey}var Cy,r2;function BG(){if(r2)return Cy;r2=1;var r=v0(),e=IG(),t=$l(),n=Vl(),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 Cy=a,Cy}var _y,t2;function MG(){if(t2)return _y;t2=1;var r=bP(),e=0;function t(n){var a=++e;return r(n)+a}return _y=t,_y}var Sy,n2;function kG(){if(n2)return Sy;n2=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 Sy=r,Sy}var Ty,a2;function LG(){if(a2)return Ty;a2=1;var r=Bl(),e=kG();function t(n,a){return e(n||[],a||[],r)}return Ty=t,Ty}var Ry,i2;function qr(){if(i2)return Ry;i2=1;var r;if(typeof Qm=="function")try{r={cloneDeep:X4(),constant:u0(),defaults:Q4(),each:dP(),filter:CP(),find:iG(),flatten:zP(),forEach:cP(),forIn:oG(),has:_P(),isUndefined:SP(),last:sG(),map:RP(),mapValues:uG(),max:fG(),merge:pG(),min:yG(),minBy:mG(),now:bG(),pick:_G(),range:RG(),reduce:AP(),sortBy:BG(),uniqueId:MG(),values:MP(),zipObject:LG()}}catch{}return r||(r=window._),Ry=r,Ry}var Ay,o2;function OG(){if(o2)return Ay;o2=1,Ay=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 Ay}var Py,s2;function qG(){if(s2)return Py;s2=1;var r=qr(),e=xn().Graph,t=OG();Py=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 Py}var Dy,u2;function NG(){if(u2)return Dy;u2=1;var r=qr(),e=qG();Dy={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 Dy}var Iy,l2;function $t(){if(l2)return Iy;l2=1;var r=qr(),e=xn().Graph;Iy={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 Iy}var By,f2;function FG(){if(f2)return By;f2=1;var r=qr(),e=$t();By={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 By}var My,c2;function al(){if(c2)return My;c2=1;var r=qr();My={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 My}var ky,d2;function WP(){if(d2)return ky;d2=1;var r=qr(),e=xn().Graph,t=al().slack;ky=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 ky}var Ly,v2;function zG(){if(v2)return Ly;v2=1;var r=qr(),e=WP(),t=al().slack,n=al().longestPath,a=xn().alg.preorder,i=xn().alg.postorder,o=$t().simplify;Ly=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 k=I.v===T,M=k?I.w:I.v;if(M!==_){var N=k===A,z=C.edge(I).weight;if(D+=N?z:-z,b(x,T,M)){var W=x.edge(T,M).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 k=r.filter(C.edges(),function(M){return I===w(x,x.node(M.v),D)&&I!==w(x,x.node(M.w),D)});return r.minBy(k,function(M){return t(C,M)})}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 Ly}var Oy,h2;function $G(){if(h2)return Oy;h2=1;var r=al(),e=r.longestPath,t=WP(),n=zG();Oy=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 Oy}var qy,g2;function VG(){if(g2)return qy;g2=1;var r=qr();qy=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 qy}var Ny,p2;function GG(){if(p2)return Ny;p2=1;var r=qr(),e=$t();Ny={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 Ny}var Fy,y2;function WG(){if(y2)return Fy;y2=1;var r=qr(),e=$t();Fy=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 Fy}var zy,m2;function UG(){if(m2)return zy;m2=1;var r=qr();zy={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 zy}var $y,b2;function HG(){if(b2)return $y;b2=1;var r=qr();$y=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 $y}var Vy,w2;function KG(){if(w2)return Vy;w2=1;var r=qr();Vy=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 Vy}var Gy,x2;function jG(){if(x2)return Gy;x2=1;var r=qr();Gy=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 Gy}var Wy,E2;function YG(){if(E2)return Wy;E2=1;var r=qr();Wy=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 Wy}var Uy,C2;function ZG(){if(C2)return Uy;C2=1;var r=qr(),e=$t();Uy=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 Uy}var Hy,_2;function XG(){if(_2)return Hy;_2=1;var r=qr(),e=jG(),t=YG(),n=ZG();Hy=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 Hy}var Ky,S2;function QG(){if(S2)return Ky;S2=1;var r=qr(),e=xn().Graph;Ky=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 Ky}var jy,T2;function JG(){if(T2)return jy;T2=1;var r=qr();jy=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 jy}var Yy,R2;function eW(){if(R2)return Yy;R2=1;var r=qr(),e=HG(),t=KG(),n=XG(),a=QG(),i=JG(),o=xn().Graph,s=$t();Yy=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 Yy}var Zy,A2;function rW(){if(A2)return Zy;A2=1;var r=qr(),e=xn().Graph,t=$t();Zy={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,k){var M=i(b,I),N=M?b.node(M).order:P;(M||I===D)&&(r.forEach(S.slice(A,k+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=k+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(k){I=S[k],b.node(I).dummy&&r.forEach(b.predecessors(I),function(M){var N=b.node(M);N.dummy&&(N.order<P||N.order>D)&&o(x,M,I)})})}function T(S,_){var A=-1,P,D=0;return r.forEach(_,function(I,k){if(b.node(I).dummy==="border"){var M=b.predecessors(I);M.length&&(P=b.node(M[0]).order,C(_,D,k,A,P),D=k,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 k=(I.length-1)/2,M=Math.floor(k),N=Math.ceil(k);M<=N;++M){var z=I[M];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(k,M){for(var N=_.nodes(),z=N.pop(),W={};z;)W[z]?k(z):(W[z]=!0,N.push(z),N=N.concat(M(z))),z=N.pop()}function D(k){S[k]=_.inEdges(k).reduce(function(M,N){return Math.max(M,S[N.v]+_.edge(N))},0)}function I(k){var M=_.outEdges(k).reduce(function(z,W){return Math.min(z,S[W.w]-_.edge(W))},Number.POSITIVE_INFINITY),N=b.node(k);M!==Number.POSITIVE_INFINITY&&N.borderType!==A&&(S[k]=Math.max(S[k],M))}return P(D,_.predecessors.bind(_)),P(I,_.successors.bind(_)),r.forEach(C,function(k){S[k]=S[x[k]]}),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 k=x[P],M=T.edge(k,I);T.setEdge(k,I,Math.max(_(b,D,P),M||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(k){return k+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(k){return r.values(k).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(k){return-k})),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 Zy}var Xy,P2;function tW(){if(P2)return Xy;P2=1;var r=qr(),e=$t(),t=rW().positionX;Xy=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 Xy}var Qy,D2;function nW(){if(D2)return Qy;D2=1;var r=qr(),e=NG(),t=FG(),n=$G(),a=$t().normalizeRanks,i=VG(),o=$t().removeEmptyRanks,s=GG(),l=WG(),u=UG(),c=eW(),d=tW(),h=$t(),g=xn().Graph;Qy=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(){k(G)}),V(" removeEdgeLabelProxies",function(){M(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),de=V.node(j);re&&(re.x=de.x,re.y=de.y,V.children(j).length&&(re.width=de.width,re.height=de.height))}),r.forEach(G.edges(),function(j){var re=G.edge(j),de=V.edge(j);re.points=de.points,r.has(de,"x")&&(re.x=de.x,re.y=de.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 de=le(G.node(re));V.setNode(re,r.defaults(ee(de,C),T)),V.setParent(re,G.parent(re))}),r.forEach(G.edges(),function(re){var de=le(G.edge(re));V.setEdge(re,r.merge({},_,ee(de,S),r.pick(de,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),de=G.node(V.w),se={rank:(de.rank-re.rank)/2+re.rank,e:V};h.addDummyNode(G,"edge-proxy",se,"_ep")}})}function k(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 M(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,de=0,se=G.graph(),Z=se.marginx||0,Q=se.marginy||0;function ae(te){var ce=te.x,_e=te.y,ve=te.width,U=te.height;V=Math.min(V,ce-ve/2),j=Math.max(j,ce+ve/2),re=Math.min(re,_e-U/2),de=Math.max(de,_e+U/2)}r.forEach(G.nodes(),function(te){ae(G.node(te))}),r.forEach(G.edges(),function(te){var ce=G.edge(te);r.has(ce,"x")&&ae(ce)}),V-=Z,re-=Q,r.forEach(G.nodes(),function(te){var ce=G.node(te);ce.x-=V,ce.y-=re}),r.forEach(G.edges(),function(te){var ce=G.edge(te);r.forEach(ce.points,function(_e){_e.x-=V,_e.y-=re}),r.has(ce,"x")&&(ce.x-=V),r.has(ce,"y")&&(ce.y-=re)}),se.width=j-V+Z,se.height=de-re+Q}function z(G){r.forEach(G.edges(),function(V){var j=G.edge(V),re=G.node(V.v),de=G.node(V.w),se,Z;j.points?(se=j.points[0],Z=j.points[j.points.length-1]):(j.points=[],se=de,Z=re),j.points.unshift(h.intersectRect(re,se)),j.points.push(h.intersectRect(de,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),de=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(de.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(de,se){var Z=G.node(de);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),de=re.x+re.width/2,se=re.y,Z=j.x-de,Q=re.height/2;G.setEdge(j.e,j.label),G.removeNode(V),j.label.points=[{x:de+2*Z/3,y:se-Q},{x:de+5*Z/6,y:se-Q},{x:de+Z,y:se},{x:de+5*Z/6,y:se+Q},{x:de+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 Qy}var Jy,I2;function aW(){if(I2)return Jy;I2=1;var r=qr(),e=$t(),t=xn().Graph;Jy={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 Jy}var em,B2;function iW(){return B2||(B2=1,em="0.8.5"),em}var rm,M2;function oW(){return M2||(M2=1,rm={graphlib:xn(),layout:nW(),debug:aW(),util:{time:$t().time,notime:$t().notime},version:iW()}),rm}var sW=$u.exports,k2;function uW(){return k2||(k2=1,(function(r,e){(function(n,a){r.exports=a(oW())})(sW,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 k=0;k<I.length;k++){var M=I[k];w.setEdge(M.source().id(),M.target().id(),{minlen:m(M,h.minLen),weight:m(M,h.edgeWeight),name:M.id()},M.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})])})})($u)),$u.exports}var lW=uW();const fW=Sl(lW);var Vu={exports:{}},tm,L2;function cW(){if(L2)return tm;L2=1;var r="Expected a function",e="__lodash_hash_undefined__",t="[object Function]",n="[object GeneratorFunction]",a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=typeof Et=="object"&&Et&&Et.Object===Object&&Et,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=de(l,"Map"),S=de(Object,"create");function _(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[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 k(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=k;function M(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function N(){this.__data__=[]}function z(ve){var U=this.__data__,fe=V(U,ve);if(fe<0)return!1;var xe=U.length-1;return fe==xe?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__,xe=V(fe,ve);return xe<0?fe.push([ve,U]):fe[xe][1]=U,this}M.prototype.clear=N,M.prototype.delete=z,M.prototype.get=W,M.prototype.has=q,M.prototype.set=$;function X(ve){var U=-1,fe=ve?ve.length:0;for(this.clear();++U<fe;){var xe=ve[U];this.set(xe[0],xe[1])}}function Y(){this.__data__={hash:new _,map:new(T||M),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(te(ve[fe][0],U))return fe;return-1}function j(ve){if(!_e(ve)||Z(ve))return!1;var U=ce(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 de(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 xe=arguments,ge=U?U.apply(this,xe):xe[0],be=fe.cache;if(be.has(ge))return be.get(ge);var Ae=ve.apply(this,xe);return fe.cache=be.set(ge,Ae),Ae};return fe.cache=new(ae.Cache||X),fe}ae.Cache=X;function te(ve,U){return ve===U||ve!==ve&&U!==U}function ce(ve){var U=_e(ve)?w.call(ve):"";return U==t||U==n}function _e(ve){var U=typeof ve;return!!ve&&(U=="object"||U=="function")}return tm=ae,tm}var nm,O2;function dW(){if(O2)return nm;O2=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 Et=="object"&&Et&&Et.Object===Object&&Et,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,k,M,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(de){var se=P,Z=D;return P=D=void 0,z=de,k=S.apply(Z,se),k}function Y(de){return z=de,M=setTimeout(le,_),W?X(de):k}function K(de){var se=de-N,Z=de-z,Q=_-se;return q?p(Q,I-Z):Q}function ee(de){var se=de-N,Z=de-z;return N===void 0||se>=_||se<0||q&&Z>=I}function le(){var de=E();if(ee(de))return G(de);M=setTimeout(le,K(de))}function G(de){return M=void 0,$&&P?X(de):(P=D=void 0,k)}function V(){M!==void 0&&clearTimeout(M),z=0,P=N=D=M=void 0}function j(){return M===void 0?k:G(E())}function re(){var de=E(),se=ee(de);if(P=arguments,D=this,N=de,se){if(M===void 0)return Y(N);if(q)return M=setTimeout(le,_),X(N)}return M===void 0&&(M=setTimeout(le,_)),k}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 nm=b,nm}var vW=Vu.exports,q2;function hW(){return q2||(q2=1,(function(r,e){(function(n,a){r.exports=a(cW(),dW())})(vW,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(k){return x.anySame(k)},S=function(k){return C.anySame(k)},_=function(k){return T(k)||S(k)},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,de){var se=re-V,Z=de-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)},k=function(V){var j=A(V),re=j+C;return re*re},M=function(V){return I(V)<=k(V)},N=function(V){var j=V.position(),re=V.outerWidth()/2,de=V.outerHeight()/2,se=j.x,Z=j.y,Q=T.x,ae=T.y,te=se-re,ce=se+re,_e=Z-de,ve=Z+de,U=te<=Q&&Q<=ce,fe=_e<=ae&&ae<=ve;if(U&&fe)return 0;if(U){var xe=ae-_e,ge=ae-ve;return Math.min(xe*xe,ge*ge)}else if(fe){var be=Q-te,Ae=Q-ce;return Math.min(be*be,Ae*Ae)}else return Q<te&&ae<_e?P(Q,ae,te,_e):Q>ce&&ae<_e?P(Q,ae,ce,_e):Q<te&&ae>ve?P(Q,ae,te,ve):P(Q,ae,ce,ve)},z=function(V,j){return N(V)-N(j)},W=z,q=!1,$=function(V){var j=T,re=V.outerWidth(),de=re/2,se=V.outerHeight(),Z=se/2,Q=V.position(),ae=Q.x-de,te=Q.x+de,ce=Q.y-Z,_e=Q.y+Z;return ae<=j.x&&j.x<=te&&ce<=j.y&&j.y<=_e},X=function(V){return V.same(S)||V.same(_)},Y=w.nodes(function(G){return!X(G)&&M(G)}).sort(W),K=!1;x.nonempty()&&!M(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,k=S,M=w.same(_),N=!this.canConnect(w),z=w.same(this.targetNode);if(!I||M||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(),k,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(),k,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})])})})(Vu)),Vu.exports}var gW=hW();const pW=Sl(gW);var am,N2;function yW(){if(N2)return am;N2=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 l=s.target,u=l.__cy_id;n.getElementById(u).style({width:l.offsetWidth,height:l.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(),l=n.zoom(),u="translate("+s.x+"px,"+s.y+"px) scale("+l+")";this._nodes_dom_container.style.msTransform=u,this._nodes_dom_container.style.transform=u}),n.on("position bounds","node",o=>{let s=o.target,l=s.id();if(!this._node_dom[l])return;let u=this._node_dom[l],c=`translate(-50%, -50%) translate(${s.position("x").toFixed(2)}px, ${s.position("y").toFixed(2)}px)`;u.style.webkitTransform=c,u.style.msTransform=c,u.style.transform=c,u.style.display="inline",u.style.position="absolute",u.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),am=e,am}var mW=yW();const bW=Sl(mW);un.prototype.hasInitialised||(un.use(fW),un.use(pW),un.use(bW),un.prototype.hasInitialised=!0);var Go={exports:{}};/**
|
|
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
332
|
* @license
|
|
333
333
|
* Lodash <https://lodash.com/>
|
|
334
334
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
335
335
|
* Released under MIT license <https://lodash.com/license>
|
|
336
336
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
337
337
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
338
|
-
*/var wW=Go.exports,F2;function xW(){return F2||(F2=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="...",k=800,M=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]",de="[object Boolean]",se="[object Date]",Z="[object DOMException]",Q="[object Error]",ae="[object Function]",te="[object GeneratorFunction]",ce="[object Map]",_e="[object Number]",ve="[object Null]",U="[object Object]",fe="[object Promise]",xe="[object Proxy]",ge="[object RegExp]",be="[object Set]",Ae="[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]",ke="[object Int8Array]",pe="[object Int16Array]",L="[object Int32Array]",oe="[object Uint8Array]",me="[object Uint8ClampedArray]",we="[object Uint16Array]",Ce="[object Uint32Array]",qe=/\b__p \+= '';/g,Pe=/\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,Wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mr=/^\w*$/,lt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,kr=/[\\^$.*+?()[\]{}|]/g,Kr=RegExp(kr.source),Nr=/^\s+/,Xr=/\s/,Cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,$r=/\{\n\/\* \[wrapped with (.+)\] \*/,dn=/,? & /,vn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ra=/[()=,{}\[\]\/\s]/,hi=/\\(\\)?/g,On=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,at=/^[-+]0x[0-9a-f]+$/i,bt=/^0b[01]+$/i,Na=/^\[object .+?Constructor\]$/,Mt=/^0o[0-7]+$/i,Rs=/^(?:0|[1-9]\d*)$/,Wl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gi=/($^)/,Ul=/['\n\r\u2028\u2029\\]/g,pi="\\ud800-\\udfff",Hl="\\u0300-\\u036f",Kl="\\ufe20-\\ufe2f",jl="\\u20d0-\\u20ff",ta=Hl+Kl+jl,yi="\\u2700-\\u27bf",Fa="a-z\\xdf-\\xf6\\xf8-\\xff",As="\\xac\\xb1\\xd7\\xf7",Ps="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Yl="\\u2000-\\u206f",Vt=" \\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",mi="A-Z\\xc0-\\xd6\\xd8-\\xde",ho="\\ufe0e\\ufe0f",na=As+Ps+Yl+Vt,Tt="['’]",Zl="["+pi+"]",Xl="["+na+"]",bi="["+ta+"]",m0="\\d+",XP="["+yi+"]",b0="["+Fa+"]",w0="[^"+pi+na+m0+yi+Fa+mi+"]",Ql="\\ud83c[\\udffb-\\udfff]",QP="(?:"+bi+"|"+Ql+")",x0="[^"+pi+"]",Jl="(?:\\ud83c[\\udde6-\\uddff]){2}",ef="[\\ud800-\\udbff][\\udc00-\\udfff]",wi="["+mi+"]",E0="\\u200d",C0="(?:"+b0+"|"+w0+")",JP="(?:"+wi+"|"+w0+")",_0="(?:"+Tt+"(?:d|ll|m|re|s|t|ve))?",S0="(?:"+Tt+"(?:D|LL|M|RE|S|T|VE))?",T0=QP+"?",R0="["+ho+"]?",eD="(?:"+E0+"(?:"+[x0,Jl,ef].join("|")+")"+R0+T0+")*",rD="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",tD="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",A0=R0+T0+eD,nD="(?:"+[XP,Jl,ef].join("|")+")"+A0,aD="(?:"+[x0+bi+"?",bi,Jl,ef,Zl].join("|")+")",iD=RegExp(Tt,"g"),oD=RegExp(bi,"g"),rf=RegExp(Ql+"(?="+Ql+")|"+aD+A0,"g"),sD=RegExp([wi+"?"+b0+"+"+_0+"(?="+[Xl,wi,"$"].join("|")+")",JP+"+"+S0+"(?="+[Xl,wi+C0,"$"].join("|")+")",wi+"?"+C0+"+"+_0,wi+"+"+S0,tD,rD,m0,nD].join("|"),"g"),uD=RegExp("["+E0+pi+ta+ho+"]"),lD=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fD=["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"],cD=-1,Dr={};Dr[er]=Dr[$e]=Dr[ke]=Dr[pe]=Dr[L]=Dr[oe]=Dr[me]=Dr[we]=Dr[Ce]=!0,Dr[V]=Dr[j]=Dr[Ve]=Dr[de]=Dr[Xe]=Dr[se]=Dr[Q]=Dr[ae]=Dr[ce]=Dr[_e]=Dr[U]=Dr[ge]=Dr[be]=Dr[Ae]=Dr[Oe]=!1;var Tr={};Tr[V]=Tr[j]=Tr[Ve]=Tr[Xe]=Tr[de]=Tr[se]=Tr[er]=Tr[$e]=Tr[ke]=Tr[pe]=Tr[L]=Tr[ce]=Tr[_e]=Tr[U]=Tr[ge]=Tr[be]=Tr[Ae]=Tr[Ie]=Tr[oe]=Tr[me]=Tr[we]=Tr[Ce]=!0,Tr[Q]=Tr[ae]=Tr[Oe]=!1;var dD={À:"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"},vD={"&":"&","<":"<",">":">",'"':""","'":"'"},hD={"&":"&","<":"<",">":">",""":'"',"'":"'"},gD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pD=parseFloat,yD=parseInt,P0=typeof Et=="object"&&Et&&Et.Object===Object&&Et,mD=typeof self=="object"&&self&&self.Object===Object&&self,ct=P0||mD||Function("return this")(),tf=e&&!e.nodeType&&e,za=tf&&!0&&r&&!r.nodeType&&r,D0=za&&za.exports===tf,nf=D0&&P0.process,Xt=(function(){try{var ne=za&&za.require&&za.require("util").types;return ne||nf&&nf.binding&&nf.binding("util")}catch{}})(),I0=Xt&&Xt.isArrayBuffer,B0=Xt&&Xt.isDate,M0=Xt&&Xt.isMap,k0=Xt&&Xt.isRegExp,L0=Xt&&Xt.isSet,O0=Xt&&Xt.isTypedArray;function Gt(ne,Ee,he){switch(he.length){case 0:return ne.call(Ee);case 1:return ne.call(Ee,he[0]);case 2:return ne.call(Ee,he[0],he[1]);case 3:return ne.call(Ee,he[0],he[1],he[2])}return ne.apply(Ee,he)}function bD(ne,Ee,he,Ne){for(var rr=-1,mr=ne==null?0:ne.length;++rr<mr;){var Qr=ne[rr];Ee(Ne,Qr,he(Qr),ne)}return Ne}function Qt(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length;++he<Ne&&Ee(ne[he],he,ne)!==!1;);return ne}function wD(ne,Ee){for(var he=ne==null?0:ne.length;he--&&Ee(ne[he],he,ne)!==!1;);return ne}function q0(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length;++he<Ne;)if(!Ee(ne[he],he,ne))return!1;return!0}function aa(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length,rr=0,mr=[];++he<Ne;){var Qr=ne[he];Ee(Qr,he,ne)&&(mr[rr++]=Qr)}return mr}function Ds(ne,Ee){var he=ne==null?0:ne.length;return!!he&&xi(ne,Ee,0)>-1}function af(ne,Ee,he){for(var Ne=-1,rr=ne==null?0:ne.length;++Ne<rr;)if(he(Ee,ne[Ne]))return!0;return!1}function Lr(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length,rr=Array(Ne);++he<Ne;)rr[he]=Ee(ne[he],he,ne);return rr}function ia(ne,Ee){for(var he=-1,Ne=Ee.length,rr=ne.length;++he<Ne;)ne[rr+he]=Ee[he];return ne}function of(ne,Ee,he,Ne){var rr=-1,mr=ne==null?0:ne.length;for(Ne&&mr&&(he=ne[++rr]);++rr<mr;)he=Ee(he,ne[rr],rr,ne);return he}function xD(ne,Ee,he,Ne){var rr=ne==null?0:ne.length;for(Ne&&rr&&(he=ne[--rr]);rr--;)he=Ee(he,ne[rr],rr,ne);return he}function sf(ne,Ee){for(var he=-1,Ne=ne==null?0:ne.length;++he<Ne;)if(Ee(ne[he],he,ne))return!0;return!1}var ED=uf("length");function CD(ne){return ne.split("")}function _D(ne){return ne.match(vn)||[]}function N0(ne,Ee,he){var Ne;return he(ne,function(rr,mr,Qr){if(Ee(rr,mr,Qr))return Ne=mr,!1}),Ne}function Is(ne,Ee,he,Ne){for(var rr=ne.length,mr=he+(Ne?1:-1);Ne?mr--:++mr<rr;)if(Ee(ne[mr],mr,ne))return mr;return-1}function xi(ne,Ee,he){return Ee===Ee?OD(ne,Ee,he):Is(ne,F0,he)}function SD(ne,Ee,he,Ne){for(var rr=he-1,mr=ne.length;++rr<mr;)if(Ne(ne[rr],Ee))return rr;return-1}function F0(ne){return ne!==ne}function z0(ne,Ee){var he=ne==null?0:ne.length;return he?ff(ne,Ee)/he:Y}function uf(ne){return function(Ee){return Ee==null?t:Ee[ne]}}function lf(ne){return function(Ee){return ne==null?t:ne[Ee]}}function $0(ne,Ee,he,Ne,rr){return rr(ne,function(mr,Qr,_r){he=Ne?(Ne=!1,mr):Ee(he,mr,Qr,_r)}),he}function TD(ne,Ee){var he=ne.length;for(ne.sort(Ee);he--;)ne[he]=ne[he].value;return ne}function ff(ne,Ee){for(var he,Ne=-1,rr=ne.length;++Ne<rr;){var mr=Ee(ne[Ne]);mr!==t&&(he=he===t?mr:he+mr)}return he}function cf(ne,Ee){for(var he=-1,Ne=Array(ne);++he<ne;)Ne[he]=Ee(he);return Ne}function RD(ne,Ee){return Lr(Ee,function(he){return[he,ne[he]]})}function V0(ne){return ne&&ne.slice(0,H0(ne)+1).replace(Nr,"")}function Wt(ne){return function(Ee){return ne(Ee)}}function df(ne,Ee){return Lr(Ee,function(he){return ne[he]})}function go(ne,Ee){return ne.has(Ee)}function G0(ne,Ee){for(var he=-1,Ne=ne.length;++he<Ne&&xi(Ee,ne[he],0)>-1;);return he}function W0(ne,Ee){for(var he=ne.length;he--&&xi(Ee,ne[he],0)>-1;);return he}function AD(ne,Ee){for(var he=ne.length,Ne=0;he--;)ne[he]===Ee&&++Ne;return Ne}var PD=lf(dD),DD=lf(vD);function ID(ne){return"\\"+gD[ne]}function BD(ne,Ee){return ne==null?t:ne[Ee]}function Ei(ne){return uD.test(ne)}function MD(ne){return lD.test(ne)}function kD(ne){for(var Ee,he=[];!(Ee=ne.next()).done;)he.push(Ee.value);return he}function vf(ne){var Ee=-1,he=Array(ne.size);return ne.forEach(function(Ne,rr){he[++Ee]=[rr,Ne]}),he}function U0(ne,Ee){return function(he){return ne(Ee(he))}}function oa(ne,Ee){for(var he=-1,Ne=ne.length,rr=0,mr=[];++he<Ne;){var Qr=ne[he];(Qr===Ee||Qr===c)&&(ne[he]=c,mr[rr++]=he)}return mr}function Bs(ne){var Ee=-1,he=Array(ne.size);return ne.forEach(function(Ne){he[++Ee]=Ne}),he}function LD(ne){var Ee=-1,he=Array(ne.size);return ne.forEach(function(Ne){he[++Ee]=[Ne,Ne]}),he}function OD(ne,Ee,he){for(var Ne=he-1,rr=ne.length;++Ne<rr;)if(ne[Ne]===Ee)return Ne;return-1}function qD(ne,Ee,he){for(var Ne=he+1;Ne--;)if(ne[Ne]===Ee)return Ne;return Ne}function Ci(ne){return Ei(ne)?FD(ne):ED(ne)}function hn(ne){return Ei(ne)?zD(ne):CD(ne)}function H0(ne){for(var Ee=ne.length;Ee--&&Xr.test(ne.charAt(Ee)););return Ee}var ND=lf(hD);function FD(ne){for(var Ee=rf.lastIndex=0;rf.test(ne);)++Ee;return Ee}function zD(ne){return ne.match(rf)||[]}function $D(ne){return ne.match(sD)||[]}var VD=(function ne(Ee){Ee=Ee==null?ct:_i.defaults(ct.Object(),Ee,_i.pick(ct,fD));var he=Ee.Array,Ne=Ee.Date,rr=Ee.Error,mr=Ee.Function,Qr=Ee.Math,_r=Ee.Object,hf=Ee.RegExp,GD=Ee.String,Jt=Ee.TypeError,Ms=he.prototype,WD=mr.prototype,Si=_r.prototype,ks=Ee["__core-js_shared__"],Ls=WD.toString,br=Si.hasOwnProperty,UD=0,K0=(function(){var f=/[^.]+$/.exec(ks&&ks.keys&&ks.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""})(),Os=Si.toString,HD=Ls.call(_r),KD=ct._,jD=hf("^"+Ls.call(br).replace(kr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qs=D0?Ee.Buffer:t,sa=Ee.Symbol,Ns=Ee.Uint8Array,j0=qs?qs.allocUnsafe:t,Fs=U0(_r.getPrototypeOf,_r),Y0=_r.create,Z0=Si.propertyIsEnumerable,zs=Ms.splice,X0=sa?sa.isConcatSpreadable:t,po=sa?sa.iterator:t,$a=sa?sa.toStringTag:t,$s=(function(){try{var f=Ha(_r,"defineProperty");return f({},"",{}),f}catch{}})(),YD=Ee.clearTimeout!==ct.clearTimeout&&Ee.clearTimeout,ZD=Ne&&Ne.now!==ct.Date.now&&Ne.now,XD=Ee.setTimeout!==ct.setTimeout&&Ee.setTimeout,Vs=Qr.ceil,Gs=Qr.floor,gf=_r.getOwnPropertySymbols,QD=qs?qs.isBuffer:t,Q0=Ee.isFinite,JD=Ms.join,eI=U0(_r.keys,_r),Jr=Qr.max,wt=Qr.min,rI=Ne.now,tI=Ee.parseInt,J0=Qr.random,nI=Ms.reverse,pf=Ha(Ee,"DataView"),yo=Ha(Ee,"Map"),yf=Ha(Ee,"Promise"),Ti=Ha(Ee,"Set"),mo=Ha(Ee,"WeakMap"),bo=Ha(_r,"create"),Ws=mo&&new mo,Ri={},aI=Ka(pf),iI=Ka(yo),oI=Ka(yf),sI=Ka(Ti),uI=Ka(mo),Us=sa?sa.prototype:t,wo=Us?Us.valueOf:t,eb=Us?Us.toString:t;function O(f){if(Vr(f)&&!tr(f)&&!(f instanceof dr)){if(f instanceof en)return f;if(br.call(f,"__wrapped__"))return r1(f)}return new en(f)}var Ai=(function(){function f(){}return function(v){if(!Fr(v))return{};if(Y0)return Y0(v);f.prototype=v;var y=new f;return f.prototype=t,y}})();function Hs(){}function en(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=Hs.prototype,O.prototype.constructor=O,en.prototype=Ai(Hs.prototype),en.prototype.constructor=en;function dr(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=K,this.__views__=[]}function lI(){var f=new dr(this.__wrapped__);return f.__actions__=kt(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=kt(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=kt(this.__views__),f}function fI(){if(this.__filtered__){var f=new dr(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function cI(){var f=this.__wrapped__.value(),v=this.__dir__,y=tr(f),R=v<0,B=y?f.length:0,F=CB(0,B,this.__views__),H=F.start,J=F.end,ie=J-H,Se=R?J:H-1,Te=this.__iteratees__,De=Te.length,Le=0,Ue=wt(ie,this.__takeCount__);if(!y||!R&&B==ie&&Ue==ie)return _b(f,this.__actions__);var Qe=[];e:for(;ie--&&Le<Ue;){Se+=v;for(var sr=-1,Je=f[Se];++sr<De;){var cr=Te[sr],vr=cr.iteratee,Kt=cr.type,Pt=vr(Je);if(Kt==z)Je=Pt;else if(!Pt){if(Kt==N)continue e;break e}}Qe[Le++]=Je}return Qe}dr.prototype=Ai(Hs.prototype),dr.prototype.constructor=dr;function Va(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 dI(){this.__data__=bo?bo(null):{},this.size=0}function vI(f){var v=this.has(f)&&delete this.__data__[f];return this.size-=v?1:0,v}function hI(f){var v=this.__data__;if(bo){var y=v[f];return y===l?t:y}return br.call(v,f)?v[f]:t}function gI(f){var v=this.__data__;return bo?v[f]!==t:br.call(v,f)}function pI(f,v){var y=this.__data__;return this.size+=this.has(f)?0:1,y[f]=bo&&v===t?l:v,this}Va.prototype.clear=dI,Va.prototype.delete=vI,Va.prototype.get=hI,Va.prototype.has=gI,Va.prototype.set=pI;function qn(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 yI(){this.__data__=[],this.size=0}function mI(f){var v=this.__data__,y=Ks(v,f);if(y<0)return!1;var R=v.length-1;return y==R?v.pop():zs.call(v,y,1),--this.size,!0}function bI(f){var v=this.__data__,y=Ks(v,f);return y<0?t:v[y][1]}function wI(f){return Ks(this.__data__,f)>-1}function xI(f,v){var y=this.__data__,R=Ks(y,f);return R<0?(++this.size,y.push([f,v])):y[R][1]=v,this}qn.prototype.clear=yI,qn.prototype.delete=mI,qn.prototype.get=bI,qn.prototype.has=wI,qn.prototype.set=xI;function Nn(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 EI(){this.size=0,this.__data__={hash:new Va,map:new(yo||qn),string:new Va}}function CI(f){var v=iu(this,f).delete(f);return this.size-=v?1:0,v}function _I(f){return iu(this,f).get(f)}function SI(f){return iu(this,f).has(f)}function TI(f,v){var y=iu(this,f),R=y.size;return y.set(f,v),this.size+=y.size==R?0:1,this}Nn.prototype.clear=EI,Nn.prototype.delete=CI,Nn.prototype.get=_I,Nn.prototype.has=SI,Nn.prototype.set=TI;function Ga(f){var v=-1,y=f==null?0:f.length;for(this.__data__=new Nn;++v<y;)this.add(f[v])}function RI(f){return this.__data__.set(f,l),this}function AI(f){return this.__data__.has(f)}Ga.prototype.add=Ga.prototype.push=RI,Ga.prototype.has=AI;function gn(f){var v=this.__data__=new qn(f);this.size=v.size}function PI(){this.__data__=new qn,this.size=0}function DI(f){var v=this.__data__,y=v.delete(f);return this.size=v.size,y}function II(f){return this.__data__.get(f)}function BI(f){return this.__data__.has(f)}function MI(f,v){var y=this.__data__;if(y instanceof qn){var R=y.__data__;if(!yo||R.length<a-1)return R.push([f,v]),this.size=++y.size,this;y=this.__data__=new Nn(R)}return y.set(f,v),this.size=y.size,this}gn.prototype.clear=PI,gn.prototype.delete=DI,gn.prototype.get=II,gn.prototype.has=BI,gn.prototype.set=MI;function rb(f,v){var y=tr(f),R=!y&&ja(f),B=!y&&!R&&da(f),F=!y&&!R&&!B&&Bi(f),H=y||R||B||F,J=H?cf(f.length,GD):[],ie=J.length;for(var Se in f)(v||br.call(f,Se))&&!(H&&(Se=="length"||B&&(Se=="offset"||Se=="parent")||F&&(Se=="buffer"||Se=="byteLength"||Se=="byteOffset")||Vn(Se,ie)))&&J.push(Se);return J}function tb(f){var v=f.length;return v?f[Af(0,v-1)]:t}function kI(f,v){return ou(kt(f),Wa(v,0,f.length))}function LI(f){return ou(kt(f))}function mf(f,v,y){(y!==t&&!pn(f[v],y)||y===t&&!(v in f))&&Fn(f,v,y)}function xo(f,v,y){var R=f[v];(!(br.call(f,v)&&pn(R,y))||y===t&&!(v in f))&&Fn(f,v,y)}function Ks(f,v){for(var y=f.length;y--;)if(pn(f[y][0],v))return y;return-1}function OI(f,v,y,R){return ua(f,function(B,F,H){v(R,B,y(B),H)}),R}function nb(f,v){return f&&Sn(v,it(v),f)}function qI(f,v){return f&&Sn(v,Ot(v),f)}function Fn(f,v,y){v=="__proto__"&&$s?$s(f,v,{configurable:!0,enumerable:!0,value:y,writable:!0}):f[v]=y}function bf(f,v){for(var y=-1,R=v.length,B=he(R),F=f==null;++y<R;)B[y]=F?t:Jf(f,v[y]);return B}function Wa(f,v,y){return f===f&&(y!==t&&(f=f<=y?f:y),v!==t&&(f=f>=v?f:v)),f}function rn(f,v,y,R,B,F){var H,J=v&d,ie=v&h,Se=v&g;if(y&&(H=B?y(f,R,B,F):y(f)),H!==t)return H;if(!Fr(f))return f;var Te=tr(f);if(Te){if(H=SB(f),!J)return kt(f,H)}else{var De=xt(f),Le=De==ae||De==te;if(da(f))return Rb(f,J);if(De==U||De==V||Le&&!B){if(H=ie||Le?{}:Hb(f),!J)return ie?hB(f,qI(H,f)):vB(f,nb(H,f))}else{if(!Tr[De])return B?f:{};H=TB(f,De,J)}}F||(F=new gn);var Ue=F.get(f);if(Ue)return Ue;F.set(f,H),x1(f)?f.forEach(function(Je){H.add(rn(Je,v,y,Je,f,F))}):b1(f)&&f.forEach(function(Je,cr){H.set(cr,rn(Je,v,y,cr,f,F))});var Qe=Se?ie?Ff:Nf:ie?Ot:it,sr=Te?t:Qe(f);return Qt(sr||f,function(Je,cr){sr&&(cr=Je,Je=f[cr]),xo(H,cr,rn(Je,v,y,cr,f,F))}),H}function NI(f){var v=it(f);return function(y){return ab(y,f,v)}}function ab(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 ib(f,v,y){if(typeof f!="function")throw new Jt(o);return Ao(function(){f.apply(t,y)},v)}function Eo(f,v,y,R){var B=-1,F=Ds,H=!0,J=f.length,ie=[],Se=v.length;if(!J)return ie;y&&(v=Lr(v,Wt(y))),R?(F=af,H=!1):v.length>=a&&(F=go,H=!1,v=new Ga(v));e:for(;++B<J;){var Te=f[B],De=y==null?Te:y(Te);if(Te=R||Te!==0?Te:0,H&&De===De){for(var Le=Se;Le--;)if(v[Le]===De)continue e;ie.push(Te)}else F(v,De,R)||ie.push(Te)}return ie}var ua=Bb(_n),ob=Bb(xf,!0);function FI(f,v){var y=!0;return ua(f,function(R,B,F){return y=!!v(R,B,F),y}),y}function js(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&&!Ht(H):y(H,J)))var J=H,ie=F}return ie}function zI(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:C1(R);y<R;)f[y++]=v;return f}function sb(f,v){var y=[];return ua(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=AB),B||(B=[]);++F<H;){var J=f[F];v>0&&y(J)?v>1?dt(J,v-1,y,R,B):ia(B,J):R||(B[B.length]=J)}return B}var wf=Mb(),ub=Mb(!0);function _n(f,v){return f&&wf(f,v,it)}function xf(f,v){return f&&ub(f,v,it)}function Ys(f,v){return aa(v,function(y){return Gn(f[y])})}function Ua(f,v){v=fa(v,f);for(var y=0,R=v.length;f!=null&&y<R;)f=f[Tn(v[y++])];return y&&y==R?f:t}function lb(f,v,y){var R=v(f);return tr(f)?R:ia(R,y(f))}function Rt(f){return f==null?f===t?Be:ve:$a&&$a in _r(f)?EB(f):LB(f)}function Ef(f,v){return f>v}function $I(f,v){return f!=null&&br.call(f,v)}function VI(f,v){return f!=null&&v in _r(f)}function GI(f,v,y){return f>=wt(v,y)&&f<Jr(v,y)}function Cf(f,v,y){for(var R=y?af:Ds,B=f[0].length,F=f.length,H=F,J=he(F),ie=1/0,Se=[];H--;){var Te=f[H];H&&v&&(Te=Lr(Te,Wt(v))),ie=wt(Te.length,ie),J[H]=!y&&(v||B>=120&&Te.length>=120)?new Ga(H&&Te):t}Te=f[0];var De=-1,Le=J[0];e:for(;++De<B&&Se.length<ie;){var Ue=Te[De],Qe=v?v(Ue):Ue;if(Ue=y||Ue!==0?Ue:0,!(Le?go(Le,Qe):R(Se,Qe,y))){for(H=F;--H;){var sr=J[H];if(!(sr?go(sr,Qe):R(f[H],Qe,y)))continue e}Le&&Le.push(Qe),Se.push(Ue)}}return Se}function WI(f,v,y,R){return _n(f,function(B,F,H){v(R,y(B),F,H)}),R}function Co(f,v,y){v=fa(v,f),f=Zb(f,v);var R=f==null?f:f[Tn(nn(v))];return R==null?t:Gt(R,f,y)}function fb(f){return Vr(f)&&Rt(f)==V}function UI(f){return Vr(f)&&Rt(f)==Ve}function HI(f){return Vr(f)&&Rt(f)==se}function _o(f,v,y,R,B){return f===v?!0:f==null||v==null||!Vr(f)&&!Vr(v)?f!==f&&v!==v:KI(f,v,y,R,_o,B)}function KI(f,v,y,R,B,F){var H=tr(f),J=tr(v),ie=H?j:xt(f),Se=J?j:xt(v);ie=ie==V?U:ie,Se=Se==V?U:Se;var Te=ie==U,De=Se==U,Le=ie==Se;if(Le&&da(f)){if(!da(v))return!1;H=!0,Te=!1}if(Le&&!Te)return F||(F=new gn),H||Bi(f)?Gb(f,v,y,R,B,F):wB(f,v,ie,y,R,B,F);if(!(y&p)){var Ue=Te&&br.call(f,"__wrapped__"),Qe=De&&br.call(v,"__wrapped__");if(Ue||Qe){var sr=Ue?f.value():f,Je=Qe?v.value():v;return F||(F=new gn),B(sr,Je,y,R,F)}}return Le?(F||(F=new gn),xB(f,v,y,R,B,F)):!1}function jI(f){return Vr(f)&&xt(f)==ce}function _f(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],Se=f[ie],Te=J[1];if(H&&J[2]){if(Se===t&&!(ie in f))return!1}else{var De=new gn;if(R)var Le=R(Se,Te,ie,f,v,De);if(!(Le===t?_o(Te,Se,p|E,R,De):Le))return!1}}return!0}function cb(f){if(!Fr(f)||DB(f))return!1;var v=Gn(f)?jD:Na;return v.test(Ka(f))}function YI(f){return Vr(f)&&Rt(f)==ge}function ZI(f){return Vr(f)&&xt(f)==be}function XI(f){return Vr(f)&&du(f.length)&&!!Dr[Rt(f)]}function db(f){return typeof f=="function"?f:f==null?qt:typeof f=="object"?tr(f)?gb(f[0],f[1]):hb(f):k1(f)}function Sf(f){if(!Ro(f))return eI(f);var v=[];for(var y in _r(f))br.call(f,y)&&y!="constructor"&&v.push(y);return v}function QI(f){if(!Fr(f))return kB(f);var v=Ro(f),y=[];for(var R in f)R=="constructor"&&(v||!br.call(f,R))||y.push(R);return y}function Tf(f,v){return f<v}function vb(f,v){var y=-1,R=Lt(f)?he(f.length):[];return ua(f,function(B,F,H){R[++y]=v(B,F,H)}),R}function hb(f){var v=$f(f);return v.length==1&&v[0][2]?jb(v[0][0],v[0][1]):function(y){return y===f||_f(y,f,v)}}function gb(f,v){return Gf(f)&&Kb(v)?jb(Tn(f),v):function(y){var R=Jf(y,f);return R===t&&R===v?ec(y,f):_o(v,R,p|E)}}function Zs(f,v,y,R,B){f!==v&&wf(v,function(F,H){if(B||(B=new gn),Fr(F))JI(f,v,H,y,Zs,R,B);else{var J=R?R(Uf(f,H),F,H+"",f,v,B):t;J===t&&(J=F),mf(f,H,J)}},Ot)}function JI(f,v,y,R,B,F,H){var J=Uf(f,y),ie=Uf(v,y),Se=H.get(ie);if(Se){mf(f,y,Se);return}var Te=F?F(J,ie,y+"",f,v,H):t,De=Te===t;if(De){var Le=tr(ie),Ue=!Le&&da(ie),Qe=!Le&&!Ue&&Bi(ie);Te=ie,Le||Ue||Qe?tr(J)?Te=J:Ur(J)?Te=kt(J):Ue?(De=!1,Te=Rb(ie,!0)):Qe?(De=!1,Te=Ab(ie,!0)):Te=[]:Po(ie)||ja(ie)?(Te=J,ja(J)?Te=_1(J):(!Fr(J)||Gn(J))&&(Te=Hb(ie))):De=!1}De&&(H.set(ie,Te),B(Te,ie,R,F,H),H.delete(ie)),mf(f,y,Te)}function pb(f,v){var y=f.length;if(y)return v+=v<0?y:0,Vn(v,y)?f[v]:t}function yb(f,v,y){v.length?v=Lr(v,function(F){return tr(F)?function(H){return Ua(H,F.length===1?F[0]:F)}:F}):v=[qt];var R=-1;v=Lr(v,Wt(Ze()));var B=vb(f,function(F,H,J){var ie=Lr(v,function(Se){return Se(F)});return{criteria:ie,index:++R,value:F}});return TD(B,function(F,H){return dB(F,H,y)})}function eB(f,v){return mb(f,v,function(y,R){return ec(f,R)})}function mb(f,v,y){for(var R=-1,B=v.length,F={};++R<B;){var H=v[R],J=Ua(f,H);y(J,H)&&So(F,fa(H,f),J)}return F}function rB(f){return function(v){return Ua(v,f)}}function Rf(f,v,y,R){var B=R?SD:xi,F=-1,H=v.length,J=f;for(f===v&&(v=kt(v)),y&&(J=Lr(f,Wt(y)));++F<H;)for(var ie=0,Se=v[F],Te=y?y(Se):Se;(ie=B(J,Te,ie,R))>-1;)J!==f&&zs.call(J,ie,1),zs.call(f,ie,1);return f}function bb(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;Vn(B)?zs.call(f,B,1):If(f,B)}}return f}function Af(f,v){return f+Gs(J0()*(v-f+1))}function tB(f,v,y,R){for(var B=-1,F=Jr(Vs((v-f)/(y||1)),0),H=he(F);F--;)H[R?F:++B]=f,f+=y;return H}function Pf(f,v){var y="";if(!f||v<1||v>$)return y;do v%2&&(y+=f),v=Gs(v/2),v&&(f+=f);while(v);return y}function lr(f,v){return Hf(Yb(f,v,qt),f+"")}function nB(f){return tb(Mi(f))}function aB(f,v){var y=Mi(f);return ou(y,Wa(v,0,y.length))}function So(f,v,y,R){if(!Fr(f))return f;v=fa(v,f);for(var B=-1,F=v.length,H=F-1,J=f;J!=null&&++B<F;){var ie=Tn(v[B]),Se=y;if(ie==="__proto__"||ie==="constructor"||ie==="prototype")return f;if(B!=H){var Te=J[ie];Se=R?R(Te,ie,J):t,Se===t&&(Se=Fr(Te)?Te:Vn(v[B+1])?[]:{})}xo(J,ie,Se),J=J[ie]}return f}var wb=Ws?function(f,v){return Ws.set(f,v),f}:qt,iB=$s?function(f,v){return $s(f,"toString",{configurable:!0,enumerable:!1,value:tc(v),writable:!0})}:qt;function oB(f){return ou(Mi(f))}function tn(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 sB(f,v){var y;return ua(f,function(R,B,F){return y=v(R,B,F),!y}),!!y}function Xs(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&&!Ht(H)&&(y?H<=v:H<v)?R=F+1:B=F}return B}return Df(f,v,qt,y)}function Df(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=Ht(v),Se=v===t;B<F;){var Te=Gs((B+F)/2),De=y(f[Te]),Le=De!==t,Ue=De===null,Qe=De===De,sr=Ht(De);if(H)var Je=R||Qe;else Se?Je=Qe&&(R||Le):J?Je=Qe&&Le&&(R||!Ue):ie?Je=Qe&&Le&&!Ue&&(R||!sr):Ue||sr?Je=!1:Je=R?De<=v:De<v;Je?B=Te+1:F=Te}return wt(F,ee)}function xb(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||!pn(J,ie)){var ie=J;F[B++]=H===0?0:H}}return F}function Eb(f){return typeof f=="number"?f:Ht(f)?Y:+f}function Ut(f){if(typeof f=="string")return f;if(tr(f))return Lr(f,Ut)+"";if(Ht(f))return eb?eb.call(f):"";var v=f+"";return v=="0"&&1/f==-q?"-0":v}function la(f,v,y){var R=-1,B=Ds,F=f.length,H=!0,J=[],ie=J;if(y)H=!1,B=af;else if(F>=a){var Se=v?null:mB(f);if(Se)return Bs(Se);H=!1,B=go,ie=new Ga}else ie=v?[]:J;e:for(;++R<F;){var Te=f[R],De=v?v(Te):Te;if(Te=y||Te!==0?Te:0,H&&De===De){for(var Le=ie.length;Le--;)if(ie[Le]===De)continue e;v&&ie.push(De),J.push(Te)}else B(ie,De,y)||(ie!==J&&ie.push(De),J.push(Te))}return J}function If(f,v){v=fa(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=Zb(f,v);return H==null||delete H[Tn(nn(v))]}function Cb(f,v,y,R){return So(f,v,y(Ua(f,v)),R)}function Qs(f,v,y,R){for(var B=f.length,F=R?B:-1;(R?F--:++F<B)&&v(f[F],F,f););return y?tn(f,R?0:F,R?F+1:B):tn(f,R?F+1:0,R?B:F)}function _b(f,v){var y=f;return y instanceof dr&&(y=y.value()),of(v,function(R,B){return B.func.apply(B.thisArg,ia([R],B.args))},y)}function Bf(f,v,y){var R=f.length;if(R<2)return R?la(f[0]):[];for(var B=-1,F=he(R);++B<R;)for(var H=f[B],J=-1;++J<R;)J!=B&&(F[B]=Eo(F[B]||H,f[J],v,y));return la(dt(F,1),v,y)}function Sb(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 Mf(f){return Ur(f)?f:[]}function kf(f){return typeof f=="function"?f:qt}function fa(f,v){return tr(f)?f:Gf(f,v)?[f]:e1(wr(f))}var uB=lr;function ca(f,v,y){var R=f.length;return y=y===t?R:y,!v&&y>=R?f:tn(f,v,y)}var Tb=YD||function(f){return ct.clearTimeout(f)};function Rb(f,v){if(v)return f.slice();var y=f.length,R=j0?j0(y):new f.constructor(y);return f.copy(R),R}function Lf(f){var v=new f.constructor(f.byteLength);return new Ns(v).set(new Ns(f)),v}function lB(f,v){var y=v?Lf(f.buffer):f.buffer;return new f.constructor(y,f.byteOffset,f.byteLength)}function fB(f){var v=new f.constructor(f.source,ft.exec(f));return v.lastIndex=f.lastIndex,v}function cB(f){return wo?_r(wo.call(f)):{}}function Ab(f,v){var y=v?Lf(f.buffer):f.buffer;return new f.constructor(y,f.byteOffset,f.length)}function Pb(f,v){if(f!==v){var y=f!==t,R=f===null,B=f===f,F=Ht(f),H=v!==t,J=v===null,ie=v===v,Se=Ht(v);if(!J&&!Se&&!F&&f>v||F&&H&&ie&&!J&&!Se||R&&H&&ie||!y&&ie||!B)return 1;if(!R&&!F&&!Se&&f<v||Se&&y&&B&&!R&&!F||J&&y&&B||!H&&B||!ie)return-1}return 0}function dB(f,v,y){for(var R=-1,B=f.criteria,F=v.criteria,H=B.length,J=y.length;++R<H;){var ie=Pb(B[R],F[R]);if(ie){if(R>=J)return ie;var Se=y[R];return ie*(Se=="desc"?-1:1)}}return f.index-v.index}function Db(f,v,y,R){for(var B=-1,F=f.length,H=y.length,J=-1,ie=v.length,Se=Jr(F-H,0),Te=he(ie+Se),De=!R;++J<ie;)Te[J]=v[J];for(;++B<H;)(De||B<F)&&(Te[y[B]]=f[B]);for(;Se--;)Te[J++]=f[B++];return Te}function Ib(f,v,y,R){for(var B=-1,F=f.length,H=-1,J=y.length,ie=-1,Se=v.length,Te=Jr(F-J,0),De=he(Te+Se),Le=!R;++B<Te;)De[B]=f[B];for(var Ue=B;++ie<Se;)De[Ue+ie]=v[ie];for(;++H<J;)(Le||B<F)&&(De[Ue+y[H]]=f[B++]);return De}function kt(f,v){var y=-1,R=f.length;for(v||(v=he(R));++y<R;)v[y]=f[y];return v}function Sn(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?Fn(y,J,ie):xo(y,J,ie)}return y}function vB(f,v){return Sn(f,Vf(f),v)}function hB(f,v){return Sn(f,Wb(f),v)}function Js(f,v){return function(y,R){var B=tr(y)?bD:OI,F=v?v():{};return B(y,f,Ze(R,2),F)}}function Pi(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&&At(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 Bb(f,v){return function(y,R){if(y==null)return y;if(!Lt(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 Mb(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 gB(f,v,y){var R=v&m,B=To(f);function F(){var H=this&&this!==ct&&this instanceof F?B:f;return H.apply(R?y:this,arguments)}return F}function kb(f){return function(v){v=wr(v);var y=Ei(v)?hn(v):t,R=y?y[0]:v.charAt(0),B=y?ca(y,1).join(""):v.slice(1);return R[f]()+B}}function Di(f){return function(v){return of(B1(I1(v).replace(iD,"")),f,"")}}function To(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=Ai(f.prototype),R=f.apply(y,v);return Fr(R)?R:y}}function pB(f,v,y){var R=To(f);function B(){for(var F=arguments.length,H=he(F),J=F,ie=Ii(B);J--;)H[J]=arguments[J];var Se=F<3&&H[0]!==ie&&H[F-1]!==ie?[]:oa(H,ie);if(F-=Se.length,F<y)return Fb(f,v,eu,B.placeholder,t,H,Se,t,t,y-F);var Te=this&&this!==ct&&this instanceof B?R:f;return Gt(Te,this,H)}return B}function Lb(f){return function(v,y,R){var B=_r(v);if(!Lt(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 Ob(f){return $n(function(v){var y=v.length,R=y,B=en.prototype.thru;for(f&&v.reverse();R--;){var F=v[R];if(typeof F!="function")throw new Jt(o);if(B&&!H&&au(F)=="wrapper")var H=new en([],!0)}for(R=H?R:y;++R<y;){F=v[R];var J=au(F),ie=J=="wrapper"?zf(F):t;ie&&Wf(ie[0])&&ie[1]==(_|x|T|A)&&!ie[4].length&&ie[9]==1?H=H[au(ie[0])].apply(H,ie[3]):H=F.length==1&&Wf(F)?H[J]():H.thru(F)}return function(){var Se=arguments,Te=Se[0];if(H&&Se.length==1&&tr(Te))return H.plant(Te).value();for(var De=0,Le=y?v[De].apply(this,Se):Te;++De<y;)Le=v[De].call(this,Le);return Le}})}function eu(f,v,y,R,B,F,H,J,ie,Se){var Te=v&_,De=v&m,Le=v&b,Ue=v&(x|C),Qe=v&P,sr=Le?t:To(f);function Je(){for(var cr=arguments.length,vr=he(cr),Kt=cr;Kt--;)vr[Kt]=arguments[Kt];if(Ue)var Pt=Ii(Je),jt=AD(vr,Pt);if(R&&(vr=Db(vr,R,B,Ue)),F&&(vr=Ib(vr,F,H,Ue)),cr-=jt,Ue&&cr<Se){var Hr=oa(vr,Pt);return Fb(f,v,eu,Je.placeholder,y,vr,Hr,J,ie,Se-cr)}var yn=De?y:this,Un=Le?yn[f]:f;return cr=vr.length,J?vr=OB(vr,J):Qe&&cr>1&&vr.reverse(),Te&&ie<cr&&(vr.length=ie),this&&this!==ct&&this instanceof Je&&(Un=sr||To(Un)),Un.apply(yn,vr)}return Je}function qb(f,v){return function(y,R){return WI(y,f,v(R),{})}}function ru(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=Ut(y),R=Ut(R)):(y=Eb(y),R=Eb(R)),B=f(y,R)}return B}}function Of(f){return $n(function(v){return v=Lr(v,Wt(Ze())),lr(function(y){var R=this;return f(v,function(B){return Gt(B,R,y)})})})}function tu(f,v){v=v===t?" ":Ut(v);var y=v.length;if(y<2)return y?Pf(v,f):v;var R=Pf(v,Vs(f/Ci(v)));return Ei(v)?ca(hn(R),0,f).join(""):R.slice(0,f)}function yB(f,v,y,R){var B=v&m,F=To(f);function H(){for(var J=-1,ie=arguments.length,Se=-1,Te=R.length,De=he(Te+ie),Le=this&&this!==ct&&this instanceof H?F:f;++Se<Te;)De[Se]=R[Se];for(;ie--;)De[Se++]=arguments[++J];return Gt(Le,B?y:this,De)}return H}function Nb(f){return function(v,y,R){return R&&typeof R!="number"&&At(v,y,R)&&(y=R=t),v=Wn(v),y===t?(y=v,v=0):y=Wn(y),R=R===t?v<y?1:-1:Wn(R),tB(v,y,R,f)}}function nu(f){return function(v,y){return typeof v=="string"&&typeof y=="string"||(v=an(v),y=an(y)),f(v,y)}}function Fb(f,v,y,R,B,F,H,J,ie,Se){var Te=v&x,De=Te?H:t,Le=Te?t:H,Ue=Te?F:t,Qe=Te?t:F;v|=Te?T:S,v&=~(Te?S:T),v&w||(v&=-4);var sr=[f,v,B,Ue,De,Qe,Le,J,ie,Se],Je=y.apply(t,sr);return Wf(f)&&Xb(Je,sr),Je.placeholder=R,Qb(Je,f,v)}function qf(f){var v=Qr[f];return function(y,R){if(y=an(y),R=R==null?0:wt(ir(R),292),R&&Q0(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 mB=Ti&&1/Bs(new Ti([,-0]))[1]==q?function(f){return new Ti(f)}:ic;function zb(f){return function(v){var y=xt(v);return y==ce?vf(v):y==be?LD(v):RD(v,f(v))}}function zn(f,v,y,R,B,F,H,J){var ie=v&b;if(!ie&&typeof f!="function")throw new Jt(o);var Se=R?R.length:0;if(Se||(v&=-97,R=B=t),H=H===t?H:Jr(ir(H),0),J=J===t?J:ir(J),Se-=B?B.length:0,v&S){var Te=R,De=B;R=B=t}var Le=ie?t:zf(f),Ue=[f,v,y,R,B,Te,De,F,H,J];if(Le&&MB(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]-Se,0),!J&&v&(x|C)&&(v&=-25),!v||v==m)var Qe=gB(f,v,y);else v==x||v==C?Qe=pB(f,v,J):(v==T||v==(m|T))&&!B.length?Qe=yB(f,v,y,R):Qe=eu.apply(t,Ue);var sr=Le?wb:Xb;return Qb(sr(Qe,Ue),f,v)}function $b(f,v,y,R){return f===t||pn(f,Si[y])&&!br.call(R,y)?v:f}function Vb(f,v,y,R,B,F){return Fr(f)&&Fr(v)&&(F.set(v,f),Zs(f,v,t,Vb,F),F.delete(v)),f}function bB(f){return Po(f)?t:f}function Gb(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 Se=F.get(f),Te=F.get(v);if(Se&&Te)return Se==v&&Te==f;var De=-1,Le=!0,Ue=y&E?new Ga:t;for(F.set(f,v),F.set(v,f);++De<J;){var Qe=f[De],sr=v[De];if(R)var Je=H?R(sr,Qe,De,v,f,F):R(Qe,sr,De,f,v,F);if(Je!==t){if(Je)continue;Le=!1;break}if(Ue){if(!sf(v,function(cr,vr){if(!go(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 wB(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 Ns(f),new Ns(v)));case de:case se:case _e:return pn(+f,+v);case Q:return f.name==v.name&&f.message==v.message;case ge:case Ae:return f==v+"";case ce:var J=vf;case be:var ie=R&p;if(J||(J=Bs),f.size!=v.size&&!ie)return!1;var Se=H.get(f);if(Se)return Se==v;R|=E,H.set(f,v);var Te=Gb(J(f),J(v),R,B,F,H);return H.delete(f),Te;case Ie:if(wo)return wo.call(f)==wo.call(v)}return!1}function xB(f,v,y,R,B,F){var H=y&p,J=Nf(f),ie=J.length,Se=Nf(v),Te=Se.length;if(ie!=Te&&!H)return!1;for(var De=ie;De--;){var Le=J[De];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;++De<ie;){Le=J[De];var cr=f[Le],vr=v[Le];if(R)var Kt=H?R(vr,cr,Le,v,f,F):R(cr,vr,Le,f,v,F);if(!(Kt===t?cr===vr||B(cr,vr,y,R,F):Kt)){sr=!1;break}Je||(Je=Le=="constructor")}if(sr&&!Je){var Pt=f.constructor,jt=v.constructor;Pt!=jt&&"constructor"in f&&"constructor"in v&&!(typeof Pt=="function"&&Pt instanceof Pt&&typeof jt=="function"&&jt instanceof jt)&&(sr=!1)}return F.delete(f),F.delete(v),sr}function $n(f){return Hf(Yb(f,t,a1),f+"")}function Nf(f){return lb(f,it,Vf)}function Ff(f){return lb(f,Ot,Wb)}var zf=Ws?function(f){return Ws.get(f)}:ic;function au(f){for(var v=f.name+"",y=Ri[v],R=br.call(Ri,v)?y.length:0;R--;){var B=y[R],F=B.func;if(F==null||F==f)return B.name}return v}function Ii(f){var v=br.call(O,"placeholder")?O:f;return v.placeholder}function Ze(){var f=O.iteratee||nc;return f=f===nc?db:f,arguments.length?f(arguments[0],arguments[1]):f}function iu(f,v){var y=f.__data__;return PB(v)?y[typeof v=="string"?"string":"hash"]:y.map}function $f(f){for(var v=it(f),y=v.length;y--;){var R=v[y],B=f[R];v[y]=[R,B,Kb(B)]}return v}function Ha(f,v){var y=BD(f,v);return cb(y)?y:t}function EB(f){var v=br.call(f,$a),y=f[$a];try{f[$a]=t;var R=!0}catch{}var B=Os.call(f);return R&&(v?f[$a]=y:delete f[$a]),B}var Vf=gf?function(f){return f==null?[]:(f=_r(f),aa(gf(f),function(v){return Z0.call(f,v)}))}:oc,Wb=gf?function(f){for(var v=[];f;)ia(v,Vf(f)),f=Fs(f);return v}:oc,xt=Rt;(pf&&xt(new pf(new ArrayBuffer(1)))!=Xe||yo&&xt(new yo)!=ce||yf&&xt(yf.resolve())!=fe||Ti&&xt(new Ti)!=be||mo&&xt(new mo)!=Oe)&&(xt=function(f){var v=Rt(f),y=v==U?f.constructor:t,R=y?Ka(y):"";if(R)switch(R){case aI:return Xe;case iI:return ce;case oI:return fe;case sI:return be;case uI:return Oe}return v});function CB(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 _B(f){var v=f.match($r);return v?v[1].split(dn):[]}function Ub(f,v,y){v=fa(v,f);for(var R=-1,B=v.length,F=!1;++R<B;){var H=Tn(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&&du(B)&&Vn(H,B)&&(tr(f)||ja(f)))}function SB(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 Hb(f){return typeof f.constructor=="function"&&!Ro(f)?Ai(Fs(f)):{}}function TB(f,v,y){var R=f.constructor;switch(v){case Ve:return Lf(f);case de:case se:return new R(+f);case Xe:return lB(f,y);case er:case $e:case ke:case pe:case L:case oe:case me:case we:case Ce:return Ab(f,y);case ce:return new R;case _e:case Ae:return new R(f);case ge:return fB(f);case be:return new R;case Ie:return cB(f)}}function RB(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(Cn,`{
|
|
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
339
|
/* [wrapped with `+v+`] */
|
|
340
|
-
`)}function AB(f){return tr(f)||ja(f)||!!(X0&&f&&f[X0])}function Vn(f,v){var y=typeof f;return v=v??$,!!v&&(y=="number"||y!="symbol"&&Rs.test(f))&&f>-1&&f%1==0&&f<v}function At(f,v,y){if(!Fr(y))return!1;var R=typeof v;return(R=="number"?Lt(y)&&Vn(v,y.length):R=="string"&&v in y)?pn(y[v],f):!1}function Gf(f,v){if(tr(f))return!1;var y=typeof f;return y=="number"||y=="symbol"||y=="boolean"||f==null||Ht(f)?!0:Mr.test(f)||!Wr.test(f)||v!=null&&f in _r(v)}function PB(f){var v=typeof f;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?f!=="__proto__":f===null}function Wf(f){var v=au(f),y=O[v];if(typeof y!="function"||!(v in dr.prototype))return!1;if(f===y)return!0;var R=zf(y);return!!R&&f===R[0]}function DB(f){return!!K0&&K0 in f}var IB=ks?Gn:sc;function Ro(f){var v=f&&f.constructor,y=typeof v=="function"&&v.prototype||Si;return f===y}function Kb(f){return f===f&&!Fr(f)}function jb(f,v){return function(y){return y==null?!1:y[f]===v&&(v!==t||f in _r(y))}}function BB(f){var v=fu(f,function(R){return y.size===u&&y.clear(),R}),y=v.cache;return v}function MB(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?Db(ie,J,v[4]):J,f[4]=ie?oa(f[3],c):v[4]}return J=v[5],J&&(ie=f[5],f[5]=ie?Ib(ie,J,v[6]):J,f[6]=ie?oa(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 kB(f){var v=[];if(f!=null)for(var y in _r(f))v.push(y);return v}function LB(f){return Os.call(f)}function Yb(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),Gt(f,this,J)}}function Zb(f,v){return v.length<2?f:Ua(f,tn(v,0,-1))}function OB(f,v){for(var y=f.length,R=wt(v.length,y),B=kt(f);R--;){var F=v[R];f[R]=Vn(F,y)?B[F]:t}return f}function Uf(f,v){if(!(v==="constructor"&&typeof f[v]=="function")&&v!="__proto__")return f[v]}var Xb=Jb(wb),Ao=XD||function(f,v){return ct.setTimeout(f,v)},Hf=Jb(iB);function Qb(f,v,y){var R=v+"";return Hf(f,RB(R,qB(_B(R),y)))}function Jb(f){var v=0,y=0;return function(){var R=rI(),B=M-(R-y);if(y=R,B>0){if(++v>=k)return arguments[0]}else v=0;return f.apply(t,arguments)}}function ou(f,v){var y=-1,R=f.length,B=R-1;for(v=v===t?R:v;++y<v;){var F=Af(y,B),H=f[F];f[F]=f[y],f[y]=H}return f.length=v,f}var e1=BB(function(f){var v=[];return f.charCodeAt(0)===46&&v.push(""),f.replace(lt,function(y,R,B,F){v.push(B?F.replace(hi,"$1"):R||y)}),v});function Tn(f){if(typeof f=="string"||Ht(f))return f;var v=f+"";return v=="0"&&1/f==-q?"-0":v}function Ka(f){if(f!=null){try{return Ls.call(f)}catch{}try{return f+""}catch{}}return""}function qB(f,v){return Qt(G,function(y){var R="_."+y[0];v&y[1]&&!Ds(f,R)&&f.push(R)}),f.sort()}function r1(f){if(f instanceof dr)return f.clone();var v=new en(f.__wrapped__,f.__chain__);return v.__actions__=kt(f.__actions__),v.__index__=f.__index__,v.__values__=f.__values__,v}function NB(f,v,y){(y?At(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(Vs(R/v));B<R;)H[F++]=tn(f,B,B+=v);return H}function FB(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 zB(){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 ia(tr(y)?kt(y):[y],dt(v,1))}var $B=lr(function(f,v){return Ur(f)?Eo(f,dt(v,1,Ur,!0)):[]}),VB=lr(function(f,v){var y=nn(v);return Ur(y)&&(y=t),Ur(f)?Eo(f,dt(v,1,Ur,!0),Ze(y,2)):[]}),GB=lr(function(f,v){var y=nn(v);return Ur(y)&&(y=t),Ur(f)?Eo(f,dt(v,1,Ur,!0),t,y):[]});function WB(f,v,y){var R=f==null?0:f.length;return R?(v=y||v===t?1:ir(v),tn(f,v<0?0:v,R)):[]}function UB(f,v,y){var R=f==null?0:f.length;return R?(v=y||v===t?1:ir(v),v=R-v,tn(f,0,v<0?0:v)):[]}function HB(f,v){return f&&f.length?Qs(f,Ze(v,3),!0,!0):[]}function KB(f,v){return f&&f.length?Qs(f,Ze(v,3),!0):[]}function jB(f,v,y,R){var B=f==null?0:f.length;return B?(y&&typeof y!="number"&&At(f,v,y)&&(y=0,R=B),zI(f,v,y,R)):[]}function t1(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)),Is(f,Ze(v,3),B)}function n1(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)),Is(f,Ze(v,3),B,!0)}function a1(f){var v=f==null?0:f.length;return v?dt(f,1):[]}function YB(f){var v=f==null?0:f.length;return v?dt(f,q):[]}function ZB(f,v){var y=f==null?0:f.length;return y?(v=v===t?1:ir(v),dt(f,v)):[]}function XB(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 i1(f){return f&&f.length?f[0]:t}function QB(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)),xi(f,v,B)}function JB(f){var v=f==null?0:f.length;return v?tn(f,0,-1):[]}var eM=lr(function(f){var v=Lr(f,Mf);return v.length&&v[0]===f[0]?Cf(v):[]}),rM=lr(function(f){var v=nn(f),y=Lr(f,Mf);return v===nn(y)?v=t:y.pop(),y.length&&y[0]===f[0]?Cf(y,Ze(v,2)):[]}),tM=lr(function(f){var v=nn(f),y=Lr(f,Mf);return v=typeof v=="function"?v:t,v&&y.pop(),y.length&&y[0]===f[0]?Cf(y,t,v):[]});function nM(f,v){return f==null?"":JD.call(f,v)}function nn(f){var v=f==null?0:f.length;return v?f[v-1]:t}function aM(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?qD(f,v,B):Is(f,F0,B,!0)}function iM(f,v){return f&&f.length?pb(f,ir(v)):t}var oM=lr(o1);function o1(f,v){return f&&f.length&&v&&v.length?Rf(f,v):f}function sM(f,v,y){return f&&f.length&&v&&v.length?Rf(f,v,Ze(y,2)):f}function uM(f,v,y){return f&&f.length&&v&&v.length?Rf(f,v,t,y):f}var lM=$n(function(f,v){var y=f==null?0:f.length,R=bf(f,v);return bb(f,Lr(v,function(B){return Vn(B,y)?+B:B}).sort(Pb)),R});function fM(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 bb(f,B),y}function Kf(f){return f==null?f:nI.call(f)}function cM(f,v,y){var R=f==null?0:f.length;return R?(y&&typeof y!="number"&&At(f,v,y)?(v=0,y=R):(v=v==null?0:ir(v),y=y===t?R:ir(y)),tn(f,v,y)):[]}function dM(f,v){return Xs(f,v)}function vM(f,v,y){return Df(f,v,Ze(y,2))}function hM(f,v){var y=f==null?0:f.length;if(y){var R=Xs(f,v);if(R<y&&pn(f[R],v))return R}return-1}function gM(f,v){return Xs(f,v,!0)}function pM(f,v,y){return Df(f,v,Ze(y,2),!0)}function yM(f,v){var y=f==null?0:f.length;if(y){var R=Xs(f,v,!0)-1;if(pn(f[R],v))return R}return-1}function mM(f){return f&&f.length?xb(f):[]}function bM(f,v){return f&&f.length?xb(f,Ze(v,2)):[]}function wM(f){var v=f==null?0:f.length;return v?tn(f,1,v):[]}function xM(f,v,y){return f&&f.length?(v=y||v===t?1:ir(v),tn(f,0,v<0?0:v)):[]}function EM(f,v,y){var R=f==null?0:f.length;return R?(v=y||v===t?1:ir(v),v=R-v,tn(f,v<0?0:v,R)):[]}function CM(f,v){return f&&f.length?Qs(f,Ze(v,3),!1,!0):[]}function _M(f,v){return f&&f.length?Qs(f,Ze(v,3)):[]}var SM=lr(function(f){return la(dt(f,1,Ur,!0))}),TM=lr(function(f){var v=nn(f);return Ur(v)&&(v=t),la(dt(f,1,Ur,!0),Ze(v,2))}),RM=lr(function(f){var v=nn(f);return v=typeof v=="function"?v:t,la(dt(f,1,Ur,!0),t,v)});function AM(f){return f&&f.length?la(f):[]}function PM(f,v){return f&&f.length?la(f,Ze(v,2)):[]}function DM(f,v){return v=typeof v=="function"?v:t,f&&f.length?la(f,t,v):[]}function jf(f){if(!(f&&f.length))return[];var v=0;return f=aa(f,function(y){if(Ur(y))return v=Jr(y.length,v),!0}),cf(v,function(y){return Lr(f,uf(y))})}function s1(f,v){if(!(f&&f.length))return[];var y=jf(f);return v==null?y:Lr(y,function(R){return Gt(v,t,R)})}var IM=lr(function(f,v){return Ur(f)?Eo(f,v):[]}),BM=lr(function(f){return Bf(aa(f,Ur))}),MM=lr(function(f){var v=nn(f);return Ur(v)&&(v=t),Bf(aa(f,Ur),Ze(v,2))}),kM=lr(function(f){var v=nn(f);return v=typeof v=="function"?v:t,Bf(aa(f,Ur),t,v)}),LM=lr(jf);function OM(f,v){return Sb(f||[],v||[],xo)}function qM(f,v){return Sb(f||[],v||[],So)}var NM=lr(function(f){var v=f.length,y=v>1?f[v-1]:t;return y=typeof y=="function"?(f.pop(),y):t,s1(f,y)});function u1(f){var v=O(f);return v.__chain__=!0,v}function FM(f,v){return v(f),f}function su(f,v){return v(f)}var zM=$n(function(f){var v=f.length,y=v?f[0]:0,R=this.__wrapped__,B=function(F){return bf(F,f)};return v>1||this.__actions__.length||!(R instanceof dr)||!Vn(y)?this.thru(B):(R=R.slice(y,+y+(v?1:0)),R.__actions__.push({func:su,args:[B],thisArg:t}),new en(R,this.__chain__).thru(function(F){return v&&!F.length&&F.push(t),F}))});function $M(){return u1(this)}function VM(){return new en(this.value(),this.__chain__)}function GM(){this.__values__===t&&(this.__values__=E1(this.value()));var f=this.__index__>=this.__values__.length,v=f?t:this.__values__[this.__index__++];return{done:f,value:v}}function WM(){return this}function UM(f){for(var v,y=this;y instanceof Hs;){var R=r1(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 HM(){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:su,args:[Kf],thisArg:t}),new en(v,this.__chain__)}return this.thru(Kf)}function KM(){return _b(this.__wrapped__,this.__actions__)}var jM=Js(function(f,v,y){br.call(f,y)?++f[y]:Fn(f,y,1)});function YM(f,v,y){var R=tr(f)?q0:FI;return y&&At(f,v,y)&&(v=t),R(f,Ze(v,3))}function ZM(f,v){var y=tr(f)?aa:sb;return y(f,Ze(v,3))}var XM=Lb(t1),QM=Lb(n1);function JM(f,v){return dt(uu(f,v),1)}function ek(f,v){return dt(uu(f,v),q)}function rk(f,v,y){return y=y===t?1:ir(y),dt(uu(f,v),y)}function l1(f,v){var y=tr(f)?Qt:ua;return y(f,Ze(v,3))}function f1(f,v){var y=tr(f)?wD:ob;return y(f,Ze(v,3))}var tk=Js(function(f,v,y){br.call(f,y)?f[y].push(v):Fn(f,y,[v])});function nk(f,v,y,R){f=Lt(f)?f:Mi(f),y=y&&!R?ir(y):0;var B=f.length;return y<0&&(y=Jr(B+y,0)),vu(f)?y<=B&&f.indexOf(v,y)>-1:!!B&&xi(f,v,y)>-1}var ak=lr(function(f,v,y){var R=-1,B=typeof v=="function",F=Lt(f)?he(f.length):[];return ua(f,function(H){F[++R]=B?Gt(v,H,y):Co(H,v,y)}),F}),ik=Js(function(f,v,y){Fn(f,y,v)});function uu(f,v){var y=tr(f)?Lr:vb;return y(f,Ze(v,3))}function ok(f,v,y,R){return f==null?[]:(tr(v)||(v=v==null?[]:[v]),y=R?t:y,tr(y)||(y=y==null?[]:[y]),yb(f,v,y))}var sk=Js(function(f,v,y){f[y?0:1].push(v)},function(){return[[],[]]});function uk(f,v,y){var R=tr(f)?of:$0,B=arguments.length<3;return R(f,Ze(v,4),y,B,ua)}function lk(f,v,y){var R=tr(f)?xD:$0,B=arguments.length<3;return R(f,Ze(v,4),y,B,ob)}function fk(f,v){var y=tr(f)?aa:sb;return y(f,cu(Ze(v,3)))}function ck(f){var v=tr(f)?tb:nB;return v(f)}function dk(f,v,y){(y?At(f,v,y):v===t)?v=1:v=ir(v);var R=tr(f)?kI:aB;return R(f,v)}function vk(f){var v=tr(f)?LI:oB;return v(f)}function hk(f){if(f==null)return 0;if(Lt(f))return vu(f)?Ci(f):f.length;var v=xt(f);return v==ce||v==be?f.size:Sf(f).length}function gk(f,v,y){var R=tr(f)?sf:sB;return y&&At(f,v,y)&&(v=t),R(f,Ze(v,3))}var pk=lr(function(f,v){if(f==null)return[];var y=v.length;return y>1&&At(f,v[0],v[1])?v=[]:y>2&&At(v[0],v[1],v[2])&&(v=[v[0]]),yb(f,dt(v,1),[])}),lu=ZD||function(){return ct.Date.now()};function yk(f,v){if(typeof v!="function")throw new Jt(o);return f=ir(f),function(){if(--f<1)return v.apply(this,arguments)}}function c1(f,v,y){return v=y?t:v,v=f&&v==null?f.length:v,zn(f,_,t,t,t,t,v)}function d1(f,v){var y;if(typeof v!="function")throw new Jt(o);return f=ir(f),function(){return--f>0&&(y=v.apply(this,arguments)),f<=1&&(v=t),y}}var Yf=lr(function(f,v,y){var R=m;if(y.length){var B=oa(y,Ii(Yf));R|=T}return zn(f,R,v,y,B)}),v1=lr(function(f,v,y){var R=m|b;if(y.length){var B=oa(y,Ii(v1));R|=T}return zn(v,R,f,y,B)});function h1(f,v,y){v=y?t:v;var R=zn(f,x,t,t,t,t,t,v);return R.placeholder=h1.placeholder,R}function g1(f,v,y){v=y?t:v;var R=zn(f,C,t,t,t,t,t,v);return R.placeholder=g1.placeholder,R}function p1(f,v,y){var R,B,F,H,J,ie,Se=0,Te=!1,De=!1,Le=!0;if(typeof f!="function")throw new Jt(o);v=an(v)||0,Fr(y)&&(Te=!!y.leading,De="maxWait"in y,F=De?Jr(an(y.maxWait)||0,v):F,Le="trailing"in y?!!y.trailing:Le);function Ue(Hr){var yn=R,Un=B;return R=B=t,Se=Hr,H=f.apply(Un,yn),H}function Qe(Hr){return Se=Hr,J=Ao(cr,v),Te?Ue(Hr):H}function sr(Hr){var yn=Hr-ie,Un=Hr-Se,L1=v-yn;return De?wt(L1,F-Un):L1}function Je(Hr){var yn=Hr-ie,Un=Hr-Se;return ie===t||yn>=v||yn<0||De&&Un>=F}function cr(){var Hr=lu();if(Je(Hr))return vr(Hr);J=Ao(cr,sr(Hr))}function vr(Hr){return J=t,Le&&R?Ue(Hr):(R=B=t,H)}function Kt(){J!==t&&Tb(J),Se=0,R=ie=B=J=t}function Pt(){return J===t?H:vr(lu())}function jt(){var Hr=lu(),yn=Je(Hr);if(R=arguments,B=this,ie=Hr,yn){if(J===t)return Qe(ie);if(De)return Tb(J),J=Ao(cr,v),Ue(ie)}return J===t&&(J=Ao(cr,v)),H}return jt.cancel=Kt,jt.flush=Pt,jt}var mk=lr(function(f,v){return ib(f,1,v)}),bk=lr(function(f,v,y){return ib(f,an(v)||0,y)});function wk(f){return zn(f,P)}function fu(f,v){if(typeof f!="function"||v!=null&&typeof v!="function")throw new Jt(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(fu.Cache||Nn),y}fu.Cache=Nn;function cu(f){if(typeof f!="function")throw new Jt(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 xk(f){return d1(2,f)}var Ek=uB(function(f,v){v=v.length==1&&tr(v[0])?Lr(v[0],Wt(Ze())):Lr(dt(v,1),Wt(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 Gt(f,this,R)})}),Zf=lr(function(f,v){var y=oa(v,Ii(Zf));return zn(f,T,t,v,y)}),y1=lr(function(f,v){var y=oa(v,Ii(y1));return zn(f,S,t,v,y)}),Ck=$n(function(f,v){return zn(f,A,t,t,t,v)});function _k(f,v){if(typeof f!="function")throw new Jt(o);return v=v===t?v:ir(v),lr(f,v)}function Sk(f,v){if(typeof f!="function")throw new Jt(o);return v=v==null?0:Jr(ir(v),0),lr(function(y){var R=y[v],B=ca(y,0,v);return R&&ia(B,R),Gt(f,this,B)})}function Tk(f,v,y){var R=!0,B=!0;if(typeof f!="function")throw new Jt(o);return Fr(y)&&(R="leading"in y?!!y.leading:R,B="trailing"in y?!!y.trailing:B),p1(f,v,{leading:R,maxWait:v,trailing:B})}function Rk(f){return c1(f,1)}function Ak(f,v){return Zf(kf(v),f)}function Pk(){if(!arguments.length)return[];var f=arguments[0];return tr(f)?f:[f]}function Dk(f){return rn(f,g)}function Ik(f,v){return v=typeof v=="function"?v:t,rn(f,g,v)}function Bk(f){return rn(f,d|g)}function Mk(f,v){return v=typeof v=="function"?v:t,rn(f,d|g,v)}function kk(f,v){return v==null||ab(f,v,it(v))}function pn(f,v){return f===v||f!==f&&v!==v}var Lk=nu(Ef),Ok=nu(function(f,v){return f>=v}),ja=fb((function(){return arguments})())?fb:function(f){return Vr(f)&&br.call(f,"callee")&&!Z0.call(f,"callee")},tr=he.isArray,qk=I0?Wt(I0):UI;function Lt(f){return f!=null&&du(f.length)&&!Gn(f)}function Ur(f){return Vr(f)&&Lt(f)}function Nk(f){return f===!0||f===!1||Vr(f)&&Rt(f)==de}var da=QD||sc,Fk=B0?Wt(B0):HI;function zk(f){return Vr(f)&&f.nodeType===1&&!Po(f)}function $k(f){if(f==null)return!0;if(Lt(f)&&(tr(f)||typeof f=="string"||typeof f.splice=="function"||da(f)||Bi(f)||ja(f)))return!f.length;var v=xt(f);if(v==ce||v==be)return!f.size;if(Ro(f))return!Sf(f).length;for(var y in f)if(br.call(f,y))return!1;return!0}function Vk(f,v){return _o(f,v)}function Gk(f,v,y){y=typeof y=="function"?y:t;var R=y?y(f,v):t;return R===t?_o(f,v,t,y):!!R}function Xf(f){if(!Vr(f))return!1;var v=Rt(f);return v==Q||v==Z||typeof f.message=="string"&&typeof f.name=="string"&&!Po(f)}function Wk(f){return typeof f=="number"&&Q0(f)}function Gn(f){if(!Fr(f))return!1;var v=Rt(f);return v==ae||v==te||v==re||v==xe}function m1(f){return typeof f=="number"&&f==ir(f)}function du(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=$}function Fr(f){var v=typeof f;return f!=null&&(v=="object"||v=="function")}function Vr(f){return f!=null&&typeof f=="object"}var b1=M0?Wt(M0):jI;function Uk(f,v){return f===v||_f(f,v,$f(v))}function Hk(f,v,y){return y=typeof y=="function"?y:t,_f(f,v,$f(v),y)}function Kk(f){return w1(f)&&f!=+f}function jk(f){if(IB(f))throw new rr(i);return cb(f)}function Yk(f){return f===null}function Zk(f){return f==null}function w1(f){return typeof f=="number"||Vr(f)&&Rt(f)==_e}function Po(f){if(!Vr(f)||Rt(f)!=U)return!1;var v=Fs(f);if(v===null)return!0;var y=br.call(v,"constructor")&&v.constructor;return typeof y=="function"&&y instanceof y&&Ls.call(y)==HD}var Qf=k0?Wt(k0):YI;function Xk(f){return m1(f)&&f>=-$&&f<=$}var x1=L0?Wt(L0):ZI;function vu(f){return typeof f=="string"||!tr(f)&&Vr(f)&&Rt(f)==Ae}function Ht(f){return typeof f=="symbol"||Vr(f)&&Rt(f)==Ie}var Bi=O0?Wt(O0):XI;function Qk(f){return f===t}function Jk(f){return Vr(f)&&xt(f)==Oe}function eL(f){return Vr(f)&&Rt(f)==He}var rL=nu(Tf),tL=nu(function(f,v){return f<=v});function E1(f){if(!f)return[];if(Lt(f))return vu(f)?hn(f):kt(f);if(po&&f[po])return kD(f[po]());var v=xt(f),y=v==ce?vf:v==be?Bs:Mi;return y(f)}function Wn(f){if(!f)return f===0?f:0;if(f=an(f),f===q||f===-q){var v=f<0?-1:1;return v*X}return f===f?f:0}function ir(f){var v=Wn(f),y=v%1;return v===v?y?v-y:v:0}function C1(f){return f?Wa(ir(f),0,K):0}function an(f){if(typeof f=="number")return f;if(Ht(f))return Y;if(Fr(f)){var v=typeof f.valueOf=="function"?f.valueOf():f;f=Fr(v)?v+"":v}if(typeof f!="string")return f===0?f:+f;f=V0(f);var y=bt.test(f);return y||Mt.test(f)?yD(f.slice(2),y?2:8):at.test(f)?Y:+f}function _1(f){return Sn(f,Ot(f))}function nL(f){return f?Wa(ir(f),-$,$):f===0?f:0}function wr(f){return f==null?"":Ut(f)}var aL=Pi(function(f,v){if(Ro(v)||Lt(v)){Sn(v,it(v),f);return}for(var y in v)br.call(v,y)&&xo(f,y,v[y])}),S1=Pi(function(f,v){Sn(v,Ot(v),f)}),hu=Pi(function(f,v,y,R){Sn(v,Ot(v),f,R)}),iL=Pi(function(f,v,y,R){Sn(v,it(v),f,R)}),oL=$n(bf);function sL(f,v){var y=Ai(f);return v==null?y:nb(y,v)}var uL=lr(function(f,v){f=_r(f);var y=-1,R=v.length,B=R>2?v[2]:t;for(B&&At(v[0],v[1],B)&&(R=1);++y<R;)for(var F=v[y],H=Ot(F),J=-1,ie=H.length;++J<ie;){var Se=H[J],Te=f[Se];(Te===t||pn(Te,Si[Se])&&!br.call(f,Se))&&(f[Se]=F[Se])}return f}),lL=lr(function(f){return f.push(t,Vb),Gt(T1,t,f)});function fL(f,v){return N0(f,Ze(v,3),_n)}function cL(f,v){return N0(f,Ze(v,3),xf)}function dL(f,v){return f==null?f:wf(f,Ze(v,3),Ot)}function vL(f,v){return f==null?f:ub(f,Ze(v,3),Ot)}function hL(f,v){return f&&_n(f,Ze(v,3))}function gL(f,v){return f&&xf(f,Ze(v,3))}function pL(f){return f==null?[]:Ys(f,it(f))}function yL(f){return f==null?[]:Ys(f,Ot(f))}function Jf(f,v,y){var R=f==null?t:Ua(f,v);return R===t?y:R}function mL(f,v){return f!=null&&Ub(f,v,$I)}function ec(f,v){return f!=null&&Ub(f,v,VI)}var bL=qb(function(f,v,y){v!=null&&typeof v.toString!="function"&&(v=Os.call(v)),f[v]=y},tc(qt)),wL=qb(function(f,v,y){v!=null&&typeof v.toString!="function"&&(v=Os.call(v)),br.call(f,v)?f[v].push(y):f[v]=[y]},Ze),xL=lr(Co);function it(f){return Lt(f)?rb(f):Sf(f)}function Ot(f){return Lt(f)?rb(f,!0):QI(f)}function EL(f,v){var y={};return v=Ze(v,3),_n(f,function(R,B,F){Fn(y,v(R,B,F),R)}),y}function CL(f,v){var y={};return v=Ze(v,3),_n(f,function(R,B,F){Fn(y,B,v(R,B,F))}),y}var _L=Pi(function(f,v,y){Zs(f,v,y)}),T1=Pi(function(f,v,y,R){Zs(f,v,y,R)}),SL=$n(function(f,v){var y={};if(f==null)return y;var R=!1;v=Lr(v,function(F){return F=fa(F,f),R||(R=F.length>1),F}),Sn(f,Ff(f),y),R&&(y=rn(y,d|h|g,bB));for(var B=v.length;B--;)If(y,v[B]);return y});function TL(f,v){return R1(f,cu(Ze(v)))}var RL=$n(function(f,v){return f==null?{}:eB(f,v)});function R1(f,v){if(f==null)return{};var y=Lr(Ff(f),function(R){return[R]});return v=Ze(v),mb(f,y,function(R,B){return v(R,B[0])})}function AL(f,v,y){v=fa(v,f);var R=-1,B=v.length;for(B||(B=1,f=t);++R<B;){var F=f==null?t:f[Tn(v[R])];F===t&&(R=B,F=y),f=Gn(F)?F.call(f):F}return f}function PL(f,v,y){return f==null?f:So(f,v,y)}function DL(f,v,y,R){return R=typeof R=="function"?R:t,f==null?f:So(f,v,y,R)}var A1=zb(it),P1=zb(Ot);function IL(f,v,y){var R=tr(f),B=R||da(f)||Bi(f);if(v=Ze(v,4),y==null){var F=f&&f.constructor;B?y=R?new F:[]:Fr(f)?y=Gn(F)?Ai(Fs(f)):{}:y={}}return(B?Qt:_n)(f,function(H,J,ie){return v(y,H,J,ie)}),y}function BL(f,v){return f==null?!0:If(f,v)}function ML(f,v,y){return f==null?f:Cb(f,v,kf(y))}function kL(f,v,y,R){return R=typeof R=="function"?R:t,f==null?f:Cb(f,v,kf(y),R)}function Mi(f){return f==null?[]:df(f,it(f))}function LL(f){return f==null?[]:df(f,Ot(f))}function OL(f,v,y){return y===t&&(y=v,v=t),y!==t&&(y=an(y),y=y===y?y:0),v!==t&&(v=an(v),v=v===v?v:0),Wa(an(f),v,y)}function qL(f,v,y){return v=Wn(v),y===t?(y=v,v=0):y=Wn(y),f=an(f),GI(f,v,y)}function NL(f,v,y){if(y&&typeof y!="boolean"&&At(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=Wn(f),v===t?(v=f,f=0):v=Wn(v)),f>v){var R=f;f=v,v=R}if(y||f%1||v%1){var B=J0();return wt(f+B*(v-f+pD("1e-"+((B+"").length-1))),v)}return Af(f,v)}var FL=Di(function(f,v,y){return v=v.toLowerCase(),f+(y?D1(v):v)});function D1(f){return rc(wr(f).toLowerCase())}function I1(f){return f=wr(f),f&&f.replace(Wl,PD).replace(oD,"")}function zL(f,v,y){f=wr(f),v=Ut(v);var R=f.length;y=y===t?R:Wa(ir(y),0,R);var B=y;return y-=v.length,y>=0&&f.slice(y,B)==v}function $L(f){return f=wr(f),f&&nr.test(f)?f.replace(je,DD):f}function VL(f){return f=wr(f),f&&Kr.test(f)?f.replace(kr,"\\$&"):f}var GL=Di(function(f,v,y){return f+(y?"-":"")+v.toLowerCase()}),WL=Di(function(f,v,y){return f+(y?" ":"")+v.toLowerCase()}),UL=kb("toLowerCase");function HL(f,v,y){f=wr(f),v=ir(v);var R=v?Ci(f):0;if(!v||R>=v)return f;var B=(v-R)/2;return tu(Gs(B),y)+f+tu(Vs(B),y)}function KL(f,v,y){f=wr(f),v=ir(v);var R=v?Ci(f):0;return v&&R<v?f+tu(v-R,y):f}function jL(f,v,y){f=wr(f),v=ir(v);var R=v?Ci(f):0;return v&&R<v?tu(v-R,y)+f:f}function YL(f,v,y){return y||v==null?v=0:v&&(v=+v),tI(wr(f).replace(Nr,""),v||0)}function ZL(f,v,y){return(y?At(f,v,y):v===t)?v=1:v=ir(v),Pf(wr(f),v)}function XL(){var f=arguments,v=wr(f[0]);return f.length<3?v:v.replace(f[1],f[2])}var QL=Di(function(f,v,y){return f+(y?"_":"")+v.toLowerCase()});function JL(f,v,y){return y&&typeof y!="number"&&At(f,v,y)&&(v=y=t),y=y===t?K:y>>>0,y?(f=wr(f),f&&(typeof v=="string"||v!=null&&!Qf(v))&&(v=Ut(v),!v&&Ei(f))?ca(hn(f),0,y):f.split(v,y)):[]}var eO=Di(function(f,v,y){return f+(y?" ":"")+rc(v)});function rO(f,v,y){return f=wr(f),y=y==null?0:Wa(ir(y),0,f.length),v=Ut(v),f.slice(y,y+v.length)==v}function tO(f,v,y){var R=O.templateSettings;y&&At(f,v,y)&&(v=t),f=wr(f),v=hu({},v,R,$b);var B=hu({},v.imports,R.imports,$b),F=it(B),H=df(B,F),J,ie,Se=0,Te=v.interpolate||gi,De="__p += '",Le=hf((v.escape||gi).source+"|"+Te.source+"|"+(Te===ar?On:gi).source+"|"+(v.evaluate||gi).source+"|$","g"),Ue="//# sourceURL="+(br.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++cD+"]")+`
|
|
341
|
-
`;f.replace(Le,function(Je,cr,vr,
|
|
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
342
|
__e(`+cr+`) +
|
|
343
|
-
'`),
|
|
344
|
-
`+
|
|
345
|
-
__p += '`),vr&&(
|
|
343
|
+
'`),Dt&&(ie=!0,Pe+=`';
|
|
344
|
+
`+Dt+`;
|
|
345
|
+
__p += '`),vr&&(Pe+=`' +
|
|
346
346
|
((__t = (`+vr+`)) == null ? '' : __t) +
|
|
347
|
-
'`),
|
|
348
|
-
`;var Qe=br.call(v,"variable")&&v.variable;if(!Qe)
|
|
349
|
-
`+
|
|
347
|
+
'`),_e=Yt+Je.length,Je}),Pe+=`';
|
|
348
|
+
`;var Qe=br.call(v,"variable")&&v.variable;if(!Qe)Pe=`with (obj) {
|
|
349
|
+
`+Pe+`
|
|
350
350
|
}
|
|
351
|
-
`;else if(
|
|
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
352
|
`+(Qe?"":`obj || (obj = {});
|
|
353
353
|
`)+"var __t, __p = ''"+(J?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join;
|
|
354
354
|
function print() { __p += __j.call(arguments, '') }
|
|
355
355
|
`:`;
|
|
356
|
-
`)+
|
|
357
|
-
}`;var sr=M1(function(){return mr(F,Ue+"return "+De).apply(t,H)});if(sr.source=De,Xf(sr))throw sr;return sr}function nO(f){return wr(f).toLowerCase()}function aO(f){return wr(f).toUpperCase()}function iO(f,v,y){if(f=wr(f),f&&(y||v===t))return V0(f);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=hn(v),F=G0(R,B),H=W0(R,B)+1;return ca(R,F,H).join("")}function oO(f,v,y){if(f=wr(f),f&&(y||v===t))return f.slice(0,H0(f)+1);if(!f||!(v=Ut(v)))return f;var R=hn(f),B=W0(R,hn(v))+1;return ca(R,0,B).join("")}function sO(f,v,y){if(f=wr(f),f&&(y||v===t))return f.replace(Nr,"");if(!f||!(v=Ut(v)))return f;var R=hn(f),B=G0(R,hn(v));return ca(R,B).join("")}function uO(f,v){var y=D,R=I;if(Fr(v)){var B="separator"in v?v.separator:B;y="length"in v?ir(v.length):y,R="omission"in v?Ut(v.omission):R}f=wr(f);var F=f.length;if(Ei(f)){var H=hn(f);F=H.length}if(y>=F)return f;var J=y-Ci(R);if(J<1)return R;var ie=H?ca(H,0,J).join(""):f.slice(0,J);if(B===t)return ie+R;if(H&&(J+=ie.length-J),Qf(B)){if(f.slice(J).search(B)){var Se,Te=ie;for(B.global||(B=hf(B.source,wr(ft.exec(B))+"g")),B.lastIndex=0;Se=B.exec(Te);)var De=Se.index;ie=ie.slice(0,De===t?J:De)}}else if(f.indexOf(Ut(B),J)!=J){var Le=ie.lastIndexOf(B);Le>-1&&(ie=ie.slice(0,Le))}return ie+R}function lO(f){return f=wr(f),f&&or.test(f)?f.replace(Fe,ND):f}var fO=Di(function(f,v,y){return f+(y?" ":"")+v.toUpperCase()}),rc=kb("toUpperCase");function B1(f,v,y){return f=wr(f),v=y?t:v,v===t?MD(f)?$D(f):_D(f):f.match(v)||[]}var M1=lr(function(f,v){try{return Gt(f,t,v)}catch(y){return Xf(y)?y:new rr(y)}}),cO=$n(function(f,v){return Qt(v,function(y){y=Tn(y),Fn(f,y,Yf(f[y],f))}),f});function dO(f){var v=f==null?0:f.length,y=Ze();return f=v?Lr(f,function(R){if(typeof R[1]!="function")throw new Jt(o);return[y(R[0]),R[1]]}):[],lr(function(R){for(var B=-1;++B<v;){var F=f[B];if(Gt(F[0],this,R))return Gt(F[1],this,R)}})}function vO(f){return NI(rn(f,d))}function tc(f){return function(){return f}}function hO(f,v){return f==null||f!==f?v:f}var gO=Ob(),pO=Ob(!0);function qt(f){return f}function nc(f){return db(typeof f=="function"?f:rn(f,d))}function yO(f){return hb(rn(f,d))}function mO(f,v){return gb(f,rn(v,d))}var bO=lr(function(f,v){return function(y){return Co(y,f,v)}}),wO=lr(function(f,v){return function(y){return Co(f,y,v)}});function ac(f,v,y){var R=it(v),B=Ys(v,R);y==null&&!(Fr(v)&&(B.length||!R.length))&&(y=v,v=f,f=this,B=Ys(v,it(v)));var F=!(Fr(y)&&"chain"in y)||!!y.chain,H=Gn(f);return Qt(B,function(J){var ie=v[J];f[J]=ie,H&&(f.prototype[J]=function(){var Se=this.__chain__;if(F||Se){var Te=f(this.__wrapped__),De=Te.__actions__=kt(this.__actions__);return De.push({func:ie,args:arguments,thisArg:f}),Te.__chain__=Se,Te}return ie.apply(f,ia([this.value()],arguments))})}),f}function xO(){return ct._===this&&(ct._=KD),this}function ic(){}function EO(f){return f=ir(f),lr(function(v){return pb(v,f)})}var CO=Of(Lr),_O=Of(q0),SO=Of(sf);function k1(f){return Gf(f)?uf(Tn(f)):rB(f)}function TO(f){return function(v){return f==null?t:Ua(f,v)}}var RO=Nb(),AO=Nb(!0);function oc(){return[]}function sc(){return!1}function PO(){return{}}function DO(){return""}function IO(){return!0}function BO(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=cf(R,v);++y<f;)v(y);return B}function MO(f){return tr(f)?Lr(f,Tn):Ht(f)?[f]:kt(e1(wr(f)))}function kO(f){var v=++UD;return wr(f)+v}var LO=ru(function(f,v){return f+v},0),OO=qf("ceil"),qO=ru(function(f,v){return f/v},1),NO=qf("floor");function FO(f){return f&&f.length?js(f,qt,Ef):t}function zO(f,v){return f&&f.length?js(f,Ze(v,2),Ef):t}function $O(f){return z0(f,qt)}function VO(f,v){return z0(f,Ze(v,2))}function GO(f){return f&&f.length?js(f,qt,Tf):t}function WO(f,v){return f&&f.length?js(f,Ze(v,2),Tf):t}var UO=ru(function(f,v){return f*v},1),HO=qf("round"),KO=ru(function(f,v){return f-v},0);function jO(f){return f&&f.length?ff(f,qt):0}function YO(f,v){return f&&f.length?ff(f,Ze(v,2)):0}return O.after=yk,O.ary=c1,O.assign=aL,O.assignIn=S1,O.assignInWith=hu,O.assignWith=iL,O.at=oL,O.before=d1,O.bind=Yf,O.bindAll=cO,O.bindKey=v1,O.castArray=Pk,O.chain=u1,O.chunk=NB,O.compact=FB,O.concat=zB,O.cond=dO,O.conforms=vO,O.constant=tc,O.countBy=jM,O.create=sL,O.curry=h1,O.curryRight=g1,O.debounce=p1,O.defaults=uL,O.defaultsDeep=lL,O.defer=mk,O.delay=bk,O.difference=$B,O.differenceBy=VB,O.differenceWith=GB,O.drop=WB,O.dropRight=UB,O.dropRightWhile=HB,O.dropWhile=KB,O.fill=jB,O.filter=ZM,O.flatMap=JM,O.flatMapDeep=ek,O.flatMapDepth=rk,O.flatten=a1,O.flattenDeep=YB,O.flattenDepth=ZB,O.flip=wk,O.flow=gO,O.flowRight=pO,O.fromPairs=XB,O.functions=pL,O.functionsIn=yL,O.groupBy=tk,O.initial=JB,O.intersection=eM,O.intersectionBy=rM,O.intersectionWith=tM,O.invert=bL,O.invertBy=wL,O.invokeMap=ak,O.iteratee=nc,O.keyBy=ik,O.keys=it,O.keysIn=Ot,O.map=uu,O.mapKeys=EL,O.mapValues=CL,O.matches=yO,O.matchesProperty=mO,O.memoize=fu,O.merge=_L,O.mergeWith=T1,O.method=bO,O.methodOf=wO,O.mixin=ac,O.negate=cu,O.nthArg=EO,O.omit=SL,O.omitBy=TL,O.once=xk,O.orderBy=ok,O.over=CO,O.overArgs=Ek,O.overEvery=_O,O.overSome=SO,O.partial=Zf,O.partialRight=y1,O.partition=sk,O.pick=RL,O.pickBy=R1,O.property=k1,O.propertyOf=TO,O.pull=oM,O.pullAll=o1,O.pullAllBy=sM,O.pullAllWith=uM,O.pullAt=lM,O.range=RO,O.rangeRight=AO,O.rearg=Ck,O.reject=fk,O.remove=fM,O.rest=_k,O.reverse=Kf,O.sampleSize=dk,O.set=PL,O.setWith=DL,O.shuffle=vk,O.slice=cM,O.sortBy=pk,O.sortedUniq=mM,O.sortedUniqBy=bM,O.split=JL,O.spread=Sk,O.tail=wM,O.take=xM,O.takeRight=EM,O.takeRightWhile=CM,O.takeWhile=_M,O.tap=FM,O.throttle=Tk,O.thru=su,O.toArray=E1,O.toPairs=A1,O.toPairsIn=P1,O.toPath=MO,O.toPlainObject=_1,O.transform=IL,O.unary=Rk,O.union=SM,O.unionBy=TM,O.unionWith=RM,O.uniq=AM,O.uniqBy=PM,O.uniqWith=DM,O.unset=BL,O.unzip=jf,O.unzipWith=s1,O.update=ML,O.updateWith=kL,O.values=Mi,O.valuesIn=LL,O.without=IM,O.words=B1,O.wrap=Ak,O.xor=BM,O.xorBy=MM,O.xorWith=kM,O.zip=LM,O.zipObject=OM,O.zipObjectDeep=qM,O.zipWith=NM,O.entries=A1,O.entriesIn=P1,O.extend=S1,O.extendWith=hu,ac(O,O),O.add=LO,O.attempt=M1,O.camelCase=FL,O.capitalize=D1,O.ceil=OO,O.clamp=OL,O.clone=Dk,O.cloneDeep=Bk,O.cloneDeepWith=Mk,O.cloneWith=Ik,O.conformsTo=kk,O.deburr=I1,O.defaultTo=hO,O.divide=qO,O.endsWith=zL,O.eq=pn,O.escape=$L,O.escapeRegExp=VL,O.every=YM,O.find=XM,O.findIndex=t1,O.findKey=fL,O.findLast=QM,O.findLastIndex=n1,O.findLastKey=cL,O.floor=NO,O.forEach=l1,O.forEachRight=f1,O.forIn=dL,O.forInRight=vL,O.forOwn=hL,O.forOwnRight=gL,O.get=Jf,O.gt=Lk,O.gte=Ok,O.has=mL,O.hasIn=ec,O.head=i1,O.identity=qt,O.includes=nk,O.indexOf=QB,O.inRange=qL,O.invoke=xL,O.isArguments=ja,O.isArray=tr,O.isArrayBuffer=qk,O.isArrayLike=Lt,O.isArrayLikeObject=Ur,O.isBoolean=Nk,O.isBuffer=da,O.isDate=Fk,O.isElement=zk,O.isEmpty=$k,O.isEqual=Vk,O.isEqualWith=Gk,O.isError=Xf,O.isFinite=Wk,O.isFunction=Gn,O.isInteger=m1,O.isLength=du,O.isMap=b1,O.isMatch=Uk,O.isMatchWith=Hk,O.isNaN=Kk,O.isNative=jk,O.isNil=Zk,O.isNull=Yk,O.isNumber=w1,O.isObject=Fr,O.isObjectLike=Vr,O.isPlainObject=Po,O.isRegExp=Qf,O.isSafeInteger=Xk,O.isSet=x1,O.isString=vu,O.isSymbol=Ht,O.isTypedArray=Bi,O.isUndefined=Qk,O.isWeakMap=Jk,O.isWeakSet=eL,O.join=nM,O.kebabCase=GL,O.last=nn,O.lastIndexOf=aM,O.lowerCase=WL,O.lowerFirst=UL,O.lt=rL,O.lte=tL,O.max=FO,O.maxBy=zO,O.mean=$O,O.meanBy=VO,O.min=GO,O.minBy=WO,O.stubArray=oc,O.stubFalse=sc,O.stubObject=PO,O.stubString=DO,O.stubTrue=IO,O.multiply=UO,O.nth=iM,O.noConflict=xO,O.noop=ic,O.now=lu,O.pad=HL,O.padEnd=KL,O.padStart=jL,O.parseInt=YL,O.random=NL,O.reduce=uk,O.reduceRight=lk,O.repeat=ZL,O.replace=XL,O.result=AL,O.round=HO,O.runInContext=ne,O.sample=ck,O.size=hk,O.snakeCase=QL,O.some=gk,O.sortedIndex=dM,O.sortedIndexBy=vM,O.sortedIndexOf=hM,O.sortedLastIndex=gM,O.sortedLastIndexBy=pM,O.sortedLastIndexOf=yM,O.startCase=eO,O.startsWith=rO,O.subtract=KO,O.sum=jO,O.sumBy=YO,O.template=tO,O.times=BO,O.toFinite=Wn,O.toInteger=ir,O.toLength=C1,O.toLower=nO,O.toNumber=an,O.toSafeInteger=nL,O.toString=wr,O.toUpper=aO,O.trim=iO,O.trimEnd=oO,O.trimStart=sO,O.truncate=uO,O.unescape=lO,O.uniqueId=kO,O.upperCase=fO,O.upperFirst=rc,O.each=l1,O.eachRight=f1,O.first=i1,ac(O,(function(){var f={};return _n(O,function(v,y){br.call(O.prototype,y)||(f[y]=v)}),f})(),{chain:!1}),O.VERSION=n,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){O[f].placeholder=O}),Qt(["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()}}),Qt(["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}}),Qt(["head","last"],function(f,v){var y="take"+(v?"Right":"");dr.prototype[f]=function(){return this[y](1).value()[0]}}),Qt(["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(qt)},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 Co(y,f,v)})}),dr.prototype.reject=function(f){return this.filter(cu(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)},_n(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,Se=J[0],Te=ie||tr(H),De=function(cr){var vr=B.apply(O,ia([cr],J));return R&&Le?vr[0]:vr};Te&&y&&typeof Se=="function"&&Se.length!=1&&(ie=Te=!1);var Le=this.__chain__,Ue=!!this.__actions__.length,Qe=F&&!Le,sr=ie&&!Ue;if(!F&&Te){H=sr?H:new dr(this);var Je=f.apply(H,J);return Je.__actions__.push({func:su,args:[De],thisArg:t}),new en(Je,Le)}return Qe&&sr?f.apply(this,J):(Je=this.thru(De),Qe?R?Je.value()[0]:Je.value():Je)})}),Qt(["pop","push","shift","sort","splice","unshift"],function(f){var v=Ms[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)})}}),_n(dr.prototype,function(f,v){var y=O[v];if(y){var R=y.name+"";br.call(Ri,R)||(Ri[R]=[]),Ri[R].push({name:v,func:y})}}),Ri[eu(t,b).name]=[{name:"wrapper",func:t}],dr.prototype.clone=lI,dr.prototype.reverse=fI,dr.prototype.value=cI,O.prototype.at=zM,O.prototype.chain=$M,O.prototype.commit=VM,O.prototype.next=GM,O.prototype.plant=UM,O.prototype.reverse=HM,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=KM,O.prototype.first=O.prototype.head,po&&(O.prototype[po]=WM),O}),_i=VD();za?((za.exports=_i)._=_i,tf._=_i):ct._=_i}).call(wW)})(Go,Go.exports)),Go.exports}var hr=xW();const z2=Sl(hr);function EW({cyParams:r,cyInst:e,layoutParams:t,layoutDebounce:n=50,children:a,init:i=()=>{},onCyInit:o}){const[s,l]=Re.useState(!1),u=Re.useRef(null),c=Re.useRef(null),d=Re.useRef(null),h=Re.useRef(!0),g=Re.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=z2.debounce(g,n);Re.useEffect(()=>{if(!u.current)return;const m=un({container:u.current,...r}),b=u.current.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 x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth)),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`),c.current.resize(),r.zoom&&r.pan&&c.current.viewport({zoom:r.zoom,pan:r.pan})}l(!0);const w=new ResizeObserver(z2.debounce(()=>{if(u.current&&c.current){const x=u.current.parentElement;let C=0,T=0;x&&(C=x.clientHeight,T=x.clientWidth,C===0&&(C=window.innerHeight-x.getBoundingClientRect().top-100),T===0&&(T=window.innerWidth),C>0&&T>0&&(u.current.style.width=`${T}px`,u.current.style.height=`${C}px`));const S=c.current.zoom()!==void 0?{zoom:c.current.zoom(),pan:c.current.pan()}:null;c.current.resize(),S&&c.current.viewport(S)}},50));return u.current&&w.observe(u.current),()=>{w.disconnect();try{m.destroy()}catch{}c.current=null,l(!1)}},[]),Re.useEffect(()=>{h.current?(h.current=!1,g()):p()},[s,t,p,g]);const E=Re.useMemo(()=>{var m;return c.current!==null?((m=Re.Children.map(a,b=>{var w;return b?Re.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.jsx("div",{ref:u,className:"cytoscape-react-cy-container",style:{width:"100%",height:"100%",position:"relative",background:"transparent"},children: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 CW({cytoInstance:r,id:e,parent:t,label:n,children:a,layout:i,classes:o,styleCallback:s}){const l=Re.useRef(null);function u(h){if(s){const g=s(h);h.isParent()&&(h.style("shape","roundrectangle"),h.style(g))}}Re.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]),Re.useEffect(()=>{i();const h=r.getElementById(e);h&&h.isParent()&&u(h)},[e,a]),Re.useEffect(()=>{if(!s)return;const h=r.getElementById(e);h&&h.isParent()&&u(h)},[s]);function c(h){return Re.cloneElement(h,{cytoInstance:r,layout:i})}const d=Re.Children.map(a,c);return ue.jsx("div",{ref:l,className:"cytoscape-react-node",children:d})}const _W={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},UP={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"},HP={...UP,pixelRatio:1,motionBlur:!0,textureOnViewport:!0,wheelPanDebounce:20},SW={...HP,hideEdgesOnViewport:!0,hideLabelsOnViewport:!0},TW=({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}=Ia(),C=Re.useRef(null),T=Re.useRef(null),S=Re.useRef(x),_=r.length>200;Re.useEffect(()=>{d(_)},[_,d]);const{edgeSep:A,rankSep:P}=Re.useMemo(()=>hq(r.length),[r.length]),{bgColor:D}=us(t),{background:I,borderSecondary:k}=ls(),M=s.backgroundColor||I,N=Re.useCallback(U=>{if(U!=null&&U.includes("gray"))return"whitesmoke";if(!U)return ht(t);switch(U){case"dark":return ht(M);case"light":return ht(k);default:return ht(U)}},[t,M,k]),z=s.colorMode==="dark",W=Re.useMemo(()=>z?N(D):"dark",[z,D,N]),q=n?N(n):W,$=Re.useMemo(()=>vq(N),[N]),X=s.initialViewport||{pan:{x:0,y:0},zoom:.01},Y=Re.useMemo(()=>({..._?SW:r.length>100?HP:UP,style:$,zoom:X.zoom,pan:X.pan,minZoom:s.minZoom??.01,maxZoom:s.maxZoom??1.5}),[$,X,r.length,s.minZoom,s.maxZoom]),K=Re.useRef(!1),ee=Re.useRef();Re.useEffect(()=>()=>{clearTimeout(ee.current)},[]);const le=Re.useMemo(()=>({..._W,...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=Re.useCallback(U=>{const fe=N(U||t);return{"corner-radius":50,"background-color":fe,color:fe,"border-color":fe}},[t,N]),V=Re.useCallback((U,fe,xe,ge)=>{let be={};return ge!=null&&ge.isInverted&&(ge==null?void 0:ge.source)===fe&&(be["target-arrow-shape"]="none",be["source-arrow-shape"]="triangle"),ge!=null&&ge.isEdgeAnimated?(be["line-style"]="dashed",be["line-dash-pattern"]=[32,18],be["line-dash-offset"]=0):ge!=null&&ge.isEdgeDashed?(be["line-style"]="dashed",be["line-dash-pattern"]=[],be["line-dash-offset"]=0):(be["line-style"]="solid",be["line-dash-pattern"]=[],be["line-dash-offset"]=0),a==="TB"&&(be["taxi-direction"]="downward"),a==="BT"&&(be["taxi-direction"]="upward"),a==="LR"&&(be["taxi-direction"]="rightward"),a==="RL"&&(be["taxi-direction"]="leftward"),be["line-color"]=q,be.color=q,be["target-arrow-color"]=q,be["source-arrow-color"]=q,be},[q,a]),j=Re.useRef(r);j.current=r;const re=Re.useRef(G);re.current=G;const de=Re.useRef(V);de.current=V,Re.useEffect(()=>{if(!i.current)return;const U=i.current,fe=()=>{U.nodes().forEach(xe=>{var ge,be;if(xe.isParent()){const Ae=j.current.find(Ie=>{var Be;return((Be=Ie.data)==null?void 0:Be.id)===xe.id()});xe.style(re.current((be=(ge=Ae==null?void 0:Ae.data)==null?void 0:ge.viewProps)==null?void 0:be.bgColor))}})};return U.on("add",fe),()=>{U.off("add",fe)}},[]),Re.useEffect(()=>{if(!i.current)return;const U=i.current;U.nodes().forEach(fe=>{var xe,ge;if(fe.isParent()){const be=r.find(Ae=>{var Ie;return((Ie=Ae.data)==null?void 0:Ie.id)===fe.id()});fe.style(G((ge=(xe=be==null?void 0:be.data)==null?void 0:xe.viewProps)==null?void 0:ge.bgColor))}}),e.forEach(({data:fe})=>{const xe=U.getElementById(fe.id);xe!=null&&xe.length&&(xe.data({isEdgeAnimated:fe.isEdgeAnimated,isEdgeDashed:fe.isEdgeDashed}),xe.style(V(xe,fe.source,fe.target,fe)))})},[r,e,q,G,V]);const se=Re.useRef(s);se.current=s;const Z=Re.useRef(h);Z.current=h;const Q=Re.useRef(w);Q.current=w,S.current=x,Re.useEffect(()=>{if(!i.current||!i.current.container)return;const U=i.current,fe=C.current;if(!fe)return;let xe=null,ge=null,be=0,Ae=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(),ke=Ie;Ie=0;let pe=$e-ke*.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}})}))):(be+=Ve.deltaX,Ae+=Ve.deltaY,xe===null&&(xe=requestAnimationFrame(()=>{xe=null;const er=U.pan(),$e=U.zoom(),ke=.35,pe=be,L=Ae;be=0,Ae=0,U.pan({x:er.x+-pe*ke/$e,y:er.y+-L*ke/$e})})))};return fe.addEventListener("wheel",He,{passive:!1}),()=>{fe.removeEventListener("wheel",He),xe!==null&&cancelAnimationFrame(xe),ge!==null&&cancelAnimationFrame(ge)}},[i.current]),Re.useEffect(()=>{i.current&&i.current.userPanningEnabled(m)},[m]),Re.useEffect(()=>{if(!i.current)return;const U=i.current;U.boxSelectionEnabled(!!p),U.selectionType(p?"additive":"single"),U.userPanningEnabled(!p&&m)},[p,m]),Re.useEffect(()=>{T.current&&(w?T.current.enableDrawMode():T.current.disableDrawMode())},[w]);const ae=Re.useRef(l);ae.current=l,Re.useEffect(()=>{if(s.disableKeyboardShortcuts)return;const U=fe=>{var ge,be;const xe=fe.target;if(!(xe.tagName==="INPUT"||xe.tagName==="TEXTAREA"||xe.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 Ae=ae.current.filter(Be=>Be!=="root");if(Ae.length===0)return;const Ie=i.current;for(const Be of Ae){const Oe=(ge=Ie==null?void 0:Ie.getElementById(Be))==null?void 0:ge.data();(be=o.onNodeDelete)==null||be.call(o,Be,Oe||{})}u([])}};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[p,m,g,E,b,s.disableKeyboardShortcuts,o,u,i]),Re.useEffect(()=>()=>{if(i.current)try{i.current.removeAllListeners()}catch{}},[]);const te=Re.useMemo(()=>_?300:r.length>50?150:r.length>20?100:50,[r.length,_]),ce=Re.useMemo(()=>{var fe;const U=new Set;for(const xe of r)(fe=xe.data)!=null&&fe.parent&&U.add(xe.data.parent);return U},[r]),_e=Re.useMemo(()=>{var fe;const U=new Map;for(const xe of e)(fe=xe.data)!=null&&fe.source&&!U.has(xe.data.source)&&U.set(xe.data.source,xe.data);return U},[e]),ve=s.backgroundPattern||"dot";return ue.jsx(oq,{pattern:ve,backgroundColor:s.backgroundColor,children:ue.jsx(ye.Box,{ref:C,padding:0,width:"100%",height:"100%",flex:1,position:"relative",children:ue.jsxs(EW,{cyParams:Y,layoutParams:le,layoutDebounce:te,onCyInit:U=>{var xe;i.current=U,(xe=o.onCyInit)==null||xe.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 Ae;const be=ge.target;c(be.id()),(Ae=o.onEdgeSelect)==null||Ae.call(o,be.id(),be.data())}),U.on("unselect","edge",()=>{var ge;c(null),(ge=o.onEdgeDeselect)==null||ge.call(o)}),U.on("remove","edge",ge=>{var Ae;const be=ge.target;(Ae=o.onEdgeRemove)==null||Ae.call(o,be.id(),be.data())}),U.on("tap",":parent",ge=>{var Ae;const be=ge.target;u([be.id()]),(Ae=o.onNodeSelect)==null||Ae.call(o,be.id(),be.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:()=>({})},be=U.edgehandles(ge);T.current=be,Q.current&&be.enableDrawMode();let Ae=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))Ae={x:He.clientX,y:He.clientY};else{const Ve=Oe.renderedPosition();Ae={x:Ve.x,y:Ve.y}}}),U.on("ehcancel",Be=>{if(!Ae||!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-Ae.x),er=Math.abs(Ve-Ae.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})}}Ae=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",()=>{Ae=null,Ie=null})}},children:[(r||[]).map(U=>{var Ie,Be,Oe,He,Ve,Xe,er,$e,ke;const fe=s.customViews||dq,xe=ce.has((Ie=U.data)==null?void 0:Ie.id)&&!((Be=U.data)!=null&&Be.parent),ge=xe?((Oe=U.data)==null?void 0:Oe.label)||((He=U.data)==null?void 0:He.headerTitle)||"Container":void 0,be=xe?fe.parentContainer:fe[U==null?void 0:U.data.type]||fe.text,Ae=_e.get((Ve=U.data)==null?void 0:Ve.id);return ue.jsx(CW,{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:Re.createElement(be,{...U,isInverted:Ae==null?void 0:Ae.isInverted,isParent:xe,key:`${($e=U.data)==null?void 0:$e.id}-${t}`})},(ke=U.data)==null?void 0:ke.id)}),(e||[]).map(({data:U})=>ue.jsx(gq,{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,xe,ge)=>V(fe,xe,ge,U)},U==null?void 0:U.id))]})})})},RW=Re.memo(TW);var Wo=(r=>(r.TOP_DOWN="TB",r.BOTTOM_UP="BT",r.LEFT_RIGHT="LR",r.RIGHT_LEFT="RL",r.CENTER="C",r))(Wo||{});const AW=[{value:"BT",label:"Bottom to Up",icon:Ir.PiArrowUpLight,flowType:Wo.BOTTOM_UP},{value:"TB",label:"Top to Bottom",icon:Ir.PiArrowDownLight,flowType:Wo.TOP_DOWN},{value:"LR",label:"Left to Right",icon:Ir.PiArrowArcRightLight,flowType:Wo.LEFT_RIGHT},{value:"RL",label:"Right to Left",icon:Ir.PiArrowArcLeftLight,flowType:Wo.RIGHT_LEFT}],KP=()=>{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}=Ia(),T=C.colorMode==="dark",{background:S,border:_,colorInactive:A,colorText:P,colorActive:D,darkBackgroundSecondary:I}=ls(),[k,M]=Re.useState(!0),[N,z]=Re.useState(!1),[W,q]=Re.useState(!0),[$,X]=Re.useState(!1),[Y,K]=Re.useState(!1);Re.useEffect(()=>{const te=()=>q(window.innerWidth>=768);return te(),window.addEventListener("resize",te),()=>window.removeEventListener("resize",te)},[]),Re.useEffect(()=>{if(!W){M(!0);return}if(!b){M(!1);return}const te=_e=>{M(window.innerHeight-_e.clientY<=250)},ce=()=>M(!1);return window.addEventListener("mousemove",te),window.addEventListener("mouseleave",ce),()=>{window.removeEventListener("mousemove",te),window.removeEventListener("mouseleave",ce)}},[W,b]);const ee=Re.useCallback(te=>{const ce=r.current;if(!ce)return;const _e=C.minZoom??.01,ve=C.maxZoom??1.5,U=.02,fe=ce.zoomingEnabled(),xe=ce.userZoomingEnabled();ce.zoomingEnabled(!0),ce.userZoomingEnabled(!0);let ge=ce.zoom();switch(te){case"increase":ge=Math.min(ve,ge+U),ce.zoom(ge),ce.center();break;case"decrease":ge=Math.max(_e,ge-U),ce.zoom(ge),ce.center();break;case"reset":ce.fit(void 0,50);break}ce.zoomingEnabled(fe),ce.userZoomingEnabled(xe)},[r,C.minZoom,C.maxZoom]),le=k||N,G=C.renderSelectedNodeToolbar,V=n.length>0&&!!G,j=Re.useMemo(()=>{if(!V)return[];const te=r.current;return te?n.map(ce=>{const _e=te.getElementById(ce);return _e!=null&&_e.length?{..._e.data(),isParent:_e.isParent()}:{id:ce}}):[]},[V,n,r]),re=Re.useCallback(()=>{var te;a([]),(te=x.onNodeDeselect)==null||te.call(x)},[a,x]),de=C.renderSelectedEdgeToolbar,se=!!i&&!!de,Z=Re.useMemo(()=>{if(!se||!i)return null;const te=r.current;if(!te)return{id:i};const ce=te.getElementById(i);return ce!=null&&ce.length?ce.data():{id:i}},[se,i,r]),Q=Re.useCallback(()=>{var ce;o(null);const te=r.current;te&&te.edges().unselect(),(ce=x.onEdgeDeselect)==null||ce.call(x)},[o,r,x]),ae=C.renderBottomBar;return ae?ue.jsxs(ue.Fragment,{children:[V&&ue.jsx(ye.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:G({selectedNodeIds:n,selectedNodeData:j,onDeselect:re})}),se&&Z&&ue.jsx(ye.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:Z,onDeselect:Q})}),ue.jsx(ye.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(ye.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:G({selectedNodeIds:n,selectedNodeData:j,onDeselect:re})}),se&&Z&&ue.jsx(ye.Box,{position:"absolute",bottom:5,left:"50%",transform:"translateX(-50%)",zIndex:101,children:de({edgeId:i,edgeData:Z,onDeselect:Q})}),!b&&ue.jsx(ye.Box,{position:"absolute",bottom:5,left:0,zIndex:101,w:3,children:ue.jsx(ye.Tooltip,{label:"Show Bottom Bar",placement:"top",fontSize:"xs",children:ue.jsx(ye.Flex,{align:"center",bg:S,borderColor:_,borderWidth:1,py:6,px:0,w:4,h:50,borderRadius:"15px",borderLeftRadius:0,onMouseEnter:()=>{z(!0),M(!0)},onMouseLeave:()=>z(!1),_hover:{bg:I},children:ue.jsx(ye.Icon,{ml:-1,as:Ir.PiLineVerticalBold,boxSize:5,color:_})})})}),ue.jsx(ye.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||M(!0)},onMouseLeave:()=>{b||(M(!1),z(!1))},children:ue.jsxs(ye.Flex,{w:"100%",px:5,position:"absolute",bottom:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[ue.jsx(ye.Box,{bg:S,alignContent:"center",h:50,borderColor:_,borderWidth:1,borderRadius:"15px",children:ue.jsxs(ye.HStack,{px:2,spacing:1,children:[ue.jsx(ye.Tooltip,{label:b?"Unpin":"Pin",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Pin",icon:ue.jsx(ye.Icon,{as:b?Ir.PiPushPinFill:Ir.PiPushPin,boxSize:5}),size:"sm",variant:"ghost",color:b?e:A,onClick:()=>{const te=!b;w(te),M(te)}})}),ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:"Zoom Out",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Zoom out",icon:ue.jsx(ye.Icon,{as:tq.HiMinus,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("decrease")})}),ue.jsx(ye.Tooltip,{label:"Zoom In",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Zoom in",icon:ue.jsx(ye.Icon,{as:gu.VscAdd,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("increase")})}),ue.jsx(ye.Tooltip,{label:"Reset Zoom",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Reset zoom",icon:ue.jsx(ye.Icon,{as:nq.GrPowerReset,boxSize:5}),size:"sm",variant:"ghost",color:P,onClick:()=>ee("reset")})}),!Y&&ue.jsxs(ue.Fragment,{children:[ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:s?"Zoom Mode (z)":"Pan Mode (z)",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Toggle zoom mode",icon:ue.jsx(ye.Icon,{as:s?gu.VscZoomIn:gu.VscMove,boxSize:5}),size:"sm",variant:"ghost",color:s?e:A,onClick:()=>l(!s)})}),ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:u?"Multi-Select On (m)":"Multi-Select Off (m)",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Toggle multi-select",icon:ue.jsx(ye.Icon,{as:gu.VscGroupByRefType,boxSize:5}),size:"sm",variant:"ghost",color:u?e:A,onClick:()=>c(!u)})}),ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:d?"Drag Mode On (d)":"Drag Mode Off (d)",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Toggle drag mode",icon:ue.jsx(ye.Icon,{as:Ir.PiHandGrabbing,boxSize:5}),size:"sm",variant:"ghost",color:d?e:A,onClick:()=>h(!d)})}),C.edgeHandles!==!1&&ue.jsxs(ue.Fragment,{children:[ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:g?"Draw Mode On":"Draw Mode Off",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Toggle draw mode",icon:ue.jsx(ye.Icon,{as:Ir.PiPencilSimpleLine,boxSize:5}),size:"sm",variant:"ghost",color:g?e:A,onClick:()=>p(!g)})})]}),ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:E?"List mode":"Set mode",placement:"top",fontSize:"xs",children:ue.jsx(ye.Flex,{cursor:"pointer",align:"center",onClick:()=>{var ce;const te=!E;m(te),(ce=x.onArrayModeChange)==null||ce.call(x,te)},_hover:{color:e},children:ue.jsx(ye.Text,{fontSize:"23px",color:E?e:A,children:E?"[]":"{}"})})})]}),ue.jsx(ye.Icon,{mx:-1,as:Ir.PiLineVerticalThin,boxSize:5,color:_}),ue.jsx(ye.Tooltip,{label:Y?"Expand toolbar":"Collapse toolbar",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Toggle toolbar collapse",icon:ue.jsx(ye.Icon,{as:Y?Ir.PiCaretRight:Ir.PiCaretLeft,boxSize:5}),size:"sm",variant:"ghost",color:A,onClick:()=>K(!Y)})})]})}),ue.jsxs(ye.Box,{position:"relative",ml:"auto",children:[ue.jsx(ye.Box,{bg:S,borderWidth:1,borderColor:_,borderRadius:"15px",h:50,px:3,cursor:"pointer",onClick:()=>X(!$),children:ue.jsxs(ye.Flex,{align:"center",h:"100%",children:[ue.jsx(ye.Tooltip,{label:"Flow Direction",placement:"top",fontSize:"xs",children:ue.jsx(ye.IconButton,{"aria-label":"Direction",icon:ue.jsx(ye.Icon,{as:Ir.PiCaretUp,boxSize:4}),size:"sm",variant:"ghost",color:A})}),ue.jsx(ye.Text,{fontSize:"xs",color:T?"whiteAlpha.600":"blackAlpha.500",ml:1,children:t})]})}),$&&ue.jsxs(ye.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:[AW.map(te=>ue.jsxs(ye.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var ce;(ce=x.onDirectionChange)==null||ce.call(x,te.value),X(!1)},children:[ue.jsx(ye.Icon,{as:te.icon,boxSize:5,color:P}),ue.jsx(ye.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:te.label}),t===te.value&&ue.jsx(ye.Icon,{as:q1.IoCheckmark,boxSize:4,color:D})]},te.value)),ue.jsxs(ye.Flex,{align:"center",gap:3,px:3,py:2,borderRadius:"10px",cursor:"pointer",_hover:{bg:T?"whiteAlpha.100":"blackAlpha.50"},onClick:()=>{var te;(te=x.onDirectionChange)==null||te.call(x,"LR"),X(!1)},children:[ue.jsx(ye.Icon,{as:aq.TbAlignCenter,boxSize:5,color:P}),ue.jsx(ye.Text,{fontSize:"sm",color:P,flex:1,whiteSpace:"nowrap",children:"Center"}),t==="C"&&ue.jsx(ye.Icon,{as:q1.IoCheckmark,boxSize:4,color:D})]})]})]})]})})]})};KP.displayName="BottomBar";const PW=Re.memo(KP),DW=".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 $2=!1;function IW(){if($2||typeof document>"u")return;const r=document.createElement("style");r.setAttribute("data-flow-sdk",""),r.textContent=DW,document.head.appendChild(r),$2=!0}function BW({title:r="untitled",nodes:e,edges:t,config:n={},callbacks:a={},className:i,style:o,showBottomBar:s=!0}){IW();const l=e||[],u=t||[];return ue.jsx(iq,{config:n,callbacks:a,children:ue.jsxs(ye.Box,{className:i,style:o,width:"100%",height:"100%",position:"relative",overflow:"hidden",children:[ue.jsx(RW,{nodes:l,edges:u}),s&&ue.jsx(PW,{})]})})}const Gl={label:"Untitled",description:"",isTask:!1,isLocked:!1},p0={id:null,type:"text",data:{...Gl,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"}}},V2={id:null,type:"objectView",data:{...Gl,headerTitle:null,viewProps:{width:"100%",borderWidth:2,borderRadius:25,height:"100%",justifyContent:"space-between",flexDirection:"row",textColor:"gray.900"}}},MW={id:null,type:"arrayView",data:{...Gl,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"}}},G2={id:null,type:"workflowStep",data:{...Gl,viewProps:{width:"max-content !important",maxWidth:350,minWidth:280,height:"100%",borderRadius:15,borderWidth:3}}};let Pu;const kW=new Uint8Array(16);function LW(){if(!Pu&&(Pu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pu(kW)}const vt=[];for(let r=0;r<256;++r)vt.push((r+256).toString(16).slice(1));function OW(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 qW=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),W2={randomUUID:qW};function NW(r,e,t){if(W2.randomUUID&&!r)return W2.randomUUID();r=r||{};const n=r.random||(r.rng||LW)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,OW(n)}const Zt=r=>typeof r=="object",jP=r=>Array.isArray(r),FW=["order","position","selected","locked","grabbed","grabbable","scratch"],Aa=r=>Object.entries(r).reduce((e,[t,n])=>(!Zt(n)&&!t.startsWith("$")&&(e[t]=n),e),{}),y0=(r,e)=>typeof r=="string"&&r.startsWith("$")?im(r,e):Zt(r)&&!jP(r)?Object.entries(r).reduce((t,[n,a])=>(typeof a=="string"&&a.startsWith("$")&&n==="..."?(delete t["..."],t[n]={...im(a,e),...r}):typeof a=="string"&&a.startsWith("$")?t[n]=im(a,e):t[n]=a,t),{}):r,Pa=r=>Object.entries(r).reduce((e,[t,n])=>(Zt(n)&&t&&n&&!t.startsWith("$")&&(FW.includes(t)&&(t=t+"#"),e[t]=n),e),{}),ri=(r,e,{label:t,parent:n=void 0},a,i=null)=>(i!==null&&(Zt(i)||jP(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}}),ba=(r,e,t=null,n=null,a=null,i=!1,o=null)=>({data:{id:NW(),source:a?e:r,target:a?r:e,label:n||"",isInverted:a,isEdgeAnimated:i,parent:o}}),Da=(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}},Hi=(r,e)=>{let t=V2;const{view:n,borderColor:a,borderRadius:i,bgColor:o,textColor:s,fontSize:l,stepType:u}=e;r=n||r,u?t={...G2}:r==="object"?t=V2:r==="text"?t=p0:r==="array"?t=MW:r==="workflowStep"&&(t={...G2});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}},ss=(r,e)=>(r=e.find(n=>n.data.id===r)?`${r}.#`:r,r),im=(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=zW(a,t);return JSON.stringify(i).includes(r)?r:i||r}return r},zW=(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}=Da(o);return o=l.length?l:o,o[s]},i))(e)};function Xi(r,e="root",t=[]){try{const{arrayObject:n}=Da(r);n.length&&(r=n);const a=Aa(r),i=Pa(r);return Zt(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)?jo({chldPth:null,itrblObjct:i,nodes:t,path:e}):hr.isArray(r)&&r.forEach((o,s)=>{const l=Aa(o),u=Pa(o),{newConfig:c,arrayObject:d}=Da(o);let h=`${e}.${s}`;Zt(o)?Object.keys(l).length?(Xi(l,h,t),Object.keys(u).length&&!hr.isArray(o)&&jo({chldPth:h,itrblObjct:u,nodes:t,path:e})):Object.keys(u).length&&!hr.isArray(o)?jo({chldPth:h,itrblObjct:u,nodes:t,path:e}):hr.isArray(o)&&YP({chldPth:h,item:o,nodes:t,path:e}):t.push(h)}),{nodes:t}}catch{return{nodes:t}}}const jo=({chldPth:r,itrblObjct:e,nodes:t,path:n})=>Object.entries(e).forEach(([a,i],o)=>{const s=Aa(i),l=Pa(i),{newConfig:u,arrayObject:c}=Da(i);c.length&&(i=c),n.split(".").slice(0,2).join(".");let d=r?`${r}.${a}`:`${n}.${a}`;if(Zt(i)&&!hr.isArray(i)){const h=Object.keys(s).length===0;if(h&&(Hi("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}`),Xi(i,p,t)}else Object.keys(l).length&&!hr.isArray(i)?jo({chldPth:d,itrblObjct:l,path:d,nodes:t}):Xi(i,d,t)}else hr.isArray(i)&&Xi(i,d,t)}),YP=({chldPth:r,item:e,nodes:t,path:n})=>e.forEach((a,i)=>{let o=`${r}.${i}`;const s=Pa(a),l=Aa(a);Zt(a)?!hr.isArray(a)&&Object.keys(l).length?Xi(a,o,t):Object.keys(s).length&&!hr.isArray(a)?jo({chldPth:o,itrblObjct:s,path:n,nodes:t}):hr.isArray(a)&&YP({chldPth:o,item:a,nodes:t,path:n}):t.push(o)}),il=[];let Yo;function Qi(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(!Yo){const{nodes:c}=Xi(r);Yo={ids:c,jsnObjct:r}}let{hideDefaultObject:l,sprtObjctKy:u}=i;try{e=ss(e,t);const{newConfig:c,arrayObject:d}=Da(r),h=Object.keys(o).length>0?o:c;d.length&&(r=d);const g=Aa(r),p=Pa(r),{label:E,collapsed:m,parent:b}=h;if(!Zt(r))t.push(ri(p0,e,{label:E||e,parent:b},r,s));else if(hr.isArray(r)||hr.isArray(r)&&e==="root"){const{config:w}=Hi("array",h),x=hr.isArray(r)?`${r.length||""}`:`{${Object.keys(r).length||""}}`,C=e==="root"?a:`${a} ${x}`;t.push(ri(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}=Hi(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}=Hi("object",h);t.push(ri(I,e,{label:E||`${E} ${x}`,parent:b},g,D))}else w.data.headerTitle=A,t.push(ri(w,e,{label:E,parent:b},g,D))}return m||(Object.keys(p).length&&!hr.isArray(r)?Zo({flowConfig:i,chldPth:null,edges:n,isInverted:null,itrblObjct:p,nodes:t,path:e,newConfig:h}):hr.isArray(r)&&r.forEach((w,x)=>{w=y0(w,Yo);const C=w,T=Aa(w),S=Pa(w),{newConfig:_,arrayObject:A}=Da(w);A.length&&(w=A);const{config:P}=Hi(typeof w=="string"?"text":"array",_),{hideConfig:D,sourceLabel:I,label:k,isEdgeAnimated:M,parent:N}=_;l=l||D;const z=e==="root"&&i.isCntr,W=e.split(".").slice(0,2).join("."),q=il.includes(W),$=i.isCntr&&q||x%2===0&&z;let X=`${e}.${x}`;X=ss(X,t),$&&il.push(X),Zt(w)?Object.keys(T).length&&!hr.isArray(w)?(n.push(ba(e,X,null,I,$,M)),Qi(w,X,t,n,k||x,i,_)):Object.keys(S).length&&!hr.isArray(w)?Zo({flowConfig:i,chldPth:X,isInverted:$,edges:n,itrblObjct:S,nodes:t,path:e,newConfig:_,forceIsInverted:!0}):hr.isArray(w)?ZP({flowConfig:i,chldPth:X,edges:n,isInverted:$,item:w,nodes:t,path:e}):Zt(w)&&Zo({flowConfig:i,chldPth:X,isInverted:$,edges:n,itrblObjct:[w],nodes:t,path:e,newConfig:_}):(n.push(ba(e,X,null,I,$,M)),t.push(ri(P,X,{label:k||String(w),parent:N},w,C)))})),{nodes:t,edges:n}}catch{return{nodes:t,edges:n}}}const Zo=({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=y0(h,Yo);const p=h,E=Aa(h),m=Pa(h),{newConfig:b,arrayObject:w}=Da(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 k=o==="root"&&e.isCntr,M=o.split(".").slice(0,2).join("."),N=il.includes(M);l||(i=e.isCntr&&N||g%2===0&&k);let z=r?`${r}.${d}`:`${o}.${d}`;if(z=ss(z,a),i&&il.push(z),_&&t.push(ba(z,_,null,A,i,D)),Zt(h)&&!hr.isArray(h)){t.push(ba(o,z,null,C,i,D));const W=c||Object.keys(E).length===0;if(W){const q=S?"object":"array",{config:$}=Hi(q,b);$.data.headerTitle=S?T:null,a.push(ri($,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}`,$=ss($,a),t.push(ba(z,$,null,C,i,D))),Qi(h,$,a,t,T||d,e,b)}else Object.keys(m).length&&!hr.isArray(h)?Zo({chldPth:z,flowConfig:e,itrblObjct:m,path:z,edges:t,nodes:a,newConfig:b,isInverted:i}):Qi(h,z,a,t,d,e,b)}else hr.isArray(h)&&(t.push(ba(o,z,null,C,i,D)),Qi(h,z,a,t,d,e,b))})},ZP=({flowConfig:r,chldPth:e,edges:t,isInverted:n,item:a,nodes:i,path:o})=>a.forEach((s,l)=>{let u=`${e}.${l}`;u=ss(u,i);const c=s;s=y0(s,Yo);const d=Pa(s),h=Aa(s),{newConfig:g}=Da(s),{collapsed:p,label:E,parent:m,sourceLabel:b,isEdgeAnimated:w,content:x}=g;Zt(s)?!hr.isArray(s)&&Object.keys(h).length?(t.push(ba(o,u,null,b,n,w)),Qi(s,u,i,t,l,r,g)):Object.keys(d).length&&!hr.isArray(s)&&!p?Zo({chldPth:u,flowConfig:r,itrblObjct:d,path:o,edges:t,nodes:i,isInverted:n,newConfig:g}):hr.isArray(s)&&ZP({flowConfig:r,chldPth:u,edges:t,isInverted:n,item:s,nodes:i,path:o}):(t.push(ba(o,u,null,b,n,w)),i.push(ri(p0,u,{label:E||String(s),parent:m},s,c)))});exports.DynamicIcon=Tm;exports.FlowDiagram=BW;exports.contentObjTheme=Dn;exports.createFlowDiagram=Qi;exports.getChakraColorHex=ht;exports.getColorVariant=H2;exports.getDarkerHexColor=Gu;exports.useCustomColors=ls;exports.useStopPropagation=K2;exports.useThemeContentColors=us;
|
|
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;
|
|
358
358
|
//# sourceMappingURL=index.cjs.map
|