graview 0.1.61 → 0.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.SAYAFOF6.js → chunk.22BZU7ME.js} +1 -1
- package/dist/preview/chunk.2AT3GRXM.js +1 -0
- package/dist/preview/chunk.2B6P4GPS.js +1 -0
- package/dist/preview/{chunk.XZUHFXME.js → chunk.2GEJNG2U.js} +1 -1
- package/dist/preview/{chunk.R3N73BJO.js → chunk.2N4Z5K5S.js} +1 -1
- package/dist/preview/{chunk.3HFUO3DC.js → chunk.3FON2Y72.js} +1 -1
- package/dist/preview/chunk.3L37FY3G.js +4 -0
- package/dist/preview/{chunk.CRCJ3TAG.js → chunk.4HEFUOLV.js} +1 -1
- package/dist/preview/chunk.4HRYB7HF.js +1 -0
- package/dist/preview/{chunk.GQNSNJTJ.js → chunk.4TX6VCBT.js} +1 -1
- package/dist/preview/{chunk.4LG34OC2.js → chunk.5HGD6OWL.js} +2 -2
- package/dist/preview/{chunk.6VLCMBRE.js → chunk.5J3O2FVG.js} +1 -1
- package/dist/preview/{chunk.DP5DUV6F.js → chunk.5MZYCELA.js} +1 -1
- package/dist/preview/{chunk.F4VHCQNP.js → chunk.5ODHHH35.js} +1 -1
- package/dist/preview/{chunk.D5Q64GA4.js → chunk.5STU3KYG.js} +1 -1
- package/dist/preview/{chunk.PYVWGTQS.js → chunk.5YAOKOGV.js} +1 -1
- package/dist/preview/{chunk.E6RNMWFN.js → chunk.66P5IDTH.js} +1 -1
- package/dist/preview/{chunk.EN2ABVIP.js → chunk.6AKW7TXM.js} +1 -1
- package/dist/preview/{chunk.GI6XQF5X.js → chunk.6JO5HQDR.js} +1 -1
- package/dist/preview/{chunk.SIYBHZDD.js → chunk.75GVFX7L.js} +1 -1
- package/dist/preview/{chunk.E7UDVC4V.js → chunk.7KVUUEZA.js} +1 -1
- package/dist/preview/{chunk.W5TVQYAI.js → chunk.7M4HNKDR.js} +1 -1
- package/dist/preview/chunk.7OBIBPYH.js +1 -0
- package/dist/preview/chunk.7V56P2A7.js +1 -0
- package/dist/preview/{chunk.A2ZQASQV.js → chunk.7XLS6XTY.js} +1 -1
- package/dist/preview/chunk.7YOAW7ED.js +1 -0
- package/dist/preview/{chunk.3SMNWZ3M.js → chunk.A3OL2BI2.js} +1 -1
- package/dist/preview/{chunk.WS7LAT4Z.js → chunk.A3ZC2JBO.js} +1 -1
- package/dist/preview/{chunk.HZHNM2KI.js → chunk.ACTXR2MI.js} +1 -1
- package/dist/preview/chunk.AFNSAQEQ.js +1 -0
- package/dist/preview/{chunk.AVFOTYZR.js → chunk.AI34V6WV.js} +4 -4
- package/dist/preview/{chunk.VN7I7XIO.js → chunk.AJSUHPBE.js} +1 -1
- package/dist/preview/chunk.AQRB7LDA.js +1 -0
- package/dist/preview/{chunk.3FUUYYR5.js → chunk.B23WZQXQ.js} +1 -1
- package/dist/preview/chunk.BIDL7GQD.js +0 -0
- package/dist/preview/chunk.BLUKSGI4.js +1 -0
- package/dist/preview/chunk.BZMQDEIY.js +1 -0
- package/dist/preview/chunk.CAKFNKN5.js +1 -0
- package/dist/preview/chunk.CGALLZ54.js +1 -0
- package/dist/preview/{chunk.65KFZV3A.js → chunk.CHHYIMB7.js} +1 -1
- package/dist/preview/chunk.CXDGE5ZS.js +1 -0
- package/dist/preview/{chunk.KRFRREEW.js → chunk.CY3ELWCM.js} +1 -1
- package/dist/preview/chunk.DC35FJAB.js +1 -0
- package/dist/preview/{chunk.ZJCM62GH.js → chunk.DD2NKFDX.js} +1 -1
- package/dist/preview/{chunk.DHY7KOBV.js → chunk.DDO3GLEJ.js} +1 -1
- package/dist/preview/{chunk.6HZY5NRX.js → chunk.DDUCIUVW.js} +1 -1
- package/dist/preview/chunk.DEAP3H2L.js +1 -0
- package/dist/preview/chunk.DHJ3FQTR.js +1 -0
- package/dist/preview/{chunk.R5547CJ7.js → chunk.DNVWSWL2.js} +1 -1
- package/dist/preview/chunk.DPEIT3TW.js +1 -0
- package/dist/preview/chunk.DVSTLVIH.js +15 -0
- package/dist/preview/chunk.DZZL5IDD.js +5 -0
- package/dist/preview/{chunk.U2ISOUM2.js → chunk.ELOFPE25.js} +1 -1
- package/dist/preview/{chunk.7LZ6JDJA.js → chunk.ELTV44HU.js} +2 -2
- package/dist/preview/chunk.EVBCEEQ4.js +1 -0
- package/dist/preview/{chunk.HQNE4I4M.js → chunk.F7YXLYLX.js} +1 -1
- package/dist/preview/{chunk.MK72IRIY.js → chunk.FULEUL34.js} +1 -1
- package/dist/preview/{chunk.HOQMD6WQ.js → chunk.G4ULQK64.js} +14 -14
- package/dist/preview/{chunk.UXOBUK3C.js → chunk.GX4G4BX3.js} +1 -1
- package/dist/preview/chunk.H24OC6OE.js +1 -0
- package/dist/preview/chunk.H5S7OL2U.js +1 -0
- package/dist/preview/chunk.H73ZPYUX.js +1 -0
- package/dist/preview/{chunk.FJIXSGYU.js → chunk.H7N7WN4U.js} +1 -1
- package/dist/preview/chunk.HANJZ6FA.js +1 -0
- package/dist/preview/chunk.HIMQ65QT.js +1 -0
- package/dist/preview/chunk.I77ZGIFE.js +1 -0
- package/dist/preview/{chunk.ZC3FRCJQ.js → chunk.ILIIBSGA.js} +1 -1
- package/dist/preview/{chunk.66IKLMYX.js → chunk.IQ3PRWGO.js} +1 -1
- package/dist/preview/{chunk.DLDP6OWD.js → chunk.IQMD7DG3.js} +1 -1
- package/dist/preview/chunk.IQPILSV3.js +18 -0
- package/dist/preview/chunk.IYBEXENQ.js +1 -0
- package/dist/preview/{chunk.5S7IGASX.js → chunk.J7Q2WAF4.js} +1 -1
- package/dist/preview/{chunk.PJ5AO7CK.js → chunk.JT3MFPRD.js} +1 -1
- package/dist/preview/chunk.JYFZCJ4N.js +2 -0
- package/dist/preview/chunk.K2HDEL7I.js +1 -0
- package/dist/preview/chunk.KDXU5DT3.js +1 -0
- package/dist/preview/chunk.KL7E4YHJ.js +1 -0
- package/dist/preview/{chunk.SBLYBRDU.js → chunk.KMV6PJFL.js} +1 -1
- package/dist/preview/{chunk.DHJI7LIW.js → chunk.L3WTKQQL.js} +1 -1
- package/dist/preview/{chunk.REH6RXNH.js → chunk.LAYQ5PFS.js} +1 -1
- package/dist/preview/{chunk.UACSX64H.js → chunk.LGRLVJGS.js} +3 -3
- package/dist/preview/chunk.LTZUF5VG.js +1 -0
- package/dist/preview/{chunk.WD4VPMEE.js → chunk.M4AYA2PL.js} +1 -1
- package/dist/preview/chunk.M7RESZB6.js +25 -0
- package/dist/preview/{chunk.CUTLO6DA.js → chunk.MAKODQO3.js} +1 -1
- package/dist/preview/{chunk.SKQO467Y.js → chunk.MDEX6ZVE.js} +1 -1
- package/dist/preview/chunk.MGALQLRW.js +1 -0
- package/dist/preview/{chunk.PZXTSWDH.js → chunk.MYNMBOLD.js} +1 -1
- package/dist/preview/{chunk.YGIJDHAV.js → chunk.N6EJXXQK.js} +2 -2
- package/dist/preview/chunk.NAD7ZXYP.js +1 -0
- package/dist/preview/chunk.NHTGAP3G.js +3 -0
- package/dist/preview/{chunk.5IEFTFKQ.js → chunk.NJSK3UO2.js} +1 -1
- package/dist/preview/{chunk.ISRQQVS4.js → chunk.NOGGSLVG.js} +1 -1
- package/dist/preview/chunk.NUWDMH47.js +1 -0
- package/dist/preview/chunk.NUYA4BWI.js +1 -0
- package/dist/preview/{chunk.BDTT4ENI.js → chunk.O2BHPYA4.js} +2 -2
- package/dist/preview/chunk.O75HWF3F.js +1 -0
- package/dist/preview/chunk.OFWNMTGB.js +21 -0
- package/dist/preview/chunk.OKZT2QBM.js +2 -0
- package/dist/preview/{chunk.MBPOYZ3J.js → chunk.OUDATENL.js} +1 -1
- package/dist/preview/chunk.OUPURRDE.js +1 -0
- package/dist/preview/{chunk.GIW657OR.js → chunk.OWOOKLIU.js} +2 -1
- package/dist/preview/{chunk.7R727IKU.js → chunk.OWT3VVOT.js} +1 -1
- package/dist/preview/{chunk.VYFMUCBT.js → chunk.PCDUV3WP.js} +1 -1
- package/dist/preview/chunk.PD2DECOP.js +1 -0
- package/dist/preview/{chunk.2WZAFKJ2.js → chunk.PKWQKFPE.js} +1 -1
- package/dist/preview/{chunk.747OH3EE.js → chunk.PLTH2LW5.js} +1 -1
- package/dist/preview/{chunk.5POG3G2C.js → chunk.PZQNR4KZ.js} +1 -1
- package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
- package/dist/preview/chunk.QDWSU47A.js +1 -0
- package/dist/preview/{chunk.U3JK2DNC.js → chunk.QGU5QTR6.js} +1 -1
- package/dist/preview/{chunk.6DOOLVT4.js → chunk.QHY5NVYH.js} +1 -1
- package/dist/preview/{chunk.BI6DS3PZ.js → chunk.QIPASE42.js} +1 -1
- package/dist/preview/{chunk.EVEHSENK.js → chunk.RD2X25XB.js} +1 -1
- package/dist/preview/{chunk.D4TA5XDC.js → chunk.RMR24LFJ.js} +3 -3
- package/dist/preview/chunk.ROZTJ6IY.js +6 -0
- package/dist/preview/{chunk.6SO64TUI.js → chunk.RPDH32XV.js} +1 -1
- package/dist/preview/chunk.RRKI24WY.js +1 -0
- package/dist/preview/{chunk.FWUG7Y6C.js → chunk.RYRQ66JN.js} +1 -1
- package/dist/preview/chunk.SEHRPTNA.js +7 -0
- package/dist/preview/{chunk.MBU7UH6J.js → chunk.SGCW2XRC.js} +1 -1
- package/dist/preview/{chunk.4G32374Q.js → chunk.SS7234R6.js} +1 -1
- package/dist/preview/{chunk.WICFQROI.js → chunk.SVPKUWZU.js} +1 -1
- package/dist/preview/{chunk.2LNSENPV.js → chunk.SWMDFXUX.js} +1 -1
- package/dist/preview/{chunk.XFSGB6EU.js → chunk.T3UQ7ZQK.js} +1 -1
- package/dist/preview/chunk.T6PU3NKP.js +1 -0
- package/dist/preview/{chunk.ZVG3DR5G.js → chunk.T6WHGKWR.js} +1 -1
- package/dist/preview/{chunk.JEQO24GS.js → chunk.THVC2BEC.js} +1 -1
- package/dist/preview/{chunk.SJALH7IX.js → chunk.TIALD6SC.js} +1 -1
- package/dist/preview/{chunk.ULHB3RYK.js → chunk.TM4EPUNO.js} +1 -1
- package/dist/preview/chunk.U6ZRJKVM.js +1 -0
- package/dist/preview/chunk.UFDJXQQQ.js +32 -0
- package/dist/preview/{chunk.Y7H5O2SL.js → chunk.UKQUUPKE.js} +1 -1
- package/dist/preview/{chunk.IA5ZBMRD.js → chunk.UQQKDBIH.js} +1 -1
- package/dist/preview/{chunk.NUEPFPRA.js → chunk.UVA7AALY.js} +1 -1
- package/dist/preview/chunk.UXMPFPFH.js +20 -0
- package/dist/preview/chunk.VACKSKGJ.js +1 -0
- package/dist/preview/{chunk.ZQHCNFJK.js → chunk.VC3V7HLL.js} +1 -1
- package/dist/preview/{chunk.N5WDQAIM.js → chunk.VIH5AX7S.js} +2 -2
- package/dist/preview/{chunk.ZKAZA6UJ.js → chunk.VJBBVLGZ.js} +1 -1
- package/dist/preview/chunk.VN23AGIY.js +1 -0
- package/dist/preview/{chunk.2XSIJH5J.js → chunk.W4BKYSZX.js} +1 -1
- package/dist/preview/{chunk.XZWXDQ3N.js → chunk.WEOVK2T4.js} +1 -1
- package/dist/preview/chunk.WKI5INH7.js +1 -0
- package/dist/preview/chunk.WPXPVD33.js +88 -0
- package/dist/preview/chunk.X6KYRBL6.js +1 -0
- package/dist/preview/{chunk.LA2DMHZC.js → chunk.Y2YYH3JN.js} +1 -1
- package/dist/preview/{chunk.MU3XII7I.js → chunk.Y4FZKUOK.js} +1 -1
- package/dist/preview/chunk.Y4S7CDRB.js +1 -0
- package/dist/preview/{chunk.C634A6ZC.js → chunk.YP2QSPXU.js} +1 -1
- package/dist/preview/{chunk.JHAFQNGC.js → chunk.Z2TDZSMN.js} +1 -1
- package/dist/preview/{chunk.2QFKNTAZ.js → chunk.ZN3PUM2I.js} +1 -1
- package/dist/preview/index.html +53 -51
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +57 -0
- package/package.json +6 -6
- package/dist/preview/chunk.2AWVQ5SW.js +0 -1
- package/dist/preview/chunk.3ICWPRRJ.js +0 -1
- package/dist/preview/chunk.3RW677X6.js +0 -1
- package/dist/preview/chunk.4OEWFPH3.js +0 -1
- package/dist/preview/chunk.4STDIZVI.js +0 -2
- package/dist/preview/chunk.5T53SF2K.js +0 -1
- package/dist/preview/chunk.5X22RKB3.js +0 -1
- package/dist/preview/chunk.644FUGSX.js +0 -1
- package/dist/preview/chunk.7CETF4A6.js +0 -1
- package/dist/preview/chunk.BFDJTWGX.js +0 -88
- package/dist/preview/chunk.BJI2C3IZ.js +0 -1
- package/dist/preview/chunk.DKXVEVDG.js +0 -1
- package/dist/preview/chunk.DXWTM4SH.js +0 -1
- package/dist/preview/chunk.F7IQ4B6A.js +0 -1
- package/dist/preview/chunk.F7PIW2EM.js +0 -5
- package/dist/preview/chunk.G4VMRYS4.js +0 -1
- package/dist/preview/chunk.GPWYWALF.js +0 -1
- package/dist/preview/chunk.HGVBGSRS.js +0 -6
- package/dist/preview/chunk.ISXNAFRC.js +0 -20
- package/dist/preview/chunk.JU3BCCQM.js +0 -1
- package/dist/preview/chunk.K2AC536Q.js +0 -21
- package/dist/preview/chunk.K3UOXAZS.js +0 -1
- package/dist/preview/chunk.KNYLY7MH.js +0 -1
- package/dist/preview/chunk.LQAT7FA6.js +0 -3
- package/dist/preview/chunk.LTI5PKTS.js +0 -1
- package/dist/preview/chunk.MBP7VDYM.js +0 -1
- package/dist/preview/chunk.MH6CCHEX.js +0 -1
- package/dist/preview/chunk.MNRTA2CB.js +0 -1
- package/dist/preview/chunk.MYVED5LU.js +0 -1
- package/dist/preview/chunk.N7T7VB77.js +0 -25
- package/dist/preview/chunk.ODVRO2BJ.js +0 -1
- package/dist/preview/chunk.OVPFROL3.js +0 -1
- package/dist/preview/chunk.PGA5TUSN.js +0 -1
- package/dist/preview/chunk.PHC2MI4C.js +0 -1
- package/dist/preview/chunk.PXQVXBNG.js +0 -1
- package/dist/preview/chunk.Q5I5M3FR.js +0 -1
- package/dist/preview/chunk.QATUGE34.js +0 -1
- package/dist/preview/chunk.QL77K3D4.js +0 -1
- package/dist/preview/chunk.QUJS63OJ.js +0 -13
- package/dist/preview/chunk.RZ5PPQBV.js +0 -1
- package/dist/preview/chunk.SCGF4ZPP.js +0 -1
- package/dist/preview/chunk.SLAZFFCQ.js +0 -1
- package/dist/preview/chunk.SLPJWOKC.js +0 -1
- package/dist/preview/chunk.TKLYUVMR.js +0 -32
- package/dist/preview/chunk.TMAZNDA6.js +0 -1
- package/dist/preview/chunk.UDCDK7XJ.js +0 -4
- package/dist/preview/chunk.UO544PZH.js +0 -1
- package/dist/preview/chunk.VKHAAH32.js +0 -1
- package/dist/preview/chunk.VOOOIECX.js +0 -1
- package/dist/preview/chunk.VS6NT5C4.js +0 -1
- package/dist/preview/chunk.VUAOCYG2.js +0 -1
- package/dist/preview/chunk.VX65S2FA.js +0 -1
- package/dist/preview/chunk.X2I3XH2E.js +0 -2
- package/dist/preview/chunk.XWWSW3ZV.js +0 -7
- package/dist/preview/chunk.YOT7ESDG.js +0 -18
- package/dist/preview/chunk.ZYNUMVEC.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Qe,b as Xe,c as Je,d as at,e as tt,h as Ze,i as ea,k as aa,l as ta,m as rt}from"./chunk.
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Qe,b as Xe,c as Je,d as at,e as tt,h as Ze,i as ea,k as aa,l as ta,m as rt}from"./chunk.VC3V7HLL.js";import{c as je}from"./chunk.CY3ELWCM.js";import{g as Qa,h as Ja,i as Za}from"./chunk.RMR24LFJ.js";import"./chunk.OWOOKLIU.js";import{b as Ua,c as Va,d as Ye,e as Ya}from"./chunk.KMV6PJFL.js";import"./chunk.NAD7ZXYP.js";import{m as Re,q as qa,r as _a,s as Ga}from"./chunk.2GEJNG2U.js";import{a as Xa}from"./chunk.HJCQ6I3S.js";import{b as ja}from"./chunk.22BZU7ME.js";import"./chunk.2N4Z5K5S.js";import{b as Wa}from"./chunk.Y4FZKUOK.js";import{b as _e,d as Ue,e as Ve}from"./chunk.TIALD6SC.js";import"./chunk.QHY5NVYH.js";import"./chunk.U6ZRJKVM.js";import{b as Ge}from"./chunk.PLTH2LW5.js";import"./chunk.66P5IDTH.js";import"./chunk.AJSUHPBE.js";import"./chunk.KDXU5DT3.js";import"./chunk.M4AYA2PL.js";import"./chunk.H5S7OL2U.js";import"./chunk.PZQNR4KZ.js";import"./chunk.W4BKYSZX.js";import"./chunk.U5P23GO7.js";import{e as et}from"./chunk.7V56P2A7.js";import"./chunk.2B6P4GPS.js";import"./chunk.NOGGSLVG.js";import"./chunk.GZHZLJBF.js";import{c as Ha,d as Oa,e as we,o as Da}from"./chunk.UKQUUPKE.js";import"./chunk.OJGHDWI6.js";import"./chunk.DDUCIUVW.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import{G as Fa,c as Na,d as Ia,j as qe,n as Ba,u as Ka}from"./chunk.AI34V6WV.js";import{b as Ea,c as $t}from"./chunk.G4ULQK64.js";import{G,Ia as Ee,Na as Ma,Oa as U,Ra as La,T as $,Va as Pa,_ as Ra,aa as Ta,ba as T,da as Ce,i as Ke,j as $e,m as ee,ma as za,n as Ae,o as Fe,r as ve,x as Aa,y as ue,z as Ca}from"./chunk.M7RESZB6.js";import{a as ie}from"./chunk.SDO3U72B.js";import{Hc as $a,Z as re,gd as H,id as D,la as ka,ma as Se,na as _,ra as Sa}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as m}from"./chunk.AJZBJBMO.js";function At(e){return`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
.graview-altitude-control {
|
|
@@ -1128,6 +1128,6 @@ var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=gl
|
|
|
1128
1128
|
}
|
|
1129
1129
|
[data-graview-connector][data-graview-activity] {
|
|
1130
1130
|
animation: graview-relation 1200ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
1131
|
-
}`}function ra(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ea(d,o.scope)}var O=m(G(),1);var V=m($(),1),Ct=Ee(ie(()=>(__graviewPreload(import.meta.url,["./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DLDP6OWD.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function ia(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,O.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,w]=(0,O.useState)(!1),v=(0,O.useId)(),g=(0,O.useRef)(null),x=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!n)return;let h=c=>{let C=c.target;C&&(x.current?.contains(C)||g.current?.contains(C))||w(!1)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[n]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:h=>{h.key!=="Escape"||!n||(h.preventDefault(),h.stopPropagation(),w(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>w(h=>!h),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),n?(0,V.jsxs)("div",{ref:x,id:v,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("rail"),width:tt,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Ct,{}):null,(0,V.jsx)(at,{inside:!0,widthOf:Xa})]}):null]}):null}var ze=m(G(),1),Te=m($(),1);function it(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Et=Ee(ie(()=>(__graviewPreload(import.meta.url,["./chunk.D4TA5XDC.js","./chunk.EVEHSENK.js","./chunk.SBLYBRDU.js","./chunk.5X22RKB3.js","./chunk.XZUHFXME.js","./chunk.HJCQ6I3S.js","./chunk.SAYAFOF6.js","./chunk.R3N73BJO.js","./chunk.VN7I7XIO.js","./chunk.REH6RXNH.js","./chunk.MBP7VDYM.js","./chunk.BDTT4ENI.js","./chunk.WD4VPMEE.js","./chunk.VUAOCYG2.js","./chunk.5POG3G2C.js","./chunk.2XSIJH5J.js","./chunk.ISRQQVS4.js","./chunk.WVUJXDXZ.js","./chunk.MBU7UH6J.js","./chunk.2QFKNTAZ.js","./chunk.BI6DS3PZ.js","./chunk.PGA5TUSN.js","./chunk.7R727IKU.js","./chunk.LQAT7FA6.js","./chunk.GZHZLJBF.js","./chunk.Y7H5O2SL.js","./chunk.OJGHDWI6.js","./chunk.6HZY5NRX.js","./chunk.UO544PZH.js","./chunk.4STDIZVI.js","./chunk.HZHNM2KI.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JEQO24GS.js")))),Rt=Et.part((e,o)=>(0,Te.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function na(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let w=(0,ze.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||w)return null;let v=it(ja(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Te.jsx)(ze.Suspense,{fallback:null,children:(0,Te.jsx)(Rt,{showing:v})})}var Tt=m(G(),1);var W=m($(),1);function oa(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),w=e.overview??!1,v=s.places().map(E=>E.kind).filter(E=>!n.has(E)),g=Fa(e,d.schema.kinds,v),x=()=>{o($e(ee(e,!1),g))},h=(()=>{if(!g)return null;let E=Aa(g)[0],b=e.within?.view,R=(b?s.places().find(N=>N.as===b):void 0)??(E?s.places().filter(N=>N.kind===E).at(-1):void 0);return R?R.title:E?_(d.schema,E):d.graph.getNode(g)?.label??null})(),c=w?"Close the map":"Up",C=w&&h?`Close the map, down to ${h}`:c;return(0,W.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":w,"aria-label":C,title:w?C:"Up \u2014 the whole thing, from above",onClick:()=>w?x():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":w?1:0,...w?{color:"var(--graview-accent)"}:{}},children:[(0,W.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,W.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,W.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,W.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,W.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,W.jsx)("span",{className:"graview-altitude-label",children:c})]})}var sa=m($(),1);function da(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,sa.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,sa.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ua(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=m(G(),1);var t=m($(),1);Ra({search:_a,touchWeights:qa});var ne=e=>e!==void 0&&"act"in e,Me=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,zt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Mt(e){let o=()=>typeof window>"u"||window.innerWidth>=Ft,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function dt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:w,brand:v,aiDesk:g,selection:x}=T(),h=Ia(g),c=Ta(),C=Ma(),E=Da().marks.flag,b=Mt(e),R=(0,u.useRef)(null),N=(0,u.useRef)(null),z=(0,u.useRef)(null),B=(0,u.useId)(),[Le,I]=(0,u.useState)(!1),[K,se]=(0,u.useState)(null),[ft,he]=(0,u.useState)(null),[Pe,be]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let f=p.closest("[data-graview-embed]"),S=r.target,J=S===document.body||S===document.documentElement||S===window;if(f&&!(i&&J||S instanceof Node&&f.contains(S)))return;let Z=document.activeElement,ge=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&ge||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),I(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=zt(l),f=a.get(p)??[];f.push({id:`${B}-${i}`,hit:l}),a.set(p,f)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,f=l.filter(ge=>ge.hit.about!=="node"||!r||++p<=Wt),S=f.filter(ge=>ge.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??S,Z=!i.endsWith(":")&&S>0&&J>S?{id:`${B}-all-${i}`,all:i,count:J}:null;return{key:i,rows:f,count:J,more:Z}})},[c,B]),ae=h&&M.trim()?{id:`${B}-ask`,ask:M.trim()}:null,k=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),wa=(c?.hits??[]).filter(a=>a.about==="node").length,xe=c?.words??M,Ie=(0,u.useMemo)(()=>Re(xe).split(" ").filter(Boolean),[xe]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Ga(o,a.hit.id,xe,{principal:n,limit:Bt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,xe,n]),He=k.find(a=>a.id===K),q=k.find(a=>a.id===ft)??He??k[0],de=(0,u.useMemo)(()=>b&&Me(q)?F(q):[],[b,q?.id,F]),ye=(0,u.useMemo)(()=>b?new Map:new Map(Pe.flatMap(a=>{let r=Me(k.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[b,Pe,k,F]),ht=(0,u.useMemo)(()=>b?new Set:new Set(k.flatMap(a=>Me(a)&&F(a).length>0?[a.id]:[])),[b,k,F]),Oe=(0,u.useMemo)(()=>b?de:[...ye.values()].flat(),[b,de,ye]),L=He??Oe.find(a=>a.id===K)??k[0];(0,u.useEffect)(()=>{se(null),he(null),be([])},[M]);let le=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=le.current;if(!a)return;le.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let S=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(S)return S.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let De=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ma=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ma.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let ce=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(ce.current),[]);let te=a=>{a&&(clearTimeout(ce.current),se(a.id),ne(a)||he(a.id))},fa=a=>{if(!ma.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=k.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(se(i.id),!ne(i)&&(clearTimeout(ce.current),ce.current=setTimeout(()=>he(i.id),Kt)))},bt=()=>{clearTimeout(ce.current),q&&!ne(L)&&se(q.id)},xt=a=>be(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),ha=a=>{let r=N.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Ot)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let We=a=>{if(!a)return;if("ask"in a){Na(g,{pointed:{...x[0]!==void 0?{on:x[0]}:{},about:x},asked:a.ask}),s(i=>Ye(i)),I(!1);return}if("all"in a)return s(i=>ue(ee(i,!1),ve(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),le.current=a.all,I(!1),De(a.all,`Opening ${_(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>Ae(p,[i]));let l=R.current?.getBoundingClientRect();w({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),I(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>Ae($e(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ue(ee(i,!1),ve(r.kind),{ownPicture:!0})),le.current=r.kind,I(!1),De(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ca(i,r.kind,r.as)),le.current=r.kind,I(!1),De(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=C.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>Ae(l,[...new Set(i)]));break}case"act":break}I(!1),R.current?.blur()},yt=c?Ht(c.byKind,c.hits,o.schema):"",pe=Le&&M.trim().length>0,kt=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Ut};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ba=Pa("find",{open:pe,onOpenChange:a=>{a||I(!1)},...e?{at:kt}:{}}),ke=k.every(a=>"ask"in a),xa=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],St=a=>{let r=ne(L)&&K!==null,i=r?k.find(p=>p.id===L.of):K!==null?He:void 0,l=i?k.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),I(!0),r){let p=xa(L),f=p.indexOf(L)+1;if(f<p.length)return te(p[f]);if(b)return}te(k[Math.min(k.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=xa(L),f=p.indexOf(L)-1;return te(f>=0?p[f]:i)}te(k[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&k.length>0){a.preventDefault(),I(!0);let p=a.key==="PageDown"?ha(k.length):-ha(k.length);te(k[Math.min(k.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&Me(L)){let p=L,f=b?p.id===q?.id?de:F(p):ye.get(p.id)??F(p);if(f.length===0)return;a.preventDefault(),!b&&!Pe.includes(p.id)&&be(S=>[...S,p.id]),he(p.id),se(f[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;b||be(f=>f.filter(S=>S!==p)),te(k.find(f=>f.id===p))}else a.key==="Enter"?(a.preventDefault(),We(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},Be=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>We(a),style:{...Zt,...p?er:null,...i},...l,children:r},a.id)},ya=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>We(a),style:{...r?ir:ct,...i?nr:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ba.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":pe,"aria-controls":B,"aria-autocomplete":"list",...pe&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;I(!0),s(i=>Va(i,r.length>0?r:null))},onFocus:()=>I(!0),onBlur:()=>I(!1),onKeyDown:St,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?yt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ba.pane,id:B,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":b?"panel":"narrow",hidden:!pe,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Vt:b&&!ke?Gt:null,...pe?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...Yt,gridTemplateColumns:b&&!ke?`minmax(0, 1fr) ${qt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:N,role:"presentation","data-testid":"find-list",onMouseMove:fa,style:jt,children:[ke?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":ot(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:la,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(lt,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ot(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Jt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!b&&l!==null&&ht.has(r.id),f=ye.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[Be(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Pt,{hit:i,flag:E,words:l?.near&&l.why.matched?[...Ie,Re(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":f?"":void 0,title:f?"Put its actions away":"Actions",onClick:S=>{S.stopPropagation(),xt(r)},style:{...sr,...f?dr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:It(i)}),f?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:or,children:f.map(S=>ya(S,!0))}):null]},r.id)}),a.more?Be(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",Se(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),ar,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?Be(ae,(0,t.jsxs)("span",{style:Q,children:["Ask: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,wa>Dt?(0,t.jsxs)("p",{role:"presentation",style:st,"data-testid":"find-more-words",children:[re(wa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:st,children:"Current ones; add is:any for the past."}):null]}),b&&!ke&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:bt,onMouseMove:fa,style:Qt,children:[(0,t.jsx)(Lt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:E}),de.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...la,padding:"10px 0 4px"},children:"Actions"}),de.map(a=>ya(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:lr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u2191"}),(0,t.jsx)("kbd",{style:fe,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"esc"})," close"]})]})]})]})}function Lt({row:e,schema:o,accents:d,marking:s,q:n,flag:w}){let v=null,g="",x,h=null;if("ask"in e)g="Ask",x=`\u2018${e.ask}\u2019`,h=(0,t.jsx)("p",{style:Y,children:"Asks it of what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=_(o,e.all),x=`All ${re(e.count)} matching \u201C${n}\u201D`,h=(0,t.jsxs)("p",{style:Y,children:["Opens the ",Se(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=nt(Sa(o.tryDefinition(c.kind),c.kind)),x=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[w," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let C=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");h=(0,t.jsxs)(t.Fragment,{children:[C?(0,t.jsx)("p",{style:Y,children:nt(C)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",x=c.label,h=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",x=c.title,h=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",Se(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",x=c.label,h=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",x=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...la,padding:0},children:[v?(0,t.jsx)(lt,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Xt,children:x}),h]})}function Pt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:tr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:me,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:me,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...me},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...me},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:me,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function Nt(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let w=n[0],v=Re(w).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,C)=>C.length-c.length)[0];if(!g)continue;let x=v.length===w.length?g.length:w.length,h=n.index??0;h>s&&d.push({text:e.slice(s,h)}),d.push({text:w.slice(0,x),marked:!0}),s=h+x}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:Nt(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:rr,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function It(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
|
|
1132
|
-
${o}`:e.label}var nt=e=>e&&e[0].toUpperCase()+e.slice(1);function lt({kind:e,accents:o}){let d=Math.round($a(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function ot(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":_(o,e)}function Ht(e,o,d){let s=Object.entries(e).map(([v,g])=>ka(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let w=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${w>0?`, ${w} of them near`:""}`}var Ot=10,Dt=12,Wt=5,Bt=6,Kt=140,Ft=760,qt="15.5rem",_t={...La,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Gt={width:"min(42rem, calc(100vw - 24px))"},Ut=6,Vt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},Yt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},jt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Qt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Xt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},la={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Jt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},Zt={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},er={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},ar={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},tr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},me={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},rr={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},ct={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},ir={...ct,minHeight:32,margin:"0 12px 4px 24px"},nr={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},or={display:"grid",padding:"2px 0 6px"},sr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},dr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},st={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},lr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},fe={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var oe=m(G(),1);var ca=m($t(),1);var gt=m($(),1);function pt(){let{following:e,follow:o}=T();return e?(0,gt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var vt=m(G(),1);var A=m($(),1);function ut({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:w,show:v,go:g}=U(),{store:x}=T(),{movedByHand:h}=T(),c=h&&(n.pan!==void 0||Object.keys(n.pins).length>0),C=n.focusId&&n.focusId!==e?x.graph.getNode(n.focusId):void 0,E=z=>_(x.schema,z),b={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&C!==void 0,N=[];if(C&&!s&&N.push({key:"focused",node:(0,A.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(x,C.id),style:{...b,maxWidth:"min(14rem, 15vw)"},children:[(0,A.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(x,C.id)}),(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&N.push({key:"past",node:(0,A.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Ya(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:b,children:["the past",(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&N.push({key:"zoomed",node:(0,A.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:b,children:["zoomed in",(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&N.push({key:"moved",node:(0,A.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:b,children:"Reset view"})}),n.relation){let z=n.relation;N.push({key:"raised",node:(0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,A.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ue(n,ve(z),{ownPicture:!0})),title:`Go into the ${E(z).toLowerCase()}`,"aria-label":`Go into the ${E(z).toLowerCase()}`,style:{...b,color:"var(--graview-ink)"},children:[E(z),(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,A.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${E(z).toLowerCase()}`,"aria-label":`Stop showing ${E(z).toLowerCase()}`,style:{...b,minWidth:26,justifyContent:"center"},children:(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&N.length===0&&d===void 0?null:(0,A.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,A.jsx)("button",{type:"button",onClick:()=>w(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,N.map(({key:z,node:B},Le)=>(0,A.jsxs)(vt.Fragment,{children:[R||Le>0?(0,A.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,B]},z)),d]})}var P=m($(),1);function pa(){let[e,o]=(0,oe.useState)([]),d=(0,oe.useCallback)(s=>{o(n=>{let w=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...w?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ga({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,P.jsxs)(P.Fragment,{children:[(0,ca.createPortal)((0,P.jsx)(dt,{compact:e.compact}),e.slot),e.own?(0,ca.createPortal)((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(oe.Suspense,{fallback:null,children:(0,P.jsx)(rt,{})}),(0,P.jsx)(Wa,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}})]}),e.own):null]}):null}function va({home:e=null}){return(0,P.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:D("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,P.jsx)(ut,{home:e,onPicture:!0}),(0,P.jsx)("span",{style:{pointerEvents:"auto"},children:(0,P.jsx)(pt,{})})]})}var X=m(G(),1);var wt=m($(),1),cr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.AVFOTYZR.js","./chunk.HOQMD6WQ.js","./chunk.N7T7VB77.js","./chunk.SDO3U72B.js","./chunk.F7PIW2EM.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HQNE4I4M.js")));function ua(){let{store:e,principal:o}=T(),d=(0,X.useContext)(Ba),s=(0,X.useRef)(null),n=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>void(n.current=!0),[]),(0,X.useEffect)(()=>{let w=e.batches().length,v=cr().then(g=>g.sceneWay(e,o,d,w,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,wt.jsx)("span",{ref:s,hidden:!0})}var mt=m(G(),1);var y=m($(),1);function qi({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let w=(0,mt.useMemo)(()=>`${ta({scope:`.${n}`})}
|
|
1131
|
+
}`}function ra(e="dark",o={}){let d=At(e);return o.scope===void 0?d:Ea(d,o.scope)}var O=m(G(),1);var V=m($(),1),Ct=Ee(ie(()=>(__graviewPreload(import.meta.url,["./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IQMD7DG3.js")))).part(e=>(0,V.jsx)(e.MapKey,{}),{quiet:!0});function ia(){let{store:e}=T(),{view:o}=U(),d=Ce(),s=(0,O.useMemo)(()=>e.graph.allEdges().length>0,[e,d]),[n,w]=(0,O.useState)(!1),v=(0,O.useId)(),g=(0,O.useRef)(null),x=(0,O.useRef)(null);return(0,O.useEffect)(()=>{if(!n)return;let h=c=>{let C=c.target;C&&(x.current?.contains(C)||g.current?.contains(C))||w(!1)};return document.addEventListener("pointerdown",h,!0),()=>document.removeEventListener("pointerdown",h,!0)},[n]),s?(0,V.jsxs)("div",{style:{display:"contents"},onKeyDown:h=>{h.key!=="Escape"||!n||(h.preventDefault(),h.stopPropagation(),w(!1),g.current?.focus({preventScroll:!0}))},children:[(0,V.jsx)("button",{ref:g,type:"button","data-testid":"lines-key","aria-expanded":n,"aria-controls":v,title:"What the lines mean",onClick:()=>w(h=>!h),style:{position:"absolute",top:60,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("overview"),height:30,padding:"0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.8125rem",color:n?"var(--graview-accent)":"var(--graview-ink-muted)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Key"}),n?(0,V.jsxs)("div",{ref:x,id:v,"data-testid":"lines-key-pane","data-graview-offstage":"",style:{position:"absolute",top:98,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("rail"),width:tt,maxHeight:"calc(100cqh - 120px)",overflowY:"auto",boxSizing:"border-box",padding:"8px 8px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},children:[o.overview?(0,V.jsx)(Ct,{}):null,(0,V.jsx)(at,{inside:!0,widthOf:Xa})]}):null]}):null}var ze=m(G(),1),Te=m($(),1);function it(e){return e.lens!==null?{what:"lens",kind:e.lens}:e.records.length===1&&e.districts.length===0?{what:"record",id:e.records[0]}:e.districts.length===1&&e.records.length===0?{what:"district",kind:e.districts[0]}:null}var Et=Ee(ie(()=>(__graviewPreload(import.meta.url,["./chunk.RMR24LFJ.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.HJCQ6I3S.js","./chunk.22BZU7ME.js","./chunk.2N4Z5K5S.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.M4AYA2PL.js","./chunk.H5S7OL2U.js","./chunk.PZQNR4KZ.js","./chunk.W4BKYSZX.js","./chunk.NOGGSLVG.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.THVC2BEC.js")))),Rt=Et.part((e,o)=>(0,Te.jsx)(e.MapPanelFor,{showing:o.showing}),{what:"This panel",quiet:!0});function na(){let{store:e,view:o,selection:d,hiddenKinds:s,seatTalk:n}=T();Ce();let w=(0,ze.useSyncExternalStore)(n.subscribe,()=>n.get().draft!==null,()=>!1);if(!o.overview||w)return null;let v=it(ja(d,{...o,beside:!0},g=>e.graph.getNode(g)?.kind));return!v||v.what!=="record"&&(s.has(v.kind)||!e.schema.kinds.includes(v.kind))?null:(0,Te.jsx)(ze.Suspense,{fallback:null,children:(0,Te.jsx)(Rt,{showing:v})})}var Tt=m(G(),1);var W=m($(),1);function oa(){let{view:e,go:o}=U(),{store:d,views:s,hiddenKinds:n}=T(),w=e.overview??!1,v=s.places().map(E=>E.kind).filter(E=>!n.has(E)),g=Fa(e,d.schema.kinds,v),x=()=>{o($e(ee(e,!1),g))},h=(()=>{if(!g)return null;let E=Aa(g)[0],b=e.within?.view,R=(b?s.places().find(N=>N.as===b):void 0)??(E?s.places().filter(N=>N.kind===E).at(-1):void 0);return R?R.title:E?_(d.schema,E):d.graph.getNode(g)?.label??null})(),c=w?"Close the map":"Up",C=w&&h?`Close the map, down to ${h}`:c;return(0,W.jsxs)("button",{type:"button","data-testid":"overview",className:"graview-altitude-control","aria-pressed":w,"aria-label":C,title:w?C:"Up \u2014 the whole thing, from above",onClick:()=>w?x():o(ee(e,!0)),style:{position:"absolute",top:14,right:"calc(14px + var(--graview-dock, 0px))",zIndex:D("overview"),display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,height:38,padding:"0 13px 0 11px",borderRadius:8,borderColor:"transparent",fontSize:"0.875rem",whiteSpace:"nowrap",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)","--graview-altitude":w?1:0,...w?{color:"var(--graview-accent)"}:{}},children:[(0,W.jsxs)("svg",{className:"graview-altitude-mark",width:"16",height:"16",viewBox:"0 0 12 12","aria-hidden":"true",children:[(0,W.jsx)("ellipse",{className:"graview-altitude-mark-ring",cx:"6",cy:"6.6",rx:"5",ry:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"0.9"}),(0,W.jsx)("circle",{className:"graview-altitude-mark-apex",cx:"6",cy:"4",r:"1.5",fill:"currentColor"}),(0,W.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"left",cx:"1.6",cy:"7.4",r:"1.2",fill:"currentColor"}),(0,W.jsx)("circle",{className:"graview-altitude-mark-wing","data-side":"right",cx:"10.4",cy:"7.4",r:"1.2",fill:"currentColor"})]}),(0,W.jsx)("span",{className:"graview-altitude-label",children:c})]})}var sa=m($(),1);function da(){let{administered:e}=T(),{view:o,go:d}=U(),s=e.filter(n=>n.canShow);return s.length===0?null:(0,sa.jsx)("div",{role:"group","aria-label":"Administered","data-testid":"administered",style:{display:"flex",gap:6},children:s.map(n=>(0,sa.jsx)("button",{type:"button","aria-pressed":n.shown,"data-testid":`show-${n.name}`,title:n.shown?`Hide the ${n.name}'s own districts again`:n.description??`Show the ${n.name}'s own districts beside the domain`,onClick:()=>d(Ua(o,n.name,!n.shown)),style:{padding:"3px 11px",borderRadius:999,fontSize:"0.875rem",borderWidth:1,borderStyle:"solid",borderColor:n.shown?"var(--graview-accent)":"var(--graview-edge)",color:n.shown?"var(--graview-accent)":"var(--graview-ink-muted)",background:n.shown?"var(--graview-panel)":"transparent"},children:n.shown?`Hide the ${n.name}`:`Show the ${n.name}`},n.name))})}var u=m(G(),1);var t=m($(),1);Ra({search:_a,touchWeights:qa});var ne=e=>e!==void 0&&"act"in e,Me=e=>e!==void 0&&"hit"in e&&e.hit.about==="node"?e:void 0,zt=e=>e.about==="rule"?"rule:":e.about==="act"?"act:":e.kind;function Mt(e){let o=()=>typeof window>"u"||window.innerWidth>=Ft,[d,s]=(0,u.useState)(o);return(0,u.useEffect)(()=>{let n=()=>s(o());return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),d&&!e}function dt({compact:e=!1}){let{store:o,view:d,setView:s,principal:n,setMenuAt:w,brand:v,aiDesk:g,selection:x}=T(),h=Ia(g),c=Ta(),C=Ma(),E=Da().marks.flag,b=Mt(e),R=(0,u.useRef)(null),N=(0,u.useRef)(null),z=(0,u.useRef)(null),B=(0,u.useId)(),[Le,I]=(0,u.useState)(!1),[K,se]=(0,u.useState)(null),[ft,he]=(0,u.useState)(null),[Pe,be]=(0,u.useState)([]),M=d.q??"";(0,u.useEffect)(()=>{let a=r=>{if(r.defaultPrevented)return;let i=r.key.toLowerCase()==="k"&&(r.metaKey||r.ctrlKey)&&!r.altKey&&!r.shiftKey,l=r.key==="/"&&!r.metaKey&&!r.ctrlKey&&!r.altKey;if(!i&&!l)return;let p=R.current;if(!p)return;let f=p.closest("[data-graview-embed]"),S=r.target,J=S===document.body||S===document.documentElement||S===window;if(f&&!(i&&J||S instanceof Node&&f.contains(S)))return;let Z=document.activeElement,ge=Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement||Z instanceof HTMLSelectElement||Z instanceof HTMLElement&&Z.isContentEditable;l&&ge||(r.preventDefault(),p.getClientRects().length===0&&p.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),p.focus({preventScroll:!0}),p.select(),I(!0))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[]);let Ne=(0,u.useMemo)(()=>{let a=new Map;for(let[i,l]of(c?.hits??[]).entries()){if(l.about==="act")continue;let p=zt(l),f=a.get(p)??[];f.push({id:`${B}-${i}`,hit:l}),a.set(p,f)}let r=[...a.values()].filter(i=>i.some(l=>l.hit.about==="node")).length>1;return[...a.entries()].map(([i,l])=>{let p=0,f=l.filter(ge=>ge.hit.about!=="node"||!r||++p<=Wt),S=f.filter(ge=>ge.hit.about==="node").length,J=i.endsWith(":")?l.length:c?.byKind[i]??S,Z=!i.endsWith(":")&&S>0&&J>S?{id:`${B}-all-${i}`,all:i,count:J}:null;return{key:i,rows:f,count:J,more:Z}})},[c,B]),ae=h&&M.trim()?{id:`${B}-ask`,ask:M.trim()}:null,k=(0,u.useMemo)(()=>[...Ne.flatMap(a=>a.more?[...a.rows,a.more]:a.rows),...ae?[ae]:[]],[Ne,ae?.ask]),wa=(c?.hits??[]).filter(a=>a.about==="node").length,xe=c?.words??M,Ie=(0,u.useMemo)(()=>Re(xe).split(" ").filter(Boolean),[xe]),F=(0,u.useCallback)(a=>a.hit.about==="node"?Ga(o,a.hit.id,xe,{principal:n,limit:Bt}).map((r,i)=>({id:`${a.id}-act-${i}`,act:r,of:a.id})):[],[o,xe,n]),He=k.find(a=>a.id===K),q=k.find(a=>a.id===ft)??He??k[0],de=(0,u.useMemo)(()=>b&&Me(q)?F(q):[],[b,q?.id,F]),ye=(0,u.useMemo)(()=>b?new Map:new Map(Pe.flatMap(a=>{let r=Me(k.find(i=>i.id===a));return r?[[a,F(r)]]:[]})),[b,Pe,k,F]),ht=(0,u.useMemo)(()=>b?new Set:new Set(k.flatMap(a=>Me(a)&&F(a).length>0?[a.id]:[])),[b,k,F]),Oe=(0,u.useMemo)(()=>b?de:[...ye.values()].flat(),[b,de,ye]),L=He??Oe.find(a=>a.id===K)??k[0];(0,u.useEffect)(()=>{se(null),he(null),be([])},[M]);let le=(0,u.useRef)(null);(0,u.useEffect)(()=>{let a=le.current;if(!a)return;le.current=null;let r=0,i=()=>{let l=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`),p=document.activeElement;if(!(!p||p===document.body||p===document.documentElement||p===R.current||p===z.current||p===l))return;let S=[...l?.querySelectorAll('[role="group"][aria-label="Arrange"] :is(button, input)')??[]].find(J=>J.checkVisibility?.()??!0);if(S)return S.focus({preventScroll:!0});l&&l.tabIndex>=0&&p!==l&&l.focus({preventScroll:!0}),++r<240?requestAnimationFrame(i):document.activeElement===z.current&&z.current?.blur()};requestAnimationFrame(i)},[d]);let De=(a,r)=>{let i=document.querySelector(`[data-graview-view="aggregate:${CSS.escape(a)}"]`);if(i&&i.tabIndex>=0)return i.focus({preventScroll:!0});let l=z.current;if(!l)return R.current?.blur();l.setAttribute("aria-label",r),l.focus({preventScroll:!0})},ma=(0,u.useRef)({x:Number.NaN,y:Number.NaN,moved:!1});(0,u.useEffect)(()=>{let a=r=>{let i=ma.current;i.moved=r.clientX!==i.x||r.clientY!==i.y,i.x=r.clientX,i.y=r.clientY};return window.addEventListener("mousemove",a,{capture:!0,passive:!0}),()=>window.removeEventListener("mousemove",a,{capture:!0})},[]);let ce=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>clearTimeout(ce.current),[]);let te=a=>{a&&(clearTimeout(ce.current),se(a.id),ne(a)||he(a.id))},fa=a=>{if(!ma.current.moved)return;let r=a.target.closest?.('[role="option"]')?.id;if(!r||r===K)return;let i=k.find(l=>l.id===r)??Oe.find(l=>l.id===r);i&&(se(i.id),!ne(i)&&(clearTimeout(ce.current),ce.current=setTimeout(()=>he(i.id),Kt)))},bt=()=>{clearTimeout(ce.current),q&&!ne(L)&&se(q.id)},xt=a=>be(r=>r.includes(a.id)?r.filter(i=>i!==a.id):[...r,a.id]),ha=a=>{let r=N.current,i=r?.querySelector('[role="option"]')?.getBoundingClientRect().height??0,l=r?.clientHeight??0;return Math.min(a,i>0&&l>0?Math.max(1,Math.floor(l/i)-1):Ot)};(0,u.useEffect)(()=>{K&&document.getElementById(K)?.scrollIntoView?.({block:"nearest"})},[K]);let We=a=>{if(!a)return;if("ask"in a){Na(g,{pointed:{...x[0]!==void 0?{on:x[0]}:{},about:x},asked:a.ask}),s(i=>Ye(i)),I(!1);return}if("all"in a)return s(i=>ue(ee(i,!1),ve(a.all),{ownPicture:!0,...i.q?{carry:i.q}:{}})),le.current=a.all,I(!1),De(a.all,`Opening ${_(o.schema,a.all)} matching \u201C${M.trim()}\u201D\u2026`);if(ne(a)){let i=a.act.subject;s(p=>Ae(p,[i]));let l=R.current?.getBoundingClientRect();w({x:l?.left??0,y:(l?.bottom??0)+6,on:i}),I(!1),R.current?.blur();return}let r=a.hit;switch(r.about){case"node":s(i=>Ae($e(ee(i,!1),r.id),[r.id]));break;case"kind":return s(i=>ue(ee(i,!1),ve(r.kind),{ownPicture:!0})),le.current=r.kind,I(!1),De(r.kind,`Opening ${r.label}\u2026`);case"place":return s(i=>Ca(i,r.kind,r.as)),le.current=r.kind,I(!1),De(r.kind,`Opening ${r.title}\u2026`);case"rule":{let i=C.filter(l=>l.invariant===r.name).flatMap(l=>l.nodeIds);s(l=>Ae(l,[...new Set(i)]));break}case"act":break}I(!1),R.current?.blur()},yt=c?Ht(c.byKind,c.hits,o.schema):"",pe=Le&&M.trim().length>0,kt=(0,u.useCallback)(()=>{let a=R.current?.closest("[data-graview-app-bar]")?.getBoundingClientRect();if(a)return{x:a.right,y:a.bottom-Ut};let r=R.current?.getBoundingClientRect();return r?{x:r.right,y:r.bottom}:null},[]),ba=Pa("find",{open:pe,onOpenChange:a=>{a||I(!1)},...e?{at:kt}:{}}),ke=k.every(a=>"ask"in a),xa=a=>ne(a)?Oe.filter(r=>r.of===a.of):[],St=a=>{let r=ne(L)&&K!==null,i=r?k.find(p=>p.id===L.of):K!==null?He:void 0,l=i?k.indexOf(i):-1;if(a.key==="ArrowDown"){if(a.preventDefault(),I(!0),r){let p=xa(L),f=p.indexOf(L)+1;if(f<p.length)return te(p[f]);if(b)return}te(k[Math.min(k.length-1,l+1)])}else if(a.key==="ArrowUp"){if(a.preventDefault(),r){let p=xa(L),f=p.indexOf(L)-1;return te(f>=0?p[f]:i)}te(k[Math.max(0,l-1)])}else if((a.key==="PageDown"||a.key==="PageUp")&&k.length>0){a.preventDefault(),I(!0);let p=a.key==="PageDown"?ha(k.length):-ha(k.length);te(k[Math.min(k.length-1,Math.max(0,(l<0?-1:l)+p))])}else if(a.key==="ArrowRight"&&!r&&Me(L)){let p=L,f=b?p.id===q?.id?de:F(p):ye.get(p.id)??F(p);if(f.length===0)return;a.preventDefault(),!b&&!Pe.includes(p.id)&&be(S=>[...S,p.id]),he(p.id),se(f[0].id)}else if(a.key==="ArrowLeft"&&r){a.preventDefault();let p=L.of;b||be(f=>f.filter(S=>S!==p)),te(k.find(f=>f.id===p))}else a.key==="Enter"?(a.preventDefault(),We(L)):a.key==="Escape"&&(a.preventDefault(),M?s(p=>Ye(p)):R.current?.blur())},Be=(a,r,i={},l={})=>{let p=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":p,onClick:()=>We(a),style:{...Zt,...p?er:null,...i},...l,children:r},a.id)},ya=(a,r)=>{let i=a.id===L?.id;return(0,t.jsx)("div",{id:a.id,role:"option","aria-selected":i,"data-testid":"find-act","data-about":"act",onClick:()=>We(a),style:{...r?ir:ct,...i?nr:null,...a.act.destructive?{color:"var(--graview-warn)"}:null},children:a.act.title},a.id)};return(0,t.jsxs)("div",{style:{position:"relative",minWidth:0,flex:"1 1 auto"},"data-testid":"find",children:[(0,t.jsx)("input",{ref:a=>{R.current=a,ba.trigger.ref(a)},"data-graview-popover-trigger":"find",type:"search",role:"combobox","aria-label":"Find anything","aria-expanded":pe,"aria-controls":B,"aria-autocomplete":"list",...pe&&L?{"aria-activedescendant":L.id}:{},"data-testid":"find-box",placeholder:"Find\u2026","aria-keyshortcuts":"/ Meta+K Control+K",value:M,onChange:a=>{let r=a.target.value;I(!0),s(i=>Va(i,r.length>0?r:null))},onFocus:()=>I(!0),onBlur:()=>I(!1),onKeyDown:St,style:{width:"100%",boxSizing:"border-box",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-panel)",border:`1px solid ${M?"var(--graview-accent)":"var(--graview-edge)"}`,borderRadius:8}}),(0,t.jsx)("span",{role:"status","aria-live":"polite",style:qe,"data-testid":"find-count",children:M.trim()?yt:""}),(0,t.jsx)("span",{ref:z,tabIndex:-1,role:"status",style:qe,"data-testid":"find-landing"}),(0,t.jsxs)("div",{...ba.pane,id:B,role:"listbox","aria-label":M?`What \u201C${M}\u201D finds`:"What the words find","data-testid":"find-strip","data-graview-find":b?"panel":"narrow",hidden:!pe,onMouseDown:a=>a.preventDefault(),style:{..._t,...e?Vt:b&&!ke?Gt:null,...pe?{display:"flex"}:null},children:[(0,t.jsxs)("div",{style:{...Yt,gridTemplateColumns:b&&!ke?`minmax(0, 1fr) ${qt}`:"minmax(0, 1fr)"},children:[(0,t.jsxs)("div",{ref:N,role:"presentation","data-testid":"find-list",onMouseMove:fa,style:jt,children:[ke?(0,t.jsxs)("p",{role:"presentation",style:{margin:0,padding:"10px 12px",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"find-nothing",children:["Nothing here is called \u201C",c?.words||M,"\u201D."]}):Ne.map(a=>(0,t.jsxs)("div",{role:"group","aria-label":ot(a.key,o.schema),children:[(0,t.jsxs)("div",{role:"presentation",style:la,children:[a.key!=="rule:"&&a.key!=="act:"?(0,t.jsx)(lt,{kind:a.key,accents:v?.accents}):null,(0,t.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ot(a.key,o.schema)}),(0,t.jsx)("span",{"aria-hidden":"true",style:Jt,"data-testid":"find-group-count",children:re(a.count)})]}),a.rows.map(r=>{let i=r.hit,l=i.about==="node"?i:null,p=!b&&l!==null&&ht.has(r.id),f=ye.get(r.id);return(0,t.jsxs)(u.Fragment,{children:[Be(r,(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Pt,{hit:i,flag:E,words:l?.near&&l.why.matched?[...Ie,Re(l.why.matched)]:Ie}),p?(0,t.jsx)("span",{"aria-hidden":"true","data-testid":"find-acts-open","data-open":f?"":void 0,title:f?"Put its actions away":"Actions",onClick:S=>{S.stopPropagation(),xt(r)},style:{...sr,...f?dr:null},children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,t.jsx)("circle",{cx:"3.5",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"8",cy:"8",r:"1.4",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12.5",cy:"8",r:"1.4",fill:"currentColor"})]})}):null]}),p?{paddingRight:48}:{},{"data-testid":"find-hit","data-about":i.about,...l?.near?{"data-near":""}:{},title:It(i)}),f?(0,t.jsx)("div",{role:"group","aria-label":`What can be done about ${l?.label??"it"}`,style:or,children:f.map(S=>ya(S,!0))}):null]},r.id)}),a.more?Be(a.more,(0,t.jsxs)("span",{style:Q,children:["All ",re(a.more.count)," ",Se(o.schema,a.more.all).toLowerCase()," matching \u201C",M.trim(),"\u201D"]}),ar,{"data-testid":"find-all","data-about":"all"}):null]},a.key)),ae?Be(ae,(0,t.jsxs)("span",{style:Q,children:["Ask: ",(0,t.jsxs)("span",{style:{fontWeight:600},children:["\u2018",ae.ask,"\u2019"]})]}),{borderTop:"1px solid var(--graview-edge)",marginTop:4},{"data-testid":"find-ask"}):null,wa>Dt?(0,t.jsxs)("p",{role:"presentation",style:st,"data-testid":"find-more-words",children:[re(wa)," found: another word of the name narrows them."]}):null,c&&c.searched.past===!1&&c.searched.kinds.some(a=>o.schema.tryDefinition(a)?.lifecycle)?(0,t.jsx)("p",{role:"presentation",style:st,children:"Current ones; add is:any for the past."}):null]}),b&&!ke&&q?(0,t.jsxs)("div",{role:"group","aria-label":"The one lit","data-testid":"find-panel",onMouseEnter:bt,onMouseMove:fa,style:Qt,children:[(0,t.jsx)(Lt,{row:q,schema:o.schema,accents:v?.accents,marking:Ie,q:M.trim(),flag:E}),de.length>0?(0,t.jsxs)("div",{role:"group","aria-label":"Actions",style:{display:"grid",gap:4},children:[(0,t.jsx)("div",{role:"presentation",style:{...la,padding:"10px 0 4px"},children:"Actions"}),de.map(a=>ya(a,!1))]}):null]}):null]}),e?null:(0,t.jsxs)("div",{"aria-hidden":"true",style:lr,"data-testid":"find-keys",children:[(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u2191"}),(0,t.jsx)("kbd",{style:fe,children:"\u2193"})," move"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u21B5"})," open"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"\u2192"})," actions"]}),(0,t.jsxs)("span",{children:[(0,t.jsx)("kbd",{style:fe,children:"esc"})," close"]})]})]})]})}function Lt({row:e,schema:o,accents:d,marking:s,q:n,flag:w}){let v=null,g="",x,h=null;if("ask"in e)g="Ask",x=`\u2018${e.ask}\u2019`,h=(0,t.jsx)("p",{style:Y,children:"Asks it of what is selected; the answer comes on a card beside it."});else if("all"in e)v=e.all,g=_(o,e.all),x=`All ${re(e.count)} matching \u201C${n}\u201D`,h=(0,t.jsxs)("p",{style:Y,children:["Opens the ",Se(o,e.all).toLowerCase(),", narrowed by these words."]});else{let c=e.hit;switch(c.about){case"node":{v=c.kind,g=nt(Sa(o.tryDefinition(c.kind),c.kind)),x=(0,t.jsxs)(t.Fragment,{children:[c.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[w," "]}):null,(0,t.jsx)(j,{text:c.label,words:s})]});let C=[c.apart,c.current?null:"past",c.archived?"set aside":null].filter(Boolean).join(" \xB7 ");h=(0,t.jsxs)(t.Fragment,{children:[C?(0,t.jsx)("p",{style:Y,children:nt(C)}):null,c.near?(0,t.jsxs)("p",{style:Y,children:["Near \u201C",c.why.asked,"\u201D",c.why.field!=="label"?` \u2014 ${c.why.reading.toLowerCase()}: ${c.why.fragment}`:""]}):c.why.field!=="label"?(0,t.jsxs)("p",{style:Y,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:c.why.reading}),(0,t.jsx)("br",{}),(0,t.jsx)(j,{text:c.why.fragment,words:s})]}):null]});break}case"kind":v=c.kind,g="Kind",x=c.label,h=(0,t.jsxs)("p",{style:Y,children:["Goes into the ",c.label.toLowerCase(),", all of them",c.count>0?`; ${re(c.count)} match these words`:"","."]});break;case"place":v=c.kind,g="Place",x=c.title,h=(0,t.jsxs)("p",{style:Y,children:["A picture of the ",Se(o,c.kind).toLowerCase(),"."]});break;case"rule":g="Rule",x=c.label,h=(0,t.jsx)("p",{style:Y,children:"Selects what it flags."});break;case"act":g="Act",x=c.title;break}}return(0,t.jsxs)("div",{role:"presentation","data-testid":"find-said",style:{display:"grid",gap:6},children:[(0,t.jsxs)("div",{style:{...la,padding:0},children:[v?(0,t.jsx)(lt,{kind:v,accents:d}):null,g]}),(0,t.jsx)("div",{style:Xt,children:x}),h]})}function Pt({hit:e,flag:o,words:d}){switch(e.about){case"node":return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{style:tr,children:[e.flagged?(0,t.jsxs)("span",{style:{color:"var(--graview-warn)"},children:[o," "]}):null,(0,t.jsx)(j,{text:e.label,words:d}),e.apart?(0,t.jsxs)("span",{style:me,children:[" \xB7 ",e.apart]}):null,e.current?null:(0,t.jsx)("span",{style:me,children:" \xB7 past"})]}),e.near?(0,t.jsxs)("span",{style:{...Q,...me},"data-testid":"find-near",children:["Near \u201C",e.why.asked,"\u201D",e.why.field!=="label"?` \u2014 ${e.why.reading.toLowerCase()}: `:"",e.why.field!=="label"?(0,t.jsx)(j,{text:e.why.fragment,words:d}):null]}):e.why.field!=="label"?(0,t.jsxs)("span",{style:{...Q,...me},children:[e.why.reading.toLowerCase(),": ",(0,t.jsx)(j,{text:e.why.fragment,words:d})]}):null]});case"kind":return(0,t.jsxs)("span",{style:Q,children:[(0,t.jsx)(j,{text:e.label,words:d}),(0,t.jsxs)("span",{style:me,children:[" \xB7 ",e.count," match"]})]});case"place":return(0,t.jsxs)("span",{style:Q,children:["Go to ",(0,t.jsx)(j,{text:e.title,words:d})]});case"rule":return(0,t.jsxs)("span",{style:Q,children:["The rule \u201C",(0,t.jsx)(j,{text:e.label,words:d}),"\u201D"]});case"act":return(0,t.jsx)("span",{style:Q,children:e.title})}}function Nt(e,o){if(o.length===0)return[{text:e}];let d=[],s=0;for(let n of e.matchAll(/[\p{L}\p{N}]+/gu)){let w=n[0],v=Re(w).replace(/ /g,""),g=o.filter(c=>v.startsWith(c)).sort((c,C)=>C.length-c.length)[0];if(!g)continue;let x=v.length===w.length?g.length:w.length,h=n.index??0;h>s&&d.push({text:e.slice(s,h)}),d.push({text:w.slice(0,x),marked:!0}),s=h+x}return s<e.length&&d.push({text:e.slice(s)}),d}function j({text:e,words:o}){return(0,t.jsx)(t.Fragment,{children:Nt(e,o).map((d,s)=>d.marked?(0,t.jsx)("mark",{style:rr,children:d.text},s):(0,t.jsx)(u.Fragment,{children:d.text},s))})}function It(e){if(e.about!=="node")return"";let o=e.near?`Near \u201C${e.why.asked}\u201D`:e.why.field!=="label"?`${e.why.reading}: ${e.why.fragment}`:"";return o?`${e.label}
|
|
1132
|
+
${o}`:e.label}var nt=e=>e&&e[0].toUpperCase()+e.slice(1);function lt({kind:e,accents:o}){let d=Math.round($a(e,o));return(0,t.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:2,flex:"0 0 auto",background:`hsl(${d} 55% 52%)`}})}function ot(e,o){return e==="rule:"?"Rules":e==="act:"?"Acts":_(o,e)}function Ht(e,o,d){let s=Object.entries(e).map(([v,g])=>ka(d,v,g)),n=o.filter(v=>v.about==="kind"||v.about==="place"||v.about==="rule").length;n>0&&s.push(`${n} ${n===1?"place or rule":"places and rules"}`);let w=o.filter(v=>v.about==="node"&&v.near).length;return s.length===0?"Nothing found":`${s.join(", ")} found${w>0?`, ${w} of them near`:""}`}var Ot=10,Dt=12,Wt=5,Bt=6,Kt=140,Ft=760,qt="15.5rem",_t={...La,flexDirection:"column",width:"min(26rem, calc(100vw - 24px))",maxHeight:"min(64vh, 30rem)",overflow:"hidden",boxSizing:"border-box",background:"linear-gradient(var(--graview-panel), var(--graview-panel)) var(--graview-ground, var(--graview-panel))",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:"1px solid var(--graview-edge)",borderRadius:10,boxShadow:"0 10px 28px rgb(0 0 0 / 0.18)",padding:0},Gt={width:"min(42rem, calc(100vw - 24px))"},Ut=6,Vt={width:"var(--graview-bar-width, 100vw)",maxHeight:"55vh",borderRadius:0,borderLeft:"none",borderRight:"none"},Yt={display:"grid",gridTemplateRows:"minmax(0, 1fr)",flex:"1 1 auto",minHeight:0},jt={overflowY:"auto",overflowX:"hidden",minHeight:0,padding:"4px 0",overscrollBehavior:"contain"},Qt={overflowY:"auto",minHeight:0,padding:"12px 14px",borderLeft:"1px solid var(--graview-edge)",background:"var(--graview-panel-muted)",display:"flex",flexDirection:"column",gap:4},Xt={fontWeight:600,fontSize:"0.9375rem",lineHeight:1.35,color:"var(--graview-ink)",overflowWrap:"anywhere"},Y={margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)",overflowWrap:"anywhere"},la={display:"flex",alignItems:"center",gap:6,padding:"10px 12px 4px",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Jt={marginLeft:"auto",fontWeight:400,letterSpacing:0,fontVariantNumeric:"tabular-nums",color:"var(--graview-ink-faint)"},Zt={position:"relative",display:"grid",gap:1,minHeight:34,padding:"5px 12px",alignContent:"center",cursor:"pointer",fontSize:"0.875rem",lineHeight:1.35,color:"var(--graview-ink)",minWidth:0},er={background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))",boxShadow:"inset 3px 0 0 var(--graview-accent)"},ar={color:"var(--graview-accent)",fontSize:"0.8125rem",minHeight:30},Q={display:"block",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},tr={display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:2,minWidth:0,overflow:"hidden",overflowWrap:"anywhere",fontWeight:600},me={color:"var(--graview-ink-muted)",fontSize:"0.8125rem",fontWeight:400},rr={background:"color-mix(in srgb, var(--graview-accent) 24%, transparent)",color:"inherit",borderRadius:2,padding:0,boxShadow:"0 1px 0 color-mix(in srgb, var(--graview-accent) 70%, transparent)"},ct={display:"flex",alignItems:"center",minHeight:32,padding:"4px 10px",boxSizing:"border-box",borderWidth:1,borderStyle:"solid",borderColor:"var(--graview-edge)",borderRadius:6,background:"var(--graview-panel)",color:"var(--graview-ink)",fontSize:"0.8125rem",lineHeight:1.3,cursor:"pointer",overflowWrap:"anywhere"},ir={...ct,minHeight:32,margin:"0 12px 4px 24px"},nr={borderColor:"var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)",background:"color-mix(in srgb, var(--graview-accent) 12%, var(--graview-panel))"},or={display:"grid",padding:"2px 0 6px"},sr={position:"absolute",top:"50%",right:6,transform:"translateY(-50%)",width:36,height:32,display:"grid",placeItems:"center",borderRadius:6,color:"var(--graview-ink-muted)",borderWidth:1,borderStyle:"solid",borderColor:"transparent"},dr={color:"var(--graview-accent)",borderColor:"var(--graview-edge)",background:"var(--graview-panel)"},st={margin:0,padding:"6px 12px 4px",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},lr={display:"flex",flexWrap:"wrap",gap:"4px 14px",padding:"7px 12px",borderTop:"1px solid var(--graview-edge)",color:"var(--graview-ink-faint)",fontSize:"0.75rem",flex:"0 0 auto"},fe={display:"inline-block",minWidth:16,padding:"0 4px",marginRight:3,border:"1px solid var(--graview-edge)",borderRadius:4,font:"inherit",fontSize:"0.6875rem",lineHeight:"16px",textAlign:"center",color:"var(--graview-ink-muted)",background:"var(--graview-panel)"};var oe=m(G(),1);var ca=m($t(),1);var gt=m($(),1);function pt(){let{following:e,follow:o}=T();return e?(0,gt.jsxs)("button",{type:"button","data-testid":"following-who",onClick:()=>o(null),title:"Press, or Escape, to stop following",style:{display:"inline-flex",alignItems:"center",gap:6,minHeight:24,padding:"2px 9px",borderRadius:999,border:"1px solid var(--graview-accent)",background:"transparent",color:"var(--graview-accent)",fontSize:"0.875rem",whiteSpace:"nowrap"},children:["following ",e.name]}):null}var vt=m(G(),1);var A=m($(),1);function ut({home:e,homeLabel:o,children:d,onPicture:s=!1}){let{view:n,focus:w,show:v,go:g}=U(),{store:x}=T(),{movedByHand:h}=T(),c=h&&(n.pan!==void 0||Object.keys(n.pins).length>0),C=n.focusId&&n.focusId!==e?x.graph.getNode(n.focusId):void 0,E=z=>_(x.schema,z),b={display:"inline-flex",alignItems:"center",gap:6,minHeight:26,padding:"2px 6px",fontSize:"0.8125rem",borderRadius:6,border:"1px solid transparent",boxShadow:"none",background:"transparent",color:"var(--graview-ink-muted)",whiteSpace:"nowrap"},R=o!==void 0&&C!==void 0,N=[];if(C&&!s&&N.push({key:"focused",node:(0,A.jsxs)("button",{type:"button","data-testid":"focused",onClick:()=>g(Fe({...n,focusId:e},!1)),title:Ge(x,C.id),style:{...b,maxWidth:"min(14rem, 15vw)"},children:[(0,A.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:Ge(x,C.id)}),(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.past&&N.push({key:"past",node:(0,A.jsxs)("button",{type:"button","data-testid":"past",onClick:()=>g(Ya(n,!1)),title:"Back to now \u2014 retired things leave the picture again",style:b,children:["the past",(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),n.zoom&&N.push({key:"zoomed",node:(0,A.jsxs)("button",{type:"button","data-testid":"zoomed",onClick:()=>g(Fe(n,!1)),title:"Zoom back out",style:b,children:["zoomed in",(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})]})}),c&&N.push({key:"moved",node:(0,A.jsx)("button",{type:"button","data-testid":"moved",onClick:()=>g(Ke(n)),title:"Put the camera and everything you dragged back where the layout wanted them",style:b,children:"Reset view"})}),n.relation){let z=n.relation;N.push({key:"raised",node:(0,A.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,A.jsxs)("button",{type:"button","data-testid":"raised-into",onClick:()=>g(ue(n,ve(z),{ownPicture:!0})),title:`Go into the ${E(z).toLowerCase()}`,"aria-label":`Go into the ${E(z).toLowerCase()}`,style:{...b,color:"var(--graview-ink)"},children:[E(z),(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\u2198"})]}),(0,A.jsx)("button",{type:"button","data-testid":"raised",onClick:()=>v(null),title:`Stop showing ${E(z).toLowerCase()}`,"aria-label":`Stop showing ${E(z).toLowerCase()}`,style:{...b,minWidth:26,justifyContent:"center"},children:(0,A.jsx)("span",{"aria-hidden":"true",style:{opacity:.7},children:"\xD7"})})]})})}return s&&!R&&N.length===0&&d===void 0?null:(0,A.jsxs)("nav",{"aria-label":"View","data-testid":"trail",style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.875rem",minWidth:0,...s?{pointerEvents:"auto",padding:"4px 6px",borderRadius:8,background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",overflow:"hidden"}:{}},children:[R?(0,A.jsx)("button",{type:"button",onClick:()=>w(e),style:{border:"none",background:"none",padding:"3px 0",minHeight:24,whiteSpace:"nowrap",color:"var(--graview-ink-muted)"},children:o}):null,N.map(({key:z,node:B},Le)=>(0,A.jsxs)(vt.Fragment,{children:[R||Le>0?(0,A.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"\u203A"}):null,B]},z)),d]})}var P=m($(),1);function pa(){let[e,o]=(0,oe.useState)([]),d=(0,oe.useCallback)(s=>{o(n=>{let w=s.phase!=="running"&&n[0]?.name===s.name&&n[0]?.at===s.at;return[s,...w?n.slice(1):n].slice(0,12)})},[]);return[e,d]}function ga({find:e,calls:o,seat:d,remembers:s=!1}){return e?(0,P.jsxs)(P.Fragment,{children:[(0,ca.createPortal)((0,P.jsx)(dt,{compact:e.compact}),e.slot),e.own?(0,ca.createPortal)((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(oe.Suspense,{fallback:null,children:(0,P.jsx)(rt,{})}),(0,P.jsx)(Wa,{calls:o,remembers:s,...d!==void 0?{seat:d}:{}})]}),e.own):null]}):null}function va({home:e=null}){return(0,P.jsxs)("div",{"data-graview-scene-trail":"",style:{position:"absolute",top:14,left:14,maxWidth:"calc(100% - 150px - var(--graview-dock, 0px))",zIndex:D("overview"),display:"flex",alignItems:"center",gap:6,minWidth:0,pointerEvents:"none"},children:[(0,P.jsx)(ut,{home:e,onPicture:!0}),(0,P.jsx)("span",{style:{pointerEvents:"auto"},children:(0,P.jsx)(pt,{})})]})}var X=m(G(),1);var wt=m($(),1),cr=ie(()=>(__graviewPreload(import.meta.url,["./chunk.Q355UPFG.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.F7YXLYLX.js")));function ua(){let{store:e,principal:o}=T(),d=(0,X.useContext)(Ba),s=(0,X.useRef)(null),n=(0,X.useRef)(!1);return(0,X.useEffect)(()=>()=>void(n.current=!0),[]),(0,X.useEffect)(()=>{let w=e.batches().length,v=cr().then(g=>g.sceneWay(e,o,d,w,s.current),()=>{});return()=>void v.then(g=>g?.(n.current))},[e,o,d]),(0,wt.jsx)("span",{ref:s,hidden:!0})}var mt=m(G(),1);var y=m($(),1);function qi({address:e=!1,auto:o,quickAsk:d=!0,scheme:s,scope:n}){let w=(0,mt.useMemo)(()=>`${ta({scope:`.${n}`})}
|
|
1133
1133
|
${ra(s,{scope:`.${n}`})}`,[s,n]),v=Ka(),[g]=pa();return(0,y.jsx)(za.Provider,{value:!0,children:(0,y.jsxs)("div",{"data-embed-content":"",style:{position:"relative",flex:o?`0 0 ${et}px`:"1 1 auto",minHeight:0,containerType:"size"},children:[(0,y.jsx)("style",{children:w}),e?(0,y.jsx)(Za,{}):null,(0,y.jsx)(Ja,{}),(0,y.jsx)(va,{}),(0,y.jsx)(oa,{}),(0,y.jsx)(ia,{}),(0,y.jsxs)(Qa,{children:[(0,y.jsx)(Xe,{}),(0,y.jsx)(Je,{face:"scene",on:d}),(0,y.jsx)(na,{}),(0,y.jsx)(Ue,{children:(0,y.jsx)(je,{children:(0,y.jsx)(Ze,{children:(0,y.jsx)(aa,{children:(0,y.jsx)(Qe,{placement:"menu"})})})})}),(0,y.jsx)(Ve,{}),(0,y.jsx)(ea,{}),(0,y.jsx)(ga,{find:v,calls:g}),(0,y.jsx)(ua,{}),(0,y.jsx)(_e,{face:"scene"})]})]})})}function _i(){return(0,y.jsx)(da,{})}export{qi as SceneFace,_i as SceneKeeping};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.JYFZCJ4N.js";import"./chunk.H5S7OL2U.js";import"./chunk.Y2YYH3JN.js";import"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{$b as w,mc as S}from"./chunk.DZZL5IDD.js";function v(s){return[...s.mutations??[],...S(s.schema,s.mutations??[])]}function B(s){let i=[...s.schema.kinds],a=v(s),d=new Map,c=new Map;for(let e of a){c.set(e.name,e.creates??[]);let n=w(e.input).filter(t=>!t.optional&&!t.kinds.includes("*")).flatMap(t=>t.kinds);d.set(e.name,[...new Set(n)])}let g=new Map;for(let e of i)g.set(e,[]);for(let e of a)for(let n of c.get(e.name)??[])g.get(n)?.push(e.name);let p=new Map,l=new Set;for(let e=0;;e+=1){let n=[];for(let t of a)if((d.get(t.name)??[]).every(o=>l.has(o)))for(let o of c.get(t.name)??[])l.has(o)||n.push(o);if(n.length===0)break;for(let t of n)l.add(t),p.set(t,e)}let h=e=>{let n=g.get(e)??[];if(n.length===0)return[];let t=n.map(r=>d.get(r)??[]).sort((r,o)=>r.length-o.length)[0];return[...new Set(t)].filter(r=>r!==e)},y=new Map,u=e=>{let n=y.get(e);if(n)return n;let t=new Set;y.set(e,t);for(let r of h(e)){t.add(r);for(let o of u(r))t.add(o)}return t.delete(e),t},f=new Map(i.map(e=>[e,0]));for(let e of i)for(let n of u(e))f.set(n,(f.get(n)??0)+1);let m=i.map(e=>({kind:e,madeBy:[...g.get(e)??[]].sort(),needs:[...h(e)].sort(),depth:p.get(e)??null})).sort((e,n)=>(e.depth??Number.MAX_SAFE_INTEGER)-(n.depth??Number.MAX_SAFE_INTEGER)||(f.get(n.kind)??0)-(f.get(e.kind)??0)||e.kind.localeCompare(n.kind)),k=m.filter(e=>e.depth===0).map(e=>e.kind),A=[...new Set(a.filter(e=>(d.get(e.name)??[]).length===0).filter(e=>(c.get(e.name)??[]).length>0).map(e=>e.name))].sort(),M=m.filter(e=>e.depth===null).map(e=>({kind:e.kind,why:e.madeBy.length===0?"no act declares that it creates this kind":`every act that makes it needs ${e.needs.map(n=>`"${n}"`).join(", ")}, which nothing can make first`}));return{order:m,roots:k,doors:A,unreachable:M}}export{B as a};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ye}from"./chunk.SDO3U72B.js";import{$d as po,Ad as lo,Hc as oo,La as eo,N as Qn,Pa as Rt,Qd as uo,Ra as to,_d as co,bb as no,fe as fo,id as ro,je as yo,le as Ue,me as Tt,pd as io,rd as ao,xd as so}from"./chunk.DZZL5IDD.js";import{a as $e,b as H}from"./chunk.AJZBJBMO.js";var Io=$e(w=>{"use strict";var Ht=Symbol.for("react.transitional.element"),ai=Symbol.for("react.portal"),si=Symbol.for("react.fragment"),li=Symbol.for("react.strict_mode"),di=Symbol.for("react.profiler"),ui=Symbol.for("react.consumer"),ci=Symbol.for("react.context"),pi=Symbol.for("react.forward_ref"),fi=Symbol.for("react.suspense"),yi=Symbol.for("react.memo"),Ro=Symbol.for("react.lazy"),mi=Symbol.for("react.activity"),Po=Symbol.iterator;function gi(e){return e===null||typeof e!="object"?null:(e=Po&&e[Po]||e["@@iterator"],typeof e=="function"?e:null)}var To={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mo=Object.assign,Co={};function Se(e,t,n){this.props=e,this.context=t,this.refs=Co,this.updater=n||To}Se.prototype.isReactComponent={};Se.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Se.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Oo(){}Oo.prototype=Se.prototype;function Dt(e,t,n){this.props=e,this.context=t,this.refs=Co,this.updater=n||To}var Nt=Dt.prototype=new Oo;Nt.constructor=Dt;Mo(Nt,Se.prototype);Nt.isPureReactComponent=!0;var Eo=Array.isArray;function _t(){}var I={H:null,A:null,T:null,S:null},Vo=Object.prototype.hasOwnProperty;function Wt(e,t,n){var o=n.ref;return{$$typeof:Ht,type:e,key:t,ref:o!==void 0?o:null,props:n}}function hi(e,t){return Wt(e.type,t,e.props)}function jt(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ht}function Si(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ao=/\/+/g;function Lt(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Si(""+e.key):t.toString(36)}function wi(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(_t,_t):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function he(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Ht:case ai:a=!0;break;case Ro:return a=e._init,he(a(e._payload),t,n,o,r)}}if(a)return r=r(e),a=o===""?"."+Lt(e,0):o,Eo(r)?(n="",a!=null&&(n=a.replace(Ao,"$&/")+"/"),he(r,t,n,"",function(u){return u})):r!=null&&(jt(r)&&(r=hi(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Ao,"$&/")+"/")+a)),t.push(r)),1;a=0;var s=o===""?".":o+":";if(Eo(e))for(var l=0;l<e.length;l++)o=e[l],i=s+Lt(o,l),a+=he(o,t,n,i,r);else if(l=gi(e),typeof l=="function")for(e=l.call(e),l=0;!(o=e.next()).done;)o=o.value,i=s+Lt(o,l++),a+=he(o,t,n,i,r);else if(i==="object"){if(typeof e.then=="function")return he(wi(e),t,n,o,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function ot(e,t,n){if(e==null)return e;var o=[],r=0;return he(e,o,"","",function(i){return t.call(n,i,r++)}),o}function vi(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ko=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},bi={map:ot,forEach:function(e,t,n){ot(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ot(e,function(){t++}),t},toArray:function(e){return ot(e,function(t){return t})||[]},only:function(e){if(!jt(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};w.Activity=mi;w.Children=bi;w.Component=Se;w.Fragment=si;w.Profiler=di;w.PureComponent=Dt;w.StrictMode=li;w.Suspense=fi;w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I;w.__COMPILER_RUNTIME={__proto__:null,c:function(e){return I.H.useMemoCache(e)}};w.cache=function(e){return function(){return e.apply(null,arguments)}};w.cacheSignal=function(){return null};w.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var o=Mo({},e.props),r=e.key;if(t!=null)for(i in t.key!==void 0&&(r=""+t.key),t)!Vo.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(o[i]=t[i]);var i=arguments.length-2;if(i===1)o.children=n;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];o.children=a}return Wt(e.type,r,o)};w.createContext=function(e){return e={$$typeof:ci,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:ui,_context:e},e};w.createElement=function(e,t,n){var o,r={},i=null;if(t!=null)for(o in t.key!==void 0&&(i=""+t.key),t)Vo.call(t,o)&&o!=="key"&&o!=="__self"&&o!=="__source"&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),l=0;l<a;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return Wt(e,i,r)};w.createRef=function(){return{current:null}};w.forwardRef=function(e){return{$$typeof:pi,render:e}};w.isValidElement=jt;w.lazy=function(e){return{$$typeof:Ro,_payload:{_status:-1,_result:e},_init:vi}};w.memo=function(e,t){return{$$typeof:yi,type:e,compare:t===void 0?null:t}};w.startTransition=function(e){var t=I.T,n={};I.T=n;try{var o=e(),r=I.S;r!==null&&r(n,o),typeof o=="object"&&o!==null&&typeof o.then=="function"&&o.then(_t,ko)}catch(i){ko(i)}finally{t!==null&&n.types!==null&&(t.types=n.types),I.T=t}};w.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()};w.use=function(e){return I.H.use(e)};w.useActionState=function(e,t,n){return I.H.useActionState(e,t,n)};w.useCallback=function(e,t){return I.H.useCallback(e,t)};w.useContext=function(e){return I.H.useContext(e)};w.useDebugValue=function(){};w.useDeferredValue=function(e,t){return I.H.useDeferredValue(e,t)};w.useEffect=function(e,t){return I.H.useEffect(e,t)};w.useEffectEvent=function(e){return I.H.useEffectEvent(e)};w.useId=function(){return I.H.useId()};w.useImperativeHandle=function(e,t,n){return I.H.useImperativeHandle(e,t,n)};w.useInsertionEffect=function(e,t){return I.H.useInsertionEffect(e,t)};w.useLayoutEffect=function(e,t){return I.H.useLayoutEffect(e,t)};w.useMemo=function(e,t){return I.H.useMemo(e,t)};w.useOptimistic=function(e,t){return I.H.useOptimistic(e,t)};w.useReducer=function(e,t,n){return I.H.useReducer(e,t,n)};w.useRef=function(e){return I.H.useRef(e)};w.useState=function(e){return I.H.useState(e)};w.useSyncExternalStore=function(e,t,n){return I.H.useSyncExternalStore(e,t,n)};w.useTransition=function(){return I.H.useTransition()};w.version="19.2.8"});var W=$e((rs,Lo)=>{"use strict";Lo.exports=Io()});var qo=$e(at=>{"use strict";var Oi=Symbol.for("react.transitional.element"),Vi=Symbol.for("react.fragment");function Bo(e,t,n){var o=null;if(n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:Oi,type:e,key:o,ref:t!==void 0?t:null,props:n}}at.Fragment=Vi;at.jsx=Bo;at.jsxs=Bo});var He=$e((ys,zo)=>{"use strict";zo.exports=qo()});var me={focusId:null,relation:null,expanded:[],pins:{}},Ze=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function Q(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${Xe(r.x)},${Xe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${Xe(e.pan.x)},${Xe(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function ei(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Je(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[m,y]of n){if(!m.startsWith("pin."))continue;let[g,b]=y.split(","),R=g===void 0?null:Ze(g),f=b===void 0?null:Ze(b);R===null||f===null||(o[m.slice(4)]={x:R,y:f})}let r=Object.create(null);for(let[m,y]of n)!m.startsWith("in.")||y.length===0||(r[m.slice(3)]=y);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],s=a[0]===void 0?null:Ze(a[0]),l=a[1]===void 0?null:Ze(a[1]),u=(n.get("sel")??"").split(",").filter(m=>m.length>0).sort(),c=n.get("overview")==="1";return{...u.length>0?{selection:u}:{},...c?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...s!==null&&l!==null?{pan:{x:s,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:ei(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(m=>m.length>0&&(c||!m.startsWith("kind:"))).sort(),pins:o}}function Ga(e){let t=Je(e);return Q(t)==="#"?{...t,overview:!0}:t}function Fa(e){let t=Q(e);return t==="#overview=1"?"":t}function Xe(e){return Math.round(e*100)/100}function go(e,t){return Q(e)===Q(t)}var mo="edge:";function ho(e){if(!e.startsWith(mo))return null;let t=e.slice(mo.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Mt(e){let{pan:t,...n}=e;return{...n,pins:{}}}function q(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Mt(e);return{...n.within?.q!==void 0?ee(n,"q",null):n,focusId:t}}function So(e,t){return{...e,relation:t}}function ee(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function ue(e,t){if(t!==e.overview&&(e=Mt(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function Qe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function Le(e,t){if(t!==(e.zoom===!0)&&(e=Mt(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function et(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}var nt="aggregate:",tt="kind:";function Ct(e){return`${tt}${e}`}function ge(e){return e.startsWith(tt)?e.slice(tt.length):null}var qa="kinds:beyond";function ti(e){let t=ge(e);return t?[t]:ce(e)}function te(...e){return`${nt}${[...e].sort().join("+")}`}function wo(e){return e.startsWith(nt)}function ce(e){return!wo(e)||e.includes("|")?[]:e.slice(nt.length).split("+").filter(Boolean)}function vo(e,t,n={}){let o=ge(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return et(e,t);let r=o!==null?te(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return Le(e,!1);if(o!==null&&n.carry){let i=ue({...q(e,r),relation:null},!1);return ee(Le(i,!0),"q",n.carry)}return Le({...q(e,r),relation:null},!0)}function ni(e,t,n){return ee(ue(q(e,te(t)),!1),"view",n)}function za(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var bo="aggregate:";function Ot(e){return e.startsWith(bo)&&e.includes("|")}var Vt=e=>e?.off===!0,oi=e=>e!==void 0&&!Vt(e)&&(e.fast!==void 0||e.thinking!==void 0||e.answer!==void 0||e.decide!==void 0||e.complete!==void 0||e.turn!==void 0),xo=e=>e!==void 0&&!Vt(e)&&(e.fast!==void 0||e.decide!==void 0),ri=e=>e?.suggestOnOpen!==!1&&xo(e),ii=e=>e?.hoverChips===!0&&xo(e);var It={};var _o=H(W(),1),xi={turns:[],outcomes:new Map,busy:!1,pending:null,draft:null,draftNote:null},Ho=e=>`graview:seat:${e}`;function Pi(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function Ei(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],draft:t.draft}))}catch{}}function Gt(e){let t=e===null?null:Ho(e),n={...xi,...Pi(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&Ei(t,n);for(let s of[...o])s()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),ask:i=>r({...n,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function Ai(e){return(0,_o.useSyncExternalStore)(e.subscribe,e.get,e.get)}var No=H(W(),1),ki={entries:[],ghost:null,loaded:!1};function Do(e,t){let n=new Map(e.map(o=>[o.id,o]));for(let o of t)n.set(o.id,{...n.get(o.id),...o});return[...n.values()].sort((o,r)=>o.at<r.at?1:o.at>r.at?-1:0)}function Ft(e){let t=ki,n=new Set,o=r=>{t=r;for(let i of[...n])i()};return{get:()=>t,subscribe:r=>(n.add(r),()=>n.delete(r)),record:r=>{o({...t,entries:Do(t.entries,[r])}),Promise.resolve(e()?.keep?.(r)).catch(i=>{console.warn("The host did not keep an AI interaction:",i)})},setGhost:r=>o({...t,ghost:r}),load:()=>{if(t.loaded)return;o({...t,loaded:!0});let r=e()?.load;r&&Promise.resolve(r()).then(i=>o({...t,entries:Do(t.entries,i)})).catch(i=>{console.warn("The host's AI interactions could not be read:",i)})}}}function Ri(e){return(0,No.useSyncExternalStore)(e.subscribe,e.get,e.get)}function Wo(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}var rt=H(W(),1),it=(0,rt.createContext)(void 0),Ti=()=>(0,rt.useContext)(it);var E=H(W(),1),_e=(0,E.createContext)(null);function Go(){return(0,E.useContext)(_e)}function Mi(e,t){let n=Go(),o=(0,E.useMemo)(()=>n?n.live.seenBy(t):e,[n,e,t]),r=(0,E.useRef)(0),i=(0,E.useCallback)(a=>o.subscribe(()=>{r.current+=1,a()}),[o]);return(0,E.useSyncExternalStore)(i,()=>r.current,()=>0),o}var Fo=Ye(()=>(__graviewPreload(import.meta.url,["./chunk.YFVJUHAK.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FC6AF6CC.js")));function Kt(e){let[,t]=(0,E.useReducer)(o=>o+1,0),n=e.publishing?.mode==="on-publish"&&!io();return(0,E.useEffect)(()=>{n&&Fo().then(t,()=>{})},[n]),!n}var jo,Ci=400;function Bt(e,t,n){let o=(0,E.useContext)(_e),r=o!==null&&o.owns(e,t),[i,a]=(0,E.useState)(null),[s,l]=(0,E.useState)(jo);(0,E.useEffect)(()=>{if(s||r||i===null)return;let P=!0;return Fo().then(T=>{jo=T,P&&l(T)},()=>{}),()=>{P=!1}},[s,r,i]);let[u,c]=(0,E.useState)(0),[m,y]=(0,E.useMemo)(()=>r||i===null||!s?[]:[i>=e.log.length?void 0:s.askArchived(e,i,n)??s.askDeclaration(n,i),s.keptOf(e,n)],[r,e,i,n,s,u]),g=m&&"waiting"in m?m.waiting:void 0,b=m&&"seq"in m?m:null,[R,f]=(0,E.useState)(void 0);(0,E.useEffect)(()=>{if(!g)return;let P=!0,T=setTimeout(()=>P&&f(g),Ci);return g.then(()=>P&&c(_=>_+1)),()=>{P=!1,clearTimeout(T)}},[g]);let S=g!==void 0&&R!==g||b!==null,v=(0,E.useMemo)(()=>{if(r||i===null||i>=e.log.length||!s||S)return null;try{let P=s.pastAt(e,i,n);return{seq:i,at:P.past?.at,store:P}}catch{return null}},[r,e,i,n,s,S,u]),A=(0,E.useRef)(null),x=S?A.current:v;(0,E.useEffect)(()=>{A.current=x},[x]);let j=(0,E.useCallback)(P=>a(P===null?null:P>=e.log.length?Number.POSITIVE_INFINITY:P),[e]),G=(0,E.useCallback)((P,T)=>[e,x?.store].some(_=>_!==void 0&&(_===P||_.seenBy(T)===P)),[e,x]),D=i!==null,O=(0,E.useMemo)(()=>({past:x,open:D,show:j,live:e,host:n,owns:G,archive:b,kept:y}),[x,D,j,e,n,G,b,y]);return r?o:O}var Ko=H(W(),1),qt=(0,Ko.createContext)(null);var $o=e=>`graview:setting:${e}`;function Uo(){return localStorage}function Yo(e,t){try{let n=(t??Uo()).getItem($o(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function Zo(e,t,n){try{(n??Uo()).setItem($o(e.name),t)}catch{}}function Xo(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var L=H(W(),1);function zt(e){return Ue(e)}var Ii=12,Li=4;function _i(e,t,n){let o=zt(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var st=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-Ii);function Jo(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=Li)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?Ct([...o][0]):n[0]}function $t(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,s]of e)s.mode!=="asking"&&s.mode!=="docked"&&t.at-s.since>=t.holdMs&&o.set(a,{...s,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=_i(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=Jo(t.ids,n);return i({at:a,mode:"reading",trail:st(r.trail,a)}),o}case"about-to-write":case"write":{let a=Jo(t.ids,n);return i({at:a,mode:"writing",trail:st(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:st(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:st(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var Qo="graview:session";function er(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(Qo);if(o)return o;let r=t();return n.setItem(Qo,r),r}catch{return t()}}var Ut={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},Yt={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},tr=[Ut,Yt],Hi=800;function nr(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:s,settingValues:l,setView:u,ttlMs:c=yo,people:m,seats:y}=e,[g,b]=(0,L.useState)(()=>new Map),[R,f]=(0,L.useState)(null),[S,v]=(0,L.useState)(null),[A,x]=(0,L.useState)(null),j=typeof r.id=="string"&&r.id.length>0,G=j&&(l[Ut.name]??Ut.initial)==="shared",D=G&&(l[Yt.name]??Yt.initial)==="shared",O=zt({kind:r.kind,...r.id?{id:r.id}:{},session:i}),P=j?no(r,{graph:n.graph,schema:n.schema,...y?{seats:y}:{},...m?{people:m}:{}}):"",T=s?a.get(`agent:${s}:${i}`):void 0,_=(0,L.useMemo)(()=>!t||!G?null:{participant:O,kind:r.kind,name:P,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:oo(r.id??"nobody"),stop:A??Q(o),...D?{over:R}:{},...T?{robot:{at:T.at,mode:T.mode}}:{},at:new Date().toISOString()},[t,G,D,O,P,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,A,R,T?.at,T?.mode]),We=(0,L.useRef)(null),Ee=k=>k&&t?.here({...k,caret:We.current??void 0,at:new Date().toISOString()}),je=(0,L.useCallback)(k=>{We.current=k,Ee(_)},[t,_]);(0,L.useEffect)(()=>{if(!_)return;Ee(_);let k=setInterval(()=>Ee(_),Hi);return()=>clearInterval(k)},[t,_]),(0,L.useEffect)(()=>t?t.onWho(K=>b(Tt(new Map,K,Date.now(),c))):void 0,[t,c]);let Ae=g.size>0;(0,L.useEffect)(()=>{if(!Ae)return;let k=setInterval(()=>{b(K=>{let ae=Tt(K,[],Date.now(),c);return ae.size===K.size?K:ae})},Math.max(250,Math.min(1e3,c/4)));return()=>clearInterval(k)},[Ae,c]),(0,L.useEffect)(()=>{if(!t||typeof window>"u")return;let k=()=>t.leave();return window.addEventListener("pagehide",k),()=>window.removeEventListener("pagehide",k)},[t]),(0,L.useEffect)(()=>{if(!D||typeof document>"u")return;let k=null,K=ae=>{let se=Wo(ae.target);se!==k&&(k=se,f(se))};return document.addEventListener("pointermove",K,{passive:!0}),()=>document.removeEventListener("pointermove",K)},[D]);let re=(0,L.useRef)(null),Z=S?g.get(S)??null:null,X=(0,L.useCallback)(k=>{re.current=null,v(k)},[]);(0,L.useEffect)(()=>{if(S){if(!Z){v(null);return}Z.stop!==re.current?.stop&&(re.current={stop:Z.stop,at:Date.now()},u(Je(Z.stop)))}},[S,Z,u]),(0,L.useEffect)(()=>{let k=re.current;!S||k===null||Date.now()-k.at<400||go(o,Je(k.stop))||v(null)},[o,S]),(0,L.useEffect)(()=>{if(!S||typeof document>"u")return;let k=K=>{K.key==="Escape"&&v(null)};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[S]);let ie=_!==null,ke=(0,L.useMemo)(()=>ie?{participant:O,name:P}:null,[ie,O,P]);return(0,L.useMemo)(()=>({who:g,sharing:ke,following:Z,follow:X,sayWhere:x,sayCaret:je}),[g,ke,Z,X,je])}var U=H(W(),1);function or(e){return Ue(e.author)}function Di(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function rr(e,t,n,o,r){let i=new Map;for(let[l,u]of e)o-u.at<r&&i.set(l,u);let a=new Set(n.flatMap(l=>l.nodeIds)),s=(l,u,c)=>{let m=i.get(l),y=m?.participants.includes(or(u))?m.participants:[...m?.participants??[],or(u)];i.set(l,{at:o,manner:Di(y,u.author.kind),intent:u.intent,wrote:(m?.wrote??!1)||(c.wrote??!1),read:(m?.read??!1)||(c.read??!1),broke:(m?.broke??!1)||a.has(l),participants:y})};for(let l of t){for(let u of l.writes)s(u,l,{wrote:!0});for(let u of l.reads)l.writes.includes(u)||s(u,l,{read:!0})}for(let l of n)for(let u of l.nodeIds){let c=i.get(u);i.set(u,{at:o,manner:c?.manner??"rule",intent:c?.intent??l.message,wrote:c?.wrote??!1,read:c?.read??!1,broke:!0,participants:c?.participants??["rule::"]})}return i}var Ni=2600;function ir(e,t=Ni){let[n,o]=(0,U.useState)(()=>new Map),r=(0,U.useRef)(n);r.current=n;let i=(0,U.useRef)(null),a=(0,U.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,U.useEffect)(()=>{let l=e.violations(),u=e.subscribe((c,m)=>{let y=e.violations(),g=lo(e.allInvariants(),l,y).introduces;l=y,a(rr(r.current,m,g.map(b=>({nodeIds:b.nodeIds,message:b.message})),Date.now(),t))});return()=>{u(),i.current&&clearTimeout(i.current)}},[e,t,a]);let s=(0,U.useCallback)(l=>{l.reads.length!==0&&a(rr(r.current,[Wi(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:s}}function Wi(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var d=H(W(),1);function ar(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}var lt=H(W(),1),ji=e=>e.definitions.some(t=>eo(t).size>0);function sr(e,t,n){let[o,r]=(0,lt.useState)(void 0),i=(n.roles??[]).join("\0"),a=n.onBehalfOf?JSON.stringify(n.onBehalfOf):"";return(0,lt.useEffect)(()=>{if(!t||!ji(e.schema)){r(void 0);return}let s=!0,l=!1,u=e.graph,c=()=>{l||(l=!0,queueMicrotask(()=>{l=!1,s&&e.reread()}))},m=to(t,{kind:n.kind,...n.id===void 0?{}:{id:n.id},...n.roles?{roles:n.roles}:{},...n.onBehalfOf?{onBehalfOf:n.onBehalfOf}:{}},c);return Rt(u,m.read),r(m),e.reread(),()=>{s=!1,Rt(u,void 0)}},[e,t,n.kind,n.id,i,a]),o}function lr(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var ne=H(He(),1),Gi="graview:place-menu",De=(0,d.createContext)(null),pr=(0,d.createContext)("scene");function Fi({mode:e,children:t}){return(0,ne.jsx)(pr.Provider,{value:e,children:t})}function Ki(){return(0,d.useContext)(pr)}var fr={kind:"human"},Bi=[],qi=[],zi=[],Zt=[];function yr(e,t){let n=(0,d.useId)();(0,d.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??fr,r=()=>so(e,o,n);r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}var $i=()=>{try{return typeof location<"u"&&new URLSearchParams(location.search).get("as")==="published"?"published":void 0}catch{return}},Ui={off:!0};function Yi({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,as:a,seats:s=Bi,onSeat:l,people:u=qi,memory:c,presenceTtlMs:m,app:y,settings:g=y?.settings??zi,presence:b,typing:R,brand:f,locale:S,timeZone:v,onKeepLens:A,onProposeChange:x,providers:j,ai:G,files:D,resolveApp:O,history:P,linkedRecords:T,menuSections:_,keptViews:We,onExport:Ee,subscriptions:je,dismissals:Ae,whileAway:re,signIn:Z,view:X,onViewChange:ie,children:ke}){let k=(0,d.useContext)(De),K=_??k?.menuSections,ae=Z??k?.signIn,se=We??k?.keptViews,wt=Ee??k?.onExport,[jr,Gr]=(0,d.useState)(null),fe=jr??i??s[0]?.principal??fr,Ge=Bt(e,fe,P),mn=Ge.past&&Ge.live===e?Ge.past.store:e,vt=a??$i(),bt=!Kt(e),N=(0,d.useMemo)(()=>bt?e:mn.seenBy(fe,vt?{as:vt}:void 0),[bt,e,mn,fe,vt]);yr(e,fe);let[le]=(0,d.useState)(()=>er(c)),[gn,Fr]=(0,d.useState)(!1),hn=(0,d.useCallback)(()=>Fr(!0),[]),de=(0,d.useMemo)(()=>b?[...g,...tr]:g,[g,b]),[xt]=(0,d.useState)(()=>n??en(t,e.schema)),[Kr,Sn]=(0,d.useState)(()=>Qe(xt??me,r??xt?.selection??[])),Re=(0,d.useRef)(xt??me).current,[wn,Br]=(0,d.useState)(null),[vn,qr]=(0,d.useState)(null),z=(0,d.useContext)(De),[bn]=(0,d.useState)(()=>z?.seatTalk??Gt(f?.name??e.schema.kinds.join(","))),Pt=G??z?.ai??It,Fe=(0,d.useMemo)(()=>Pt.off?Ui:Pt,[Pt]),xn=(0,d.useRef)(Fe.interactions);xn.current=Fe.interactions;let[Pn]=(0,d.useState)(()=>z?.aiDesk??Ft(()=>xn.current)),[zr]=(0,d.useState)(()=>z?.subscriptions??ao()),En=je??z?.subscriptions??zr,Et=A??z?.onKeepLens,An=x??z?.onProposeChange,Ke=y??z?.app,Be=S??z?.locale,$r=f?.locale??Ke?.brand?.locale,qe=v??z?.timeZone;Qn({reader:Be,app:$r,readerTimeZone:qe,appTimeZone:f?.timeZone??Ke?.brand?.timeZone});let kn=(0,d.useRef)(null),Rn=(0,d.useCallback)(p=>{kn.current=p},[]),Tn=(0,d.useCallback)(p=>kn.current?.whereIs(p)??null,[]),[Mn]=(0,d.useState)(()=>ar()),[Cn]=(0,d.useState)(()=>lr()),[At,Ur]=(0,d.useState)(null),[Te,On]=(0,d.useState)(()=>new Map),Me=(0,d.useRef)(Te);Me.current=Te;let Ce=(0,d.useRef)(null),kt=(0,d.useCallback)(p=>N.graph.getNode(p)?.kind,[N]),J=(0,d.useCallback)(p=>{let h=$t(Me.current,p,kt);Me.current=h,On(h),Ce.current&&clearTimeout(Ce.current),[...h.values()].some(V=>V.mode!=="docked"&&V.mode!=="asking")&&(Ce.current=setTimeout(()=>{let V=$t(Me.current,{type:"rest",at:Date.now(),holdMs:Qt},kt);Me.current=V,On(V)},Qt+20))},[kt]),Vn=(0,d.useCallback)(p=>J({...p,at:p.at??Date.now()}),[J]),In=(0,d.useCallback)(p=>{Ur(p),p&&J({type:"home",author:{kind:"agent",id:p,session:le},at:Date.now()})},[J,le]);(0,d.useEffect)(()=>N.subscribe((p,h)=>{for(let M of h)M.author.kind==="agent"&&J({type:"write",author:M.author,ids:M.writes,at:Date.now()})}),[N,J]),(0,d.useEffect)(()=>()=>{Ce.current&&clearTimeout(Ce.current)},[]);let $=(0,d.useMemo)(()=>({...fe,session:le}),[fe,le]),Ln=sr(N,T,$),_n=(0,d.useCallback)(p=>{Gr(p),l?.(p)},[l]),[Oe,Yr]=(0,d.useState)(()=>Object.fromEntries(de.map(p=>[p.name,Yo(p,c)])));(0,d.useEffect)(()=>{for(let p of de)Xo(p,Oe[p.name]??p.initial)},[de,Oe]);let Hn=(0,d.useCallback)((p,h)=>{let M=de.find(V=>V.name===p);!M||!M.options.some(V=>V.value===h)||(Zo(M,h,c),Yr(V=>({...V,[p]:h})))},[de,c]),[Dn,Zr]=(0,d.useState)(null),{activity:Nn,noteAttention:Wn}=ir(N),jn=(0,d.useCallback)(p=>{Wn(p),J({type:"read",author:p.author,ids:p.reads,at:Date.now()})},[Wn,J]),ye=(0,d.useCallback)(p=>{if(ge(p)!==null||ce(p).length>0||Ot(p))return!0;let h=ho(p);return h?N.graph.allEdges().some(M=>M.kind===h.kind&&M.from===h.from&&M.to===h.to):N.graph.getNode(p)!==void 0},[N]),Gn=(0,d.useCallback)(p=>{let h=p.selection??Zt,M=h.filter(ye),V=M.length===h.length?p:Qe(p,M);return V.focusId!==null&&!ye(V.focusId)&&(V=q(V,null)),V},[ye]),Ve=(0,d.useCallback)(p=>{let h=Gn(p),M=cr(N,$,h.shown);if(h.focusId!==null&&M.size>0){let V=ce(h.focusId),Jn=N.graph.getNode(h.focusId);(V.length>0?V.every(Qr=>M.has(Qr)):Jn?M.has(Jn.kind):!1)&&(h={...h,focusId:null})}if(!h.overview&&h.focusId===null){let V=Re.focusId!==null&&!ye(Re.focusId)?en(t,e.schema)??{...me,overview:!0}:Re;V.focusId!==null&&ye(V.focusId)?h={...h,focusId:V.focusId}:V.overview===!0&&(h={...h,overview:!0})}return h},[Gn,ye,N,Re,$,t,e.schema]),B=Ve(X??Kr),Fn=(0,d.useMemo)(()=>cr(N,$,B.shown),[N,$,B.shown]),Kn=(0,d.useMemo)(()=>[...N.modules.administered.entries()].map(([p,h])=>{let M=N.mayAdminister(p,$);return{name:p,...h.description?{description:h.description}:{},kinds:h.kinds??[],canShow:M,shown:M&&(B.shown??[]).includes(p)}}),[N,$,B.shown]),Ie=(0,d.useCallback)(p=>{let h=M=>Ve(typeof p=="function"?p(M):p);if(X!==void 0){ie?.(h(X));return}ie&&ie(h(B)),Sn(M=>h(M))},[B,ie,X,Ve]);(0,d.useEffect)(()=>{X===void 0&&Sn(p=>{let h=Ve(p);return h===p?p:h})},[B,X,Ve]);let Bn=B.selection??Zt,qn=(0,d.useCallback)(p=>{Ie(h=>Qe(h,typeof p=="function"?p(h.selection??Zt):p))},[Ie]),{who:ze,following:zn,follow:$n,sayWhere:Xr,sayCaret:Un,sharing:Yn}=nr({channel:b,store:N,view:B,principal:$,session:le,robots:Te,seatWho:At,settingValues:Oe,setView:Ie,seats:s,people:u,...m!==void 0?{ttlMs:m}:{}}),Jr=(0,d.useMemo)(()=>({store:N,scheme:o,views:t,view:B,setView:Ie,homeView:Re,selection:Bn,setSelection:qn,menuAt:wn,setMenuAt:Br,whereIs:Tn,pointer:Mn,motion:Cn,registerScene:Rn,robots:Te,noteSeat:Vn,seatWho:At,registerSeatWho:In,actsDoor:vn,registerActsDoor:qr,seatTalk:bn,aiDesk:Pn,...c?{memory:c}:{},who:ze,following:zn,follow:$n,sayWhere:Xr,sharing:Yn,session:le,ai:Fe,resolveApp:O,linkedRecords:T,menuSections:K,...se?{keptViews:se}:{},...wt?{onExport:wt}:{},subscriptions:En,dismissals:Ae,whileAway:re,signIn:ae,linkedReads:Ln,movedByHand:gn,noteMoved:hn,emphasis:Dn,setEmphasis:Zr,activity:Nn,noteAttention:jn,principal:$,seats:s,people:u,takeSeat:_n,settings:de,settingValues:Oe,chooseSetting:Hn,hiddenKinds:Fn,administered:Kn,...j?{providers:j}:{},...f?{brand:f}:{},...Et?{onKeepLens:Et}:{},...An?{onProposeChange:An}:{},app:Ke,...Be?{locale:Be}:{},...qe?{timeZone:qe}:{}}),[N,o,t,B,Ie,Bn,qn,wn,Tn,Mn,Cn,Rn,Te,Vn,At,In,vn,bn,Pn,c,ze,zn,$n,Yn,le,Fe,O,T,K,se,wt,En,Ae,re,ae,Ln,gn,hn,Dn,Nn,jn,$,s,u,_n,de,Oe,Hn,Fn,Kn,j,f,Et,Ke,Be,qe]),Zn=(0,d.useMemo)(()=>R?{typing:R,sayCaret:Un,who:ze}:null,[R,Un,ze]),Xn=D?(0,ne.jsx)(it.Provider,{value:D,children:ke}):ke;return(0,ne.jsx)(De.Provider,{value:Jr,children:(0,ne.jsx)(_e.Provider,{value:Ge,children:(0,ne.jsx)(ea,{children:bt?null:Zn?(0,ne.jsx)(qt.Provider,{value:Zn,children:Xn}):Xn})})})}var mr=(0,d.createContext)(null),Xt,Jt=new Set,Zi=e=>(Jt.add(e),()=>void Jt.delete(e)),dr=()=>Xt;function Xi(e){if(!Xt){Xt=e;for(let t of[...Jt])t()}}var Ji=300;function Qi(e){let t=0;return async(n,o)=>{let r=++t;return await new Promise(i=>setTimeout(i,Ji)),r===t?e(n,o):[]}}function ea({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a,ai:s}=oe(),l=dt(),u=n.q,c=n.focusId,m=!!(u&&u.trim().length>0),y=(0,d.useSyncExternalStore)(Zi,dr,dr),g=(0,d.useMemo)(()=>m&&y?{flagged:new Set(t.violations().flatMap(A=>A.nodeIds)),touched:y.touchWeights(t.log.all())}:null,[t,l,m,y]),b=c?t.graph.getNode(c)?.kind??ge(c)??(ce(c).length===1?ce(c)[0]:void 0):void 0,R=(0,d.useMemo)(()=>s.near&&Qi(s.near),[s.near]),f=(0,d.useMemo)(()=>!u||!g||!y?null:y.search(t,u,{...b?{inKind:b}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(A=>!i.has(A)),from:[...a,...c&&t.graph.has(c)?[c]:[]],flagged:g.flagged,touched:g.touched,limit:200,rank:R}),[t,u,r,o,i,a,c,b,g,R]),[S,v]=(0,d.useState)();return(0,d.useEffect)(()=>void f?.later?.then(A=>v([f,A])),[f]),(0,ne.jsx)(mr.Provider,{value:S?.[0]===f?S[1]:f,children:e})}var ur=new WeakMap;function qs(e){let t=ur.get(e);return t||ur.set(e,t=new Set(e.matched)),t}function ta(){return(0,d.useContext)(mr)}function oe(){let e=(0,d.useContext)(De);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function tn(){return(0,d.useContext)(De)??null}function dt(){let{store:e}=oe(),t=(0,d.useRef)(null),n=(0,d.useRef)(null),o=(0,d.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,d.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,d.useSyncExternalStore)(r,o,o)}function na(e){let{store:t}=oe(),n=(0,d.useCallback)(r=>t.subscribe(r),[t]),o=(0,d.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,d.useSyncExternalStore)(n,o,o)}function cr(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var Qt=2600;var gr=new WeakSet,oa=e=>gr.has(e),ra=e=>void gr.add(e);function en(e,t){let n=fo(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...me,focusId:te(n.place.kind),within:{view:n.place.as}}:{...me,focusId:te(n.kind)}}var pe=H(W(),1);var nn=H(W(),1),ia=(0,nn.createContext)(null),on=(0,nn.createContext)(null);var hr=(0,pe.createContext)(null);function aa(){let e=(0,pe.useContext)(hr),t=tn(),n=(0,pe.useContext)(on),o=(i,a,s)=>t?.setView(l=>ee(ee(ue(q(l,te(i)),!1),"view",a),"filter",s?.filter??null)),r=()=>t?.setView(i=>ee(ue(i,!0),"view",null));return(0,pe.useMemo)(()=>e??{record:i=>{t&&(t.setView(a=>q(ue(a,!1),i)),t.setSelection([i]))},place:(i,a)=>{if(i===po)return r();if(i===co)return n?n.open("/"):r();let s=t?.views.places().find(l=>l.as===i);s&&o(s.kind,s.as,a)},list:(i,a)=>o(i,null,a)},[e,t,n])}var Sr=H(W(),1),sa=(0,Sr.createContext)(!1);var ut=Symbol.for("graview.default-view");function wr(e){return Object.defineProperty(e,ut,{value:!0,enumerable:!1}),e}function vr(e){return typeof e=="function"&&e[ut]===!0}var ct=Symbol.for("graview.replaces-page");function br(e){return Object.defineProperty(e,ct,{value:!0,enumerable:!1}),e}function xr(e){return typeof e=="function"&&e[ct]===!0}var pt=Symbol.for("graview.bleeds");function Pr(e){return Object.defineProperty(e,pt,{value:!0,enumerable:!1}),e}function Er(e){return typeof e=="function"&&e[pt]===!0}var ft=Symbol.for("graview.previews");function Ar(e,t={}){return Object.defineProperty(e,ft,{value:t,enumerable:!1}),e}function kr(e){return typeof e=="function"?e[ft]:void 0}function la(e){return uo(e)}function da(e,t){if(t===e)return e;for(let r of t.registrations())e.register(r.kind,r,r.view,r);let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homes?.()??[];if(o.length>0)for(let r of o)e.home?.(r.view,r.name!==void 0?{name:r.name}:void 0);else{let r=t.homeView?.();r&&e.home?.(r)}return e}var C=H(W(),1),Y=H(He(),1),rn=new Set,yt=0;function an(e){return()=>{yt+=1;let t=e();return t.then(()=>void(yt-=1),()=>void(yt-=1)),t}}var ua=()=>yt,gt=(0,C.createContext)(null);function ca(){return{waiting:new Map,at:0}}function pa(e){for(let[t,n]of e.waiting)n<e.at&&e.waiting.delete(t);e.at+=1}var fa=e=>e?.waiting.size??0;function Mr(e,t){e?.waiting.set(t,e.at)}function Cr(e){let t=(0,C.useContext)(gt);(0,C.useLayoutEffect)(()=>{t?.waiting.delete(e)},[t,e])}function ya(e){let t={},n=!1,o=new Set,r=(0,C.lazy)(an(()=>e().then(a=>{n=!0;let s=a.default;function l(u){return Cr(t),(0,C.createElement)(s,u)}return{default:l}},a=>{for(let s of o)s.waiting.delete(t);throw a})));function i(a){let s=(0,C.useContext)(gt);return!n&&s&&(o.add(s),Mr(s,t)),(0,C.createElement)(r,a)}return i}var Or=!1,Vr=!1,mt=new Set;function ma(){Or=!0}function ga(){Vr=!0;for(let e of[...mt])e();mt.clear()}var Ir=()=>Vr||!Or;function ha(e){return Ir()?(e(),()=>{}):(mt.add(e),()=>void mt.delete(e))}var Rr=!1;function sn(){for(let e of[...rn])e()}function Sa(){Rr||typeof window>"u"||(Rr=!0,window.addEventListener("online",sn))}function ln(e){let t,n=!1,o=!1,r,i=0,a=new Set,s=()=>{i+=1;for(let y of[...a])y()},l=y=>(a.add(y),()=>void a.delete(y)),u=()=>i,c=()=>void m().catch(()=>{});function m(){if(n)return Promise.resolve(t);if(r)return r;let y=e().then(g=>(t=g,n=!0,o=!1,r=void 0,rn.delete(c),s(),g),g=>{throw r=void 0,o=!0,rn.add(c),Sa(),s(),g});return y.catch(()=>{}),r=y,y}return{load:m,prefetch:c,get current(){return t},get failed(){return o},part(y,g={}){let b=g.what??"This part",R={};function f(A){(0,C.useSyncExternalStore)(l,u,u),Cr(R);let x=(0,C.useRef)(null),j=(0,C.useRef)(null),G=(0,C.useRef)(!1);return(0,C.useEffect)(()=>{o&&r===void 0&&c()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(G.current=!0),(0,C.useLayoutEffect)(()=>{if(!(!n||!G.current)){G.current=!1;for(let D=j.current?.nextElementSibling??null;D!==null;D=D.nextElementSibling){let O=D.matches(Tr)?D:D.querySelector(Tr);if(O instanceof HTMLElement){O.focus();return}}}}),n?(0,Y.jsxs)(Y.Fragment,{children:[G.current?(0,Y.jsx)("span",{ref:j,hidden:!0}):null,y(t,A)]}):g.quiet?null:(0,Y.jsx)(wa,{what:b,button:x,...g.as?{as:g.as}:{}})}let S=(0,C.lazy)(an(()=>m().then(()=>({default:f}),()=>({default:f}))));function v(A){let x=(0,C.useContext)(gt),[j]=(0,C.useState)(()=>n||o);return!n&&!o&&Mr(x,R),(0,C.createElement)(j?f:S,A)}return v}}}var Tr="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function wa({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,Y.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,Y.jsx)("span",{role:"status",children:r})," ",(0,Y.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:sn,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var ve=H(W(),1);function va(){let{selection:e,setSelection:t}=oe();return(0,ve.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function ba(){let{store:e}=oe(),t=dt();return(0,ve.useMemo)(()=>xa(e),[e,t])}var Lr=new WeakMap;function xa(e){let t=Lr.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),Lr.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Pa(){let{view:e,setView:t}=oe();return(0,ve.useMemo)(()=>({view:e,url:Q(e),focus:n=>t(o=>q(o,n)),show:n=>t(o=>So(o,n)),toggle:n=>t(o=>et(o,n)),go:n=>t(n)}),[e,t])}var we={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;we.at=typeof t?.graview=="number"?t.graview:0,we.at>we.depth&&(we.depth=we.at),we.tell()});var F=H(W(),1),un={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},suggested:{trigger:"suggested-button",pane:"suggested",opens:"press",focus:"into",drawn:["shell","embed","pages"]},"host-actions":{trigger:"host-bar-actions-open",pane:"host-bar-actions",opens:"press",focus:"into",drawn:["shell","embed"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed","pages"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Ea={position:"fixed",inset:"auto",margin:0,zIndex:ro("popover"),boxSizing:"border-box"},ht=6,be=8,Aa=e=>typeof e.showPopover=="function";function St(e){try{return e.matches(":popover-open")}catch{return!1}}function ka(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function cn(e,t,n={}){let o=ka(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),s=r.height-o.bottom-ht-be,l=o.top-ht-be,u=a.height<=s||s>=l,c=Math.max(96,Math.floor(u?s:l)),m=Math.min(a.height,c);a.height>c&&(e.style.maxHeight=i?`min(${i}, ${c}px)`:`${c}px`);let y=a.width,g=n.align==="start"?o.left:o.right-y,b=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();b&&y<=b.right-b.left&&(g<b.left?g=o.left+y<=b.right?o.left:b.left:g+y>b.right&&(g=o.right-y>=b.left?o.right-y:b.right-y));let R=y>=r.width-2*be?Math.max(0,(r.width-y)/2):Math.max(be,Math.min(g,r.width-be-y)),f=u?o.bottom+ht:Math.max(be,o.top-ht-m);e.style.left=`${Math.round(R)}px`,e.style.top=`${Math.round(f)}px`}function _r(e,t,n,o={}){let r=o.align??"end";(0,F.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Aa(i)&&!St(i))try{i.showPopover(),Ta()}catch{}let a=0,s=u=>{u?.target instanceof Node&&i.contains(u.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>cn(i,n,{align:r})))};cn(i,n,{align:r}),addEventListener("resize",s),addEventListener("scroll",s,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>s());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",s),removeEventListener("scroll",s,!0),l?.disconnect(),i.isConnected&&St(i))try{i.hidePopover()}catch{}}},[t,e,r])}var pn=new Set;function Ra(e){return pn.add(e),()=>pn.delete(e)}function Ta(){for(let e of pn)if(!(!e.isConnected||!St(e)))try{e.hidePopover(),e.showPopover()}catch{}}var xe=null,Ma='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function Ca(e){for(let t of e.querySelectorAll(Ma))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var dn=()=>{let e=document.activeElement;return e===null||e===document.body};function Oa(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,s]=(0,F.useState)(!1),l=t.open??a,u=(0,F.useRef)(null),c=(0,F.useRef)(null),m=(0,F.useCallback)(v=>{u.current=v},[]),y=(0,F.useCallback)(v=>{c.current=v},[]),g=`graview-popover-${(0,F.useId)().replace(/:/g,"")}`,b=(0,F.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});b.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let R=(0,F.useCallback)(v=>{b.current.controlled||s(v),b.current.onOpenChange?.(v)},[]),f=(0,F.useCallback)(()=>{(document.querySelector(`[aria-controls="${g}"]`)??u.current??b.current.returnTo?.()??null)?.focus({preventScroll:!0})},[g]),S=(0,F.useCallback)(v=>{let A=c.current,x=typeof document>"u"?null:document.activeElement,j=x===null||x===document.body||A!==null&&A.contains(x);R(!1),!(!v||!j)&&(f(),requestAnimationFrame(()=>{dn()&&f()}))},[R,f]);return _r(c,i&&l,n??u,t.align?{align:t.align}:{}),(0,F.useEffect)(()=>{if(!i||!l)return;let v={name:e,close:()=>S(!1)};if(xe&&xe.close!==v.close&&xe.close(),xe=v,un[e].focus==="into"){let O=c.current;O&&!O.contains(document.activeElement)&&Ca(O).focus({preventScroll:!0})}let A=O=>{O.key==="Escape"&&S(!0)},x=O=>{let P=O.target;if(!(P instanceof Node))return;let T=c.current;if(T?.contains(P)||u.current?.contains(P))return;let _=P instanceof Element?P.closest('[role="dialog"], [role="alertdialog"]'):null;_&&!(T&&_.contains(T))||(S(!1),un[e].focus==="into"&&requestAnimationFrame(()=>{(dn()||T!==null&&T.contains(document.activeElement))&&f()}))},j=null,G=null,D=O=>{let P=O.target;if(!(P instanceof Element))return;let T=c.current,_=P.closest('[role="dialog"], [role="alertdialog"]');!_||T&&(T.contains(_)||_.contains(T))||(j=_,S(!1))};return document.addEventListener("keydown",A),document.addEventListener("pointerdown",x,!0),document.addEventListener("focusin",D),()=>{document.removeEventListener("keydown",A),document.removeEventListener("pointerdown",x,!0),document.removeEventListener("focusin",D);let O=j;O&&typeof MutationObserver<"u"&&(G?.disconnect(),G=new MutationObserver(()=>{O.isConnected||(G?.disconnect(),requestAnimationFrame(()=>{(dn()||document.activeElement.closest("[hidden]")!==null)&&f()}))}),G.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>G?.disconnect(),10*6e4)),xe?.close===v.close&&(xe=null)}},[i,l,e,S,f]),{open:l,setOpen:v=>v?R(!0):S(!0),toggle:()=>l?S(!0):R(!0),trigger:{ref:m,"aria-expanded":l,"aria-controls":g,"data-graview-popover-trigger":e},pane:{ref:y,id:g,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var Pe=H(W(),1);var Va=ln(Ye(()=>(__graviewPreload(import.meta.url,["./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.JT3MFPRD.js"))));function Ia(e,t,n){let o,r=!1,i=()=>{let{hidden:s,removed:l}=t.current();o||r||s.length+l.length===0||(o=()=>{},Va.load().then(u=>{r||(o=u.watchTidied(e,t,n))},String))};i();let a=t.onChange?.(i);return()=>{r=!0,a?.(),o?.()}}function La(e,t){let[n,o]=(0,Pe.useState)();return(0,Pe.useEffect)(()=>t?Ia(e,t,r=>o([e,r])):void 0,[e,t]),n?.[0]===e?n[1]:e}var Hr=H(W(),1),_a=(0,Hr.createContext)(!1);var Dr=H(W(),1),Ha=(0,Dr.createContext)(null);var Nr=H(W(),1),fn='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',yn=e=>e instanceof HTMLElement&&(e.matches(fn)||e.hasAttribute("tabindex")),Ne=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function Da(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let s=e.querySelector(a);return s&&yn(s)&&Ne(s)?s:null}var Na=e=>e.isConnected&&yn(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&Ne(e);function Wr(e,t){let n=t?Da(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&Ne(o))return o;for(let r of e.querySelectorAll(fn))if(Ne(r))return r;return yn(e)&&Ne(e)?e:null}function Wa(e){(0,Nr.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=f=>{let S=f.target;if(S instanceof Element){n=[];for(let v=S;v&&v!==t.parentElement;v=v.parentElement)n.push(v)}},r=!1,i=!1,a=t.ownerDocument,s=()=>!i&&a.defaultView!==null,l=(f,S)=>void setTimeout(()=>s()&&S(),f),u=f=>void requestAnimationFrame(()=>s()&&f()),c=f=>{if(r=!1,i)return;let S=a.activeElement;if(!(!(S===null||S===a.body||S===a.documentElement)||n.length===0)){if(Na(n[0])){f&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let A of n.slice(1)){if(!A.isConnected)continue;let x=Wr(A,n[0]);if(x){x.focus({preventScroll:!0}),n=[];return}}}},m=(f,S=Date.now()+2500)=>{l(100,()=>{c(f);let v=a.activeElement;(v===null||v===a.body||v===a.documentElement)&&n.length>0&&Date.now()<S&&m(f,S)})},y=()=>{r||n.length===0||(r=!0,l(60,()=>u(()=>{c(!1),m(!1)})))},g=f=>{if(!(f instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(f.key))){if(!(f instanceof KeyboardEvent)){let S=f.target instanceof Element?f.target.closest(fn):null,v=a.activeElement,A=v===null||v===a.body||v===a.documentElement;if(S&&A&&t.contains(S)){n=[];for(let x=S;x&&x!==t.parentElement;x=x.parentElement)n.push(x);l(150,()=>u(()=>{c(!1),m(!1)}));return}}!(f instanceof KeyboardEvent)&&!(f.target instanceof Node&&n[0]?.contains(f.target))||l(150,()=>u(()=>{c(!0),m(!0)}))}},b=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&y()}),R=f=>{f.relatedTarget===null&&y()};return t.addEventListener("focusin",o),t.addEventListener("focusout",R),t.addEventListener("click",g),t.addEventListener("keydown",g),b.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",R),t.removeEventListener("click",g),t.removeEventListener("keydown",g),b.disconnect()}},[e])}export{me as a,Q as b,Je as c,Ga as d,Fa as e,go as f,mo as g,ho as h,Mt as i,q as j,So as k,ee as l,ue as m,Qe as n,Le as o,et as p,nt as q,Ct as r,ge as s,qa as t,ti as u,te as v,wo as w,ce as x,vo as y,ni as z,za as A,bo as B,Ot as C,oi as D,ri as E,ii as F,W as G,Gt as H,Ai as I,Ri as J,Wo as K,it as L,Ti as M,_e as N,Go as O,Mi as P,Kt as Q,Bt as R,qt as S,He as T,Gi as U,De as V,Fi as W,Ki as X,yr as Y,Yi as Z,Xi as _,qs as $,ta as aa,oe as ba,tn as ca,dt as da,na as ea,oa as fa,ra as ga,en as ha,ia,on as ja,hr as ka,aa as la,sa as ma,wr as na,vr as oa,br as pa,xr as qa,Pr as ra,Er as sa,Ar as ta,kr as ua,la as va,da as wa,an as xa,ua as ya,gt as za,ca as Aa,pa as Ba,fa as Ca,ya as Da,ma as Ea,ga as Fa,Ir as Ga,ha as Ha,ln as Ia,La as Ja,_a as Ka,Ha as La,va as Ma,ba as Na,Pa as Oa,we as Pa,Wa as Qa,Ea as Ra,St as Sa,_r as Ta,Ra as Ua,Oa as Va};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
react/cjs/react.production.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license React
|
|
7
|
+
* react.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license React
|
|
18
|
+
* react-jsx-runtime.production.js
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the MIT license found in the
|
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as h}from"./chunk.
|
|
1
|
+
import{a as y,b as h}from"./chunk.MDEX6ZVE.js";import"./chunk.RPDH32XV.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import{qd as b}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as m}from"./chunk.
|
|
1
|
+
import{c as m}from"./chunk.OWT3VVOT.js";import{ga as c,ja as u,ka as p,ma as f,qa as h,ra as l}from"./chunk.DZZL5IDD.js";function M(t,e){let n=t.schema.kinds,r="kind"in e?e.kind:void 0;if(r!==void 0&&!n.includes(r))return`There is no kind "${r}" in this app. Its kinds are: ${n.join(", ")}.`;if(e.on==="act"&&e.act!==void 0&&t.allMutations&&!t.allMutations().some(i=>i.name===e.act))return`There is no act "${e.act}" in this app.`;let o="record"in e?e.record:void 0;if(o!==void 0&&t.graph&&!t.graph.getNode(o))return`No record "${o}" is here to be told about.`;if(o!==void 0&&r!==void 0&&t.graph&&t.graph.getNode(o)?.kind!==r)return`\u201C${o}\u201D is not ${h(r)}.`;if(e.on==="changed"&&e.kind===void 0&&e.record===void 0)return"Say which kind, or which record, to be told about.";if(e.on==="reaches"){if(e.condition.trim()==="")return"Say what it should reach: a condition like done == true.";try{m(e.condition)}catch(i){return`The condition does not read: ${i instanceof Error?i.message:String(i)}.`}}}function d(t,e){let n=t.graph?.getNode(e);return n?u(t.schema.tryDefinition(n.kind),n):e}function g(t,e){let n=t.allMutations?.().find(r=>r.name===e);return n?p(n):c(e)}function v(t,e){let{when:n}=e,r=e.alsoMine?"anyone":"someone else",o=s=>l(t.schema.tryDefinition(s),s),i=s=>{let a=o(s);return`${/^[aeiou]/i.test(a)?"an":"a"} ${a}`};switch(n.on){case"act":{let s=n.act!==void 0?`\u201C${g(t,n.act)}\u201D`:"an act";return`When ${r} runs ${s}${n.record!==void 0?` on \u201C${d(t,n.record)}\u201D`:""}`}case"created":return`When ${r} adds ${i(n.kind)}`;case"changed":return n.record!==void 0?`When ${r} changes \u201C${d(t,n.record)}\u201D`:`When ${r} changes any of the ${f(t.schema,n.kind)}`;case"reaches":return`When ${n.record!==void 0?`\u201C${d(t,n.record)}\u201D`:i(n.kind)} reaches ${n.condition}${e.alsoMine?"":" (by someone else)"}`}}export{M as a,v as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk.ROZTJ6IY.js";import"./chunk.BIDL7GQD.js";import"./chunk.G4JJXA63.js";import"./chunk.M4AYA2PL.js";import"./chunk.H5S7OL2U.js";import"./chunk.T6WHGKWR.js";import"./chunk.XOZU4OFA.js";import"./chunk.Y2YYH3JN.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.CGALLZ54.js";import"./chunk.WKI5INH7.js";import"./chunk.NOGGSLVG.js";import"./chunk.WVUJXDXZ.js";import"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as draftAnswer,h as draftFromLens,b as draftSight,l as draftView,a as isDraftFailure,c as judgeLens,d as lensEditOf,f as lensFromSpec,j as recipeDraft,g as recipeOfLens,m as refineDraft,o as runDraftTool,e as takeBackEditOf,k as templateDraft,n as withReaderLenses};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as te}from"./chunk.
|
|
1
|
+
import{b as te}from"./chunk.22BZU7ME.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import{c as ne}from"./chunk.ACTXR2MI.js";import{G as ge,T as ee}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{gd as q,ja as X,la as Z}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as T}from"./chunk.AJZBJBMO.js";var M=T(ge(),1);var ye=6;function re($,S,m,x,E){let t=new Set($),o=new Map;for(let i of S)for(let[h,l,b]of[[i.from,i.to,"out"],[i.to,i.from,"in"]]){if(!t.has(h)||t.has(l))continue;let f=m(l);if(f===void 0)continue;let p=`${h}|${i.kind}|${b}|${f}`,v=o.get(p);v?v.others.includes(l)||v.others.push(l):o.set(p,{self:h,edge:i.kind,direction:b,kind:f,others:[l]})}let d=[];for(let i of o.values()){let h=m(i.self)??"",l=ne(E,i.direction==="out"?h:i.kind,i.edge,i.direction);if(i.others.length>ye){d.push({...i,others:i.others,lands:"district",words:l});continue}let b=[],f=[];for(let p of i.others)(x(p)?b:f).push(p);for(let p of b)d.push({...i,others:[p],lands:"record",words:l});f.length>0&&d.push({...i,others:f,lands:"district",words:l})}return d}function ie($,S=[]){let m=[...S],x=new Map,E=t=>m.some(o=>t.x<o.x+o.width&&o.x<t.x+t.width&&t.y<o.y+o.height&&o.y<t.y+t.height);for(let t of[...$].sort((o,d)=>o.y-d.y||o.x-d.x)){let o={x:t.x-t.width/2,y:t.y-t.height,width:t.width,height:t.height};for(let d=0;d<12&&E(o);d++)o.y+=t.height+2;m.push(o),x.set(t.key,{x:o.x,y:o.y})}return x}var s=T(ee(),1),he=4;function xe({frame:$,width:S,height:m,stageRef:x,tick:E,store:t,graphVersion:o,selection:d,view:i,rulers:{visibleRect:h,clipQuadratic:l,unsureOf:b,unsureDash:f,unsureOpacity:p}}){let v=n=>t.graph.getNode(n)?.kind,C=te(d,i,v),R=C.lens===null&&C.records.length<=he?C.records:[],oe=R.join(`
|
|
2
2
|
`),[y,K]=(0,M.useState)(null);(0,M.useLayoutEffect)(()=>{let n=x.current;if(!i.overview||R.length===0||!n||typeof document>"u"||$.t<1){K(null);return}let w=n.getBoundingClientRect(),B=e=>({x:e.left-w.left,y:e.top-w.top,width:e.width,height:e.height}),D=new Map,se=R.map(e=>`[data-graview-view="${CSS.escape(e)}"]`).join(","),k=null,H=()=>{if(k)return k;k={drawn:new Map,buildings:new Map};for(let e of n.querySelectorAll("[data-graview-pick], [data-graview-view], [data-graview-building]")){let r=e.getAttribute("data-graview-pick"),a=e.getAttribute("data-graview-view");for(let c of r!==null&&r===a?[r]:[r,a]){if(c===null)continue;let u=k.drawn.get(c);u?u.push(e):k.drawn.set(c,[e])}let L=e.getAttribute("data-graview-building");L!==null&&!k.buildings.has(L)&&k.buildings.set(L,e)}return k},P=e=>{if(D.has(e))return D.get(e);let r=null;for(let a of H().drawn.get(e)??[])if(!a.closest("[data-graview-offstage], [data-graview-screen]")&&!(!R.includes(e)&&a.closest(se))&&(r=h(a,n),r))break;if(!r){let a=H().buildings.get(e);a&&(r=B(a.getBoundingClientRect()))}return D.set(e,r),r},W=e=>{let r=n.querySelector(`[data-graview-plot="kind:${CSS.escape(e)}"] .graview-plot-tile`);return r?B(r.getBoundingClientRect()):null},de=re(R,t.graph.allEdges(),v,e=>P(e)!==null,t.schema),z=[];for(let e of n.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')){let r=h(e,n);r&&z.push(r)}let Q=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),O=[],V=new Set(R),I=new Set;for(let e of de){let r=v(e.self),a=P(e.self)??(r?W(r):null),L=e.lands==="record"?P(e.others[0]):W(e.kind);if(!a||!L)continue;for(let g of e.others)V.add(g);I.add(e.kind),r&&I.add(r);let c=Q(a),u=Q(L),A=Math.hypot(u.x-c.x,u.y-c.y);if(A<6)continue;let G=Math.min(40,A*.12)*(O.length%2===0?1:-1),le={x:(c.x+u.x)/2-(u.y-c.y)/A*G,y:(c.y+u.y)/2+(u.x-c.x)/A*G},J=l({p0:c,c:le,p1:u},z);if(J.length===0)continue;let ce=J.map(g=>`M ${g.p0.x.toFixed(1)} ${g.p0.y.toFixed(1)} Q ${g.c.x.toFixed(1)} ${g.c.y.toFixed(1)} ${g.p1.x.toFixed(1)} ${g.p1.y.toFixed(1)}`).join(" "),ue=g=>{let j=t.graph.getNode(g);return j?X(t.schema.tryDefinition(j.kind),j):g},U=e.lands==="record"?`${e.words}: ${ue(e.others[0])}`:`${e.words}: ${Z(t.schema,e.kind,e.others.length)}`,F=e.others[0],_=e.lands==="record"?b?.(e.edge,e.direction==="out"?e.self:F,e.direction==="out"?F:e.self):void 0;O.push({key:`${e.self}|${e.edge}|${e.direction}|${e.lands}|${F}`,link:e,d:ce,end:u,said:_!==void 0?`${U} \xB7 unsure`:U,..._!==void 0?{unsure:_}:{}})}let Y=[];for(let e of n.querySelectorAll(".graview-kind-face[data-graview-nameplate]")){let r=h(e,n);r&&Y.push(r)}let ae=ie(O.map(e=>({key:e.key,x:e.end.x,y:e.end.y-6,width:Math.min(260,14+e.said.length*6.6),height:20})),Y);K({lines:O,labels:ae,reached:[...V],districts:[...I]})},[oe,i.overview,$,o,E,S,m,x,t]);let N=(0,M.useMemo)(()=>{if(!y)return"";let n=y.reached.map(B=>`[data-graview-building="${CSS.escape(B)}"]`).join(","),w=y.districts.map(B=>`[data-graview-plot="kind:${CSS.escape(B)}"]`).join(",");return[".graview-ground[data-graview-altitude] .graview-building { opacity: 0.22; }",n?`.graview-ground[data-graview-altitude] .graview-building:is(${n}) { opacity: 1; }`:"",w?`.graview-ground[data-graview-altitude] .graview-plot:not(:is(${w})) .graview-plot-tile { opacity: 0.4; }`:""].join(`
|
|
3
3
|
`)},[y]);return!y||y.lines.length===0?N?(0,s.jsx)("style",{children:N}):null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:N}),(0,s.jsx)("svg",{className:"graview-record-links","data-graview-world":"","data-graview-record-links":y.lines.length,"aria-hidden":"true",width:S,height:m,style:{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:q.lines},children:y.lines.map(n=>(0,s.jsxs)("g",{className:"graview-record-link","data-graview-link":n.link.edge,"data-graview-lands":n.link.lands,"data-graview-direction":n.link.direction,"data-graview-provisional":n.unsure!==void 0||void 0,children:[(0,s.jsx)("path",{className:"graview-record-link-line",d:n.d,...n.unsure!==void 0?{strokeDasharray:f,strokeOpacity:p}:{}}),n.link.lands==="record"?(0,s.jsx)("circle",{className:"graview-record-link-end",cx:n.end.x,cy:n.end.y,r:3}):null]},n.key))}),(0,s.jsx)("div",{"aria-hidden":"true","data-graview-world":"",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:q.tieLabels},children:y.lines.map(n=>{let w=y.labels.get(n.key);return w?(0,s.jsx)("span",{className:"graview-record-link-said","data-graview-link-said":n.link.edge,"data-graview-lands":n.link.lands,...n.unsure!==void 0?{title:n.unsure}:{},style:{position:"absolute",left:w.x,top:w.y,...n.unsure!==void 0?{pointerEvents:"auto"}:{}},children:n.said},n.key):null})})]})}export{xe as RecordLinks};
|