summaryrefslogtreecommitdiff
path: root/out/_next/static/chunks
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-09-12 19:38:51 +0200
committerThomas F. K. Jorna <[email protected]>2021-09-12 19:38:51 +0200
commita21b4afd4f54a53e5d563c3d02195e05f48a4700 (patch)
tree80f88f77b326cac182ef38ae14b6bc3a2e8f12c8 /out/_next/static/chunks
parent2f6545337d832c766feaae1854b936bb3d1d9557 (diff)
fix: #81 Ui now loads on empty db
Diffstat (limited to 'out/_next/static/chunks')
-rw-r--r--out/_next/static/chunks/pages/index-b52c9d7fa8c7209bbb6a.js (renamed from out/_next/static/chunks/pages/index-f5d1a43f5f82d3f9b8af.js)2
1 files changed, 1 insertions, 1 deletions
diff --git a/out/_next/static/chunks/pages/index-f5d1a43f5f82d3f9b8af.js b/out/_next/static/chunks/pages/index-b52c9d7fa8c7209bbb6a.js
index 63e23cc..7dbb0de 100644
--- a/out/_next/static/chunks/pages/index-f5d1a43f5f82d3f9b8af.js
+++ b/out/_next/static/chunks/pages/index-b52c9d7fa8c7209bbb6a.js
@@ -1 +1 @@
-(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{96834:function(e,n,t){"use strict";t.r(n),t.d(n,{Graph:function(){return Te},GraphPage:function(){return ze},default:function(){return Ne}});var r=t(87757),i=t.n(r),o=t(92137),l=t(85893),s=t(87329),a=t(96156),c=t(34699),u=t(67294);function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,a.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function g(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=f(e,null!==(t=r.storage)&&void 0!==t?t:localStorage),o=i.get(),l=void 0!==o?o:n;l!==o&&i.update(l);var s="object"===typeof o?h(h({},o),l):l,a=(0,u.useState)(s),c=a[0],d=a[1];(0,u.useEffect)((function(){c!==s&&d(s)}),[e]);var g=function(e){e instanceof Function?d((function(n){var t=e(n);return i.update(t),t})):(d(e),i.update(e))};return[c,g]}function f(e,n){return{get:function(){var t=n.getItem(e);if(t&&"undefined"!==t)return JSON.parse(t)},update:function(t){n.setItem(e,JSON.stringify(t))},remove:function(){n.removeItem(e)}}}var x=t(54533),p=t(54309),j=t(32351),m=t(40980),v=t(48017),b=t(74860),C=t(36194),y=[],k={};for(var w in C.oY)for(var S in C.oY[w]){var I=w+S;"LinearNone"===I&&(I="Linear"),y.push(I),k[I]=C.oY[w][S]}var L=k,O={enabled:!0,charge:-700,collision:!0,collisionStrength:20,centering:!0,centeringStrength:.2,linkStrength:.3,linkIts:1,alphaDecay:.05,alphaTarget:0,alphaMin:0,velocityDecay:.25,gravity:.3,gravityOn:!0,gravityLocal:!1},N={orphans:!1,parent:"heading",filelessCites:!1,tagsBlacklist:[],tagsWhitelist:[],bad:!0,nodes:[],links:[],date:[]},z={particles:!1,particlesNumber:0,particlesWidth:4,arrows:!1,arrowsLength:1,arrowsPos:.5,arrowsColor:"",linkOpacity:.8,linkWidth:1,nodeRel:4,nodeOpacity:1,nodeResolution:12,labels:2,labelScale:1.5,labelFontSize:13,labelLength:40,highlight:!0,highlightNodeSize:2,highlightLinkSize:2,highlightFade:.8,highlightAnim:!0,animationSpeed:420,algorithmOptions:y,algorithmName:"SinusoidalOut",linkColorScheme:"gray.500",nodeColorScheme:["red.500","gray.600","yellow.500","green.500","cyan.500","blue.500","pink.500","purple.500","orange.500"],nodeHighlight:"purple.500",linkHighlight:"purple.500",backgroundColor:"white",emacsNodeColor:"gray.800",labelTextColor:"gray.900",labelBackgroundColor:"",labelBackgroundOpacity:.7,citeDashes:!0,citeDashLength:35,citeGapLength:15,citeLinkColor:"gray.700",citeLinkHighlightColor:"",citeNodeColor:"black",refDashes:!0,refDashLength:35,refGapLength:15,refLinkColor:"gray.700",refLinkHighlightColor:"",refNodeColor:"black",nodeSizeLinks:.5},T={follow:"zoom",localSame:"add",zoomPadding:200,zoomSpeed:2e3},D={highlight:"hover",local:"click",follow:"double",context:"right"},E=["red.500","orange.500","yellow.500","green.500","cyan.500","blue.500","pink.500","purple.500","white","gray.100","gray.200","gray.300","gray.400","gray.500","gray.600","gray.700","gray.800","gray.900","black"],R=t(81253),F=t(93924),Z=t(83986),P=t(48931),H=t(6569),A=t(67546),B=t(93441),V=t(24189),M=t(2827),W=t(48420),X=t(96699),_=t(40155),q=t(56769),U=t(336),G=t(72026),Q=t(94096),K=t(64115),J=t(48235),Y=t(67273),$=t(88134),ee=t(15267),ne=t(46049),te=t(95818),re=t(47647),ie=t(86658),oe=t(29356);function le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?le(Object(t),!0).forEach((function(n){(0,a.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ae=function(e){var n=e.physics,t=e.setPhysics,r=e.threeDim,i=e.setThreeDim,o=e.filter,d=e.setFilter,h=e.visuals,f=e.setVisuals,x=e.mouse,p=e.setMouse,j=e.behavior,m=e.setBehavior,b=e.tags,C=e.tagColors,y=e.setTagColors,k=g("showTweaks",!1),w=(0,c.Z)(k,2),S=w[0],I=w[1],L=(0,u.useContext)(oe.N),V=L.highlightColor,M=L.setHighlightColor,te=(0,u.useCallback)((function(e){return f(e)}),[]),re=(0,u.useCallback)((function(e,n,r){t((function(t){return se(se({},t),{},(0,a.Z)({},n,e/r))}))}),[]);return S?(0,l.jsxs)(v.xu,{bg:"alt.100",w:"xs",marginTop:10,marginLeft:10,borderRadius:"xl",paddingBottom:5,zIndex:300,position:"relative",boxShadow:"xl",maxH:.92*globalThis.innerHeight,marginBottom:10,children:[(0,l.jsxs)(v.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:2,paddingTop:1,children:[(0,l.jsx)(X.u,{label:"2D",children:(0,l.jsx)(_.z,{onClick:function(){return i(!r)},variant:"ghost",zIndex:"overlay",children:r?"3D":"2D"})}),(0,l.jsxs)(v.xu,{display:"flex",alignItems:"center",children:[(0,l.jsx)(X.u,{label:"Reset settings to defaults",children:(0,l.jsx)(W.h,{"aria-label":"Reset Defaults",icon:(0,l.jsx)(Z.A,{}),onClick:function(){f(z),d(N),p(D),t(O),m(T)},variant:"none",size:"sm"})}),(0,l.jsx)(W.h,{size:"sm",icon:(0,l.jsx)(P.T,{}),"aria-label":"Close Tweak Panel",variant:"ghost",onClick:function(){return I(!1)}})]})]}),(0,l.jsx)(ie.ZP,{autoHeight:!0,autoHeightMax:.85*globalThis.innerHeight,autoHide:!0,renderThumbVertical:function(e){var n=e.style,t=(0,R.Z)(e,["style"]);return(0,l.jsx)(v.xu,se(se({},t),{},{style:se(se({},n),{},{borderRadius:10}),bg:V}))},children:(0,l.jsxs)(q.UQ,{allowMultiple:!0,allowToggle:!0,color:"black",children:[(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Filter"})]}),(0,l.jsxs)(q.Hk,{children:[(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Link children to..."}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:function(){switch(o.parent){case"parent":return(0,l.jsx)(K.x,{children:"File"});case"heading":return(0,l.jsx)(K.x,{children:"Heading"});default:return(0,l.jsx)(K.x,{children:"Nothing"})}}()}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return d((function(e){return se(se({},e),{},{parent:""})}))},children:"Nothing"}),(0,l.jsx)(J.sN,{onClick:function(){return d((function(e){return se(se({},e),{},{parent:"parent"})}))},children:"Parent file node"}),(0,l.jsx)(J.sN,{onClick:function(){return d((function(e){return se(se({},e),{},{parent:"heading"})}))},children:"Next highest heading node"})]})]})]})]}),(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Orphans"}),(0,l.jsx)($.r,{onChange:function(){d((function(e){return se(se({},e),{},{orphans:!e.orphans})}))},isChecked:o.orphans})]}),(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Citations without note files"}),(0,l.jsx)($.r,{onChange:function(){d(se(se({},o),{},{filelessCites:!o.filelessCites}))},isChecked:o.filelessCites})]}),(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Non-existant nodes"}),(0,l.jsx)($.r,{onChange:function(){y(se(se({},C),{},{bad:"white"})),d(se(se({},o),{},{bad:!o.bad}))},isChecked:o.bad})]})]}),(0,l.jsxs)(q.UQ,{padding:0,allowToggle:!0,allowMultiple:!0,paddingLeft:3,children:[(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:["Tag filters",(0,l.jsx)(q.XE,{})]}),(0,l.jsxs)(q.Hk,{pr:0,mr:0,children:[(0,l.jsx)(ge,{highlightColor:V,filter:o,setFilter:d,tags:b,mode:"blacklist"}),(0,l.jsx)(ge,{highlightColor:V,filter:o,setFilter:d,tags:b,mode:"whitelist"})]})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:["Tag Colors",(0,l.jsx)(q.XE,{})]}),(0,l.jsx)(q.Hk,{pr:0,mr:0,children:(0,l.jsx)(fe,{tags:b,colorList:E,tagColors:C,setTagColors:y,highlightColor:V})})]})]})]})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsx)(q.KF,{display:"flex",justifyContent:"space-between",children:(0,l.jsxs)(v.xu,{display:"flex",children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Physics"})]})}),(0,l.jsxs)(q.Hk,{children:[(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsxs)(de,{label:"Gravity",value:n.gravityOn,onChange:function(){return t(se(se({},n),{},{gravityOn:!n.gravityOn}))},children:[(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Also in local"}),(0,l.jsx)($.r,{onChange:function(){t((function(e){return se(se({},e),{},{gravityLocal:!e.gravityLocal})}))},isChecked:n.gravityLocal})]}),(0,l.jsx)(ue,{label:"Strength",value:10*n.gravity,onChange:function(e){return re(e,"gravity",10)}})]}),(0,l.jsx)(ue,{value:-n.charge/100,onChange:function(e){return re(e,"charge",-.01)},label:"Repulsive Force"}),(0,l.jsx)(de,{label:"Collision",infoText:"Perfomance sap, disable if slow",value:n.collision,onChange:function(){return t(se(se({},n),{},{collision:!n.collision}))},children:(0,l.jsx)(ue,{value:n.collisionStrength/5,onChange:function(e){return re(e,"collisionStrength",.2)},label:"Collision Radius",infoText:"Easy with this one, high values can lead to a real jiggly mess"})}),(0,l.jsx)(ue,{value:5*n.linkStrength,onChange:function(e){return re(e,"linkStrength",5)},label:"Link Force"}),(0,l.jsx)(ue,{label:"Link Iterations",value:n.linkIts,onChange:function(e){return re(e,"linkIts",1)},min:0,max:6,step:1,infoText:"How many links down the line the physics of a single node affects (Slow)"}),(0,l.jsx)(ue,{label:"Viscosity",value:10*n.velocityDecay,onChange:function(e){return re(e,"velocityDecay",10)}})]}),(0,l.jsx)(v.xu,{children:(0,l.jsx)(q.UQ,{paddingLeft:3,allowToggle:!0,children:(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(K.x,{children:"Advanced"}),(0,l.jsx)(q.XE,{marginRight:2})]}),(0,l.jsx)(q.Hk,{children:(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:3,color:"gray.800",children:[(0,l.jsx)(ue,{label:"Stabilization rate",value:50*n.alphaDecay,onChange:function(e){return re(e,"alphaDecay",50)}}),(0,l.jsx)(de,{label:"Center nodes",value:n.centering,onChange:function(){return t(se(se({},n),{},{centering:!n.centering}))},infoText:"Keeps the nodes in the center of the viewport. If disabled you can drag the nodes anywhere you want.",children:(0,l.jsx)(ue,{label:"Centering Strength",value:n.centeringStrength,max:2,step:.01,onChange:function(e){return re(e,"centeringStrength",1)}})})]})})]})})})]})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Visual"})]}),(0,l.jsx)(q.Hk,{children:(0,l.jsxs)(G.gC,{justifyContent:"flex-start",align:"stretch",children:[(0,l.jsx)(q.UQ,{allowToggle:!0,defaultIndex:[0],paddingLeft:3,children:(0,l.jsxs)(q.Qd,{children:[(0,l.jsx)(q.KF,{children:(0,l.jsxs)(Q.k,{justifyContent:"space-between",w:"100%",children:[(0,l.jsx)(K.x,{children:"Colors"}),(0,l.jsx)(q.XE,{marginRight:2})]})}),(0,l.jsx)(q.Hk,{children:(0,l.jsx)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",color:"gray.800",children:(0,l.jsxs)(v.xu,{children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Nodes"}),(0,l.jsx)(X.u,{label:"Shuffle node colors",children:(0,l.jsx)(W.h,{"aria-label":"Shuffle node colors",size:"sm",icon:(0,l.jsx)(A.n,{}),variant:"ghost",onClick:function(){var e,n=null!==(e=h.nodeColorScheme)&&void 0!==e?e:[];f(se(se({},h),{},{nodeColorScheme:n.map((function(e){return[Math.random(),e]})).sort((function(e,n){return(0,c.Z)(e,1)[0]-(0,c.Z)(n,1)[0]})).map((function(e){var n=(0,c.Z)(e,2);n[0];return n[1]}))}))}})}),(0,l.jsx)(X.u,{label:"Cycle node colors",children:(0,l.jsx)(W.h,{"aria-label":"Shift node colors",icon:(0,l.jsx)(B.L,{}),size:"sm",variant:"ghost",onClick:function(){var e,n=null!==(e=h.nodeColorScheme)&&void 0!==e?e:[];f(se(se({},h),{},{nodeColorScheme:[].concat((0,s.Z)(n.slice(1,n.length)),[n[0]])}))}})}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",closeOnSelect:!1,matchWidth:!0,children:[(0,l.jsx)(J.j2,{width:20,as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(Q.k,{height:6,width:6,flexDirection:"column",flexWrap:"wrap",children:h.nodeColorScheme.map((function(e){return(0,l.jsx)(v.xu,{bgColor:e,flex:"1 1 8px",borderRadius:"2xl"},e)}))})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsx)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:(0,l.jsx)(J.__,{width:500,type:"checkbox",defaultValue:h.nodeColorScheme,onChange:function(e){e.length&&f(se(se({},h),{},{nodeColorScheme:e}))},children:E.map((function(e){return(0,l.jsx)(J.ii,{isChecked:h.nodeColorScheme.some((function(n){return n===e})),value:e,isDisabled:1===h.nodeColorScheme.length&&h.nodeColorScheme[0]===e,children:(0,l.jsx)(v.xu,{justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})})},e)}))})})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Links"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(v.xu,{children:h.linkColorScheme?(0,l.jsx)(v.xu,{bgColor:h.linkColorScheme,borderRadius:"sm",height:6,width:6}):(0,l.jsx)(Q.k,{height:6,width:6,flexDirection:"column",flexWrap:"wrap",children:h.nodeColorScheme.map((function(e){return(0,l.jsx)(v.xu,{bgColor:e,flex:"1 1 8px",borderRadius:"2xl"},e)}))})})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{linkColorScheme:""}))},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(Q.k,{height:6,width:6,flexDirection:"column",flexWrap:"wrap",children:h.nodeColorScheme.map((function(e){return(0,l.jsx)(v.xu,{bgColor:e,flex:"1 1 8px",borderRadius:"2xl"},e)}))})}),E.map((function(e){return(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{linkColorScheme:e}))},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})},e)}))]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Accent"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(v.xu,{bgColor:V,borderRadius:"sm",height:6,width:6})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsx)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:E.map((function(e){return(0,l.jsx)(J.sN,{onClick:function(){return M(e)},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})},e)}))})]})]})]}),(0,l.jsx)(he,{colorList:E,label:"Link highlight",setVisuals:te,value:"linkHighlight",visValue:h.linkHighlight}),(0,l.jsx)(he,{colorList:E,label:"Node highlight",setVisuals:te,value:"nodeHighlight",visValue:h.nodeHighlight}),(0,l.jsx)(he,{colorList:E,label:"Background",setVisuals:te,value:"backgroundColor",visValue:h.backgroundColor}),(0,l.jsx)(he,{colorList:E,label:"Emacs node",setVisuals:te,value:"emacsNodeColor",visValue:h.emacsNodeColor})]})})})]})}),(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsx)(ue,{label:"Node size",value:h.nodeRel,onChange:function(e){return f(se(se({},h),{},{nodeRel:e}))}}),(0,l.jsx)(ue,{label:"Node connections size scale",value:h.nodeSizeLinks,min:0,max:2,onChange:function(e){return f(se(se({},h),{},{nodeSizeLinks:e}))}}),r&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ue,{label:"Node opacity",value:h.nodeOpacity,min:0,max:1,onChange:function(e){return f(se(se({},h),{},{nodeOpacity:e}))}}),(0,l.jsx)(ue,{label:"Node resolution",value:h.nodeResolution,min:5,max:32,step:1,onChange:function(e){return f(se(se({},h),{},{nodeResolution:e}))}})]}),(0,l.jsx)(ue,{label:"Link width",value:h.linkWidth,onChange:function(e){return f(se(se({},h),{},{linkWidth:e}))}}),r&&(0,l.jsx)(ue,{label:"Link opacity",min:0,max:1,value:h.linkOpacity,onChange:function(e){return f(se(se({},h),{},{linkOpacity:e}))}}),(0,l.jsxs)(de,{label:"Dash cite links",infoText:"Add dashes to citation links made with org-roam-bibtex",value:h.citeDashes,onChange:function(){return f(se(se({},h),{},{citeDashes:!h.citeDashes}))},children:[(0,l.jsx)(ue,{label:"Dash length",value:h.citeDashLength/10,onChange:function(e){return f(se(se({},h),{},{citeDashLength:10*e}))}}),(0,l.jsx)(ue,{label:"Gap length",value:h.citeGapLength/5,onChange:function(e){return f(se(se({},h),{},{citeGapLength:5*e}))}})]}),(0,l.jsx)(he,{colorList:E,label:"Citation node color",setVisuals:te,value:"citeNodeColor",visValue:h.citeNodeColor}),(0,l.jsx)(he,{colorList:E,label:"Citation link color",setVisuals:te,value:"citeLinkColor",visValue:h.citeLinkColor}),(0,l.jsx)(he,{colorList:E,label:"Reference link highlight",setVisuals:te,value:"citeLinkHighlightColor",visValue:h.citeLinkHighlightColor}),(0,l.jsxs)(de,{label:"Dash ref links",infoText:"Add dashes to citation links, whose target has a note, made with org-roam-bibtex",value:h.refDashes,onChange:function(){return f(se(se({},h),{},{refDashes:!h.refDashes}))},children:[(0,l.jsx)(ue,{label:"Dash length",value:h.refDashLength/10,onChange:function(e){return f(se(se({},h),{},{refDashLength:10*e}))}}),(0,l.jsx)(ue,{label:"Gap length",value:h.refGapLength/5,onChange:function(e){return f(se(se({},h),{},{refGapLength:5*e}))}})]}),(0,l.jsx)(he,{colorList:E,label:"Reference node color",setVisuals:te,value:"refNodeColor",visValue:h.refNodeColor}),(0,l.jsx)(he,{colorList:E,label:"Reference link color",setVisuals:te,value:"refLinkColor",visValue:h.refLinkColor}),(0,l.jsx)(he,{colorList:E,label:"Reference link highlight",setVisuals:te,value:"refLinkHighlightColor",visValue:h.refLinkHighlightColor}),(0,l.jsxs)(v.xu,{children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Labels"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:h.labels?h.labels<2?"On Highlight":"Always":"Never"}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:0}))},children:"Never"}),(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:1}))},children:"On Highlight"}),(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:2}))},children:"Always"}),(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:3}))},children:"Always (even in 3D)"})]})]})]})]}),(0,l.jsx)(ee.U,{in:h.labels>0,animateOpacity:!0,children:(0,l.jsxs)(G.gC,{spacing:1,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.400"}),align:"stretch",paddingLeft:2,color:"gray.800",children:[(0,l.jsx)(ue,{label:"Label font size",value:h.labelFontSize,min:5,max:20,step:.5,onChange:function(e){return f(se(se({},h),{},{labelFontSize:e}))}}),(0,l.jsx)(ue,{label:"Maximum label characters",value:h.labelLength,min:10,max:100,step:1,onChange:function(e){return f(se(se({},h),{},{labelLength:e}))}}),(0,l.jsx)(he,{colorList:E,label:"Text",setVisuals:te,value:"labelTextColor",visValue:h.labelTextColor}),(0,l.jsx)(he,{colorList:E,label:"Background",setVisuals:te,value:"labelBackgroundColor",visValue:h.labelBackgroundColor}),(0,l.jsx)(ee.U,{in:!!h.labelBackgroundColor,animateOpacity:!0,children:(0,l.jsx)(v.xu,{paddingTop:2,children:(0,l.jsx)(ue,{label:"Background opacity",value:h.labelBackgroundOpacity,onChange:function(e){console.log(h.labelBackgroundOpacity),f(se(se({},h),{},{labelBackgroundOpacity:e}))},min:0,max:1,step:.01})})}),(0,l.jsx)(ee.U,{in:h.labels>1,animateOpacity:!0,children:(0,l.jsx)(v.xu,{paddingTop:2,children:(0,l.jsx)(ue,{label:"Label Appearance Scale",value:5*h.labelScale,onChange:function(e){return f(se(se({},h),{},{labelScale:e/5}))}})})})]})})]}),(0,l.jsxs)(de,{label:"Link arrows",value:h.arrows,onChange:function(){return f(se(se({},h),{},{arrows:!h.arrows}))},children:[(0,l.jsx)(ue,{label:"Arrow size",value:h.arrowsLength/10,onChange:function(e){return f(se(se({},h),{},{arrowsLength:10*e}))}}),(0,l.jsx)(ue,{label:"Arrow Position",value:h.arrowsPos,min:0,max:1,step:.01,onChange:function(e){return f(se(se({},h),{},{arrowsPos:e}))}}),(0,l.jsx)(he,{colorList:E,label:"Arrow Color",setVisuals:te,value:"arrowsColor",visValue:h.arrowsColor},"arrow")]}),(0,l.jsxs)(de,{label:"Directional Particles",value:h.particles,onChange:function(){return f(se(se({},h),{},{particles:!h.particles}))},children:[(0,l.jsx)(ue,{label:"Particle Number",value:h.particlesNumber,max:5,step:1,onChange:function(e){return f(se(se({},h),{},{particlesNumber:e}))}}),(0,l.jsx)(ue,{label:"Particle Size",value:h.particlesWidth,onChange:function(e){return f(se(se({},h),{},{particlesWidth:e}))}})]}),(0,l.jsx)(de,{label:"Highlight",onChange:function(){return f(se(se({},h),{},{highlight:!h.highlight}))},value:h.highlight,children:(0,l.jsxs)(G.gC,{spacing:1,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.400"}),align:"stretch",paddingLeft:0,children:[(0,l.jsx)(ue,{label:"Highlight Link Thickness",value:h.highlightLinkSize,onChange:function(e){return f(se(se({},h),{},{highlightLinkSize:e}))}}),(0,l.jsx)(ue,{label:"Highlight Node Size",value:h.highlightNodeSize,onChange:function(e){return f(se(se({},h),{},{highlightNodeSize:e}))}}),(0,l.jsx)(ue,{min:0,max:1,label:"Highlight Fade",value:h.highlightFade,onChange:function(e){return f(se(se({},h),{},{highlightFade:e}))}}),(0,l.jsxs)(de,{label:"Highlight Animation",onChange:function(){f(se(se({},h),{},{highlightAnim:!h.highlightAnim}))},value:h.highlightAnim,children:[(0,l.jsx)(ue,{label:"Animation speed",onChange:function(e){return f(se(se({},h),{},{animationSpeed:e}))},value:h.animationSpeed,infoText:"Slower speed has a chance of being buggy",min:50,max:1e3,step:10}),(0,l.jsx)(ne.Ph,{placeholder:h.algorithmName,onChange:function(e){f(se(se({},h),{},{algorithmName:e.target.value}))},children:h.algorithmOptions.map((function(e){return(0,l.jsx)("option",{value:e,children:e},e)}))})]})]})})]})]})})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Behavior"})]}),(0,l.jsx)(q.Hk,{children:(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsxs)(Q.k,{children:[(0,l.jsx)(K.x,{children:"Expand Node"}),(0,l.jsx)(ce,{infoText:"View only the node and its direct neighbors"})]}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:x.local?x.local[0].toUpperCase()+x.local.slice(1):"Never"})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:""}))},children:"Never"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:"click"}))},children:"Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:"double"}))},children:"Double Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:"right"}))},children:"Right Click"})]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Open in Emacs"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:x.follow?x.follow[0].toUpperCase()+x.follow.slice(1):"Never"})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:""}))},children:"Never"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:"click"}))},children:"Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:"double"}))},children:"Double Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:"right"}))},children:"Right Click"})]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Follow Emacs by..."}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:j.follow[0].toUpperCase()+j.follow.slice(1)})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{follow:"color"}))},children:"Just coloring the currently opened node"}),(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{follow:"local"}))},children:"Opening the local graph"}),(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{follow:"zoom"}))},children:"Zooming to the current node"})]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsxs)(Q.k,{children:[(0,l.jsx)(K.x,{children:"Local graph"}),(0,l.jsx)(ce,{infoText:"When in local mode and clicking a new node, should I add that node's local graph or open the new one?"})]}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:"add"===j.localSame?"Add":"Replace"})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{localSame:"replace"}))},children:"Open that nodes graph"}),(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{localSame:"add"}))},children:"Add node to local graph"})]})]})]})]}),(0,l.jsx)(ue,{label:"Zoom speed",value:j.zoomSpeed,min:0,max:4e3,step:100,onChange:function(e){return m(se(se({},j),{},{zoomSpeed:e}))}}),(0,l.jsx)(ue,{label:"Zoom padding",value:j.zoomPadding,min:0,max:400,step:1,onChange:function(e){return m(se(se({},j),{},{zoomPadding:e}))},infoText:"How much to zoom out to accomodate all nodes when changing the view."})]})})]})]})})]}):(0,l.jsx)(v.xu,{position:"absolute",zIndex:"overlay",marginTop:10,marginLeft:10,display:S?"none":"block",children:(0,l.jsx)(W.h,{variant:"ghost","aria-label":"Settings",icon:(0,l.jsx)(F.e,{}),onClick:function(){return I(!0)}})})},ce=function(e){var n=e.infoText;return(0,l.jsx)(v.xu,{paddingLeft:"1",children:(0,l.jsx)(X.u,{label:n,placement:"top",color:"gray.100",bg:"gray.800",hasArrow:!0,children:(0,l.jsx)(V.h,{})})})},ue=function(e){var n=e.min,t=void 0===n?0:n,r=e.max,i=void 0===r?10:r,o=e.step,s=void 0===o?.1:o,a=e.value,c=void 0===a?1:a,d=(0,R.Z)(e,["min","max","step","value"]),h=d.onChange,g=d.label,f=d.infoText,x=(0,u.useContext)(oe.N).highlightColor;return(0,l.jsxs)(v.xu,{children:[(0,l.jsxs)(v.xu,{display:"flex",alignItems:"flex-end",children:[(0,l.jsx)(K.x,{children:g}),f&&(0,l.jsx)(ce,{infoText:f})]}),(0,l.jsxs)(te.iR,{value:c,onChange:h,min:t,max:i,step:s,children:[(0,l.jsx)(te.Uj,{children:(0,l.jsx)(te.Ms,{})}),(0,l.jsx)(X.u,{bg:x,label:c.toFixed(1),children:(0,l.jsx)(te.gs,{bg:"white"})})]})]},g)},de=function(e){var n=e.value,t=e.onChange,r=e.label,i=e.infoText,o=e.children;return(0,l.jsxs)(v.xu,{paddingTop:2,children:[(0,l.jsxs)(v.xu,{display:"flex",justifyContent:"space-between",paddingBottom:2,children:[(0,l.jsxs)(v.xu,{display:"flex",alignItems:"center",children:[(0,l.jsx)(K.x,{children:r}),i&&(0,l.jsx)(ce,{infoText:i})]}),(0,l.jsx)($.r,{isChecked:!!n,onChange:t})]}),(0,l.jsx)(ee.U,{in:!!n,animateOpacity:!0,children:(0,l.jsx)(v.xu,{paddingLeft:4,paddingTop:2,paddingBottom:2,children:o})})]},r)},he=function(e){var n=e.label,t=e.colorList,r=e.value,i=e.visValue,o=e.setVisuals,s=(0,u.useCallback)((function(e){return o((function(n){return se(se({},n),{},(0,a.Z)({},r,e))}))}),[]);return(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:n}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(v.xu,{bgColor:i,borderRadius:"sm",height:6,width:6})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return s("")},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{height:6,width:6})}),t.map((function(e){return(0,l.jsx)(J.sN,{onClick:function(){return s(e)},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})},e)}))]})]})]})]})},ge=function(e){var n=e.filter,t=e.setFilter,r=e.tags,i=e.highlightColor,o=e.mode,s=r.map((function(e){return{value:e,label:e}})),c="blacklist"===o?"tagsBlacklist":"tagsWhitelist",d=(0,u.useState)(n[c].map((function(e){return{value:e,label:e}}))),h=d[0],g=d[1];return(0,l.jsx)(re.CUIAutoComplete,{items:s,label:"Add tag to "+o,placeholder:" ",onCreateItem:function(e){return null},disableCreateItem:!0,selectedItems:h,onSelectedItemsChange:function(e){e.selectedItems&&(g(e.selectedItems),t(se(se({},n),{},(0,a.Z)({},c,e.selectedItems.map((function(e){return e.value}))))))},listItemStyleProps:{overflow:"hidden"},highlightItemBg:"gray.400",toggleButtonStyleProps:{variant:"outline"},inputStyleProps:{focusBorderColor:i,color:"gray.800",borderColor:"gray.600"},tagStyleProps:{rounded:"full",bg:i,height:8,paddingLeft:4,fontWeight:"bold"},hideToggleButton:!0,itemRenderer:function(e){return e.label}})},fe=function(e){var n=e.colorList,t=e.tagColors,r=e.setTagColors,i=e.highlightColor,o=e.tags.map((function(e){return{value:e,label:e}})),s=(0,u.useState)(Object.keys(t).map((function(e){return{value:e,label:e}}))),c=s[0],d=s[1];return(0,l.jsxs)(v.xu,{children:[(0,l.jsx)(re.CUIAutoComplete,{items:o,label:"Add tag to filter",placeholder:" ",disableCreateItem:!0,selectedItems:c,onSelectedItemsChange:function(e){e.selectedItems&&(d(Array.from(new Set(e.selectedItems))),r(Object.fromEntries(Array.from(new Set(e.selectedItems)).map((function(e){var n;return[e.label,null!==(n=t[e.label])&&void 0!==n?n:"gray.600"]})))))},listItemStyleProps:{overflow:"hidden"},highlightItemBg:"gray.400",toggleButtonStyleProps:{variant:"outline"},inputStyleProps:{focusBorderColor:i,color:"gray.800",borderColor:"gray.600"},tagStyleProps:{display:"none",rounded:"full",bg:i,height:8,paddingLeft:4,fontWeight:"bold"},hideToggleButton:!0,itemRenderer:function(e){return e.label}}),(0,l.jsx)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",color:"gray.800",children:Object.keys(t).map((function(e){return(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",width:"100%",pl:2,children:[(0,l.jsx)(v.xu,{width:"100%",children:(0,l.jsx)(K.x,{fontWeight:"bold",children:e})}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",children:(0,l.jsx)(v.xu,{bgColor:t[e],borderRadius:"sm",height:6,width:6})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsx)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:n.map((function(n){return(0,l.jsx)(J.sN,{onClick:function(){return r(se(se({},t),{},(0,a.Z)({},e,n)))},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:n,borderRadius:"sm",height:6,width:6})},n)}))})]})]}),(0,l.jsx)(W.h,{"aria-label":"Delete tag color",variant:"ghost",icon:(0,l.jsx)(M.p,{}),onClick:function(){r(Object.fromEntries(Array.from(new Set(c)).map((function(e){var n;return[e.label,null!==(n=t[e.label])&&void 0!==n?n:"gray.600"]})))),d(c.filter((function(n){return n.value!==e})))}})]},e)}))})]})},xe=t(14218),pe=t(94030),je=t(55830),me=t(46617),ve=t(50862),be=t(68928),Ce=function(e){e.background;var n=e.node,t=(e.nodeType,e.coordinates),r=e.handleLocal,i=e.menuClose,o=e.scope,s=e.openNodeInEmacs,a=e.deleteNodeInEmacs,c=e.createNodeInEmacs,d=(0,b.q)(),h=d.isOpen,g=d.onOpen,f=d.onClose;(0,u.useRef)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.xu,{position:"absolute",zIndex:"overlay",left:t[0]+10,top:t[1]-10,padding:5,children:(0,l.jsx)(J.v2,{closeOnBlur:!1,defaultIsOpen:!0,onClose:function(){return i()},children:(0,l.jsxs)(J.qy,{zIndex:"overlay",bgColor:"alt.100",borderColor:"gray.500",maxWidth:"xs",children:[n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.X,{size:"sm",isTruncated:!0,px:3,py:1,children:n.title}),(0,l.jsx)(J.R,{borderColor:"gray.500"})]}),0!==o.nodeIds.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(J.sN,{onClick:function(){return r(n,"add")},icon:(0,l.jsx)(pe.I,{}),children:"Expand local graph at node"}),(0,l.jsx)(J.sN,{onClick:function(){return r(n,"replace")},icon:(0,l.jsx)(je.O,{}),children:"Open local graph for this node"})]}),null!==n&&void 0!==n&&n.properties.FILELESS?(0,l.jsx)(J.sN,{icon:(0,l.jsx)(ve.d,{}),onClick:function(){return c(n)},children:"Create node"}):(0,l.jsx)(J.sN,{icon:(0,l.jsx)(me.d,{}),onClick:function(){return s(n)},children:"Open in Emacs"}),(null===n||void 0===n?void 0:n.properties.ROAM_REFS)&&(0,l.jsx)(J.sN,{icon:(0,l.jsx)(be.h,{}),children:"Open in Zotero"}),0===o.nodeIds.length&&(0,l.jsx)(J.sN,{icon:(0,l.jsx)(je.O,{}),onClick:function(){return r(n,"replace")},children:"Open local graph"}),0===(null===n||void 0===n?void 0:n.level)&&(0,l.jsx)(J.sN,{closeOnSelect:!1,icon:(0,l.jsx)(M.p,{color:"red.500"}),color:"red.500",onClick:g,children:"Permenantly delete note"})]})})}),(0,l.jsxs)(xe.u_,{isCentered:!0,isOpen:h,onClose:f,children:[(0,l.jsx)(xe.ZA,{}),(0,l.jsxs)(xe.hz,{zIndex:"popover",children:[(0,l.jsx)(xe.xB,{children:"Delete node?"}),(0,l.jsx)(xe.ol,{}),(0,l.jsx)(xe.fe,{children:(0,l.jsxs)(G.gC,{spacing:4,display:"flex",alignItems:"flex-start",children:[(0,l.jsx)(K.x,{children:"This will permanently delete your note:"}),(0,l.jsx)(K.x,{fontWeight:"bold",children:null===n||void 0===n?void 0:n.title}),0!==(null===n||void 0===n?void 0:n.level)&&(0,l.jsx)(K.x,{children:"This will only delete the from this heading until but not including the next node. Your parent file and all other nodes will not be deleted."}),(0,l.jsx)(K.x,{children:"Are you sure you want to do continue?"})]})}),(0,l.jsxs)(xe.mz,{children:[(0,l.jsx)(_.z,{mr:3,onClick:function(){console.log("closing"),f(),i()},children:"Cancel"}),(0,l.jsx)(_.z,{variant:"link",colorScheme:"red",ml:3,onClick:function(){console.log("aaaaa"),a(n),f(),i()},children:"Delete node"})]})]})]})]})},ye=t(31122),ke=t(22003);function we(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?we(Object(t),!0).forEach((function(n){(0,a.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):we(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=t.e(4).then(t.bind(t,57004)),Le=t.g.window?t(61957).f$:null,Oe=t.g.window?t(61957).s6:null;function Ne(){var e=(0,u.useState)(!1),n=e[0],t=e[1];return(0,u.useEffect)((function(){t(!0)}),[]),n?(0,l.jsx)(ze,{}):null}function ze(){var e=g("3d",!1),n=(0,c.Z)(e,2),t=n[0],r=n[1],i=g("tagCols",{}),o=(0,c.Z)(i,2),d=o[0],h=o[1],f=(0,u.useState)({nodeIds:[]}),x=f[0],p=f[1],j=g("physics",O),m=(0,c.Z)(j,2),b=m[0],C=m[1],y=g("filter",N),k=(0,c.Z)(y,2),w=k[0],S=k[1],I=g("visuals",z),L=(0,c.Z)(I,2),E=L[0],R=L[1],F=(0,u.useState)(null),Z=F[0],P=F[1],H=(0,u.useState)(null),A=H[0],B=H[1],V=g("behavior",T),M=(0,c.Z)(V,2),W=M[0],X=M[1],_=g("mouse",D),q=(0,c.Z)(_,2),U=q[0],G=q[1],Q=(0,u.useRef)({}),K=(0,u.useRef)({}),J=(0,u.useRef)([]),Y=(0,u.useRef)(null),$=(0,u.useRef)({nodes:[],links:[]});(0,u.useEffect)((function(){Z&&($.current=Z)}),[Z]);var ee=(0,u.useContext)(oe.N).setEmacsTheme,ne=(0,u.useRef)({nodeIds:[]}),te=(0,u.useRef)(T);te.current=W;var re=(0,u.useRef)(null);ne.current=x;var ie=function(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;if("color"!==e){var o=Y.current,l=ne.current,a=te.current,c=null!==(t=K.current[n])&&void 0!==t?t:[],u=Object.fromEntries([n].concat((0,s.Z)(c.flatMap((function(e){return[e.source,e.target]})))).map((function(e){return[e,{}]})));if("zoom"===e)return l.nodeIds.length&&p({nodeIds:[]}),void setTimeout((function(){return o.zoomToFit(r,i,(function(e){return u[e.id]}))}),50);if(!l.nodeIds.length)return p({nodeIds:[n]}),void setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50);if("add"!==a.localSame)return p({nodeIds:[n]}),void setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50);if(!l.nodeIds.includes(n)||!l.nodeIds.some((function(e){return u[e]})))return p({nodeIds:[n]}),void setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50);p((function(e){return Se(Se({},e),{},{nodeIds:[].concat((0,s.Z)(e.nodeIds),[n])})})),setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50)}};return(0,u.useEffect)((function(){re.current=new ke.Z("ws://localhost:35903"),re.current.addEventListener("open",(function(){console.log("Connection with Emacs established")})),re.current.addEventListener("message",(function(e){var n=te.current,t=JSON.parse(e.data);switch(t.type){case"graphdata":return function(e){var n,t=Q.current;J.current=null!==(n=e.tags)&&void 0!==n?n:[];var r=e.nodes.reduce((function(e,n){var t;return Se(Se({},e),{},(0,a.Z)({},n.file,[].concat((0,s.Z)(null!==(t=e[n.file])&&void 0!==t?t:[]),[n])))}),{}),i=Object.keys(r).flatMap((function(e){var n,t=null!==(n=r[e])&&void 0!==n?n:[],i=t.find((function(e){return 0===e.level})),o=t.filter((function(e){return 0!==e.level}));return i?o.map((function(e){var n=t.filter((function(n){var t;return!(n.level>=e.level||n.pos>=e.pos||null===(t=e.olp)||void 0===t||!t.includes(n.title))})).reduce((function(e,n){return n.level>e.level&&(e=n),e}),i);return{source:e.id,target:(null===n||void 0===n?void 0:n.id)||i.id,type:"heading"}})):[]})),o=Object.keys(r).flatMap((function(e){var n,t=null!==(n=r[e])&&void 0!==n?n:[],i=t.find((function(e){return 0===e.level})),o=t.filter((function(e){return 0!==e.level}));return i?o.map((function(e){return{source:e.id,target:i.id,type:"parent"}})):[]}));Q.current=Object.fromEntries(e.nodes.map((function(e){return[e.id,e]})));var l=[].concat((0,s.Z)(e.links),(0,s.Z)(i),(0,s.Z)(o)),u=[],d=l.map((function(e){var n=e.source,t=e.target;return Q.current[n]?Q.current[t]?e:(u.push({id:t,tags:["bad"],properties:{FILELESS:"yes",bad:"yes"},file:"",title:t,level:0,pos:0,olp:null}),Se(Se({},e),{},{type:"bad"})):(u.push({id:n,tags:["bad"],properties:{FILELESS:"yes",bad:"yes"},file:"",title:n,level:0,pos:0,olp:null}),Se(Se({},e),{},{type:"bad"}))}));Q.current=Se(Se({},Q.current),Object.fromEntries(u.map((function(e){return[e.id,e]})))),K.current=d.reduce((function(e,n){var t,r,i;return Se(Se({},e),{},(i={},(0,a.Z)(i,n.source,[].concat((0,s.Z)(null!==(t=e[n.source])&&void 0!==t?t:[]),[n])),(0,a.Z)(i,n.target,[].concat((0,s.Z)(null!==(r=e[n.target])&&void 0!==r?r:[]),[n])),i))}),{});var h={nodes:[].concat((0,s.Z)(e.nodes),u),links:d},g=$.current;if(0===g.nodes.length){var f=JSON.parse(JSON.stringify(h));return $.current=f,void P(f)}var x=[].concat((0,s.Z)(g.nodes.flatMap((function(e){var n,t=null!==(n=Q.current[null===e||void 0===e?void 0:e.id])&&void 0!==n&&n;return t?[Se(Se({},e),t)]:[]}))),(0,s.Z)(Object.keys(Q.current).filter((function(e){return!t[e]})).map((function(e){return Q.current[e]})))),p=x.reduce((function(e,n,t){var r=null===n||void 0===n?void 0:n.id;return Se(Se({},e),{},(0,a.Z)({},r,t))}),{}),j=d.map((function(e){var n=Ee(e),t=(0,c.Z)(n,2),r=t[0],i=t[1];return Se(Se({},e),{},{source:x[p[r]],target:x[p[i]]})}));P({nodes:x,links:j})}(t.data);case"theme":return ee(t.data);case"command":switch(t.data.commandName){case"local":var r=W.zoomSpeed,i=W.zoomPadding;ie("local",t.data.id,r,i),B(t.data.id);break;case"zoom":var o,l,u=(null===t||void 0===t||null===(o=t.data)||void 0===o?void 0:o.speed)||n.zoomSpeed,d=(null===t||void 0===t||null===(l=t.data)||void 0===l?void 0:l.padding)||n.zoomPadding;ie("zoom",t.data.id,u,d),B(t.data.id);break;case"follow":ie(n.follow,t.data.id,n.zoomSpeed,n.zoomPadding),B(t.data.id);break;default:return console.error("unknown message type",t.type)}}}))}),[]),(0,u.useEffect)((function(){var e=Y.current;!e||x.nodeIds.length>1||(x.nodeIds.length||!b.gravityOn?setTimeout((function(){e.zoomToFit(5,200)}),50):e.zoomToFit())}),[x.nodeIds]),Z?(0,l.jsxs)(v.xu,{display:"flex",alignItems:"flex-start",flexDirection:"row",height:"100%",overflow:"hidden",children:[(0,l.jsx)(ae,Se(Se({},{physics:b,setPhysics:C,threeDim:t,setThreeDim:r,filter:w,setFilter:S,visuals:E,setVisuals:R,mouse:U,setMouse:G,behavior:W,setBehavior:X,tagColors:d,setTagColors:h}),{},{tags:J.current})),(0,l.jsx)(v.xu,{position:"absolute",alignItems:"top",overflow:"hidden",children:(0,l.jsx)(Te,Se({ref:Y,nodeById:Q.current,linksByNodeId:K.current,webSocket:re.current},{physics:b,graphData:Z,threeDim:t,emacsNodeId:A,filter:w,visuals:E,behavior:W,mouse:U,scope:x,setScope:p,tagColors:d}))})]}):null}var Te=(0,u.forwardRef)((function(e,n){var t=e.physics,r=e.graphData,d=e.threeDim,h=e.linksByNodeId,g=e.filter,f=e.emacsNodeId,C=e.nodeById,y=e.visuals,k=e.behavior,w=e.mouse,S=e.scope,I=e.setScope,O=e.webSocket,N=e.tagColors,z=(0,p.iP)(),T=(0,c.Z)(z,2),D=T[0],R=T[1],F=(0,u.useState)(null),Z=F[0],P=F[1],H=(0,u.useState)(null),A=H[0],B=H[1],V=(0,u.useState)([0,0]),M=V[0],W=V[1],X=(0,m.useTheme)(),_=(0,u.useContext)(oe.N).emacsTheme,q=function(e,n){"replace"!==n?S.nodeIds.includes(e.id)||I((function(n){return Se(Se({},n),{},{nodeIds:[].concat((0,s.Z)(n.nodeIds),[e.id])})})):I({nodeIds:[e.id]})},U=function(e,n){O.send(JSON.stringify({command:e,data:n}))},G=function(e){U("open",{id:e.id})},Q=(0,b.q)(),K=function(e,n,t){switch(e){case w.local:q(n,k.localSame);break;case w.follow:G(n);break;case w.context:!function(e,n){W([n.pageX,n.pageY]),B(e),Q.onOpen()}(n,t)}},J=(0,u.useRef)(null);(0,u.useEffect)((function(){f&&P(C[f])}),[f]);var Y=(0,u.useRef)({}),$=(0,u.useRef)({}),ee=(0,u.useMemo)((function(){var e;$.current={};var n=null===r||void 0===r||null===(e=r.nodes)||void 0===e?void 0:e.filter((function(e){var n=e;return g.tagsBlacklist.length&&g.tagsBlacklist.some((function(e){return n.tags.indexOf(e)>-1}))||g.tagsWhitelist.length>0&&!g.tagsWhitelist.some((function(e){return n.tags.indexOf(e)>-1}))||g.filelessCites&&n.properties.FILELESS?($.current=Se(Se({},$.current),{},(0,a.Z)({},n.id,n)),!1):!g.bad||!n.properties.bad||($.current=Se(Se({},$.current),{},(0,a.Z)({},n.id,n)),!1)})).filter((function(e){var n,t=(null!==(n=h[null===e||void 0===e?void 0:e.id])&&void 0!==n?n:[]).filter((function(e){return!$.current[e.source]&&!$.current[e.target]}));return!g.orphans||(g.parent?0!==t.length:0!==t.length&&t.some((function(e){return!["parent","heading"].includes(e.type)})))})),t=n.map((function(e){return e.id})),i=r.links.filter((function(e){var n=Ee(e),r=(0,c.Z)(n,2),i=r[0],o=r[1];if(!t.includes(i)||!t.includes(o))return!1;var l=e;return g.parent?"heading"===g.parent?"parent"!==l.type:"heading"!==l.type:!["parent","heading"].includes(l.type)}));return Y.current=i.reduce((function(e,n){var t,r,i,o=n,l=Ee(o),u=(0,c.Z)(l,2),d=u[0],h=u[1];return Se(Se({},e),{},(i={},(0,a.Z)(i,d,[].concat((0,s.Z)(null!==(t=e[d])&&void 0!==t?t:[]),[o])),(0,a.Z)(i,h,[].concat((0,s.Z)(null!==(r=e[h])&&void 0!==r?r:[]),[o])),i))}),{}),{nodes:n,links:i}}),[g,r]),ne=(0,u.useState)({nodes:[],links:[]}),te=ne[0],re=ne[1];(0,u.useEffect)((function(){if(S.nodeIds.length){var e=S.nodeIds.length>1?te.nodes:[],n=e.map((function(e){return e.id})),t=function(e,n){var t=[e[0]],r=[],i=[e[0]];return Array.from({length:n},(function(){t.forEach((function(e){var n;(null!==(n=Y.current[e])&&void 0!==n?n:[]).forEach((function(e){var n=Ee(e),t=(0,c.Z)(n,2),o=t[0],l=t[1];i.includes(o)?i.includes(l)||r.push(l):r.push(o)}))})),t=r,r.forEach((function(e){return e&&i.push(e)})),r=[]})),i}(S.nodeIds,1),r=ee.nodes.filter((function(r){var i;return e.length?!n.includes(r.id)&&(null!==(i=Y.current[r.id])&&void 0!==i?i:[]).some((function(e){return S.nodeIds.includes(e.source)||S.nodeIds.includes(e.target)})):t.includes(r.id)})).map((function(e){return Se(Se({},e),{},{x:0,y:0,vy:0,vx:0})})),i=[].concat((0,s.Z)(e),(0,s.Z)(r)),o=i.map((function(e){return e.id})),l=S.nodeIds.length>1?te.links:[],a=ee.links.filter((function(e){var t=Ee(e),r=(0,c.Z)(t,2),i=r[0],s=r[1];return!(l.length&&n.includes(s)&&n.includes(i))&&(o.includes(i)&&o.includes(s))})).map((function(e){var n=Ee(e),t=(0,c.Z)(n,2);return{source:t[0],target:t[1]}})),u=[].concat((0,s.Z)(l),(0,s.Z)(a));re({nodes:i,links:u})}}),[g,S,r]),J.current=Z;var ie=(0,u.useMemo)((function(){if(!J.current)return{};var e=Y.current[J.current.id];return e?Object.fromEntries([J.current.id].concat((0,s.Z)(e.flatMap((function(e){return[e.source,e.target]})))).map((function(e){return[e,{}]}))):{}}),[J.current,Y.current]);(0,u.useEffect)((function(){(0,o.Z)(i().mark((function e(){var r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.current,e.next=3,Ie;case 3:o=e.sent,!t.gravityOn||S.nodeIds.length&&!t.gravityLocal?(r.d3Force("x",null),r.d3Force("y",null),d&&r.d3Force("z",null)):(r.d3Force("x",o.forceX().strength(t.gravity)),r.d3Force("y",o.forceY().strength(t.gravity)),d&&r.d3Force("z",o.forceZ().strength(t.gravity))),t.centering?r.d3Force("center",o.forceCenter().strength(t.centeringStrength)):r.d3Force("center",null),t.linkStrength&&r.d3Force("link").strength(t.linkStrength),t.linkIts&&r.d3Force("link").iterations(t.linkIts),t.charge&&r.d3Force("charge").strength(t.charge),r.d3Force("collide",t.collision?o.forceCollide().radius(t.collisionStrength):null);case 10:case"end":return e.stop()}}),e)})))()}),[t,d,S]),(0,u.useEffect)((function(){var e;null===(e=n.current)||void 0===e||e.d3ReheatSimulation()}),[t,S.nodeIds.length]);var le=(0,u.useRef)(0),se=(0,u.useState)(1),ae=se[0],ce=se[1],ue=(0,j._7)((function(e){return ce(e)}),{duration:y.animationSpeed,algorithm:L[y.algorithmName]}),de=(0,c.Z)(ue,2),he=de[0],ge=de[1],fe=(0,j._7)((function(e){return ce(Math.min(ae,-1*(e-1)))}),{duration:y.animationSpeed,algorithm:L[y.algorithmName]}),xe=(0,c.Z)(fe,2),pe=xe[0],je=xe[1],me=(0,u.useRef)(null);(0,u.useEffect)((function(){if(Z&&(me.current=Z),!y.highlightAnim)return ce(Z?1:0);Z?he():(ge(),ae>.5?pe():ce(0))}),[Z]);var ve=function(e){if(X)return e.split(".").reduce((function(e,n){return e[n]}),X.colors)},be=(0,u.useMemo)((function(){return Object.fromEntries(E.map((function(e){var n=ve(e),t=E.map((function(e){return[e,x.Z(n,ve(e))]}));return[e,Object.fromEntries(t)]})))}),[_]),ke=(0,u.useMemo)((function(){var e,n,t,r=null!==(e=Y.current[null===(n=me.current)||void 0===n?void 0:n.id])&&void 0!==e?e:[];return Object.fromEntries([null===(t=me.current)||void 0===t?void 0:t.id].concat((0,s.Z)(r.flatMap((function(e){return Ee(e)})))).map((function(e){return[e,{}]})))}),[JSON.stringify(Z),me.current,Y.current]),we=function(e){var n,t,r,i,o,l=null!==(n=null===(t=Y.current[e])||void 0===t?void 0:t.length)&&void 0!==n?n:0;return y.nodeColorScheme[(r=l,i=0,o=y.nodeColorScheme.length-1,Math.min(Math.max(r,i),o))]},Ne=function(e,n){return Y.current[e].length>Y.current[n].length?we(e):we(n)},ze=(0,u.useMemo)((function(){return ve(y.labelTextColor)}),[y.labelTextColor,_]),Te=(0,u.useMemo)((function(){return ve(y.labelBackgroundColor)}),[y.labelBackgroundColor,_]),Fe=function(e){var n,t=null!==(n=Y.current[e.id])&&void 0!==n?n:[],r=t.length?t.filter((function(e){return"parent"===e.type})).length:0,i=3+t.length*y.nodeSizeLinks-(g.parent?0:r);return 1===y.highlightNodeSize?i:i*(ie[e.id]||ke[e.id]?1+ae*(y.highlightNodeSize-1):1)},Ze=(0,u.useState)(!1),Pe=Ze[0],He=Ze[1],Ae={graphData:S.nodeIds.length?te:ee,width:D,height:R,backgroundColor:X.colors.gray[y.backgroundColor],warmupTicks:1===S.nodeIds.length?100:S.nodeIds.length>1?20:0,nodeLabel:function(e){return e.title},nodeColor:function(e){return function(e){var n=ie[e.id]||ke[e.id];if(y.emacsNodeColor&&e.id===f)return ve(y.emacsNodeColor);if(N&&e.tags.some((function(e){return N[e]}))){var t=N[e.tags.filter((function(e){return N[e]}))[0]];return be[t][y.backgroundColor](y.highlightFade*ae)}return y.citeNodeColor&&e.properties.ROAM_REFS&&e.properties.FILELESS?n?ve(y.citeNodeColor):be[y.citeNodeColor][y.backgroundColor](y.highlightFade*ae):y.refNodeColor&&e.properties.ROAM_REFS?n?ve(y.refNodeColor):be[y.refNodeColor][y.backgroundColor](y.highlightFade*ae):n?y.nodeHighlight?be[we(e.id)][y.nodeHighlight](ae):ve(we(e.id)):be[we(e.id)][y.backgroundColor](y.highlightFade*ae)}(e)},nodeRelSize:y.nodeRel,nodeVal:function(e){return Fe(e)},nodeCanvasObject:function(e,n,t){if(e&&!Pe&&y.labels){var r=ke[e.id];if(!(t<=y.labelScale||1===y.labels)||ie[e.id]||r){var i=e.title,o=i.length>y.labelLength?i.substring(0,y.labelLength)+"...":i,l=y.labelFontSize/(.75*Math.min(Math.max(.5,t),3)),a=[1.1*n.measureText(o).width,l].map((function(e){return e+.5*l})),c=Math.min(3*(t-y.labelScale)/y.labelScale,1),u=function(){return 1===y.labels||t<=y.labelScale?ae:ie[e.id]||ke[e.id]?Math.max(c,ae):1*c*(-1*(y.highlightFade*ae-1))},d=8*Math.cbrt(Fe(e)*y.nodeRel);if(y.labelBackgroundColor&&y.labelBackgroundOpacity){var h=u()*y.labelBackgroundOpacity,g=Re(Te,h);n.fillStyle=g,n.fillRect.apply(n,[e.x-a[0]/2,e.y-a[1]/2+d].concat((0,s.Z)(a)))}var f=u();n.textAlign="center",n.textBaseline="middle";var x=Re(ze,f);n.fillStyle=x,n.font="".concat(l,"px Sans-Serif"),n.fillText(o,e.x,e.y+d)}}},nodeCanvasObjectMode:function(){return"after"},linkDirectionalParticles:y.particles?y.particlesNumber:void 0,linkDirectionalArrowLength:y.arrows?y.arrowsLength:void 0,linkDirectionalArrowRelPos:y.arrowsPos,linkDirectionalArrowColor:y.arrowsColor?function(){return ve(y.arrowsColor)}:void 0,linkColor:function(e){var n,t="object"===typeof e.source?e.source.id:e.source,r="object"===typeof e.target?e.target.id:e.target,i=De(e,J.current),o=De(e,me.current),l=i||o,s=e;return y.refLinkColor&&"ref"===s.type?l&&(y.refLinkHighlightColor||y.linkHighlight)?be[y.refLinkColor][y.refLinkHighlightColor||y.linkHighlight](ae):be[y.refLinkColor][y.backgroundColor](y.highlightFade*ae):y.citeLinkColor&&null!==(n=s.type)&&void 0!==n&&n.includes("cite")?l&&(y.citeLinkHighlightColor||y.linkHighlight)?be[y.citeLinkColor][y.citeLinkHighlightColor||y.linkHighlight](ae):be[y.citeLinkColor][y.backgroundColor](y.highlightFade*ae):function(e,n,t){if(!y.linkHighlight&&!y.linkColorScheme&&!t){var r=Ne(e,n);return ve(r)}if(!t&&!y.linkColorScheme){var i=Ne(e,n);return be[i][y.backgroundColor](y.highlightFade*ae)}if(!t)return be[y.linkColorScheme][y.backgroundColor](y.highlightFade*ae);if(!y.linkHighlight&&!y.linkColorScheme){var o=Ne(e,n);return ve(o)}return y.linkHighlight?y.linkColorScheme?be[y.linkColorScheme][y.linkHighlight](ae):be[Ne(e,n)][y.linkHighlight](ae):ve(y.linkColorScheme)}(t,r,l)},linkWidth:function(e){if(1===y.highlightLinkSize)return y.linkWidth;var n=De(e,J.current),t=De(e,me.current);return n||t?y.linkWidth*(1+ae*(y.highlightLinkSize-1)):y.linkWidth},linkDirectionalParticleWidth:y.particlesWidth,d3AlphaDecay:t.alphaDecay,d3AlphaMin:t.alphaMin,d3VelocityDecay:t.velocityDecay,onNodeClick:function(e,n){var t=e;Q.onClose();var r=n.timeStamp-le.current<200;if(le.current=n.timeStamp,r)return K("double",t,n);var i=le.current;return setTimeout((function(){if(le.current===i)return K("click",t,n)}),200)},onBackgroundClick:function(){Q.onClose(),P(null),0!==S.nodeIds.length&&I((function(e){return Se(Se({},e),{},{nodeIds:[]})}))},onNodeHover:function(e){y.highlight&&(Z||(je(),ce(0)),P(e))},onNodeRightClick:function(e,n){K("right",e,n)},onNodeDrag:function(e){Q.onClose(),P(e),He(!0)},onNodeDragEnd:function(){P(null),He(!1)}};return(0,l.jsxs)(v.xu,{overflow:"hidden",children:[Q.isOpen&&(0,l.jsx)(Ce,{scope:S,node:A,nodeType:null===A||void 0===A?void 0:A.id,background:!1,coordinates:M,handleLocal:q,menuClose:Q.onClose.bind(Q),openNodeInEmacs:G,deleteNodeInEmacs:function(e){0===e.level&&U("delete",{id:e.id,file:e.file})},createNodeInEmacs:function(e){U("create",{id:e.id,title:e.title,ref:e.properties.ROAM_REFS})}}),d?(0,l.jsx)(Oe,Se(Se({ref:n},Ae),{},{nodeThreeObjectExtend:!0,backgroundColor:X.colors.white,nodeOpacity:y.nodeOpacity,nodeResolution:y.nodeResolution,linkOpacity:y.linkOpacity,nodeThreeObject:function(e){if(y.labels&&(!(y.labels<3)||ie[e.id])){var n=new ye.Z(e.title.substring(0,40));return n.color=ve(y.labelTextColor),n.backgroundColor=ve(y.labelBackgroundColor),n.padding=2,n.textHeight=8,n}}})):(0,l.jsx)(Le,Se(Se({ref:n},Ae),{},{linkLineDash:function(e){var n,t=e;return y.citeDashes&&null!==(n=t.type)&&void 0!==n&&n.includes("cite")?[y.citeDashLength,y.citeGapLength]:y.refDashes&&"ref"==t.type?[y.refDashLength,y.refGapLength]:null}}))]})}));function De(e,n){var t,r;return(null===(t=e.source)||void 0===t?void 0:t.id)===(null===n||void 0===n?void 0:n.id)||(null===(r=e.target)||void 0===r?void 0:r.id)===(null===n||void 0===n?void 0:n.id)}function Ee(e){return["object"===typeof e.source?e.source.id:e.source,"object"===typeof e.target?e.target.id:e.target]}function Re(e,n){return"rgba("+(e=e.replace("#","")).match(new RegExp("(.{"+e.length/3+"})","g")).map((function(n){return parseInt(e.length%2?n+n:n,16)})).concat(isFinite(n)?n:1).join(",")+")"}},45301:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(96834)}])}},function(e){e.O(0,[774,737,446,726,888,179],(function(){return n=45301,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file
+(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{96834:function(e,n,t){"use strict";t.r(n),t.d(n,{Graph:function(){return Te},GraphPage:function(){return ze},default:function(){return Ne}});var r=t(87757),i=t.n(r),o=t(92137),l=t(85893),s=t(87329),a=t(96156),c=t(34699),u=t(67294);function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?d(Object(t),!0).forEach((function(n){(0,a.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function g(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=f(e,null!==(t=r.storage)&&void 0!==t?t:localStorage),o=i.get(),l=void 0!==o?o:n;l!==o&&i.update(l);var s="object"===typeof o?h(h({},o),l):l,a=(0,u.useState)(s),c=a[0],d=a[1];(0,u.useEffect)((function(){c!==s&&d(s)}),[e]);var g=function(e){e instanceof Function?d((function(n){var t=e(n);return i.update(t),t})):(d(e),i.update(e))};return[c,g]}function f(e,n){return{get:function(){var t=n.getItem(e);if(t&&"undefined"!==t)return JSON.parse(t)},update:function(t){n.setItem(e,JSON.stringify(t))},remove:function(){n.removeItem(e)}}}var x=t(54533),p=t(54309),j=t(32351),m=t(40980),v=t(48017),b=t(74860),C=t(36194),y=[],k={};for(var w in C.oY)for(var S in C.oY[w]){var I=w+S;"LinearNone"===I&&(I="Linear"),y.push(I),k[I]=C.oY[w][S]}var L=k,O={enabled:!0,charge:-700,collision:!0,collisionStrength:20,centering:!0,centeringStrength:.2,linkStrength:.3,linkIts:1,alphaDecay:.05,alphaTarget:0,alphaMin:0,velocityDecay:.25,gravity:.3,gravityOn:!0,gravityLocal:!1},N={orphans:!1,parent:"heading",filelessCites:!1,tagsBlacklist:[],tagsWhitelist:[],bad:!0,nodes:[],links:[],date:[]},z={particles:!1,particlesNumber:0,particlesWidth:4,arrows:!1,arrowsLength:1,arrowsPos:.5,arrowsColor:"",linkOpacity:.8,linkWidth:1,nodeRel:4,nodeOpacity:1,nodeResolution:12,labels:2,labelScale:1.5,labelFontSize:13,labelLength:40,highlight:!0,highlightNodeSize:2,highlightLinkSize:2,highlightFade:.8,highlightAnim:!0,animationSpeed:420,algorithmOptions:y,algorithmName:"SinusoidalOut",linkColorScheme:"gray.500",nodeColorScheme:["red.500","gray.600","yellow.500","green.500","cyan.500","blue.500","pink.500","purple.500","orange.500"],nodeHighlight:"purple.500",linkHighlight:"purple.500",backgroundColor:"white",emacsNodeColor:"gray.800",labelTextColor:"gray.900",labelBackgroundColor:"",labelBackgroundOpacity:.7,citeDashes:!0,citeDashLength:35,citeGapLength:15,citeLinkColor:"gray.700",citeLinkHighlightColor:"",citeNodeColor:"black",refDashes:!0,refDashLength:35,refGapLength:15,refLinkColor:"gray.700",refLinkHighlightColor:"",refNodeColor:"black",nodeSizeLinks:.5},T={follow:"zoom",localSame:"add",zoomPadding:200,zoomSpeed:2e3},D={highlight:"hover",local:"click",follow:"double",context:"right"},E=["red.500","orange.500","yellow.500","green.500","cyan.500","blue.500","pink.500","purple.500","white","gray.100","gray.200","gray.300","gray.400","gray.500","gray.600","gray.700","gray.800","gray.900","black"],R=t(81253),F=t(93924),Z=t(83986),P=t(48931),H=t(6569),A=t(67546),B=t(93441),V=t(24189),M=t(2827),W=t(48420),X=t(96699),_=t(40155),q=t(56769),U=t(336),G=t(72026),Q=t(94096),K=t(64115),J=t(48235),Y=t(67273),$=t(88134),ee=t(15267),ne=t(46049),te=t(95818),re=t(47647),ie=t(86658),oe=t(29356);function le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?le(Object(t),!0).forEach((function(n){(0,a.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ae=function(e){var n=e.physics,t=e.setPhysics,r=e.threeDim,i=e.setThreeDim,o=e.filter,d=e.setFilter,h=e.visuals,f=e.setVisuals,x=e.mouse,p=e.setMouse,j=e.behavior,m=e.setBehavior,b=e.tags,C=e.tagColors,y=e.setTagColors,k=g("showTweaks",!1),w=(0,c.Z)(k,2),S=w[0],I=w[1],L=(0,u.useContext)(oe.N),V=L.highlightColor,M=L.setHighlightColor,te=(0,u.useCallback)((function(e){return f(e)}),[]),re=(0,u.useCallback)((function(e,n,r){t((function(t){return se(se({},t),{},(0,a.Z)({},n,e/r))}))}),[]);return S?(0,l.jsxs)(v.xu,{bg:"alt.100",w:"xs",marginTop:10,marginLeft:10,borderRadius:"xl",paddingBottom:5,zIndex:300,position:"relative",boxShadow:"xl",maxH:.92*globalThis.innerHeight,marginBottom:10,children:[(0,l.jsxs)(v.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:2,paddingTop:1,children:[(0,l.jsx)(X.u,{label:"2D",children:(0,l.jsx)(_.z,{onClick:function(){return i(!r)},variant:"ghost",zIndex:"overlay",children:r?"3D":"2D"})}),(0,l.jsxs)(v.xu,{display:"flex",alignItems:"center",children:[(0,l.jsx)(X.u,{label:"Reset settings to defaults",children:(0,l.jsx)(W.h,{"aria-label":"Reset Defaults",icon:(0,l.jsx)(Z.A,{}),onClick:function(){f(z),d(N),p(D),t(O),m(T)},variant:"none",size:"sm"})}),(0,l.jsx)(W.h,{size:"sm",icon:(0,l.jsx)(P.T,{}),"aria-label":"Close Tweak Panel",variant:"ghost",onClick:function(){return I(!1)}})]})]}),(0,l.jsx)(ie.ZP,{autoHeight:!0,autoHeightMax:.85*globalThis.innerHeight,autoHide:!0,renderThumbVertical:function(e){var n=e.style,t=(0,R.Z)(e,["style"]);return(0,l.jsx)(v.xu,se(se({},t),{},{style:se(se({},n),{},{borderRadius:10}),bg:V}))},children:(0,l.jsxs)(q.UQ,{allowMultiple:!0,allowToggle:!0,color:"black",children:[(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Filter"})]}),(0,l.jsxs)(q.Hk,{children:[(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Link children to..."}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:function(){switch(o.parent){case"parent":return(0,l.jsx)(K.x,{children:"File"});case"heading":return(0,l.jsx)(K.x,{children:"Heading"});default:return(0,l.jsx)(K.x,{children:"Nothing"})}}()}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return d((function(e){return se(se({},e),{},{parent:""})}))},children:"Nothing"}),(0,l.jsx)(J.sN,{onClick:function(){return d((function(e){return se(se({},e),{},{parent:"parent"})}))},children:"Parent file node"}),(0,l.jsx)(J.sN,{onClick:function(){return d((function(e){return se(se({},e),{},{parent:"heading"})}))},children:"Next highest heading node"})]})]})]})]}),(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Orphans"}),(0,l.jsx)($.r,{onChange:function(){d((function(e){return se(se({},e),{},{orphans:!e.orphans})}))},isChecked:o.orphans})]}),(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Citations without note files"}),(0,l.jsx)($.r,{onChange:function(){d(se(se({},o),{},{filelessCites:!o.filelessCites}))},isChecked:o.filelessCites})]}),(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Non-existant nodes"}),(0,l.jsx)($.r,{onChange:function(){y(se(se({},C),{},{bad:"white"})),d(se(se({},o),{},{bad:!o.bad}))},isChecked:o.bad})]})]}),(0,l.jsxs)(q.UQ,{padding:0,allowToggle:!0,allowMultiple:!0,paddingLeft:3,children:[(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:["Tag filters",(0,l.jsx)(q.XE,{})]}),(0,l.jsxs)(q.Hk,{pr:0,mr:0,children:[(0,l.jsx)(ge,{highlightColor:V,filter:o,setFilter:d,tags:b,mode:"blacklist"}),(0,l.jsx)(ge,{highlightColor:V,filter:o,setFilter:d,tags:b,mode:"whitelist"})]})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:["Tag Colors",(0,l.jsx)(q.XE,{})]}),(0,l.jsx)(q.Hk,{pr:0,mr:0,children:(0,l.jsx)(fe,{tags:b,colorList:E,tagColors:C,setTagColors:y,highlightColor:V})})]})]})]})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsx)(q.KF,{display:"flex",justifyContent:"space-between",children:(0,l.jsxs)(v.xu,{display:"flex",children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Physics"})]})}),(0,l.jsxs)(q.Hk,{children:[(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsxs)(de,{label:"Gravity",value:n.gravityOn,onChange:function(){return t(se(se({},n),{},{gravityOn:!n.gravityOn}))},children:[(0,l.jsxs)(Q.k,{justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Also in local"}),(0,l.jsx)($.r,{onChange:function(){t((function(e){return se(se({},e),{},{gravityLocal:!e.gravityLocal})}))},isChecked:n.gravityLocal})]}),(0,l.jsx)(ue,{label:"Strength",value:10*n.gravity,onChange:function(e){return re(e,"gravity",10)}})]}),(0,l.jsx)(ue,{value:-n.charge/100,onChange:function(e){return re(e,"charge",-.01)},label:"Repulsive Force"}),(0,l.jsx)(de,{label:"Collision",infoText:"Perfomance sap, disable if slow",value:n.collision,onChange:function(){return t(se(se({},n),{},{collision:!n.collision}))},children:(0,l.jsx)(ue,{value:n.collisionStrength/5,onChange:function(e){return re(e,"collisionStrength",.2)},label:"Collision Radius",infoText:"Easy with this one, high values can lead to a real jiggly mess"})}),(0,l.jsx)(ue,{value:5*n.linkStrength,onChange:function(e){return re(e,"linkStrength",5)},label:"Link Force"}),(0,l.jsx)(ue,{label:"Link Iterations",value:n.linkIts,onChange:function(e){return re(e,"linkIts",1)},min:0,max:6,step:1,infoText:"How many links down the line the physics of a single node affects (Slow)"}),(0,l.jsx)(ue,{label:"Viscosity",value:10*n.velocityDecay,onChange:function(e){return re(e,"velocityDecay",10)}})]}),(0,l.jsx)(v.xu,{children:(0,l.jsx)(q.UQ,{paddingLeft:3,allowToggle:!0,children:(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(K.x,{children:"Advanced"}),(0,l.jsx)(q.XE,{marginRight:2})]}),(0,l.jsx)(q.Hk,{children:(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:3,color:"gray.800",children:[(0,l.jsx)(ue,{label:"Stabilization rate",value:50*n.alphaDecay,onChange:function(e){return re(e,"alphaDecay",50)}}),(0,l.jsx)(de,{label:"Center nodes",value:n.centering,onChange:function(){return t(se(se({},n),{},{centering:!n.centering}))},infoText:"Keeps the nodes in the center of the viewport. If disabled you can drag the nodes anywhere you want.",children:(0,l.jsx)(ue,{label:"Centering Strength",value:n.centeringStrength,max:2,step:.01,onChange:function(e){return re(e,"centeringStrength",1)}})})]})})]})})})]})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Visual"})]}),(0,l.jsx)(q.Hk,{children:(0,l.jsxs)(G.gC,{justifyContent:"flex-start",align:"stretch",children:[(0,l.jsx)(q.UQ,{allowToggle:!0,defaultIndex:[0],paddingLeft:3,children:(0,l.jsxs)(q.Qd,{children:[(0,l.jsx)(q.KF,{children:(0,l.jsxs)(Q.k,{justifyContent:"space-between",w:"100%",children:[(0,l.jsx)(K.x,{children:"Colors"}),(0,l.jsx)(q.XE,{marginRight:2})]})}),(0,l.jsx)(q.Hk,{children:(0,l.jsx)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",color:"gray.800",children:(0,l.jsxs)(v.xu,{children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Nodes"}),(0,l.jsx)(X.u,{label:"Shuffle node colors",children:(0,l.jsx)(W.h,{"aria-label":"Shuffle node colors",size:"sm",icon:(0,l.jsx)(A.n,{}),variant:"ghost",onClick:function(){var e,n=null!==(e=h.nodeColorScheme)&&void 0!==e?e:[];f(se(se({},h),{},{nodeColorScheme:n.map((function(e){return[Math.random(),e]})).sort((function(e,n){return(0,c.Z)(e,1)[0]-(0,c.Z)(n,1)[0]})).map((function(e){var n=(0,c.Z)(e,2);n[0];return n[1]}))}))}})}),(0,l.jsx)(X.u,{label:"Cycle node colors",children:(0,l.jsx)(W.h,{"aria-label":"Shift node colors",icon:(0,l.jsx)(B.L,{}),size:"sm",variant:"ghost",onClick:function(){var e,n=null!==(e=h.nodeColorScheme)&&void 0!==e?e:[];f(se(se({},h),{},{nodeColorScheme:[].concat((0,s.Z)(n.slice(1,n.length)),[n[0]])}))}})}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",closeOnSelect:!1,matchWidth:!0,children:[(0,l.jsx)(J.j2,{width:20,as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(Q.k,{height:6,width:6,flexDirection:"column",flexWrap:"wrap",children:h.nodeColorScheme.map((function(e){return(0,l.jsx)(v.xu,{bgColor:e,flex:"1 1 8px",borderRadius:"2xl"},e)}))})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsx)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:(0,l.jsx)(J.__,{width:500,type:"checkbox",defaultValue:h.nodeColorScheme,onChange:function(e){e.length&&f(se(se({},h),{},{nodeColorScheme:e}))},children:E.map((function(e){return(0,l.jsx)(J.ii,{isChecked:h.nodeColorScheme.some((function(n){return n===e})),value:e,isDisabled:1===h.nodeColorScheme.length&&h.nodeColorScheme[0]===e,children:(0,l.jsx)(v.xu,{justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})})},e)}))})})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Links"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(v.xu,{children:h.linkColorScheme?(0,l.jsx)(v.xu,{bgColor:h.linkColorScheme,borderRadius:"sm",height:6,width:6}):(0,l.jsx)(Q.k,{height:6,width:6,flexDirection:"column",flexWrap:"wrap",children:h.nodeColorScheme.map((function(e){return(0,l.jsx)(v.xu,{bgColor:e,flex:"1 1 8px",borderRadius:"2xl"},e)}))})})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{linkColorScheme:""}))},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(Q.k,{height:6,width:6,flexDirection:"column",flexWrap:"wrap",children:h.nodeColorScheme.map((function(e){return(0,l.jsx)(v.xu,{bgColor:e,flex:"1 1 8px",borderRadius:"2xl"},e)}))})}),E.map((function(e){return(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{linkColorScheme:e}))},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})},e)}))]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Accent"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(v.xu,{bgColor:V,borderRadius:"sm",height:6,width:6})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsx)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:E.map((function(e){return(0,l.jsx)(J.sN,{onClick:function(){return M(e)},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})},e)}))})]})]})]}),(0,l.jsx)(he,{colorList:E,label:"Link highlight",setVisuals:te,value:"linkHighlight",visValue:h.linkHighlight}),(0,l.jsx)(he,{colorList:E,label:"Node highlight",setVisuals:te,value:"nodeHighlight",visValue:h.nodeHighlight}),(0,l.jsx)(he,{colorList:E,label:"Background",setVisuals:te,value:"backgroundColor",visValue:h.backgroundColor}),(0,l.jsx)(he,{colorList:E,label:"Emacs node",setVisuals:te,value:"emacsNodeColor",visValue:h.emacsNodeColor})]})})})]})}),(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsx)(ue,{label:"Node size",value:h.nodeRel,onChange:function(e){return f(se(se({},h),{},{nodeRel:e}))}}),(0,l.jsx)(ue,{label:"Node connections size scale",value:h.nodeSizeLinks,min:0,max:2,onChange:function(e){return f(se(se({},h),{},{nodeSizeLinks:e}))}}),r&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ue,{label:"Node opacity",value:h.nodeOpacity,min:0,max:1,onChange:function(e){return f(se(se({},h),{},{nodeOpacity:e}))}}),(0,l.jsx)(ue,{label:"Node resolution",value:h.nodeResolution,min:5,max:32,step:1,onChange:function(e){return f(se(se({},h),{},{nodeResolution:e}))}})]}),(0,l.jsx)(ue,{label:"Link width",value:h.linkWidth,onChange:function(e){return f(se(se({},h),{},{linkWidth:e}))}}),r&&(0,l.jsx)(ue,{label:"Link opacity",min:0,max:1,value:h.linkOpacity,onChange:function(e){return f(se(se({},h),{},{linkOpacity:e}))}}),(0,l.jsxs)(de,{label:"Dash cite links",infoText:"Add dashes to citation links made with org-roam-bibtex",value:h.citeDashes,onChange:function(){return f(se(se({},h),{},{citeDashes:!h.citeDashes}))},children:[(0,l.jsx)(ue,{label:"Dash length",value:h.citeDashLength/10,onChange:function(e){return f(se(se({},h),{},{citeDashLength:10*e}))}}),(0,l.jsx)(ue,{label:"Gap length",value:h.citeGapLength/5,onChange:function(e){return f(se(se({},h),{},{citeGapLength:5*e}))}})]}),(0,l.jsx)(he,{colorList:E,label:"Citation node color",setVisuals:te,value:"citeNodeColor",visValue:h.citeNodeColor}),(0,l.jsx)(he,{colorList:E,label:"Citation link color",setVisuals:te,value:"citeLinkColor",visValue:h.citeLinkColor}),(0,l.jsx)(he,{colorList:E,label:"Reference link highlight",setVisuals:te,value:"citeLinkHighlightColor",visValue:h.citeLinkHighlightColor}),(0,l.jsxs)(de,{label:"Dash ref links",infoText:"Add dashes to citation links, whose target has a note, made with org-roam-bibtex",value:h.refDashes,onChange:function(){return f(se(se({},h),{},{refDashes:!h.refDashes}))},children:[(0,l.jsx)(ue,{label:"Dash length",value:h.refDashLength/10,onChange:function(e){return f(se(se({},h),{},{refDashLength:10*e}))}}),(0,l.jsx)(ue,{label:"Gap length",value:h.refGapLength/5,onChange:function(e){return f(se(se({},h),{},{refGapLength:5*e}))}})]}),(0,l.jsx)(he,{colorList:E,label:"Reference node color",setVisuals:te,value:"refNodeColor",visValue:h.refNodeColor}),(0,l.jsx)(he,{colorList:E,label:"Reference link color",setVisuals:te,value:"refLinkColor",visValue:h.refLinkColor}),(0,l.jsx)(he,{colorList:E,label:"Reference link highlight",setVisuals:te,value:"refLinkHighlightColor",visValue:h.refLinkHighlightColor}),(0,l.jsxs)(v.xu,{children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Labels"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:h.labels?h.labels<2?"On Highlight":"Always":"Never"}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:0}))},children:"Never"}),(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:1}))},children:"On Highlight"}),(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:2}))},children:"Always"}),(0,l.jsx)(J.sN,{onClick:function(){return f(se(se({},h),{},{labels:3}))},children:"Always (even in 3D)"})]})]})]})]}),(0,l.jsx)(ee.U,{in:h.labels>0,animateOpacity:!0,children:(0,l.jsxs)(G.gC,{spacing:1,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.400"}),align:"stretch",paddingLeft:2,color:"gray.800",children:[(0,l.jsx)(ue,{label:"Label font size",value:h.labelFontSize,min:5,max:20,step:.5,onChange:function(e){return f(se(se({},h),{},{labelFontSize:e}))}}),(0,l.jsx)(ue,{label:"Maximum label characters",value:h.labelLength,min:10,max:100,step:1,onChange:function(e){return f(se(se({},h),{},{labelLength:e}))}}),(0,l.jsx)(he,{colorList:E,label:"Text",setVisuals:te,value:"labelTextColor",visValue:h.labelTextColor}),(0,l.jsx)(he,{colorList:E,label:"Background",setVisuals:te,value:"labelBackgroundColor",visValue:h.labelBackgroundColor}),(0,l.jsx)(ee.U,{in:!!h.labelBackgroundColor,animateOpacity:!0,children:(0,l.jsx)(v.xu,{paddingTop:2,children:(0,l.jsx)(ue,{label:"Background opacity",value:h.labelBackgroundOpacity,onChange:function(e){console.log(h.labelBackgroundOpacity),f(se(se({},h),{},{labelBackgroundOpacity:e}))},min:0,max:1,step:.01})})}),(0,l.jsx)(ee.U,{in:h.labels>1,animateOpacity:!0,children:(0,l.jsx)(v.xu,{paddingTop:2,children:(0,l.jsx)(ue,{label:"Label Appearance Scale",value:5*h.labelScale,onChange:function(e){return f(se(se({},h),{},{labelScale:e/5}))}})})})]})})]}),(0,l.jsxs)(de,{label:"Link arrows",value:h.arrows,onChange:function(){return f(se(se({},h),{},{arrows:!h.arrows}))},children:[(0,l.jsx)(ue,{label:"Arrow size",value:h.arrowsLength/10,onChange:function(e){return f(se(se({},h),{},{arrowsLength:10*e}))}}),(0,l.jsx)(ue,{label:"Arrow Position",value:h.arrowsPos,min:0,max:1,step:.01,onChange:function(e){return f(se(se({},h),{},{arrowsPos:e}))}}),(0,l.jsx)(he,{colorList:E,label:"Arrow Color",setVisuals:te,value:"arrowsColor",visValue:h.arrowsColor},"arrow")]}),(0,l.jsxs)(de,{label:"Directional Particles",value:h.particles,onChange:function(){return f(se(se({},h),{},{particles:!h.particles}))},children:[(0,l.jsx)(ue,{label:"Particle Number",value:h.particlesNumber,max:5,step:1,onChange:function(e){return f(se(se({},h),{},{particlesNumber:e}))}}),(0,l.jsx)(ue,{label:"Particle Size",value:h.particlesWidth,onChange:function(e){return f(se(se({},h),{},{particlesWidth:e}))}})]}),(0,l.jsx)(de,{label:"Highlight",onChange:function(){return f(se(se({},h),{},{highlight:!h.highlight}))},value:h.highlight,children:(0,l.jsxs)(G.gC,{spacing:1,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.400"}),align:"stretch",paddingLeft:0,children:[(0,l.jsx)(ue,{label:"Highlight Link Thickness",value:h.highlightLinkSize,onChange:function(e){return f(se(se({},h),{},{highlightLinkSize:e}))}}),(0,l.jsx)(ue,{label:"Highlight Node Size",value:h.highlightNodeSize,onChange:function(e){return f(se(se({},h),{},{highlightNodeSize:e}))}}),(0,l.jsx)(ue,{min:0,max:1,label:"Highlight Fade",value:h.highlightFade,onChange:function(e){return f(se(se({},h),{},{highlightFade:e}))}}),(0,l.jsxs)(de,{label:"Highlight Animation",onChange:function(){f(se(se({},h),{},{highlightAnim:!h.highlightAnim}))},value:h.highlightAnim,children:[(0,l.jsx)(ue,{label:"Animation speed",onChange:function(e){return f(se(se({},h),{},{animationSpeed:e}))},value:h.animationSpeed,infoText:"Slower speed has a chance of being buggy",min:50,max:1e3,step:10}),(0,l.jsx)(ne.Ph,{placeholder:h.algorithmName,onChange:function(e){f(se(se({},h),{},{algorithmName:e.target.value}))},children:h.algorithmOptions.map((function(e){return(0,l.jsx)("option",{value:e,children:e},e)}))})]})]})})]})]})})]}),(0,l.jsxs)(q.Qd,{children:[(0,l.jsxs)(q.KF,{children:[(0,l.jsx)(q.XE,{marginRight:2}),(0,l.jsx)(U.X,{size:"sm",children:"Behavior"})]}),(0,l.jsx)(q.Hk,{children:(0,l.jsxs)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",paddingLeft:7,color:"gray.800",children:[(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsxs)(Q.k,{children:[(0,l.jsx)(K.x,{children:"Expand Node"}),(0,l.jsx)(ce,{infoText:"View only the node and its direct neighbors"})]}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:x.local?x.local[0].toUpperCase()+x.local.slice(1):"Never"})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:""}))},children:"Never"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:"click"}))},children:"Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:"double"}))},children:"Double Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{local:"right"}))},children:"Right Click"})]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Open in Emacs"}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:x.follow?x.follow[0].toUpperCase()+x.follow.slice(1):"Never"})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:""}))},children:"Never"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:"click"}))},children:"Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:"double"}))},children:"Double Click"}),(0,l.jsx)(J.sN,{onClick:function(){return p(se(se({},x),{},{follow:"right"}))},children:"Right Click"})]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:"Follow Emacs by..."}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:j.follow[0].toUpperCase()+j.follow.slice(1)})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{follow:"color"}))},children:"Just coloring the currently opened node"}),(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{follow:"local"}))},children:"Opening the local graph"}),(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{follow:"zoom"}))},children:"Zooming to the current node"})]})]})]})]}),(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsxs)(Q.k,{children:[(0,l.jsx)(K.x,{children:"Local graph"}),(0,l.jsx)(ce,{infoText:"When in local mode and clicking a new node, should I add that node's local graph or open the new one?"})]}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,rightIcon:(0,l.jsx)(H.v,{}),colorScheme:"",color:"black",children:(0,l.jsx)(K.x,{children:"add"===j.localSame?"Add":"Replace"})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{bgColor:"gray.200",zIndex:"popover",children:[(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{localSame:"replace"}))},children:"Open that nodes graph"}),(0,l.jsx)(J.sN,{onClick:function(){return m(se(se({},j),{},{localSame:"add"}))},children:"Add node to local graph"})]})]})]})]}),(0,l.jsx)(ue,{label:"Zoom speed",value:j.zoomSpeed,min:0,max:4e3,step:100,onChange:function(e){return m(se(se({},j),{},{zoomSpeed:e}))}}),(0,l.jsx)(ue,{label:"Zoom padding",value:j.zoomPadding,min:0,max:400,step:1,onChange:function(e){return m(se(se({},j),{},{zoomPadding:e}))},infoText:"How much to zoom out to accomodate all nodes when changing the view."})]})})]})]})})]}):(0,l.jsx)(v.xu,{position:"absolute",zIndex:"overlay",marginTop:10,marginLeft:10,display:S?"none":"block",children:(0,l.jsx)(W.h,{variant:"ghost","aria-label":"Settings",icon:(0,l.jsx)(F.e,{}),onClick:function(){return I(!0)}})})},ce=function(e){var n=e.infoText;return(0,l.jsx)(v.xu,{paddingLeft:"1",children:(0,l.jsx)(X.u,{label:n,placement:"top",color:"gray.100",bg:"gray.800",hasArrow:!0,children:(0,l.jsx)(V.h,{})})})},ue=function(e){var n=e.min,t=void 0===n?0:n,r=e.max,i=void 0===r?10:r,o=e.step,s=void 0===o?.1:o,a=e.value,c=void 0===a?1:a,d=(0,R.Z)(e,["min","max","step","value"]),h=d.onChange,g=d.label,f=d.infoText,x=(0,u.useContext)(oe.N).highlightColor;return(0,l.jsxs)(v.xu,{children:[(0,l.jsxs)(v.xu,{display:"flex",alignItems:"flex-end",children:[(0,l.jsx)(K.x,{children:g}),f&&(0,l.jsx)(ce,{infoText:f})]}),(0,l.jsxs)(te.iR,{value:c,onChange:h,min:t,max:i,step:s,children:[(0,l.jsx)(te.Uj,{children:(0,l.jsx)(te.Ms,{})}),(0,l.jsx)(X.u,{bg:x,label:c.toFixed(1),children:(0,l.jsx)(te.gs,{bg:"white"})})]})]},g)},de=function(e){var n=e.value,t=e.onChange,r=e.label,i=e.infoText,o=e.children;return(0,l.jsxs)(v.xu,{paddingTop:2,children:[(0,l.jsxs)(v.xu,{display:"flex",justifyContent:"space-between",paddingBottom:2,children:[(0,l.jsxs)(v.xu,{display:"flex",alignItems:"center",children:[(0,l.jsx)(K.x,{children:r}),i&&(0,l.jsx)(ce,{infoText:i})]}),(0,l.jsx)($.r,{isChecked:!!n,onChange:t})]}),(0,l.jsx)(ee.U,{in:!!n,animateOpacity:!0,children:(0,l.jsx)(v.xu,{paddingLeft:4,paddingTop:2,paddingBottom:2,children:o})})]},r)},he=function(e){var n=e.label,t=e.colorList,r=e.value,i=e.visValue,o=e.setVisuals,s=(0,u.useCallback)((function(e){return o((function(n){return se(se({},n),{},(0,a.Z)({},r,e))}))}),[]);return(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",children:[(0,l.jsx)(K.x,{children:n}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",rightIcon:(0,l.jsx)(H.v,{}),children:(0,l.jsx)(v.xu,{bgColor:i,borderRadius:"sm",height:6,width:6})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsxs)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:[(0,l.jsx)(J.sN,{onClick:function(){return s("")},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{height:6,width:6})}),t.map((function(e){return(0,l.jsx)(J.sN,{onClick:function(){return s(e)},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:e,borderRadius:"sm",height:6,width:6})},e)}))]})]})]})]})},ge=function(e){var n=e.filter,t=e.setFilter,r=e.tags,i=e.highlightColor,o=e.mode,s=r.map((function(e){return{value:e,label:e}})),c="blacklist"===o?"tagsBlacklist":"tagsWhitelist",d=(0,u.useState)(n[c].map((function(e){return{value:e,label:e}}))),h=d[0],g=d[1];return(0,l.jsx)(re.CUIAutoComplete,{items:s,label:"Add tag to "+o,placeholder:" ",onCreateItem:function(e){return null},disableCreateItem:!0,selectedItems:h,onSelectedItemsChange:function(e){e.selectedItems&&(g(e.selectedItems),t(se(se({},n),{},(0,a.Z)({},c,e.selectedItems.map((function(e){return e.value}))))))},listItemStyleProps:{overflow:"hidden"},highlightItemBg:"gray.400",toggleButtonStyleProps:{variant:"outline"},inputStyleProps:{focusBorderColor:i,color:"gray.800",borderColor:"gray.600"},tagStyleProps:{rounded:"full",bg:i,height:8,paddingLeft:4,fontWeight:"bold"},hideToggleButton:!0,itemRenderer:function(e){return e.label}})},fe=function(e){var n=e.colorList,t=e.tagColors,r=e.setTagColors,i=e.highlightColor,o=e.tags.map((function(e){return{value:e,label:e}})),s=(0,u.useState)(Object.keys(t).map((function(e){return{value:e,label:e}}))),c=s[0],d=s[1];return(0,l.jsxs)(v.xu,{children:[(0,l.jsx)(re.CUIAutoComplete,{items:o,label:"Add tag to filter",placeholder:" ",disableCreateItem:!0,selectedItems:c,onSelectedItemsChange:function(e){e.selectedItems&&(d(Array.from(new Set(e.selectedItems))),r(Object.fromEntries(Array.from(new Set(e.selectedItems)).map((function(e){var n;return[e.label,null!==(n=t[e.label])&&void 0!==n?n:"gray.600"]})))))},listItemStyleProps:{overflow:"hidden"},highlightItemBg:"gray.400",toggleButtonStyleProps:{variant:"outline"},inputStyleProps:{focusBorderColor:i,color:"gray.800",borderColor:"gray.600"},tagStyleProps:{display:"none",rounded:"full",bg:i,height:8,paddingLeft:4,fontWeight:"bold"},hideToggleButton:!0,itemRenderer:function(e){return e.label}}),(0,l.jsx)(G.gC,{spacing:2,justifyContent:"flex-start",divider:(0,l.jsx)(G.cX,{borderColor:"gray.500"}),align:"stretch",color:"gray.800",children:Object.keys(t).map((function(e){return(0,l.jsxs)(Q.k,{alignItems:"center",justifyContent:"space-between",width:"100%",pl:2,children:[(0,l.jsx)(v.xu,{width:"100%",children:(0,l.jsx)(K.x,{fontWeight:"bold",children:e})}),(0,l.jsxs)(J.v2,{isLazy:!0,placement:"right",children:[(0,l.jsx)(J.j2,{as:_.z,colorScheme:"",color:"black",children:(0,l.jsx)(v.xu,{bgColor:t[e],borderRadius:"sm",height:6,width:6})}),(0,l.jsxs)(Y.h,{children:[" ",(0,l.jsx)(J.qy,{minW:10,zIndex:"popover",bgColor:"gray.200",children:n.map((function(n){return(0,l.jsx)(J.sN,{onClick:function(){return r(se(se({},t),{},(0,a.Z)({},e,n)))},justifyContent:"space-between",alignItems:"center",display:"flex",children:(0,l.jsx)(v.xu,{bgColor:n,borderRadius:"sm",height:6,width:6})},n)}))})]})]}),(0,l.jsx)(W.h,{"aria-label":"Delete tag color",variant:"ghost",icon:(0,l.jsx)(M.p,{}),onClick:function(){r(Object.fromEntries(Array.from(new Set(c)).map((function(e){var n;return[e.label,null!==(n=t[e.label])&&void 0!==n?n:"gray.600"]})))),d(c.filter((function(n){return n.value!==e})))}})]},e)}))})]})},xe=t(14218),pe=t(94030),je=t(55830),me=t(46617),ve=t(50862),be=t(68928),Ce=function(e){e.background;var n=e.node,t=(e.nodeType,e.coordinates),r=e.handleLocal,i=e.menuClose,o=e.scope,s=e.openNodeInEmacs,a=e.deleteNodeInEmacs,c=e.createNodeInEmacs,d=(0,b.q)(),h=d.isOpen,g=d.onOpen,f=d.onClose;(0,u.useRef)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(v.xu,{position:"absolute",zIndex:"overlay",left:t[0]+10,top:t[1]-10,padding:5,children:(0,l.jsx)(J.v2,{closeOnBlur:!1,defaultIsOpen:!0,onClose:function(){return i()},children:(0,l.jsxs)(J.qy,{zIndex:"overlay",bgColor:"alt.100",borderColor:"gray.500",maxWidth:"xs",children:[n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(U.X,{size:"sm",isTruncated:!0,px:3,py:1,children:n.title}),(0,l.jsx)(J.R,{borderColor:"gray.500"})]}),0!==o.nodeIds.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(J.sN,{onClick:function(){return r(n,"add")},icon:(0,l.jsx)(pe.I,{}),children:"Expand local graph at node"}),(0,l.jsx)(J.sN,{onClick:function(){return r(n,"replace")},icon:(0,l.jsx)(je.O,{}),children:"Open local graph for this node"})]}),null!==n&&void 0!==n&&n.properties.FILELESS?(0,l.jsx)(J.sN,{icon:(0,l.jsx)(ve.d,{}),onClick:function(){return c(n)},children:"Create node"}):(0,l.jsx)(J.sN,{icon:(0,l.jsx)(me.d,{}),onClick:function(){return s(n)},children:"Open in Emacs"}),(null===n||void 0===n?void 0:n.properties.ROAM_REFS)&&(0,l.jsx)(J.sN,{icon:(0,l.jsx)(be.h,{}),children:"Open in Zotero"}),0===o.nodeIds.length&&(0,l.jsx)(J.sN,{icon:(0,l.jsx)(je.O,{}),onClick:function(){return r(n,"replace")},children:"Open local graph"}),0===(null===n||void 0===n?void 0:n.level)&&(0,l.jsx)(J.sN,{closeOnSelect:!1,icon:(0,l.jsx)(M.p,{color:"red.500"}),color:"red.500",onClick:g,children:"Permenantly delete note"})]})})}),(0,l.jsxs)(xe.u_,{isCentered:!0,isOpen:h,onClose:f,children:[(0,l.jsx)(xe.ZA,{}),(0,l.jsxs)(xe.hz,{zIndex:"popover",children:[(0,l.jsx)(xe.xB,{children:"Delete node?"}),(0,l.jsx)(xe.ol,{}),(0,l.jsx)(xe.fe,{children:(0,l.jsxs)(G.gC,{spacing:4,display:"flex",alignItems:"flex-start",children:[(0,l.jsx)(K.x,{children:"This will permanently delete your note:"}),(0,l.jsx)(K.x,{fontWeight:"bold",children:null===n||void 0===n?void 0:n.title}),0!==(null===n||void 0===n?void 0:n.level)&&(0,l.jsx)(K.x,{children:"This will only delete the from this heading until but not including the next node. Your parent file and all other nodes will not be deleted."}),(0,l.jsx)(K.x,{children:"Are you sure you want to do continue?"})]})}),(0,l.jsxs)(xe.mz,{children:[(0,l.jsx)(_.z,{mr:3,onClick:function(){console.log("closing"),f(),i()},children:"Cancel"}),(0,l.jsx)(_.z,{variant:"link",colorScheme:"red",ml:3,onClick:function(){console.log("aaaaa"),a(n),f(),i()},children:"Delete node"})]})]})]})]})},ye=t(31122),ke=t(22003);function we(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Se(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?we(Object(t),!0).forEach((function(n){(0,a.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):we(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ie=t.e(4).then(t.bind(t,57004)),Le=t.g.window?t(61957).f$:null,Oe=t.g.window?t(61957).s6:null;function Ne(){var e=(0,u.useState)(!1),n=e[0],t=e[1];return(0,u.useEffect)((function(){t(!0)}),[]),n?(0,l.jsx)(ze,{}):null}function ze(){var e=g("3d",!1),n=(0,c.Z)(e,2),t=n[0],r=n[1],i=g("tagCols",{}),o=(0,c.Z)(i,2),d=o[0],h=o[1],f=(0,u.useState)({nodeIds:[]}),x=f[0],p=f[1],j=g("physics",O),m=(0,c.Z)(j,2),b=m[0],C=m[1],y=g("filter",N),k=(0,c.Z)(y,2),w=k[0],S=k[1],I=g("visuals",z),L=(0,c.Z)(I,2),E=L[0],R=L[1],F=(0,u.useState)(null),Z=F[0],P=F[1],H=(0,u.useState)(null),A=H[0],B=H[1],V=g("behavior",T),M=(0,c.Z)(V,2),W=M[0],X=M[1],_=g("mouse",D),q=(0,c.Z)(_,2),U=q[0],G=q[1],Q=(0,u.useRef)({}),K=(0,u.useRef)({}),J=(0,u.useRef)([]),Y=(0,u.useRef)(null),$=(0,u.useRef)({nodes:[],links:[]});(0,u.useEffect)((function(){Z&&($.current=Z)}),[Z]);var ee=(0,u.useContext)(oe.N).setEmacsTheme,ne=(0,u.useRef)({nodeIds:[]}),te=(0,u.useRef)(T);te.current=W;var re=(0,u.useRef)(null);ne.current=x;var ie=function(e,n){var t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;if("color"!==e){var o=Y.current,l=ne.current,a=te.current,c=null!==(t=K.current[n])&&void 0!==t?t:[],u=Object.fromEntries([n].concat((0,s.Z)(c.flatMap((function(e){return[e.source,e.target]})))).map((function(e){return[e,{}]})));if("zoom"===e)return l.nodeIds.length&&p({nodeIds:[]}),void setTimeout((function(){return o.zoomToFit(r,i,(function(e){return u[e.id]}))}),50);if(!l.nodeIds.length)return p({nodeIds:[n]}),void setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50);if("add"!==a.localSame)return p({nodeIds:[n]}),void setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50);if(!l.nodeIds.includes(n)||!l.nodeIds.some((function(e){return u[e]})))return p({nodeIds:[n]}),void setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50);p((function(e){return Se(Se({},e),{},{nodeIds:[].concat((0,s.Z)(e.nodeIds),[n])})})),setTimeout((function(){o.centerAt(0,0,10),o.zoomToFit(1,i)}),50)}};return(0,u.useEffect)((function(){re.current=new ke.Z("ws://localhost:35903"),re.current.addEventListener("open",(function(){console.log("Connection with Emacs established")})),re.current.addEventListener("message",(function(e){var n=te.current,t=JSON.parse(e.data);switch(t.type){case"graphdata":return function(e){var n,t,r,i=Q.current;J.current=null!==(n=e.tags)&&void 0!==n?n:[];var o=null!==(t=e.nodes)&&void 0!==t?t:[],l=null!==(r=e.links)&&void 0!==r?r:[],u=o.reduce((function(e,n){var t;return Se(Se({},e),{},(0,a.Z)({},n.file,[].concat((0,s.Z)(null!==(t=e[n.file])&&void 0!==t?t:[]),[n])))}),{}),d=Object.keys(u).flatMap((function(e){var n,t=null!==(n=u[e])&&void 0!==n?n:[],r=t.find((function(e){return 0===e.level})),i=t.filter((function(e){return 0!==e.level}));return r?i.map((function(e){var n=t.filter((function(n){var t;return!(n.level>=e.level||n.pos>=e.pos||null===(t=e.olp)||void 0===t||!t.includes(n.title))})).reduce((function(e,n){return n.level>e.level&&(e=n),e}),r);return{source:e.id,target:(null===n||void 0===n?void 0:n.id)||r.id,type:"heading"}})):[]})),h=Object.keys(u).flatMap((function(e){var n,t=null!==(n=u[e])&&void 0!==n?n:[],r=t.find((function(e){return 0===e.level})),i=t.filter((function(e){return 0!==e.level}));return r?i.map((function(e){return{source:e.id,target:r.id,type:"parent"}})):[]}));Q.current=Object.fromEntries(o.map((function(e){return[e.id,e]})));var g=[].concat((0,s.Z)(l),(0,s.Z)(d),(0,s.Z)(h)),f=[],x=g.map((function(e){var n=e.source,t=e.target;return Q.current[n]?Q.current[t]?e:(f.push({id:t,tags:["bad"],properties:{FILELESS:"yes",bad:"yes"},file:"",title:t,level:0,pos:0,olp:null}),Se(Se({},e),{},{type:"bad"})):(f.push({id:n,tags:["bad"],properties:{FILELESS:"yes",bad:"yes"},file:"",title:n,level:0,pos:0,olp:null}),Se(Se({},e),{},{type:"bad"}))}));Q.current=Se(Se({},Q.current),Object.fromEntries(f.map((function(e){return[e.id,e]})))),K.current=x.reduce((function(e,n){var t,r,i;return Se(Se({},e),{},(i={},(0,a.Z)(i,n.source,[].concat((0,s.Z)(null!==(t=e[n.source])&&void 0!==t?t:[]),[n])),(0,a.Z)(i,n.target,[].concat((0,s.Z)(null!==(r=e[n.target])&&void 0!==r?r:[]),[n])),i))}),{});var p={nodes:[].concat((0,s.Z)(o),f),links:x},j=$.current;if(0===j.nodes.length){var m=JSON.parse(JSON.stringify(p));return $.current=m,void P(m)}var v=[].concat((0,s.Z)(j.nodes.flatMap((function(e){var n,t=null!==(n=Q.current[null===e||void 0===e?void 0:e.id])&&void 0!==n&&n;return t?[Se(Se({},e),t)]:[]}))),(0,s.Z)(Object.keys(Q.current).filter((function(e){return!i[e]})).map((function(e){return Q.current[e]})))),b=v.reduce((function(e,n,t){var r=null===n||void 0===n?void 0:n.id;return Se(Se({},e),{},(0,a.Z)({},r,t))}),{}),C=x.map((function(e){var n=Ee(e),t=(0,c.Z)(n,2),r=t[0],i=t[1];return Se(Se({},e),{},{source:v[b[r]],target:v[b[i]]})}));P({nodes:v,links:C})}(t.data);case"theme":return ee(t.data);case"command":switch(t.data.commandName){case"local":var r=W.zoomSpeed,i=W.zoomPadding;ie("local",t.data.id,r,i),B(t.data.id);break;case"zoom":var o,l,u=(null===t||void 0===t||null===(o=t.data)||void 0===o?void 0:o.speed)||n.zoomSpeed,d=(null===t||void 0===t||null===(l=t.data)||void 0===l?void 0:l.padding)||n.zoomPadding;ie("zoom",t.data.id,u,d),B(t.data.id);break;case"follow":ie(n.follow,t.data.id,n.zoomSpeed,n.zoomPadding),B(t.data.id);break;default:return console.error("unknown message type",t.type)}}}))}),[]),(0,u.useEffect)((function(){var e=Y.current;!e||x.nodeIds.length>1||(x.nodeIds.length||!b.gravityOn?setTimeout((function(){e.zoomToFit(5,200)}),50):e.zoomToFit())}),[x.nodeIds]),Z?(0,l.jsxs)(v.xu,{display:"flex",alignItems:"flex-start",flexDirection:"row",height:"100%",overflow:"hidden",children:[(0,l.jsx)(ae,Se(Se({},{physics:b,setPhysics:C,threeDim:t,setThreeDim:r,filter:w,setFilter:S,visuals:E,setVisuals:R,mouse:U,setMouse:G,behavior:W,setBehavior:X,tagColors:d,setTagColors:h}),{},{tags:J.current})),(0,l.jsx)(v.xu,{position:"absolute",alignItems:"top",overflow:"hidden",children:(0,l.jsx)(Te,Se({ref:Y,nodeById:Q.current,linksByNodeId:K.current,webSocket:re.current},{physics:b,graphData:Z,threeDim:t,emacsNodeId:A,filter:w,visuals:E,behavior:W,mouse:U,scope:x,setScope:p,tagColors:d}))})]}):null}var Te=(0,u.forwardRef)((function(e,n){var t=e.physics,r=e.graphData,d=e.threeDim,h=e.linksByNodeId,g=e.filter,f=e.emacsNodeId,C=e.nodeById,y=e.visuals,k=e.behavior,w=e.mouse,S=e.scope,I=e.setScope,O=e.webSocket,N=e.tagColors,z=(0,p.iP)(),T=(0,c.Z)(z,2),D=T[0],R=T[1],F=(0,u.useState)(null),Z=F[0],P=F[1],H=(0,u.useState)(null),A=H[0],B=H[1],V=(0,u.useState)([0,0]),M=V[0],W=V[1],X=(0,m.useTheme)(),_=(0,u.useContext)(oe.N).emacsTheme,q=function(e,n){"replace"!==n?S.nodeIds.includes(e.id)||I((function(n){return Se(Se({},n),{},{nodeIds:[].concat((0,s.Z)(n.nodeIds),[e.id])})})):I({nodeIds:[e.id]})},U=function(e,n){O.send(JSON.stringify({command:e,data:n}))},G=function(e){U("open",{id:e.id})},Q=(0,b.q)(),K=function(e,n,t){switch(e){case w.local:q(n,k.localSame);break;case w.follow:G(n);break;case w.context:!function(e,n){W([n.pageX,n.pageY]),B(e),Q.onOpen()}(n,t)}},J=(0,u.useRef)(null);(0,u.useEffect)((function(){f&&P(C[f])}),[f]);var Y=(0,u.useRef)({}),$=(0,u.useRef)({}),ee=(0,u.useMemo)((function(){var e;$.current={};var n=null===r||void 0===r||null===(e=r.nodes)||void 0===e?void 0:e.filter((function(e){var n=e;return g.tagsBlacklist.length&&g.tagsBlacklist.some((function(e){return n.tags.indexOf(e)>-1}))||g.tagsWhitelist.length>0&&!g.tagsWhitelist.some((function(e){return n.tags.indexOf(e)>-1}))||g.filelessCites&&n.properties.FILELESS?($.current=Se(Se({},$.current),{},(0,a.Z)({},n.id,n)),!1):!g.bad||!n.properties.bad||($.current=Se(Se({},$.current),{},(0,a.Z)({},n.id,n)),!1)})).filter((function(e){var n,t=(null!==(n=h[null===e||void 0===e?void 0:e.id])&&void 0!==n?n:[]).filter((function(e){return!$.current[e.source]&&!$.current[e.target]}));return!g.orphans||(g.parent?0!==t.length:0!==t.length&&t.some((function(e){return!["parent","heading"].includes(e.type)})))})),t=n.map((function(e){return e.id})),i=r.links.filter((function(e){var n=Ee(e),r=(0,c.Z)(n,2),i=r[0],o=r[1];if(!t.includes(i)||!t.includes(o))return!1;var l=e;return g.parent?"heading"===g.parent?"parent"!==l.type:"heading"!==l.type:!["parent","heading"].includes(l.type)}));return Y.current=i.reduce((function(e,n){var t,r,i,o=n,l=Ee(o),u=(0,c.Z)(l,2),d=u[0],h=u[1];return Se(Se({},e),{},(i={},(0,a.Z)(i,d,[].concat((0,s.Z)(null!==(t=e[d])&&void 0!==t?t:[]),[o])),(0,a.Z)(i,h,[].concat((0,s.Z)(null!==(r=e[h])&&void 0!==r?r:[]),[o])),i))}),{}),{nodes:n,links:i}}),[g,r]),ne=(0,u.useState)({nodes:[],links:[]}),te=ne[0],re=ne[1];(0,u.useEffect)((function(){if(S.nodeIds.length){var e=S.nodeIds.length>1?te.nodes:[],n=e.map((function(e){return e.id})),t=function(e,n){var t=[e[0]],r=[],i=[e[0]];return Array.from({length:n},(function(){t.forEach((function(e){var n;(null!==(n=Y.current[e])&&void 0!==n?n:[]).forEach((function(e){var n=Ee(e),t=(0,c.Z)(n,2),o=t[0],l=t[1];i.includes(o)?i.includes(l)||r.push(l):r.push(o)}))})),t=r,r.forEach((function(e){return e&&i.push(e)})),r=[]})),i}(S.nodeIds,1),r=ee.nodes.filter((function(r){var i;return e.length?!n.includes(r.id)&&(null!==(i=Y.current[r.id])&&void 0!==i?i:[]).some((function(e){return S.nodeIds.includes(e.source)||S.nodeIds.includes(e.target)})):t.includes(r.id)})).map((function(e){return Se(Se({},e),{},{x:0,y:0,vy:0,vx:0})})),i=[].concat((0,s.Z)(e),(0,s.Z)(r)),o=i.map((function(e){return e.id})),l=S.nodeIds.length>1?te.links:[],a=ee.links.filter((function(e){var t=Ee(e),r=(0,c.Z)(t,2),i=r[0],s=r[1];return!(l.length&&n.includes(s)&&n.includes(i))&&(o.includes(i)&&o.includes(s))})).map((function(e){var n=Ee(e),t=(0,c.Z)(n,2);return{source:t[0],target:t[1]}})),u=[].concat((0,s.Z)(l),(0,s.Z)(a));re({nodes:i,links:u})}}),[g,S,r]),J.current=Z;var ie=(0,u.useMemo)((function(){if(!J.current)return{};var e=Y.current[J.current.id];return e?Object.fromEntries([J.current.id].concat((0,s.Z)(e.flatMap((function(e){return[e.source,e.target]})))).map((function(e){return[e,{}]}))):{}}),[J.current,Y.current]);(0,u.useEffect)((function(){(0,o.Z)(i().mark((function e(){var r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.current,e.next=3,Ie;case 3:o=e.sent,!t.gravityOn||S.nodeIds.length&&!t.gravityLocal?(r.d3Force("x",null),r.d3Force("y",null),d&&r.d3Force("z",null)):(r.d3Force("x",o.forceX().strength(t.gravity)),r.d3Force("y",o.forceY().strength(t.gravity)),d&&r.d3Force("z",o.forceZ().strength(t.gravity))),t.centering?r.d3Force("center",o.forceCenter().strength(t.centeringStrength)):r.d3Force("center",null),t.linkStrength&&r.d3Force("link").strength(t.linkStrength),t.linkIts&&r.d3Force("link").iterations(t.linkIts),t.charge&&r.d3Force("charge").strength(t.charge),r.d3Force("collide",t.collision?o.forceCollide().radius(t.collisionStrength):null);case 10:case"end":return e.stop()}}),e)})))()}),[t,d,S]),(0,u.useEffect)((function(){var e;null===(e=n.current)||void 0===e||e.d3ReheatSimulation()}),[t,S.nodeIds.length]);var le=(0,u.useRef)(0),se=(0,u.useState)(1),ae=se[0],ce=se[1],ue=(0,j._7)((function(e){return ce(e)}),{duration:y.animationSpeed,algorithm:L[y.algorithmName]}),de=(0,c.Z)(ue,2),he=de[0],ge=de[1],fe=(0,j._7)((function(e){return ce(Math.min(ae,-1*(e-1)))}),{duration:y.animationSpeed,algorithm:L[y.algorithmName]}),xe=(0,c.Z)(fe,2),pe=xe[0],je=xe[1],me=(0,u.useRef)(null);(0,u.useEffect)((function(){if(Z&&(me.current=Z),!y.highlightAnim)return ce(Z?1:0);Z?he():(ge(),ae>.5?pe():ce(0))}),[Z]);var ve=function(e){if(X)return e.split(".").reduce((function(e,n){return e[n]}),X.colors)},be=(0,u.useMemo)((function(){return Object.fromEntries(E.map((function(e){var n=ve(e),t=E.map((function(e){return[e,x.Z(n,ve(e))]}));return[e,Object.fromEntries(t)]})))}),[_]),ke=(0,u.useMemo)((function(){var e,n,t,r=null!==(e=Y.current[null===(n=me.current)||void 0===n?void 0:n.id])&&void 0!==e?e:[];return Object.fromEntries([null===(t=me.current)||void 0===t?void 0:t.id].concat((0,s.Z)(r.flatMap((function(e){return Ee(e)})))).map((function(e){return[e,{}]})))}),[JSON.stringify(Z),me.current,Y.current]),we=function(e){var n,t,r,i,o,l=null!==(n=null===(t=Y.current[e])||void 0===t?void 0:t.length)&&void 0!==n?n:0;return y.nodeColorScheme[(r=l,i=0,o=y.nodeColorScheme.length-1,Math.min(Math.max(r,i),o))]},Ne=function(e,n){return Y.current[e].length>Y.current[n].length?we(e):we(n)},ze=(0,u.useMemo)((function(){return ve(y.labelTextColor)}),[y.labelTextColor,_]),Te=(0,u.useMemo)((function(){return ve(y.labelBackgroundColor)}),[y.labelBackgroundColor,_]),Fe=function(e){var n,t=null!==(n=Y.current[e.id])&&void 0!==n?n:[],r=t.length?t.filter((function(e){return"parent"===e.type})).length:0,i=3+t.length*y.nodeSizeLinks-(g.parent?0:r);return 1===y.highlightNodeSize?i:i*(ie[e.id]||ke[e.id]?1+ae*(y.highlightNodeSize-1):1)},Ze=(0,u.useState)(!1),Pe=Ze[0],He=Ze[1],Ae={graphData:S.nodeIds.length?te:ee,width:D,height:R,backgroundColor:X.colors.gray[y.backgroundColor],warmupTicks:1===S.nodeIds.length?100:S.nodeIds.length>1?20:0,nodeLabel:function(e){return e.title},nodeColor:function(e){return function(e){var n=ie[e.id]||ke[e.id];if(y.emacsNodeColor&&e.id===f)return ve(y.emacsNodeColor);if(N&&e.tags.some((function(e){return N[e]}))){var t=N[e.tags.filter((function(e){return N[e]}))[0]];return be[t][y.backgroundColor](y.highlightFade*ae)}return y.citeNodeColor&&e.properties.ROAM_REFS&&e.properties.FILELESS?n?ve(y.citeNodeColor):be[y.citeNodeColor][y.backgroundColor](y.highlightFade*ae):y.refNodeColor&&e.properties.ROAM_REFS?n?ve(y.refNodeColor):be[y.refNodeColor][y.backgroundColor](y.highlightFade*ae):n?y.nodeHighlight?be[we(e.id)][y.nodeHighlight](ae):ve(we(e.id)):be[we(e.id)][y.backgroundColor](y.highlightFade*ae)}(e)},nodeRelSize:y.nodeRel,nodeVal:function(e){return Fe(e)},nodeCanvasObject:function(e,n,t){if(e&&!Pe&&y.labels){var r=ke[e.id];if(!(t<=y.labelScale||1===y.labels)||ie[e.id]||r){var i=e.title,o=i.length>y.labelLength?i.substring(0,y.labelLength)+"...":i,l=y.labelFontSize/(.75*Math.min(Math.max(.5,t),3)),a=[1.1*n.measureText(o).width,l].map((function(e){return e+.5*l})),c=Math.min(3*(t-y.labelScale)/y.labelScale,1),u=function(){return 1===y.labels||t<=y.labelScale?ae:ie[e.id]||ke[e.id]?Math.max(c,ae):1*c*(-1*(y.highlightFade*ae-1))},d=8*Math.cbrt(Fe(e)*y.nodeRel);if(y.labelBackgroundColor&&y.labelBackgroundOpacity){var h=u()*y.labelBackgroundOpacity,g=Re(Te,h);n.fillStyle=g,n.fillRect.apply(n,[e.x-a[0]/2,e.y-a[1]/2+d].concat((0,s.Z)(a)))}var f=u();n.textAlign="center",n.textBaseline="middle";var x=Re(ze,f);n.fillStyle=x,n.font="".concat(l,"px Sans-Serif"),n.fillText(o,e.x,e.y+d)}}},nodeCanvasObjectMode:function(){return"after"},linkDirectionalParticles:y.particles?y.particlesNumber:void 0,linkDirectionalArrowLength:y.arrows?y.arrowsLength:void 0,linkDirectionalArrowRelPos:y.arrowsPos,linkDirectionalArrowColor:y.arrowsColor?function(){return ve(y.arrowsColor)}:void 0,linkColor:function(e){var n,t="object"===typeof e.source?e.source.id:e.source,r="object"===typeof e.target?e.target.id:e.target,i=De(e,J.current),o=De(e,me.current),l=i||o,s=e;return y.refLinkColor&&"ref"===s.type?l&&(y.refLinkHighlightColor||y.linkHighlight)?be[y.refLinkColor][y.refLinkHighlightColor||y.linkHighlight](ae):be[y.refLinkColor][y.backgroundColor](y.highlightFade*ae):y.citeLinkColor&&null!==(n=s.type)&&void 0!==n&&n.includes("cite")?l&&(y.citeLinkHighlightColor||y.linkHighlight)?be[y.citeLinkColor][y.citeLinkHighlightColor||y.linkHighlight](ae):be[y.citeLinkColor][y.backgroundColor](y.highlightFade*ae):function(e,n,t){if(!y.linkHighlight&&!y.linkColorScheme&&!t){var r=Ne(e,n);return ve(r)}if(!t&&!y.linkColorScheme){var i=Ne(e,n);return be[i][y.backgroundColor](y.highlightFade*ae)}if(!t)return be[y.linkColorScheme][y.backgroundColor](y.highlightFade*ae);if(!y.linkHighlight&&!y.linkColorScheme){var o=Ne(e,n);return ve(o)}return y.linkHighlight?y.linkColorScheme?be[y.linkColorScheme][y.linkHighlight](ae):be[Ne(e,n)][y.linkHighlight](ae):ve(y.linkColorScheme)}(t,r,l)},linkWidth:function(e){if(1===y.highlightLinkSize)return y.linkWidth;var n=De(e,J.current),t=De(e,me.current);return n||t?y.linkWidth*(1+ae*(y.highlightLinkSize-1)):y.linkWidth},linkDirectionalParticleWidth:y.particlesWidth,d3AlphaDecay:t.alphaDecay,d3AlphaMin:t.alphaMin,d3VelocityDecay:t.velocityDecay,onNodeClick:function(e,n){var t=e;Q.onClose();var r=n.timeStamp-le.current<200;if(le.current=n.timeStamp,r)return K("double",t,n);var i=le.current;return setTimeout((function(){if(le.current===i)return K("click",t,n)}),200)},onBackgroundClick:function(){Q.onClose(),P(null),0!==S.nodeIds.length&&I((function(e){return Se(Se({},e),{},{nodeIds:[]})}))},onNodeHover:function(e){y.highlight&&(Z||(je(),ce(0)),P(e))},onNodeRightClick:function(e,n){K("right",e,n)},onNodeDrag:function(e){Q.onClose(),P(e),He(!0)},onNodeDragEnd:function(){P(null),He(!1)}};return(0,l.jsxs)(v.xu,{overflow:"hidden",children:[Q.isOpen&&(0,l.jsx)(Ce,{scope:S,node:A,nodeType:null===A||void 0===A?void 0:A.id,background:!1,coordinates:M,handleLocal:q,menuClose:Q.onClose.bind(Q),openNodeInEmacs:G,deleteNodeInEmacs:function(e){0===e.level&&U("delete",{id:e.id,file:e.file})},createNodeInEmacs:function(e){U("create",{id:e.id,title:e.title,ref:e.properties.ROAM_REFS})}}),d?(0,l.jsx)(Oe,Se(Se({ref:n},Ae),{},{nodeThreeObjectExtend:!0,backgroundColor:X.colors.white,nodeOpacity:y.nodeOpacity,nodeResolution:y.nodeResolution,linkOpacity:y.linkOpacity,nodeThreeObject:function(e){if(y.labels&&(!(y.labels<3)||ie[e.id])){var n=new ye.Z(e.title.substring(0,40));return n.color=ve(y.labelTextColor),n.backgroundColor=ve(y.labelBackgroundColor),n.padding=2,n.textHeight=8,n}}})):(0,l.jsx)(Le,Se(Se({ref:n},Ae),{},{linkLineDash:function(e){var n,t=e;return y.citeDashes&&null!==(n=t.type)&&void 0!==n&&n.includes("cite")?[y.citeDashLength,y.citeGapLength]:y.refDashes&&"ref"==t.type?[y.refDashLength,y.refGapLength]:null}}))]})}));function De(e,n){var t,r;return(null===(t=e.source)||void 0===t?void 0:t.id)===(null===n||void 0===n?void 0:n.id)||(null===(r=e.target)||void 0===r?void 0:r.id)===(null===n||void 0===n?void 0:n.id)}function Ee(e){return["object"===typeof e.source?e.source.id:e.source,"object"===typeof e.target?e.target.id:e.target]}function Re(e,n){return"rgba("+(e=e.replace("#","")).match(new RegExp("(.{"+e.length/3+"})","g")).map((function(n){return parseInt(e.length%2?n+n:n,16)})).concat(isFinite(n)?n:1).join(",")+")"}},45301:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(96834)}])}},function(e){e.O(0,[774,737,446,726,888,179],(function(){return n=45301,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file