From 6419f737ebbcebcfae59127ffba97c446ca25ea9 Mon Sep 17 00:00:00 2001 From: Pedro Rico Pinazo Date: Fri, 22 Nov 2024 17:21:51 +0000 Subject: [PATCH] add saved-graphs route to python server --- Cargo.lock | 39 ++++++++++++++++++++++++--- Cargo.toml | 4 +-- raphtory-graphql/resources/index.html | 2 +- raphtory-graphql/src/server.rs | 1 + 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 566dc672d..83d7845d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,6 +72,7 @@ dependencies = [ "const-random", "getrandom", "once_cell", + "serde", "version_check", "zerocopy", ] @@ -4413,6 +4414,38 @@ dependencies = [ name = "pometry-storage" version = "0.13.1" +[[package]] +name = "pometry-storage-private" +version = "0.12.1" +dependencies = [ + "ahash", + "bincode", + "bytemuck", + "criterion", + "itertools 0.12.1", + "memmap2 0.9.5", + "once_cell", + "parking_lot", + "polars-arrow", + "polars-core", + "polars-io", + "polars-parquet", + "polars-utils", + "pretty_assertions", + "proptest", + "rand", + "raphtory-api", + "rayon", + "serde", + "serde_json", + "strum", + "tempfile", + "thiserror 1.0.68", + "tracing", + "tracing-subscriber", + "twox-hash", +] + [[package]] name = "portable-atomic" version = "1.9.0" @@ -4847,7 +4880,7 @@ dependencies = [ "polars-core", "polars-io", "polars-parquet", - "pometry-storage", + "pometry-storage-private", "pretty_assertions", "proptest", "prost", @@ -4909,7 +4942,7 @@ dependencies = [ "criterion", "csv", "flate2", - "pometry-storage", + "pometry-storage-private", "rand", "raphtory", "raphtory-api", @@ -4936,7 +4969,7 @@ dependencies = [ "pest", "pest_derive", "polars-arrow", - "pometry-storage", + "pometry-storage-private", "pretty_assertions", "proptest", "raphtory", diff --git a/Cargo.toml b/Cargo.toml index 8c14d8e66..f1f4adcd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,9 +40,9 @@ debug = 0 [workspace.dependencies] #[public-storage] -pometry-storage = { version = ">=0.8.1", path = "pometry-storage" } +# pometry-storage = { version = ">=0.8.1", path = "pometry-storage" } #[private-storage] -# pometry-storage = { path = "pometry-storage-private", package = "pometry-storage-private" } +pometry-storage = { path = "pometry-storage-private", package = "pometry-storage-private" } async-graphql = { version = ">=7.0.5, <7.0.8", features = [ "dynamic-schema", ] } # 7.0.8+ is borked, see https://github.com/async-graphql/async-graphql/issues/1586 diff --git a/raphtory-graphql/resources/index.html b/raphtory-graphql/resources/index.html index 34b3765a4..4115d06cd 100644 --- a/raphtory-graphql/resources/index.html +++ b/raphtory-graphql/resources/index.html @@ -803,7 +803,7 @@ 57% { transform: scale(1,1) translateX(3px); } 64% { transform: scale(1,1) translateX(0); } 100% { transform: scale(1,1) translateX(0); } -`,aun=`${iun} 2s 1 cubic-bezier(0.280, 0.840, 0.420, 1)`,sun=`${oun} 2s 1 cubic-bezier(0.280, 0.840, 0.420, 1)`,lun=({centerDomainAroundTime:e,scope:{nearestStart:t,nearestEnd:n,noInfo:r}})=>{if(r){const i=t!==void 0?k.jsx(vr,{onClick:()=>e(t),children:k.jsx(Kn,{icon:tjt,style:{transformOrigin:"right",animation:aun}})}):k.jsx(lr,{}),o=n!==void 0?k.jsx(vr,{onClick:()=>e(n),children:k.jsx(Kn,{icon:xSe,style:{transformOrigin:"left",animation:sun}})}):k.jsx(lr,{});return k.jsxs(lr,{sx:{display:"flex",justifyContent:"space-between",direction:"ltr","& > button":{pointerEvents:"all"}},children:[i,o]})}else return null},uun={fill:"gray"},zS=e=>e.end.getTime()-e.start.getTime();function sI(e){var r;const t=(r=e==null?void 0:e.style)==null?void 0:r.fill;return typeof t=="string"?t:uun.fill}var cun=({buckets:e,originalNodes:t,opacity:n,nodeHeight:r,xScale:i,yScale:o})=>k.jsx(k.Fragment,{children:e.map(a=>{const s=a.node+a.time.getTime(),l=i(a.time);return k.jsx("line",{x1:l>0?l:0,x2:i(a.end),y1:o(a.node),y2:o(a.node),style:{strokeWidth:r,stroke:sI(t.get(a.node)),strokeOpacity:n}},s)})}),lI=3,Rve=20,Ave=2,Dve=lI+3,dun=({edges:e,originalNodes:t,opacity:n,hoveredElement:r,setHoveredElement:i,xScale:o,yScale:a})=>{const s=()=>i(void 0);return M.useMemo(()=>e.map(u=>{const c=o(u.time),d="translate("+c+",0 )",f=c>Rve?1:c/Rve,h=a(u.src.id),p=a(u.dst.id),g=sI(t.get(u.src.id)),y=sI(t.get(u.dst.id)),v=(u.src.id+"->"+u.dst.id+"_"+u.layer+"_"+u.time.getTime()).replaceAll(" ",""),b="linear-gradient-"+v,x="arrowhead-"+v;return{edge:u,transform:d,srcY:h,dstY:p,srcColor:g,dstColor:y,id:v,linearGradientId:b,arrowheadId:x,fadingOutOpacity:f}}),[e,t,o,a]).map(({edge:u,id:c,transform:d,srcY:f,dstY:h,srcColor:p,dstColor:g,fadingOutOpacity:y,arrowheadId:v,linearGradientId:b})=>k.jsxs("g",{transform:d,style:{strokeOpacity:y*n,fillOpacity:y*n},children:[k.jsx("defs",{children:k.jsx("marker",{id:v,markerWidth:"10",markerHeight:"10",refX:"4",refY:"2",orient:"auto",children:k.jsx("path",{d:"M0,0 L0,4 L4,2 Z",style:{fill:g}})})}),k.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:b,x1:0,x2:0,y1:f,y2:h,children:[k.jsx("stop",{offset:"0%",stopColor:p}),k.jsx("stop",{offset:"100%",stopColor:g})]}),c===(r==null?void 0:r.id)&&k.jsxs(k.Fragment,{children:[k.jsx("line",{y1:f,y2:h,style:{stroke:`url(#${b})`,strokeWidth:Ave+4,strokeOpacity:.5}}),k.jsx("circle",{cy:f,r:Dve,style:{fill:p,fillOpacity:.5}}),k.jsx("circle",{cy:h,r:Dve,style:{fill:g,fillOpacity:.5}})]}),k.jsx("circle",{cy:f,r:lI,style:{fill:p}}),k.jsx("circle",{cy:h,r:lI,style:{fill:g}}),k.jsx("line",{y1:f,y2:h,markerEnd:`url(#${v})`,style:{stroke:`url(#${b})`,strokeWidth:Ave}}),k.jsx("line",{onMouseEnter:()=>i({type:"edge",id:c,...u,src:u.src.displayName,dst:u.dst.displayName}),onMouseLeave:s,y1:f,y2:h,style:{stroke:"red",strokeOpacity:0,strokeWidth:8}})]},c))},fun=({nodeNames:e,selectedNodes:t,originalNodes:n,yScale:r,canvasWidth:i})=>{const o=Bi(),a=t.size===0?o.palette.grey[500]:o.palette.grey[400],s=e.map(l=>[l,r(l)??0]);return k.jsx("g",{children:s.map(([l,u])=>{var f,h;let c=(h=(f=n.get(l))==null?void 0:f.style)==null?void 0:h.iconSrc;typeof c!="string"&&(c=void 0);const d=t.has(l);return k.jsxs("g",{transform:"translate(0,"+u+")",children:[k.jsx("line",{x2:i,style:{stroke:d?o.palette.primary.main:o.palette.grey[300],strokeWidth:1}}),c!==void 0&&k.jsxs(k.Fragment,{children:[k.jsx("circle",{r:7,style:{fill:d?o.palette.primary.main:a}}),k.jsx("image",{x:"-5",y:"-5",width:"10",height:"10",href:c})]})]},l)})})},hun=({scope:e,selectedNodes:t})=>{if(e.noInfo){const r=e.nearestStart!==void 0||e.nearestEnd!==void 0?"No information available for this time window, please use the arrow buttons or reset the view":t?"No information available for the selected node, please expand it":"No information available, please expand a node";return k.jsx(lr,{sx:{alignSelf:"center"},children:k.jsx(_r,{children:r})})}else return null},WC=lI+1,pun=({events:e,originalNodes:t,opacity:n,hoveredElement:r,setHoveredElement:i,xScale:o,yScale:a})=>{const s=e.map(c=>({prop:c.prop,node:c.node.id,key:`${c.node.id}-${c.prop}-${c.time.getTime()}`,time:c.time,color:sI(t.get(c.node.id)),value:c.value,x1:Math.max(o(c.time),0),x2:c.end!==void 0?o(c.end):void 0})),l=new Map;for(const c of s){const d=l.get(c.node)??[];l.set(c.node,[...d,c])}const u=[...l.values()].flatMap(c=>c.map((d,f)=>{var v,b;const h=f>0?(v=c.at(f-1))==null?void 0:v.x1:void 0,p=h===void 0||d.x1-h>80,g=(b=c.at(f+1))==null?void 0:b.x1,y=g===void 0||g-d.x1>80;return{...d,showText:p&&y}}));return k.jsx(k.Fragment,{children:u.map(({node:c,prop:d,key:f,time:h,color:p,value:g,x1:y,x2:v})=>k.jsxs("g",{transform:"translate(0,"+a(c)+")",strokeOpacity:n,fillOpacity:n,children:[(r==null?void 0:r.id)===f&&k.jsx("circle",{cx:y,r:WC+3,style:{fill:p,fillOpacity:.5}}),k.jsx("circle",{cx:y,r:WC,style:{fill:p}}),v!==void 0&&k.jsxs(k.Fragment,{children:[(r==null?void 0:r.id)===f&&k.jsx("line",{x1:y,x2:v,style:{stroke:p,strokeWidth:6,strokeOpacity:.5}}),k.jsx("line",{x1:y,x2:v,style:{stroke:p,strokeWidth:3}}),k.jsx("circle",{cx:v,r:WC,style:{fill:p}})]}),k.jsx("line",{onMouseEnter:()=>{i({type:"prop",id:f,node:c,time:h,prop:d,value:g})},onMouseLeave:()=>i(void 0),x1:y-2*WC,x2:(v??y)+2*WC,style:{stroke:"red",strokeWidth:20,strokeOpacity:0}})]},f))})},rz=({onClick:e,title:t,children:n})=>k.jsx(xi,{arrow:!0,title:t,placement:"top",children:k.jsx(vr,{onClick:e,sx:{padding:r=>r.spacing(.5),borderRadius:0},children:n})}),gun=({hideEdges:e,setHideEdges:t,resetView:n,fitView:r})=>k.jsxs(lr,{sx:i=>({alignSelf:"flex-end",backgroundColor:i.palette.grey[200],height:i.spacing(3.5),pointerEvents:"all"}),children:[k.jsx(rz,{title:e?"Show edges":"Hide edges",onClick:()=>t(!e),children:e?k.jsx(Kn,{icon:ojt,fontSize:20}):k.jsx(Kn,{icon:sjt,fontSize:20})}),k.jsx(rz,{title:"Reset view",onClick:n,children:k.jsx(Kn,{icon:Vke,fontSize:20})}),k.jsx(rz,{title:"Fit view",onClick:r,children:k.jsx(Kn,{icon:rjt,fontSize:20})})]}),mun=e=>e.type==="prop"?`${e.prop} changed to ${e.value} for ${e.node}`:e.type==="edge"?`Interaction between ${e.src} and ${e.dst}.`:"unknown activity",vun=e=>e.slice(0,1).toUpperCase()+e.slice(1),yun=({x:e,y:t,type:n,hoveredElement:r,description:i})=>{const o=n==="edge",a=o?"edge-tooltip":"prop-tooltip",s=i?i(r):mun(r),l=vun(s);return k.jsx("div",{id:a,style:{position:"absolute",top:t,left:e,transform:o?"translateY(-50%)":"translateX(-50%) translateY(-100%) translateY(-12px)",maxWidth:"30em",height:"fit-content",marginLeft:o?"12px":void 0,zIndex:"100",padding:"1em",boxSizing:"border-box",background:"#fff",border:"1px solid #fafafa",boxShadow:"0 0 3px 1px rgba(0, 0, 0, 0.2)",borderRadius:"5px",fontSize:"12px"},children:k.jsxs(ti,{direction:"column",spacing:"0.2rem",children:[k.jsx("span",{children:l}),k.jsxs(ti,{direction:"row",alignItems:"center",spacing:"0.2rem",color:"gray",children:[k.jsx(Kn,{icon:ujt,height:"1rem",width:"1rem"}),k.jsx("span",{children:r.time.toLocaleString()})]})]})})},c5e=5,bun=14,Ive=14,Nve=14,xun=4,wun=()=>{const[e,{width:t,height:n,x:r}]=xS(),[i,{width:o}]=xS(),a=M.useMemo(()=>{const s=c5e+o+bun,l=Ive+Nve+xun;return{svg:{width:t,height:n,left:r},canvas:{width:t-s,height:n-l,left:r+s},xAxis:{height:l,upperHeight:Ive,lowerHeight:Nve},yAxis:{width:s,textWidth:o}}},[t,n,r,o]);return{svgRef:e,yAxisTextRef:i,...a}},Sun=new Date(1970,0,1),Cun=bjt(.25,.1,.25,1),Lve=e=>{const n=zS(e)*.1;return{start:new Date(e.start.getTime()-n),end:new Date(e.end.getTime()+n)}},Eun=({current:e,final:t,fallback:n,setDomain:r})=>{const a=Math.ceil(24),s=(e==null?void 0:e.start.getTime())??n.start.getTime(),l=(e==null?void 0:e.end.getTime())??n.end.getTime(),u=(t==null?void 0:t.start.getTime())??n.start.getTime(),c=(t==null?void 0:t.end.getTime())??n.end.getTime(),f=[...Array(a).keys()].map(y=>y/(a-1)),h=f.map(y=>Cun(y)),p=h.map(y=>new Date(y*u+(1-y)*s)),g=h.map(y=>new Date(y*c+(1-y)*l));N$t(p,g).forEach(([y,v],b)=>{y&&v&&setTimeout(()=>r({start:y,end:v}),b*1e3/60)}),setTimeout(()=>r(t),f.length*1e3/60)},Tun=(e,t,n)=>{var y;const r=e??t,i=200,o=n.delta;if(o===0)return e;const a=o>=0?1+o/i:i/(i-o),s=zS(r),l=zS(t),u=r.start.getTime()+s*n.relativeMousePosition;n.setTimeReference(new Date(u));const c=((y=p$t(n.timesOnScreen,v=>Math.abs(v.getTime()-u)))==null?void 0:y.getTime())??u,d=Math.max(Math.min(l,s*a),100),f=c-r.start.getTime(),h=new Date(r.start.getTime()+f/s*(s-d)),p=new Date(h.getTime()+d),g=new Date;return g.setFullYear(g.getFullYear()+5),h.getTime()>Sun.getTime()&&p.getTime(){const{domain:i,globalDomainWithPadding:o}=M.useMemo(()=>{const h=Lve(e);return{domain:{start:(n==null?void 0:n.start)??h.start,end:(n==null?void 0:n.end)??h.end},globalDomainWithPadding:h}},[n,e]),a=M.useCallback(h=>{r(p=>Tun(p,o,h))},[o,r]),s=M.useCallback(h=>{Eun({current:n,final:h,fallback:o,setDomain:r})},[n,o,r]),l=M.useCallback(()=>{s(void 0)},[s]),u=M.useCallback(h=>{const p=zS(i)/2,g=h.getTime(),y=new Date(g-p),v=new Date(g+p);s({start:y,end:v})},[s,i]),c=M.useCallback(h=>{if(h.length>1){const p=wX(h),g=Kk(h);s(Lve({start:p,end:g}))}else h.length===1&&u(h[0])},[u,s]),d=M.useCallback(h=>{const g=zS(i)*h,y=new Date(i.start.getTime()-g),v=new Date(i.end.getTime()-g);r({start:y,end:v})},[i,r]),f=M.useMemo(()=>bRe().range([0,t]).domain([i.start,i.end]),[t,i]);return{resetDomain:l,fitDomain:c,centerDomainAroundTime:u,updateDomainWithScroll:a,updateDomainWithRelativeOffset:d,xScale:f}},kun=(e,t)=>({mouseDownHandler:M.useCallback(r=>{r.preventDefault();const i=r.screenX,o=l=>{const u=(l.screenX-i)/e;t(u)},a=l=>{o(l)},s=l=>{o(l),window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",a),window.addEventListener("mouseup",s)},[e,t])}),d5e=(e,t)=>{M.useEffect(()=>{const n=e.current;return n==null||n.addEventListener("wheel",t,{passive:!1}),()=>{n==null||n.removeEventListener("wheel",t)}},[t,e])},Fve=(e,t)=>Math.max(Math.min(e,t),0),Mun=({canvasHeight:e,minNodeHeight:t,nodeNames:n})=>{const r=e/n.length,i=Math.max(t,r),o=n.length*i,[a,s]=M.useState(0),l=o-e,u=Fve(a,l),c=cRe().domain(n).range([i/2-u,o+i/2-u]),d=M.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(p=>Fve(p,l)+h.deltaY)},[s,l]),f=M.useRef(null);return d5e(f,d),{scrollSensorRef:f,nodeHeight:i,yScale:c}},Pun=[vc.every(1),Rm.every(6),Rm.every(3),Rm.every(1),Km.every(7),Km.every(1),Sg.every(12),Sg.every(6),Sg.every(1),np.every(30),np.every(20),np.every(5),np.every(1),su.every(30),su.every(20),su.every(5),su.every(1),hl.every(200),hl.every(50),hl.every(10),hl.every(1)],Oun=(e,t,n)=>{var o;const r=(o=e.properties)==null?void 0:o.temporal.values,i=n??"name";return r!==void 0?r.flatMap(({key:a,values:s,history:l})=>{const u=l.map(d=>new Date(d)),c=new Date(e.latestTime);return u.map((d,f)=>{var p,g;const h=s.at(f)??"null";return{prop:a,node:{id:e.id,displayName:((g=(p=e.properties)==null?void 0:p.values.find(y=>y.key===i))==null?void 0:g.value)??e.id},time:d,end:t.includes(a)?u.at(f+1)??c:void 0,value:h}})}):[]},Run=(e,t,n,r)=>{const i=new Map(e.map(g=>[g.id,g])),o=t.flatMap(g=>g.layers.flatMap(y=>R9t(y.history).map(v=>({src:g.src,dst:g.dst,time:new Date(v),layer:y.layerName})))),a=e.flatMap(g=>Oun(g,n,r)),s=[...o.map(g=>({node:g.src,time:g.time})),...o.map(g=>({node:g.dst,time:g.time})),...a],l=Lun(s),u=a.flatMap(g=>g!==void 0?[g.time]:[]),c=[...s.map(g=>g.time),...u],d=new Date(wX(c)),f=new Date(Kk(c)),h=[...new Set([...o.map(g=>g.src.id),...o.map(g=>g.dst.id),...a.map(g=>g.node.id)])].map((g,y)=>[g,y]);return{nodeOrder:new Map(h),originalNodes:i,edgeEvents:o,propEvents:a,buckets:l,domain:{start:d,end:f}}},Aun=(e,t,n)=>{if(e>n)return{eventOpacity:0,bucketOpacity:1};if(e{const n=e.filter(r=>r0?Kk(n):void 0},$ve=(e,t)=>{const n=e.filter(r=>r>t);return n.length>0?Kk(n):void 0},Dun=(e,t,n,r)=>{const i=e.map(({time:f})=>f),o=t.map(({time:f})=>f),a=jve(i,n),s=jve(o,n),l=[a,s].flatMap(f=>f!==void 0?[f]:[]),u=$ve(i,r),c=$ve(o,r),d=[u,c].flatMap(f=>f!==void 0?[f]:[]);return{noInfo:!0,nearestStart:l.length>0?Kk(l):void 0,nearestEnd:d.length>0?wX(d):void 0}},Iun=(e,t,n)=>{const r=new Set([...t.flatMap(i=>[i.src.id,i.dst.id]),...n.map(i=>i.node.id)]);return e.filter(i=>r.has(i.node))},Nun=(e,{domain:t,selectedNodes:n,hideEdges:r,minNumIntervals:i,maxNumEvents:o,minNumEvents:a})=>{const{start:s,end:l}=t,u=r?[]:e.edgeEvents,c=u.filter(N=>N.time>=s&&N.time<=l),d=n.size===0?c:c.filter(N=>n.has(N.src.id)||n.has(N.dst.id)),f=e.propEvents.filter(N=>(N.end??N.time)>=s&&N.time<=l),h=n.size===0?f:f.filter(N=>n.has(N.node.id)),p=d.length+h.length,{eventOpacity:g,bucketOpacity:y}=Aun(p,a,o),v=g!==0?d:[],b=g!==0?h:[],x=zS(t)/i,w=[...e.buckets.keys()].filter(N=>N<=x).slice(0).at(0),E=y!==0&&w!==void 0?e.buckets.get(w).filter(N=>N.times):[],C=n.size===0||!r?E:Iun(E,d,h),_=v.length!==0||b.length!==0||C.length!==0?{noInfo:!1,nearestStart:void 0,nearestEnd:void 0}:Dun(u,e.propEvents,s,l),R=[...new Set([...v.map(N=>N.src.id),...v.map(N=>N.dst.id),...b.map(N=>N.node.id),...C.map(N=>N.node)])].sort((N,L)=>e.nodeOrder.get(N)-e.nodeOrder.get(L)),I=new Map(R.map(N=>{var L;return[N,((L=e.originalNodes.get(N))==null?void 0:L.displayName)??N]}));return{nodeNames:R,originalNodes:e.originalNodes,displayNames:I,edgeEvents:v,propEvents:b,buckets:C,eventOpacity:g,bucketOpacity:y,scope:_}},Lun=e=>{const t=new Map;return f5e(t,e,Pun),t},Fun=e=>{const t=new Date(2e3,1,1),n=e.offset(t,1).getTime();return e.offset(t,2).getTime()-n},f5e=(e,t,n)=>{if(n.length>0){const[r,...i]=n,o=jun(t,r);if(o.some(s=>s.size>1)){const s=Fun(r);e.set(s,o),f5e(e,t,i)}}},jun=(e,t)=>[...e.reduce((r,i)=>{const o=t.floor(i.time),a=i.node+"#"+o,s=r.get(a)??{node:i.node.id,time:o,end:t.ceil(i.time),size:0};return s.size+=1,r.set(a,s),r},new Map).values()],$un=(e,t,n,r,i,o,a)=>{const s=JSON.stringify(o),l=M.useDeferredValue({nodes:e,edges:t}),u=M.useMemo(()=>Run(l.nodes,l.edges,JSON.parse(s),a),[l.nodes,l.edges,s,a]),c=M.useMemo(()=>Nun(u,{domain:i??u.domain,selectedNodes:n,hideEdges:r,minNumIntervals:25,maxNumEvents:60,minNumEvents:30}),[u,i,n,r]),d=M.useCallback(()=>[...c.buckets,...c.edgeEvents,...c.propEvents].map(({time:h})=>h),[c]);return{filteredData:c,getTimesOnScreen:d,dataDomain:u.domain}},iz=[[vc,100],[vc,20],[vc,10],[vc,1],[Rm,3],[Rm,1],[rM,1],[Km,1],[Sg,12],[Sg,6],[Sg,1],[np,30],[np,5],[np,1],[su,30],[su,20],[su,5],[su,1],[hl,200],[hl,50],[hl,10],[hl,1]];function Bun(e){var i,o;const t=e.end.getTime()-e.start.getTime(),n=new Date(2e3,1,1),r=new Date(n.getTime()+t);for(const[a,[s,l]]of iz.entries()){if(a+1>=iz.length)break;const[u,c]=iz[a+1],d=(i=s.every(l))==null?void 0:i.range(n,r).length,f=(o=u.every(c))==null?void 0:o.range(n,r).length;if(d===void 0||d<=1||f===void 0||f<=0)continue;const h=s.every(l),p=u.every(c);if(!(h===null||p===null))return[{interval:h,formatter:Bve(s,l)},{interval:p,formatter:zve(u,c)}]}return[{interval:hl.every(10),formatter:Bve(hl,1)},{interval:hl.every(1),formatter:zve(hl,1)}]}function Bve(e,t){return n=>{switch(e){case hl:return qa(ls(n,"UTC"),"PP hh:mm:ss:SSS a");case su:return qa(ls(n,"UTC"),"PP hh:mm:ss a");case np:return qa(ls(n,"UTC"),"PP hh:mm a");case Sg:return qa(ls(n,"UTC"),"PP ha");case Km:return qa(ls(n,"UTC"),"PP");case rM:return qa(ls(n,"UTC"),"'w/b' PPP");case Rm:return t<3?qa(ls(n,"UTC"),"MMM y"):qa(ls(n,"UTC"),"qqq MMM y");case vc:return t<10?qa(ls(n,"UTC"),"y"):qa(ls(n,"UTC"),"y's'");default:return""}}}function zve(e,t){return n=>{switch(e){case hl:return qa(ls(n,"UTC"),"SSS'ms'");case su:return qa(ls(n,"UTC"),"ss's'");case np:return qa(ls(n,"UTC"),"mm'm'");case Sg:return qa(ls(n,"UTC"),"ha");case Km:return qa(ls(n,"UTC"),"dd");case rM:return qa(ls(n,"UTC"),"dd MMM");case Rm:return t<3?qa(ls(n,"UTC"),"MMM"):qa(ls(n,"UTC"),"qqq");case vc:return t===1?qa(ls(n,"UTC"),"yy"):t<10?qa(ls(n,"UTC"),"y"):qa(ls(n,"UTC"),"y's'");default:return""}}}var Vve=3,zun=({scale:e,upperXAxisHeight:t,lowerXAxisHeight:n,svgWidth:r,canvasWidth:i})=>{const o=M.useRef(null),a=M.useRef(null),s=t+n;return M.useEffect(()=>{if(a.current!==null&&o.current!==null){const[l,u]=e.domain(),d=(u.getTime()-l.getTime())/i*r,f=new Date(u.getTime()-d),h={start:f,end:u},p=bRe().range([0,r]).domain([f,u]),[g,y]=Bun(h),v=bpe(p).tickSize(t).tickPadding(-t+Vve).ticks(g.interval).tickFormat(g.formatter),b=wpe(o.current);b.call(v);const x=bpe(p).tickSize(n).tickPadding(-n+Vve).ticks(y.interval).tickFormat(y.formatter),w=wpe(a.current);w.call(x),b.selectAll(".tick text").style("text-anchor","start").style("fill","gray").attr("transform","translate(2, 0)"),w.selectAll(".tick text").style("text-anchor","start").attr("transform","translate(2, 0)"),b.selectAll(".tick line").style("stroke","#D3D3D3"),w.selectAll(".tick line").style("stroke","#D3D3D3"),b.select(".domain").attr("stroke-width",0),w.select(".domain").attr("stroke-width",0)}},[e,i,r,n,t]),k.jsxs(k.Fragment,{children:[k.jsx("g",{ref:o}),k.jsx("g",{transform:"translate(0,"+t+")",ref:a}),k.jsx("line",{x2:r,y1:s,y2:s,stroke:"gray"})]})},Vun=(e,t)=>{const n=e.domain(),r=n.at(0),i=n.at(-1),o=e.step();if(r!==void 0&&i!==void 0){const a=e(r),s=e(i);if(a!==void 0&&s!==void 0){const l=a-o/2,u=s+o/2;if(l<=-.001||u>t+.001){const c=u-l,f=t/c*t,h=Math.abs(l)/c,p=t*h;return{height:f,y:p}}}}},Uun=({nodeNames:e,scale:t,canvasHeight:n,textMeasureRef:r,scrollRef:i,yAxisTextWidth:o})=>{const a=Vun(t,n),s=Bi();return k.jsxs(k.Fragment,{children:[a&&k.jsxs(k.Fragment,{children:[k.jsx("rect",{width:12,height:n,style:{fill:s.palette.grey[300],fillOpacity:.3}}),k.jsx("rect",{width:12,y:a.y,height:a.height,style:{fill:s.palette.grey[600],fillOpacity:.5}})]}),k.jsx("g",{ref:r,transform:"translate("+(o+c5e)+",0)",children:Array.from(e).map(([l,u])=>{const c=u.length>15,d=c?u.slice(0,13):u,f=t(l)??0;return k.jsxs("g",{transform:`translate(0,${f})`,fill:"black",children:["5",k.jsx("text",{dominantBaseline:"middle",alignmentBaseline:"middle",textAnchor:"end",fontSize:11,children:d}),c&&k.jsx("text",{alignmentBaseline:"middle",dominantBaseline:"middle",children:"..."})]},l)})}),k.jsx("rect",{ref:i,width:o,height:1e4,style:{fill:"red",fillOpacity:0}})]})},Hun=(e,t)=>(e+t)/2,Wun=(e,t,n)=>e>n?n:e{const[s,l]=M.useState(void 0),[u,c]=M.useState(!1),[d,f]=M.useState(void 0),{filteredData:h,dataDomain:p,getTimesOnScreen:g}=$un(e,t,n??new Set,u,d,r??[],a),{svgRef:y,yAxisTextRef:v,canvas:b,svg:x,xAxis:w,yAxis:E}=wun(),{scrollSensorRef:C,yScale:T,nodeHeight:_}=Mun({nodeNames:h.nodeNames,minNodeHeight:20,canvasHeight:b.height}),{xScale:A,resetDomain:R,fitDomain:I,centerDomainAroundTime:N,updateDomainWithScroll:L,updateDomainWithRelativeOffset:$}=_un(p,b.width,d,f),[j,W]=M.useState(),q=M.useRef(null),{elX:H}=mkt(q),Y=M.useCallback(ne=>{ne.preventDefault(),ne.stopPropagation();const ie=g();L({delta:ne.deltaY,relativeMousePosition:H/b.width,timesOnScreen:ie,setTimeReference:W})},[L,g,b.width,H]);d5e(q,Y);const{mouseDownHandler:Z}=kun(b.width,$),te=M.useCallback(()=>{I(g())},[g,I]),be=M.useMemo(()=>{if((s==null?void 0:s.type)==="edge"){const ne=Hun(T(s.src)??0,T(s.dst)??0)+w.height,ie=w.height+10,de=x.height-10;return{x:A(s.time)+E.width,y:Wun(ne,ie,de)}}else return(s==null?void 0:s.type)==="prop"?{x:(A(s.time)??0)+E.width,y:(T(s.node)??0)+w.height}:void 0},[s,A,E.width,w.height,x.height,T]);return k.jsx(lr,{ref:o,sx:ne=>({height:"100%",padding:ne.spacing(2,2.5,2.5,2.5)}),children:k.jsxs(lr,{position:"relative",height:"100%",children:[s&&be&&k.jsx(yun,{x:be.x,y:be.y,type:s==null?void 0:s.type,hoveredElement:s,description:i}),k.jsxs(ti,{direction:"column",spacing:1,sx:ne=>({position:"absolute",padding:ne.spacing(2),zIndex:1,height:"100%",width:"100%",transition:"opacity 0.4s",justifyContent:"space-between",pointerEvents:"none"}),children:[k.jsx(lr,{sx:{height:ne=>ne.spacing(3.5)}}),k.jsx(lun,{scope:h.scope,centerDomainAroundTime:N}),k.jsx(hun,{selectedNodes:n!==void 0&&n.size>0,scope:h.scope}),k.jsx(gun,{resetView:R,fitView:te,hideEdges:u,setHideEdges:c})]}),k.jsxs("svg",{ref:y,width:"100%",height:"100%",style:{direction:"ltr"},children:[k.jsx(zun,{scale:A,canvasWidth:b.width,svgWidth:x.width,upperXAxisHeight:w.upperHeight,lowerXAxisHeight:w.lowerHeight}),k.jsxs("g",{transform:"translate(0,"+w.height+")",clipPath:"url(#canvas-clippath)",children:[k.jsx("clipPath",{id:"canvas-clippath",children:k.jsx("rect",{width:x.width,height:b.height})}),k.jsx(Uun,{nodeNames:h.displayNames,scale:T,canvasHeight:b.height,textMeasureRef:v,scrollRef:C,yAxisTextWidth:E.textWidth}),k.jsxs("g",{onMouseDown:Z,ref:q,transform:"translate("+E.width+",0)",children:[j&&k.jsx("line",{x1:A(j),x2:A(j),y1:0,y2:b.height,style:{stroke:"red",strokeWidth:2,opacity:0}}),k.jsx("rect",{width:b.width,height:b.height,style:{fillOpacity:0}}),k.jsx(fun,{nodeNames:h.nodeNames,selectedNodes:n??new Set,originalNodes:h.originalNodes,yScale:T,canvasWidth:b.width}),k.jsx(cun,{buckets:h.buckets,originalNodes:h.originalNodes,opacity:h.bucketOpacity,nodeHeight:_,xScale:A,yScale:T}),k.jsx(dun,{edges:h.edgeEvents,originalNodes:h.originalNodes,opacity:h.eventOpacity,hoveredElement:s,setHoveredElement:l,xScale:A,yScale:T}),k.jsx(pun,{events:h.propEvents,originalNodes:h.originalNodes,opacity:h.eventOpacity,hoveredElement:s,setHoveredElement:l,yScale:T,xScale:A})]})]})]})]})})};function h5e({sx:e,icon:t,children:n}){return k.jsxs(ti,{direction:"row",spacing:1,alignItems:"center",sx:e,children:[t,n]})}function g4({children:e,sx:t}){return k.jsx(cu,{elevation:4,sx:[n=>({width:"100%",padding:n.spacing(1.5)}),...Array.isArray(t)?t:[t]],children:e})}function m4({icon:e,text:t,children:n}){function r(i){return i.spacing(2)}return k.jsxs(ti,{sx:{color:i=>i.palette.primary.main,"&:not(:last-of-type)":{"--left-border-width":"1px"},"&:last-of-type":{"--left-border-width":"0px"}},children:[k.jsxs(ti,{direction:"row",spacing:3,sx:{"& > .MuiSvgIcon-root":i=>({width:r(i),height:r(i)})},children:[e,k.jsx(_r,{variant:"h2",sx:{fontWeight:"bold",fontSize:"14px"},children:t})]}),k.jsx(ti,{direction:"row",sx:i=>({marginTop:i.spacing(1),marginLeft:`calc((${r(i)} - var(--left-border-width)) / 2)`,marginRight:i.spacing(1),borderLeft:`var(--left-border-width) solid ${i.palette.grey[400]}`,paddingTop:i.spacing(1.5),paddingBottom:i.spacing(1.5),paddingLeft:`calc(${r(i)} / 2 + ${i.spacing(3)})`}),children:n})]})}function p5e(e){const t=Bi();return k.jsx(n2,{IconComponent:function(){return k.jsx(Kn,{icon:xX,style:{marginRight:t.spacing(1.5)}})},...e})}function Gun({availableCategories:e,entityMap:t}){const n=Bi(),[r,i]=M.useState("Entities"),o=a=>{i(a.target.value)};return k.jsx(m4,{icon:k.jsx(Kn,{icon:qBt,color:n.palette.primary.dark}),text:"I am searching for:",children:k.jsx(g4,{children:k.jsx(p5e,{value:r,onChange:o,fullWidth:!0,children:e.map(a=>k.jsx(da,{value:a,children:k.jsx(h5e,{icon:k.jsx(Kn,{icon:YBt,color:n.palette.primary.dark}),children:k.jsx(_r,{children:(t==null?void 0:t[a])??a})})},a))})})})}function Yun({condition:e,onDelete:t,onUpdate:n}){const r=Ae(aL)(({theme:i})=>({transform:"translate(0px, 0px) scale(1)",padding:i.spacing(2),"&.MuiInputLabel-shrink":{transform:`translate(0px, -${i.spacing(1.5)}) scale(0.75)`}}));return k.jsxs(ti,{direction:"row",spacing:2,sx:i=>({flex:1,paddingRight:i.spacing(1)}),children:[k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{sx:{transform:"translate(0px, -5px) scale(0.75)"},children:"Field"}),k.jsx(lr,{sx:i=>({transform:e.field.length>20?`translate(0, ${i.spacing(3)})`:`translate(${i.spacing(1.3)}, ${i.spacing(3)}) `,fontSize:"1rem",scale:e.field.length>20?.9:1,wordWrap:"break-word"}),children:k.jsx(_r,{sx:{fontSize:e.field.length<15?"1rem":void 0},children:e.field.length>11?`${e.field.slice(0,10)}...`:e.field})})]}),k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{sx:{marginTop:"6px"},children:"Operation"}),k.jsx(p5e,{id:"select-operation",value:e.op,sx:i=>({transform:`translate(0px, ${i.spacing(1)})`}),children:k.jsx(da,{value:e.op,sx:{fontSize:"1rem"},children:e.op==="eq"?"Is":e.op})})]}),e.variants.length>0?k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{children:"Value"}),k.jsx(n2,{id:"select-value",onChange:i=>n(i.target.value),defaultValue:"",children:e.variants.map(i=>k.jsx(da,{value:i,sx:{fontSize:"1rem"},children:i},i))})]}):k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{shrink:!1,htmlFor:"input-value",sx:{transform:"translate(0px, -6px) scale(0.75)"},children:"Value"}),k.jsx(iL,{id:"input-value",sx:{flex:1,marginLeft:1.6,marginTop:1.4,backgroundColor:"transparent",fontSize:"1rem"},onBlur:i=>{n(i.target.value)}})]}),k.jsx(vr,{onClick:()=>t(),sx:i=>({background:"black",color:"white",width:i.spacing(2),height:i.spacing(2),padding:0,"&:hover":{background:"black",boxShadow:`0 0 ${i.spacing(2.5)} ${wa("#FFFFFF",.5)} inset`}}),children:k.jsx(Kn,{icon:XBt})})]})}function g5e({sx:e,typeName:t,icon:n,typeColor:r}){return t&&n?k.jsx(h5e,{icon:n,sx:e,children:k.jsx(_r,{children:t})}):k.jsxs(ti,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[k.jsx(Kn,{icon:nRe,color:r}),k.jsx(_r,{children:t})]})}function Kun({children:e,onInsertCondition:t,type:n,availableFields:r,getTypeIcon:i,entityMap:o,typeColors:a}){return k.jsxs(g4,{children:[k.jsxs(ti,{direction:"row",justifyContent:"space-between",spacing:2,sx:s=>({paddingLeft:s.spacing(2),paddingTop:s.spacing(2),paddingRight:s.spacing(1),paddingBottom:s.spacing(2)}),children:[k.jsx(g5e,{typeName:(o==null?void 0:o[n])??n,icon:i!==void 0&&i(n,{color:"#384A66",fontSize:"1rem"}),typeColor:(a==null?void 0:a[n])??"#CADE96"}),r.length>0&&k.jsx(Xun,{availableFields:r,onInsertCondition:t})]}),n!==""&&k.jsx(ti,{direction:"column",justifyContent:"space-between",spacing:2,children:e})]})}function Xun({availableFields:e,onInsertCondition:t}){const[n,r]=M.useState();return k.jsxs(k.Fragment,{children:[k.jsx(vr,{onClick:i=>r(i.currentTarget),sx:i=>({alignSelf:"center",background:"black",color:"white",width:i.spacing(2),height:i.spacing(2),padding:0,"&:hover":{background:"black",boxShadow:`0 0 ${i.spacing(2.5)} ${wa("#FFFFFF",.5)} inset`}}),children:k.jsx(Kn,{icon:QBt})}),k.jsx(Gu,{anchorEl:n,open:n!==void 0,onClose:()=>r(void 0),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:e.map(i=>k.jsx(da,{onClick:()=>{t(i),r(void 0)},children:i},i))})]})}function Zun({selected:e,onSelectGraph:t,graphList:n}){const r=Bi();return k.jsx(m4,{icon:k.jsx(Kn,{icon:ezt,color:r.palette.primary.dark}),text:"Graph:",children:k.jsx(g4,{children:k.jsx(TY,{value:e??null,onChange:(i,o)=>{typeof o=="string"&&t(o)},options:(n==null?void 0:n.map(i=>i.name))??[],renderInput:i=>k.jsx(ff,{...i,label:"Select a graph"})})})})}function Qun({insertType:e,deleteType:t,selectedTypes:n,availableTypes:r,getTypeIcon:i,entityMap:o,typeColors:a}){return k.jsx(m4,{icon:k.jsx(Kn,{icon:nzt}),text:"Of this type:",children:k.jsx(g4,{children:k.jsx(TY,{popupIcon:k.jsx(Kn,{icon:xX}),multiple:!0,options:r,getOptionLabel:s=>(o==null?void 0:o[s])??s,value:n,filterSelectedOptions:!0,onChange:(s,l)=>{l.forEach(u=>{n.includes(u)||e(u)}),n.forEach(u=>{l.includes(u)||t(u)})},renderInput:s=>k.jsx(ff,{...s,placeholder:"Select type"}),renderTags:(s,l)=>s.map((u,c)=>{const{key:d,...f}=l({index:c});return M.createElement(Jun,{...f,key:d,type:u,deleteType:t,getTypeIcon:i,entityMap:o,typeColors:a})})})})})}function Jun({type:e,getTypeIcon:t,onDelete:n,deleteType:r,entityMap:i,typeColors:o,...a}){const s=M.useCallback(u=>{n(u),r(e)},[r,e,n]),l=Bi();return k.jsxs(cu,{...a,sx:{display:"inline-flex",alignItems:"center",padding:u=>u.spacing(.25,1)},children:[k.jsx(g5e,{typeName:(i==null?void 0:i[e])??e,icon:t!==void 0&&t(e,{color:l.palette.primary.dark,fontSize:"1.2rem"}),typeColor:(o==null?void 0:o[e])??l.palette.primary.dark}),k.jsx(vr,{onClick:s,children:k.jsx(Kn,{icon:rRe})})]})}function ecn({state:e,editActions:t,getTypeIcon:n,onSearchGraph:r,disableGraphSelection:i,entityMap:o,graphList:a,typeColors:s}){return k.jsxs(ti,{sx:{gridArea:"rhs-panel",overflowY:"auto"},children:[k.jsxs(ti,{spacing:2,sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"}},children:[!i&&k.jsx(Zun,{selected:e.graph,onSelectGraph:t.setGraph,graphList:a}),k.jsx(Gun,{availableCategories:["Entities"],entityMap:o}),k.jsx(Qun,{selectedTypes:e.selectedTypes,availableTypes:e.availableTypes,insertType:t.insertType,deleteType:t.deleteType,getTypeIcon:n,entityMap:o,typeColors:s}),k.jsx(m4,{icon:k.jsx(Kn,{icon:HBt,color:"#384A66"}),text:"With the following conditions:",children:k.jsx(ti,{sx:{width:"100%"},spacing:4,children:e.selectedConditionsByType.map(l=>k.jsx(Kun,{type:l.type,availableFields:l.availableFields,onInsertCondition:u=>t.insertCondition(l.type,u),typeColors:s,getTypeIcon:n,children:l.conditions.map(u=>k.jsx(Yun,{condition:u,onUpdate:c=>t.updateCondition(l.type,u.field,c),onDelete:()=>t.deleteCondition(l.type,u.field)},u.field))},l.type))})})]}),k.jsxs(ti,{justifyContent:"flex-end",spacing:1,direction:"row",sx:{marginTop:l=>l.spacing(2)},children:[k.jsx(Da,{disabled:e.selectedConditionsByType.length===0,variant:"contained",sx:{fontSize:"12px"},onClick:()=>{t.clearAll()},children:"Clear"}),k.jsx(Da,{disabled:e.selectedConditionsByType.length===0,variant:"contained",color:"secondary",onClick:()=>{r()},sx:{fontSize:"12px"},children:"Search"})]})]})}function tcn({queryBuilderProps:e,selectedRhsTab:t,setSelectedRhsTab:n,detailsPanelProps:r}){const i=(r==null?void 0:r.viewedNodeData.data)!==void 0?k.jsx(u5e,{...r}):k.jsx(_r,{children:"To see object details, please select an object in the graph canvas."}),o={"Query Builder":k.jsx(ecn,{...e}),Selected:i};return k.jsxs(ti,{sx:{gridArea:"rhs-panel",paddingLeft:a=>a.spacing(4),overflowY:"auto"},children:[k.jsx(PM,{tabs:["Query Builder","Selected"],selectedTab:t,setSelectedTab:n}),k.jsx(MY,{sx:a=>({marginTop:a.spacing(4),"&.MuiContainer-root":{paddingLeft:0,paddingRight:0}}),children:o[t]})]})}function ncn(){var t,n,r,i,o;const{slots:e}=M.useContext(kJ);return k.jsx(run,{slots:{top:k.jsxs(k.Fragment,{children:[(t=e==null?void 0:e.appBar)==null?void 0:t.logo,k.jsx(oz,{tooltipText:"Search for a graph",to:pc.search.path,children:k.jsx(Kn,{icon:Y6t})}),k.jsx(oz,{tooltipText:"List of saved graphs",to:pc.savedGraphs.path,children:k.jsx(Kn,{icon:q6t})}),(r=(n=e==null?void 0:e.catchAll)==null?void 0:n.navBar)==null?void 0:r.top]}),bottom:k.jsxs(k.Fragment,{children:[k.jsx(oz,{tooltipText:"GraphQL Playground",to:pc.gqlPlayground.buildPath({}),children:k.jsx(Kn,{icon:X6t})}),(o=(i=e==null?void 0:e.catchAll)==null?void 0:i.navBar)==null?void 0:o.bottom]})}})}function oz({children:e,tooltipText:t,to:n}){return k.jsx(S$e,{to:n,children:k.jsx(xi,{title:t,placement:"right",children:k.jsx(vr,{children:e})})})}function rcn(){var et;const{slots:e,nodeStyle:t,edgeStyle:n,activityDescription:r,nameProperty:i,masterGraphName:o}=Fp(),[a,s]=Vsn(),[l]=bxe(pc.graph),u=pk();M.useEffect(()=>{s(vt=>({...vt,lastSeenGraphParams:l}))},[l,s]);const[c,{height:d}]=xS(),f=l.baseGraph??o??l.graphSource,{data:h,error:p}=FLe(f);if(f===void 0)throw new Error("baseGraph needs to be defined");const g=M.useMemo(()=>({...l,baseGraph:f,temporalProps:["status"]}),[l,f]),y=M.useMemo(()=>({additionalInitialUndoableState:{layout:void 0}}),[]),v=$sn(g,y,i),{allNodes:b,allEdges:x,aliveEdges:w,additionalState:E,setAdditionalState:C,selectedNodeNames:T,disabledNodeNames:_,disabledEdgeIds:A,decorations:R,risks:I,highlightedNodeName:N,setHighlightedNodeName:L,highlightedLayer:$,setHighlightedLayer:j,onInvertSelectedNodes:W,onSelectSimilarTypes:q,onSelectRelatedNodes:H,onExpandSharedNeighbours:Y,onSelectShortestPath:Z,onSelectNode:te,onDeselectNode:be,onDeselectAll:ne,onExpandNode:ie,onExpandSelected:de,onExpandTwoHop:ue,onHideSelected:fe,undo:se,redo:re,canUndo:Ce,canRedo:xe,errors:pe}=v,_e=M.useMemo(()=>E==null?void 0:E.layout,[E==null?void 0:E.layout]),Pe=M.useCallback(vt=>{C({layout:vt})},[C]),[ye,Fe]=M.useState(void 0),{data:Be,error:Ie}=_J({graph:f,nodeName:ye,nameProperty:i}),ft=i5e(b,t,R==null?void 0:R.nodes,i),dt=Dq(w,n,R==null?void 0:R.edges),mt=Dq(x,n,R==null?void 0:R.edges),{mutateAsync:Kt,error:ot}=fsn(),{mutateAsync:Tt,error:Rt}=hsn();async function Ft(vt){const yt=l.graphSource??"";await Kt({graphName:yt,newGraphName:vt}),await Tt({newGraphName:vt}),u("/graph",{state:{graphSource:vt,initialNodes:[]}})}const Lt=M.useMemo(()=>{const vt=e==null?void 0:e.graphView;if(vt!==void 0)return typeof vt=="function"?vt({baseGraph:h,graphManagerData:v,viewedNodeData:Be}):vt},[h,v,e==null?void 0:e.graphView,Be]),Qe=M.useMemo(()=>({isUndoDisabled:!Ce,isRedoDisabled:!xe,onUndo:se,onRedo:re}),[xe,Ce,re,se]),We=M.useMemo(()=>(h==null?void 0:h.name)??"",[h==null?void 0:h.name]),ht=M.useMemo(()=>{var yt;const vt=Object.entries(yxe(w.flatMap(({layerNames:kn})=>kn.length===0?"none":kn))).map(([kn,$n])=>({id:kn,cols:[{value:kn},{value:$n.toString()}]}));return k.jsxs(ti,{spacing:4,sx:{marginTop:kn=>kn.spacing(4)},children:[v.risks.length>0&&k.jsx(l5e,{risks:I,highlightedRisk:N,setHighlightedRisk:L}),k.jsx(s5e,{title:"Relationships",rows:vt,headers:["Type","Amount"],highlightedRowId:$,onHighlightRowId:j}),(yt=Lt==null?void 0:Lt.drawer)==null?void 0:yt.overview]})},[w,I,N,L,$,j,(et=Lt==null?void 0:Lt.drawer)==null?void 0:et.overview,v.risks.length]),un=M.useCallback(()=>{L(void 0),j(void 0)},[j,L]),[Qt,at]=M.useState(!1),st=M.useMemo(()=>[p,...pe,Ie,ot,Rt].filter(vt=>vt!==null),[p,pe,ot,Ie,Rt]),ze=t5e({baseGraph:f,viewedNodeName:Be==null?void 0:Be.id,nameProperty:i},v),_t=ze!==void 0?k.jsx(u5e,{...ze}):k.jsx(_r,{children:"To see object details, please select an object in the graph canvas."});return k.jsx(Hln,{graphName:(h==null?void 0:h.name)??"",nodes:ft,edges:dt,selectedNodeNames:T,disabledNodeNames:_,disabledEdgeIds:A,onInvertSelectedNodes:W,onSelectSimilarTypes:q,onSelectRelatedNodes:H,onExpandSharedNeighbours:Y,onSelectShortestPath:Z,onSelectNode:te,onDeselectNode:be,onDeselectAll:ne,onExpand:de,onExpandNode:ie,onExpandTwoHop:ue,onHide:fe,onSaveGraph:Ft,viewedNodeName:ye,setViewedNodeName:Fe,onCanvasClick:un,isDrawerOpen:Qt,setIsDrawerOpen:at,layout:_e,setLayout:Pe,temporalViewHeight:d,errors:st,slots:{floatingActions:{undoRedoState:Qe},bottomPanel:k.jsx(qun,{temporalViewRef:c,nodes:ft,edges:mt,activityDescription:r,nameProperty:i}),rhsPanel:k.jsx(nun,{isOpen:Qt,setOpen:at,graphName:We,viewedNodeName:ye,onSaveGraph:Ft,slots:{detailsTable:(Lt==null?void 0:Lt.drawer)!==void 0?Lt==null?void 0:Lt.drawer.detailsTable:_t,overview:ht}})}})}var _E=new xD("raphtory-base-ui");_E.version(1).stores({pinnedNodes:"id, graph, name"});var icn=(e,t)=>{var s;const{data:n}=Ssn(e==null?void 0:e.graph),r=e??{},i=(s=r.selectedConditionsByType)==null?void 0:s.map(l=>{var u;return{type:l.type,conditions:l.conditions.map(c=>{var d;return{...c,variants:((d=n==null?void 0:n.get(l.type))==null?void 0:d.get(c.field))??[]}}),availableFields:[...((u=n==null?void 0:n.get(l.type))==null?void 0:u.keys())??[]].filter(c=>!l.conditions.some(d=>d.field===c))}}),o={graph:r.graph,range:r==null?void 0:r.range,availableTypes:[...(n==null?void 0:n.keys())??[]],selectedConditionsByType:i??[],selectedTypes:(i==null?void 0:i.map(({type:l})=>l))??[]},a=l=>{t(u=>({...u??[],builderState:l}))};return{state:o,actions:{setGraph:l=>{t(u=>({...u??[],committed:void 0,builderState:{graph:l,selectedConditionsByType:[]}}))},updateRangeStart:l=>{var u;a({...r,range:{start:l,end:((u=r.range)==null?void 0:u.end)??null}})},updateRangeEnd:l=>{var u;a({...r,range:{end:l,start:((u=r.range)==null?void 0:u.start)??null}})},insertType:l=>{a({...r,selectedConditionsByType:[...r.selectedConditionsByType??[],{type:l,conditions:[]}]})},deleteType:l=>{var u;a({...r,selectedConditionsByType:(u=r.selectedConditionsByType)==null?void 0:u.filter(c=>c.type!==l)})},insertCondition:(l,u)=>{const c=az(r,l,d=>({...d,conditions:[...d.conditions,{field:u,op:"eq",value:""}]}));a({...r,selectedConditionsByType:c})},updateCondition:(l,u,c)=>{const d=az(r,l,f=>({...f,conditions:f.conditions.map(h=>h.field===u?{...h,value:c}:h)}));a({...r,selectedConditionsByType:d})},deleteCondition:(l,u)=>{const c=az(r,l,d=>({...d,conditions:d.conditions.filter(f=>f.field!==u)}));a({...r,selectedConditionsByType:c})},clearAll:()=>{a({graph:e==null?void 0:e.graph})}}}},az=(e,t,n)=>{var r;return(r=e.selectedConditionsByType)==null?void 0:r.map(i=>i.type===t?n(i):i)},Uve=e=>e!==null&&SX(e)?e.getTime().toString():"*",ocn=(e,t,n,r,i)=>{const o=M.useMemo(()=>{var y;const l=e??{selectedConditionsByType:[]},u=(y=l.selectedConditionsByType)==null?void 0:y.find(v=>v.type===t);if(u===void 0)return"";const c=l.range,d=c===void 0?[]:[`time:[${Uve(c.start)} TO ${Uve(c.end)}]`],{type:f,conditions:h}=u,p=f==="None"?"*":`node_type:${f}`,g=h.map(v=>{const{value:b,field:x}=v;return`${x}:"${b}"`});return[p,...g,...d].join(" AND ")},[e,t]),{data:a,isLoading:s}=gsn(e==null?void 0:e.graph,o,n,r,i);return{queryResult:a,searchIsLoading:s}};function acn(){var te,be;const{masterGraphName:e,getTypeIcon:t,entityMap:n,nameProperty:r}=Fp(),i=pk(),[o,a]=bxe(pc.search),s=t??void 0,l=M.useMemo(()=>{var ne,ie;return((ie=(ne=o==null?void 0:o.committed)==null?void 0:ne.selectedConditionsByType)==null?void 0:ie.map(de=>de.type))??[]},[o]),u=M.useMemo(()=>l.length===0?[]:[...l,"Pinned"],[l]),c=(o==null?void 0:o.selectedTab)??"",d=c==="Pinned"?"Pinned":u.includes(c)?c:u[0],{pagination:f,setPage:h}=Oq({type:d,tab:d,pageSize:4}),{state:p,actions:g}=icn({...o==null?void 0:o.builderState,graph:e??((te=o.builderState)==null?void 0:te.graph)},a),{queryResult:y,searchIsLoading:v}=ocn(o==null?void 0:o.committed,d,f.page,f.pageSize,r),[b,x]=M.useState(void 0),w=(be=o.committed)==null?void 0:be.graph,E=azt(async()=>(await _E.pinnedNodes.toArray()).filter(ie=>ie.graph===w),[w],[]),C=ne=>{w!==void 0&&_E.pinnedNodes.add({id:`${w}-${ne}`,graph:w,name:ne})},T=ne=>{_E.pinnedNodes.delete(ne)},_=()=>{w!==void 0&&_E.pinnedNodes.where("graph").equals(w).delete()},[A,R]=M.useState("Query Builder"),I=()=>{a(ne=>({...ne,committed:ne==null?void 0:ne.builderState}))},N=ne=>{a(ie=>({...ie,selectedTab:ne}))},L=M.useRef(Date.now()).current,$=(E==null?void 0:E.map(ne=>ne.name))??[],{data:j}=xsn({graph:E?w:void 0,nodeNames:$,at:L,offset:f.page,limit:f.pageSize,nameProperty:r}),{data:W}=$Le(),q=t5e({baseGraph:w,viewedNodeName:b,nameProperty:r},void 0),H=M.useCallback(ne=>{i(pc.graph.buildPath({},{graphSource:void 0,initialNodes:ne,baseGraph:w}))},[i,w]),Y=M.useCallback((ne,ie)=>{i(pc.graph.buildPath({},{graphSource:ne,initialNodes:ie}))},[i]),Z=Object.fromEntries(p.availableTypes.map(ne=>[ne,n5e(ne)]));return k.jsxs(ti,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 60ch",gridTemplateAreas:['"top-left top-left top-left rhs-panel"','"tiles tiles tiles rhs-panel"','"tiles tiles tiles rhs-panel"'].join(` +`,aun=`${iun} 2s 1 cubic-bezier(0.280, 0.840, 0.420, 1)`,sun=`${oun} 2s 1 cubic-bezier(0.280, 0.840, 0.420, 1)`,lun=({centerDomainAroundTime:e,scope:{nearestStart:t,nearestEnd:n,noInfo:r}})=>{if(r){const i=t!==void 0?k.jsx(vr,{onClick:()=>e(t),children:k.jsx(Kn,{icon:tjt,style:{transformOrigin:"right",animation:aun}})}):k.jsx(lr,{}),o=n!==void 0?k.jsx(vr,{onClick:()=>e(n),children:k.jsx(Kn,{icon:xSe,style:{transformOrigin:"left",animation:sun}})}):k.jsx(lr,{});return k.jsxs(lr,{sx:{display:"flex",justifyContent:"space-between",direction:"ltr","& > button":{pointerEvents:"all"}},children:[i,o]})}else return null},uun={fill:"gray"},zS=e=>e.end.getTime()-e.start.getTime();function sI(e){var r;const t=(r=e==null?void 0:e.style)==null?void 0:r.fill;return typeof t=="string"?t:uun.fill}var cun=({buckets:e,originalNodes:t,opacity:n,nodeHeight:r,xScale:i,yScale:o})=>k.jsx(k.Fragment,{children:e.map(a=>{const s=a.node+a.time.getTime(),l=i(a.time);return k.jsx("line",{x1:l>0?l:0,x2:i(a.end),y1:o(a.node),y2:o(a.node),style:{strokeWidth:r,stroke:sI(t.get(a.node)),strokeOpacity:n}},s)})}),lI=3,Rve=20,Ave=2,Dve=lI+3,dun=({edges:e,originalNodes:t,opacity:n,hoveredElement:r,setHoveredElement:i,xScale:o,yScale:a})=>{const s=()=>i(void 0);return M.useMemo(()=>e.map(u=>{const c=o(u.time),d="translate("+c+",0 )",f=c>Rve?1:c/Rve,h=a(u.src.id),p=a(u.dst.id),g=sI(t.get(u.src.id)),y=sI(t.get(u.dst.id)),v=(u.src.id+"->"+u.dst.id+"_"+u.layer+"_"+u.time.getTime()).replaceAll(" ",""),b="linear-gradient-"+v,x="arrowhead-"+v;return{edge:u,transform:d,srcY:h,dstY:p,srcColor:g,dstColor:y,id:v,linearGradientId:b,arrowheadId:x,fadingOutOpacity:f}}),[e,t,o,a]).map(({edge:u,id:c,transform:d,srcY:f,dstY:h,srcColor:p,dstColor:g,fadingOutOpacity:y,arrowheadId:v,linearGradientId:b})=>k.jsxs("g",{transform:d,style:{strokeOpacity:y*n,fillOpacity:y*n},children:[k.jsx("defs",{children:k.jsx("marker",{id:v,markerWidth:"10",markerHeight:"10",refX:"4",refY:"2",orient:"auto",children:k.jsx("path",{d:"M0,0 L0,4 L4,2 Z",style:{fill:g}})})}),k.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:b,x1:0,x2:0,y1:f,y2:h,children:[k.jsx("stop",{offset:"0%",stopColor:p}),k.jsx("stop",{offset:"100%",stopColor:g})]}),c===(r==null?void 0:r.id)&&k.jsxs(k.Fragment,{children:[k.jsx("line",{y1:f,y2:h,style:{stroke:`url(#${b})`,strokeWidth:Ave+4,strokeOpacity:.5}}),k.jsx("circle",{cy:f,r:Dve,style:{fill:p,fillOpacity:.5}}),k.jsx("circle",{cy:h,r:Dve,style:{fill:g,fillOpacity:.5}})]}),k.jsx("circle",{cy:f,r:lI,style:{fill:p}}),k.jsx("circle",{cy:h,r:lI,style:{fill:g}}),k.jsx("line",{y1:f,y2:h,markerEnd:`url(#${v})`,style:{stroke:`url(#${b})`,strokeWidth:Ave}}),k.jsx("line",{onMouseEnter:()=>i({type:"edge",id:c,...u,src:u.src.displayName,dst:u.dst.displayName}),onMouseLeave:s,y1:f,y2:h,style:{stroke:"red",strokeOpacity:0,strokeWidth:8}})]},c))},fun=({nodeNames:e,selectedNodes:t,originalNodes:n,yScale:r,canvasWidth:i})=>{const o=Bi(),a=t.size===0?o.palette.grey[500]:o.palette.grey[400],s=e.map(l=>[l,r(l)??0]);return k.jsx("g",{children:s.map(([l,u])=>{var f,h;let c=(h=(f=n.get(l))==null?void 0:f.style)==null?void 0:h.iconSrc;typeof c!="string"&&(c=void 0);const d=t.has(l);return k.jsxs("g",{transform:"translate(0,"+u+")",children:[k.jsx("line",{x2:i,style:{stroke:d?o.palette.primary.main:o.palette.grey[300],strokeWidth:1}}),c!==void 0&&k.jsxs(k.Fragment,{children:[k.jsx("circle",{r:7,style:{fill:d?o.palette.primary.main:a}}),k.jsx("image",{x:"-5",y:"-5",width:"10",height:"10",href:c})]})]},l)})})},hun=({scope:e,selectedNodes:t})=>{if(e.noInfo){const r=e.nearestStart!==void 0||e.nearestEnd!==void 0?"No information available for this time window, please use the arrow buttons or reset the view":t?"No information available for the selected node, please expand it":"No information available, please expand a node";return k.jsx(lr,{sx:{alignSelf:"center"},children:k.jsx(_r,{children:r})})}else return null},WC=lI+1,pun=({events:e,originalNodes:t,opacity:n,hoveredElement:r,setHoveredElement:i,xScale:o,yScale:a})=>{const s=e.map(c=>({prop:c.prop,node:c.node.id,key:`${c.node.id}-${c.prop}-${c.time.getTime()}`,time:c.time,color:sI(t.get(c.node.id)),value:c.value,x1:Math.max(o(c.time),0),x2:c.end!==void 0?o(c.end):void 0})),l=new Map;for(const c of s){const d=l.get(c.node)??[];l.set(c.node,[...d,c])}const u=[...l.values()].flatMap(c=>c.map((d,f)=>{var v,b;const h=f>0?(v=c.at(f-1))==null?void 0:v.x1:void 0,p=h===void 0||d.x1-h>80,g=(b=c.at(f+1))==null?void 0:b.x1,y=g===void 0||g-d.x1>80;return{...d,showText:p&&y}}));return k.jsx(k.Fragment,{children:u.map(({node:c,prop:d,key:f,time:h,color:p,value:g,x1:y,x2:v})=>k.jsxs("g",{transform:"translate(0,"+a(c)+")",strokeOpacity:n,fillOpacity:n,children:[(r==null?void 0:r.id)===f&&k.jsx("circle",{cx:y,r:WC+3,style:{fill:p,fillOpacity:.5}}),k.jsx("circle",{cx:y,r:WC,style:{fill:p}}),v!==void 0&&k.jsxs(k.Fragment,{children:[(r==null?void 0:r.id)===f&&k.jsx("line",{x1:y,x2:v,style:{stroke:p,strokeWidth:6,strokeOpacity:.5}}),k.jsx("line",{x1:y,x2:v,style:{stroke:p,strokeWidth:3}}),k.jsx("circle",{cx:v,r:WC,style:{fill:p}})]}),k.jsx("line",{onMouseEnter:()=>{i({type:"prop",id:f,node:c,time:h,prop:d,value:g})},onMouseLeave:()=>i(void 0),x1:y-2*WC,x2:(v??y)+2*WC,style:{stroke:"red",strokeWidth:20,strokeOpacity:0}})]},f))})},rz=({onClick:e,title:t,children:n})=>k.jsx(xi,{arrow:!0,title:t,placement:"top",children:k.jsx(vr,{onClick:e,sx:{padding:r=>r.spacing(.5),borderRadius:0},children:n})}),gun=({hideEdges:e,setHideEdges:t,resetView:n,fitView:r})=>k.jsxs(lr,{sx:i=>({alignSelf:"flex-end",backgroundColor:i.palette.grey[200],height:i.spacing(3.5),pointerEvents:"all"}),children:[k.jsx(rz,{title:e?"Show edges":"Hide edges",onClick:()=>t(!e),children:e?k.jsx(Kn,{icon:ojt,fontSize:20}):k.jsx(Kn,{icon:sjt,fontSize:20})}),k.jsx(rz,{title:"Reset view",onClick:n,children:k.jsx(Kn,{icon:Vke,fontSize:20})}),k.jsx(rz,{title:"Fit view",onClick:r,children:k.jsx(Kn,{icon:rjt,fontSize:20})})]}),mun=e=>e.type==="prop"?`${e.prop} changed to ${e.value} for ${e.node}`:e.type==="edge"?`Interaction between ${e.src} and ${e.dst}.`:"unknown activity",vun=e=>e.slice(0,1).toUpperCase()+e.slice(1),yun=({x:e,y:t,type:n,hoveredElement:r,description:i})=>{const o=n==="edge",a=o?"edge-tooltip":"prop-tooltip",s=i?i(r):mun(r),l=vun(s);return k.jsx("div",{id:a,style:{position:"absolute",top:t,left:e,transform:o?"translateY(-50%)":"translateX(-50%) translateY(-100%) translateY(-12px)",maxWidth:"30em",height:"fit-content",marginLeft:o?"12px":void 0,zIndex:"100",padding:"1em",boxSizing:"border-box",background:"#fff",border:"1px solid #fafafa",boxShadow:"0 0 3px 1px rgba(0, 0, 0, 0.2)",borderRadius:"5px",fontSize:"12px"},children:k.jsxs(ti,{direction:"column",spacing:"0.2rem",children:[k.jsx("span",{children:l}),k.jsxs(ti,{direction:"row",alignItems:"center",spacing:"0.2rem",color:"gray",children:[k.jsx(Kn,{icon:ujt,height:"1rem",width:"1rem"}),k.jsx("span",{children:r.time.toLocaleString()})]})]})})},c5e=5,bun=14,Ive=14,Nve=14,xun=4,wun=()=>{const[e,{width:t,height:n,x:r}]=xS(),[i,{width:o}]=xS(),a=M.useMemo(()=>{const s=c5e+o+bun,l=Ive+Nve+xun;return{svg:{width:t,height:n,left:r},canvas:{width:t-s,height:n-l,left:r+s},xAxis:{height:l,upperHeight:Ive,lowerHeight:Nve},yAxis:{width:s,textWidth:o}}},[t,n,r,o]);return{svgRef:e,yAxisTextRef:i,...a}},Sun=new Date(1970,0,1),Cun=bjt(.25,.1,.25,1),Lve=e=>{const n=zS(e)*.1;return{start:new Date(e.start.getTime()-n),end:new Date(e.end.getTime()+n)}},Eun=({current:e,final:t,fallback:n,setDomain:r})=>{const a=Math.ceil(24),s=(e==null?void 0:e.start.getTime())??n.start.getTime(),l=(e==null?void 0:e.end.getTime())??n.end.getTime(),u=(t==null?void 0:t.start.getTime())??n.start.getTime(),c=(t==null?void 0:t.end.getTime())??n.end.getTime(),f=[...Array(a).keys()].map(y=>y/(a-1)),h=f.map(y=>Cun(y)),p=h.map(y=>new Date(y*u+(1-y)*s)),g=h.map(y=>new Date(y*c+(1-y)*l));N$t(p,g).forEach(([y,v],b)=>{y&&v&&setTimeout(()=>r({start:y,end:v}),b*1e3/60)}),setTimeout(()=>r(t),f.length*1e3/60)},Tun=(e,t,n)=>{var y;const r=e??t,i=200,o=n.delta;if(o===0)return e;const a=o>=0?1+o/i:i/(i-o),s=zS(r),l=zS(t),u=r.start.getTime()+s*n.relativeMousePosition;n.setTimeReference(new Date(u));const c=((y=p$t(n.timesOnScreen,v=>Math.abs(v.getTime()-u)))==null?void 0:y.getTime())??u,d=Math.max(Math.min(l,s*a),100),f=c-r.start.getTime(),h=new Date(r.start.getTime()+f/s*(s-d)),p=new Date(h.getTime()+d),g=new Date;return g.setFullYear(g.getFullYear()+5),h.getTime()>Sun.getTime()&&p.getTime(){const{domain:i,globalDomainWithPadding:o}=M.useMemo(()=>{const h=Lve(e);return{domain:{start:(n==null?void 0:n.start)??h.start,end:(n==null?void 0:n.end)??h.end},globalDomainWithPadding:h}},[n,e]),a=M.useCallback(h=>{r(p=>Tun(p,o,h))},[o,r]),s=M.useCallback(h=>{Eun({current:n,final:h,fallback:o,setDomain:r})},[n,o,r]),l=M.useCallback(()=>{s(void 0)},[s]),u=M.useCallback(h=>{const p=zS(i)/2,g=h.getTime(),y=new Date(g-p),v=new Date(g+p);s({start:y,end:v})},[s,i]),c=M.useCallback(h=>{if(h.length>1){const p=wX(h),g=Kk(h);s(Lve({start:p,end:g}))}else h.length===1&&u(h[0])},[u,s]),d=M.useCallback(h=>{const g=zS(i)*h,y=new Date(i.start.getTime()-g),v=new Date(i.end.getTime()-g);r({start:y,end:v})},[i,r]),f=M.useMemo(()=>bRe().range([0,t]).domain([i.start,i.end]),[t,i]);return{resetDomain:l,fitDomain:c,centerDomainAroundTime:u,updateDomainWithScroll:a,updateDomainWithRelativeOffset:d,xScale:f}},kun=(e,t)=>({mouseDownHandler:M.useCallback(r=>{r.preventDefault();const i=r.screenX,o=l=>{const u=(l.screenX-i)/e;t(u)},a=l=>{o(l)},s=l=>{o(l),window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",s)};window.addEventListener("mousemove",a),window.addEventListener("mouseup",s)},[e,t])}),d5e=(e,t)=>{M.useEffect(()=>{const n=e.current;return n==null||n.addEventListener("wheel",t,{passive:!1}),()=>{n==null||n.removeEventListener("wheel",t)}},[t,e])},Fve=(e,t)=>Math.max(Math.min(e,t),0),Mun=({canvasHeight:e,minNodeHeight:t,nodeNames:n})=>{const r=e/n.length,i=Math.max(t,r),o=n.length*i,[a,s]=M.useState(0),l=o-e,u=Fve(a,l),c=cRe().domain(n).range([i/2-u,o+i/2-u]),d=M.useCallback(h=>{h.preventDefault(),h.stopPropagation(),s(p=>Fve(p,l)+h.deltaY)},[s,l]),f=M.useRef(null);return d5e(f,d),{scrollSensorRef:f,nodeHeight:i,yScale:c}},Pun=[vc.every(1),Rm.every(6),Rm.every(3),Rm.every(1),Km.every(7),Km.every(1),Sg.every(12),Sg.every(6),Sg.every(1),np.every(30),np.every(20),np.every(5),np.every(1),su.every(30),su.every(20),su.every(5),su.every(1),hl.every(200),hl.every(50),hl.every(10),hl.every(1)],Oun=(e,t,n)=>{var o;const r=(o=e.properties)==null?void 0:o.temporal.values,i=n??"name";return r!==void 0?r.flatMap(({key:a,values:s,history:l})=>{const u=l.map(d=>new Date(d)),c=new Date(e.latestTime);return u.map((d,f)=>{var p,g;const h=s.at(f)??"null";return{prop:a,node:{id:e.id,displayName:((g=(p=e.properties)==null?void 0:p.values.find(y=>y.key===i))==null?void 0:g.value)??e.id},time:d,end:t.includes(a)?u.at(f+1)??c:void 0,value:h}})}):[]},Run=(e,t,n,r)=>{const i=new Map(e.map(g=>[g.id,g])),o=t.flatMap(g=>g.layers.flatMap(y=>R9t(y.history).map(v=>({src:g.src,dst:g.dst,time:new Date(v),layer:y.layerName})))),a=e.flatMap(g=>Oun(g,n,r)),s=[...o.map(g=>({node:g.src,time:g.time})),...o.map(g=>({node:g.dst,time:g.time})),...a],l=Lun(s),u=a.flatMap(g=>g!==void 0?[g.time]:[]),c=[...s.map(g=>g.time),...u],d=new Date(wX(c)),f=new Date(Kk(c)),h=[...new Set([...o.map(g=>g.src.id),...o.map(g=>g.dst.id),...a.map(g=>g.node.id)])].map((g,y)=>[g,y]);return{nodeOrder:new Map(h),originalNodes:i,edgeEvents:o,propEvents:a,buckets:l,domain:{start:d,end:f}}},Aun=(e,t,n)=>{if(e>n)return{eventOpacity:0,bucketOpacity:1};if(e{const n=e.filter(r=>r0?Kk(n):void 0},$ve=(e,t)=>{const n=e.filter(r=>r>t);return n.length>0?Kk(n):void 0},Dun=(e,t,n,r)=>{const i=e.map(({time:f})=>f),o=t.map(({time:f})=>f),a=jve(i,n),s=jve(o,n),l=[a,s].flatMap(f=>f!==void 0?[f]:[]),u=$ve(i,r),c=$ve(o,r),d=[u,c].flatMap(f=>f!==void 0?[f]:[]);return{noInfo:!0,nearestStart:l.length>0?Kk(l):void 0,nearestEnd:d.length>0?wX(d):void 0}},Iun=(e,t,n)=>{const r=new Set([...t.flatMap(i=>[i.src.id,i.dst.id]),...n.map(i=>i.node.id)]);return e.filter(i=>r.has(i.node))},Nun=(e,{domain:t,selectedNodes:n,hideEdges:r,minNumIntervals:i,maxNumEvents:o,minNumEvents:a})=>{const{start:s,end:l}=t,u=r?[]:e.edgeEvents,c=u.filter(N=>N.time>=s&&N.time<=l),d=n.size===0?c:c.filter(N=>n.has(N.src.id)||n.has(N.dst.id)),f=e.propEvents.filter(N=>(N.end??N.time)>=s&&N.time<=l),h=n.size===0?f:f.filter(N=>n.has(N.node.id)),p=d.length+h.length,{eventOpacity:g,bucketOpacity:y}=Aun(p,a,o),v=g!==0?d:[],b=g!==0?h:[],x=zS(t)/i,w=[...e.buckets.keys()].filter(N=>N<=x).slice(0).at(0),E=y!==0&&w!==void 0?e.buckets.get(w).filter(N=>N.times):[],C=n.size===0||!r?E:Iun(E,d,h),_=v.length!==0||b.length!==0||C.length!==0?{noInfo:!1,nearestStart:void 0,nearestEnd:void 0}:Dun(u,e.propEvents,s,l),R=[...new Set([...v.map(N=>N.src.id),...v.map(N=>N.dst.id),...b.map(N=>N.node.id),...C.map(N=>N.node)])].sort((N,L)=>e.nodeOrder.get(N)-e.nodeOrder.get(L)),I=new Map(R.map(N=>{var L;return[N,((L=e.originalNodes.get(N))==null?void 0:L.displayName)??N]}));return{nodeNames:R,originalNodes:e.originalNodes,displayNames:I,edgeEvents:v,propEvents:b,buckets:C,eventOpacity:g,bucketOpacity:y,scope:_}},Lun=e=>{const t=new Map;return f5e(t,e,Pun),t},Fun=e=>{const t=new Date(2e3,1,1),n=e.offset(t,1).getTime();return e.offset(t,2).getTime()-n},f5e=(e,t,n)=>{if(n.length>0){const[r,...i]=n,o=jun(t,r);if(o.some(s=>s.size>1)){const s=Fun(r);e.set(s,o),f5e(e,t,i)}}},jun=(e,t)=>[...e.reduce((r,i)=>{const o=t.floor(i.time),a=i.node+"#"+o,s=r.get(a)??{node:i.node.id,time:o,end:t.ceil(i.time),size:0};return s.size+=1,r.set(a,s),r},new Map).values()],$un=(e,t,n,r,i,o,a)=>{const s=JSON.stringify(o),l=M.useDeferredValue({nodes:e,edges:t}),u=M.useMemo(()=>Run(l.nodes,l.edges,JSON.parse(s),a),[l.nodes,l.edges,s,a]),c=M.useMemo(()=>Nun(u,{domain:i??u.domain,selectedNodes:n,hideEdges:r,minNumIntervals:25,maxNumEvents:60,minNumEvents:30}),[u,i,n,r]),d=M.useCallback(()=>[...c.buckets,...c.edgeEvents,...c.propEvents].map(({time:h})=>h),[c]);return{filteredData:c,getTimesOnScreen:d,dataDomain:u.domain}},iz=[[vc,100],[vc,20],[vc,10],[vc,1],[Rm,3],[Rm,1],[rM,1],[Km,1],[Sg,12],[Sg,6],[Sg,1],[np,30],[np,5],[np,1],[su,30],[su,20],[su,5],[su,1],[hl,200],[hl,50],[hl,10],[hl,1]];function Bun(e){var i,o;const t=e.end.getTime()-e.start.getTime(),n=new Date(2e3,1,1),r=new Date(n.getTime()+t);for(const[a,[s,l]]of iz.entries()){if(a+1>=iz.length)break;const[u,c]=iz[a+1],d=(i=s.every(l))==null?void 0:i.range(n,r).length,f=(o=u.every(c))==null?void 0:o.range(n,r).length;if(d===void 0||d<=1||f===void 0||f<=0)continue;const h=s.every(l),p=u.every(c);if(!(h===null||p===null))return[{interval:h,formatter:Bve(s,l)},{interval:p,formatter:zve(u,c)}]}return[{interval:hl.every(10),formatter:Bve(hl,1)},{interval:hl.every(1),formatter:zve(hl,1)}]}function Bve(e,t){return n=>{switch(e){case hl:return qa(ls(n,"UTC"),"PP hh:mm:ss:SSS a");case su:return qa(ls(n,"UTC"),"PP hh:mm:ss a");case np:return qa(ls(n,"UTC"),"PP hh:mm a");case Sg:return qa(ls(n,"UTC"),"PP ha");case Km:return qa(ls(n,"UTC"),"PP");case rM:return qa(ls(n,"UTC"),"'w/b' PPP");case Rm:return t<3?qa(ls(n,"UTC"),"MMM y"):qa(ls(n,"UTC"),"qqq MMM y");case vc:return t<10?qa(ls(n,"UTC"),"y"):qa(ls(n,"UTC"),"y's'");default:return""}}}function zve(e,t){return n=>{switch(e){case hl:return qa(ls(n,"UTC"),"SSS'ms'");case su:return qa(ls(n,"UTC"),"ss's'");case np:return qa(ls(n,"UTC"),"mm'm'");case Sg:return qa(ls(n,"UTC"),"ha");case Km:return qa(ls(n,"UTC"),"dd");case rM:return qa(ls(n,"UTC"),"dd MMM");case Rm:return t<3?qa(ls(n,"UTC"),"MMM"):qa(ls(n,"UTC"),"qqq");case vc:return t===1?qa(ls(n,"UTC"),"yy"):t<10?qa(ls(n,"UTC"),"y"):qa(ls(n,"UTC"),"y's'");default:return""}}}var Vve=3,zun=({scale:e,upperXAxisHeight:t,lowerXAxisHeight:n,svgWidth:r,canvasWidth:i})=>{const o=M.useRef(null),a=M.useRef(null),s=t+n;return M.useEffect(()=>{if(a.current!==null&&o.current!==null){const[l,u]=e.domain(),d=(u.getTime()-l.getTime())/i*r,f=new Date(u.getTime()-d),h={start:f,end:u},p=bRe().range([0,r]).domain([f,u]),[g,y]=Bun(h),v=bpe(p).tickSize(t).tickPadding(-t+Vve).ticks(g.interval).tickFormat(g.formatter),b=wpe(o.current);b.call(v);const x=bpe(p).tickSize(n).tickPadding(-n+Vve).ticks(y.interval).tickFormat(y.formatter),w=wpe(a.current);w.call(x),b.selectAll(".tick text").style("text-anchor","start").style("fill","gray").attr("transform","translate(2, 0)"),w.selectAll(".tick text").style("text-anchor","start").attr("transform","translate(2, 0)"),b.selectAll(".tick line").style("stroke","#D3D3D3"),w.selectAll(".tick line").style("stroke","#D3D3D3"),b.select(".domain").attr("stroke-width",0),w.select(".domain").attr("stroke-width",0)}},[e,i,r,n,t]),k.jsxs(k.Fragment,{children:[k.jsx("g",{ref:o}),k.jsx("g",{transform:"translate(0,"+t+")",ref:a}),k.jsx("line",{x2:r,y1:s,y2:s,stroke:"gray"})]})},Vun=(e,t)=>{const n=e.domain(),r=n.at(0),i=n.at(-1),o=e.step();if(r!==void 0&&i!==void 0){const a=e(r),s=e(i);if(a!==void 0&&s!==void 0){const l=a-o/2,u=s+o/2;if(l<=-.001||u>t+.001){const c=u-l,f=t/c*t,h=Math.abs(l)/c,p=t*h;return{height:f,y:p}}}}},Uun=({nodeNames:e,scale:t,canvasHeight:n,textMeasureRef:r,scrollRef:i,yAxisTextWidth:o})=>{const a=Vun(t,n),s=Bi();return k.jsxs(k.Fragment,{children:[a&&k.jsxs(k.Fragment,{children:[k.jsx("rect",{width:12,height:n,style:{fill:s.palette.grey[300],fillOpacity:.3}}),k.jsx("rect",{width:12,y:a.y,height:a.height,style:{fill:s.palette.grey[600],fillOpacity:.5}})]}),k.jsx("g",{ref:r,transform:"translate("+(o+c5e)+",0)",children:Array.from(e).map(([l,u])=>{const c=u.length>15,d=c?u.slice(0,13):u,f=t(l)??0;return k.jsxs("g",{transform:`translate(0,${f})`,fill:"black",children:["5",k.jsx("text",{dominantBaseline:"middle",alignmentBaseline:"middle",textAnchor:"end",fontSize:11,children:d}),c&&k.jsx("text",{alignmentBaseline:"middle",dominantBaseline:"middle",children:"..."})]},l)})}),k.jsx("rect",{ref:i,width:o,height:1e4,style:{fill:"red",fillOpacity:0}})]})},Hun=(e,t)=>(e+t)/2,Wun=(e,t,n)=>e>n?n:e{const[s,l]=M.useState(void 0),[u,c]=M.useState(!1),[d,f]=M.useState(void 0),{filteredData:h,dataDomain:p,getTimesOnScreen:g}=$un(e,t,n??new Set,u,d,r??[],a),{svgRef:y,yAxisTextRef:v,canvas:b,svg:x,xAxis:w,yAxis:E}=wun(),{scrollSensorRef:C,yScale:T,nodeHeight:_}=Mun({nodeNames:h.nodeNames,minNodeHeight:20,canvasHeight:b.height}),{xScale:A,resetDomain:R,fitDomain:I,centerDomainAroundTime:N,updateDomainWithScroll:L,updateDomainWithRelativeOffset:$}=_un(p,b.width,d,f),[j,W]=M.useState(),q=M.useRef(null),{elX:H}=mkt(q),Y=M.useCallback(ne=>{ne.preventDefault(),ne.stopPropagation();const ie=g();L({delta:ne.deltaY,relativeMousePosition:H/b.width,timesOnScreen:ie,setTimeReference:W})},[L,g,b.width,H]);d5e(q,Y);const{mouseDownHandler:Z}=kun(b.width,$),te=M.useCallback(()=>{I(g())},[g,I]),be=M.useMemo(()=>{if((s==null?void 0:s.type)==="edge"){const ne=Hun(T(s.src)??0,T(s.dst)??0)+w.height,ie=w.height+10,de=x.height-10;return{x:A(s.time)+E.width,y:Wun(ne,ie,de)}}else return(s==null?void 0:s.type)==="prop"?{x:(A(s.time)??0)+E.width,y:(T(s.node)??0)+w.height}:void 0},[s,A,E.width,w.height,x.height,T]);return k.jsx(lr,{ref:o,sx:ne=>({height:"100%",padding:ne.spacing(2,2.5,2.5,2.5)}),children:k.jsxs(lr,{position:"relative",height:"100%",children:[s&&be&&k.jsx(yun,{x:be.x,y:be.y,type:s==null?void 0:s.type,hoveredElement:s,description:i}),k.jsxs(ti,{direction:"column",spacing:1,sx:ne=>({position:"absolute",padding:ne.spacing(2),zIndex:1,height:"100%",width:"100%",transition:"opacity 0.4s",justifyContent:"space-between",pointerEvents:"none"}),children:[k.jsx(lr,{sx:{height:ne=>ne.spacing(3.5)}}),k.jsx(lun,{scope:h.scope,centerDomainAroundTime:N}),k.jsx(hun,{selectedNodes:n!==void 0&&n.size>0,scope:h.scope}),k.jsx(gun,{resetView:R,fitView:te,hideEdges:u,setHideEdges:c})]}),k.jsxs("svg",{ref:y,width:"100%",height:"100%",style:{direction:"ltr"},children:[k.jsx(zun,{scale:A,canvasWidth:b.width,svgWidth:x.width,upperXAxisHeight:w.upperHeight,lowerXAxisHeight:w.lowerHeight}),k.jsxs("g",{transform:"translate(0,"+w.height+")",clipPath:"url(#canvas-clippath)",children:[k.jsx("clipPath",{id:"canvas-clippath",children:k.jsx("rect",{width:x.width,height:b.height})}),k.jsx(Uun,{nodeNames:h.displayNames,scale:T,canvasHeight:b.height,textMeasureRef:v,scrollRef:C,yAxisTextWidth:E.textWidth}),k.jsxs("g",{onMouseDown:Z,ref:q,transform:"translate("+E.width+",0)",children:[j&&k.jsx("line",{x1:A(j),x2:A(j),y1:0,y2:b.height,style:{stroke:"red",strokeWidth:2,opacity:0}}),k.jsx("rect",{width:b.width,height:b.height,style:{fillOpacity:0}}),k.jsx(fun,{nodeNames:h.nodeNames,selectedNodes:n??new Set,originalNodes:h.originalNodes,yScale:T,canvasWidth:b.width}),k.jsx(cun,{buckets:h.buckets,originalNodes:h.originalNodes,opacity:h.bucketOpacity,nodeHeight:_,xScale:A,yScale:T}),k.jsx(dun,{edges:h.edgeEvents,originalNodes:h.originalNodes,opacity:h.eventOpacity,hoveredElement:s,setHoveredElement:l,xScale:A,yScale:T}),k.jsx(pun,{events:h.propEvents,originalNodes:h.originalNodes,opacity:h.eventOpacity,hoveredElement:s,setHoveredElement:l,yScale:T,xScale:A})]})]})]})]})})};function h5e({sx:e,icon:t,children:n}){return k.jsxs(ti,{direction:"row",spacing:1,alignItems:"center",sx:e,children:[t,n]})}function g4({children:e,sx:t}){return k.jsx(cu,{elevation:4,sx:[n=>({width:"100%",padding:n.spacing(1.5)}),...Array.isArray(t)?t:[t]],children:e})}function m4({icon:e,text:t,children:n}){function r(i){return i.spacing(2)}return k.jsxs(ti,{sx:{color:i=>i.palette.primary.main,"&:not(:last-of-type)":{"--left-border-width":"1px"},"&:last-of-type":{"--left-border-width":"0px"}},children:[k.jsxs(ti,{direction:"row",spacing:3,sx:{"& > .MuiSvgIcon-root":i=>({width:r(i),height:r(i)})},children:[e,k.jsx(_r,{variant:"h2",sx:{fontWeight:"bold",fontSize:"14px"},children:t})]}),k.jsx(ti,{direction:"row",sx:i=>({marginTop:i.spacing(1),marginLeft:`calc((${r(i)} - var(--left-border-width)) / 2)`,marginRight:i.spacing(1),borderLeft:`var(--left-border-width) solid ${i.palette.grey[400]}`,paddingTop:i.spacing(1.5),paddingBottom:i.spacing(1.5),paddingLeft:`calc(${r(i)} / 2 + ${i.spacing(3)})`}),children:n})]})}function p5e(e){const t=Bi();return k.jsx(n2,{IconComponent:function(){return k.jsx(Kn,{icon:xX,style:{marginRight:t.spacing(1.5)}})},...e})}function Gun({availableCategories:e,entityMap:t}){const n=Bi(),[r,i]=M.useState("Entities"),o=a=>{i(a.target.value)};return k.jsx(m4,{icon:k.jsx(Kn,{icon:qBt,color:n.palette.primary.dark}),text:"I am searching for:",children:k.jsx(g4,{children:k.jsx(p5e,{value:r,onChange:o,fullWidth:!0,children:e.map(a=>k.jsx(da,{value:a,children:k.jsx(h5e,{icon:k.jsx(Kn,{icon:YBt,color:n.palette.primary.dark}),children:k.jsx(_r,{children:(t==null?void 0:t[a])??a})})},a))})})})}function Yun({condition:e,onDelete:t,onUpdate:n}){const r=Ae(aL)(({theme:a})=>({transform:"translate(0px, 0px) scale(1)",padding:a.spacing(2),"&.MuiInputLabel-shrink":{transform:`translate(0px, -${a.spacing(1.5)}) scale(0.75)`}})),[i,o]=M.useState(void 0);return k.jsxs(ti,{direction:"row",spacing:2,sx:a=>({flex:1,paddingRight:a.spacing(1)}),children:[k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{sx:{transform:"translate(0px, -5px) scale(0.75)"},children:"Field"}),k.jsx(lr,{sx:a=>({transform:e.field.length>20?`translate(0, ${a.spacing(3)})`:`translate(${a.spacing(1.3)}, ${a.spacing(3)}) `,fontSize:"1rem",scale:e.field.length>20?.9:1,wordWrap:"break-word"}),children:k.jsx(_r,{sx:{fontSize:e.field.length<15?"1rem":void 0},children:e.field.length>11?`${e.field.slice(0,10)}...`:e.field})})]}),k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{sx:{marginTop:"6px"},children:"Operation"}),k.jsx(p5e,{id:"select-operation",value:e.op,sx:a=>({transform:`translate(0px, ${a.spacing(1)})`}),children:k.jsx(da,{value:e.op,sx:{fontSize:"1rem"},children:e.op==="eq"?"Is":e.op})})]}),e.variants.length>0?k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{children:"Value"}),k.jsx(n2,{id:"select-value",onChange:a=>n(a.target.value),defaultValue:"",children:e.variants.map(a=>k.jsx(da,{value:a,sx:{fontSize:"1rem"},children:a},a))})]}):k.jsxs(ny,{sx:{flex:1,boxShadow:1},children:[k.jsx(r,{shrink:!1,htmlFor:"input-value",sx:{transform:"translate(0px, -6px) scale(0.75)"},children:"Value"}),k.jsx(iL,{id:"input-value",sx:{flex:1,marginLeft:1.6,marginTop:1.4,backgroundColor:"transparent",fontSize:"1rem"},value:i??e.value,onChange:a=>o(a.target.value),onBlur:a=>{o(void 0),n(a.target.value)}})]}),k.jsx(vr,{onClick:()=>t(),sx:a=>({background:"black",color:"white",width:a.spacing(2),height:a.spacing(2),padding:0,"&:hover":{background:"black",boxShadow:`0 0 ${a.spacing(2.5)} ${wa("#FFFFFF",.5)} inset`}}),children:k.jsx(Kn,{icon:XBt})})]})}function g5e({sx:e,typeName:t,icon:n,typeColor:r}){return t&&n?k.jsx(h5e,{icon:n,sx:e,children:k.jsx(_r,{children:t})}):k.jsxs(ti,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[k.jsx(Kn,{icon:nRe,color:r}),k.jsx(_r,{children:t})]})}function Kun({children:e,onInsertCondition:t,type:n,availableFields:r,getTypeIcon:i,entityMap:o,typeColors:a}){return k.jsxs(g4,{children:[k.jsxs(ti,{direction:"row",justifyContent:"space-between",spacing:2,sx:s=>({paddingLeft:s.spacing(2),paddingTop:s.spacing(2),paddingRight:s.spacing(1),paddingBottom:s.spacing(2)}),children:[k.jsx(g5e,{typeName:(o==null?void 0:o[n])??n,icon:i!==void 0&&i(n,{color:"#384A66",fontSize:"1rem"}),typeColor:(a==null?void 0:a[n])??"#CADE96"}),r.length>0&&k.jsx(Xun,{availableFields:r,onInsertCondition:t})]}),n!==""&&k.jsx(ti,{direction:"column",justifyContent:"space-between",spacing:2,children:e})]})}function Xun({availableFields:e,onInsertCondition:t}){const[n,r]=M.useState();return k.jsxs(k.Fragment,{children:[k.jsx(vr,{onClick:i=>r(i.currentTarget),sx:i=>({alignSelf:"center",background:"black",color:"white",width:i.spacing(2),height:i.spacing(2),padding:0,"&:hover":{background:"black",boxShadow:`0 0 ${i.spacing(2.5)} ${wa("#FFFFFF",.5)} inset`}}),children:k.jsx(Kn,{icon:QBt})}),k.jsx(Gu,{anchorEl:n,open:n!==void 0,onClose:()=>r(void 0),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:e.map(i=>k.jsx(da,{onClick:()=>{t(i),r(void 0)},children:i},i))})]})}function Zun({selected:e,onSelectGraph:t,graphList:n}){const r=Bi();return k.jsx(m4,{icon:k.jsx(Kn,{icon:ezt,color:r.palette.primary.dark}),text:"Graph:",children:k.jsx(g4,{children:k.jsx(TY,{value:e??null,onChange:(i,o)=>{typeof o=="string"&&t(o)},options:(n==null?void 0:n.map(i=>i.name))??[],renderInput:i=>k.jsx(ff,{...i,label:"Select a graph"})})})})}function Qun({insertType:e,deleteType:t,selectedTypes:n,availableTypes:r,getTypeIcon:i,entityMap:o,typeColors:a}){return k.jsx(m4,{icon:k.jsx(Kn,{icon:nzt}),text:"Of this type:",children:k.jsx(g4,{children:k.jsx(TY,{popupIcon:k.jsx(Kn,{icon:xX}),multiple:!0,options:r,getOptionLabel:s=>(o==null?void 0:o[s])??s,value:n,filterSelectedOptions:!0,onChange:(s,l)=>{l.forEach(u=>{n.includes(u)||e(u)}),n.forEach(u=>{l.includes(u)||t(u)})},renderInput:s=>k.jsx(ff,{...s,placeholder:"Select type"}),renderTags:(s,l)=>s.map((u,c)=>{const{key:d,...f}=l({index:c});return M.createElement(Jun,{...f,key:d,type:u,deleteType:t,getTypeIcon:i,entityMap:o,typeColors:a})})})})})}function Jun({type:e,getTypeIcon:t,onDelete:n,deleteType:r,entityMap:i,typeColors:o,...a}){const s=M.useCallback(u=>{n(u),r(e)},[r,e,n]),l=Bi();return k.jsxs(cu,{...a,sx:{display:"inline-flex",alignItems:"center",padding:u=>u.spacing(.25,1)},children:[k.jsx(g5e,{typeName:(i==null?void 0:i[e])??e,icon:t!==void 0&&t(e,{color:l.palette.primary.dark,fontSize:"1.2rem"}),typeColor:(o==null?void 0:o[e])??l.palette.primary.dark}),k.jsx(vr,{onClick:s,children:k.jsx(Kn,{icon:rRe})})]})}function ecn({state:e,editActions:t,getTypeIcon:n,onSearchGraph:r,disableGraphSelection:i,entityMap:o,graphList:a,typeColors:s}){return k.jsxs(ti,{sx:{gridArea:"rhs-panel",overflowY:"auto"},children:[k.jsxs(ti,{spacing:2,sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"}},children:[!i&&k.jsx(Zun,{selected:e.graph,onSelectGraph:t.setGraph,graphList:a}),k.jsx(Gun,{availableCategories:["Entities"],entityMap:o}),k.jsx(Qun,{selectedTypes:e.selectedTypes,availableTypes:e.availableTypes,insertType:t.insertType,deleteType:t.deleteType,getTypeIcon:n,entityMap:o,typeColors:s}),k.jsx(m4,{icon:k.jsx(Kn,{icon:HBt,color:"#384A66"}),text:"With the following conditions:",children:k.jsx(ti,{sx:{width:"100%"},spacing:4,children:e.selectedConditionsByType.map(l=>k.jsx(Kun,{type:l.type,availableFields:l.availableFields,onInsertCondition:u=>t.insertCondition(l.type,u),typeColors:s,getTypeIcon:n,children:l.conditions.map(u=>k.jsx(Yun,{condition:u,onUpdate:c=>t.updateCondition(l.type,u.field,c),onDelete:()=>t.deleteCondition(l.type,u.field)},u.field))},l.type))})})]}),k.jsxs(ti,{justifyContent:"flex-end",spacing:1,direction:"row",sx:{marginTop:l=>l.spacing(2)},children:[k.jsx(Da,{disabled:e.selectedConditionsByType.length===0,variant:"contained",sx:{fontSize:"12px"},onClick:()=>{t.clearAll()},children:"Clear"}),k.jsx(Da,{disabled:e.selectedConditionsByType.length===0,variant:"contained",color:"secondary",onClick:()=>{r()},sx:{fontSize:"12px"},children:"Search"})]})]})}function tcn({queryBuilderProps:e,selectedRhsTab:t,setSelectedRhsTab:n,detailsPanelProps:r}){const i=(r==null?void 0:r.viewedNodeData.data)!==void 0?k.jsx(u5e,{...r}):k.jsx(_r,{children:"To see object details, please select an object in the graph canvas."}),o={"Query Builder":k.jsx(ecn,{...e}),Selected:i};return k.jsxs(ti,{sx:{gridArea:"rhs-panel",paddingLeft:a=>a.spacing(4),overflowY:"auto"},children:[k.jsx(PM,{tabs:["Query Builder","Selected"],selectedTab:t,setSelectedTab:n}),k.jsx(MY,{sx:a=>({marginTop:a.spacing(4),"&.MuiContainer-root":{paddingLeft:0,paddingRight:0}}),children:o[t]})]})}function ncn(){var t,n,r,i,o;const{slots:e}=M.useContext(kJ);return k.jsx(run,{slots:{top:k.jsxs(k.Fragment,{children:[(t=e==null?void 0:e.appBar)==null?void 0:t.logo,k.jsx(oz,{tooltipText:"Search for a graph",to:pc.search.path,children:k.jsx(Kn,{icon:Y6t})}),k.jsx(oz,{tooltipText:"List of saved graphs",to:pc.savedGraphs.path,children:k.jsx(Kn,{icon:q6t})}),(r=(n=e==null?void 0:e.catchAll)==null?void 0:n.navBar)==null?void 0:r.top]}),bottom:k.jsxs(k.Fragment,{children:[k.jsx(oz,{tooltipText:"GraphQL Playground",to:pc.gqlPlayground.buildPath({}),children:k.jsx(Kn,{icon:X6t})}),(o=(i=e==null?void 0:e.catchAll)==null?void 0:i.navBar)==null?void 0:o.bottom]})}})}function oz({children:e,tooltipText:t,to:n}){return k.jsx(S$e,{to:n,children:k.jsx(xi,{title:t,placement:"right",children:k.jsx(vr,{children:e})})})}function rcn(){var et;const{slots:e,nodeStyle:t,edgeStyle:n,activityDescription:r,nameProperty:i,masterGraphName:o}=Fp(),[a,s]=Vsn(),[l]=bxe(pc.graph),u=pk();M.useEffect(()=>{s(vt=>({...vt,lastSeenGraphParams:l}))},[l,s]);const[c,{height:d}]=xS(),f=l.baseGraph??o??l.graphSource,{data:h,error:p}=FLe(f);if(f===void 0)throw new Error("baseGraph needs to be defined");const g=M.useMemo(()=>({...l,baseGraph:f,temporalProps:["status"]}),[l,f]),y=M.useMemo(()=>({additionalInitialUndoableState:{layout:void 0}}),[]),v=$sn(g,y,i),{allNodes:b,allEdges:x,aliveEdges:w,additionalState:E,setAdditionalState:C,selectedNodeNames:T,disabledNodeNames:_,disabledEdgeIds:A,decorations:R,risks:I,highlightedNodeName:N,setHighlightedNodeName:L,highlightedLayer:$,setHighlightedLayer:j,onInvertSelectedNodes:W,onSelectSimilarTypes:q,onSelectRelatedNodes:H,onExpandSharedNeighbours:Y,onSelectShortestPath:Z,onSelectNode:te,onDeselectNode:be,onDeselectAll:ne,onExpandNode:ie,onExpandSelected:de,onExpandTwoHop:ue,onHideSelected:fe,undo:se,redo:re,canUndo:Ce,canRedo:xe,errors:pe}=v,_e=M.useMemo(()=>E==null?void 0:E.layout,[E==null?void 0:E.layout]),Pe=M.useCallback(vt=>{C({layout:vt})},[C]),[ye,Fe]=M.useState(void 0),{data:Be,error:Ie}=_J({graph:f,nodeName:ye,nameProperty:i}),ft=i5e(b,t,R==null?void 0:R.nodes,i),dt=Dq(w,n,R==null?void 0:R.edges),mt=Dq(x,n,R==null?void 0:R.edges),{mutateAsync:Kt,error:ot}=fsn(),{mutateAsync:Tt,error:Rt}=hsn();async function Ft(vt){const yt=l.graphSource??"";await Kt({graphName:yt,newGraphName:vt}),await Tt({newGraphName:vt}),u("/graph",{state:{graphSource:vt,initialNodes:[]}})}const Lt=M.useMemo(()=>{const vt=e==null?void 0:e.graphView;if(vt!==void 0)return typeof vt=="function"?vt({baseGraph:h,graphManagerData:v,viewedNodeData:Be}):vt},[h,v,e==null?void 0:e.graphView,Be]),Qe=M.useMemo(()=>({isUndoDisabled:!Ce,isRedoDisabled:!xe,onUndo:se,onRedo:re}),[xe,Ce,re,se]),We=M.useMemo(()=>(h==null?void 0:h.name)??"",[h==null?void 0:h.name]),ht=M.useMemo(()=>{var yt;const vt=Object.entries(yxe(w.flatMap(({layerNames:kn})=>kn.length===0?"none":kn))).map(([kn,$n])=>({id:kn,cols:[{value:kn},{value:$n.toString()}]}));return k.jsxs(ti,{spacing:4,sx:{marginTop:kn=>kn.spacing(4)},children:[v.risks.length>0&&k.jsx(l5e,{risks:I,highlightedRisk:N,setHighlightedRisk:L}),k.jsx(s5e,{title:"Relationships",rows:vt,headers:["Type","Amount"],highlightedRowId:$,onHighlightRowId:j}),(yt=Lt==null?void 0:Lt.drawer)==null?void 0:yt.overview]})},[w,I,N,L,$,j,(et=Lt==null?void 0:Lt.drawer)==null?void 0:et.overview,v.risks.length]),un=M.useCallback(()=>{L(void 0),j(void 0)},[j,L]),[Qt,at]=M.useState(!1),st=M.useMemo(()=>[p,...pe,Ie,ot,Rt].filter(vt=>vt!==null),[p,pe,ot,Ie,Rt]),ze=t5e({baseGraph:f,viewedNodeName:Be==null?void 0:Be.id,nameProperty:i},v),_t=ze!==void 0?k.jsx(u5e,{...ze}):k.jsx(_r,{children:"To see object details, please select an object in the graph canvas."});return k.jsx(Hln,{graphName:(h==null?void 0:h.name)??"",nodes:ft,edges:dt,selectedNodeNames:T,disabledNodeNames:_,disabledEdgeIds:A,onInvertSelectedNodes:W,onSelectSimilarTypes:q,onSelectRelatedNodes:H,onExpandSharedNeighbours:Y,onSelectShortestPath:Z,onSelectNode:te,onDeselectNode:be,onDeselectAll:ne,onExpand:de,onExpandNode:ie,onExpandTwoHop:ue,onHide:fe,onSaveGraph:Ft,viewedNodeName:ye,setViewedNodeName:Fe,onCanvasClick:un,isDrawerOpen:Qt,setIsDrawerOpen:at,layout:_e,setLayout:Pe,temporalViewHeight:d,errors:st,slots:{floatingActions:{undoRedoState:Qe},bottomPanel:k.jsx(qun,{temporalViewRef:c,nodes:ft,edges:mt,activityDescription:r,nameProperty:i}),rhsPanel:k.jsx(nun,{isOpen:Qt,setOpen:at,graphName:We,viewedNodeName:ye,onSaveGraph:Ft,slots:{detailsTable:(Lt==null?void 0:Lt.drawer)!==void 0?Lt==null?void 0:Lt.drawer.detailsTable:_t,overview:ht}})}})}var _E=new xD("raphtory-base-ui");_E.version(1).stores({pinnedNodes:"id, graph, name"});var icn=(e,t)=>{var s;const{data:n}=Ssn(e==null?void 0:e.graph),r=e??{},i=(s=r.selectedConditionsByType)==null?void 0:s.map(l=>{var u;return{type:l.type,conditions:l.conditions.map(c=>{var d;return{...c,variants:((d=n==null?void 0:n.get(l.type))==null?void 0:d.get(c.field))??[]}}),availableFields:[...((u=n==null?void 0:n.get(l.type))==null?void 0:u.keys())??[]].filter(c=>!l.conditions.some(d=>d.field===c))}}),o={graph:r.graph,range:r==null?void 0:r.range,availableTypes:[...(n==null?void 0:n.keys())??[]],selectedConditionsByType:i??[],selectedTypes:(i==null?void 0:i.map(({type:l})=>l))??[]},a=l=>{t(u=>({...u??[],builderState:l}))};return{state:o,actions:{setGraph:l=>{t(u=>({...u??[],committed:void 0,builderState:{graph:l,selectedConditionsByType:[]}}))},updateRangeStart:l=>{var u;a({...r,range:{start:l,end:((u=r.range)==null?void 0:u.end)??null}})},updateRangeEnd:l=>{var u;a({...r,range:{end:l,start:((u=r.range)==null?void 0:u.start)??null}})},insertType:l=>{a({...r,selectedConditionsByType:[...r.selectedConditionsByType??[],{type:l,conditions:[]}]})},deleteType:l=>{var u;a({...r,selectedConditionsByType:(u=r.selectedConditionsByType)==null?void 0:u.filter(c=>c.type!==l)})},insertCondition:(l,u)=>{const c=az(r,l,d=>({...d,conditions:[...d.conditions,{field:u,op:"eq",value:""}]}));a({...r,selectedConditionsByType:c})},updateCondition:(l,u,c)=>{const d=az(r,l,f=>({...f,conditions:f.conditions.map(h=>h.field===u?{...h,value:c}:h)}));a({...r,selectedConditionsByType:d})},deleteCondition:(l,u)=>{const c=az(r,l,d=>({...d,conditions:d.conditions.filter(f=>f.field!==u)}));a({...r,selectedConditionsByType:c})},clearAll:()=>{a({graph:e==null?void 0:e.graph})}}}},az=(e,t,n)=>{var r;return(r=e.selectedConditionsByType)==null?void 0:r.map(i=>i.type===t?n(i):i)},Uve=e=>e!==null&&SX(e)?e.getTime().toString():"*",ocn=(e,t,n,r,i)=>{const o=M.useMemo(()=>{var y;const l=e??{selectedConditionsByType:[]},u=(y=l.selectedConditionsByType)==null?void 0:y.find(v=>v.type===t);if(u===void 0)return"";const c=l.range,d=c===void 0?[]:[`time:[${Uve(c.start)} TO ${Uve(c.end)}]`],{type:f,conditions:h}=u,p=f==="None"?"*":`node_type:${f}`,g=h.map(v=>{const{value:b,field:x}=v;return`${x}:"${b}"`});return[p,...g,...d].join(" AND ")},[e,t]),{data:a,isLoading:s}=gsn(e==null?void 0:e.graph,o,n,r,i);return{queryResult:a,searchIsLoading:s}};function acn(){var te,be;const{masterGraphName:e,getTypeIcon:t,entityMap:n,nameProperty:r}=Fp(),i=pk(),[o,a]=bxe(pc.search),s=t??void 0,l=M.useMemo(()=>{var ne,ie;return((ie=(ne=o==null?void 0:o.committed)==null?void 0:ne.selectedConditionsByType)==null?void 0:ie.map(de=>de.type))??[]},[o]),u=M.useMemo(()=>l.length===0?[]:[...l,"Pinned"],[l]),c=(o==null?void 0:o.selectedTab)??"",d=c==="Pinned"?"Pinned":u.includes(c)?c:u[0],{pagination:f,setPage:h}=Oq({type:d,tab:d,pageSize:4}),{state:p,actions:g}=icn({...o==null?void 0:o.builderState,graph:e??((te=o.builderState)==null?void 0:te.graph)},a),{queryResult:y,searchIsLoading:v}=ocn(o==null?void 0:o.committed,d,f.page,f.pageSize,r),[b,x]=M.useState(void 0),w=(be=o.committed)==null?void 0:be.graph,E=azt(async()=>(await _E.pinnedNodes.toArray()).filter(ie=>ie.graph===w),[w],[]),C=ne=>{w!==void 0&&_E.pinnedNodes.add({id:`${w}-${ne}`,graph:w,name:ne})},T=ne=>{_E.pinnedNodes.delete(ne)},_=()=>{w!==void 0&&_E.pinnedNodes.where("graph").equals(w).delete()},[A,R]=M.useState("Query Builder"),I=()=>{a(ne=>({...ne,committed:ne==null?void 0:ne.builderState}))},N=ne=>{a(ie=>({...ie,selectedTab:ne}))},L=M.useRef(Date.now()).current,$=(E==null?void 0:E.map(ne=>ne.name))??[],{data:j}=xsn({graph:E?w:void 0,nodeNames:$,at:L,offset:f.page,limit:f.pageSize,nameProperty:r}),{data:W}=$Le(),q=t5e({baseGraph:w,viewedNodeName:b,nameProperty:r},void 0),H=M.useCallback(ne=>{i(pc.graph.buildPath({},{graphSource:void 0,initialNodes:ne,baseGraph:w}))},[i,w]),Y=M.useCallback((ne,ie)=>{i(pc.graph.buildPath({},{graphSource:ne,initialNodes:ie}))},[i]),Z=Object.fromEntries(p.availableTypes.map(ne=>[ne,n5e(ne)]));return k.jsxs(ti,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 60ch",gridTemplateAreas:['"top-left top-left top-left rhs-panel"','"tiles tiles tiles rhs-panel"','"tiles tiles tiles rhs-panel"'].join(` `),padding:ne=>ne.spacing(4,8),height:"100%"},children:[k.jsx(Iln,{resultsByType:y,pagination:f,setPage:h,onSearchGraph:I,setSelectedRhsTab:R,setViewedNodeName:x,selectedTypes:l,selectedTab:d,setSelectedTab:N,currentTabsShowing:u,getTypeIcon:s,pinnedNodes:E,pinnedNodesByPage:j,pinNode:C,unpinNode:T,clearPinnedNodes:_,listOfGraphs:W,onNavigateTo:H,navigateAfterAddNode:Y,searchIsLoading:v,typeColors:Z,graphName:w}),k.jsx(tcn,{queryBuilderProps:{state:p,graphList:W,onSearchGraph:I,disableGraphSelection:e!==void 0,editActions:g,entityMap:n,getTypeIcon:t,typeColors:Z},selectedRhsTab:A,setSelectedRhsTab:R,detailsPanelProps:q})]})}function scn(){const{graphqlAddress:e}=Fp();return M.useEffect(()=>{const t=new MutationObserver(n=>{n.forEach(r=>{r.addedNodes.forEach(i=>{i.nodeType===1&&i.classList.contains("CodeMirror-lint-tooltip")&&i.innerText.includes("Int cannot represent non 32-bit signed integer value")&&(i.style.opacity=0)})})});return t.observe(document.body,{childList:!0,subtree:!0}),()=>{t.disconnect()}},[]),k.jsx(mm,{fetcher:LUt({url:e??window.location.origin})})}function lcn(){return k.jsxs(ti,{id:"parent",direction:"row",height:"100%",sx:{maxHeight:"100%",overflow:"hidden"},children:[k.jsx(ncn,{}),k.jsx(lr,{sx:{flex:1,boxSizing:"border-box"},children:k.jsx(M.Suspense,{fallback:k.jsx("div",{children:"Loading"}),children:k.jsx(J8e,{})})})]})}var Hve=gr.object({graph:gr.string().optional(),range:gr.object({start:gr.coerce.date().nullable(),end:gr.coerce.date().nullable()}).optional(),selectedConditionsByType:gr.array(gr.object({type:gr.string(),conditions:gr.array(gr.object({field:gr.string(),value:gr.string(),op:gr.enum(["eq"])}))})).optional()}),pc={search:xP("search",{searchParams:{builderState:Ib(Hve),selectedTab:Ib(gr.string()),committed:Ib(Hve)}}),graph:xP("graph",{searchParams:{baseGraph:Ib(gr.string()),graphSource:Ib(gr.string()),initialNodes:Ib(gr.array(gr.string())).default([])}}),savedGraphs:xP("saved-graphs"),gqlPlayground:xP("playground")};function ucn(...e){return l$e([{path:"/",element:k.jsx(lcn,{}),children:[{path:"/",loader:()=>u8e(pc.search.path)},{path:pc.search.path,element:k.jsx(acn,{})},{path:pc.savedGraphs.path,element:k.jsx(Zln,{})},{path:pc.graph.path,element:k.jsx(rcn,{})},{path:pc.gqlPlayground.path,element:k.jsx(scn,{})},...e]}])}var ccn={panelPadding:{top:50,bottom:150,left:10,defaultPadding:[90,0,306,10]},typography:{fontFamily:["Manrope","-apple-system","BlinkMacSystemFont","sans-serif"].join(","),fontSize:12,button:{fontSize:"0.75rem"}},components:{MuiTableCell:{styleOverrides:{head:({theme:e})=>({color:e.palette.primary.main})}},MuiButton:{styleOverrides:{root:({theme:e})=>({variants:[],textTransform:"none",padding:e.spacing(.5)}),startIcon:({theme:e})=>({marginLeft:0,marginRight:e.spacing(.5)}),endIcon:({theme:e})=>({marginLeft:e.spacing(.5),marginRight:0})}},MuiListItemIcon:{styleOverrides:{root:({theme:e})=>({"&.MuiListItemIcon-root":{minWidth:e.spacing(3.5)}})}},MuiListItemText:{styleOverrides:{inset:({theme:e})=>({"&.MuiListItemText-inset":{paddingLeft:e.spacing(3.5)}})}}},palette:{primary:{main:"#4C5970",dark:"#384A66"},secondary:{main:"#1977DF"},info:{main:"#d63890"}}};function dcn({children:e,theme:t,...n}){const r=hY(Wan(t,ccn));return k.jsxs(tHe,{theme:r,...n,children:[k.jsx(_Ye,{}),e]})}function fcn(e){const t=Usn(),n=ucn(...e.additionalRoutes??[]),i=window.location.origin+"/graphql/",o=e.graphqlAddress??i;return k.jsx(M.Suspense,{fallback:k.jsx("div",{children:"Loading"}),children:k.jsx(ULe.Provider,{value:t,children:k.jsx(Bln,{children:k.jsx(kJ.Provider,{value:e,children:k.jsx(esn,{address:o,children:k.jsx(dcn,{theme:e.muiTheme,children:k.jsx(v$e,{router:n})})})})})})})}var m5e,Wve=Kg;m5e=Wve.createRoot,Wve.hydrateRoot;const hcn=document.getElementsByTagName("head")[0],OJ=document.createElement("link");OJ.rel="shortcut icon";OJ.href=Jln;hcn.appendChild(OJ);const pcn=window.location.origin;m5e(document.getElementById("root")??document.body).render(k.jsx(fcn,{graphqlAddress:pcn}));var gcn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sz={exports:{}},qve;function Zu(){return qve||(qve=1,function(e,t){(function(n,r){e.exports=r()})(gcn,function(){var n=navigator.userAgent,r=navigator.platform,i=/gecko\/\d/i.test(n),o=/MSIE \d/.test(n),a=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(n),s=/Edge\/(\d+)/.exec(n),l=o||a||s,u=l&&(o?document.documentMode||6:+(s||a)[1]),c=!s&&/WebKit\//.test(n),d=c&&/Qt\/\d+\.\d+/.test(n),f=!s&&/Chrome\//.test(n),h=/Opera\//.test(n),p=/Apple Computer/.test(navigator.vendor),g=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(n),y=/PhantomJS/.test(n),v=p&&(/Mobile\/\w+/.test(n)||navigator.maxTouchPoints>2),b=/Android/.test(n),x=v||b||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(n),w=v||/Mac/.test(r),E=/\bCrOS\b/.test(n),C=/win/i.test(r),T=h&&n.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(h=!1,c=!0);var _=w&&(d||h&&(T==null||T<12.11)),A=i||l&&u>=9;function R(m){return new RegExp("(^|\\s)"+m+"(?:$|\\s)\\s*")}var I=function(m,S){var O=m.className,P=R(S).exec(O);if(P){var D=O.slice(P.index+P[0].length);m.className=O.slice(0,P.index)+(D?P[1]+D:"")}};function N(m){for(var S=m.childNodes.length;S>0;--S)m.removeChild(m.firstChild);return m}function L(m,S){return N(m).appendChild(S)}function $(m,S,O,P){var D=document.createElement(m);if(O&&(D.className=O),P&&(D.style.cssText=P),typeof S=="string")D.appendChild(document.createTextNode(S));else if(S)for(var B=0;B=S)return G+(S-B);G+=X-B,G+=O-G%O,B=X+1}}var de=function(){this.id=null,this.f=null,this.time=0,this.handler=be(this.onTimeout,this)};de.prototype.onTimeout=function(m){m.id=0,m.time<=+new Date?m.f():setTimeout(m.handler,m.time-+new Date)},de.prototype.set=function(m,S){this.f=S;var O=+new Date+m;(!this.id||O=S)return P+Math.min(G,S-D);if(D+=B-P,D+=O-D%O,P=B+1,D>=S)return P}}var _e=[""];function Pe(m){for(;_e.length<=m;)_e.push(ye(_e)+" ");return _e[m]}function ye(m){return m[m.length-1]}function Fe(m,S){for(var O=[],P=0;P"€"&&(m.toUpperCase()!=m.toLowerCase()||dt.test(m))}function Kt(m,S){return S?S.source.indexOf("\\w")>-1&&mt(m)?!0:S.test(m):mt(m)}function ot(m){for(var S in m)if(m.hasOwnProperty(S)&&m[S])return!1;return!0}var Tt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Rt(m){return m.charCodeAt(0)>=768&&Tt.test(m)}function Ft(m,S,O){for(;(O<0?S>0:SO?-1:1;;){if(S==O)return S;var D=(S+O)/2,B=P<0?Math.ceil(D):Math.floor(D);if(B==S)return m(B)?S:O;m(B)?O=B:S=B+P}}function Qe(m,S,O,P){if(!m)return P(S,O,"ltr",0);for(var D=!1,B=0;BS||S==O&&G.to==S)&&(P(Math.max(G.from,S),Math.min(G.to,O),G.level==1?"rtl":"ltr",B),D=!0)}D||P(S,O,"ltr")}var We=null;function ht(m,S,O){var P;We=null;for(var D=0;DS)return D;B.to==S&&(B.from!=B.to&&O=="before"?P=D:We=D),B.from==S&&(B.from!=B.to&&O!="before"?P=D:We=D)}return P??We}var un=function(){var m="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",S="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function O(oe){return oe<=247?m.charAt(oe):1424<=oe&&oe<=1524?"R":1536<=oe&&oe<=1785?S.charAt(oe-1536):1774<=oe&&oe<=2220?"r":8192<=oe&&oe<=8203?"w":oe==8204?"b":"L"}var P=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,D=/[stwN]/,B=/[LRr]/,G=/[Lb1n]/,X=/[1n]/;function Q(oe,Te,Oe){this.level=oe,this.from=Te,this.to=Oe}return function(oe,Te){var Oe=Te=="ltr"?"L":"R";if(oe.length==0||Te=="ltr"&&!P.test(oe))return!1;for(var it=oe.length,Ke=[],Ot=0;Ot-1&&(P[S]=D.slice(0,B).concat(D.slice(B+1)))}}}function et(m,S){var O=ze(m,S);if(O.length)for(var P=Array.prototype.slice.call(arguments,2),D=0;D0}function $n(m){m.prototype.on=function(S,O){st(this,S,O)},m.prototype.off=function(S,O){_t(this,S,O)}}function cr(m){m.preventDefault?m.preventDefault():m.returnValue=!1}function ur(m){m.stopPropagation?m.stopPropagation():m.cancelBubble=!0}function Lr(m){return m.defaultPrevented!=null?m.defaultPrevented:m.returnValue==!1}function hi(m){cr(m),ur(m)}function ii(m){return m.target||m.srcElement}function Jr(m){var S=m.which;return S==null&&(m.button&1?S=1:m.button&2?S=3:m.button&4&&(S=2)),w&&m.ctrlKey&&S==1&&(S=3),S}var Vi=function(){if(l&&u<9)return!1;var m=$("div");return"draggable"in m||"dragDrop"in m}(),kr;function Re(m){if(kr==null){var S=$("span","​");L(m,$("span",[S,document.createTextNode("x")])),m.firstChild.offsetHeight!=0&&(kr=S.offsetWidth<=1&&S.offsetHeight>2&&!(l&&u<8))}var O=kr?$("span","​"):$("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return O.setAttribute("cm-text",""),O}var De;function Xe(m){if(De!=null)return De;var S=L(m,document.createTextNode("AخA")),O=W(S,0,1).getBoundingClientRect(),P=W(S,1,2).getBoundingClientRect();return N(m),!O||O.left==O.right?!1:De=P.right-O.right<3}var tt=` b`.split(/\n/).length!=3?function(m){for(var S=0,O=[],P=m.length;S<=P;){var D=m.indexOf(` diff --git a/raphtory-graphql/src/server.rs b/raphtory-graphql/src/server.rs index bc6515cab..ca1c6cba3 100644 --- a/raphtory-graphql/src/server.rs +++ b/raphtory-graphql/src/server.rs @@ -246,6 +246,7 @@ impl GraphServer { .at("/", get(ui).post(GraphQL::new(schema))) .at("/graph", get(ui)) .at("/search", get(ui)) + .at("/saved-graphs", get(ui)) .at("/playground", get(ui)) .at("/health", get(health)) .with(CookieJarManager::new())